├── .idea ├── .name ├── FeatureExtraction.iml ├── misc.xml └── modules.xml ├── cmake-build-debug ├── CMakeFiles │ ├── progress.marks │ ├── triangulation.dir │ │ ├── progress.make │ │ ├── cmake_clean.cmake │ │ ├── flags.make │ │ ├── link.txt │ │ ├── DependInfo.cmake │ │ └── build.make │ ├── feature_extraction.dir │ │ ├── progress.make │ │ ├── feature_extraction.cpp.o │ │ ├── cmake_clean.cmake │ │ ├── flags.make │ │ ├── link.txt │ │ ├── DependInfo.cmake │ │ ├── build.make │ │ └── depend.internal │ ├── pose_estimation_2d2d.dir │ │ ├── progress.make │ │ ├── cmake_clean.cmake │ │ ├── flags.make │ │ ├── link.txt │ │ ├── DependInfo.cmake │ │ └── build.make │ ├── pose_estimation_3d2d.dir │ │ ├── progress.make │ │ ├── depend.make │ │ ├── cmake_clean.cmake │ │ ├── flags.make │ │ ├── DependInfo.cmake │ │ ├── link.txt │ │ └── build.make │ ├── pose_estimation_3d3d.dir │ │ ├── progress.make │ │ ├── depend.make │ │ ├── cmake_clean.cmake │ │ ├── flags.make │ │ ├── DependInfo.cmake │ │ ├── link.txt │ │ └── build.make │ ├── clion-environment.txt │ ├── cmake.check_cache │ ├── feature_tests.bin │ ├── 3.7.1 │ │ ├── CompilerIdC │ │ │ ├── a.out │ │ │ └── CMakeCCompilerId.c │ │ ├── CompilerIdCXX │ │ │ ├── a.out │ │ │ └── CMakeCXXCompilerId.cpp │ │ ├── CMakeDetermineCompilerABI_C.bin │ │ ├── CMakeDetermineCompilerABI_CXX.bin │ │ ├── CMakeSystem.cmake │ │ ├── CMakeCCompiler.cmake │ │ └── CMakeCXXCompiler.cmake │ ├── TargetDirectories.txt │ ├── CMakeDirectoryInformation.cmake │ ├── feature_tests.c │ ├── clion-log.txt │ ├── Makefile.cmake │ ├── Makefile2 │ └── feature_tests.cxx ├── feature_extraction ├── cmake_install.cmake └── Makefile ├── 1.png ├── 2.png ├── 1_depth.png ├── 2_depth.png ├── README.md ├── extra.h ├── cmake_modules ├── FindCSparse.cmake └── FindG2O.cmake ├── CMakeLists.txt ├── feature_extraction.cpp ├── pose_estimation_2d2d.cpp ├── extra.cpp ├── triangulation.cpp ├── pose_estimation_3d2d.cpp └── pose_estimation_3d3d.cpp /.idea/.name: -------------------------------------------------------------------------------- 1 | vo1 -------------------------------------------------------------------------------- /cmake-build-debug/CMakeFiles/progress.marks: -------------------------------------------------------------------------------- 1 | 10 2 | -------------------------------------------------------------------------------- /1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jingedawang/FeatureMethod/HEAD/1.png -------------------------------------------------------------------------------- /2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jingedawang/FeatureMethod/HEAD/2.png -------------------------------------------------------------------------------- /1_depth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jingedawang/FeatureMethod/HEAD/1_depth.png -------------------------------------------------------------------------------- /2_depth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jingedawang/FeatureMethod/HEAD/2_depth.png -------------------------------------------------------------------------------- /cmake-build-debug/CMakeFiles/triangulation.dir/progress.make: -------------------------------------------------------------------------------- 1 | CMAKE_PROGRESS_1 = 9 2 | CMAKE_PROGRESS_2 = 10 3 | 4 | -------------------------------------------------------------------------------- /cmake-build-debug/CMakeFiles/feature_extraction.dir/progress.make: -------------------------------------------------------------------------------- 1 | CMAKE_PROGRESS_1 = 1 2 | CMAKE_PROGRESS_2 = 2 3 | 4 | -------------------------------------------------------------------------------- /cmake-build-debug/CMakeFiles/pose_estimation_2d2d.dir/progress.make: -------------------------------------------------------------------------------- 1 | CMAKE_PROGRESS_1 = 3 2 | CMAKE_PROGRESS_2 = 4 3 | 4 | -------------------------------------------------------------------------------- /cmake-build-debug/CMakeFiles/pose_estimation_3d2d.dir/progress.make: -------------------------------------------------------------------------------- 1 | CMAKE_PROGRESS_1 = 5 2 | CMAKE_PROGRESS_2 = 6 3 | 4 | -------------------------------------------------------------------------------- /cmake-build-debug/CMakeFiles/pose_estimation_3d3d.dir/progress.make: -------------------------------------------------------------------------------- 1 | CMAKE_PROGRESS_1 = 7 2 | CMAKE_PROGRESS_2 = 8 3 | 4 | -------------------------------------------------------------------------------- /.idea/FeatureExtraction.iml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cmake-build-debug/feature_extraction: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jingedawang/FeatureMethod/HEAD/cmake-build-debug/feature_extraction -------------------------------------------------------------------------------- /cmake-build-debug/CMakeFiles/clion-environment.txt: -------------------------------------------------------------------------------- 1 | Options: 2 | CMake: 3.7.1@/home/wjg/softwares/clion-2017.1.1/bin/cmake/bin/cmake 3 | -------------------------------------------------------------------------------- /cmake-build-debug/CMakeFiles/cmake.check_cache: -------------------------------------------------------------------------------- 1 | # This file is generated by cmake for dependency checking of the CMakeCache.txt file 2 | -------------------------------------------------------------------------------- /cmake-build-debug/CMakeFiles/feature_tests.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jingedawang/FeatureMethod/HEAD/cmake-build-debug/CMakeFiles/feature_tests.bin -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /cmake-build-debug/CMakeFiles/3.7.1/CompilerIdC/a.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jingedawang/FeatureMethod/HEAD/cmake-build-debug/CMakeFiles/3.7.1/CompilerIdC/a.out -------------------------------------------------------------------------------- /cmake-build-debug/CMakeFiles/3.7.1/CompilerIdCXX/a.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jingedawang/FeatureMethod/HEAD/cmake-build-debug/CMakeFiles/3.7.1/CompilerIdCXX/a.out -------------------------------------------------------------------------------- /cmake-build-debug/CMakeFiles/pose_estimation_3d2d.dir/depend.make: -------------------------------------------------------------------------------- 1 | # Empty dependencies file for pose_estimation_3d2d. 2 | # This may be replaced when dependencies are built. 3 | -------------------------------------------------------------------------------- /cmake-build-debug/CMakeFiles/pose_estimation_3d3d.dir/depend.make: -------------------------------------------------------------------------------- 1 | # Empty dependencies file for pose_estimation_3d3d. 2 | # This may be replaced when dependencies are built. 3 | -------------------------------------------------------------------------------- /cmake-build-debug/CMakeFiles/3.7.1/CMakeDetermineCompilerABI_C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jingedawang/FeatureMethod/HEAD/cmake-build-debug/CMakeFiles/3.7.1/CMakeDetermineCompilerABI_C.bin -------------------------------------------------------------------------------- /cmake-build-debug/CMakeFiles/3.7.1/CMakeDetermineCompilerABI_CXX.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jingedawang/FeatureMethod/HEAD/cmake-build-debug/CMakeFiles/3.7.1/CMakeDetermineCompilerABI_CXX.bin -------------------------------------------------------------------------------- /cmake-build-debug/CMakeFiles/feature_extraction.dir/feature_extraction.cpp.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jingedawang/FeatureMethod/HEAD/cmake-build-debug/CMakeFiles/feature_extraction.dir/feature_extraction.cpp.o -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /cmake-build-debug/CMakeFiles/triangulation.dir/cmake_clean.cmake: -------------------------------------------------------------------------------- 1 | file(REMOVE_RECURSE 2 | "CMakeFiles/triangulation.dir/triangulation.cpp.o" 3 | "triangulation.pdb" 4 | "triangulation" 5 | ) 6 | 7 | # Per-language clean rules from dependency scanning. 8 | foreach(lang CXX) 9 | include(CMakeFiles/triangulation.dir/cmake_clean_${lang}.cmake OPTIONAL) 10 | endforeach() 11 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # FeatureMethod 2 | 3 | 这是一个使用OpenCV实现特征点法的视觉里程计的Demo。 4 | 5 | 相关教程见我的简书 6 | 7 | + [OpenCV提取ORB特征并匹配](http://www.jianshu.com/p/420f8211d1cb) 8 | + [2D-2D相机位姿估计](http://www.jianshu.com/p/fbf56587a268) 9 | + [三角测量](http://www.jianshu.com/p/96d3b832330e) 10 | + [3D-2D相机位姿估计](http://www.jianshu.com/p/f16e5b5cc47d) 11 | + [3D-3D相机位姿估计](http://www.jianshu.com/p/504f0e5d9c26) 12 | -------------------------------------------------------------------------------- /cmake-build-debug/CMakeFiles/feature_extraction.dir/cmake_clean.cmake: -------------------------------------------------------------------------------- 1 | file(REMOVE_RECURSE 2 | "CMakeFiles/feature_extraction.dir/feature_extraction.cpp.o" 3 | "feature_extraction.pdb" 4 | "feature_extraction" 5 | ) 6 | 7 | # Per-language clean rules from dependency scanning. 8 | foreach(lang CXX) 9 | include(CMakeFiles/feature_extraction.dir/cmake_clean_${lang}.cmake OPTIONAL) 10 | endforeach() 11 | -------------------------------------------------------------------------------- /cmake-build-debug/CMakeFiles/triangulation.dir/flags.make: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.7 3 | 4 | # compile CXX with /usr/bin/c++ 5 | CXX_FLAGS = -std=c++11 -O3 -O3 -DNDEBUG 6 | 7 | CXX_DEFINES = 8 | 9 | CXX_INCLUDES = -isystem /usr/local/include -isystem /usr/local/include/opencv -I/usr/include/suitesparse -I/usr/include/eigen3 10 | 11 | -------------------------------------------------------------------------------- /cmake-build-debug/CMakeFiles/feature_extraction.dir/flags.make: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.7 3 | 4 | # compile CXX with /usr/bin/c++ 5 | CXX_FLAGS = -std=c++11 -O3 -O3 -DNDEBUG 6 | 7 | CXX_DEFINES = 8 | 9 | CXX_INCLUDES = -isystem /usr/local/include -isystem /usr/local/include/opencv -I/usr/include/suitesparse -I/usr/include/eigen3 10 | 11 | -------------------------------------------------------------------------------- /cmake-build-debug/CMakeFiles/pose_estimation_2d2d.dir/cmake_clean.cmake: -------------------------------------------------------------------------------- 1 | file(REMOVE_RECURSE 2 | "CMakeFiles/pose_estimation_2d2d.dir/pose_estimation_2d2d.cpp.o" 3 | "pose_estimation_2d2d.pdb" 4 | "pose_estimation_2d2d" 5 | ) 6 | 7 | # Per-language clean rules from dependency scanning. 8 | foreach(lang CXX) 9 | include(CMakeFiles/pose_estimation_2d2d.dir/cmake_clean_${lang}.cmake OPTIONAL) 10 | endforeach() 11 | -------------------------------------------------------------------------------- /cmake-build-debug/CMakeFiles/pose_estimation_3d2d.dir/cmake_clean.cmake: -------------------------------------------------------------------------------- 1 | file(REMOVE_RECURSE 2 | "CMakeFiles/pose_estimation_3d2d.dir/pose_estimation_3d2d.cpp.o" 3 | "pose_estimation_3d2d.pdb" 4 | "pose_estimation_3d2d" 5 | ) 6 | 7 | # Per-language clean rules from dependency scanning. 8 | foreach(lang CXX) 9 | include(CMakeFiles/pose_estimation_3d2d.dir/cmake_clean_${lang}.cmake OPTIONAL) 10 | endforeach() 11 | -------------------------------------------------------------------------------- /cmake-build-debug/CMakeFiles/pose_estimation_3d3d.dir/cmake_clean.cmake: -------------------------------------------------------------------------------- 1 | file(REMOVE_RECURSE 2 | "CMakeFiles/pose_estimation_3d3d.dir/pose_estimation_3d3d.cpp.o" 3 | "pose_estimation_3d3d.pdb" 4 | "pose_estimation_3d3d" 5 | ) 6 | 7 | # Per-language clean rules from dependency scanning. 8 | foreach(lang CXX) 9 | include(CMakeFiles/pose_estimation_3d3d.dir/cmake_clean_${lang}.cmake OPTIONAL) 10 | endforeach() 11 | -------------------------------------------------------------------------------- /cmake-build-debug/CMakeFiles/pose_estimation_2d2d.dir/flags.make: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.7 3 | 4 | # compile CXX with /usr/bin/c++ 5 | CXX_FLAGS = -std=c++11 -O3 -O3 -DNDEBUG 6 | 7 | CXX_DEFINES = 8 | 9 | CXX_INCLUDES = -isystem /usr/local/include -isystem /usr/local/include/opencv -I/usr/include/suitesparse -I/usr/include/eigen3 10 | 11 | -------------------------------------------------------------------------------- /cmake-build-debug/CMakeFiles/pose_estimation_3d2d.dir/flags.make: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.7 3 | 4 | # compile CXX with /usr/bin/c++ 5 | CXX_FLAGS = -std=c++11 -O3 -O3 -DNDEBUG 6 | 7 | CXX_DEFINES = 8 | 9 | CXX_INCLUDES = -isystem /usr/local/include -isystem /usr/local/include/opencv -I/usr/include/suitesparse -I/usr/include/eigen3 10 | 11 | -------------------------------------------------------------------------------- /cmake-build-debug/CMakeFiles/pose_estimation_3d3d.dir/flags.make: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.7 3 | 4 | # compile CXX with /usr/bin/c++ 5 | CXX_FLAGS = -std=c++11 -O3 -O3 -DNDEBUG 6 | 7 | CXX_DEFINES = 8 | 9 | CXX_INCLUDES = -isystem /usr/local/include -isystem /usr/local/include/opencv -I/usr/include/suitesparse -I/usr/include/eigen3 10 | 11 | -------------------------------------------------------------------------------- /cmake-build-debug/CMakeFiles/3.7.1/CMakeSystem.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_HOST_SYSTEM "Linux-4.9.0-deepin4-amd64") 2 | set(CMAKE_HOST_SYSTEM_NAME "Linux") 3 | set(CMAKE_HOST_SYSTEM_VERSION "4.9.0-deepin4-amd64") 4 | set(CMAKE_HOST_SYSTEM_PROCESSOR "x86_64") 5 | 6 | 7 | 8 | set(CMAKE_SYSTEM "Linux-4.9.0-deepin4-amd64") 9 | set(CMAKE_SYSTEM_NAME "Linux") 10 | set(CMAKE_SYSTEM_VERSION "4.9.0-deepin4-amd64") 11 | set(CMAKE_SYSTEM_PROCESSOR "x86_64") 12 | 13 | set(CMAKE_CROSSCOMPILING "FALSE") 14 | 15 | set(CMAKE_SYSTEM_LOADED 1) 16 | -------------------------------------------------------------------------------- /cmake-build-debug/CMakeFiles/TargetDirectories.txt: -------------------------------------------------------------------------------- 1 | /home/wjg/projects/FeatureMethod/cmake-build-debug/CMakeFiles/rebuild_cache.dir 2 | /home/wjg/projects/FeatureMethod/cmake-build-debug/CMakeFiles/edit_cache.dir 3 | /home/wjg/projects/FeatureMethod/cmake-build-debug/CMakeFiles/pose_estimation_3d3d.dir 4 | /home/wjg/projects/FeatureMethod/cmake-build-debug/CMakeFiles/pose_estimation_3d2d.dir 5 | /home/wjg/projects/FeatureMethod/cmake-build-debug/CMakeFiles/pose_estimation_2d2d.dir 6 | /home/wjg/projects/FeatureMethod/cmake-build-debug/CMakeFiles/triangulation.dir 7 | /home/wjg/projects/FeatureMethod/cmake-build-debug/CMakeFiles/feature_extraction.dir 8 | -------------------------------------------------------------------------------- /extra.h: -------------------------------------------------------------------------------- 1 | #ifndef _EXTRA_H_ 2 | #define _EXTRA_H_ 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | 9 | using namespace cv; 10 | 11 | void decomposeEssentialMat( InputArray _E, OutputArray _R1, OutputArray _R2, OutputArray _t ); 12 | 13 | int recoverPose( InputArray E, InputArray _points1, InputArray _points2, OutputArray _R, 14 | OutputArray _t, double focal, Point2d pp=Point2d(0, 0), InputOutputArray _mask=noArray()); 15 | 16 | cv::Mat findEssentialMat( InputArray _points1, InputArray _points2, double focal, Point2d pp); 17 | 18 | #endif -------------------------------------------------------------------------------- /cmake_modules/FindCSparse.cmake: -------------------------------------------------------------------------------- 1 | # Look for csparse; note the difference in the directory specifications! 2 | FIND_PATH(CSPARSE_INCLUDE_DIR NAMES cs.h 3 | PATHS 4 | /usr/include/suitesparse 5 | /usr/include 6 | /opt/local/include 7 | /usr/local/include 8 | /sw/include 9 | /usr/include/ufsparse 10 | /opt/local/include/ufsparse 11 | /usr/local/include/ufsparse 12 | /sw/include/ufsparse 13 | ) 14 | 15 | FIND_LIBRARY(CSPARSE_LIBRARY NAMES cxsparse 16 | PATHS 17 | /usr/lib 18 | /usr/local/lib 19 | /opt/local/lib 20 | /sw/lib 21 | ) 22 | 23 | include(FindPackageHandleStandardArgs) 24 | find_package_handle_standard_args(CSPARSE DEFAULT_MSG 25 | CSPARSE_INCLUDE_DIR CSPARSE_LIBRARY) 26 | -------------------------------------------------------------------------------- /cmake-build-debug/CMakeFiles/CMakeDirectoryInformation.cmake: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.7 3 | 4 | # Relative path conversion top directories. 5 | set(CMAKE_RELATIVE_PATH_TOP_SOURCE "/home/wjg/projects/FeatureMethod") 6 | set(CMAKE_RELATIVE_PATH_TOP_BINARY "/home/wjg/projects/FeatureMethod/cmake-build-debug") 7 | 8 | # Force unix paths in dependencies. 9 | set(CMAKE_FORCE_UNIX_PATHS 1) 10 | 11 | 12 | # The C and CXX include file regular expressions for this directory. 13 | set(CMAKE_C_INCLUDE_REGEX_SCAN "^.*$") 14 | set(CMAKE_C_INCLUDE_REGEX_COMPLAIN "^$") 15 | set(CMAKE_CXX_INCLUDE_REGEX_SCAN ${CMAKE_C_INCLUDE_REGEX_SCAN}) 16 | set(CMAKE_CXX_INCLUDE_REGEX_COMPLAIN ${CMAKE_C_INCLUDE_REGEX_COMPLAIN}) 17 | -------------------------------------------------------------------------------- /cmake-build-debug/CMakeFiles/triangulation.dir/link.txt: -------------------------------------------------------------------------------- 1 | /usr/bin/c++ -std=c++11 -O3 -O3 -DNDEBUG CMakeFiles/triangulation.dir/triangulation.cpp.o -o triangulation -Wl,-rpath,/usr/local/lib -rdynamic /usr/local/lib/libopencv_shape.so.3.2.0 /usr/local/lib/libopencv_stitching.so.3.2.0 /usr/local/lib/libopencv_superres.so.3.2.0 /usr/local/lib/libopencv_videostab.so.3.2.0 /usr/local/lib/libopencv_objdetect.so.3.2.0 /usr/local/lib/libopencv_calib3d.so.3.2.0 /usr/local/lib/libopencv_features2d.so.3.2.0 /usr/local/lib/libopencv_flann.so.3.2.0 /usr/local/lib/libopencv_highgui.so.3.2.0 /usr/local/lib/libopencv_ml.so.3.2.0 /usr/local/lib/libopencv_photo.so.3.2.0 /usr/local/lib/libopencv_video.so.3.2.0 /usr/local/lib/libopencv_videoio.so.3.2.0 /usr/local/lib/libopencv_imgcodecs.so.3.2.0 /usr/local/lib/libopencv_imgproc.so.3.2.0 /usr/local/lib/libopencv_core.so.3.2.0 2 | -------------------------------------------------------------------------------- /cmake-build-debug/CMakeFiles/feature_extraction.dir/link.txt: -------------------------------------------------------------------------------- 1 | /usr/bin/c++ -std=c++11 -O3 -O3 -DNDEBUG CMakeFiles/feature_extraction.dir/feature_extraction.cpp.o -o feature_extraction -Wl,-rpath,/usr/local/lib -rdynamic /usr/local/lib/libopencv_shape.so.3.2.0 /usr/local/lib/libopencv_stitching.so.3.2.0 /usr/local/lib/libopencv_superres.so.3.2.0 /usr/local/lib/libopencv_videostab.so.3.2.0 /usr/local/lib/libopencv_objdetect.so.3.2.0 /usr/local/lib/libopencv_calib3d.so.3.2.0 /usr/local/lib/libopencv_features2d.so.3.2.0 /usr/local/lib/libopencv_flann.so.3.2.0 /usr/local/lib/libopencv_highgui.so.3.2.0 /usr/local/lib/libopencv_ml.so.3.2.0 /usr/local/lib/libopencv_photo.so.3.2.0 /usr/local/lib/libopencv_video.so.3.2.0 /usr/local/lib/libopencv_videoio.so.3.2.0 /usr/local/lib/libopencv_imgcodecs.so.3.2.0 /usr/local/lib/libopencv_imgproc.so.3.2.0 /usr/local/lib/libopencv_core.so.3.2.0 2 | -------------------------------------------------------------------------------- /cmake-build-debug/CMakeFiles/feature_tests.c: -------------------------------------------------------------------------------- 1 | 2 | const char features[] = {"\n" 3 | "C_FEATURE:" 4 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 5 | "1" 6 | #else 7 | "0" 8 | #endif 9 | "c_function_prototypes\n" 10 | "C_FEATURE:" 11 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L 12 | "1" 13 | #else 14 | "0" 15 | #endif 16 | "c_restrict\n" 17 | "C_FEATURE:" 18 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 406 && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201000L 19 | "1" 20 | #else 21 | "0" 22 | #endif 23 | "c_static_assert\n" 24 | "C_FEATURE:" 25 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L 26 | "1" 27 | #else 28 | "0" 29 | #endif 30 | "c_variadic_macros\n" 31 | 32 | }; 33 | 34 | int main(int argc, char** argv) { (void)argv; return features[argc]; } 35 | -------------------------------------------------------------------------------- /cmake-build-debug/CMakeFiles/pose_estimation_2d2d.dir/link.txt: -------------------------------------------------------------------------------- 1 | /usr/bin/c++ -std=c++11 -O3 -O3 -DNDEBUG CMakeFiles/pose_estimation_2d2d.dir/pose_estimation_2d2d.cpp.o -o pose_estimation_2d2d -Wl,-rpath,/usr/local/lib -rdynamic /usr/local/lib/libopencv_shape.so.3.2.0 /usr/local/lib/libopencv_stitching.so.3.2.0 /usr/local/lib/libopencv_superres.so.3.2.0 /usr/local/lib/libopencv_videostab.so.3.2.0 /usr/local/lib/libopencv_objdetect.so.3.2.0 /usr/local/lib/libopencv_calib3d.so.3.2.0 /usr/local/lib/libopencv_features2d.so.3.2.0 /usr/local/lib/libopencv_flann.so.3.2.0 /usr/local/lib/libopencv_highgui.so.3.2.0 /usr/local/lib/libopencv_ml.so.3.2.0 /usr/local/lib/libopencv_photo.so.3.2.0 /usr/local/lib/libopencv_video.so.3.2.0 /usr/local/lib/libopencv_videoio.so.3.2.0 /usr/local/lib/libopencv_imgcodecs.so.3.2.0 /usr/local/lib/libopencv_imgproc.so.3.2.0 /usr/local/lib/libopencv_core.so.3.2.0 2 | -------------------------------------------------------------------------------- /cmake-build-debug/CMakeFiles/triangulation.dir/DependInfo.cmake: -------------------------------------------------------------------------------- 1 | # The set of languages for which implicit dependencies are needed: 2 | set(CMAKE_DEPENDS_LANGUAGES 3 | "CXX" 4 | ) 5 | # The set of files for implicit dependencies of each language: 6 | set(CMAKE_DEPENDS_CHECK_CXX 7 | "/home/wjg/projects/FeatureMethod/triangulation.cpp" "/home/wjg/projects/FeatureMethod/cmake-build-debug/CMakeFiles/triangulation.dir/triangulation.cpp.o" 8 | ) 9 | set(CMAKE_CXX_COMPILER_ID "GNU") 10 | 11 | # The include file search paths: 12 | set(CMAKE_CXX_TARGET_INCLUDE_PATH 13 | "/usr/local/include" 14 | "/usr/local/include/opencv" 15 | "/usr/include/suitesparse" 16 | "/usr/include/eigen3" 17 | ) 18 | 19 | # Targets to which this target links. 20 | set(CMAKE_TARGET_LINKED_INFO_FILES 21 | ) 22 | 23 | # Fortran module output directory. 24 | set(CMAKE_Fortran_TARGET_MODULE_DIR "") 25 | -------------------------------------------------------------------------------- /cmake-build-debug/CMakeFiles/feature_extraction.dir/DependInfo.cmake: -------------------------------------------------------------------------------- 1 | # The set of languages for which implicit dependencies are needed: 2 | set(CMAKE_DEPENDS_LANGUAGES 3 | "CXX" 4 | ) 5 | # The set of files for implicit dependencies of each language: 6 | set(CMAKE_DEPENDS_CHECK_CXX 7 | "/home/wjg/projects/FeatureMethod/feature_extraction.cpp" "/home/wjg/projects/FeatureMethod/cmake-build-debug/CMakeFiles/feature_extraction.dir/feature_extraction.cpp.o" 8 | ) 9 | set(CMAKE_CXX_COMPILER_ID "GNU") 10 | 11 | # The include file search paths: 12 | set(CMAKE_CXX_TARGET_INCLUDE_PATH 13 | "/usr/local/include" 14 | "/usr/local/include/opencv" 15 | "/usr/include/suitesparse" 16 | "/usr/include/eigen3" 17 | ) 18 | 19 | # Targets to which this target links. 20 | set(CMAKE_TARGET_LINKED_INFO_FILES 21 | ) 22 | 23 | # Fortran module output directory. 24 | set(CMAKE_Fortran_TARGET_MODULE_DIR "") 25 | -------------------------------------------------------------------------------- /cmake-build-debug/CMakeFiles/pose_estimation_2d2d.dir/DependInfo.cmake: -------------------------------------------------------------------------------- 1 | # The set of languages for which implicit dependencies are needed: 2 | set(CMAKE_DEPENDS_LANGUAGES 3 | "CXX" 4 | ) 5 | # The set of files for implicit dependencies of each language: 6 | set(CMAKE_DEPENDS_CHECK_CXX 7 | "/home/wjg/projects/FeatureMethod/pose_estimation_2d2d.cpp" "/home/wjg/projects/FeatureMethod/cmake-build-debug/CMakeFiles/pose_estimation_2d2d.dir/pose_estimation_2d2d.cpp.o" 8 | ) 9 | set(CMAKE_CXX_COMPILER_ID "GNU") 10 | 11 | # The include file search paths: 12 | set(CMAKE_CXX_TARGET_INCLUDE_PATH 13 | "/usr/local/include" 14 | "/usr/local/include/opencv" 15 | "/usr/include/suitesparse" 16 | "/usr/include/eigen3" 17 | ) 18 | 19 | # Targets to which this target links. 20 | set(CMAKE_TARGET_LINKED_INFO_FILES 21 | ) 22 | 23 | # Fortran module output directory. 24 | set(CMAKE_Fortran_TARGET_MODULE_DIR "") 25 | -------------------------------------------------------------------------------- /cmake-build-debug/CMakeFiles/pose_estimation_3d2d.dir/DependInfo.cmake: -------------------------------------------------------------------------------- 1 | # The set of languages for which implicit dependencies are needed: 2 | set(CMAKE_DEPENDS_LANGUAGES 3 | "CXX" 4 | ) 5 | # The set of files for implicit dependencies of each language: 6 | set(CMAKE_DEPENDS_CHECK_CXX 7 | "/home/wjg/projects/FeatureMethod/pose_estimation_3d2d.cpp" "/home/wjg/projects/FeatureMethod/cmake-build-debug/CMakeFiles/pose_estimation_3d2d.dir/pose_estimation_3d2d.cpp.o" 8 | ) 9 | set(CMAKE_CXX_COMPILER_ID "GNU") 10 | 11 | # The include file search paths: 12 | set(CMAKE_CXX_TARGET_INCLUDE_PATH 13 | "/usr/local/include" 14 | "/usr/local/include/opencv" 15 | "/usr/include/suitesparse" 16 | "/usr/include/eigen3" 17 | ) 18 | 19 | # Targets to which this target links. 20 | set(CMAKE_TARGET_LINKED_INFO_FILES 21 | ) 22 | 23 | # Fortran module output directory. 24 | set(CMAKE_Fortran_TARGET_MODULE_DIR "") 25 | -------------------------------------------------------------------------------- /cmake-build-debug/CMakeFiles/pose_estimation_3d3d.dir/DependInfo.cmake: -------------------------------------------------------------------------------- 1 | # The set of languages for which implicit dependencies are needed: 2 | set(CMAKE_DEPENDS_LANGUAGES 3 | "CXX" 4 | ) 5 | # The set of files for implicit dependencies of each language: 6 | set(CMAKE_DEPENDS_CHECK_CXX 7 | "/home/wjg/projects/FeatureMethod/pose_estimation_3d3d.cpp" "/home/wjg/projects/FeatureMethod/cmake-build-debug/CMakeFiles/pose_estimation_3d3d.dir/pose_estimation_3d3d.cpp.o" 8 | ) 9 | set(CMAKE_CXX_COMPILER_ID "GNU") 10 | 11 | # The include file search paths: 12 | set(CMAKE_CXX_TARGET_INCLUDE_PATH 13 | "/usr/local/include" 14 | "/usr/local/include/opencv" 15 | "/usr/include/suitesparse" 16 | "/usr/include/eigen3" 17 | ) 18 | 19 | # Targets to which this target links. 20 | set(CMAKE_TARGET_LINKED_INFO_FILES 21 | ) 22 | 23 | # Fortran module output directory. 24 | set(CMAKE_Fortran_TARGET_MODULE_DIR "") 25 | -------------------------------------------------------------------------------- /cmake-build-debug/CMakeFiles/pose_estimation_3d2d.dir/link.txt: -------------------------------------------------------------------------------- 1 | /usr/bin/c++ -std=c++11 -O3 -O3 -DNDEBUG CMakeFiles/pose_estimation_3d2d.dir/pose_estimation_3d2d.cpp.o -o pose_estimation_3d2d -Wl,-rpath,/usr/local/lib -rdynamic /usr/local/lib/libopencv_shape.so.3.2.0 /usr/local/lib/libopencv_stitching.so.3.2.0 /usr/local/lib/libopencv_superres.so.3.2.0 /usr/local/lib/libopencv_videostab.so.3.2.0 -lcxsparse -lg2o_core -lg2o_stuff -lg2o_types_sba -lg2o_csparse_extension /usr/local/lib/libopencv_objdetect.so.3.2.0 /usr/local/lib/libopencv_calib3d.so.3.2.0 /usr/local/lib/libopencv_features2d.so.3.2.0 /usr/local/lib/libopencv_flann.so.3.2.0 /usr/local/lib/libopencv_highgui.so.3.2.0 /usr/local/lib/libopencv_ml.so.3.2.0 /usr/local/lib/libopencv_photo.so.3.2.0 /usr/local/lib/libopencv_video.so.3.2.0 /usr/local/lib/libopencv_videoio.so.3.2.0 /usr/local/lib/libopencv_imgcodecs.so.3.2.0 /usr/local/lib/libopencv_imgproc.so.3.2.0 /usr/local/lib/libopencv_core.so.3.2.0 2 | -------------------------------------------------------------------------------- /cmake-build-debug/CMakeFiles/pose_estimation_3d3d.dir/link.txt: -------------------------------------------------------------------------------- 1 | /usr/bin/c++ -std=c++11 -O3 -O3 -DNDEBUG CMakeFiles/pose_estimation_3d3d.dir/pose_estimation_3d3d.cpp.o -o pose_estimation_3d3d -Wl,-rpath,/usr/local/lib -rdynamic /usr/local/lib/libopencv_shape.so.3.2.0 /usr/local/lib/libopencv_stitching.so.3.2.0 /usr/local/lib/libopencv_superres.so.3.2.0 /usr/local/lib/libopencv_videostab.so.3.2.0 -lg2o_core -lg2o_stuff -lg2o_types_sba -lg2o_csparse_extension -lcxsparse /usr/local/lib/libopencv_objdetect.so.3.2.0 /usr/local/lib/libopencv_calib3d.so.3.2.0 /usr/local/lib/libopencv_features2d.so.3.2.0 /usr/local/lib/libopencv_flann.so.3.2.0 /usr/local/lib/libopencv_highgui.so.3.2.0 /usr/local/lib/libopencv_ml.so.3.2.0 /usr/local/lib/libopencv_photo.so.3.2.0 /usr/local/lib/libopencv_video.so.3.2.0 /usr/local/lib/libopencv_videoio.so.3.2.0 /usr/local/lib/libopencv_imgcodecs.so.3.2.0 /usr/local/lib/libopencv_imgproc.so.3.2.0 /usr/local/lib/libopencv_core.so.3.2.0 2 | -------------------------------------------------------------------------------- /cmake-build-debug/CMakeFiles/clion-log.txt: -------------------------------------------------------------------------------- 1 | /home/wjg/softwares/clion-2017.1.1/bin/cmake/bin/cmake -DCMAKE_BUILD_TYPE=Debug -G "CodeBlocks - Unix Makefiles" /home/wjg/projects/FeatureMethod 2 | -- The C compiler identification is GNU 5.4.1 3 | -- The CXX compiler identification is GNU 5.4.1 4 | -- Check for working C compiler: /usr/bin/cc 5 | -- Check for working C compiler: /usr/bin/cc -- works 6 | -- Detecting C compiler ABI info 7 | -- Detecting C compiler ABI info - done 8 | -- Detecting C compile features 9 | -- Detecting C compile features - done 10 | -- Check for working CXX compiler: /usr/bin/c++ 11 | -- Check for working CXX compiler: /usr/bin/c++ -- works 12 | -- Detecting CXX compiler ABI info 13 | -- Detecting CXX compiler ABI info - done 14 | -- Detecting CXX compile features 15 | -- Detecting CXX compile features - done 16 | -- Found OpenCV: /usr/local (found suitable version "3.2.0", minimum required is "3.1") 17 | -- Found CSPARSE: /usr/include/suitesparse 18 | -- Configuring done 19 | -- Generating done 20 | -- Build files have been written to: /home/wjg/projects/FeatureMethod/cmake-build-debug 21 | -------------------------------------------------------------------------------- /cmake-build-debug/cmake_install.cmake: -------------------------------------------------------------------------------- 1 | # Install script for directory: /home/wjg/projects/FeatureMethod 2 | 3 | # Set the install prefix 4 | if(NOT DEFINED CMAKE_INSTALL_PREFIX) 5 | set(CMAKE_INSTALL_PREFIX "/usr/local") 6 | endif() 7 | string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") 8 | 9 | # Set the install configuration name. 10 | if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME) 11 | if(BUILD_TYPE) 12 | string(REGEX REPLACE "^[^A-Za-z0-9_]+" "" 13 | CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}") 14 | else() 15 | set(CMAKE_INSTALL_CONFIG_NAME "Release") 16 | endif() 17 | message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"") 18 | endif() 19 | 20 | # Set the component getting installed. 21 | if(NOT CMAKE_INSTALL_COMPONENT) 22 | if(COMPONENT) 23 | message(STATUS "Install component: \"${COMPONENT}\"") 24 | set(CMAKE_INSTALL_COMPONENT "${COMPONENT}") 25 | else() 26 | set(CMAKE_INSTALL_COMPONENT) 27 | endif() 28 | endif() 29 | 30 | # Install shared libraries without execute permission? 31 | if(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE) 32 | set(CMAKE_INSTALL_SO_NO_EXE "1") 33 | endif() 34 | 35 | if(CMAKE_INSTALL_COMPONENT) 36 | set(CMAKE_INSTALL_MANIFEST "install_manifest_${CMAKE_INSTALL_COMPONENT}.txt") 37 | else() 38 | set(CMAKE_INSTALL_MANIFEST "install_manifest.txt") 39 | endif() 40 | 41 | string(REPLACE ";" "\n" CMAKE_INSTALL_MANIFEST_CONTENT 42 | "${CMAKE_INSTALL_MANIFEST_FILES}") 43 | file(WRITE "/home/wjg/projects/FeatureMethod/cmake-build-debug/${CMAKE_INSTALL_MANIFEST}" 44 | "${CMAKE_INSTALL_MANIFEST_CONTENT}") 45 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required( VERSION 2.8 ) 2 | project( vo1 ) 3 | 4 | set( CMAKE_BUILD_TYPE "Release" ) 5 | set( CMAKE_CXX_FLAGS "-std=c++11 -O3" ) 6 | 7 | # 添加cmake模块以使用g2o 8 | list( APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake_modules ) 9 | 10 | find_package( OpenCV 3.1 REQUIRED ) 11 | # find_package( OpenCV REQUIRED ) # use this if in OpenCV2 12 | find_package( G2O REQUIRED ) 13 | find_package( CSparse REQUIRED ) 14 | 15 | include_directories( 16 | ${OpenCV_INCLUDE_DIRS} 17 | ${G2O_INCLUDE_DIRS} 18 | ${CSPARSE_INCLUDE_DIR} 19 | "/usr/include/eigen3/" 20 | ) 21 | 22 | add_executable( feature_extraction feature_extraction.cpp ) 23 | target_link_libraries( feature_extraction ${OpenCV_LIBS} ) 24 | 25 | # add_executable( pose_estimation_2d2d pose_estimation_2d2d.cpp extra.cpp ) # use this if in OpenCV2 26 | add_executable( pose_estimation_2d2d pose_estimation_2d2d.cpp ) 27 | target_link_libraries( pose_estimation_2d2d ${OpenCV_LIBS} ) 28 | 29 | # add_executable( triangulation triangulation.cpp extra.cpp) # use this if in opencv2 30 | add_executable( triangulation triangulation.cpp ) 31 | target_link_libraries( triangulation ${OpenCV_LIBS} ) 32 | 33 | add_executable( pose_estimation_3d2d pose_estimation_3d2d.cpp ) 34 | target_link_libraries( pose_estimation_3d2d 35 | ${OpenCV_LIBS} 36 | ${CSPARSE_LIBRARY} 37 | g2o_core g2o_stuff g2o_types_sba g2o_csparse_extension 38 | ) 39 | 40 | add_executable( pose_estimation_3d3d pose_estimation_3d3d.cpp ) 41 | target_link_libraries( pose_estimation_3d3d 42 | ${OpenCV_LIBS} 43 | g2o_core g2o_stuff g2o_types_sba g2o_csparse_extension 44 | ${CSPARSE_LIBRARY} 45 | ) 46 | -------------------------------------------------------------------------------- /cmake-build-debug/CMakeFiles/3.7.1/CMakeCCompiler.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_C_COMPILER "/usr/bin/cc") 2 | set(CMAKE_C_COMPILER_ARG1 "") 3 | set(CMAKE_C_COMPILER_ID "GNU") 4 | set(CMAKE_C_COMPILER_VERSION "5.4.1") 5 | set(CMAKE_C_COMPILER_WRAPPER "") 6 | set(CMAKE_C_STANDARD_COMPUTED_DEFAULT "11") 7 | set(CMAKE_C_COMPILE_FEATURES "c_function_prototypes;c_restrict;c_variadic_macros;c_static_assert") 8 | set(CMAKE_C90_COMPILE_FEATURES "c_function_prototypes") 9 | set(CMAKE_C99_COMPILE_FEATURES "c_restrict;c_variadic_macros") 10 | set(CMAKE_C11_COMPILE_FEATURES "c_static_assert") 11 | 12 | set(CMAKE_C_PLATFORM_ID "Linux") 13 | set(CMAKE_C_SIMULATE_ID "") 14 | set(CMAKE_C_SIMULATE_VERSION "") 15 | 16 | set(CMAKE_AR "/usr/bin/ar") 17 | set(CMAKE_RANLIB "/usr/bin/ranlib") 18 | set(CMAKE_LINKER "/usr/bin/ld") 19 | set(CMAKE_COMPILER_IS_GNUCC 1) 20 | set(CMAKE_C_COMPILER_LOADED 1) 21 | set(CMAKE_C_COMPILER_WORKS TRUE) 22 | set(CMAKE_C_ABI_COMPILED TRUE) 23 | set(CMAKE_COMPILER_IS_MINGW ) 24 | set(CMAKE_COMPILER_IS_CYGWIN ) 25 | if(CMAKE_COMPILER_IS_CYGWIN) 26 | set(CYGWIN 1) 27 | set(UNIX 1) 28 | endif() 29 | 30 | set(CMAKE_C_COMPILER_ENV_VAR "CC") 31 | 32 | if(CMAKE_COMPILER_IS_MINGW) 33 | set(MINGW 1) 34 | endif() 35 | set(CMAKE_C_COMPILER_ID_RUN 1) 36 | set(CMAKE_C_SOURCE_FILE_EXTENSIONS c;m) 37 | set(CMAKE_C_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC) 38 | set(CMAKE_C_LINKER_PREFERENCE 10) 39 | 40 | # Save compiler ABI information. 41 | set(CMAKE_C_SIZEOF_DATA_PTR "8") 42 | set(CMAKE_C_COMPILER_ABI "ELF") 43 | set(CMAKE_C_LIBRARY_ARCHITECTURE "x86_64-linux-gnu") 44 | 45 | if(CMAKE_C_SIZEOF_DATA_PTR) 46 | set(CMAKE_SIZEOF_VOID_P "${CMAKE_C_SIZEOF_DATA_PTR}") 47 | endif() 48 | 49 | if(CMAKE_C_COMPILER_ABI) 50 | set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_C_COMPILER_ABI}") 51 | endif() 52 | 53 | if(CMAKE_C_LIBRARY_ARCHITECTURE) 54 | set(CMAKE_LIBRARY_ARCHITECTURE "x86_64-linux-gnu") 55 | endif() 56 | 57 | set(CMAKE_C_CL_SHOWINCLUDES_PREFIX "") 58 | if(CMAKE_C_CL_SHOWINCLUDES_PREFIX) 59 | set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_C_CL_SHOWINCLUDES_PREFIX}") 60 | endif() 61 | 62 | 63 | 64 | 65 | 66 | set(CMAKE_C_IMPLICIT_LINK_LIBRARIES "c") 67 | set(CMAKE_C_IMPLICIT_LINK_DIRECTORIES "/usr/lib/gcc/x86_64-linux-gnu/5;/usr/lib/x86_64-linux-gnu;/usr/lib;/lib/x86_64-linux-gnu;/lib") 68 | set(CMAKE_C_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "") 69 | -------------------------------------------------------------------------------- /feature_extraction.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | using namespace std; 7 | using namespace cv; 8 | 9 | int main ( int argc, char** argv ) 10 | { 11 | if ( argc != 3 ) 12 | { 13 | cout<<"usage: feature_extraction img1 img2"< keypoints_1, keypoints_2; 22 | Mat descriptors_1, descriptors_2; 23 | Ptr detector = ORB::create(); 24 | Ptr descriptor = ORB::create(); 25 | // Ptr detector = FeatureDetector::create(detector_name); 26 | // Ptr descriptor = DescriptorExtractor::create(descriptor_name); 27 | Ptr matcher = DescriptorMatcher::create ( "BruteForce-Hamming" ); 28 | 29 | //-- 第一步:检测 Oriented FAST 角点位置 30 | detector->detect ( img_1,keypoints_1 ); 31 | detector->detect ( img_2,keypoints_2 ); 32 | 33 | //-- 第二步:根据角点位置计算 BRIEF 描述子 34 | descriptor->compute ( img_1, keypoints_1, descriptors_1 ); 35 | descriptor->compute ( img_2, keypoints_2, descriptors_2 ); 36 | 37 | Mat outimg1; 38 | drawKeypoints( img_1, keypoints_1, outimg1, Scalar::all(-1), DrawMatchesFlags::DEFAULT ); 39 | imshow("ORB特征点",outimg1); 40 | 41 | //-- 第三步:对两幅图像中的BRIEF描述子进行匹配,使用 Hamming 距离 42 | vector matches; 43 | //BFMatcher matcher ( NORM_HAMMING ); 44 | matcher->match ( descriptors_1, descriptors_2, matches ); 45 | 46 | //-- 第四步:匹配点对筛选 47 | double min_dist=10000, max_dist=0; 48 | 49 | //找出所有匹配之间的最小距离和最大距离, 即是最相似的和最不相似的两组点之间的距离 50 | for ( int i = 0; i < descriptors_1.rows; i++ ) 51 | { 52 | double dist = matches[i].distance; 53 | if ( dist < min_dist ) min_dist = dist; 54 | if ( dist > max_dist ) max_dist = dist; 55 | } 56 | 57 | // 仅供娱乐的写法 58 | min_dist = min_element( matches.begin(), matches.end(), [](const DMatch& m1, const DMatch& m2) {return m1.distancedistance; 59 | max_dist = max_element( matches.begin(), matches.end(), [](const DMatch& m1, const DMatch& m2) {return m1.distancedistance; 60 | 61 | printf ( "-- Max dist : %f \n", max_dist ); 62 | printf ( "-- Min dist : %f \n", min_dist ); 63 | 64 | //当描述子之间的距离大于两倍的最小距离时,即认为匹配有误.但有时候最小距离会非常小,设置一个经验值30作为下限. 65 | std::vector< DMatch > good_matches; 66 | for ( int i = 0; i < descriptors_1.rows; i++ ) 67 | { 68 | if ( matches[i].distance <= max ( 2*min_dist, 30.0 ) ) 69 | { 70 | good_matches.push_back ( matches[i] ); 71 | } 72 | } 73 | 74 | //-- 第五步:绘制匹配结果 75 | Mat img_match; 76 | Mat img_goodmatch; 77 | drawMatches ( img_1, keypoints_1, img_2, keypoints_2, matches, img_match ); 78 | drawMatches ( img_1, keypoints_1, img_2, keypoints_2, good_matches, img_goodmatch ); 79 | imshow ( "所有匹配点对", img_match ); 80 | imshow ( "优化后匹配点对", img_goodmatch ); 81 | waitKey(0); 82 | 83 | return 0; 84 | } 85 | -------------------------------------------------------------------------------- /cmake_modules/FindG2O.cmake: -------------------------------------------------------------------------------- 1 | # Find the header files 2 | 3 | FIND_PATH(G2O_INCLUDE_DIR g2o/core/base_vertex.h 4 | ${G2O_ROOT}/include 5 | $ENV{G2O_ROOT}/include 6 | $ENV{G2O_ROOT} 7 | /usr/local/include 8 | /usr/include 9 | /opt/local/include 10 | /sw/local/include 11 | /sw/include 12 | NO_DEFAULT_PATH 13 | ) 14 | 15 | # Macro to unify finding both the debug and release versions of the 16 | # libraries; this is adapted from the OpenSceneGraph FIND_LIBRARY 17 | # macro. 18 | 19 | MACRO(FIND_G2O_LIBRARY MYLIBRARY MYLIBRARYNAME) 20 | 21 | FIND_LIBRARY("${MYLIBRARY}_DEBUG" 22 | NAMES "g2o_${MYLIBRARYNAME}_d" 23 | PATHS 24 | ${G2O_ROOT}/lib/Debug 25 | ${G2O_ROOT}/lib 26 | $ENV{G2O_ROOT}/lib/Debug 27 | $ENV{G2O_ROOT}/lib 28 | NO_DEFAULT_PATH 29 | ) 30 | 31 | FIND_LIBRARY("${MYLIBRARY}_DEBUG" 32 | NAMES "g2o_${MYLIBRARYNAME}_d" 33 | PATHS 34 | ~/Library/Frameworks 35 | /Library/Frameworks 36 | /usr/local/lib 37 | /usr/local/lib64 38 | /usr/lib 39 | /usr/lib64 40 | /opt/local/lib 41 | /sw/local/lib 42 | /sw/lib 43 | ) 44 | 45 | FIND_LIBRARY(${MYLIBRARY} 46 | NAMES "g2o_${MYLIBRARYNAME}" 47 | PATHS 48 | ${G2O_ROOT}/lib/Release 49 | ${G2O_ROOT}/lib 50 | $ENV{G2O_ROOT}/lib/Release 51 | $ENV{G2O_ROOT}/lib 52 | NO_DEFAULT_PATH 53 | ) 54 | 55 | FIND_LIBRARY(${MYLIBRARY} 56 | NAMES "g2o_${MYLIBRARYNAME}" 57 | PATHS 58 | ~/Library/Frameworks 59 | /Library/Frameworks 60 | /usr/local/lib 61 | /usr/local/lib64 62 | /usr/lib 63 | /usr/lib64 64 | /opt/local/lib 65 | /sw/local/lib 66 | /sw/lib 67 | ) 68 | 69 | IF(NOT ${MYLIBRARY}_DEBUG) 70 | IF(MYLIBRARY) 71 | SET(${MYLIBRARY}_DEBUG ${MYLIBRARY}) 72 | ENDIF(MYLIBRARY) 73 | ENDIF( NOT ${MYLIBRARY}_DEBUG) 74 | 75 | ENDMACRO(FIND_G2O_LIBRARY LIBRARY LIBRARYNAME) 76 | 77 | # Find the core elements 78 | FIND_G2O_LIBRARY(G2O_STUFF_LIBRARY stuff) 79 | FIND_G2O_LIBRARY(G2O_CORE_LIBRARY core) 80 | 81 | # Find the CLI library 82 | FIND_G2O_LIBRARY(G2O_CLI_LIBRARY cli) 83 | 84 | # Find the pluggable solvers 85 | FIND_G2O_LIBRARY(G2O_SOLVER_CHOLMOD solver_cholmod) 86 | FIND_G2O_LIBRARY(G2O_SOLVER_CSPARSE solver_csparse) 87 | FIND_G2O_LIBRARY(G2O_SOLVER_CSPARSE_EXTENSION csparse_extension) 88 | FIND_G2O_LIBRARY(G2O_SOLVER_DENSE solver_dense) 89 | FIND_G2O_LIBRARY(G2O_SOLVER_PCG solver_pcg) 90 | FIND_G2O_LIBRARY(G2O_SOLVER_SLAM2D_LINEAR solver_slam2d_linear) 91 | FIND_G2O_LIBRARY(G2O_SOLVER_STRUCTURE_ONLY solver_structure_only) 92 | FIND_G2O_LIBRARY(G2O_SOLVER_EIGEN solver_eigen) 93 | 94 | # Find the predefined types 95 | FIND_G2O_LIBRARY(G2O_TYPES_DATA types_data) 96 | FIND_G2O_LIBRARY(G2O_TYPES_ICP types_icp) 97 | FIND_G2O_LIBRARY(G2O_TYPES_SBA types_sba) 98 | FIND_G2O_LIBRARY(G2O_TYPES_SCLAM2D types_sclam2d) 99 | FIND_G2O_LIBRARY(G2O_TYPES_SIM3 types_sim3) 100 | FIND_G2O_LIBRARY(G2O_TYPES_SLAM2D types_slam2d) 101 | FIND_G2O_LIBRARY(G2O_TYPES_SLAM3D types_slam3d) 102 | 103 | # G2O solvers declared found if we found at least one solver 104 | SET(G2O_SOLVERS_FOUND "NO") 105 | IF(G2O_SOLVER_CHOLMOD OR G2O_SOLVER_CSPARSE OR G2O_SOLVER_DENSE OR G2O_SOLVER_PCG OR G2O_SOLVER_SLAM2D_LINEAR OR G2O_SOLVER_STRUCTURE_ONLY OR G2O_SOLVER_EIGEN) 106 | SET(G2O_SOLVERS_FOUND "YES") 107 | ENDIF(G2O_SOLVER_CHOLMOD OR G2O_SOLVER_CSPARSE OR G2O_SOLVER_DENSE OR G2O_SOLVER_PCG OR G2O_SOLVER_SLAM2D_LINEAR OR G2O_SOLVER_STRUCTURE_ONLY OR G2O_SOLVER_EIGEN) 108 | 109 | # G2O itself declared found if we found the core libraries and at least one solver 110 | SET(G2O_FOUND "NO") 111 | IF(G2O_STUFF_LIBRARY AND G2O_CORE_LIBRARY AND G2O_INCLUDE_DIR AND G2O_SOLVERS_FOUND) 112 | SET(G2O_FOUND "YES") 113 | ENDIF(G2O_STUFF_LIBRARY AND G2O_CORE_LIBRARY AND G2O_INCLUDE_DIR AND G2O_SOLVERS_FOUND) 114 | -------------------------------------------------------------------------------- /cmake-build-debug/CMakeFiles/3.7.1/CMakeCXXCompiler.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_CXX_COMPILER "/usr/bin/c++") 2 | set(CMAKE_CXX_COMPILER_ARG1 "") 3 | set(CMAKE_CXX_COMPILER_ID "GNU") 4 | set(CMAKE_CXX_COMPILER_VERSION "5.4.1") 5 | set(CMAKE_CXX_COMPILER_WRAPPER "") 6 | set(CMAKE_CXX_STANDARD_COMPUTED_DEFAULT "98") 7 | set(CMAKE_CXX_COMPILE_FEATURES "cxx_template_template_parameters;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates") 8 | set(CMAKE_CXX98_COMPILE_FEATURES "cxx_template_template_parameters") 9 | set(CMAKE_CXX11_COMPILE_FEATURES "cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates") 10 | set(CMAKE_CXX14_COMPILE_FEATURES "cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates") 11 | 12 | set(CMAKE_CXX_PLATFORM_ID "Linux") 13 | set(CMAKE_CXX_SIMULATE_ID "") 14 | set(CMAKE_CXX_SIMULATE_VERSION "") 15 | 16 | set(CMAKE_AR "/usr/bin/ar") 17 | set(CMAKE_RANLIB "/usr/bin/ranlib") 18 | set(CMAKE_LINKER "/usr/bin/ld") 19 | set(CMAKE_COMPILER_IS_GNUCXX 1) 20 | set(CMAKE_CXX_COMPILER_LOADED 1) 21 | set(CMAKE_CXX_COMPILER_WORKS TRUE) 22 | set(CMAKE_CXX_ABI_COMPILED TRUE) 23 | set(CMAKE_COMPILER_IS_MINGW ) 24 | set(CMAKE_COMPILER_IS_CYGWIN ) 25 | if(CMAKE_COMPILER_IS_CYGWIN) 26 | set(CYGWIN 1) 27 | set(UNIX 1) 28 | endif() 29 | 30 | set(CMAKE_CXX_COMPILER_ENV_VAR "CXX") 31 | 32 | if(CMAKE_COMPILER_IS_MINGW) 33 | set(MINGW 1) 34 | endif() 35 | set(CMAKE_CXX_COMPILER_ID_RUN 1) 36 | set(CMAKE_CXX_IGNORE_EXTENSIONS inl;h;hpp;HPP;H;o;O;obj;OBJ;def;DEF;rc;RC) 37 | set(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;mm;CPP) 38 | set(CMAKE_CXX_LINKER_PREFERENCE 30) 39 | set(CMAKE_CXX_LINKER_PREFERENCE_PROPAGATES 1) 40 | 41 | # Save compiler ABI information. 42 | set(CMAKE_CXX_SIZEOF_DATA_PTR "8") 43 | set(CMAKE_CXX_COMPILER_ABI "ELF") 44 | set(CMAKE_CXX_LIBRARY_ARCHITECTURE "x86_64-linux-gnu") 45 | 46 | if(CMAKE_CXX_SIZEOF_DATA_PTR) 47 | set(CMAKE_SIZEOF_VOID_P "${CMAKE_CXX_SIZEOF_DATA_PTR}") 48 | endif() 49 | 50 | if(CMAKE_CXX_COMPILER_ABI) 51 | set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_CXX_COMPILER_ABI}") 52 | endif() 53 | 54 | if(CMAKE_CXX_LIBRARY_ARCHITECTURE) 55 | set(CMAKE_LIBRARY_ARCHITECTURE "x86_64-linux-gnu") 56 | endif() 57 | 58 | set(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX "") 59 | if(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX) 60 | set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_CXX_CL_SHOWINCLUDES_PREFIX}") 61 | endif() 62 | 63 | 64 | 65 | 66 | 67 | set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "stdc++;m;c") 68 | set(CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "/usr/lib/gcc/x86_64-linux-gnu/5;/usr/lib/x86_64-linux-gnu;/usr/lib;/lib/x86_64-linux-gnu;/lib") 69 | set(CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "") 70 | -------------------------------------------------------------------------------- /cmake-build-debug/CMakeFiles/triangulation.dir/build.make: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.7 3 | 4 | # Delete rule output on recipe failure. 5 | .DELETE_ON_ERROR: 6 | 7 | 8 | #============================================================================= 9 | # Special targets provided by cmake. 10 | 11 | # Disable implicit rules so canonical targets will work. 12 | .SUFFIXES: 13 | 14 | 15 | # Remove some rules from gmake that .SUFFIXES does not remove. 16 | SUFFIXES = 17 | 18 | .SUFFIXES: .hpux_make_needs_suffix_list 19 | 20 | 21 | # Suppress display of executed commands. 22 | $(VERBOSE).SILENT: 23 | 24 | 25 | # A target that is always out of date. 26 | cmake_force: 27 | 28 | .PHONY : cmake_force 29 | 30 | #============================================================================= 31 | # Set environment variables for the build. 32 | 33 | # The shell in which to execute make rules. 34 | SHELL = /bin/sh 35 | 36 | # The CMake executable. 37 | CMAKE_COMMAND = /home/wjg/softwares/clion-2017.1.1/bin/cmake/bin/cmake 38 | 39 | # The command to remove a file. 40 | RM = /home/wjg/softwares/clion-2017.1.1/bin/cmake/bin/cmake -E remove -f 41 | 42 | # Escaping for special characters. 43 | EQUALS = = 44 | 45 | # The top-level source directory on which CMake was run. 46 | CMAKE_SOURCE_DIR = /home/wjg/projects/FeatureMethod 47 | 48 | # The top-level build directory on which CMake was run. 49 | CMAKE_BINARY_DIR = /home/wjg/projects/FeatureMethod/cmake-build-debug 50 | 51 | # Include any dependencies generated for this target. 52 | include CMakeFiles/triangulation.dir/depend.make 53 | 54 | # Include the progress variables for this target. 55 | include CMakeFiles/triangulation.dir/progress.make 56 | 57 | # Include the compile flags for this target's objects. 58 | include CMakeFiles/triangulation.dir/flags.make 59 | 60 | CMakeFiles/triangulation.dir/triangulation.cpp.o: CMakeFiles/triangulation.dir/flags.make 61 | CMakeFiles/triangulation.dir/triangulation.cpp.o: ../triangulation.cpp 62 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/wjg/projects/FeatureMethod/cmake-build-debug/CMakeFiles --progress-num=$(CMAKE_PROGRESS_1) "Building CXX object CMakeFiles/triangulation.dir/triangulation.cpp.o" 63 | /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/triangulation.dir/triangulation.cpp.o -c /home/wjg/projects/FeatureMethod/triangulation.cpp 64 | 65 | CMakeFiles/triangulation.dir/triangulation.cpp.i: cmake_force 66 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/triangulation.dir/triangulation.cpp.i" 67 | /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /home/wjg/projects/FeatureMethod/triangulation.cpp > CMakeFiles/triangulation.dir/triangulation.cpp.i 68 | 69 | CMakeFiles/triangulation.dir/triangulation.cpp.s: cmake_force 70 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/triangulation.dir/triangulation.cpp.s" 71 | /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/wjg/projects/FeatureMethod/triangulation.cpp -o CMakeFiles/triangulation.dir/triangulation.cpp.s 72 | 73 | CMakeFiles/triangulation.dir/triangulation.cpp.o.requires: 74 | 75 | .PHONY : CMakeFiles/triangulation.dir/triangulation.cpp.o.requires 76 | 77 | CMakeFiles/triangulation.dir/triangulation.cpp.o.provides: CMakeFiles/triangulation.dir/triangulation.cpp.o.requires 78 | $(MAKE) -f CMakeFiles/triangulation.dir/build.make CMakeFiles/triangulation.dir/triangulation.cpp.o.provides.build 79 | .PHONY : CMakeFiles/triangulation.dir/triangulation.cpp.o.provides 80 | 81 | CMakeFiles/triangulation.dir/triangulation.cpp.o.provides.build: CMakeFiles/triangulation.dir/triangulation.cpp.o 82 | 83 | 84 | # Object files for target triangulation 85 | triangulation_OBJECTS = \ 86 | "CMakeFiles/triangulation.dir/triangulation.cpp.o" 87 | 88 | # External object files for target triangulation 89 | triangulation_EXTERNAL_OBJECTS = 90 | 91 | triangulation: CMakeFiles/triangulation.dir/triangulation.cpp.o 92 | triangulation: CMakeFiles/triangulation.dir/build.make 93 | triangulation: /usr/local/lib/libopencv_shape.so.3.2.0 94 | triangulation: /usr/local/lib/libopencv_stitching.so.3.2.0 95 | triangulation: /usr/local/lib/libopencv_superres.so.3.2.0 96 | triangulation: /usr/local/lib/libopencv_videostab.so.3.2.0 97 | triangulation: /usr/local/lib/libopencv_objdetect.so.3.2.0 98 | triangulation: /usr/local/lib/libopencv_calib3d.so.3.2.0 99 | triangulation: /usr/local/lib/libopencv_features2d.so.3.2.0 100 | triangulation: /usr/local/lib/libopencv_flann.so.3.2.0 101 | triangulation: /usr/local/lib/libopencv_highgui.so.3.2.0 102 | triangulation: /usr/local/lib/libopencv_ml.so.3.2.0 103 | triangulation: /usr/local/lib/libopencv_photo.so.3.2.0 104 | triangulation: /usr/local/lib/libopencv_video.so.3.2.0 105 | triangulation: /usr/local/lib/libopencv_videoio.so.3.2.0 106 | triangulation: /usr/local/lib/libopencv_imgcodecs.so.3.2.0 107 | triangulation: /usr/local/lib/libopencv_imgproc.so.3.2.0 108 | triangulation: /usr/local/lib/libopencv_core.so.3.2.0 109 | triangulation: CMakeFiles/triangulation.dir/link.txt 110 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --bold --progress-dir=/home/wjg/projects/FeatureMethod/cmake-build-debug/CMakeFiles --progress-num=$(CMAKE_PROGRESS_2) "Linking CXX executable triangulation" 111 | $(CMAKE_COMMAND) -E cmake_link_script CMakeFiles/triangulation.dir/link.txt --verbose=$(VERBOSE) 112 | 113 | # Rule to build all files generated by this target. 114 | CMakeFiles/triangulation.dir/build: triangulation 115 | 116 | .PHONY : CMakeFiles/triangulation.dir/build 117 | 118 | CMakeFiles/triangulation.dir/requires: CMakeFiles/triangulation.dir/triangulation.cpp.o.requires 119 | 120 | .PHONY : CMakeFiles/triangulation.dir/requires 121 | 122 | CMakeFiles/triangulation.dir/clean: 123 | $(CMAKE_COMMAND) -P CMakeFiles/triangulation.dir/cmake_clean.cmake 124 | .PHONY : CMakeFiles/triangulation.dir/clean 125 | 126 | CMakeFiles/triangulation.dir/depend: 127 | cd /home/wjg/projects/FeatureMethod/cmake-build-debug && $(CMAKE_COMMAND) -E cmake_depends "Unix Makefiles" /home/wjg/projects/FeatureMethod /home/wjg/projects/FeatureMethod /home/wjg/projects/FeatureMethod/cmake-build-debug /home/wjg/projects/FeatureMethod/cmake-build-debug /home/wjg/projects/FeatureMethod/cmake-build-debug/CMakeFiles/triangulation.dir/DependInfo.cmake --color=$(COLOR) 128 | .PHONY : CMakeFiles/triangulation.dir/depend 129 | 130 | -------------------------------------------------------------------------------- /pose_estimation_2d2d.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | // #include "extra.h" // use this if in OpenCV2 7 | using namespace std; 8 | using namespace cv; 9 | 10 | /**************************************************** 11 | * 本程序演示了如何使用2D-2D的特征匹配估计相机运动 12 | * **************************************************/ 13 | 14 | void find_feature_matches ( 15 | const Mat& img_1, const Mat& img_2, 16 | std::vector& keypoints_1, 17 | std::vector& keypoints_2, 18 | std::vector< DMatch >& matches ); 19 | 20 | void pose_estimation_2d2d ( 21 | std::vector keypoints_1, 22 | std::vector keypoints_2, 23 | std::vector< DMatch > matches, 24 | Mat& R, Mat& t ); 25 | 26 | // 像素坐标转相机归一化坐标 27 | Point2d pixel2cam ( const Point2d& p, const Mat& K ); 28 | 29 | int main ( int argc, char** argv ) 30 | { 31 | if ( argc != 3 ) 32 | { 33 | cout<<"usage: pose_estimation_2d2d img1 img2"< keypoints_1, keypoints_2; 41 | vector matches; 42 | find_feature_matches ( img_1, img_2, keypoints_1, keypoints_2, matches ); 43 | cout<<"一共找到了"< ( 3,3 ) << 51 | 0, -t.at ( 2,0 ), t.at ( 1,0 ), 52 | t.at ( 2,0 ), 0, -t.at ( 0,0 ), 53 | -t.at ( 1.0 ), t.at ( 0,0 ), 0 ); 54 | 55 | cout<<"t^R="< ( 3,3 ) << 520.9, 0, 325.1, 0, 521.0, 249.7, 0, 0, 1 ); 59 | for ( DMatch m: matches ) 60 | { 61 | Point2d pt1 = pixel2cam ( keypoints_1[ m.queryIdx ].pt, K ); 62 | Mat y1 = ( Mat_ ( 3,1 ) << pt1.x, pt1.y, 1 ); 63 | Point2d pt2 = pixel2cam ( keypoints_2[ m.trainIdx ].pt, K ); 64 | Mat y2 = ( Mat_ ( 3,1 ) << pt2.x, pt2.y, 1 ); 65 | Mat d = y2.t() * t_x * R * y1; 66 | cout << "epipolar constraint = " << d << endl; 67 | } 68 | return 0; 69 | } 70 | 71 | void find_feature_matches ( const Mat& img_1, const Mat& img_2, 72 | std::vector& keypoints_1, 73 | std::vector& keypoints_2, 74 | std::vector< DMatch >& matches ) 75 | { 76 | //-- 初始化 77 | Mat descriptors_1, descriptors_2; 78 | // used in OpenCV3 79 | Ptr detector = ORB::create(); 80 | Ptr descriptor = ORB::create(); 81 | // use this if you are in OpenCV2 82 | // Ptr detector = FeatureDetector::create ( "ORB" ); 83 | // Ptr descriptor = DescriptorExtractor::create ( "ORB" ); 84 | Ptr matcher = DescriptorMatcher::create ( "BruteForce-Hamming" ); 85 | //-- 第一步:检测 Oriented FAST 角点位置 86 | detector->detect ( img_1,keypoints_1 ); 87 | detector->detect ( img_2,keypoints_2 ); 88 | 89 | //-- 第二步:根据角点位置计算 BRIEF 描述子 90 | descriptor->compute ( img_1, keypoints_1, descriptors_1 ); 91 | descriptor->compute ( img_2, keypoints_2, descriptors_2 ); 92 | 93 | //-- 第三步:对两幅图像中的BRIEF描述子进行匹配,使用 Hamming 距离 94 | vector match; 95 | //BFMatcher matcher ( NORM_HAMMING ); 96 | matcher->match ( descriptors_1, descriptors_2, match ); 97 | 98 | //-- 第四步:匹配点对筛选 99 | double min_dist=10000, max_dist=0; 100 | 101 | //找出所有匹配之间的最小距离和最大距离, 即是最相似的和最不相似的两组点之间的距离 102 | for ( int i = 0; i < descriptors_1.rows; i++ ) 103 | { 104 | double dist = match[i].distance; 105 | if ( dist < min_dist ) min_dist = dist; 106 | if ( dist > max_dist ) max_dist = dist; 107 | } 108 | 109 | printf ( "-- Max dist : %f \n", max_dist ); 110 | printf ( "-- Min dist : %f \n", min_dist ); 111 | 112 | //当描述子之间的距离大于两倍的最小距离时,即认为匹配有误.但有时候最小距离会非常小,设置一个经验值30作为下限. 113 | for ( int i = 0; i < descriptors_1.rows; i++ ) 114 | { 115 | if ( match[i].distance <= max ( 2*min_dist, 30.0 ) ) 116 | { 117 | matches.push_back ( match[i] ); 118 | } 119 | } 120 | } 121 | 122 | 123 | Point2d pixel2cam ( const Point2d& p, const Mat& K ) 124 | { 125 | return Point2d 126 | ( 127 | ( p.x - K.at ( 0,2 ) ) / K.at ( 0,0 ), 128 | ( p.y - K.at ( 1,2 ) ) / K.at ( 1,1 ) 129 | ); 130 | } 131 | 132 | 133 | void pose_estimation_2d2d ( std::vector keypoints_1, 134 | std::vector keypoints_2, 135 | std::vector< DMatch > matches, 136 | Mat& R, Mat& t ) 137 | { 138 | // 相机内参,TUM Freiburg2 139 | Mat K = ( Mat_ ( 3,3 ) << 520.9, 0, 325.1, 0, 521.0, 249.7, 0, 0, 1 ); 140 | 141 | //-- 把匹配点转换为vector的形式 142 | vector points1; 143 | vector points2; 144 | 145 | for ( int i = 0; i < ( int ) matches.size(); i++ ) 146 | { 147 | points1.push_back ( keypoints_1[matches[i].queryIdx].pt ); 148 | points2.push_back ( keypoints_2[matches[i].trainIdx].pt ); 149 | } 150 | 151 | //-- 计算基础矩阵 152 | Mat fundamental_matrix; 153 | fundamental_matrix = findFundamentalMat ( points1, points2, CV_FM_8POINT ); 154 | cout<<"fundamental_matrix is "< 3 | using namespace std; 4 | 5 | void decomposeEssentialMat( InputArray _E, OutputArray _R1, OutputArray _R2, OutputArray _t ) 6 | { 7 | Mat E = _E.getMat().reshape(1, 3); 8 | CV_Assert(E.cols == 3 && E.rows == 3); 9 | 10 | Mat D, U, Vt; 11 | SVD::compute(E, D, U, Vt); 12 | 13 | if (determinant(U) < 0) U *= -1.; 14 | if (determinant(Vt) < 0) Vt *= -1.; 15 | 16 | Mat W = (Mat_(3, 3) << 0, 1, 0, -1, 0, 0, 0, 0, 1); 17 | W.convertTo(W, E.type()); 18 | 19 | Mat R1, R2, t; 20 | R1 = U * W * Vt; 21 | R2 = U * W.t() * Vt; 22 | t = U.col(2) * 1.0; 23 | 24 | R1.copyTo(_R1); 25 | R2.copyTo(_R2); 26 | t.copyTo(_t); 27 | } 28 | 29 | int recoverPose( InputArray E, InputArray _points1, InputArray _points2, OutputArray _R, 30 | OutputArray _t, double focal, Point2d pp, InputOutputArray _mask) 31 | { 32 | Mat points1, points2, cameraMatrix; 33 | cameraMatrix = (Mat_(3,3) << focal, 0, pp.x, 0, focal, pp.y, 0, 0, 1); 34 | _points1.getMat().convertTo(points1, CV_64F); 35 | _points2.getMat().convertTo(points2, CV_64F); 36 | 37 | int npoints = points1.checkVector(2); 38 | CV_Assert( npoints >= 0 && points2.checkVector(2) == npoints && 39 | points1.type() == points2.type()); 40 | 41 | CV_Assert(cameraMatrix.rows == 3 && cameraMatrix.cols == 3 && cameraMatrix.channels() == 1); 42 | 43 | if (points1.channels() > 1) 44 | { 45 | points1 = points1.reshape(1, npoints); 46 | points2 = points2.reshape(1, npoints); 47 | } 48 | 49 | double fx = cameraMatrix.at(0,0); 50 | double fy = cameraMatrix.at(1,1); 51 | double cx = cameraMatrix.at(0,2); 52 | double cy = cameraMatrix.at(1,2); 53 | 54 | points1.col(0) = (points1.col(0) - cx) / fx; 55 | points2.col(0) = (points2.col(0) - cx) / fx; 56 | points1.col(1) = (points1.col(1) - cy) / fy; 57 | points2.col(1) = (points2.col(1) - cy) / fy; 58 | 59 | points1 = points1.t(); 60 | points2 = points2.t(); 61 | 62 | Mat R1, R2, t; 63 | decomposeEssentialMat(E, R1, R2, t); 64 | Mat P0 = Mat::eye(3, 4, R1.type()); 65 | Mat P1(3, 4, R1.type()), P2(3, 4, R1.type()), P3(3, 4, R1.type()), P4(3, 4, R1.type()); 66 | P1(Range::all(), Range(0, 3)) = R1 * 1.0; P1.col(3) = t * 1.0; 67 | P2(Range::all(), Range(0, 3)) = R2 * 1.0; P2.col(3) = t * 1.0; 68 | P3(Range::all(), Range(0, 3)) = R1 * 1.0; P3.col(3) = -t * 1.0; 69 | P4(Range::all(), Range(0, 3)) = R2 * 1.0; P4.col(3) = -t * 1.0; 70 | 71 | // Do the cheirality check. 72 | // Notice here a threshold dist is used to filter 73 | // out far away points (i.e. infinite points) since 74 | // there depth may vary between postive and negtive. 75 | double dist = 50.0; 76 | Mat Q; 77 | triangulatePoints(P0, P1, points1, points2, Q); 78 | Mat mask1 = Q.row(2).mul(Q.row(3)) > 0; 79 | Q.row(0) /= Q.row(3); 80 | Q.row(1) /= Q.row(3); 81 | Q.row(2) /= Q.row(3); 82 | Q.row(3) /= Q.row(3); 83 | mask1 = (Q.row(2) < dist) & mask1; 84 | Q = P1 * Q; 85 | mask1 = (Q.row(2) > 0) & mask1; 86 | mask1 = (Q.row(2) < dist) & mask1; 87 | 88 | triangulatePoints(P0, P2, points1, points2, Q); 89 | Mat mask2 = Q.row(2).mul(Q.row(3)) > 0; 90 | Q.row(0) /= Q.row(3); 91 | Q.row(1) /= Q.row(3); 92 | Q.row(2) /= Q.row(3); 93 | Q.row(3) /= Q.row(3); 94 | mask2 = (Q.row(2) < dist) & mask2; 95 | Q = P2 * Q; 96 | mask2 = (Q.row(2) > 0) & mask2; 97 | mask2 = (Q.row(2) < dist) & mask2; 98 | 99 | triangulatePoints(P0, P3, points1, points2, Q); 100 | Mat mask3 = Q.row(2).mul(Q.row(3)) > 0; 101 | Q.row(0) /= Q.row(3); 102 | Q.row(1) /= Q.row(3); 103 | Q.row(2) /= Q.row(3); 104 | Q.row(3) /= Q.row(3); 105 | mask3 = (Q.row(2) < dist) & mask3; 106 | Q = P3 * Q; 107 | mask3 = (Q.row(2) > 0) & mask3; 108 | mask3 = (Q.row(2) < dist) & mask3; 109 | 110 | triangulatePoints(P0, P4, points1, points2, Q); 111 | Mat mask4 = Q.row(2).mul(Q.row(3)) > 0; 112 | Q.row(0) /= Q.row(3); 113 | Q.row(1) /= Q.row(3); 114 | Q.row(2) /= Q.row(3); 115 | Q.row(3) /= Q.row(3); 116 | mask4 = (Q.row(2) < dist) & mask4; 117 | Q = P4 * Q; 118 | mask4 = (Q.row(2) > 0) & mask4; 119 | mask4 = (Q.row(2) < dist) & mask4; 120 | 121 | mask1 = mask1.t(); 122 | mask2 = mask2.t(); 123 | mask3 = mask3.t(); 124 | mask4 = mask4.t(); 125 | 126 | // If _mask is given, then use it to filter outliers. 127 | if (!_mask.empty()) 128 | { 129 | Mat mask = _mask.getMat(); 130 | CV_Assert(mask.size() == mask1.size()); 131 | bitwise_and(mask, mask1, mask1); 132 | bitwise_and(mask, mask2, mask2); 133 | bitwise_and(mask, mask3, mask3); 134 | bitwise_and(mask, mask4, mask4); 135 | } 136 | if (_mask.empty() && _mask.needed()) 137 | { 138 | _mask.create(mask1.size(), CV_8U); 139 | } 140 | 141 | CV_Assert(_R.needed() && _t.needed()); 142 | _R.create(3, 3, R1.type()); 143 | _t.create(3, 1, t.type()); 144 | 145 | int good1 = countNonZero(mask1); 146 | int good2 = countNonZero(mask2); 147 | int good3 = countNonZero(mask3); 148 | int good4 = countNonZero(mask4); 149 | 150 | if (good1 >= good2 && good1 >= good3 && good1 >= good4) 151 | { 152 | R1.copyTo(_R); 153 | t.copyTo(_t); 154 | if (_mask.needed()) mask1.copyTo(_mask); 155 | return good1; 156 | } 157 | else if (good2 >= good1 && good2 >= good3 && good2 >= good4) 158 | { 159 | R2.copyTo(_R); 160 | t.copyTo(_t); 161 | if (_mask.needed()) mask2.copyTo(_mask); 162 | return good2; 163 | } 164 | else if (good3 >= good1 && good3 >= good2 && good3 >= good4) 165 | { 166 | t = -t; 167 | R1.copyTo(_R); 168 | t.copyTo(_t); 169 | if (_mask.needed()) mask3.copyTo(_mask); 170 | return good3; 171 | } 172 | else 173 | { 174 | t = -t; 175 | R2.copyTo(_R); 176 | t.copyTo(_t); 177 | if (_mask.needed()) mask4.copyTo(_mask); 178 | return good4; 179 | } 180 | } 181 | 182 | cv::Mat findEssentialMat( InputArray _points1, InputArray _points2, double focal, Point2d pp) 183 | { 184 | Mat cameraMatrix = (Mat_(3,3) << focal, 0, pp.x, 0, focal, pp.y, 0, 0, 1); 185 | 186 | Mat points1, points2; 187 | _points1.getMat().convertTo(points1, CV_64F); 188 | _points2.getMat().convertTo(points2, CV_64F); 189 | 190 | Mat fundamental_matrix; 191 | fundamental_matrix = findFundamentalMat ( points1, points2, CV_FM_8POINT ); 192 | Mat E; 193 | E = cameraMatrix.t()* fundamental_matrix * cameraMatrix; 194 | 195 | return E; 196 | } 197 | 198 | 199 | -------------------------------------------------------------------------------- /cmake-build-debug/CMakeFiles/feature_extraction.dir/build.make: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.7 3 | 4 | # Delete rule output on recipe failure. 5 | .DELETE_ON_ERROR: 6 | 7 | 8 | #============================================================================= 9 | # Special targets provided by cmake. 10 | 11 | # Disable implicit rules so canonical targets will work. 12 | .SUFFIXES: 13 | 14 | 15 | # Remove some rules from gmake that .SUFFIXES does not remove. 16 | SUFFIXES = 17 | 18 | .SUFFIXES: .hpux_make_needs_suffix_list 19 | 20 | 21 | # Suppress display of executed commands. 22 | $(VERBOSE).SILENT: 23 | 24 | 25 | # A target that is always out of date. 26 | cmake_force: 27 | 28 | .PHONY : cmake_force 29 | 30 | #============================================================================= 31 | # Set environment variables for the build. 32 | 33 | # The shell in which to execute make rules. 34 | SHELL = /bin/sh 35 | 36 | # The CMake executable. 37 | CMAKE_COMMAND = /home/wjg/softwares/clion-2017.1.1/bin/cmake/bin/cmake 38 | 39 | # The command to remove a file. 40 | RM = /home/wjg/softwares/clion-2017.1.1/bin/cmake/bin/cmake -E remove -f 41 | 42 | # Escaping for special characters. 43 | EQUALS = = 44 | 45 | # The top-level source directory on which CMake was run. 46 | CMAKE_SOURCE_DIR = /home/wjg/projects/FeatureMethod 47 | 48 | # The top-level build directory on which CMake was run. 49 | CMAKE_BINARY_DIR = /home/wjg/projects/FeatureMethod/cmake-build-debug 50 | 51 | # Include any dependencies generated for this target. 52 | include CMakeFiles/feature_extraction.dir/depend.make 53 | 54 | # Include the progress variables for this target. 55 | include CMakeFiles/feature_extraction.dir/progress.make 56 | 57 | # Include the compile flags for this target's objects. 58 | include CMakeFiles/feature_extraction.dir/flags.make 59 | 60 | CMakeFiles/feature_extraction.dir/feature_extraction.cpp.o: CMakeFiles/feature_extraction.dir/flags.make 61 | CMakeFiles/feature_extraction.dir/feature_extraction.cpp.o: ../feature_extraction.cpp 62 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/wjg/projects/FeatureMethod/cmake-build-debug/CMakeFiles --progress-num=$(CMAKE_PROGRESS_1) "Building CXX object CMakeFiles/feature_extraction.dir/feature_extraction.cpp.o" 63 | /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/feature_extraction.dir/feature_extraction.cpp.o -c /home/wjg/projects/FeatureMethod/feature_extraction.cpp 64 | 65 | CMakeFiles/feature_extraction.dir/feature_extraction.cpp.i: cmake_force 66 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/feature_extraction.dir/feature_extraction.cpp.i" 67 | /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /home/wjg/projects/FeatureMethod/feature_extraction.cpp > CMakeFiles/feature_extraction.dir/feature_extraction.cpp.i 68 | 69 | CMakeFiles/feature_extraction.dir/feature_extraction.cpp.s: cmake_force 70 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/feature_extraction.dir/feature_extraction.cpp.s" 71 | /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/wjg/projects/FeatureMethod/feature_extraction.cpp -o CMakeFiles/feature_extraction.dir/feature_extraction.cpp.s 72 | 73 | CMakeFiles/feature_extraction.dir/feature_extraction.cpp.o.requires: 74 | 75 | .PHONY : CMakeFiles/feature_extraction.dir/feature_extraction.cpp.o.requires 76 | 77 | CMakeFiles/feature_extraction.dir/feature_extraction.cpp.o.provides: CMakeFiles/feature_extraction.dir/feature_extraction.cpp.o.requires 78 | $(MAKE) -f CMakeFiles/feature_extraction.dir/build.make CMakeFiles/feature_extraction.dir/feature_extraction.cpp.o.provides.build 79 | .PHONY : CMakeFiles/feature_extraction.dir/feature_extraction.cpp.o.provides 80 | 81 | CMakeFiles/feature_extraction.dir/feature_extraction.cpp.o.provides.build: CMakeFiles/feature_extraction.dir/feature_extraction.cpp.o 82 | 83 | 84 | # Object files for target feature_extraction 85 | feature_extraction_OBJECTS = \ 86 | "CMakeFiles/feature_extraction.dir/feature_extraction.cpp.o" 87 | 88 | # External object files for target feature_extraction 89 | feature_extraction_EXTERNAL_OBJECTS = 90 | 91 | feature_extraction: CMakeFiles/feature_extraction.dir/feature_extraction.cpp.o 92 | feature_extraction: CMakeFiles/feature_extraction.dir/build.make 93 | feature_extraction: /usr/local/lib/libopencv_shape.so.3.2.0 94 | feature_extraction: /usr/local/lib/libopencv_stitching.so.3.2.0 95 | feature_extraction: /usr/local/lib/libopencv_superres.so.3.2.0 96 | feature_extraction: /usr/local/lib/libopencv_videostab.so.3.2.0 97 | feature_extraction: /usr/local/lib/libopencv_objdetect.so.3.2.0 98 | feature_extraction: /usr/local/lib/libopencv_calib3d.so.3.2.0 99 | feature_extraction: /usr/local/lib/libopencv_features2d.so.3.2.0 100 | feature_extraction: /usr/local/lib/libopencv_flann.so.3.2.0 101 | feature_extraction: /usr/local/lib/libopencv_highgui.so.3.2.0 102 | feature_extraction: /usr/local/lib/libopencv_ml.so.3.2.0 103 | feature_extraction: /usr/local/lib/libopencv_photo.so.3.2.0 104 | feature_extraction: /usr/local/lib/libopencv_video.so.3.2.0 105 | feature_extraction: /usr/local/lib/libopencv_videoio.so.3.2.0 106 | feature_extraction: /usr/local/lib/libopencv_imgcodecs.so.3.2.0 107 | feature_extraction: /usr/local/lib/libopencv_imgproc.so.3.2.0 108 | feature_extraction: /usr/local/lib/libopencv_core.so.3.2.0 109 | feature_extraction: CMakeFiles/feature_extraction.dir/link.txt 110 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --bold --progress-dir=/home/wjg/projects/FeatureMethod/cmake-build-debug/CMakeFiles --progress-num=$(CMAKE_PROGRESS_2) "Linking CXX executable feature_extraction" 111 | $(CMAKE_COMMAND) -E cmake_link_script CMakeFiles/feature_extraction.dir/link.txt --verbose=$(VERBOSE) 112 | 113 | # Rule to build all files generated by this target. 114 | CMakeFiles/feature_extraction.dir/build: feature_extraction 115 | 116 | .PHONY : CMakeFiles/feature_extraction.dir/build 117 | 118 | CMakeFiles/feature_extraction.dir/requires: CMakeFiles/feature_extraction.dir/feature_extraction.cpp.o.requires 119 | 120 | .PHONY : CMakeFiles/feature_extraction.dir/requires 121 | 122 | CMakeFiles/feature_extraction.dir/clean: 123 | $(CMAKE_COMMAND) -P CMakeFiles/feature_extraction.dir/cmake_clean.cmake 124 | .PHONY : CMakeFiles/feature_extraction.dir/clean 125 | 126 | CMakeFiles/feature_extraction.dir/depend: 127 | cd /home/wjg/projects/FeatureMethod/cmake-build-debug && $(CMAKE_COMMAND) -E cmake_depends "Unix Makefiles" /home/wjg/projects/FeatureMethod /home/wjg/projects/FeatureMethod /home/wjg/projects/FeatureMethod/cmake-build-debug /home/wjg/projects/FeatureMethod/cmake-build-debug /home/wjg/projects/FeatureMethod/cmake-build-debug/CMakeFiles/feature_extraction.dir/DependInfo.cmake --color=$(COLOR) 128 | .PHONY : CMakeFiles/feature_extraction.dir/depend 129 | 130 | -------------------------------------------------------------------------------- /cmake-build-debug/CMakeFiles/pose_estimation_2d2d.dir/build.make: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.7 3 | 4 | # Delete rule output on recipe failure. 5 | .DELETE_ON_ERROR: 6 | 7 | 8 | #============================================================================= 9 | # Special targets provided by cmake. 10 | 11 | # Disable implicit rules so canonical targets will work. 12 | .SUFFIXES: 13 | 14 | 15 | # Remove some rules from gmake that .SUFFIXES does not remove. 16 | SUFFIXES = 17 | 18 | .SUFFIXES: .hpux_make_needs_suffix_list 19 | 20 | 21 | # Suppress display of executed commands. 22 | $(VERBOSE).SILENT: 23 | 24 | 25 | # A target that is always out of date. 26 | cmake_force: 27 | 28 | .PHONY : cmake_force 29 | 30 | #============================================================================= 31 | # Set environment variables for the build. 32 | 33 | # The shell in which to execute make rules. 34 | SHELL = /bin/sh 35 | 36 | # The CMake executable. 37 | CMAKE_COMMAND = /home/wjg/softwares/clion-2017.1.1/bin/cmake/bin/cmake 38 | 39 | # The command to remove a file. 40 | RM = /home/wjg/softwares/clion-2017.1.1/bin/cmake/bin/cmake -E remove -f 41 | 42 | # Escaping for special characters. 43 | EQUALS = = 44 | 45 | # The top-level source directory on which CMake was run. 46 | CMAKE_SOURCE_DIR = /home/wjg/projects/FeatureMethod 47 | 48 | # The top-level build directory on which CMake was run. 49 | CMAKE_BINARY_DIR = /home/wjg/projects/FeatureMethod/cmake-build-debug 50 | 51 | # Include any dependencies generated for this target. 52 | include CMakeFiles/pose_estimation_2d2d.dir/depend.make 53 | 54 | # Include the progress variables for this target. 55 | include CMakeFiles/pose_estimation_2d2d.dir/progress.make 56 | 57 | # Include the compile flags for this target's objects. 58 | include CMakeFiles/pose_estimation_2d2d.dir/flags.make 59 | 60 | CMakeFiles/pose_estimation_2d2d.dir/pose_estimation_2d2d.cpp.o: CMakeFiles/pose_estimation_2d2d.dir/flags.make 61 | CMakeFiles/pose_estimation_2d2d.dir/pose_estimation_2d2d.cpp.o: ../pose_estimation_2d2d.cpp 62 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/wjg/projects/FeatureMethod/cmake-build-debug/CMakeFiles --progress-num=$(CMAKE_PROGRESS_1) "Building CXX object CMakeFiles/pose_estimation_2d2d.dir/pose_estimation_2d2d.cpp.o" 63 | /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/pose_estimation_2d2d.dir/pose_estimation_2d2d.cpp.o -c /home/wjg/projects/FeatureMethod/pose_estimation_2d2d.cpp 64 | 65 | CMakeFiles/pose_estimation_2d2d.dir/pose_estimation_2d2d.cpp.i: cmake_force 66 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/pose_estimation_2d2d.dir/pose_estimation_2d2d.cpp.i" 67 | /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /home/wjg/projects/FeatureMethod/pose_estimation_2d2d.cpp > CMakeFiles/pose_estimation_2d2d.dir/pose_estimation_2d2d.cpp.i 68 | 69 | CMakeFiles/pose_estimation_2d2d.dir/pose_estimation_2d2d.cpp.s: cmake_force 70 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/pose_estimation_2d2d.dir/pose_estimation_2d2d.cpp.s" 71 | /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/wjg/projects/FeatureMethod/pose_estimation_2d2d.cpp -o CMakeFiles/pose_estimation_2d2d.dir/pose_estimation_2d2d.cpp.s 72 | 73 | CMakeFiles/pose_estimation_2d2d.dir/pose_estimation_2d2d.cpp.o.requires: 74 | 75 | .PHONY : CMakeFiles/pose_estimation_2d2d.dir/pose_estimation_2d2d.cpp.o.requires 76 | 77 | CMakeFiles/pose_estimation_2d2d.dir/pose_estimation_2d2d.cpp.o.provides: CMakeFiles/pose_estimation_2d2d.dir/pose_estimation_2d2d.cpp.o.requires 78 | $(MAKE) -f CMakeFiles/pose_estimation_2d2d.dir/build.make CMakeFiles/pose_estimation_2d2d.dir/pose_estimation_2d2d.cpp.o.provides.build 79 | .PHONY : CMakeFiles/pose_estimation_2d2d.dir/pose_estimation_2d2d.cpp.o.provides 80 | 81 | CMakeFiles/pose_estimation_2d2d.dir/pose_estimation_2d2d.cpp.o.provides.build: CMakeFiles/pose_estimation_2d2d.dir/pose_estimation_2d2d.cpp.o 82 | 83 | 84 | # Object files for target pose_estimation_2d2d 85 | pose_estimation_2d2d_OBJECTS = \ 86 | "CMakeFiles/pose_estimation_2d2d.dir/pose_estimation_2d2d.cpp.o" 87 | 88 | # External object files for target pose_estimation_2d2d 89 | pose_estimation_2d2d_EXTERNAL_OBJECTS = 90 | 91 | pose_estimation_2d2d: CMakeFiles/pose_estimation_2d2d.dir/pose_estimation_2d2d.cpp.o 92 | pose_estimation_2d2d: CMakeFiles/pose_estimation_2d2d.dir/build.make 93 | pose_estimation_2d2d: /usr/local/lib/libopencv_shape.so.3.2.0 94 | pose_estimation_2d2d: /usr/local/lib/libopencv_stitching.so.3.2.0 95 | pose_estimation_2d2d: /usr/local/lib/libopencv_superres.so.3.2.0 96 | pose_estimation_2d2d: /usr/local/lib/libopencv_videostab.so.3.2.0 97 | pose_estimation_2d2d: /usr/local/lib/libopencv_objdetect.so.3.2.0 98 | pose_estimation_2d2d: /usr/local/lib/libopencv_calib3d.so.3.2.0 99 | pose_estimation_2d2d: /usr/local/lib/libopencv_features2d.so.3.2.0 100 | pose_estimation_2d2d: /usr/local/lib/libopencv_flann.so.3.2.0 101 | pose_estimation_2d2d: /usr/local/lib/libopencv_highgui.so.3.2.0 102 | pose_estimation_2d2d: /usr/local/lib/libopencv_ml.so.3.2.0 103 | pose_estimation_2d2d: /usr/local/lib/libopencv_photo.so.3.2.0 104 | pose_estimation_2d2d: /usr/local/lib/libopencv_video.so.3.2.0 105 | pose_estimation_2d2d: /usr/local/lib/libopencv_videoio.so.3.2.0 106 | pose_estimation_2d2d: /usr/local/lib/libopencv_imgcodecs.so.3.2.0 107 | pose_estimation_2d2d: /usr/local/lib/libopencv_imgproc.so.3.2.0 108 | pose_estimation_2d2d: /usr/local/lib/libopencv_core.so.3.2.0 109 | pose_estimation_2d2d: CMakeFiles/pose_estimation_2d2d.dir/link.txt 110 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --bold --progress-dir=/home/wjg/projects/FeatureMethod/cmake-build-debug/CMakeFiles --progress-num=$(CMAKE_PROGRESS_2) "Linking CXX executable pose_estimation_2d2d" 111 | $(CMAKE_COMMAND) -E cmake_link_script CMakeFiles/pose_estimation_2d2d.dir/link.txt --verbose=$(VERBOSE) 112 | 113 | # Rule to build all files generated by this target. 114 | CMakeFiles/pose_estimation_2d2d.dir/build: pose_estimation_2d2d 115 | 116 | .PHONY : CMakeFiles/pose_estimation_2d2d.dir/build 117 | 118 | CMakeFiles/pose_estimation_2d2d.dir/requires: CMakeFiles/pose_estimation_2d2d.dir/pose_estimation_2d2d.cpp.o.requires 119 | 120 | .PHONY : CMakeFiles/pose_estimation_2d2d.dir/requires 121 | 122 | CMakeFiles/pose_estimation_2d2d.dir/clean: 123 | $(CMAKE_COMMAND) -P CMakeFiles/pose_estimation_2d2d.dir/cmake_clean.cmake 124 | .PHONY : CMakeFiles/pose_estimation_2d2d.dir/clean 125 | 126 | CMakeFiles/pose_estimation_2d2d.dir/depend: 127 | cd /home/wjg/projects/FeatureMethod/cmake-build-debug && $(CMAKE_COMMAND) -E cmake_depends "Unix Makefiles" /home/wjg/projects/FeatureMethod /home/wjg/projects/FeatureMethod /home/wjg/projects/FeatureMethod/cmake-build-debug /home/wjg/projects/FeatureMethod/cmake-build-debug /home/wjg/projects/FeatureMethod/cmake-build-debug/CMakeFiles/pose_estimation_2d2d.dir/DependInfo.cmake --color=$(COLOR) 128 | .PHONY : CMakeFiles/pose_estimation_2d2d.dir/depend 129 | 130 | -------------------------------------------------------------------------------- /cmake-build-debug/CMakeFiles/pose_estimation_3d2d.dir/build.make: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.7 3 | 4 | # Delete rule output on recipe failure. 5 | .DELETE_ON_ERROR: 6 | 7 | 8 | #============================================================================= 9 | # Special targets provided by cmake. 10 | 11 | # Disable implicit rules so canonical targets will work. 12 | .SUFFIXES: 13 | 14 | 15 | # Remove some rules from gmake that .SUFFIXES does not remove. 16 | SUFFIXES = 17 | 18 | .SUFFIXES: .hpux_make_needs_suffix_list 19 | 20 | 21 | # Suppress display of executed commands. 22 | $(VERBOSE).SILENT: 23 | 24 | 25 | # A target that is always out of date. 26 | cmake_force: 27 | 28 | .PHONY : cmake_force 29 | 30 | #============================================================================= 31 | # Set environment variables for the build. 32 | 33 | # The shell in which to execute make rules. 34 | SHELL = /bin/sh 35 | 36 | # The CMake executable. 37 | CMAKE_COMMAND = /home/wjg/softwares/clion-2017.1.1/bin/cmake/bin/cmake 38 | 39 | # The command to remove a file. 40 | RM = /home/wjg/softwares/clion-2017.1.1/bin/cmake/bin/cmake -E remove -f 41 | 42 | # Escaping for special characters. 43 | EQUALS = = 44 | 45 | # The top-level source directory on which CMake was run. 46 | CMAKE_SOURCE_DIR = /home/wjg/projects/FeatureMethod 47 | 48 | # The top-level build directory on which CMake was run. 49 | CMAKE_BINARY_DIR = /home/wjg/projects/FeatureMethod/cmake-build-debug 50 | 51 | # Include any dependencies generated for this target. 52 | include CMakeFiles/pose_estimation_3d2d.dir/depend.make 53 | 54 | # Include the progress variables for this target. 55 | include CMakeFiles/pose_estimation_3d2d.dir/progress.make 56 | 57 | # Include the compile flags for this target's objects. 58 | include CMakeFiles/pose_estimation_3d2d.dir/flags.make 59 | 60 | CMakeFiles/pose_estimation_3d2d.dir/pose_estimation_3d2d.cpp.o: CMakeFiles/pose_estimation_3d2d.dir/flags.make 61 | CMakeFiles/pose_estimation_3d2d.dir/pose_estimation_3d2d.cpp.o: ../pose_estimation_3d2d.cpp 62 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/wjg/projects/FeatureMethod/cmake-build-debug/CMakeFiles --progress-num=$(CMAKE_PROGRESS_1) "Building CXX object CMakeFiles/pose_estimation_3d2d.dir/pose_estimation_3d2d.cpp.o" 63 | /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/pose_estimation_3d2d.dir/pose_estimation_3d2d.cpp.o -c /home/wjg/projects/FeatureMethod/pose_estimation_3d2d.cpp 64 | 65 | CMakeFiles/pose_estimation_3d2d.dir/pose_estimation_3d2d.cpp.i: cmake_force 66 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/pose_estimation_3d2d.dir/pose_estimation_3d2d.cpp.i" 67 | /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /home/wjg/projects/FeatureMethod/pose_estimation_3d2d.cpp > CMakeFiles/pose_estimation_3d2d.dir/pose_estimation_3d2d.cpp.i 68 | 69 | CMakeFiles/pose_estimation_3d2d.dir/pose_estimation_3d2d.cpp.s: cmake_force 70 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/pose_estimation_3d2d.dir/pose_estimation_3d2d.cpp.s" 71 | /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/wjg/projects/FeatureMethod/pose_estimation_3d2d.cpp -o CMakeFiles/pose_estimation_3d2d.dir/pose_estimation_3d2d.cpp.s 72 | 73 | CMakeFiles/pose_estimation_3d2d.dir/pose_estimation_3d2d.cpp.o.requires: 74 | 75 | .PHONY : CMakeFiles/pose_estimation_3d2d.dir/pose_estimation_3d2d.cpp.o.requires 76 | 77 | CMakeFiles/pose_estimation_3d2d.dir/pose_estimation_3d2d.cpp.o.provides: CMakeFiles/pose_estimation_3d2d.dir/pose_estimation_3d2d.cpp.o.requires 78 | $(MAKE) -f CMakeFiles/pose_estimation_3d2d.dir/build.make CMakeFiles/pose_estimation_3d2d.dir/pose_estimation_3d2d.cpp.o.provides.build 79 | .PHONY : CMakeFiles/pose_estimation_3d2d.dir/pose_estimation_3d2d.cpp.o.provides 80 | 81 | CMakeFiles/pose_estimation_3d2d.dir/pose_estimation_3d2d.cpp.o.provides.build: CMakeFiles/pose_estimation_3d2d.dir/pose_estimation_3d2d.cpp.o 82 | 83 | 84 | # Object files for target pose_estimation_3d2d 85 | pose_estimation_3d2d_OBJECTS = \ 86 | "CMakeFiles/pose_estimation_3d2d.dir/pose_estimation_3d2d.cpp.o" 87 | 88 | # External object files for target pose_estimation_3d2d 89 | pose_estimation_3d2d_EXTERNAL_OBJECTS = 90 | 91 | pose_estimation_3d2d: CMakeFiles/pose_estimation_3d2d.dir/pose_estimation_3d2d.cpp.o 92 | pose_estimation_3d2d: CMakeFiles/pose_estimation_3d2d.dir/build.make 93 | pose_estimation_3d2d: /usr/local/lib/libopencv_shape.so.3.2.0 94 | pose_estimation_3d2d: /usr/local/lib/libopencv_stitching.so.3.2.0 95 | pose_estimation_3d2d: /usr/local/lib/libopencv_superres.so.3.2.0 96 | pose_estimation_3d2d: /usr/local/lib/libopencv_videostab.so.3.2.0 97 | pose_estimation_3d2d: /usr/lib/x86_64-linux-gnu/libcxsparse.so 98 | pose_estimation_3d2d: /usr/local/lib/libopencv_objdetect.so.3.2.0 99 | pose_estimation_3d2d: /usr/local/lib/libopencv_calib3d.so.3.2.0 100 | pose_estimation_3d2d: /usr/local/lib/libopencv_features2d.so.3.2.0 101 | pose_estimation_3d2d: /usr/local/lib/libopencv_flann.so.3.2.0 102 | pose_estimation_3d2d: /usr/local/lib/libopencv_highgui.so.3.2.0 103 | pose_estimation_3d2d: /usr/local/lib/libopencv_ml.so.3.2.0 104 | pose_estimation_3d2d: /usr/local/lib/libopencv_photo.so.3.2.0 105 | pose_estimation_3d2d: /usr/local/lib/libopencv_video.so.3.2.0 106 | pose_estimation_3d2d: /usr/local/lib/libopencv_videoio.so.3.2.0 107 | pose_estimation_3d2d: /usr/local/lib/libopencv_imgcodecs.so.3.2.0 108 | pose_estimation_3d2d: /usr/local/lib/libopencv_imgproc.so.3.2.0 109 | pose_estimation_3d2d: /usr/local/lib/libopencv_core.so.3.2.0 110 | pose_estimation_3d2d: CMakeFiles/pose_estimation_3d2d.dir/link.txt 111 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --bold --progress-dir=/home/wjg/projects/FeatureMethod/cmake-build-debug/CMakeFiles --progress-num=$(CMAKE_PROGRESS_2) "Linking CXX executable pose_estimation_3d2d" 112 | $(CMAKE_COMMAND) -E cmake_link_script CMakeFiles/pose_estimation_3d2d.dir/link.txt --verbose=$(VERBOSE) 113 | 114 | # Rule to build all files generated by this target. 115 | CMakeFiles/pose_estimation_3d2d.dir/build: pose_estimation_3d2d 116 | 117 | .PHONY : CMakeFiles/pose_estimation_3d2d.dir/build 118 | 119 | CMakeFiles/pose_estimation_3d2d.dir/requires: CMakeFiles/pose_estimation_3d2d.dir/pose_estimation_3d2d.cpp.o.requires 120 | 121 | .PHONY : CMakeFiles/pose_estimation_3d2d.dir/requires 122 | 123 | CMakeFiles/pose_estimation_3d2d.dir/clean: 124 | $(CMAKE_COMMAND) -P CMakeFiles/pose_estimation_3d2d.dir/cmake_clean.cmake 125 | .PHONY : CMakeFiles/pose_estimation_3d2d.dir/clean 126 | 127 | CMakeFiles/pose_estimation_3d2d.dir/depend: 128 | cd /home/wjg/projects/FeatureMethod/cmake-build-debug && $(CMAKE_COMMAND) -E cmake_depends "Unix Makefiles" /home/wjg/projects/FeatureMethod /home/wjg/projects/FeatureMethod /home/wjg/projects/FeatureMethod/cmake-build-debug /home/wjg/projects/FeatureMethod/cmake-build-debug /home/wjg/projects/FeatureMethod/cmake-build-debug/CMakeFiles/pose_estimation_3d2d.dir/DependInfo.cmake --color=$(COLOR) 129 | .PHONY : CMakeFiles/pose_estimation_3d2d.dir/depend 130 | 131 | -------------------------------------------------------------------------------- /cmake-build-debug/CMakeFiles/pose_estimation_3d3d.dir/build.make: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.7 3 | 4 | # Delete rule output on recipe failure. 5 | .DELETE_ON_ERROR: 6 | 7 | 8 | #============================================================================= 9 | # Special targets provided by cmake. 10 | 11 | # Disable implicit rules so canonical targets will work. 12 | .SUFFIXES: 13 | 14 | 15 | # Remove some rules from gmake that .SUFFIXES does not remove. 16 | SUFFIXES = 17 | 18 | .SUFFIXES: .hpux_make_needs_suffix_list 19 | 20 | 21 | # Suppress display of executed commands. 22 | $(VERBOSE).SILENT: 23 | 24 | 25 | # A target that is always out of date. 26 | cmake_force: 27 | 28 | .PHONY : cmake_force 29 | 30 | #============================================================================= 31 | # Set environment variables for the build. 32 | 33 | # The shell in which to execute make rules. 34 | SHELL = /bin/sh 35 | 36 | # The CMake executable. 37 | CMAKE_COMMAND = /home/wjg/softwares/clion-2017.1.1/bin/cmake/bin/cmake 38 | 39 | # The command to remove a file. 40 | RM = /home/wjg/softwares/clion-2017.1.1/bin/cmake/bin/cmake -E remove -f 41 | 42 | # Escaping for special characters. 43 | EQUALS = = 44 | 45 | # The top-level source directory on which CMake was run. 46 | CMAKE_SOURCE_DIR = /home/wjg/projects/FeatureMethod 47 | 48 | # The top-level build directory on which CMake was run. 49 | CMAKE_BINARY_DIR = /home/wjg/projects/FeatureMethod/cmake-build-debug 50 | 51 | # Include any dependencies generated for this target. 52 | include CMakeFiles/pose_estimation_3d3d.dir/depend.make 53 | 54 | # Include the progress variables for this target. 55 | include CMakeFiles/pose_estimation_3d3d.dir/progress.make 56 | 57 | # Include the compile flags for this target's objects. 58 | include CMakeFiles/pose_estimation_3d3d.dir/flags.make 59 | 60 | CMakeFiles/pose_estimation_3d3d.dir/pose_estimation_3d3d.cpp.o: CMakeFiles/pose_estimation_3d3d.dir/flags.make 61 | CMakeFiles/pose_estimation_3d3d.dir/pose_estimation_3d3d.cpp.o: ../pose_estimation_3d3d.cpp 62 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/wjg/projects/FeatureMethod/cmake-build-debug/CMakeFiles --progress-num=$(CMAKE_PROGRESS_1) "Building CXX object CMakeFiles/pose_estimation_3d3d.dir/pose_estimation_3d3d.cpp.o" 63 | /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/pose_estimation_3d3d.dir/pose_estimation_3d3d.cpp.o -c /home/wjg/projects/FeatureMethod/pose_estimation_3d3d.cpp 64 | 65 | CMakeFiles/pose_estimation_3d3d.dir/pose_estimation_3d3d.cpp.i: cmake_force 66 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/pose_estimation_3d3d.dir/pose_estimation_3d3d.cpp.i" 67 | /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /home/wjg/projects/FeatureMethod/pose_estimation_3d3d.cpp > CMakeFiles/pose_estimation_3d3d.dir/pose_estimation_3d3d.cpp.i 68 | 69 | CMakeFiles/pose_estimation_3d3d.dir/pose_estimation_3d3d.cpp.s: cmake_force 70 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/pose_estimation_3d3d.dir/pose_estimation_3d3d.cpp.s" 71 | /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/wjg/projects/FeatureMethod/pose_estimation_3d3d.cpp -o CMakeFiles/pose_estimation_3d3d.dir/pose_estimation_3d3d.cpp.s 72 | 73 | CMakeFiles/pose_estimation_3d3d.dir/pose_estimation_3d3d.cpp.o.requires: 74 | 75 | .PHONY : CMakeFiles/pose_estimation_3d3d.dir/pose_estimation_3d3d.cpp.o.requires 76 | 77 | CMakeFiles/pose_estimation_3d3d.dir/pose_estimation_3d3d.cpp.o.provides: CMakeFiles/pose_estimation_3d3d.dir/pose_estimation_3d3d.cpp.o.requires 78 | $(MAKE) -f CMakeFiles/pose_estimation_3d3d.dir/build.make CMakeFiles/pose_estimation_3d3d.dir/pose_estimation_3d3d.cpp.o.provides.build 79 | .PHONY : CMakeFiles/pose_estimation_3d3d.dir/pose_estimation_3d3d.cpp.o.provides 80 | 81 | CMakeFiles/pose_estimation_3d3d.dir/pose_estimation_3d3d.cpp.o.provides.build: CMakeFiles/pose_estimation_3d3d.dir/pose_estimation_3d3d.cpp.o 82 | 83 | 84 | # Object files for target pose_estimation_3d3d 85 | pose_estimation_3d3d_OBJECTS = \ 86 | "CMakeFiles/pose_estimation_3d3d.dir/pose_estimation_3d3d.cpp.o" 87 | 88 | # External object files for target pose_estimation_3d3d 89 | pose_estimation_3d3d_EXTERNAL_OBJECTS = 90 | 91 | pose_estimation_3d3d: CMakeFiles/pose_estimation_3d3d.dir/pose_estimation_3d3d.cpp.o 92 | pose_estimation_3d3d: CMakeFiles/pose_estimation_3d3d.dir/build.make 93 | pose_estimation_3d3d: /usr/local/lib/libopencv_shape.so.3.2.0 94 | pose_estimation_3d3d: /usr/local/lib/libopencv_stitching.so.3.2.0 95 | pose_estimation_3d3d: /usr/local/lib/libopencv_superres.so.3.2.0 96 | pose_estimation_3d3d: /usr/local/lib/libopencv_videostab.so.3.2.0 97 | pose_estimation_3d3d: /usr/lib/x86_64-linux-gnu/libcxsparse.so 98 | pose_estimation_3d3d: /usr/local/lib/libopencv_objdetect.so.3.2.0 99 | pose_estimation_3d3d: /usr/local/lib/libopencv_calib3d.so.3.2.0 100 | pose_estimation_3d3d: /usr/local/lib/libopencv_features2d.so.3.2.0 101 | pose_estimation_3d3d: /usr/local/lib/libopencv_flann.so.3.2.0 102 | pose_estimation_3d3d: /usr/local/lib/libopencv_highgui.so.3.2.0 103 | pose_estimation_3d3d: /usr/local/lib/libopencv_ml.so.3.2.0 104 | pose_estimation_3d3d: /usr/local/lib/libopencv_photo.so.3.2.0 105 | pose_estimation_3d3d: /usr/local/lib/libopencv_video.so.3.2.0 106 | pose_estimation_3d3d: /usr/local/lib/libopencv_videoio.so.3.2.0 107 | pose_estimation_3d3d: /usr/local/lib/libopencv_imgcodecs.so.3.2.0 108 | pose_estimation_3d3d: /usr/local/lib/libopencv_imgproc.so.3.2.0 109 | pose_estimation_3d3d: /usr/local/lib/libopencv_core.so.3.2.0 110 | pose_estimation_3d3d: CMakeFiles/pose_estimation_3d3d.dir/link.txt 111 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --bold --progress-dir=/home/wjg/projects/FeatureMethod/cmake-build-debug/CMakeFiles --progress-num=$(CMAKE_PROGRESS_2) "Linking CXX executable pose_estimation_3d3d" 112 | $(CMAKE_COMMAND) -E cmake_link_script CMakeFiles/pose_estimation_3d3d.dir/link.txt --verbose=$(VERBOSE) 113 | 114 | # Rule to build all files generated by this target. 115 | CMakeFiles/pose_estimation_3d3d.dir/build: pose_estimation_3d3d 116 | 117 | .PHONY : CMakeFiles/pose_estimation_3d3d.dir/build 118 | 119 | CMakeFiles/pose_estimation_3d3d.dir/requires: CMakeFiles/pose_estimation_3d3d.dir/pose_estimation_3d3d.cpp.o.requires 120 | 121 | .PHONY : CMakeFiles/pose_estimation_3d3d.dir/requires 122 | 123 | CMakeFiles/pose_estimation_3d3d.dir/clean: 124 | $(CMAKE_COMMAND) -P CMakeFiles/pose_estimation_3d3d.dir/cmake_clean.cmake 125 | .PHONY : CMakeFiles/pose_estimation_3d3d.dir/clean 126 | 127 | CMakeFiles/pose_estimation_3d3d.dir/depend: 128 | cd /home/wjg/projects/FeatureMethod/cmake-build-debug && $(CMAKE_COMMAND) -E cmake_depends "Unix Makefiles" /home/wjg/projects/FeatureMethod /home/wjg/projects/FeatureMethod /home/wjg/projects/FeatureMethod/cmake-build-debug /home/wjg/projects/FeatureMethod/cmake-build-debug /home/wjg/projects/FeatureMethod/cmake-build-debug/CMakeFiles/pose_estimation_3d3d.dir/DependInfo.cmake --color=$(COLOR) 129 | .PHONY : CMakeFiles/pose_estimation_3d3d.dir/depend 130 | 131 | -------------------------------------------------------------------------------- /triangulation.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | // #include "extra.h" // used in opencv2 7 | using namespace std; 8 | using namespace cv; 9 | 10 | void find_feature_matches ( 11 | const Mat& img_1, const Mat& img_2, 12 | std::vector& keypoints_1, 13 | std::vector& keypoints_2, 14 | std::vector< DMatch >& matches ); 15 | 16 | void pose_estimation_2d2d ( 17 | const std::vector& keypoints_1, 18 | const std::vector& keypoints_2, 19 | const std::vector< DMatch >& matches, 20 | Mat& R, Mat& t ); 21 | 22 | void triangulation ( 23 | const vector& keypoint_1, 24 | const vector& keypoint_2, 25 | const std::vector< DMatch >& matches, 26 | const Mat& R, const Mat& t, 27 | vector& points 28 | ); 29 | 30 | // 像素坐标转相机归一化坐标 31 | Point2f pixel2cam( const Point2d& p, const Mat& K ); 32 | 33 | int main ( int argc, char** argv ) 34 | { 35 | if ( argc != 3 ) 36 | { 37 | cout<<"usage: triangulation img1 img2"< keypoints_1, keypoints_2; 45 | vector matches; 46 | find_feature_matches ( img_1, img_2, keypoints_1, keypoints_2, matches ); 47 | cout<<"一共找到了"< points; 55 | triangulation( keypoints_1, keypoints_2, matches, R, t, points ); 56 | 57 | //-- 验证三角化点与特征点的重投影关系 58 | Mat K = ( Mat_ ( 3,3 ) << 520.9, 0, 325.1, 0, 521.0, 249.7, 0, 0, 1 ); 59 | for ( int i=0; i& keypoints_1, 84 | std::vector& keypoints_2, 85 | std::vector< DMatch >& matches ) 86 | { 87 | //-- 初始化 88 | Mat descriptors_1, descriptors_2; 89 | // used in OpenCV3 90 | Ptr detector = ORB::create(); 91 | Ptr descriptor = ORB::create(); 92 | // use this if you are in OpenCV2 93 | // Ptr detector = FeatureDetector::create ( "ORB" ); 94 | // Ptr descriptor = DescriptorExtractor::create ( "ORB" ); 95 | Ptr matcher = DescriptorMatcher::create("BruteForce-Hamming"); 96 | //-- 第一步:检测 Oriented FAST 角点位置 97 | detector->detect ( img_1,keypoints_1 ); 98 | detector->detect ( img_2,keypoints_2 ); 99 | 100 | //-- 第二步:根据角点位置计算 BRIEF 描述子 101 | descriptor->compute ( img_1, keypoints_1, descriptors_1 ); 102 | descriptor->compute ( img_2, keypoints_2, descriptors_2 ); 103 | 104 | //-- 第三步:对两幅图像中的BRIEF描述子进行匹配,使用 Hamming 距离 105 | vector match; 106 | // BFMatcher matcher ( NORM_HAMMING ); 107 | matcher->match ( descriptors_1, descriptors_2, match ); 108 | 109 | //-- 第四步:匹配点对筛选 110 | double min_dist=10000, max_dist=0; 111 | 112 | //找出所有匹配之间的最小距离和最大距离, 即是最相似的和最不相似的两组点之间的距离 113 | for ( int i = 0; i < descriptors_1.rows; i++ ) 114 | { 115 | double dist = match[i].distance; 116 | if ( dist < min_dist ) min_dist = dist; 117 | if ( dist > max_dist ) max_dist = dist; 118 | } 119 | 120 | printf ( "-- Max dist : %f \n", max_dist ); 121 | printf ( "-- Min dist : %f \n", min_dist ); 122 | 123 | //当描述子之间的距离大于两倍的最小距离时,即认为匹配有误.但有时候最小距离会非常小,设置一个经验值30作为下限. 124 | for ( int i = 0; i < descriptors_1.rows; i++ ) 125 | { 126 | if ( match[i].distance <= max ( 2*min_dist, 30.0 ) ) 127 | { 128 | matches.push_back ( match[i] ); 129 | } 130 | } 131 | } 132 | 133 | void pose_estimation_2d2d ( 134 | const std::vector& keypoints_1, 135 | const std::vector& keypoints_2, 136 | const std::vector< DMatch >& matches, 137 | Mat& R, Mat& t ) 138 | { 139 | // 相机内参,TUM Freiburg2 140 | Mat K = ( Mat_ ( 3,3 ) << 520.9, 0, 325.1, 0, 521.0, 249.7, 0, 0, 1 ); 141 | 142 | //-- 把匹配点转换为vector的形式 143 | vector points1; 144 | vector points2; 145 | 146 | for ( int i = 0; i < ( int ) matches.size(); i++ ) 147 | { 148 | points1.push_back ( keypoints_1[matches[i].queryIdx].pt ); 149 | points2.push_back ( keypoints_2[matches[i].trainIdx].pt ); 150 | } 151 | 152 | //-- 计算基础矩阵 153 | Mat fundamental_matrix; 154 | fundamental_matrix = findFundamentalMat ( points1, points2, CV_FM_8POINT ); 155 | cout<<"fundamental_matrix is "<& keypoint_1, 177 | const vector< KeyPoint >& keypoint_2, 178 | const std::vector< DMatch >& matches, 179 | const Mat& R, const Mat& t, 180 | vector< Point3d >& points ) 181 | { 182 | Mat T1 = (Mat_ (3,4) << 183 | 1,0,0,0, 184 | 0,1,0,0, 185 | 0,0,1,0); 186 | Mat T2 = (Mat_ (3,4) << 187 | R.at(0,0), R.at(0,1), R.at(0,2), t.at(0,0), 188 | R.at(1,0), R.at(1,1), R.at(1,2), t.at(1,0), 189 | R.at(2,0), R.at(2,1), R.at(2,2), t.at(2,0) 190 | ); 191 | 192 | Mat K = ( Mat_ ( 3,3 ) << 520.9, 0, 325.1, 0, 521.0, 249.7, 0, 0, 1 ); 193 | vector pts_1, pts_2; 194 | for ( DMatch m:matches ) 195 | { 196 | // 将像素坐标转换至相机坐标 197 | pts_1.push_back ( pixel2cam( keypoint_1[m.queryIdx].pt, K) ); 198 | pts_2.push_back ( pixel2cam( keypoint_2[m.trainIdx].pt, K) ); 199 | } 200 | 201 | Mat pts_4d; 202 | cv::triangulatePoints( T1, T2, pts_1, pts_2, pts_4d ); 203 | 204 | // 转换成非齐次坐标 205 | for ( int i=0; i(3,0); // 归一化 //金戈大王注:此处的归一化是指从齐次坐标变换到非齐次坐标。而不是变换到归一化平面。 209 | Point3d p ( 210 | x.at(0,0), 211 | x.at(1,0), 212 | x.at(2,0) 213 | ); 214 | points.push_back( p ); 215 | } 216 | } 217 | 218 | Point2f pixel2cam ( const Point2d& p, const Mat& K ) 219 | { 220 | return Point2f 221 | ( 222 | ( p.x - K.at(0,2) ) / K.at(0,0), 223 | ( p.y - K.at(1,2) ) / K.at(1,1) 224 | ); 225 | } 226 | 227 | -------------------------------------------------------------------------------- /pose_estimation_3d2d.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | using namespace std; 17 | using namespace cv; 18 | 19 | void find_feature_matches ( 20 | const Mat& img_1, const Mat& img_2, 21 | std::vector& keypoints_1, 22 | std::vector& keypoints_2, 23 | std::vector< DMatch >& matches ); 24 | 25 | // 像素坐标转相机归一化坐标 26 | Point2d pixel2cam ( const Point2d& p, const Mat& K ); 27 | 28 | void bundleAdjustment ( 29 | const vector points_3d, 30 | const vector points_2d, 31 | const Mat& K, 32 | Mat& R, Mat& t 33 | ); 34 | 35 | int main ( int argc, char** argv ) 36 | { 37 | if ( argc != 5 ) 38 | { 39 | cout<<"usage: pose_estimation_3d2d img1 img2 depth1 depth2"< keypoints_1, keypoints_2; 47 | vector matches; 48 | find_feature_matches ( img_1, img_2, keypoints_1, keypoints_2, matches ); 49 | cout<<"一共找到了"< ( 3,3 ) << 520.9, 0, 325.1, 0, 521.0, 249.7, 0, 0, 1 ); 54 | vector pts_3d; 55 | vector pts_2d; 56 | for ( DMatch m:matches ) 57 | { 58 | ushort d = d1.ptr (int ( keypoints_1[m.queryIdx].pt.y )) [ int ( keypoints_1[m.queryIdx].pt.x ) ]; 59 | if ( d == 0 ) // bad depth 60 | continue; 61 | float dd = d/1000.0; 62 | Point2d p1 = pixel2cam ( keypoints_1[m.queryIdx].pt, K ); 63 | pts_3d.push_back ( Point3f ( p1.x*dd, p1.y*dd, dd ) ); 64 | pts_2d.push_back ( keypoints_2[m.trainIdx].pt ); 65 | } 66 | 67 | cout<<"3d-2d pairs: "<& keypoints_1, 84 | std::vector& keypoints_2, 85 | std::vector< DMatch >& matches ) 86 | { 87 | //-- 初始化 88 | Mat descriptors_1, descriptors_2; 89 | // used in OpenCV3 90 | Ptr detector = ORB::create(); 91 | Ptr descriptor = ORB::create(); 92 | // use this if you are in OpenCV2 93 | // Ptr detector = FeatureDetector::create ( "ORB" ); 94 | // Ptr descriptor = DescriptorExtractor::create ( "ORB" ); 95 | Ptr matcher = DescriptorMatcher::create ( "BruteForce-Hamming" ); 96 | //-- 第一步:检测 Oriented FAST 角点位置 97 | detector->detect ( img_1,keypoints_1 ); 98 | detector->detect ( img_2,keypoints_2 ); 99 | 100 | //-- 第二步:根据角点位置计算 BRIEF 描述子 101 | descriptor->compute ( img_1, keypoints_1, descriptors_1 ); 102 | descriptor->compute ( img_2, keypoints_2, descriptors_2 ); 103 | 104 | //-- 第三步:对两幅图像中的BRIEF描述子进行匹配,使用 Hamming 距离 105 | vector match; 106 | // BFMatcher matcher ( NORM_HAMMING ); 107 | matcher->match ( descriptors_1, descriptors_2, match ); 108 | 109 | //-- 第四步:匹配点对筛选 110 | double min_dist=10000, max_dist=0; 111 | 112 | //找出所有匹配之间的最小距离和最大距离, 即是最相似的和最不相似的两组点之间的距离 113 | for ( int i = 0; i < descriptors_1.rows; i++ ) 114 | { 115 | double dist = match[i].distance; 116 | if ( dist < min_dist ) min_dist = dist; 117 | if ( dist > max_dist ) max_dist = dist; 118 | } 119 | 120 | printf ( "-- Max dist : %f \n", max_dist ); 121 | printf ( "-- Min dist : %f \n", min_dist ); 122 | 123 | //当描述子之间的距离大于两倍的最小距离时,即认为匹配有误.但有时候最小距离会非常小,设置一个经验值30作为下限. 124 | for ( int i = 0; i < descriptors_1.rows; i++ ) 125 | { 126 | if ( match[i].distance <= max ( 2*min_dist, 30.0 ) ) 127 | { 128 | matches.push_back ( match[i] ); 129 | } 130 | } 131 | } 132 | 133 | Point2d pixel2cam ( const Point2d& p, const Mat& K ) 134 | { 135 | return Point2d 136 | ( 137 | ( p.x - K.at ( 0,2 ) ) / K.at ( 0,0 ), 138 | ( p.y - K.at ( 1,2 ) ) / K.at ( 1,1 ) 139 | ); 140 | } 141 | 142 | void bundleAdjustment ( 143 | const vector< Point3f > points_3d, 144 | const vector< Point2f > points_2d, 145 | const Mat& K, 146 | Mat& R, Mat& t ) 147 | { 148 | // 初始化g2o 149 | typedef g2o::BlockSolver< g2o::BlockSolverTraits<6,3> > Block; // pose 维度为 6, landmark 维度为 3 150 | Block::LinearSolverType* linearSolver = new g2o::LinearSolverCSparse(); // 线性方程求解器 151 | Block* solver_ptr = new Block ( linearSolver ); // 矩阵块求解器 152 | g2o::OptimizationAlgorithmLevenberg* solver = new g2o::OptimizationAlgorithmLevenberg ( solver_ptr ); 153 | g2o::SparseOptimizer optimizer; 154 | optimizer.setAlgorithm ( solver ); 155 | 156 | // vertex 157 | g2o::VertexSE3Expmap* pose = new g2o::VertexSE3Expmap(); // camera pose 158 | Eigen::Matrix3d R_mat; 159 | R_mat << 160 | R.at ( 0,0 ), R.at ( 0,1 ), R.at ( 0,2 ), 161 | R.at ( 1,0 ), R.at ( 1,1 ), R.at ( 1,2 ), 162 | R.at ( 2,0 ), R.at ( 2,1 ), R.at ( 2,2 ); 163 | pose->setId ( 0 ); 164 | pose->setEstimate ( g2o::SE3Quat ( 165 | R_mat, 166 | Eigen::Vector3d ( t.at ( 0,0 ), t.at ( 1,0 ), t.at ( 2,0 ) ) 167 | ) ); 168 | optimizer.addVertex ( pose ); 169 | 170 | int index = 1; 171 | for ( const Point3f p:points_3d ) // landmarks 172 | { 173 | g2o::VertexSBAPointXYZ* point = new g2o::VertexSBAPointXYZ(); 174 | point->setId ( index++ ); 175 | point->setEstimate ( Eigen::Vector3d ( p.x, p.y, p.z ) ); 176 | point->setMarginalized ( true ); // g2o 中必须设置 marg 参见第十讲内容 177 | optimizer.addVertex ( point ); 178 | } 179 | 180 | // parameter: camera intrinsics 181 | g2o::CameraParameters* camera = new g2o::CameraParameters ( 182 | K.at ( 0,0 ), Eigen::Vector2d ( K.at ( 0,2 ), K.at ( 1,2 ) ), 0 183 | ); 184 | camera->setId ( 0 ); 185 | optimizer.addParameter ( camera ); 186 | 187 | // edges 188 | index = 1; 189 | for ( const Point2f p:points_2d ) 190 | { 191 | g2o::EdgeProjectXYZ2UV* edge = new g2o::EdgeProjectXYZ2UV(); 192 | edge->setId ( index ); 193 | edge->setVertex ( 0, dynamic_cast ( optimizer.vertex ( index ) ) ); 194 | edge->setVertex ( 1, pose ); 195 | edge->setMeasurement ( Eigen::Vector2d ( p.x, p.y ) ); 196 | edge->setParameterId ( 0,0 ); 197 | edge->setInformation ( Eigen::Matrix2d::Identity() ); 198 | optimizer.addEdge ( edge ); 199 | index++; 200 | } 201 | 202 | chrono::steady_clock::time_point t1 = chrono::steady_clock::now(); 203 | optimizer.setVerbose ( true ); 204 | optimizer.initializeOptimization(); 205 | optimizer.optimize ( 100 ); 206 | chrono::steady_clock::time_point t2 = chrono::steady_clock::now(); 207 | chrono::duration time_used = chrono::duration_cast> ( t2-t1 ); 208 | cout<<"optimization costs time: "< 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | 17 | using namespace std; 18 | using namespace cv; 19 | 20 | void find_feature_matches ( 21 | const Mat& img_1, const Mat& img_2, 22 | std::vector& keypoints_1, 23 | std::vector& keypoints_2, 24 | std::vector< DMatch >& matches ); 25 | 26 | // 像素坐标转相机归一化坐标 27 | Point2d pixel2cam ( const Point2d& p, const Mat& K ); 28 | 29 | void pose_estimation_3d3d ( 30 | const vector& pts1, 31 | const vector& pts2, 32 | Mat& R, Mat& t 33 | ); 34 | 35 | void bundleAdjustment( 36 | const vector& points_3d, 37 | const vector& points_2d, 38 | Mat& R, Mat& t 39 | ); 40 | 41 | // g2o edge 42 | class EdgeProjectXYZRGBDPoseOnly : public g2o::BaseUnaryEdge<3, Eigen::Vector3d, g2o::VertexSE3Expmap> 43 | { 44 | public: 45 | EIGEN_MAKE_ALIGNED_OPERATOR_NEW; 46 | EdgeProjectXYZRGBDPoseOnly( const Eigen::Vector3d& point ) : _point(point) {} 47 | 48 | virtual void computeError() 49 | { 50 | const g2o::VertexSE3Expmap* pose = static_cast ( _vertices[0] ); 51 | // measurement is p, point is p' 52 | _error = _measurement - pose->estimate().map( _point ); 53 | } 54 | 55 | virtual void linearizeOplus() 56 | { 57 | g2o::VertexSE3Expmap* pose = static_cast(_vertices[0]); 58 | g2o::SE3Quat T(pose->estimate()); 59 | Eigen::Vector3d xyz_trans = T.map(_point); 60 | double x = xyz_trans[0]; 61 | double y = xyz_trans[1]; 62 | double z = xyz_trans[2]; 63 | 64 | _jacobianOplusXi(0,0) = 0; 65 | _jacobianOplusXi(0,1) = -z; 66 | _jacobianOplusXi(0,2) = y; 67 | _jacobianOplusXi(0,3) = -1; 68 | _jacobianOplusXi(0,4) = 0; 69 | _jacobianOplusXi(0,5) = 0; 70 | 71 | _jacobianOplusXi(1,0) = z; 72 | _jacobianOplusXi(1,1) = 0; 73 | _jacobianOplusXi(1,2) = -x; 74 | _jacobianOplusXi(1,3) = 0; 75 | _jacobianOplusXi(1,4) = -1; 76 | _jacobianOplusXi(1,5) = 0; 77 | 78 | _jacobianOplusXi(2,0) = -y; 79 | _jacobianOplusXi(2,1) = x; 80 | _jacobianOplusXi(2,2) = 0; 81 | _jacobianOplusXi(2,3) = 0; 82 | _jacobianOplusXi(2,4) = 0; 83 | _jacobianOplusXi(2,5) = -1; 84 | } 85 | 86 | bool read ( istream& in ) {} 87 | bool write ( ostream& out ) const {} 88 | protected: 89 | Eigen::Vector3d _point; 90 | }; 91 | 92 | int main ( int argc, char** argv ) 93 | { 94 | if ( argc != 5 ) 95 | { 96 | cout<<"usage: pose_estimation_3d3d img1 img2 depth1 depth2"< keypoints_1, keypoints_2; 104 | vector matches; 105 | find_feature_matches ( img_1, img_2, keypoints_1, keypoints_2, matches ); 106 | cout<<"一共找到了"< ( 3,3 ) << 520.9, 0, 325.1, 0, 521.0, 249.7, 0, 0, 1 ); 112 | vector pts1, pts2; 113 | 114 | for ( DMatch m:matches ) 115 | { 116 | ushort d1 = depth1.ptr ( int ( keypoints_1[m.queryIdx].pt.y ) ) [ int ( keypoints_1[m.queryIdx].pt.x ) ]; 117 | ushort d2 = depth2.ptr ( int ( keypoints_2[m.trainIdx].pt.y ) ) [ int ( keypoints_2[m.trainIdx].pt.x ) ]; 118 | if ( d1==0 || d2==0 ) // bad depth 119 | continue; 120 | Point2d p1 = pixel2cam ( keypoints_1[m.queryIdx].pt, K ); 121 | Point2d p2 = pixel2cam ( keypoints_2[m.trainIdx].pt, K ); 122 | float dd1 = float ( d1 ) /1000.0; 123 | float dd2 = float ( d2 ) /1000.0; 124 | pts1.push_back ( Point3f ( p1.x*dd1, p1.y*dd1, dd1 ) ); 125 | pts2.push_back ( Point3f ( p2.x*dd2, p2.y*dd2, dd2 ) ); 126 | } 127 | 128 | cout<<"3d-3d pairs: "< descriptor = DescriptorExtractor::create ( "ORB" ); 166 | Ptr matcher = DescriptorMatcher::create("BruteForce-Hamming"); 167 | //-- 第一步:检测 Oriented FAST 角点位置 168 | detector->detect ( img_1,keypoints_1 ); 169 | detector->detect ( img_2,keypoints_2 ); 170 | 171 | //-- 第二步:根据角点位置计算 BRIEF 描述子 172 | descriptor->compute ( img_1, keypoints_1, descriptors_1 ); 173 | descriptor->compute ( img_2, keypoints_2, descriptors_2 ); 174 | 175 | //-- 第三步:对两幅图像中的BRIEF描述子进行匹配,使用 Hamming 距离 176 | vector match; 177 | // BFMatcher matcher ( NORM_HAMMING ); 178 | matcher->match ( descriptors_1, descriptors_2, match ); 179 | 180 | //-- 第四步:匹配点对筛选 181 | double min_dist=10000, max_dist=0; 182 | 183 | //找出所有匹配之间的最小距离和最大距离, 即是最相似的和最不相似的两组点之间的距离 184 | for ( int i = 0; i < descriptors_1.rows; i++ ) 185 | { 186 | double dist = match[i].distance; 187 | if ( dist < min_dist ) min_dist = dist; 188 | if ( dist > max_dist ) max_dist = dist; 189 | } 190 | 191 | printf ( "-- Max dist : %f \n", max_dist ); 192 | printf ( "-- Min dist : %f \n", min_dist ); 193 | 194 | //当描述子之间的距离大于两倍的最小距离时,即认为匹配有误.但有时候最小距离会非常小,设置一个经验值30作为下限. 195 | for ( int i = 0; i < descriptors_1.rows; i++ ) 196 | { 197 | if ( match[i].distance <= max ( 2*min_dist, 30.0 ) ) 198 | { 199 | matches.push_back ( match[i] ); 200 | } 201 | } 202 | } 203 | 204 | Point2d pixel2cam ( const Point2d& p, const Mat& K ) 205 | { 206 | return Point2d 207 | ( 208 | ( p.x - K.at ( 0,2 ) ) / K.at ( 0,0 ), 209 | ( p.y - K.at ( 1,2 ) ) / K.at ( 1,1 ) 210 | ); 211 | } 212 | 213 | void pose_estimation_3d3d ( 214 | const vector& pts1, 215 | const vector& pts2, 216 | Mat& R, Mat& t 217 | ) 218 | { 219 | Point3f p1, p2; // center of mass 220 | int N = pts1.size(); 221 | for ( int i=0; i q1 ( N ), q2 ( N ); // remove the center 229 | for ( int i=0; i= 500 && __cplusplus >= 201402L 5 | "1" 6 | #else 7 | "0" 8 | #endif 9 | "cxx_aggregate_default_initializers\n" 10 | "CXX_FEATURE:" 11 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 407 && __cplusplus >= 201103L 12 | "1" 13 | #else 14 | "0" 15 | #endif 16 | "cxx_alias_templates\n" 17 | "CXX_FEATURE:" 18 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 408 && __cplusplus >= 201103L 19 | "1" 20 | #else 21 | "0" 22 | #endif 23 | "cxx_alignas\n" 24 | "CXX_FEATURE:" 25 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 408 && __cplusplus >= 201103L 26 | "1" 27 | #else 28 | "0" 29 | #endif 30 | "cxx_alignof\n" 31 | "CXX_FEATURE:" 32 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 408 && __cplusplus >= 201103L 33 | "1" 34 | #else 35 | "0" 36 | #endif 37 | "cxx_attributes\n" 38 | "CXX_FEATURE:" 39 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 409 && __cplusplus > 201103L 40 | "1" 41 | #else 42 | "0" 43 | #endif 44 | "cxx_attribute_deprecated\n" 45 | "CXX_FEATURE:" 46 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) 47 | "1" 48 | #else 49 | "0" 50 | #endif 51 | "cxx_auto_type\n" 52 | "CXX_FEATURE:" 53 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 409 && __cplusplus > 201103L 54 | "1" 55 | #else 56 | "0" 57 | #endif 58 | "cxx_binary_literals\n" 59 | "CXX_FEATURE:" 60 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 406 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) 61 | "1" 62 | #else 63 | "0" 64 | #endif 65 | "cxx_constexpr\n" 66 | "CXX_FEATURE:" 67 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 409 && __cplusplus > 201103L 68 | "1" 69 | #else 70 | "0" 71 | #endif 72 | "cxx_contextual_conversions\n" 73 | "CXX_FEATURE:" 74 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) 75 | "1" 76 | #else 77 | "0" 78 | #endif 79 | "cxx_decltype\n" 80 | "CXX_FEATURE:" 81 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 409 && __cplusplus > 201103L 82 | "1" 83 | #else 84 | "0" 85 | #endif 86 | "cxx_decltype_auto\n" 87 | "CXX_FEATURE:" 88 | #if ((__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) >= 40801) && __cplusplus >= 201103L 89 | "1" 90 | #else 91 | "0" 92 | #endif 93 | "cxx_decltype_incomplete_return_types\n" 94 | "CXX_FEATURE:" 95 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) 96 | "1" 97 | #else 98 | "0" 99 | #endif 100 | "cxx_default_function_template_args\n" 101 | "CXX_FEATURE:" 102 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) 103 | "1" 104 | #else 105 | "0" 106 | #endif 107 | "cxx_defaulted_functions\n" 108 | "CXX_FEATURE:" 109 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 406 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) 110 | "1" 111 | #else 112 | "0" 113 | #endif 114 | "cxx_defaulted_move_initializers\n" 115 | "CXX_FEATURE:" 116 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 407 && __cplusplus >= 201103L 117 | "1" 118 | #else 119 | "0" 120 | #endif 121 | "cxx_delegating_constructors\n" 122 | "CXX_FEATURE:" 123 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) 124 | "1" 125 | #else 126 | "0" 127 | #endif 128 | "cxx_deleted_functions\n" 129 | "CXX_FEATURE:" 130 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 409 && __cplusplus > 201103L 131 | "1" 132 | #else 133 | "0" 134 | #endif 135 | "cxx_digit_separators\n" 136 | "CXX_FEATURE:" 137 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 406 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) 138 | "1" 139 | #else 140 | "0" 141 | #endif 142 | "cxx_enum_forward_declarations\n" 143 | "CXX_FEATURE:" 144 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 405 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) 145 | "1" 146 | #else 147 | "0" 148 | #endif 149 | "cxx_explicit_conversions\n" 150 | "CXX_FEATURE:" 151 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 407 && __cplusplus >= 201103L 152 | "1" 153 | #else 154 | "0" 155 | #endif 156 | "cxx_extended_friend_declarations\n" 157 | "CXX_FEATURE:" 158 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) 159 | "1" 160 | #else 161 | "0" 162 | #endif 163 | "cxx_extern_templates\n" 164 | "CXX_FEATURE:" 165 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 407 && __cplusplus >= 201103L 166 | "1" 167 | #else 168 | "0" 169 | #endif 170 | "cxx_final\n" 171 | "CXX_FEATURE:" 172 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) 173 | "1" 174 | #else 175 | "0" 176 | #endif 177 | "cxx_func_identifier\n" 178 | "CXX_FEATURE:" 179 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) 180 | "1" 181 | #else 182 | "0" 183 | #endif 184 | "cxx_generalized_initializers\n" 185 | "CXX_FEATURE:" 186 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 409 && __cplusplus > 201103L 187 | "1" 188 | #else 189 | "0" 190 | #endif 191 | "cxx_generic_lambdas\n" 192 | "CXX_FEATURE:" 193 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 408 && __cplusplus >= 201103L 194 | "1" 195 | #else 196 | "0" 197 | #endif 198 | "cxx_inheriting_constructors\n" 199 | "CXX_FEATURE:" 200 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) 201 | "1" 202 | #else 203 | "0" 204 | #endif 205 | "cxx_inline_namespaces\n" 206 | "CXX_FEATURE:" 207 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 405 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) 208 | "1" 209 | #else 210 | "0" 211 | #endif 212 | "cxx_lambdas\n" 213 | "CXX_FEATURE:" 214 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 409 && __cplusplus > 201103L 215 | "1" 216 | #else 217 | "0" 218 | #endif 219 | "cxx_lambda_init_captures\n" 220 | "CXX_FEATURE:" 221 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 405 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) 222 | "1" 223 | #else 224 | "0" 225 | #endif 226 | "cxx_local_type_template_args\n" 227 | "CXX_FEATURE:" 228 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) 229 | "1" 230 | #else 231 | "0" 232 | #endif 233 | "cxx_long_long_type\n" 234 | "CXX_FEATURE:" 235 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 406 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) 236 | "1" 237 | #else 238 | "0" 239 | #endif 240 | "cxx_noexcept\n" 241 | "CXX_FEATURE:" 242 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 407 && __cplusplus >= 201103L 243 | "1" 244 | #else 245 | "0" 246 | #endif 247 | "cxx_nonstatic_member_init\n" 248 | "CXX_FEATURE:" 249 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 406 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) 250 | "1" 251 | #else 252 | "0" 253 | #endif 254 | "cxx_nullptr\n" 255 | "CXX_FEATURE:" 256 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 407 && __cplusplus >= 201103L 257 | "1" 258 | #else 259 | "0" 260 | #endif 261 | "cxx_override\n" 262 | "CXX_FEATURE:" 263 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 406 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) 264 | "1" 265 | #else 266 | "0" 267 | #endif 268 | "cxx_range_for\n" 269 | "CXX_FEATURE:" 270 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 405 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) 271 | "1" 272 | #else 273 | "0" 274 | #endif 275 | "cxx_raw_string_literals\n" 276 | "CXX_FEATURE:" 277 | #if ((__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) >= 40801) && __cplusplus >= 201103L 278 | "1" 279 | #else 280 | "0" 281 | #endif 282 | "cxx_reference_qualified_functions\n" 283 | "CXX_FEATURE:" 284 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 500 && __cplusplus >= 201402L 285 | "1" 286 | #else 287 | "0" 288 | #endif 289 | "cxx_relaxed_constexpr\n" 290 | "CXX_FEATURE:" 291 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 409 && __cplusplus > 201103L 292 | "1" 293 | #else 294 | "0" 295 | #endif 296 | "cxx_return_type_deduction\n" 297 | "CXX_FEATURE:" 298 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) 299 | "1" 300 | #else 301 | "0" 302 | #endif 303 | "cxx_right_angle_brackets\n" 304 | "CXX_FEATURE:" 305 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) 306 | "1" 307 | #else 308 | "0" 309 | #endif 310 | "cxx_rvalue_references\n" 311 | "CXX_FEATURE:" 312 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) 313 | "1" 314 | #else 315 | "0" 316 | #endif 317 | "cxx_sizeof_member\n" 318 | "CXX_FEATURE:" 319 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) 320 | "1" 321 | #else 322 | "0" 323 | #endif 324 | "cxx_static_assert\n" 325 | "CXX_FEATURE:" 326 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) 327 | "1" 328 | #else 329 | "0" 330 | #endif 331 | "cxx_strong_enums\n" 332 | "CXX_FEATURE:" 333 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && __cplusplus 334 | "1" 335 | #else 336 | "0" 337 | #endif 338 | "cxx_template_template_parameters\n" 339 | "CXX_FEATURE:" 340 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 408 && __cplusplus >= 201103L 341 | "1" 342 | #else 343 | "0" 344 | #endif 345 | "cxx_thread_local\n" 346 | "CXX_FEATURE:" 347 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) 348 | "1" 349 | #else 350 | "0" 351 | #endif 352 | "cxx_trailing_return_types\n" 353 | "CXX_FEATURE:" 354 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) 355 | "1" 356 | #else 357 | "0" 358 | #endif 359 | "cxx_unicode_literals\n" 360 | "CXX_FEATURE:" 361 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) 362 | "1" 363 | #else 364 | "0" 365 | #endif 366 | "cxx_uniform_initialization\n" 367 | "CXX_FEATURE:" 368 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 406 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) 369 | "1" 370 | #else 371 | "0" 372 | #endif 373 | "cxx_unrestricted_unions\n" 374 | "CXX_FEATURE:" 375 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 407 && __cplusplus >= 201103L 376 | "1" 377 | #else 378 | "0" 379 | #endif 380 | "cxx_user_literals\n" 381 | "CXX_FEATURE:" 382 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 500 && __cplusplus >= 201402L 383 | "1" 384 | #else 385 | "0" 386 | #endif 387 | "cxx_variable_templates\n" 388 | "CXX_FEATURE:" 389 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) 390 | "1" 391 | #else 392 | "0" 393 | #endif 394 | "cxx_variadic_macros\n" 395 | "CXX_FEATURE:" 396 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) 397 | "1" 398 | #else 399 | "0" 400 | #endif 401 | "cxx_variadic_templates\n" 402 | 403 | }; 404 | 405 | int main(int argc, char** argv) { (void)argv; return features[argc]; } 406 | -------------------------------------------------------------------------------- /cmake-build-debug/Makefile: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.7 3 | 4 | # Default target executed when no arguments are given to make. 5 | default_target: all 6 | 7 | .PHONY : default_target 8 | 9 | # Allow only one "make -f Makefile2" at a time, but pass parallelism. 10 | .NOTPARALLEL: 11 | 12 | 13 | #============================================================================= 14 | # Special targets provided by cmake. 15 | 16 | # Disable implicit rules so canonical targets will work. 17 | .SUFFIXES: 18 | 19 | 20 | # Remove some rules from gmake that .SUFFIXES does not remove. 21 | SUFFIXES = 22 | 23 | .SUFFIXES: .hpux_make_needs_suffix_list 24 | 25 | 26 | # Suppress display of executed commands. 27 | $(VERBOSE).SILENT: 28 | 29 | 30 | # A target that is always out of date. 31 | cmake_force: 32 | 33 | .PHONY : cmake_force 34 | 35 | #============================================================================= 36 | # Set environment variables for the build. 37 | 38 | # The shell in which to execute make rules. 39 | SHELL = /bin/sh 40 | 41 | # The CMake executable. 42 | CMAKE_COMMAND = /home/wjg/softwares/clion-2017.1.1/bin/cmake/bin/cmake 43 | 44 | # The command to remove a file. 45 | RM = /home/wjg/softwares/clion-2017.1.1/bin/cmake/bin/cmake -E remove -f 46 | 47 | # Escaping for special characters. 48 | EQUALS = = 49 | 50 | # The top-level source directory on which CMake was run. 51 | CMAKE_SOURCE_DIR = /home/wjg/projects/FeatureMethod 52 | 53 | # The top-level build directory on which CMake was run. 54 | CMAKE_BINARY_DIR = /home/wjg/projects/FeatureMethod/cmake-build-debug 55 | 56 | #============================================================================= 57 | # Targets provided globally by CMake. 58 | 59 | # Special rule for the target rebuild_cache 60 | rebuild_cache: 61 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..." 62 | /home/wjg/softwares/clion-2017.1.1/bin/cmake/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) 63 | .PHONY : rebuild_cache 64 | 65 | # Special rule for the target rebuild_cache 66 | rebuild_cache/fast: rebuild_cache 67 | 68 | .PHONY : rebuild_cache/fast 69 | 70 | # Special rule for the target edit_cache 71 | edit_cache: 72 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "No interactive CMake dialog available..." 73 | /home/wjg/softwares/clion-2017.1.1/bin/cmake/bin/cmake -E echo No\ interactive\ CMake\ dialog\ available. 74 | .PHONY : edit_cache 75 | 76 | # Special rule for the target edit_cache 77 | edit_cache/fast: edit_cache 78 | 79 | .PHONY : edit_cache/fast 80 | 81 | # The main all target 82 | all: cmake_check_build_system 83 | $(CMAKE_COMMAND) -E cmake_progress_start /home/wjg/projects/FeatureMethod/cmake-build-debug/CMakeFiles /home/wjg/projects/FeatureMethod/cmake-build-debug/CMakeFiles/progress.marks 84 | $(MAKE) -f CMakeFiles/Makefile2 all 85 | $(CMAKE_COMMAND) -E cmake_progress_start /home/wjg/projects/FeatureMethod/cmake-build-debug/CMakeFiles 0 86 | .PHONY : all 87 | 88 | # The main clean target 89 | clean: 90 | $(MAKE) -f CMakeFiles/Makefile2 clean 91 | .PHONY : clean 92 | 93 | # The main clean target 94 | clean/fast: clean 95 | 96 | .PHONY : clean/fast 97 | 98 | # Prepare targets for installation. 99 | preinstall: all 100 | $(MAKE) -f CMakeFiles/Makefile2 preinstall 101 | .PHONY : preinstall 102 | 103 | # Prepare targets for installation. 104 | preinstall/fast: 105 | $(MAKE) -f CMakeFiles/Makefile2 preinstall 106 | .PHONY : preinstall/fast 107 | 108 | # clear depends 109 | depend: 110 | $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 111 | .PHONY : depend 112 | 113 | #============================================================================= 114 | # Target rules for targets named pose_estimation_3d3d 115 | 116 | # Build rule for target. 117 | pose_estimation_3d3d: cmake_check_build_system 118 | $(MAKE) -f CMakeFiles/Makefile2 pose_estimation_3d3d 119 | .PHONY : pose_estimation_3d3d 120 | 121 | # fast build rule for target. 122 | pose_estimation_3d3d/fast: 123 | $(MAKE) -f CMakeFiles/pose_estimation_3d3d.dir/build.make CMakeFiles/pose_estimation_3d3d.dir/build 124 | .PHONY : pose_estimation_3d3d/fast 125 | 126 | #============================================================================= 127 | # Target rules for targets named pose_estimation_3d2d 128 | 129 | # Build rule for target. 130 | pose_estimation_3d2d: cmake_check_build_system 131 | $(MAKE) -f CMakeFiles/Makefile2 pose_estimation_3d2d 132 | .PHONY : pose_estimation_3d2d 133 | 134 | # fast build rule for target. 135 | pose_estimation_3d2d/fast: 136 | $(MAKE) -f CMakeFiles/pose_estimation_3d2d.dir/build.make CMakeFiles/pose_estimation_3d2d.dir/build 137 | .PHONY : pose_estimation_3d2d/fast 138 | 139 | #============================================================================= 140 | # Target rules for targets named pose_estimation_2d2d 141 | 142 | # Build rule for target. 143 | pose_estimation_2d2d: cmake_check_build_system 144 | $(MAKE) -f CMakeFiles/Makefile2 pose_estimation_2d2d 145 | .PHONY : pose_estimation_2d2d 146 | 147 | # fast build rule for target. 148 | pose_estimation_2d2d/fast: 149 | $(MAKE) -f CMakeFiles/pose_estimation_2d2d.dir/build.make CMakeFiles/pose_estimation_2d2d.dir/build 150 | .PHONY : pose_estimation_2d2d/fast 151 | 152 | #============================================================================= 153 | # Target rules for targets named triangulation 154 | 155 | # Build rule for target. 156 | triangulation: cmake_check_build_system 157 | $(MAKE) -f CMakeFiles/Makefile2 triangulation 158 | .PHONY : triangulation 159 | 160 | # fast build rule for target. 161 | triangulation/fast: 162 | $(MAKE) -f CMakeFiles/triangulation.dir/build.make CMakeFiles/triangulation.dir/build 163 | .PHONY : triangulation/fast 164 | 165 | #============================================================================= 166 | # Target rules for targets named feature_extraction 167 | 168 | # Build rule for target. 169 | feature_extraction: cmake_check_build_system 170 | $(MAKE) -f CMakeFiles/Makefile2 feature_extraction 171 | .PHONY : feature_extraction 172 | 173 | # fast build rule for target. 174 | feature_extraction/fast: 175 | $(MAKE) -f CMakeFiles/feature_extraction.dir/build.make CMakeFiles/feature_extraction.dir/build 176 | .PHONY : feature_extraction/fast 177 | 178 | feature_extraction.o: feature_extraction.cpp.o 179 | 180 | .PHONY : feature_extraction.o 181 | 182 | # target to build an object file 183 | feature_extraction.cpp.o: 184 | $(MAKE) -f CMakeFiles/feature_extraction.dir/build.make CMakeFiles/feature_extraction.dir/feature_extraction.cpp.o 185 | .PHONY : feature_extraction.cpp.o 186 | 187 | feature_extraction.i: feature_extraction.cpp.i 188 | 189 | .PHONY : feature_extraction.i 190 | 191 | # target to preprocess a source file 192 | feature_extraction.cpp.i: 193 | $(MAKE) -f CMakeFiles/feature_extraction.dir/build.make CMakeFiles/feature_extraction.dir/feature_extraction.cpp.i 194 | .PHONY : feature_extraction.cpp.i 195 | 196 | feature_extraction.s: feature_extraction.cpp.s 197 | 198 | .PHONY : feature_extraction.s 199 | 200 | # target to generate assembly for a file 201 | feature_extraction.cpp.s: 202 | $(MAKE) -f CMakeFiles/feature_extraction.dir/build.make CMakeFiles/feature_extraction.dir/feature_extraction.cpp.s 203 | .PHONY : feature_extraction.cpp.s 204 | 205 | pose_estimation_2d2d.o: pose_estimation_2d2d.cpp.o 206 | 207 | .PHONY : pose_estimation_2d2d.o 208 | 209 | # target to build an object file 210 | pose_estimation_2d2d.cpp.o: 211 | $(MAKE) -f CMakeFiles/pose_estimation_2d2d.dir/build.make CMakeFiles/pose_estimation_2d2d.dir/pose_estimation_2d2d.cpp.o 212 | .PHONY : pose_estimation_2d2d.cpp.o 213 | 214 | pose_estimation_2d2d.i: pose_estimation_2d2d.cpp.i 215 | 216 | .PHONY : pose_estimation_2d2d.i 217 | 218 | # target to preprocess a source file 219 | pose_estimation_2d2d.cpp.i: 220 | $(MAKE) -f CMakeFiles/pose_estimation_2d2d.dir/build.make CMakeFiles/pose_estimation_2d2d.dir/pose_estimation_2d2d.cpp.i 221 | .PHONY : pose_estimation_2d2d.cpp.i 222 | 223 | pose_estimation_2d2d.s: pose_estimation_2d2d.cpp.s 224 | 225 | .PHONY : pose_estimation_2d2d.s 226 | 227 | # target to generate assembly for a file 228 | pose_estimation_2d2d.cpp.s: 229 | $(MAKE) -f CMakeFiles/pose_estimation_2d2d.dir/build.make CMakeFiles/pose_estimation_2d2d.dir/pose_estimation_2d2d.cpp.s 230 | .PHONY : pose_estimation_2d2d.cpp.s 231 | 232 | pose_estimation_3d2d.o: pose_estimation_3d2d.cpp.o 233 | 234 | .PHONY : pose_estimation_3d2d.o 235 | 236 | # target to build an object file 237 | pose_estimation_3d2d.cpp.o: 238 | $(MAKE) -f CMakeFiles/pose_estimation_3d2d.dir/build.make CMakeFiles/pose_estimation_3d2d.dir/pose_estimation_3d2d.cpp.o 239 | .PHONY : pose_estimation_3d2d.cpp.o 240 | 241 | pose_estimation_3d2d.i: pose_estimation_3d2d.cpp.i 242 | 243 | .PHONY : pose_estimation_3d2d.i 244 | 245 | # target to preprocess a source file 246 | pose_estimation_3d2d.cpp.i: 247 | $(MAKE) -f CMakeFiles/pose_estimation_3d2d.dir/build.make CMakeFiles/pose_estimation_3d2d.dir/pose_estimation_3d2d.cpp.i 248 | .PHONY : pose_estimation_3d2d.cpp.i 249 | 250 | pose_estimation_3d2d.s: pose_estimation_3d2d.cpp.s 251 | 252 | .PHONY : pose_estimation_3d2d.s 253 | 254 | # target to generate assembly for a file 255 | pose_estimation_3d2d.cpp.s: 256 | $(MAKE) -f CMakeFiles/pose_estimation_3d2d.dir/build.make CMakeFiles/pose_estimation_3d2d.dir/pose_estimation_3d2d.cpp.s 257 | .PHONY : pose_estimation_3d2d.cpp.s 258 | 259 | pose_estimation_3d3d.o: pose_estimation_3d3d.cpp.o 260 | 261 | .PHONY : pose_estimation_3d3d.o 262 | 263 | # target to build an object file 264 | pose_estimation_3d3d.cpp.o: 265 | $(MAKE) -f CMakeFiles/pose_estimation_3d3d.dir/build.make CMakeFiles/pose_estimation_3d3d.dir/pose_estimation_3d3d.cpp.o 266 | .PHONY : pose_estimation_3d3d.cpp.o 267 | 268 | pose_estimation_3d3d.i: pose_estimation_3d3d.cpp.i 269 | 270 | .PHONY : pose_estimation_3d3d.i 271 | 272 | # target to preprocess a source file 273 | pose_estimation_3d3d.cpp.i: 274 | $(MAKE) -f CMakeFiles/pose_estimation_3d3d.dir/build.make CMakeFiles/pose_estimation_3d3d.dir/pose_estimation_3d3d.cpp.i 275 | .PHONY : pose_estimation_3d3d.cpp.i 276 | 277 | pose_estimation_3d3d.s: pose_estimation_3d3d.cpp.s 278 | 279 | .PHONY : pose_estimation_3d3d.s 280 | 281 | # target to generate assembly for a file 282 | pose_estimation_3d3d.cpp.s: 283 | $(MAKE) -f CMakeFiles/pose_estimation_3d3d.dir/build.make CMakeFiles/pose_estimation_3d3d.dir/pose_estimation_3d3d.cpp.s 284 | .PHONY : pose_estimation_3d3d.cpp.s 285 | 286 | triangulation.o: triangulation.cpp.o 287 | 288 | .PHONY : triangulation.o 289 | 290 | # target to build an object file 291 | triangulation.cpp.o: 292 | $(MAKE) -f CMakeFiles/triangulation.dir/build.make CMakeFiles/triangulation.dir/triangulation.cpp.o 293 | .PHONY : triangulation.cpp.o 294 | 295 | triangulation.i: triangulation.cpp.i 296 | 297 | .PHONY : triangulation.i 298 | 299 | # target to preprocess a source file 300 | triangulation.cpp.i: 301 | $(MAKE) -f CMakeFiles/triangulation.dir/build.make CMakeFiles/triangulation.dir/triangulation.cpp.i 302 | .PHONY : triangulation.cpp.i 303 | 304 | triangulation.s: triangulation.cpp.s 305 | 306 | .PHONY : triangulation.s 307 | 308 | # target to generate assembly for a file 309 | triangulation.cpp.s: 310 | $(MAKE) -f CMakeFiles/triangulation.dir/build.make CMakeFiles/triangulation.dir/triangulation.cpp.s 311 | .PHONY : triangulation.cpp.s 312 | 313 | # Help Target 314 | help: 315 | @echo "The following are some of the valid targets for this Makefile:" 316 | @echo "... all (the default if no target is provided)" 317 | @echo "... clean" 318 | @echo "... depend" 319 | @echo "... rebuild_cache" 320 | @echo "... edit_cache" 321 | @echo "... pose_estimation_3d3d" 322 | @echo "... pose_estimation_3d2d" 323 | @echo "... pose_estimation_2d2d" 324 | @echo "... triangulation" 325 | @echo "... feature_extraction" 326 | @echo "... feature_extraction.o" 327 | @echo "... feature_extraction.i" 328 | @echo "... feature_extraction.s" 329 | @echo "... pose_estimation_2d2d.o" 330 | @echo "... pose_estimation_2d2d.i" 331 | @echo "... pose_estimation_2d2d.s" 332 | @echo "... pose_estimation_3d2d.o" 333 | @echo "... pose_estimation_3d2d.i" 334 | @echo "... pose_estimation_3d2d.s" 335 | @echo "... pose_estimation_3d3d.o" 336 | @echo "... pose_estimation_3d3d.i" 337 | @echo "... pose_estimation_3d3d.s" 338 | @echo "... triangulation.o" 339 | @echo "... triangulation.i" 340 | @echo "... triangulation.s" 341 | .PHONY : help 342 | 343 | 344 | 345 | #============================================================================= 346 | # Special targets to cleanup operation of make. 347 | 348 | # Special rule to run CMake to check the build system integrity. 349 | # No rule that depends on this can have commands that come from listfiles 350 | # because they might be regenerated. 351 | cmake_check_build_system: 352 | $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 353 | .PHONY : cmake_check_build_system 354 | 355 | -------------------------------------------------------------------------------- /cmake-build-debug/CMakeFiles/3.7.1/CompilerIdCXX/CMakeCXXCompilerId.cpp: -------------------------------------------------------------------------------- 1 | /* This source file must have a .cpp extension so that all C++ compilers 2 | recognize the extension without flags. Borland does not know .cxx for 3 | example. */ 4 | #ifndef __cplusplus 5 | # error "A C compiler has been selected for C++." 6 | #endif 7 | 8 | 9 | /* Version number components: V=Version, R=Revision, P=Patch 10 | Version date components: YYYY=Year, MM=Month, DD=Day */ 11 | 12 | #if defined(__COMO__) 13 | # define COMPILER_ID "Comeau" 14 | /* __COMO_VERSION__ = VRR */ 15 | # define COMPILER_VERSION_MAJOR DEC(__COMO_VERSION__ / 100) 16 | # define COMPILER_VERSION_MINOR DEC(__COMO_VERSION__ % 100) 17 | 18 | #elif defined(__INTEL_COMPILER) || defined(__ICC) 19 | # define COMPILER_ID "Intel" 20 | # if defined(_MSC_VER) 21 | # define SIMULATE_ID "MSVC" 22 | # endif 23 | /* __INTEL_COMPILER = VRP */ 24 | # define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100) 25 | # define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10) 26 | # if defined(__INTEL_COMPILER_UPDATE) 27 | # define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER_UPDATE) 28 | # else 29 | # define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10) 30 | # endif 31 | # if defined(__INTEL_COMPILER_BUILD_DATE) 32 | /* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */ 33 | # define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE) 34 | # endif 35 | # if defined(_MSC_VER) 36 | /* _MSC_VER = VVRR */ 37 | # define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) 38 | # define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) 39 | # endif 40 | 41 | #elif defined(__PATHCC__) 42 | # define COMPILER_ID "PathScale" 43 | # define COMPILER_VERSION_MAJOR DEC(__PATHCC__) 44 | # define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__) 45 | # if defined(__PATHCC_PATCHLEVEL__) 46 | # define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__) 47 | # endif 48 | 49 | #elif defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__) 50 | # define COMPILER_ID "Embarcadero" 51 | # define COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF) 52 | # define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF) 53 | # define COMPILER_VERSION_PATCH DEC(__CODEGEARC_VERSION__ & 0xFFFF) 54 | 55 | #elif defined(__BORLANDC__) 56 | # define COMPILER_ID "Borland" 57 | /* __BORLANDC__ = 0xVRR */ 58 | # define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8) 59 | # define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF) 60 | 61 | #elif defined(__WATCOMC__) && __WATCOMC__ < 1200 62 | # define COMPILER_ID "Watcom" 63 | /* __WATCOMC__ = VVRR */ 64 | # define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100) 65 | # define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) 66 | # if (__WATCOMC__ % 10) > 0 67 | # define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) 68 | # endif 69 | 70 | #elif defined(__WATCOMC__) 71 | # define COMPILER_ID "OpenWatcom" 72 | /* __WATCOMC__ = VVRP + 1100 */ 73 | # define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100) 74 | # define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) 75 | # if (__WATCOMC__ % 10) > 0 76 | # define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) 77 | # endif 78 | 79 | #elif defined(__SUNPRO_CC) 80 | # define COMPILER_ID "SunPro" 81 | # if __SUNPRO_CC >= 0x5100 82 | /* __SUNPRO_CC = 0xVRRP */ 83 | # define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>12) 84 | # define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xFF) 85 | # define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF) 86 | # else 87 | /* __SUNPRO_CC = 0xVRP */ 88 | # define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>8) 89 | # define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xF) 90 | # define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF) 91 | # endif 92 | 93 | #elif defined(__HP_aCC) 94 | # define COMPILER_ID "HP" 95 | /* __HP_aCC = VVRRPP */ 96 | # define COMPILER_VERSION_MAJOR DEC(__HP_aCC/10000) 97 | # define COMPILER_VERSION_MINOR DEC(__HP_aCC/100 % 100) 98 | # define COMPILER_VERSION_PATCH DEC(__HP_aCC % 100) 99 | 100 | #elif defined(__DECCXX) 101 | # define COMPILER_ID "Compaq" 102 | /* __DECCXX_VER = VVRRTPPPP */ 103 | # define COMPILER_VERSION_MAJOR DEC(__DECCXX_VER/10000000) 104 | # define COMPILER_VERSION_MINOR DEC(__DECCXX_VER/100000 % 100) 105 | # define COMPILER_VERSION_PATCH DEC(__DECCXX_VER % 10000) 106 | 107 | #elif defined(__IBMCPP__) && defined(__COMPILER_VER__) 108 | # define COMPILER_ID "zOS" 109 | /* __IBMCPP__ = VRP */ 110 | # define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100) 111 | # define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10) 112 | # define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10) 113 | 114 | #elif defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ >= 800 115 | # define COMPILER_ID "XL" 116 | /* __IBMCPP__ = VRP */ 117 | # define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100) 118 | # define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10) 119 | # define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10) 120 | 121 | #elif defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ < 800 122 | # define COMPILER_ID "VisualAge" 123 | /* __IBMCPP__ = VRP */ 124 | # define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100) 125 | # define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10) 126 | # define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10) 127 | 128 | #elif defined(__PGI) 129 | # define COMPILER_ID "PGI" 130 | # define COMPILER_VERSION_MAJOR DEC(__PGIC__) 131 | # define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__) 132 | # if defined(__PGIC_PATCHLEVEL__) 133 | # define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__) 134 | # endif 135 | 136 | #elif defined(_CRAYC) 137 | # define COMPILER_ID "Cray" 138 | # define COMPILER_VERSION_MAJOR DEC(_RELEASE_MAJOR) 139 | # define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR) 140 | 141 | #elif defined(__TI_COMPILER_VERSION__) 142 | # define COMPILER_ID "TI" 143 | /* __TI_COMPILER_VERSION__ = VVVRRRPPP */ 144 | # define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000) 145 | # define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000) 146 | # define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000) 147 | 148 | #elif defined(__FUJITSU) || defined(__FCC_VERSION) || defined(__fcc_version) 149 | # define COMPILER_ID "Fujitsu" 150 | 151 | #elif defined(__SCO_VERSION__) 152 | # define COMPILER_ID "SCO" 153 | 154 | #elif defined(__clang__) && defined(__apple_build_version__) 155 | # define COMPILER_ID "AppleClang" 156 | # if defined(_MSC_VER) 157 | # define SIMULATE_ID "MSVC" 158 | # endif 159 | # define COMPILER_VERSION_MAJOR DEC(__clang_major__) 160 | # define COMPILER_VERSION_MINOR DEC(__clang_minor__) 161 | # define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) 162 | # if defined(_MSC_VER) 163 | /* _MSC_VER = VVRR */ 164 | # define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) 165 | # define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) 166 | # endif 167 | # define COMPILER_VERSION_TWEAK DEC(__apple_build_version__) 168 | 169 | #elif defined(__clang__) 170 | # define COMPILER_ID "Clang" 171 | # if defined(_MSC_VER) 172 | # define SIMULATE_ID "MSVC" 173 | # endif 174 | # define COMPILER_VERSION_MAJOR DEC(__clang_major__) 175 | # define COMPILER_VERSION_MINOR DEC(__clang_minor__) 176 | # define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) 177 | # if defined(_MSC_VER) 178 | /* _MSC_VER = VVRR */ 179 | # define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) 180 | # define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) 181 | # endif 182 | 183 | #elif defined(__GNUC__) 184 | # define COMPILER_ID "GNU" 185 | # define COMPILER_VERSION_MAJOR DEC(__GNUC__) 186 | # if defined(__GNUC_MINOR__) 187 | # define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__) 188 | # endif 189 | # if defined(__GNUC_PATCHLEVEL__) 190 | # define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) 191 | # endif 192 | 193 | #elif defined(_MSC_VER) 194 | # define COMPILER_ID "MSVC" 195 | /* _MSC_VER = VVRR */ 196 | # define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100) 197 | # define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100) 198 | # if defined(_MSC_FULL_VER) 199 | # if _MSC_VER >= 1400 200 | /* _MSC_FULL_VER = VVRRPPPPP */ 201 | # define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000) 202 | # else 203 | /* _MSC_FULL_VER = VVRRPPPP */ 204 | # define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000) 205 | # endif 206 | # endif 207 | # if defined(_MSC_BUILD) 208 | # define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD) 209 | # endif 210 | 211 | #elif defined(__VISUALDSPVERSION__) || defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__) 212 | # define COMPILER_ID "ADSP" 213 | #if defined(__VISUALDSPVERSION__) 214 | /* __VISUALDSPVERSION__ = 0xVVRRPP00 */ 215 | # define COMPILER_VERSION_MAJOR HEX(__VISUALDSPVERSION__>>24) 216 | # define COMPILER_VERSION_MINOR HEX(__VISUALDSPVERSION__>>16 & 0xFF) 217 | # define COMPILER_VERSION_PATCH HEX(__VISUALDSPVERSION__>>8 & 0xFF) 218 | #endif 219 | 220 | #elif defined(__IAR_SYSTEMS_ICC__ ) || defined(__IAR_SYSTEMS_ICC) 221 | # define COMPILER_ID "IAR" 222 | 223 | #elif defined(__ARMCC_VERSION) 224 | # define COMPILER_ID "ARMCC" 225 | #if __ARMCC_VERSION >= 1000000 226 | /* __ARMCC_VERSION = VRRPPPP */ 227 | # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/1000000) 228 | # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 100) 229 | # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) 230 | #else 231 | /* __ARMCC_VERSION = VRPPPP */ 232 | # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/100000) 233 | # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 10) 234 | # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) 235 | #endif 236 | 237 | 238 | #elif defined(_SGI_COMPILER_VERSION) || defined(_COMPILER_VERSION) 239 | # define COMPILER_ID "MIPSpro" 240 | # if defined(_SGI_COMPILER_VERSION) 241 | /* _SGI_COMPILER_VERSION = VRP */ 242 | # define COMPILER_VERSION_MAJOR DEC(_SGI_COMPILER_VERSION/100) 243 | # define COMPILER_VERSION_MINOR DEC(_SGI_COMPILER_VERSION/10 % 10) 244 | # define COMPILER_VERSION_PATCH DEC(_SGI_COMPILER_VERSION % 10) 245 | # else 246 | /* _COMPILER_VERSION = VRP */ 247 | # define COMPILER_VERSION_MAJOR DEC(_COMPILER_VERSION/100) 248 | # define COMPILER_VERSION_MINOR DEC(_COMPILER_VERSION/10 % 10) 249 | # define COMPILER_VERSION_PATCH DEC(_COMPILER_VERSION % 10) 250 | # endif 251 | 252 | 253 | /* These compilers are either not known or too old to define an 254 | identification macro. Try to identify the platform and guess that 255 | it is the native compiler. */ 256 | #elif defined(__sgi) 257 | # define COMPILER_ID "MIPSpro" 258 | 259 | #elif defined(__hpux) || defined(__hpua) 260 | # define COMPILER_ID "HP" 261 | 262 | #else /* unknown compiler */ 263 | # define COMPILER_ID "" 264 | #endif 265 | 266 | /* Construct the string literal in pieces to prevent the source from 267 | getting matched. Store it in a pointer rather than an array 268 | because some compilers will just produce instructions to fill the 269 | array rather than assigning a pointer to a static array. */ 270 | char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]"; 271 | #ifdef SIMULATE_ID 272 | char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]"; 273 | #endif 274 | 275 | #ifdef __QNXNTO__ 276 | char const* qnxnto = "INFO" ":" "qnxnto[]"; 277 | #endif 278 | 279 | #if defined(__CRAYXE) || defined(__CRAYXC) 280 | char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]"; 281 | #endif 282 | 283 | #define STRINGIFY_HELPER(X) #X 284 | #define STRINGIFY(X) STRINGIFY_HELPER(X) 285 | 286 | /* Identify known platforms by name. */ 287 | #if defined(__linux) || defined(__linux__) || defined(linux) 288 | # define PLATFORM_ID "Linux" 289 | 290 | #elif defined(__CYGWIN__) 291 | # define PLATFORM_ID "Cygwin" 292 | 293 | #elif defined(__MINGW32__) 294 | # define PLATFORM_ID "MinGW" 295 | 296 | #elif defined(__APPLE__) 297 | # define PLATFORM_ID "Darwin" 298 | 299 | #elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32) 300 | # define PLATFORM_ID "Windows" 301 | 302 | #elif defined(__FreeBSD__) || defined(__FreeBSD) 303 | # define PLATFORM_ID "FreeBSD" 304 | 305 | #elif defined(__NetBSD__) || defined(__NetBSD) 306 | # define PLATFORM_ID "NetBSD" 307 | 308 | #elif defined(__OpenBSD__) || defined(__OPENBSD) 309 | # define PLATFORM_ID "OpenBSD" 310 | 311 | #elif defined(__sun) || defined(sun) 312 | # define PLATFORM_ID "SunOS" 313 | 314 | #elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__) 315 | # define PLATFORM_ID "AIX" 316 | 317 | #elif defined(__sgi) || defined(__sgi__) || defined(_SGI) 318 | # define PLATFORM_ID "IRIX" 319 | 320 | #elif defined(__hpux) || defined(__hpux__) 321 | # define PLATFORM_ID "HP-UX" 322 | 323 | #elif defined(__HAIKU__) 324 | # define PLATFORM_ID "Haiku" 325 | 326 | #elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS) 327 | # define PLATFORM_ID "BeOS" 328 | 329 | #elif defined(__QNX__) || defined(__QNXNTO__) 330 | # define PLATFORM_ID "QNX" 331 | 332 | #elif defined(__tru64) || defined(_tru64) || defined(__TRU64__) 333 | # define PLATFORM_ID "Tru64" 334 | 335 | #elif defined(__riscos) || defined(__riscos__) 336 | # define PLATFORM_ID "RISCos" 337 | 338 | #elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__) 339 | # define PLATFORM_ID "SINIX" 340 | 341 | #elif defined(__UNIX_SV__) 342 | # define PLATFORM_ID "UNIX_SV" 343 | 344 | #elif defined(__bsdos__) 345 | # define PLATFORM_ID "BSDOS" 346 | 347 | #elif defined(_MPRAS) || defined(MPRAS) 348 | # define PLATFORM_ID "MP-RAS" 349 | 350 | #elif defined(__osf) || defined(__osf__) 351 | # define PLATFORM_ID "OSF1" 352 | 353 | #elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv) 354 | # define PLATFORM_ID "SCO_SV" 355 | 356 | #elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX) 357 | # define PLATFORM_ID "ULTRIX" 358 | 359 | #elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX) 360 | # define PLATFORM_ID "Xenix" 361 | 362 | #elif defined(__WATCOMC__) 363 | # if defined(__LINUX__) 364 | # define PLATFORM_ID "Linux" 365 | 366 | # elif defined(__DOS__) 367 | # define PLATFORM_ID "DOS" 368 | 369 | # elif defined(__OS2__) 370 | # define PLATFORM_ID "OS2" 371 | 372 | # elif defined(__WINDOWS__) 373 | # define PLATFORM_ID "Windows3x" 374 | 375 | # else /* unknown platform */ 376 | # define PLATFORM_ID 377 | # endif 378 | 379 | #else /* unknown platform */ 380 | # define PLATFORM_ID 381 | 382 | #endif 383 | 384 | /* For windows compilers MSVC and Intel we can determine 385 | the architecture of the compiler being used. This is because 386 | the compilers do not have flags that can change the architecture, 387 | but rather depend on which compiler is being used 388 | */ 389 | #if defined(_WIN32) && defined(_MSC_VER) 390 | # if defined(_M_IA64) 391 | # define ARCHITECTURE_ID "IA64" 392 | 393 | # elif defined(_M_X64) || defined(_M_AMD64) 394 | # define ARCHITECTURE_ID "x64" 395 | 396 | # elif defined(_M_IX86) 397 | # define ARCHITECTURE_ID "X86" 398 | 399 | # elif defined(_M_ARM) 400 | # if _M_ARM == 4 401 | # define ARCHITECTURE_ID "ARMV4I" 402 | # elif _M_ARM == 5 403 | # define ARCHITECTURE_ID "ARMV5I" 404 | # else 405 | # define ARCHITECTURE_ID "ARMV" STRINGIFY(_M_ARM) 406 | # endif 407 | 408 | # elif defined(_M_MIPS) 409 | # define ARCHITECTURE_ID "MIPS" 410 | 411 | # elif defined(_M_SH) 412 | # define ARCHITECTURE_ID "SHx" 413 | 414 | # else /* unknown architecture */ 415 | # define ARCHITECTURE_ID "" 416 | # endif 417 | 418 | #elif defined(__WATCOMC__) 419 | # if defined(_M_I86) 420 | # define ARCHITECTURE_ID "I86" 421 | 422 | # elif defined(_M_IX86) 423 | # define ARCHITECTURE_ID "X86" 424 | 425 | # else /* unknown architecture */ 426 | # define ARCHITECTURE_ID "" 427 | # endif 428 | 429 | #else 430 | # define ARCHITECTURE_ID 431 | #endif 432 | 433 | /* Convert integer to decimal digit literals. */ 434 | #define DEC(n) \ 435 | ('0' + (((n) / 10000000)%10)), \ 436 | ('0' + (((n) / 1000000)%10)), \ 437 | ('0' + (((n) / 100000)%10)), \ 438 | ('0' + (((n) / 10000)%10)), \ 439 | ('0' + (((n) / 1000)%10)), \ 440 | ('0' + (((n) / 100)%10)), \ 441 | ('0' + (((n) / 10)%10)), \ 442 | ('0' + ((n) % 10)) 443 | 444 | /* Convert integer to hex digit literals. */ 445 | #define HEX(n) \ 446 | ('0' + ((n)>>28 & 0xF)), \ 447 | ('0' + ((n)>>24 & 0xF)), \ 448 | ('0' + ((n)>>20 & 0xF)), \ 449 | ('0' + ((n)>>16 & 0xF)), \ 450 | ('0' + ((n)>>12 & 0xF)), \ 451 | ('0' + ((n)>>8 & 0xF)), \ 452 | ('0' + ((n)>>4 & 0xF)), \ 453 | ('0' + ((n) & 0xF)) 454 | 455 | /* Construct a string literal encoding the version number components. */ 456 | #ifdef COMPILER_VERSION_MAJOR 457 | char const info_version[] = { 458 | 'I', 'N', 'F', 'O', ':', 459 | 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[', 460 | COMPILER_VERSION_MAJOR, 461 | # ifdef COMPILER_VERSION_MINOR 462 | '.', COMPILER_VERSION_MINOR, 463 | # ifdef COMPILER_VERSION_PATCH 464 | '.', COMPILER_VERSION_PATCH, 465 | # ifdef COMPILER_VERSION_TWEAK 466 | '.', COMPILER_VERSION_TWEAK, 467 | # endif 468 | # endif 469 | # endif 470 | ']','\0'}; 471 | #endif 472 | 473 | /* Construct a string literal encoding the version number components. */ 474 | #ifdef SIMULATE_VERSION_MAJOR 475 | char const info_simulate_version[] = { 476 | 'I', 'N', 'F', 'O', ':', 477 | 's','i','m','u','l','a','t','e','_','v','e','r','s','i','o','n','[', 478 | SIMULATE_VERSION_MAJOR, 479 | # ifdef SIMULATE_VERSION_MINOR 480 | '.', SIMULATE_VERSION_MINOR, 481 | # ifdef SIMULATE_VERSION_PATCH 482 | '.', SIMULATE_VERSION_PATCH, 483 | # ifdef SIMULATE_VERSION_TWEAK 484 | '.', SIMULATE_VERSION_TWEAK, 485 | # endif 486 | # endif 487 | # endif 488 | ']','\0'}; 489 | #endif 490 | 491 | /* Construct the string literal in pieces to prevent the source from 492 | getting matched. Store it in a pointer rather than an array 493 | because some compilers will just produce instructions to fill the 494 | array rather than assigning a pointer to a static array. */ 495 | char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]"; 496 | char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]"; 497 | 498 | 499 | 500 | 501 | const char* info_language_dialect_default = "INFO" ":" "dialect_default[" 502 | #if __cplusplus >= 201402L 503 | "14" 504 | #elif __cplusplus >= 201103L 505 | "11" 506 | #else 507 | "98" 508 | #endif 509 | "]"; 510 | 511 | /*--------------------------------------------------------------------------*/ 512 | 513 | int main(int argc, char* argv[]) 514 | { 515 | int require = 0; 516 | require += info_compiler[argc]; 517 | require += info_platform[argc]; 518 | #ifdef COMPILER_VERSION_MAJOR 519 | require += info_version[argc]; 520 | #endif 521 | #ifdef SIMULATE_ID 522 | require += info_simulate[argc]; 523 | #endif 524 | #ifdef SIMULATE_VERSION_MAJOR 525 | require += info_simulate_version[argc]; 526 | #endif 527 | #if defined(__CRAYXE) || defined(__CRAYXC) 528 | require += info_cray[argc]; 529 | #endif 530 | require += info_language_dialect_default[argc]; 531 | (void)argv; 532 | return require; 533 | } 534 | -------------------------------------------------------------------------------- /cmake-build-debug/CMakeFiles/3.7.1/CompilerIdC/CMakeCCompilerId.c: -------------------------------------------------------------------------------- 1 | #ifdef __cplusplus 2 | # error "A C++ compiler has been selected for C." 3 | #endif 4 | 5 | #if defined(__18CXX) 6 | # define ID_VOID_MAIN 7 | #endif 8 | #if defined(__CLASSIC_C__) 9 | /* cv-qualifiers did not exist in K&R C */ 10 | # define const 11 | # define volatile 12 | #endif 13 | 14 | 15 | /* Version number components: V=Version, R=Revision, P=Patch 16 | Version date components: YYYY=Year, MM=Month, DD=Day */ 17 | 18 | #if defined(__INTEL_COMPILER) || defined(__ICC) 19 | # define COMPILER_ID "Intel" 20 | # if defined(_MSC_VER) 21 | # define SIMULATE_ID "MSVC" 22 | # endif 23 | /* __INTEL_COMPILER = VRP */ 24 | # define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100) 25 | # define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10) 26 | # if defined(__INTEL_COMPILER_UPDATE) 27 | # define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER_UPDATE) 28 | # else 29 | # define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10) 30 | # endif 31 | # if defined(__INTEL_COMPILER_BUILD_DATE) 32 | /* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */ 33 | # define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE) 34 | # endif 35 | # if defined(_MSC_VER) 36 | /* _MSC_VER = VVRR */ 37 | # define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) 38 | # define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) 39 | # endif 40 | 41 | #elif defined(__PATHCC__) 42 | # define COMPILER_ID "PathScale" 43 | # define COMPILER_VERSION_MAJOR DEC(__PATHCC__) 44 | # define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__) 45 | # if defined(__PATHCC_PATCHLEVEL__) 46 | # define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__) 47 | # endif 48 | 49 | #elif defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__) 50 | # define COMPILER_ID "Embarcadero" 51 | # define COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF) 52 | # define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF) 53 | # define COMPILER_VERSION_PATCH DEC(__CODEGEARC_VERSION__ & 0xFFFF) 54 | 55 | #elif defined(__BORLANDC__) 56 | # define COMPILER_ID "Borland" 57 | /* __BORLANDC__ = 0xVRR */ 58 | # define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8) 59 | # define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF) 60 | 61 | #elif defined(__WATCOMC__) && __WATCOMC__ < 1200 62 | # define COMPILER_ID "Watcom" 63 | /* __WATCOMC__ = VVRR */ 64 | # define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100) 65 | # define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) 66 | # if (__WATCOMC__ % 10) > 0 67 | # define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) 68 | # endif 69 | 70 | #elif defined(__WATCOMC__) 71 | # define COMPILER_ID "OpenWatcom" 72 | /* __WATCOMC__ = VVRP + 1100 */ 73 | # define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100) 74 | # define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) 75 | # if (__WATCOMC__ % 10) > 0 76 | # define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) 77 | # endif 78 | 79 | #elif defined(__SUNPRO_C) 80 | # define COMPILER_ID "SunPro" 81 | # if __SUNPRO_C >= 0x5100 82 | /* __SUNPRO_C = 0xVRRP */ 83 | # define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>12) 84 | # define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xFF) 85 | # define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF) 86 | # else 87 | /* __SUNPRO_CC = 0xVRP */ 88 | # define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>8) 89 | # define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xF) 90 | # define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF) 91 | # endif 92 | 93 | #elif defined(__HP_cc) 94 | # define COMPILER_ID "HP" 95 | /* __HP_cc = VVRRPP */ 96 | # define COMPILER_VERSION_MAJOR DEC(__HP_cc/10000) 97 | # define COMPILER_VERSION_MINOR DEC(__HP_cc/100 % 100) 98 | # define COMPILER_VERSION_PATCH DEC(__HP_cc % 100) 99 | 100 | #elif defined(__DECC) 101 | # define COMPILER_ID "Compaq" 102 | /* __DECC_VER = VVRRTPPPP */ 103 | # define COMPILER_VERSION_MAJOR DEC(__DECC_VER/10000000) 104 | # define COMPILER_VERSION_MINOR DEC(__DECC_VER/100000 % 100) 105 | # define COMPILER_VERSION_PATCH DEC(__DECC_VER % 10000) 106 | 107 | #elif defined(__IBMC__) && defined(__COMPILER_VER__) 108 | # define COMPILER_ID "zOS" 109 | /* __IBMC__ = VRP */ 110 | # define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) 111 | # define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) 112 | # define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) 113 | 114 | #elif defined(__IBMC__) && !defined(__COMPILER_VER__) && __IBMC__ >= 800 115 | # define COMPILER_ID "XL" 116 | /* __IBMC__ = VRP */ 117 | # define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) 118 | # define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) 119 | # define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) 120 | 121 | #elif defined(__IBMC__) && !defined(__COMPILER_VER__) && __IBMC__ < 800 122 | # define COMPILER_ID "VisualAge" 123 | /* __IBMC__ = VRP */ 124 | # define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) 125 | # define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) 126 | # define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) 127 | 128 | #elif defined(__PGI) 129 | # define COMPILER_ID "PGI" 130 | # define COMPILER_VERSION_MAJOR DEC(__PGIC__) 131 | # define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__) 132 | # if defined(__PGIC_PATCHLEVEL__) 133 | # define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__) 134 | # endif 135 | 136 | #elif defined(_CRAYC) 137 | # define COMPILER_ID "Cray" 138 | # define COMPILER_VERSION_MAJOR DEC(_RELEASE_MAJOR) 139 | # define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR) 140 | 141 | #elif defined(__TI_COMPILER_VERSION__) 142 | # define COMPILER_ID "TI" 143 | /* __TI_COMPILER_VERSION__ = VVVRRRPPP */ 144 | # define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000) 145 | # define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000) 146 | # define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000) 147 | 148 | #elif defined(__FUJITSU) || defined(__FCC_VERSION) || defined(__fcc_version) 149 | # define COMPILER_ID "Fujitsu" 150 | 151 | #elif defined(__TINYC__) 152 | # define COMPILER_ID "TinyCC" 153 | 154 | #elif defined(__BCC__) 155 | # define COMPILER_ID "Bruce" 156 | 157 | #elif defined(__SCO_VERSION__) 158 | # define COMPILER_ID "SCO" 159 | 160 | #elif defined(__clang__) && defined(__apple_build_version__) 161 | # define COMPILER_ID "AppleClang" 162 | # if defined(_MSC_VER) 163 | # define SIMULATE_ID "MSVC" 164 | # endif 165 | # define COMPILER_VERSION_MAJOR DEC(__clang_major__) 166 | # define COMPILER_VERSION_MINOR DEC(__clang_minor__) 167 | # define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) 168 | # if defined(_MSC_VER) 169 | /* _MSC_VER = VVRR */ 170 | # define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) 171 | # define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) 172 | # endif 173 | # define COMPILER_VERSION_TWEAK DEC(__apple_build_version__) 174 | 175 | #elif defined(__clang__) 176 | # define COMPILER_ID "Clang" 177 | # if defined(_MSC_VER) 178 | # define SIMULATE_ID "MSVC" 179 | # endif 180 | # define COMPILER_VERSION_MAJOR DEC(__clang_major__) 181 | # define COMPILER_VERSION_MINOR DEC(__clang_minor__) 182 | # define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) 183 | # if defined(_MSC_VER) 184 | /* _MSC_VER = VVRR */ 185 | # define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) 186 | # define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) 187 | # endif 188 | 189 | #elif defined(__GNUC__) 190 | # define COMPILER_ID "GNU" 191 | # define COMPILER_VERSION_MAJOR DEC(__GNUC__) 192 | # if defined(__GNUC_MINOR__) 193 | # define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__) 194 | # endif 195 | # if defined(__GNUC_PATCHLEVEL__) 196 | # define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) 197 | # endif 198 | 199 | #elif defined(_MSC_VER) 200 | # define COMPILER_ID "MSVC" 201 | /* _MSC_VER = VVRR */ 202 | # define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100) 203 | # define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100) 204 | # if defined(_MSC_FULL_VER) 205 | # if _MSC_VER >= 1400 206 | /* _MSC_FULL_VER = VVRRPPPPP */ 207 | # define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000) 208 | # else 209 | /* _MSC_FULL_VER = VVRRPPPP */ 210 | # define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000) 211 | # endif 212 | # endif 213 | # if defined(_MSC_BUILD) 214 | # define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD) 215 | # endif 216 | 217 | #elif defined(__VISUALDSPVERSION__) || defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__) 218 | # define COMPILER_ID "ADSP" 219 | #if defined(__VISUALDSPVERSION__) 220 | /* __VISUALDSPVERSION__ = 0xVVRRPP00 */ 221 | # define COMPILER_VERSION_MAJOR HEX(__VISUALDSPVERSION__>>24) 222 | # define COMPILER_VERSION_MINOR HEX(__VISUALDSPVERSION__>>16 & 0xFF) 223 | # define COMPILER_VERSION_PATCH HEX(__VISUALDSPVERSION__>>8 & 0xFF) 224 | #endif 225 | 226 | #elif defined(__IAR_SYSTEMS_ICC__ ) || defined(__IAR_SYSTEMS_ICC) 227 | # define COMPILER_ID "IAR" 228 | 229 | #elif defined(__ARMCC_VERSION) 230 | # define COMPILER_ID "ARMCC" 231 | #if __ARMCC_VERSION >= 1000000 232 | /* __ARMCC_VERSION = VRRPPPP */ 233 | # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/1000000) 234 | # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 100) 235 | # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) 236 | #else 237 | /* __ARMCC_VERSION = VRPPPP */ 238 | # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/100000) 239 | # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 10) 240 | # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) 241 | #endif 242 | 243 | 244 | #elif defined(SDCC) 245 | # define COMPILER_ID "SDCC" 246 | /* SDCC = VRP */ 247 | # define COMPILER_VERSION_MAJOR DEC(SDCC/100) 248 | # define COMPILER_VERSION_MINOR DEC(SDCC/10 % 10) 249 | # define COMPILER_VERSION_PATCH DEC(SDCC % 10) 250 | 251 | #elif defined(_SGI_COMPILER_VERSION) || defined(_COMPILER_VERSION) 252 | # define COMPILER_ID "MIPSpro" 253 | # if defined(_SGI_COMPILER_VERSION) 254 | /* _SGI_COMPILER_VERSION = VRP */ 255 | # define COMPILER_VERSION_MAJOR DEC(_SGI_COMPILER_VERSION/100) 256 | # define COMPILER_VERSION_MINOR DEC(_SGI_COMPILER_VERSION/10 % 10) 257 | # define COMPILER_VERSION_PATCH DEC(_SGI_COMPILER_VERSION % 10) 258 | # else 259 | /* _COMPILER_VERSION = VRP */ 260 | # define COMPILER_VERSION_MAJOR DEC(_COMPILER_VERSION/100) 261 | # define COMPILER_VERSION_MINOR DEC(_COMPILER_VERSION/10 % 10) 262 | # define COMPILER_VERSION_PATCH DEC(_COMPILER_VERSION % 10) 263 | # endif 264 | 265 | 266 | /* These compilers are either not known or too old to define an 267 | identification macro. Try to identify the platform and guess that 268 | it is the native compiler. */ 269 | #elif defined(__sgi) 270 | # define COMPILER_ID "MIPSpro" 271 | 272 | #elif defined(__hpux) || defined(__hpua) 273 | # define COMPILER_ID "HP" 274 | 275 | #else /* unknown compiler */ 276 | # define COMPILER_ID "" 277 | #endif 278 | 279 | /* Construct the string literal in pieces to prevent the source from 280 | getting matched. Store it in a pointer rather than an array 281 | because some compilers will just produce instructions to fill the 282 | array rather than assigning a pointer to a static array. */ 283 | char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]"; 284 | #ifdef SIMULATE_ID 285 | char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]"; 286 | #endif 287 | 288 | #ifdef __QNXNTO__ 289 | char const* qnxnto = "INFO" ":" "qnxnto[]"; 290 | #endif 291 | 292 | #if defined(__CRAYXE) || defined(__CRAYXC) 293 | char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]"; 294 | #endif 295 | 296 | #define STRINGIFY_HELPER(X) #X 297 | #define STRINGIFY(X) STRINGIFY_HELPER(X) 298 | 299 | /* Identify known platforms by name. */ 300 | #if defined(__linux) || defined(__linux__) || defined(linux) 301 | # define PLATFORM_ID "Linux" 302 | 303 | #elif defined(__CYGWIN__) 304 | # define PLATFORM_ID "Cygwin" 305 | 306 | #elif defined(__MINGW32__) 307 | # define PLATFORM_ID "MinGW" 308 | 309 | #elif defined(__APPLE__) 310 | # define PLATFORM_ID "Darwin" 311 | 312 | #elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32) 313 | # define PLATFORM_ID "Windows" 314 | 315 | #elif defined(__FreeBSD__) || defined(__FreeBSD) 316 | # define PLATFORM_ID "FreeBSD" 317 | 318 | #elif defined(__NetBSD__) || defined(__NetBSD) 319 | # define PLATFORM_ID "NetBSD" 320 | 321 | #elif defined(__OpenBSD__) || defined(__OPENBSD) 322 | # define PLATFORM_ID "OpenBSD" 323 | 324 | #elif defined(__sun) || defined(sun) 325 | # define PLATFORM_ID "SunOS" 326 | 327 | #elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__) 328 | # define PLATFORM_ID "AIX" 329 | 330 | #elif defined(__sgi) || defined(__sgi__) || defined(_SGI) 331 | # define PLATFORM_ID "IRIX" 332 | 333 | #elif defined(__hpux) || defined(__hpux__) 334 | # define PLATFORM_ID "HP-UX" 335 | 336 | #elif defined(__HAIKU__) 337 | # define PLATFORM_ID "Haiku" 338 | 339 | #elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS) 340 | # define PLATFORM_ID "BeOS" 341 | 342 | #elif defined(__QNX__) || defined(__QNXNTO__) 343 | # define PLATFORM_ID "QNX" 344 | 345 | #elif defined(__tru64) || defined(_tru64) || defined(__TRU64__) 346 | # define PLATFORM_ID "Tru64" 347 | 348 | #elif defined(__riscos) || defined(__riscos__) 349 | # define PLATFORM_ID "RISCos" 350 | 351 | #elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__) 352 | # define PLATFORM_ID "SINIX" 353 | 354 | #elif defined(__UNIX_SV__) 355 | # define PLATFORM_ID "UNIX_SV" 356 | 357 | #elif defined(__bsdos__) 358 | # define PLATFORM_ID "BSDOS" 359 | 360 | #elif defined(_MPRAS) || defined(MPRAS) 361 | # define PLATFORM_ID "MP-RAS" 362 | 363 | #elif defined(__osf) || defined(__osf__) 364 | # define PLATFORM_ID "OSF1" 365 | 366 | #elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv) 367 | # define PLATFORM_ID "SCO_SV" 368 | 369 | #elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX) 370 | # define PLATFORM_ID "ULTRIX" 371 | 372 | #elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX) 373 | # define PLATFORM_ID "Xenix" 374 | 375 | #elif defined(__WATCOMC__) 376 | # if defined(__LINUX__) 377 | # define PLATFORM_ID "Linux" 378 | 379 | # elif defined(__DOS__) 380 | # define PLATFORM_ID "DOS" 381 | 382 | # elif defined(__OS2__) 383 | # define PLATFORM_ID "OS2" 384 | 385 | # elif defined(__WINDOWS__) 386 | # define PLATFORM_ID "Windows3x" 387 | 388 | # else /* unknown platform */ 389 | # define PLATFORM_ID 390 | # endif 391 | 392 | #else /* unknown platform */ 393 | # define PLATFORM_ID 394 | 395 | #endif 396 | 397 | /* For windows compilers MSVC and Intel we can determine 398 | the architecture of the compiler being used. This is because 399 | the compilers do not have flags that can change the architecture, 400 | but rather depend on which compiler is being used 401 | */ 402 | #if defined(_WIN32) && defined(_MSC_VER) 403 | # if defined(_M_IA64) 404 | # define ARCHITECTURE_ID "IA64" 405 | 406 | # elif defined(_M_X64) || defined(_M_AMD64) 407 | # define ARCHITECTURE_ID "x64" 408 | 409 | # elif defined(_M_IX86) 410 | # define ARCHITECTURE_ID "X86" 411 | 412 | # elif defined(_M_ARM) 413 | # if _M_ARM == 4 414 | # define ARCHITECTURE_ID "ARMV4I" 415 | # elif _M_ARM == 5 416 | # define ARCHITECTURE_ID "ARMV5I" 417 | # else 418 | # define ARCHITECTURE_ID "ARMV" STRINGIFY(_M_ARM) 419 | # endif 420 | 421 | # elif defined(_M_MIPS) 422 | # define ARCHITECTURE_ID "MIPS" 423 | 424 | # elif defined(_M_SH) 425 | # define ARCHITECTURE_ID "SHx" 426 | 427 | # else /* unknown architecture */ 428 | # define ARCHITECTURE_ID "" 429 | # endif 430 | 431 | #elif defined(__WATCOMC__) 432 | # if defined(_M_I86) 433 | # define ARCHITECTURE_ID "I86" 434 | 435 | # elif defined(_M_IX86) 436 | # define ARCHITECTURE_ID "X86" 437 | 438 | # else /* unknown architecture */ 439 | # define ARCHITECTURE_ID "" 440 | # endif 441 | 442 | #else 443 | # define ARCHITECTURE_ID 444 | #endif 445 | 446 | /* Convert integer to decimal digit literals. */ 447 | #define DEC(n) \ 448 | ('0' + (((n) / 10000000)%10)), \ 449 | ('0' + (((n) / 1000000)%10)), \ 450 | ('0' + (((n) / 100000)%10)), \ 451 | ('0' + (((n) / 10000)%10)), \ 452 | ('0' + (((n) / 1000)%10)), \ 453 | ('0' + (((n) / 100)%10)), \ 454 | ('0' + (((n) / 10)%10)), \ 455 | ('0' + ((n) % 10)) 456 | 457 | /* Convert integer to hex digit literals. */ 458 | #define HEX(n) \ 459 | ('0' + ((n)>>28 & 0xF)), \ 460 | ('0' + ((n)>>24 & 0xF)), \ 461 | ('0' + ((n)>>20 & 0xF)), \ 462 | ('0' + ((n)>>16 & 0xF)), \ 463 | ('0' + ((n)>>12 & 0xF)), \ 464 | ('0' + ((n)>>8 & 0xF)), \ 465 | ('0' + ((n)>>4 & 0xF)), \ 466 | ('0' + ((n) & 0xF)) 467 | 468 | /* Construct a string literal encoding the version number components. */ 469 | #ifdef COMPILER_VERSION_MAJOR 470 | char const info_version[] = { 471 | 'I', 'N', 'F', 'O', ':', 472 | 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[', 473 | COMPILER_VERSION_MAJOR, 474 | # ifdef COMPILER_VERSION_MINOR 475 | '.', COMPILER_VERSION_MINOR, 476 | # ifdef COMPILER_VERSION_PATCH 477 | '.', COMPILER_VERSION_PATCH, 478 | # ifdef COMPILER_VERSION_TWEAK 479 | '.', COMPILER_VERSION_TWEAK, 480 | # endif 481 | # endif 482 | # endif 483 | ']','\0'}; 484 | #endif 485 | 486 | /* Construct a string literal encoding the version number components. */ 487 | #ifdef SIMULATE_VERSION_MAJOR 488 | char const info_simulate_version[] = { 489 | 'I', 'N', 'F', 'O', ':', 490 | 's','i','m','u','l','a','t','e','_','v','e','r','s','i','o','n','[', 491 | SIMULATE_VERSION_MAJOR, 492 | # ifdef SIMULATE_VERSION_MINOR 493 | '.', SIMULATE_VERSION_MINOR, 494 | # ifdef SIMULATE_VERSION_PATCH 495 | '.', SIMULATE_VERSION_PATCH, 496 | # ifdef SIMULATE_VERSION_TWEAK 497 | '.', SIMULATE_VERSION_TWEAK, 498 | # endif 499 | # endif 500 | # endif 501 | ']','\0'}; 502 | #endif 503 | 504 | /* Construct the string literal in pieces to prevent the source from 505 | getting matched. Store it in a pointer rather than an array 506 | because some compilers will just produce instructions to fill the 507 | array rather than assigning a pointer to a static array. */ 508 | char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]"; 509 | char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]"; 510 | 511 | 512 | 513 | 514 | #if !defined(__STDC__) 515 | # if defined(_MSC_VER) && !defined(__clang__) 516 | # define C_DIALECT "90" 517 | # else 518 | # define C_DIALECT 519 | # endif 520 | #elif __STDC_VERSION__ >= 201000L 521 | # define C_DIALECT "11" 522 | #elif __STDC_VERSION__ >= 199901L 523 | # define C_DIALECT "99" 524 | #else 525 | # define C_DIALECT "90" 526 | #endif 527 | const char* info_language_dialect_default = 528 | "INFO" ":" "dialect_default[" C_DIALECT "]"; 529 | 530 | /*--------------------------------------------------------------------------*/ 531 | 532 | #ifdef ID_VOID_MAIN 533 | void main() {} 534 | #else 535 | # if defined(__CLASSIC_C__) 536 | int main(argc, argv) int argc; char *argv[]; 537 | # else 538 | int main(int argc, char* argv[]) 539 | # endif 540 | { 541 | int require = 0; 542 | require += info_compiler[argc]; 543 | require += info_platform[argc]; 544 | require += info_arch[argc]; 545 | #ifdef COMPILER_VERSION_MAJOR 546 | require += info_version[argc]; 547 | #endif 548 | #ifdef SIMULATE_ID 549 | require += info_simulate[argc]; 550 | #endif 551 | #ifdef SIMULATE_VERSION_MAJOR 552 | require += info_simulate_version[argc]; 553 | #endif 554 | #if defined(__CRAYXE) || defined(__CRAYXC) 555 | require += info_cray[argc]; 556 | #endif 557 | require += info_language_dialect_default[argc]; 558 | (void)argv; 559 | return require; 560 | } 561 | #endif 562 | --------------------------------------------------------------------------------