├── .gitignore ├── .gitmodules ├── .travis.yml ├── 3rdparty ├── cfitsio │ ├── CMakeLists.txt │ ├── FindPthreads.cmake │ ├── License.txt │ ├── Makefile.in │ ├── README │ ├── README.MacOS │ ├── README.win │ ├── README_OLD.win │ ├── buffers.c │ ├── cfileio.c │ ├── cfitsio.pc.in │ ├── cfitsio_mac.sit.hqx │ ├── cfortran.h │ ├── checksum.c │ ├── config.guess │ ├── config.sub │ ├── configure │ ├── configure.in │ ├── cookbook.c │ ├── cookbook.f │ ├── docs │ │ ├── cfitsio.doc │ │ ├── cfitsio.pdf │ │ ├── cfitsio.ps │ │ ├── cfitsio.tex │ │ ├── cfitsio.toc │ │ ├── cfortran.doc │ │ ├── changes.txt │ │ ├── fitsio.doc │ │ ├── fitsio.pdf │ │ ├── fitsio.ps │ │ ├── fitsio.tex │ │ ├── fitsio.toc │ │ ├── fpackguide.pdf │ │ ├── quick.pdf │ │ ├── quick.ps │ │ ├── quick.tex │ │ └── quick.toc │ ├── drvrfile.c │ ├── drvrgsiftp.c │ ├── drvrgsiftp.h │ ├── drvrmem.c │ ├── drvrnet.c │ ├── drvrsmem.c │ ├── drvrsmem.h │ ├── editcol.c │ ├── edithdu.c │ ├── eval.l │ ├── eval.y │ ├── eval_defs.h │ ├── eval_f.c │ ├── eval_l.c │ ├── eval_tab.h │ ├── eval_y.c │ ├── f77.inc │ ├── f77_wrap.h │ ├── f77_wrap1.c │ ├── f77_wrap2.c │ ├── f77_wrap3.c │ ├── f77_wrap4.c │ ├── fits_hcompress.c │ ├── fits_hdecompress.c │ ├── fitscopy.c │ ├── fitscore.c │ ├── fitsio.h │ ├── fitsio2.h │ ├── fpack.c │ ├── fpack.h │ ├── fpackutil.c │ ├── funpack.c │ ├── getcol.c │ ├── getcolb.c │ ├── getcold.c │ ├── getcole.c │ ├── getcoli.c │ ├── getcolj.c │ ├── getcolk.c │ ├── getcoll.c │ ├── getcols.c │ ├── getcolsb.c │ ├── getcolui.c │ ├── getcoluj.c │ ├── getcoluk.c │ ├── getkey.c │ ├── group.c │ ├── group.h │ ├── grparser.c │ ├── grparser.h │ ├── histo.c │ ├── imcompress.c │ ├── imcopy.c │ ├── install-sh │ ├── iraffits.c │ ├── iter_a.c │ ├── iter_a.f │ ├── iter_a.fit │ ├── iter_b.c │ ├── iter_b.f │ ├── iter_b.fit │ ├── iter_c.c │ ├── iter_c.f │ ├── iter_c.fit │ ├── iter_image.c │ ├── iter_var.c │ ├── longnam.h │ ├── makefile.bc │ ├── makefile.vcc │ ├── makepc.bat │ ├── modkey.c │ ├── pliocomp.c │ ├── putcol.c │ ├── putcolb.c │ ├── putcold.c │ ├── putcole.c │ ├── putcoli.c │ ├── putcolj.c │ ├── putcolk.c │ ├── putcoll.c │ ├── putcols.c │ ├── putcolsb.c │ ├── putcolu.c │ ├── putcolui.c │ ├── putcoluj.c │ ├── putcoluk.c │ ├── putkey.c │ ├── quantize.c │ ├── region.c │ ├── region.h │ ├── ricecomp.c │ ├── sample.tpl │ ├── scalnull.c │ ├── simplerng.c │ ├── simplerng.h │ ├── smem.c │ ├── speed.c │ ├── swapproc.c │ ├── testf77.f │ ├── testf77.out │ ├── testf77.std │ ├── testprog.c │ ├── testprog.out │ ├── testprog.std │ ├── testprog.tpt │ ├── vmsieee.c │ ├── wcssub.c │ ├── wcsutil.c │ ├── winDumpExts.mak │ ├── windumpexts.c │ └── zlib │ │ ├── adler32.c │ │ ├── crc32.c │ │ ├── crc32.h │ │ ├── deflate.c │ │ ├── deflate.h │ │ ├── infback.c │ │ ├── inffast.c │ │ ├── inffast.h │ │ ├── inffixed.h │ │ ├── inflate.c │ │ ├── inflate.h │ │ ├── inftrees.c │ │ ├── inftrees.h │ │ ├── trees.c │ │ ├── trees.h │ │ ├── uncompr.c │ │ ├── zcompress.c │ │ ├── zconf.h │ │ ├── zlib.h │ │ ├── zuncompress.c │ │ ├── zutil.c │ │ └── zutil.h └── chealpix │ ├── CHANGES │ ├── CMakeLists.txt │ ├── COPYING │ ├── README │ ├── READ_Copyrights_Licenses.txt │ ├── include │ └── chealpix.h │ └── src │ └── chealpix.c ├── CHANGELOG ├── CMakeLists.txt ├── CTestConfig.cmake ├── LICENSE ├── README.md ├── appveyor.yml ├── assets ├── hippo1.obj └── hippo2.obj ├── cmake ├── AssetsAndScripts.cmake ├── Config.cmake.in ├── ConfigureChealpix.cmake ├── ConfigureCompiler.cmake ├── ConfigureRPath.cmake ├── ConfigureTesting.cmake ├── FindCFITSIO.cmake ├── FindEigen3.cmake └── FindMeshlab.cmake ├── demos ├── CGalWrapper │ └── CMakelists.txt ├── CMakeLists.txt ├── MeshlabPlugin │ ├── CMakeLists.txt │ ├── filter_globalregistration.pro.in │ ├── filter_globalregistration │ │ ├── globalregistration.cpp │ │ └── globalregistration.h │ └── readme.md.in ├── PCLWrapper │ ├── CMakeLists.txt │ ├── CMakelists.txt │ ├── main.cpp │ └── pcl │ │ └── registration │ │ ├── impl │ │ └── super4pcs.hpp │ │ └── super4pcs.h ├── Super4PCS │ ├── CMakeLists.txt │ └── super4pcs_test.cc └── demo-utils.h ├── doc ├── Compilation.md ├── Current-release.md ├── Datasets.md ├── Demos.md ├── Doxyfile.in ├── File-formats.md ├── Getting-started.md ├── Road-map.md ├── Tests.md ├── Usage-Part-in-Whole.md ├── Usage.md ├── img │ ├── Meshlab-UI2.jpg │ ├── VStudio-globalFolders.jpg │ └── super4PCS_overlap.png └── overview.md ├── scripts ├── run-example.bat └── run-example.sh ├── src └── super4pcs │ ├── accelerators │ ├── CMakeLists.txt │ ├── bbox.h │ ├── kdtree.h │ ├── normalHealSet.h │ ├── normalset.h │ ├── normalset.hpp │ ├── pairExtraction │ │ ├── bruteForceFunctor.h │ │ ├── intersectionFunctor.h │ │ ├── intersectionNode.h │ │ └── intersectionPrimitive.h │ └── utils.h │ ├── algorithms │ ├── 4pcs.cc │ ├── 4pcs.h │ ├── CMakeLists.txt │ ├── match4pcsBase.cc │ ├── match4pcsBase.h │ ├── match4pcsBase.hpp │ ├── pairCreationFunctor.h │ ├── super4pcs.cc │ └── super4pcs.h │ ├── io │ ├── CMakeLists.txt │ ├── io.cc │ ├── io.h │ └── io_ply.h │ ├── sampling.h │ ├── shared4pcs.h │ └── utils │ ├── CMakeLists.txt │ ├── disablewarnings.h │ ├── geometry.h │ ├── logger.h │ └── timer.h └── tests ├── CMakeLists.txt ├── externalAppTest ├── CMakeLists.txt ├── cmake_call └── main.cpp ├── matching.cc ├── pair_extraction.cc ├── quad_extraction.cc └── testing.h /.gitignore: -------------------------------------------------------------------------------- 1 | build*/ 2 | *.user 3 | assets/demo* 4 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "3rdparty/Eigen"] 2 | path = 3rdparty/Eigen 3 | url = https://github.com/eigenteam/eigen-git-mirror.git 4 | -------------------------------------------------------------------------------- /3rdparty/cfitsio/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | PROJECT(CFITSIO) 2 | CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0) 3 | 4 | # Allow the developer to select if Dynamic or Static libraries are built 5 | OPTION (BUILD_SHARED_LIBS "Build Shared Libraries" ON) 6 | OPTION (USE_PTHREADS "Thread-safe build (using pthreads)" OFF) 7 | 8 | set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}") 9 | set (LIB_DESTINATION "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}") 10 | set (INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/include/") 11 | 12 | # Define project version 13 | SET(${PROJECT_NAME}_MAJOR_VERSION 3) 14 | SET(${PROJECT_NAME}_MINOR_VERSION 41) 15 | SET(${PROJECT_NAME}_VERSION ${${PROJECT_NAME}_MAJOR_VERSION}.${${PROJECT_NAME}_MINOR_VERSION}) 16 | SET(LIB_NAME cfitsio) 17 | 18 | # Microsoft Visual Studio: 19 | IF(MSVC OR BORLAND) 20 | # Define 21 | ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE) 22 | # Need an empty unistd.h in MSVC for flex-generated eval_l.c: 23 | FILE(WRITE ${CMAKE_SOURCE_DIR}/unistd.h "") 24 | INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}) 25 | ENDIF() 26 | 27 | IF(BORLAND) 28 | # Suppress spurious Borland compiler warnings about "Suspicious 29 | # pointer arithmetic", "Possibly incorrect assignment", and 30 | # "Comparing signed and unsigned values". 31 | ADD_DEFINITIONS(-w-spa) 32 | ADD_DEFINITIONS(-w-pia) 33 | ADD_DEFINITIONS(-w-csu) 34 | ENDIF() 35 | 36 | #add_subdirectory (src) 37 | 38 | SET (LIB_TYPE STATIC) 39 | IF (BUILD_SHARED_LIBS) 40 | SET (LIB_TYPE SHARED) 41 | ENDIF (BUILD_SHARED_LIBS) 42 | 43 | 44 | FILE(GLOB H_FILES "*.h") 45 | 46 | IF (USE_PTHREADS) 47 | FIND_PACKAGE(pthreads REQUIRED) 48 | INCLUDE_DIRECTORIES(${PTHREADS_INCLUDE_DIR}) 49 | ADD_DEFINITIONS(-D_REENTRANT) 50 | ENDIF() 51 | 52 | # Math library (not available in MSVC or MINGW) 53 | IF (MSVC OR MINGW) 54 | SET(M_LIB "") 55 | ELSE() 56 | FIND_LIBRARY(M_LIB m) 57 | ENDIF() 58 | 59 | SET(SRC_FILES 60 | buffers.c cfileio.c checksum.c drvrfile.c drvrmem.c 61 | drvrnet.c drvrsmem.c drvrgsiftp.c editcol.c edithdu.c eval_l.c 62 | eval_y.c eval_f.c fitscore.c getcol.c getcolb.c getcold.c getcole.c 63 | getcoli.c getcolj.c getcolk.c getcoll.c getcols.c getcolsb.c 64 | getcoluk.c getcolui.c getcoluj.c getkey.c group.c grparser.c 65 | histo.c iraffits.c 66 | modkey.c putcol.c putcolb.c putcold.c putcole.c putcoli.c 67 | putcolj.c putcolk.c putcoluk.c putcoll.c putcols.c putcolsb.c 68 | putcolu.c putcolui.c putcoluj.c putkey.c region.c scalnull.c 69 | swapproc.c wcssub.c wcsutil.c imcompress.c quantize.c ricecomp.c 70 | pliocomp.c fits_hcompress.c fits_hdecompress.c zlib/zuncompress.c 71 | zlib/zcompress.c zlib/adler32.c zlib/crc32.c zlib/inffast.c 72 | zlib/inftrees.c zlib/trees.c zlib/zutil.c zlib/deflate.c 73 | zlib/infback.c zlib/inflate.c zlib/uncompr.c simplerng.c 74 | f77_wrap1.c f77_wrap2.c f77_wrap3.c f77_wrap4.c 75 | ) 76 | 77 | ADD_LIBRARY(${LIB_NAME} ${LIB_TYPE} ${H_FILES} ${SRC_FILES}) 78 | TARGET_LINK_LIBRARIES(${LIB_NAME} ${PTHREADS_LIBRARY} ${M_LIB}) 79 | 80 | SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES VERSION ${${PROJECT_NAME}_VERSION} SOVERSION ${${PROJECT_NAME}_MAJOR_VERSION}) 81 | install(TARGETS ${LIB_NAME} DESTINATION ${LIB_DESTINATION}) 82 | install(FILES ${H_FILES} DESTINATION ${INCLUDE_INSTALL_DIR} COMPONENT Devel) 83 | 84 | ENABLE_TESTING() 85 | 86 | ADD_EXECUTABLE(TestProg testprog.c) 87 | TARGET_LINK_LIBRARIES(TestProg ${LIB_NAME}) 88 | ADD_TEST(TestProg TestProg) 89 | # Copy testprog.tpt to build directory to allow quick test 90 | # of ./TestProg (or .\Release\TestProg.exe in MSVC): 91 | FILE(COPY ${CMAKE_SOURCE_DIR}/testprog.tpt DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) 92 | 93 | ADD_EXECUTABLE(cookbook cookbook.c) 94 | TARGET_LINK_LIBRARIES(cookbook ${LIB_NAME}) 95 | ADD_TEST(cookbook cookbook) 96 | 97 | ADD_EXECUTABLE(FPack fpack.c fpackutil.c) 98 | TARGET_LINK_LIBRARIES(FPack ${LIB_NAME}) 99 | 100 | ADD_EXECUTABLE(Funpack funpack.c fpackutil.c) 101 | TARGET_LINK_LIBRARIES(Funpack ${LIB_NAME}) 102 | 103 | ADD_EXECUTABLE(Fitscopy fitscopy.c) 104 | TARGET_LINK_LIBRARIES(Fitscopy ${LIB_NAME}) 105 | 106 | # To expands the command line arguments in Windows, see: 107 | # http://msdn.microsoft.com/en-us/library/8bch7bkk.aspx 108 | if(MSVC) 109 | set_target_properties(FPack Funpack PROPERTIES 110 | LINK_FLAGS "setargv.obj" 111 | ) 112 | endif(MSVC) 113 | -------------------------------------------------------------------------------- /3rdparty/cfitsio/FindPthreads.cmake: -------------------------------------------------------------------------------- 1 | # - Find the Pthreads library 2 | # This module searches for the Pthreads library (including the 3 | # pthreads-win32 port). 4 | # 5 | # This module defines these variables: 6 | # 7 | # PTHREADS_FOUND 8 | # True if the Pthreads library was found 9 | # PTHREADS_LIBRARY 10 | # The location of the Pthreads library 11 | # PTHREADS_INCLUDE_DIR 12 | # The include path of the Pthreads library 13 | # PTHREADS_DEFINITIONS 14 | # Preprocessor definitions to define 15 | # 16 | # This module responds to the PTHREADS_EXCEPTION_SCHEME 17 | # variable on Win32 to allow the user to control the 18 | # library linked against. The Pthreads-win32 port 19 | # provides the ability to link against a version of the 20 | # library with exception handling. IT IS NOT RECOMMENDED 21 | # THAT YOU USE THIS because most POSIX thread implementations 22 | # do not support stack unwinding. 23 | # 24 | # PTHREADS_EXCEPTION_SCHEME 25 | # C = no exceptions (default) 26 | # (NOTE: This is the default scheme on most POSIX thread 27 | # implementations and what you should probably be using) 28 | # CE = C++ Exception Handling 29 | # SE = Structure Exception Handling (MSVC only) 30 | # 31 | 32 | # 33 | # Define a default exception scheme to link against 34 | # and validate user choice. 35 | # 36 | IF(NOT DEFINED PTHREADS_EXCEPTION_SCHEME) 37 | # Assign default if needed 38 | SET(PTHREADS_EXCEPTION_SCHEME "C") 39 | ELSE(NOT DEFINED PTHREADS_EXCEPTION_SCHEME) 40 | # Validate 41 | IF(NOT PTHREADS_EXCEPTION_SCHEME STREQUAL "C" AND 42 | NOT PTHREADS_EXCEPTION_SCHEME STREQUAL "CE" AND 43 | NOT PTHREADS_EXCEPTION_SCHEME STREQUAL "SE") 44 | 45 | MESSAGE(FATAL_ERROR "See documentation for FindPthreads.cmake, only C, CE, and SE modes are allowed") 46 | 47 | ENDIF(NOT PTHREADS_EXCEPTION_SCHEME STREQUAL "C" AND 48 | NOT PTHREADS_EXCEPTION_SCHEME STREQUAL "CE" AND 49 | NOT PTHREADS_EXCEPTION_SCHEME STREQUAL "SE") 50 | 51 | IF(NOT MSVC AND PTHREADS_EXCEPTION_SCHEME STREQUAL "SE") 52 | MESSAGE(FATAL_ERROR "Structured Exception Handling is only allowed for MSVC") 53 | ENDIF(NOT MSVC AND PTHREADS_EXCEPTION_SCHEME STREQUAL "SE") 54 | 55 | ENDIF(NOT DEFINED PTHREADS_EXCEPTION_SCHEME) 56 | 57 | # 58 | # Find the header file 59 | # 60 | FIND_PATH(PTHREADS_INCLUDE_DIR pthread.h) 61 | 62 | # 63 | # Find the library 64 | # 65 | SET(names) 66 | IF(MSVC) 67 | SET(names 68 | pthreadV${PTHREADS_EXCEPTION_SCHEME}2 69 | pthread 70 | ) 71 | ELSEIF(MINGW) 72 | SET(names 73 | pthreadG${PTHREADS_EXCEPTION_SCHEME}2 74 | pthread 75 | ) 76 | ELSE(MSVC) # Unix / Cygwin / Apple 77 | SET(names pthread) 78 | ENDIF(MSVC) 79 | 80 | FIND_LIBRARY(PTHREADS_LIBRARY ${names} 81 | DOC "The Portable Threads Library") 82 | 83 | IF(PTHREADS_INCLUDE_DIR AND PTHREADS_LIBRARY) 84 | SET(PTHREADS_FOUND true) 85 | SET(PTHREADS_DEFINITIONS -DHAVE_PTHREAD_H) 86 | SET(PTHREADS_INCLUDE_DIRS ${PTHREADS_INCLUDE_DIR}) 87 | SET(PTHREADS_LIBRARIES ${PTHREADS_LIBRARY}) 88 | ENDIF(PTHREADS_INCLUDE_DIR AND PTHREADS_LIBRARY) 89 | 90 | IF(PTHREADS_FOUND) 91 | IF(NOT PTHREADS_FIND_QUIETLY) 92 | MESSAGE(STATUS "Found Pthreads: ${PTHREADS_LIBRARY}") 93 | ENDIF(NOT PTHREADS_FIND_QUIETLY) 94 | ELSE(PTHREADS_FOUND) 95 | IF(PTHREADS_FIND_REQUIRED) 96 | MESSAGE(FATAL_ERROR "Could not find the Pthreads Library") 97 | ENDIF(PTHREADS_FIND_REQUIRED) 98 | ENDIF(PTHREADS_FOUND) 99 | -------------------------------------------------------------------------------- /3rdparty/cfitsio/License.txt: -------------------------------------------------------------------------------- 1 | Copyright (Unpublished--all rights reserved under the copyright laws of 2 | the United States), U.S. Government as represented by the Administrator 3 | of the National Aeronautics and Space Administration. No copyright is 4 | claimed in the United States under Title 17, U.S. Code. 5 | 6 | Permission to freely use, copy, modify, and distribute this software 7 | and its documentation without fee is hereby granted, provided that this 8 | copyright notice and disclaimer of warranty appears in all copies. 9 | 10 | DISCLAIMER: 11 | 12 | THE SOFTWARE IS PROVIDED 'AS IS' WITHOUT ANY WARRANTY OF ANY KIND, 13 | EITHER EXPRESSED, IMPLIED, OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, 14 | ANY WARRANTY THAT THE SOFTWARE WILL CONFORM TO SPECIFICATIONS, ANY 15 | IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 16 | PURPOSE, AND FREEDOM FROM INFRINGEMENT, AND ANY WARRANTY THAT THE 17 | DOCUMENTATION WILL CONFORM TO THE SOFTWARE, OR ANY WARRANTY THAT THE 18 | SOFTWARE WILL BE ERROR FREE. IN NO EVENT SHALL NASA BE LIABLE FOR ANY 19 | DAMAGES, INCLUDING, BUT NOT LIMITED TO, DIRECT, INDIRECT, SPECIAL OR 20 | CONSEQUENTIAL DAMAGES, ARISING OUT OF, RESULTING FROM, OR IN ANY WAY 21 | CONNECTED WITH THIS SOFTWARE, WHETHER OR NOT BASED UPON WARRANTY, 22 | CONTRACT, TORT , OR OTHERWISE, WHETHER OR NOT INJURY WAS SUSTAINED BY 23 | PERSONS OR PROPERTY OR OTHERWISE, AND WHETHER OR NOT LOSS WAS SUSTAINED 24 | FROM, OR AROSE OUT OF THE RESULTS OF, OR USE OF, THE SOFTWARE OR 25 | SERVICES PROVIDED HEREUNDER. 26 | -------------------------------------------------------------------------------- /3rdparty/cfitsio/README: -------------------------------------------------------------------------------- 1 | CFITSIO Interface Library 2 | 3 | CFITSIO is a library of ANSI C routines for reading and writing FITS 4 | format data files. A set of Fortran-callable wrapper routines are also 5 | included for the convenience of Fortran programmers. This README file 6 | gives a brief summary of how to build and test CFITSIO, but the CFITSIO 7 | User's Guide, found in the files cfitsio.doc (plain text), cfitsio.tex 8 | (LaTeX source file), cfitsio.ps, or cfitsio.pdf should be 9 | referenced for the latest and most complete information. 10 | 11 | BUILDING CFITSIO 12 | ---------------- 13 | 14 | The CFITSIO code is contained in about 40 *.c source files and several *.h 15 | header files. CFITSIO should compile and run on most Unix platforms without 16 | modification, except that Cray supercomputers computers are currently not 17 | supported. The CFITSIO library is built on Unix systems by typing: 18 | 19 | > ./configure [--prefix=/target/installation/path] 20 | > make (or 'make shared') 21 | > make install (this step is optional) 22 | 23 | at the operating system prompt. The configure command customizes the 24 | Makefile for the particular system, then the `make' command compiles the 25 | source files and builds the library. Type `./configure' and not simply 26 | `configure' to ensure that the configure script in the current directory 27 | is run and not some other system-wide configure script. The optional 28 | 'prefix' argument to configure gives the path to the directory where 29 | the CFITSIO library and include files should be installed via the later 30 | 'make install' command. For example, 31 | 32 | > ./configure --prefix=/usr1/local 33 | 34 | will cause the 'make install' command to copy the CFITSIO libcfitsio file 35 | to /usr1/local/lib and the necessary include files to /usr1/local/include 36 | (assuming of course that the process has permission to write to these 37 | directories). 38 | 39 | All the available configure options can be seen by entering the command 40 | 41 | > ./configure --help 42 | 43 | On VAX/VMS and ALPHA/VMS systems the make.com command file may be used 44 | to build the cfitsio.olb object library using the default G-floating 45 | point option for double variables. The make\_dfloat.com and make\_ieee.com 46 | files may be used instead to build the library with the other floating 47 | point options. 48 | 49 | A precompiled DLL version of CFITSIO is available for IBM-PC users of 50 | the Borland or Microsoft Visual C++ compilers in the files 51 | cfitsiodll_xxxx_borland.zip and cfitsiodll_xxxx_vcc.zip, where 'xxxx' 52 | represents the current release number. These zip archives also 53 | contains other files and instructions on how to use the CFITSIO DLL 54 | library. The CFITSIO library may also be built from the source code 55 | using the makefile.bc or makefile.vcc files. Finally, the makepc.bat 56 | file gives an example of building CFITSIO with the Borland C++ v4.5 57 | compiler using simpler DOS commands. 58 | 59 | Instructions for building CFITSIO on Mac OS can be found in 60 | the README.MacOS file. 61 | 62 | TESTING CFITSIO 63 | --------------- 64 | 65 | The CFITSIO library should be tested by building and running 66 | the testprog.c program that is included with the release. 67 | On Unix systems, type: 68 | - 69 | % make testprog 70 | % testprog > testprog.lis 71 | % diff testprog.lis testprog.out 72 | % cmp testprog.fit testprog.std 73 | - 74 | On VMS systems, 75 | (assuming cc is the name of the C compiler command), type: 76 | - 77 | $ cc testprog.c 78 | $ link testprog, cfitsio/lib 79 | $ run testprog 80 | - 81 | The testprog program should produce a FITS file called `testprog.fit' 82 | that is identical to the testprog.std FITS file included in this 83 | release. The diagnostic messages (which were piped to the file 84 | testprog.lis in the Unix example) should be identical to the listing 85 | contained in the file testprog.out. The 'diff' and 'cmp' commands 86 | shown above should not report any differences in the files. 87 | 88 | USING CFITSIO 89 | ------------- 90 | 91 | The CFITSIO User's Guide, contained in the files cfitsio.doc (plain 92 | text file) and cfitsio.ps (postscript file), provides detailed 93 | documentation about how to build and use the CFITSIO library. 94 | It contains a description of every user-callable routine in the 95 | CFITSIO interface. 96 | 97 | The cookbook.c file provides some sample routines for performing common 98 | operations on various types of FITS files. Programmers are urged to 99 | examine these routines for recommended programming practices when using 100 | CFITSIO. Users are free to copy or modify these routines for their own 101 | purposes. 102 | 103 | Any problem reports or suggestions for 104 | improvements are welcome and should be sent to the HEASARC 105 | help desk. 106 | 107 | ------------------------------------------------------------------------- 108 | William D. Pence 109 | HEASARC, NASA/GSFC 110 | -------------------------------------------------------------------------------- /3rdparty/cfitsio/README.MacOS: -------------------------------------------------------------------------------- 1 | By default, the CFITSIO library will be a "Universal Binary" (i.e. 2 | 32- and 64-bit compatible) under Mac OS X when built in the standard 3 | way, i.e. 4 | 5 | - tar xzf cfitsio3370.tar.gz (or whatever version this is) 6 | - cd cfitsio/ 7 | 8 | - ./configure 9 | - make 10 | - make install 11 | 12 | --------------------------------------------------------------------- 13 | To install CFITSIO using MacPorts: 14 | --------------------------------------------------------------------- 15 | 16 | If you have MacPorts installed, you may install CFITSIO simply with 17 | the command 18 | 19 | $ sudo port install cfitsio +universal 20 | 21 | For more information, please visit: 22 | 23 | http://macports.org 24 | https://trac.macports.org/browser/trunk/dports/science/cfitsio/Portfile 25 | 26 | --------------------------------------------------------------------- 27 | To install CFITSIO using Homebrew: 28 | --------------------------------------------------------------------- 29 | 30 | If you have Homebrew installed, you may install CFITSIO simply with 31 | the command 32 | 33 | $ brew install cfitsio 34 | 35 | For more information, please visit: 36 | 37 | http://brew.sh 38 | http://brewformulas.org/Cfitsio 39 | 40 | --------------------------------------------------------------------- 41 | To build CFITSIO using the XCode GUI: 42 | --------------------------------------------------------------------- 43 | 44 | - tar xzf cfitsio3370.tar.gz (or whatever version this is) 45 | - cd cfitsio/ 46 | 47 | - Start Xcode and open cfitsio.xcodeproj/project.pbxproj, 48 | or just "open" the file from a terminal command line, 49 | 50 | $ open cfitsio.xcodeproj/project.pbxproj 51 | 52 | and this will start up XCode for you. 53 | 54 | - Press the Build (or "Play") button in the upper left 55 | corner of the GUI. 56 | 57 | --------------------------------------------------------------------- 58 | --------------------------------------------------------------------- 59 | 60 | Below, are the old (and now obsolete) instructions for building CFITSIO 61 | on classic Mac OS-9 or earlier versions: 62 | 63 | 1. Un binhex and unstuff cfitsio_mac.sit.hqx 64 | 2. put CFitsioPPC.mcp in the cfitsio directory. 65 | 2. Load CFitsioPPC.mcp into CodeWarrior Pro 5 and make. 66 | This builds the cfitsio library for PPC. There are also targets for both 67 | the test program and the speed test program. 68 | 69 | To use the MacOS port you can add Cfitsio PPC.lib to your Codewarrior Pro 5 70 | project. Note that this only has been tested for the PPC. It probably 71 | won't work on 68k macs. Also note that the fortran bindings aren't 72 | included. I haven't worked with the codewarrior f2c plugin so I don't know 73 | how these would work. If one is interested, please write and I can look 74 | into this. 75 | 76 | -------------------------------------------------------------------------------- /3rdparty/cfitsio/README_OLD.win: -------------------------------------------------------------------------------- 1 | =============================================================================== 2 | =============================================================================== 3 | = NOTE: This is the old version of the README.win32 file that was distributed 4 | = with CFITSIO up until version 3.35 in 2013. These instruction may still work 5 | = with more recent versions of CFITSIO, however, users are strongly urged to 6 | = use the CMake procedures that are now documented in the new README.win32 file. 7 | =============================================================================== 8 | =============================================================================== 9 | 10 | Instructions on using CFITSIO on Windows platforms for C programmers 11 | 12 | These instructions use a simple DOS-style command window. It is also possible 13 | to build and use CFITSIO within a GUI programming environment such as Visual 14 | Studio, but this is not supported here. 15 | 16 | =============================================================================== 17 | 1. Build the CFITSIO dll library 18 | 19 | This step will create the cfitsio.def, cfitsio.dll, and cfitsio.lib files. 20 | (If you downloaded the CFITSIO .zip file that contains the pre-built binary 21 | .dll file, then SKIP THIS STEP). 22 | 23 | A. With Microsoft Visual C++: 24 | 25 | 1. Open a DOS command window and execute the vcvars32.bat file that 26 | is distributed with older versions of Visual C++, or simply open 27 | the Visual C++ command window (e.g., when using Visual Studio 2010). 28 | 29 | 2. Unpack the CFITSIO source files (cfitxxxx.zip) into a new empty directory 30 | 31 | 3. In the DOS command window, cd to that directory and enter the 32 | following commands: 33 | 34 | nmake winDumpExts.mak 35 | nmake makefile.vcc 36 | (ignore the compiler warning messages) 37 | 38 | B: With Borland C++: 39 | 40 | First, follow the instructions provided by Borland to set up 41 | the proper environment variables and configure files for the compiler. 42 | 43 | Unpack the cfitsio.zip source file distribution into a suitable directory. 44 | 45 | In a DOS command window, cd to that directory and then execute the 46 | makepc.bat batch file on the command line to build the CFITSIO library, 47 | and the testprog and cookbook sample programs. 48 | 49 | =============================================================================== 50 | 2. Test the CFITSIO library with Visual C++ 51 | 52 | Compile and link the testprog.c test program. When using Visual Studio, 53 | the command is: 54 | 55 | cl /MD testprog.c cfitsio.lib 56 | 57 | 58 | This will create the testprog.exe executable program. Running this 59 | program should print out a long series of diagnostic messages 60 | that should end with "Status = 0; OK - no error" 61 | 62 | =============================================================================== 63 | 3. Compile and link an application program that calls CFITSIO routines 64 | with Visual C++ 65 | 66 | Include the fitsio.h and longnam.h header files in the C source code. 67 | 68 | Link the program with the cfitsio.lib file: 69 | 70 | cl /MD your_program.c cfitsio.lib 71 | 72 | 73 | NOTE: The /MD command line switch must be specified on the cl 74 | command line to force the compiler/linker to use the 75 | appropriete runtime library. If this switch is omitted, then 76 | the fits_report_error function in CFITSIO will likely crash. 77 | 78 | When building programs in the Visual Studio environment, one 79 | can force the equivalent of the /MD switch by selecting 80 | 'Settings...' under the 'Project' menu, then click on the C/C++ 81 | tab and select the 'Code Generator' category. Then under 'User 82 | Run-time Library' select 'Multithreaded DLL'. 83 | 84 | -------------------------------------------------------------------------------- /3rdparty/cfitsio/cfitsio.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: cfitsio 7 | Description: FITS File Subroutine Library 8 | Version: @CFITSIO_MAJOR@.@CFITSIO_MINOR@ 9 | Libs: -L${libdir} -lcfitsio @LIBS@ 10 | Libs.private: -lm 11 | Cflags: -I${includedir} 12 | -------------------------------------------------------------------------------- /3rdparty/cfitsio/docs/cfitsio.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nmellado/Super4PCS/d5ab2a407c4f8cbfd60dc97d826b1cc726bb25d8/3rdparty/cfitsio/docs/cfitsio.pdf -------------------------------------------------------------------------------- /3rdparty/cfitsio/docs/fitsio.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nmellado/Super4PCS/d5ab2a407c4f8cbfd60dc97d826b1cc726bb25d8/3rdparty/cfitsio/docs/fitsio.pdf -------------------------------------------------------------------------------- /3rdparty/cfitsio/docs/fpackguide.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nmellado/Super4PCS/d5ab2a407c4f8cbfd60dc97d826b1cc726bb25d8/3rdparty/cfitsio/docs/fpackguide.pdf -------------------------------------------------------------------------------- /3rdparty/cfitsio/docs/quick.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nmellado/Super4PCS/d5ab2a407c4f8cbfd60dc97d826b1cc726bb25d8/3rdparty/cfitsio/docs/quick.pdf -------------------------------------------------------------------------------- /3rdparty/cfitsio/docs/quick.toc: -------------------------------------------------------------------------------- 1 | \contentsline {section}{\numberline {1}Introduction}{2} 2 | \contentsline {section}{\numberline {2}Installing and Using CFITSIO}{3} 3 | \contentsline {section}{\numberline {3}Example Programs}{4} 4 | \contentsline {section}{\numberline {4}CFITSIO Routines}{6} 5 | \contentsline {subsection}{\numberline {4.1}Error Reporting}{6} 6 | \contentsline {subsection}{\numberline {4.2}File Open/Close Routines}{6} 7 | \contentsline {subsection}{\numberline {4.3}HDU-level Routines}{7} 8 | \contentsline {subsection}{\numberline {4.4}Image I/O Routines}{9} 9 | \contentsline {subsection}{\numberline {4.5}Table I/O Routines}{12} 10 | \contentsline {subsection}{\numberline {4.6}Header Keyword I/O Routines}{19} 11 | \contentsline {subsection}{\numberline {4.7}Utility Routines}{22} 12 | \contentsline {section}{\numberline {5}CFITSIO File Names and Filters}{23} 13 | \contentsline {subsection}{\numberline {5.1}Creating New Files}{23} 14 | \contentsline {subsection}{\numberline {5.2}Opening Existing Files}{24} 15 | \contentsline {subsection}{\numberline {5.3}Image Filtering}{26} 16 | \contentsline {subsubsection}{\numberline {5.3.1}Extracting a subsection of an image}{26} 17 | \contentsline {subsubsection}{\numberline {5.3.2}Create an Image by Binning Table Columns}{26} 18 | \contentsline {subsection}{\numberline {5.4}Table Filtering}{28} 19 | \contentsline {subsubsection}{\numberline {5.4.1}Column and Keyword Filtering}{28} 20 | \contentsline {subsubsection}{\numberline {5.4.2}Row Filtering}{29} 21 | \contentsline {subsubsection}{\numberline {5.4.3}Good Time Interval Filtering}{32} 22 | \contentsline {subsubsection}{\numberline {5.4.4}Spatial Region Filtering}{32} 23 | \contentsline {subsubsection}{\numberline {5.4.5}Example Row Filters}{34} 24 | \contentsline {subsection}{\numberline {5.5}Combined Filtering Examples}{36} 25 | \contentsline {section}{\numberline {6}CFITSIO Error Status Codes}{38} 26 | -------------------------------------------------------------------------------- /3rdparty/cfitsio/drvrgsiftp.h: -------------------------------------------------------------------------------- 1 | #ifndef _GSIFTP_H 2 | #define _GSIFTP_H 3 | 4 | int gsiftp_init(void); 5 | int gsiftp_setoptions(int options); 6 | int gsiftp_getoptions(int *options); 7 | int gsiftp_getversion(int *version); 8 | int gsiftp_shutdown(void); 9 | int gsiftp_checkfile(char *urltype, char *infile, char *outfile); 10 | int gsiftp_open(char *filename, int rwmode, int *driverhandle); 11 | int gsiftp_create(char *filename, int *driverhandle); 12 | int gsiftp_truncate(int driverhandle, LONGLONG filesize); 13 | int gsiftp_size(int driverhandle, LONGLONG *filesize); 14 | int gsiftp_close(int driverhandle); 15 | int gsiftp_remove(char *filename); 16 | int gsiftp_flush(int driverhandle); 17 | int gsiftp_seek(int driverhandle, LONGLONG offset); 18 | int gsiftp_read (int driverhandle, void *buffer, long nbytes); 19 | int gsiftp_write(int driverhandle, void *buffer, long nbytes); 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /3rdparty/cfitsio/drvrnet.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nmellado/Super4PCS/d5ab2a407c4f8cbfd60dc97d826b1cc726bb25d8/3rdparty/cfitsio/drvrnet.c -------------------------------------------------------------------------------- /3rdparty/cfitsio/eval_defs.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #if defined(__sgi) || defined(__hpux) 6 | #include 7 | #endif 8 | #ifdef sparc 9 | #include 10 | #endif 11 | #include "fitsio2.h" 12 | 13 | #define MAXDIMS 5 14 | #define MAXSUBS 10 15 | #define MAXVARNAME 80 16 | #define CONST_OP -1000 17 | #define pERROR -1 18 | #define MAX_STRLEN 256 19 | #define MAX_STRLEN_S "255" 20 | 21 | #ifndef FFBISON 22 | #include "eval_tab.h" 23 | #endif 24 | 25 | 26 | typedef struct { 27 | char name[MAXVARNAME+1]; 28 | int type; 29 | long nelem; 30 | int naxis; 31 | long naxes[MAXDIMS]; 32 | char *undef; 33 | void *data; 34 | } DataInfo; 35 | 36 | typedef struct { 37 | long nelem; 38 | int naxis; 39 | long naxes[MAXDIMS]; 40 | char *undef; 41 | union { 42 | double dbl; 43 | long lng; 44 | char log; 45 | char str[MAX_STRLEN]; 46 | double *dblptr; 47 | long *lngptr; 48 | char *logptr; 49 | char **strptr; 50 | void *ptr; 51 | } data; 52 | } lval; 53 | 54 | typedef struct Node { 55 | int operation; 56 | void (*DoOp)(struct Node *this); 57 | int nSubNodes; 58 | int SubNodes[MAXSUBS]; 59 | int type; 60 | lval value; 61 | } Node; 62 | 63 | typedef struct { 64 | fitsfile *def_fptr; 65 | int (*getData)( char *dataName, void *dataValue ); 66 | int (*loadData)( int varNum, long fRow, long nRows, 67 | void *data, char *undef ); 68 | 69 | int compressed; 70 | int timeCol; 71 | int parCol; 72 | int valCol; 73 | 74 | char *expr; 75 | int index; 76 | int is_eobuf; 77 | 78 | Node *Nodes; 79 | int nNodes; 80 | int nNodesAlloc; 81 | int resultNode; 82 | 83 | long firstRow; 84 | long nRows; 85 | 86 | int nCols; 87 | iteratorCol *colData; 88 | DataInfo *varData; 89 | PixelFilter *pixFilter; 90 | 91 | long firstDataRow; 92 | long nDataRows; 93 | long totalRows; 94 | 95 | int datatype; 96 | int hdutype; 97 | 98 | int status; 99 | } ParseData; 100 | 101 | typedef enum { 102 | rnd_fct = 1001, 103 | sum_fct, 104 | nelem_fct, 105 | sin_fct, 106 | cos_fct, 107 | tan_fct, 108 | asin_fct, 109 | acos_fct, 110 | atan_fct, 111 | sinh_fct, 112 | cosh_fct, 113 | tanh_fct, 114 | exp_fct, 115 | log_fct, 116 | log10_fct, 117 | sqrt_fct, 118 | abs_fct, 119 | atan2_fct, 120 | ceil_fct, 121 | floor_fct, 122 | round_fct, 123 | min1_fct, 124 | min2_fct, 125 | max1_fct, 126 | max2_fct, 127 | near_fct, 128 | circle_fct, 129 | box_fct, 130 | elps_fct, 131 | isnull_fct, 132 | defnull_fct, 133 | gtifilt_fct, 134 | regfilt_fct, 135 | ifthenelse_fct, 136 | row_fct, 137 | null_fct, 138 | median_fct, 139 | average_fct, 140 | stddev_fct, 141 | nonnull_fct, 142 | angsep_fct, 143 | gasrnd_fct, 144 | poirnd_fct, 145 | strmid_fct, 146 | strpos_fct 147 | } funcOp; 148 | 149 | extern ParseData gParse; 150 | 151 | #ifdef __cplusplus 152 | extern "C" { 153 | #endif 154 | 155 | int ffparse(void); 156 | int fflex(void); 157 | void ffrestart(FILE*); 158 | 159 | void Evaluate_Parser( long firstRow, long nRows ); 160 | 161 | #ifdef __cplusplus 162 | } 163 | #endif 164 | -------------------------------------------------------------------------------- /3rdparty/cfitsio/eval_tab.h: -------------------------------------------------------------------------------- 1 | 2 | /* A Bison parser, made by GNU Bison 2.4.1. */ 3 | 4 | /* Skeleton interface for Bison's Yacc-like parsers in C 5 | 6 | Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 7 | Free Software Foundation, Inc. 8 | 9 | This program is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU General Public License as published by 11 | the Free Software Foundation, either version 3 of the License, or 12 | (at your option) any later version. 13 | 14 | This program is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | GNU General Public License for more details. 18 | 19 | You should have received a copy of the GNU General Public License 20 | along with this program. If not, see . */ 21 | 22 | /* As a special exception, you may create a larger work that contains 23 | part or all of the Bison parser skeleton and distribute that work 24 | under terms of your choice, so long as that work isn't itself a 25 | parser generator using the skeleton or a modified version thereof 26 | as a parser skeleton. Alternatively, if you modify or redistribute 27 | the parser skeleton itself, you may (at your option) remove this 28 | special exception, which will cause the skeleton and the resulting 29 | Bison output files to be licensed under the GNU General Public 30 | License without this special exception. 31 | 32 | This special exception was added by the Free Software Foundation in 33 | version 2.2 of Bison. */ 34 | 35 | 36 | /* Tokens. */ 37 | #ifndef FFTOKENTYPE 38 | # define FFTOKENTYPE 39 | /* Put the tokens into the symbol table, so that GDB and other debuggers 40 | know about them. */ 41 | enum fftokentype { 42 | BOOLEAN = 258, 43 | LONG = 259, 44 | DOUBLE = 260, 45 | STRING = 261, 46 | BITSTR = 262, 47 | FUNCTION = 263, 48 | BFUNCTION = 264, 49 | IFUNCTION = 265, 50 | GTIFILTER = 266, 51 | REGFILTER = 267, 52 | COLUMN = 268, 53 | BCOLUMN = 269, 54 | SCOLUMN = 270, 55 | BITCOL = 271, 56 | ROWREF = 272, 57 | NULLREF = 273, 58 | SNULLREF = 274, 59 | OR = 275, 60 | AND = 276, 61 | NE = 277, 62 | EQ = 278, 63 | GTE = 279, 64 | LTE = 280, 65 | LT = 281, 66 | GT = 282, 67 | POWER = 283, 68 | NOT = 284, 69 | FLTCAST = 285, 70 | INTCAST = 286, 71 | UMINUS = 287, 72 | DIFF = 288, 73 | ACCUM = 289 74 | }; 75 | #endif 76 | /* Tokens. */ 77 | #define BOOLEAN 258 78 | #define LONG 259 79 | #define DOUBLE 260 80 | #define STRING 261 81 | #define BITSTR 262 82 | #define FUNCTION 263 83 | #define BFUNCTION 264 84 | #define IFUNCTION 265 85 | #define GTIFILTER 266 86 | #define REGFILTER 267 87 | #define COLUMN 268 88 | #define BCOLUMN 269 89 | #define SCOLUMN 270 90 | #define BITCOL 271 91 | #define ROWREF 272 92 | #define NULLREF 273 93 | #define SNULLREF 274 94 | #define OR 275 95 | #define AND 276 96 | #define NE 277 97 | #define EQ 278 98 | #define GTE 279 99 | #define LTE 280 100 | #define LT 281 101 | #define GT 282 102 | #define POWER 283 103 | #define NOT 284 104 | #define FLTCAST 285 105 | #define INTCAST 286 106 | #define UMINUS 287 107 | #define DIFF 288 108 | #define ACCUM 289 109 | 110 | 111 | 112 | 113 | #if ! defined FFSTYPE && ! defined FFSTYPE_IS_DECLARED 114 | typedef union FFSTYPE 115 | { 116 | 117 | /* Line 1676 of yacc.c */ 118 | #line 192 "eval.y" 119 | 120 | int Node; /* Index of Node */ 121 | double dbl; /* real value */ 122 | long lng; /* integer value */ 123 | char log; /* logical value */ 124 | char str[MAX_STRLEN]; /* string value */ 125 | 126 | 127 | 128 | /* Line 1676 of yacc.c */ 129 | #line 130 "y.tab.h" 130 | } FFSTYPE; 131 | # define FFSTYPE_IS_TRIVIAL 1 132 | # define ffstype FFSTYPE /* obsolescent; will be withdrawn */ 133 | # define FFSTYPE_IS_DECLARED 1 134 | #endif 135 | 136 | extern FFSTYPE fflval; 137 | 138 | 139 | -------------------------------------------------------------------------------- /3rdparty/cfitsio/f77.inc: -------------------------------------------------------------------------------- 1 | C Codes for FITS extension types 2 | integer IMAGE_HDU, ASCII_TBL, BINARY_TBL 3 | parameter ( 4 | & IMAGE_HDU = 0, 5 | & ASCII_TBL = 1, 6 | & BINARY_TBL = 2 ) 7 | 8 | C Codes for FITS table data types 9 | 10 | integer TBIT,TBYTE,TLOGICAL,TSTRING,TSHORT,TINT 11 | integer TFLOAT,TDOUBLE,TCOMPLEX,TDBLCOMPLEX 12 | parameter ( 13 | & TBIT = 1, 14 | & TBYTE = 11, 15 | & TLOGICAL = 14, 16 | & TSTRING = 16, 17 | & TSHORT = 21, 18 | & TINT = 31, 19 | & TFLOAT = 42, 20 | & TDOUBLE = 82, 21 | & TCOMPLEX = 83, 22 | & TDBLCOMPLEX = 163 ) 23 | 24 | C Codes for iterator column types 25 | 26 | integer InputCol, InputOutputCol, OutputCol 27 | parameter ( 28 | & InputCol = 0, 29 | & InputOutputCol = 1, 30 | & OutputCol = 2 ) 31 | 32 | -------------------------------------------------------------------------------- /3rdparty/cfitsio/fitscopy.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "fitsio.h" 3 | 4 | int main(int argc, char *argv[]) 5 | { 6 | fitsfile *infptr, *outfptr; /* FITS file pointers defined in fitsio.h */ 7 | int status = 0; /* status must always be initialized = 0 */ 8 | 9 | if (argc != 3) 10 | { 11 | printf("Usage: fitscopy inputfile outputfile\n"); 12 | printf("\n"); 13 | printf("Copy an input file to an output file, optionally filtering\n"); 14 | printf("the file in the process. This seemingly simple program can\n"); 15 | printf("apply powerful filters which transform the input file as\n"); 16 | printf("it is being copied. Filters may be used to extract a\n"); 17 | printf("subimage from a larger image, select rows from a table,\n"); 18 | printf("filter a table with a GTI time extension or a SAO region file,\n"); 19 | printf("create or delete columns in a table, create an image by\n"); 20 | printf("binning (histogramming) 2 table columns, and convert IRAF\n"); 21 | printf("format *.imh or raw binary data files into FITS images.\n"); 22 | printf("See the CFITSIO User's Guide for a complete description of\n"); 23 | printf("the Extended File Name filtering syntax.\n"); 24 | printf("\n"); 25 | printf("Examples:\n"); 26 | printf("\n"); 27 | printf("fitscopy in.fit out.fit (simple file copy)\n"); 28 | printf("fitscopy - - (stdin to stdout)\n"); 29 | printf("fitscopy in.fit[11:50,21:60] out.fit (copy a subimage)\n"); 30 | printf("fitscopy iniraf.imh out.fit (IRAF image to FITS)\n"); 31 | printf("fitscopy in.dat[i512,512] out.fit (raw array to FITS)\n"); 32 | printf("fitscopy in.fit[events][pi>35] out.fit (copy rows with pi>35)\n"); 33 | printf("fitscopy in.fit[events][bin X,Y] out.fit (bin an image) \n"); 34 | printf("fitscopy in.fit[events][col x=.9*y] out.fit (new x column)\n"); 35 | printf("fitscopy in.fit[events][gtifilter()] out.fit (time filter)\n"); 36 | printf("fitscopy in.fit[2][regfilter(\"pow.reg\")] out.fit (spatial filter)\n"); 37 | printf("\n"); 38 | printf("Note that it may be necessary to enclose the input file name\n"); 39 | printf("in single quote characters on the Unix command line.\n"); 40 | return(0); 41 | } 42 | /* Open the input file */ 43 | if ( !fits_open_file(&infptr, argv[1], READONLY, &status) ) 44 | { 45 | /* Create the output file */ 46 | if ( !fits_create_file(&outfptr, argv[2], &status) ) 47 | { 48 | 49 | /* copy the previous, current, and following HDUs */ 50 | fits_copy_file(infptr, outfptr, 1, 1, 1, &status); 51 | 52 | fits_close_file(outfptr, &status); 53 | } 54 | fits_close_file(infptr, &status); 55 | } 56 | 57 | /* if error occured, print out error message */ 58 | if (status) fits_report_error(stderr, status); 59 | return(status); 60 | } 61 | -------------------------------------------------------------------------------- /3rdparty/cfitsio/funpack.c: -------------------------------------------------------------------------------- 1 | /* FUNPACK 2 | * R. Seaman, NOAO 3 | * uses fits_img_compress by W. Pence, HEASARC 4 | */ 5 | 6 | #include "fitsio.h" 7 | #include "fpack.h" 8 | 9 | int main (int argc, char *argv[]) 10 | { 11 | fpstate fpvar; 12 | 13 | if (argc <= 1) { fu_usage (); fu_hint (); exit (-1); } 14 | 15 | fp_init (&fpvar); 16 | fu_get_param (argc, argv, &fpvar); 17 | 18 | if (fpvar.listonly) { 19 | fp_list (argc, argv, fpvar); 20 | 21 | } else { 22 | fp_preflight (argc, argv, FUNPACK, &fpvar); 23 | fp_loop (argc, argv, FUNPACK, fpvar); 24 | } 25 | 26 | exit (0); 27 | } 28 | 29 | int fu_get_param (int argc, char *argv[], fpstate *fpptr) 30 | { 31 | int iarg; 32 | char tile[SZ_STR]; 33 | 34 | if (fpptr->initialized != FP_INIT_MAGIC) { 35 | fp_msg ("Error: internal initialization error\n"); exit (-1); 36 | } 37 | 38 | tile[0] = 0; 39 | 40 | /* by default, .fz suffix characters to be deleted from compressed file */ 41 | fpptr->delete_suffix = 1; 42 | 43 | /* flags must come first and be separately specified 44 | */ 45 | for (iarg = 1; iarg < argc; iarg++) { 46 | if (argv[iarg][0] == '-' && strlen (argv[iarg]) == 2) { 47 | 48 | if (argv[iarg][1] == 'F') { 49 | fpptr->clobber++; 50 | fpptr->delete_suffix = 0; /* no suffix in this case */ 51 | 52 | } else if (argv[iarg][1] == 'D') { 53 | fpptr->delete_input++; 54 | 55 | } else if (argv[iarg][1] == 'P') { 56 | if (++iarg >= argc) { 57 | fu_usage (); fu_hint (); exit (-1); 58 | } else 59 | strncpy (fpptr->prefix, argv[iarg], SZ_STR); 60 | 61 | } else if (argv[iarg][1] == 'E') { 62 | if (++iarg >= argc) { 63 | fu_usage (); fu_hint (); exit (-1); 64 | } else 65 | strncpy (fpptr->extname, argv[iarg], SZ_STR); 66 | 67 | } else if (argv[iarg][1] == 'S') { 68 | fpptr->to_stdout++; 69 | 70 | } else if (argv[iarg][1] == 'L') { 71 | fpptr->listonly++; 72 | 73 | } else if (argv[iarg][1] == 'C') { 74 | fpptr->do_checksums = 0; 75 | 76 | } else if (argv[iarg][1] == 'H') { 77 | fu_help (); exit (0); 78 | 79 | } else if (argv[iarg][1] == 'V') { 80 | fp_version (); exit (0); 81 | 82 | } else if (argv[iarg][1] == 'Z') { 83 | fpptr->do_gzip_file++; 84 | 85 | } else if (argv[iarg][1] == 'v') { 86 | fpptr->verbose = 1; 87 | 88 | } else if (argv[iarg][1] == 'O') { 89 | if (++iarg >= argc) { 90 | fu_usage (); fu_hint (); exit (-1); 91 | } else 92 | strncpy (fpptr->outfile, argv[iarg], SZ_STR); 93 | 94 | } else { 95 | fp_msg ("Error: unknown command line flag `"); 96 | fp_msg (argv[iarg]); fp_msg ("'\n"); 97 | fu_usage (); fu_hint (); exit (-1); 98 | } 99 | 100 | } else 101 | break; 102 | } 103 | 104 | if (fpptr->extname[0] && (fpptr->clobber || fpptr->delete_input)) { 105 | fp_msg ("Error: -E option may not be used with -F or -D\n"); 106 | fu_usage (); exit (-1); 107 | } 108 | 109 | if (fpptr->to_stdout && (fpptr->outfile[0] || fpptr->prefix[0]) ) { 110 | 111 | fp_msg ("Error: -S option may not be used with -P or -O\n"); 112 | fu_usage (); exit (-1); 113 | } 114 | 115 | if (fpptr->outfile[0] && fpptr->prefix[0] ) { 116 | fp_msg ("Error: -P and -O options may not be used together\n"); 117 | fu_usage (); exit (-1); 118 | } 119 | 120 | if (iarg >= argc) { 121 | fp_msg ("Error: no FITS files to uncompress\n"); 122 | fu_usage (); exit (-1); 123 | } else 124 | fpptr->firstfile = iarg; 125 | 126 | return(0); 127 | } 128 | 129 | int fu_usage (void) 130 | { 131 | fp_msg ("usage: funpack [-E ] [-P
] [-O ] [-Z] -v \n");
132 |         fp_msg ("more:   [-F] [-D] [-S] [-L] [-C] [-H] [-V] \n");
133 | 	return(0);
134 | }
135 | 
136 | int fu_hint (void)
137 | {
138 | 	fp_msg ("      `funpack -H' for help\n");
139 | 	return(0);
140 | }
141 | 
142 | int fu_help (void)
143 | {
144 | fp_msg ("funpack, decompress fpacked files.  Version ");
145 | fp_version ();
146 | fu_usage ();
147 | fp_msg ("\n");
148 | 
149 | fp_msg ("Flags must be separate and appear before filenames:\n");
150 | fp_msg (" -E  Unpack only the list of HDU names or numbers in the file.\n");
151 | fp_msg (" -P 
    Prepend 
 to create new output filenames.\n");
152 | fp_msg (" -O    Specify full output file name.\n");
153 | fp_msg (" -Z          Recompress the output file with host GZIP program.\n");
154 | fp_msg (" -F          Overwrite input file by output file with same name.\n");
155 | fp_msg (" -D          Delete input file after writing output.\n");
156 | fp_msg (" -S          Output uncompressed file to STDOUT file stream.\n");
157 | fp_msg (" -L          List contents, files unchanged.\n");
158 | 
159 | fp_msg (" -C          Don't update FITS checksum keywords.\n");
160 | 
161 | fp_msg (" -v          Verbose mode; list each file as it is processed.\n");
162 | fp_msg (" -H          Show this message.\n");
163 | fp_msg (" -V          Show version number.\n");
164 | 
165 | fp_msg (" \n       FITS files to unpack; enter '-' (a hyphen) to read from stdin.\n");
166 | fp_msg (" Refer to the fpack User's Guide for more extensive help.\n");
167 | 	return(0);
168 | }
169 | 


--------------------------------------------------------------------------------
/3rdparty/cfitsio/group.h:
--------------------------------------------------------------------------------
 1 | #define MAX_HDU_TRACKER 1000
 2 | 
 3 | typedef struct _HDUtracker HDUtracker;
 4 | 
 5 | struct _HDUtracker
 6 | {
 7 |   int nHDU;
 8 | 
 9 |   char *filename[MAX_HDU_TRACKER];
10 |   int  position[MAX_HDU_TRACKER];
11 | 
12 |   char *newFilename[MAX_HDU_TRACKER];
13 |   int  newPosition[MAX_HDU_TRACKER];
14 | };
15 | 
16 | /* functions used internally in the grouping convention module */
17 | 
18 | int ffgtdc(int grouptype, int xtensioncol, int extnamecol, int extvercol,
19 | 	   int positioncol, int locationcol, int uricol, char *ttype[],
20 | 	   char *tform[], int *ncols, int  *status);
21 | 
22 | int ffgtgc(fitsfile *gfptr, int *xtensionCol, int *extnameCol, int *extverCol,
23 | 	   int *positionCol, int *locationCol, int *uriCol, int *grptype,
24 | 	   int *status);
25 | 
26 | int ffgmul(fitsfile *mfptr, int rmopt, int *status);
27 | 
28 | int ffgmf(fitsfile *gfptr, char *xtension, char *extname, int extver,	   
29 | 	  int position,	char *location,	long *member, int *status);
30 | 
31 | int ffgtrmr(fitsfile *gfptr, HDUtracker *HDU, int *status);
32 | 
33 | int ffgtcpr(fitsfile *infptr, fitsfile *outfptr, int cpopt, HDUtracker *HDU,
34 | 	    int *status);
35 | 
36 | int fftsad(fitsfile *mfptr, HDUtracker *HDU, int *newPosition, 
37 | 	   char *newFileName);
38 | 
39 | int fftsud(fitsfile *mfptr, HDUtracker *HDU, int newPosition, 
40 | 	   char *newFileName);
41 | 
42 | void prepare_keyvalue(char *keyvalue);
43 | 
44 | int fits_path2url(char *inpath, char *outpath, int  *status);
45 | 
46 | int fits_url2path(char *inpath, char *outpath, int  *status);
47 | 
48 | int fits_get_cwd(char *cwd, int *status);
49 | 
50 | int fits_get_url(fitsfile *fptr, char *realURL, char *startURL, 
51 | 		 char *realAccess, char *startAccess, int *iostate, 
52 | 		 int *status);
53 | 
54 | int fits_clean_url(char *inURL, char *outURL, int *status);
55 | 
56 | int fits_relurl2url(char *refURL, char *relURL, char *absURL, int *status);
57 | 
58 | int fits_url2relurl(char *refURL, char *absURL, char *relURL, int *status);
59 | 
60 | int fits_encode_url(char *inpath, char *outpath, int *status);
61 | 
62 | int fits_unencode_url(char *inpath, char *outpath, int *status);
63 | 
64 | int fits_is_url_absolute(char *url);
65 | 
66 | 


--------------------------------------------------------------------------------
/3rdparty/cfitsio/iter_a.fit:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nmellado/Super4PCS/d5ab2a407c4f8cbfd60dc97d826b1cc726bb25d8/3rdparty/cfitsio/iter_a.fit


--------------------------------------------------------------------------------
/3rdparty/cfitsio/iter_b.c:
--------------------------------------------------------------------------------
  1 | #include 
  2 | #include 
  3 | #include 
  4 | #include "fitsio.h"
  5 | 
  6 | /*
  7 |   This program illustrates how to use the CFITSIO iterator function.
  8 |   It simply prints out the values in a character string and a logical
  9 |   type column in a table, and toggles the value in the logical column
 10 |   so that T -> F and F -> T.
 11 | */
 12 | main()
 13 | {
 14 |     extern str_iter(); /* external work function is passed to the iterator */
 15 |     fitsfile *fptr;
 16 |     iteratorCol cols[2];
 17 |     int n_cols;
 18 |     long rows_per_loop, offset;
 19 |     int status = 0;
 20 |     char filename[]  = "iter_b.fit";     /* name of rate FITS file */
 21 | 
 22 |     /* open the file and move to the correct extension */
 23 |     fits_open_file(&fptr, filename, READWRITE, &status);
 24 |     fits_movnam_hdu(fptr, BINARY_TBL, "iter_test", 0, &status);
 25 | 
 26 |     /* define input column structure members for the iterator function */
 27 |     n_cols  = 2;   /* number of columns */
 28 | 
 29 |     /* define input column structure members for the iterator function */
 30 |     fits_iter_set_by_name(&cols[0], fptr, "Avalue", TSTRING,  InputOutputCol);
 31 |     fits_iter_set_by_name(&cols[1], fptr, "Lvalue", TLOGICAL, InputOutputCol);
 32 | 
 33 |     rows_per_loop = 0;  /* use default optimum number of rows */
 34 |     offset = 0;         /* process all the rows */
 35 | 
 36 |     /* apply the  function to each row of the table */
 37 |     printf("Calling iterator function...%d\n", status);
 38 | 
 39 |     fits_iterate_data(n_cols, cols, offset, rows_per_loop,
 40 |                       str_iter, 0L, &status);
 41 | 
 42 |     fits_close_file(fptr, &status);      /* all done */
 43 | 
 44 |     if (status)
 45 |        fits_report_error(stderr, status); /* print out error messages */
 46 | 
 47 |     return(status);
 48 | }
 49 | /*--------------------------------------------------------------------------*/
 50 | int str_iter(long totalrows, long offset, long firstrow, long nrows,
 51 |              int ncols, iteratorCol *cols, void *user_strct )
 52 | 
 53 | /*
 54 |    Sample iterator function.
 55 | */
 56 | {
 57 |     int ii;
 58 | 
 59 |     /* declare variables static to preserve their values between calls */
 60 |     static char **stringvals;
 61 |     static char *logicalvals;
 62 | 
 63 |     /*--------------------------------------------------------*/
 64 |     /*  Initialization procedures: execute on the first call  */
 65 |     /*--------------------------------------------------------*/
 66 |     if (firstrow == 1)
 67 |     {
 68 |        if (ncols != 2)
 69 |            return(-1);  /* number of columns incorrect */
 70 | 
 71 |        if (fits_iter_get_datatype(&cols[0]) != TSTRING ||
 72 |            fits_iter_get_datatype(&cols[1]) != TLOGICAL )
 73 |            return(-2);  /* bad data type */
 74 | 
 75 |        /* assign the input pointers to the appropriate arrays */
 76 |        stringvals       = (char **) fits_iter_get_array(&cols[0]);
 77 |        logicalvals      = (char *)  fits_iter_get_array(&cols[1]);
 78 | 
 79 |        printf("Total rows, No. rows = %d %d\n",totalrows, nrows);
 80 |     }
 81 | 
 82 |     /*------------------------------------------*/
 83 |     /*  Main loop: process all the rows of data */
 84 |     /*------------------------------------------*/
 85 | 
 86 |     /*  NOTE: 1st element of array is the null pixel value!  */
 87 |     /*  Loop from 1 to nrows, not 0 to nrows - 1.  */
 88 |    
 89 |     for (ii = 1; ii <= nrows; ii++)
 90 |     {
 91 |       printf("%s %d\n", stringvals[ii], logicalvals[ii]);
 92 |       if (logicalvals[ii])
 93 |       {
 94 |          logicalvals[ii] = FALSE;
 95 |          strcpy(stringvals[ii], "changed to false");
 96 |       }
 97 |       else
 98 |       {
 99 |          logicalvals[ii] = TRUE;
100 |          strcpy(stringvals[ii], "changed to true");
101 |       }
102 |     }
103 | 
104 |     /*-------------------------------------------------------*/
105 |     /*  Clean up procedures:  after processing all the rows  */
106 |     /*-------------------------------------------------------*/
107 | 
108 |     if (firstrow + nrows - 1 == totalrows)
109 |     {
110 |       /* no action required in this case */
111 |     }
112 |  
113 |     return(0);
114 | }
115 | 


--------------------------------------------------------------------------------
/3rdparty/cfitsio/iter_c.fit:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nmellado/Super4PCS/d5ab2a407c4f8cbfd60dc97d826b1cc726bb25d8/3rdparty/cfitsio/iter_c.fit


--------------------------------------------------------------------------------
/3rdparty/cfitsio/iter_image.c:
--------------------------------------------------------------------------------
 1 | #include 
 2 | #include 
 3 | #include 
 4 | #include "fitsio.h"
 5 | 
 6 | /*
 7 |   This program illustrates how to use the CFITSIO iterator function.
 8 |   It reads and modifies the input 'iter_image.fit' image file by setting
 9 |   all the pixel values to zero (DESTROYING THE ORIGINAL IMAGE!!!)
10 | */
11 | main()
12 | {
13 |     extern zero_image(); /* external work function is passed to the iterator */
14 |     fitsfile *fptr;
15 |     iteratorCol cols[3];  /* structure used by the iterator function */
16 |     int n_cols;
17 |     long rows_per_loop, offset;
18 | 
19 |     int status, nkeys, keypos, hdutype, ii, jj;
20 |     char filename[]  = "iter_image.fit";     /* name of rate FITS file */
21 | 
22 |     status = 0; 
23 | 
24 |     fits_open_file(&fptr, filename, READWRITE, &status); /* open file */
25 | 
26 | 
27 |     n_cols = 1;
28 | 
29 |     /* define input column structure members for the iterator function */
30 |     fits_iter_set_file(&cols[0], fptr);
31 |     fits_iter_set_iotype(&cols[0], InputOutputCol);
32 |     fits_iter_set_datatype(&cols[0], 0);
33 | 
34 |     rows_per_loop = 0;  /* use default optimum number of rows */
35 |     offset = 0;         /* process all the rows */
36 | 
37 |     /* apply the rate function to each row of the table */
38 |     printf("Calling iterator function...%d\n", status);
39 | 
40 |     fits_iterate_data(n_cols, cols, offset, rows_per_loop,
41 |                       zero_image, 0L, &status);
42 | 
43 |     fits_close_file(fptr, &status);      /* all done */
44 | 
45 |     if (status)
46 |         fits_report_error(stderr, status);  /* print out error messages */
47 | 
48 |     return(status);
49 | }
50 | /*--------------------------------------------------------------------------*/
51 | int zero_image(long totalrows, long offset, long firstrow, long nrows,
52 |              int ncols, iteratorCol *cols, void *user_strct ) 
53 | 
54 | /*
55 |    Sample iterator function that calculates the output flux 'rate' column
56 |    by dividing the input 'counts' by the 'time' column.
57 |    It also applies a constant deadtime correction factor if the 'deadtime'
58 |    keyword exists.  Finally, this creates or updates the 'LIVETIME'
59 |    keyword with the sum of all the individual integration times.
60 | */
61 | {
62 |     int ii, status = 0;
63 | 
64 |     /* declare variables static to preserve their values between calls */
65 |     static int *counts;
66 | 
67 |     /*--------------------------------------------------------*/
68 |     /*  Initialization procedures: execute on the first call  */
69 |     /*--------------------------------------------------------*/
70 |     if (firstrow == 1)
71 |     {
72 |        if (ncols != 1)
73 |            return(-1);  /* number of columns incorrect */
74 | 
75 |        /* assign the input pointers to the appropriate arrays and null ptrs*/
76 |        counts       = (int *)  fits_iter_get_array(&cols[0]);
77 |     }
78 | 
79 |     /*--------------------------------------------*/
80 |     /*  Main loop: process all the rows of data */
81 |     /*--------------------------------------------*/
82 | 
83 |     /*  NOTE: 1st element of array is the null pixel value!  */
84 |     /*  Loop from 1 to nrows, not 0 to nrows - 1.  */
85 | 
86 |     for (ii = 1; ii <= nrows; ii++)
87 |     {
88 |        counts[ii] = 1.;
89 |     }
90 |     printf("firstrows, nrows = %d %d\n", firstrow, nrows);
91 |     
92 |     return(0);  /* return successful status */
93 | }
94 | 


--------------------------------------------------------------------------------
/3rdparty/cfitsio/iter_var.c:
--------------------------------------------------------------------------------
  1 | #include 
  2 | #include 
  3 | #include 
  4 | #include "fitsio.h"
  5 | 
  6 | /*
  7 |   This program illustrates how to use the CFITSIO iterator function.
  8 |   It reads and modifies the input 'iter_a.fit' file by computing a
  9 |   value for the 'rate' column as a function of the values in the other
 10 |   'counts' and 'time' columns.
 11 | */
 12 | main()
 13 | {
 14 |     extern flux_rate(); /* external work function is passed to the iterator */
 15 |     fitsfile *fptr;
 16 |     iteratorCol cols[3];  /* structure used by the iterator function */
 17 |     int n_cols;
 18 |     long rows_per_loop, offset;
 19 | 
 20 |     int status, nkeys, keypos, hdutype, ii, jj;
 21 |     char filename[]  = "vari.fits";     /* name of rate FITS file */
 22 | 
 23 |     status = 0; 
 24 | 
 25 |     fits_open_file(&fptr, filename, READWRITE, &status); /* open file */
 26 | 
 27 |     /* move to the desired binary table extension */
 28 |     if (fits_movnam_hdu(fptr, BINARY_TBL, "COMPRESSED_IMAGE", 0, &status) )
 29 |         fits_report_error(stderr, status);    /* print out error messages */
 30 | 
 31 |     n_cols  = 1;   /* number of columns */
 32 | 
 33 |     /* define input column structure members for the iterator function */
 34 |     fits_iter_set_by_name(&cols[0], fptr, "COMPRESSED_DATA", 0,  InputCol);
 35 | 
 36 |     rows_per_loop = 0;  /* use default optimum number of rows */
 37 |     offset = 0;         /* process all the rows */
 38 | 
 39 |     /* apply the rate function to each row of the table */
 40 |     printf("Calling iterator function...%d\n", status);
 41 | 
 42 |     fits_iterate_data(n_cols, cols, offset, rows_per_loop,
 43 |                       flux_rate, 0L, &status);
 44 | 
 45 |     fits_close_file(fptr, &status);      /* all done */
 46 | 
 47 |     if (status)
 48 |         fits_report_error(stderr, status);  /* print out error messages */
 49 | 
 50 |     return(status);
 51 | }
 52 | /*--------------------------------------------------------------------------*/
 53 | int flux_rate(long totalrows, long offset, long firstrow, long nrows,
 54 |              int ncols, iteratorCol *cols, void *user_strct ) 
 55 | 
 56 | /*
 57 |    Sample iterator function that calculates the output flux 'rate' column
 58 |    by dividing the input 'counts' by the 'time' column.
 59 |    It also applies a constant deadtime correction factor if the 'deadtime'
 60 |    keyword exists.  Finally, this creates or updates the 'LIVETIME'
 61 |    keyword with the sum of all the individual integration times.
 62 | */
 63 | {
 64 |     int ii, status = 0;
 65 |     long repeat;
 66 | 
 67 |     /* declare variables static to preserve their values between calls */
 68 |     static unsigned char *counts;
 69 | 
 70 |     /*--------------------------------------------------------*/
 71 |     /*  Initialization procedures: execute on the first call  */
 72 |     /*--------------------------------------------------------*/
 73 |     if (firstrow == 1)
 74 |     {
 75 | 
 76 | printf("Datatype of column = %d\n",fits_iter_get_datatype(&cols[0]));
 77 | 
 78 |        /* assign the input pointers to the appropriate arrays and null ptrs*/
 79 |        counts       = (long *)  fits_iter_get_array(&cols[0]);
 80 | 
 81 |     }
 82 | 
 83 |     /*--------------------------------------------*/
 84 |     /*  Main loop: process all the rows of data */
 85 |     /*--------------------------------------------*/
 86 | 
 87 |     /*  NOTE: 1st element of array is the null pixel value!  */
 88 |     /*  Loop from 1 to nrows, not 0 to nrows - 1.  */
 89 | 
 90 | 
 91 |     for (ii = 1; ii <= nrows; ii++)
 92 |     {
 93 |        repeat = fits_iter_get_repeat(&cols[0]);
 94 |        printf ("repeat = %d, %d\n",repeat, counts[1]);
 95 |        
 96 |     }
 97 | 
 98 | 
 99 |     return(0);  /* return successful status */
100 | }
101 | 


--------------------------------------------------------------------------------
/3rdparty/cfitsio/makepc.bat:
--------------------------------------------------------------------------------
 1 | rem:  this batch file builds the cfitsio library 
 2 | rem:  using the Borland C++ v4.5 or new free v5.5 compiler
 3 | rem:
 4 | bcc32 -c buffers.c
 5 | bcc32 -c cfileio.c
 6 | bcc32 -c checksum.c
 7 | bcc32 -c drvrfile.c
 8 | bcc32 -c drvrmem.c
 9 | bcc32 -c editcol.c
10 | bcc32 -c edithdu.c
11 | bcc32 -c eval_l.c
12 | bcc32 -c eval_y.c
13 | bcc32 -c eval_f.c
14 | bcc32 -c fitscore.c
15 | bcc32 -c getcol.c
16 | bcc32 -c getcolb.c
17 | bcc32 -c getcolsb.c
18 | bcc32 -c getcoli.c
19 | bcc32 -c getcolj.c
20 | bcc32 -c getcolui.c
21 | bcc32 -c getcoluj.c
22 | bcc32 -c getcoluk.c
23 | bcc32 -c getcolk.c
24 | bcc32 -c getcole.c
25 | bcc32 -c getcold.c
26 | bcc32 -c getcoll.c
27 | bcc32 -c getcols.c
28 | bcc32 -c getkey.c
29 | bcc32 -c group.c
30 | bcc32 -c grparser.c
31 | bcc32 -c histo.c
32 | bcc32 -c iraffits.c
33 | bcc32 -c modkey.c
34 | bcc32 -c putcol.c
35 | bcc32 -c putcolb.c
36 | bcc32 -c putcolsb.c
37 | bcc32 -c putcoli.c
38 | bcc32 -c putcolj.c
39 | bcc32 -c putcolui.c
40 | bcc32 -c putcoluj.c
41 | bcc32 -c putcoluk.c
42 | bcc32 -c putcolk.c
43 | bcc32 -c putcole.c
44 | bcc32 -c putcold.c
45 | bcc32 -c putcols.c
46 | bcc32 -c putcoll.c
47 | bcc32 -c putcolu.c
48 | bcc32 -c putkey.c
49 | bcc32 -c region.c
50 | bcc32 -c scalnull.c
51 | bcc32 -c swapproc.c
52 | bcc32 -c wcsutil.c
53 | bcc32 -c wcssub.c
54 | bcc32 -c imcompress.c
55 | bcc32 -c quantize.c
56 | bcc32 -c ricecomp.c
57 | bcc32 -c pliocomp.c
58 | bcc32 -c fits_hcompress.c
59 | bcc32 -c fits_hdecompress.c
60 | bcc32 -c zuncompress.c
61 | bcc32 -c zcompress.c
62 | bcc32 -c adler32.c
63 | bcc32 -c crc32.c
64 | bcc32 -c inffast.c
65 | bcc32 -c inftrees.c
66 | bcc32 -c trees.c
67 | bcc32 -c zutil.c
68 | bcc32 -c deflate.c
69 | bcc32 -c infback.c
70 | bcc32 -c inflate.c
71 | bcc32 -c uncompr.c
72 | del cfitsio.lib
73 | tlib cfitsio +buffers +cfileio +checksum +drvrfile +drvrmem 
74 | tlib cfitsio +editcol +edithdu +eval_l +eval_y +eval_f +fitscore
75 | tlib cfitsio +getcol +getcolb +getcolsb +getcoli +getcolj +getcolk +getcoluk 
76 | tlib cfitsio +getcolui +getcoluj +getcole +getcold +getcoll +getcols
77 | tlib cfitsio +getkey +group +grparser +histo +iraffits +modkey +putkey 
78 | tlib cfitsio +putcol  +putcolb +putcoli +putcolj +putcolk +putcole +putcold
79 | tlib cfitsio +putcoll +putcols +putcolu +putcolui +putcoluj +putcoluk
80 | tlib cfitsio +region +scalnull +swapproc +wcsutil +wcssub +putcolsb
81 | tlib cfitsio +imcompress +quantize +ricecomp +pliocomp
82 | tlib cfitsio +fits_hcompress +fits_hdecompress
83 | tlib cfitsio +zuncompress +zcompress +adler32 +crc32 +inffast
84 | tlib cfitsio +inftrees +trees +zutil +deflate +infback +inflate +uncompr
85 | bcc32 -f testprog.c cfitsio.lib
86 | bcc32 -f cookbook.c cfitsio.lib
87 | 
88 | 


--------------------------------------------------------------------------------
/3rdparty/cfitsio/region.h:
--------------------------------------------------------------------------------
 1 | /***************************************************************/
 2 | /*                   REGION STUFF                              */
 3 | /***************************************************************/
 4 | 
 5 | #include "fitsio.h"
 6 | #define myPI  3.1415926535897932385
 7 | #define RadToDeg 180.0/myPI
 8 | 
 9 | typedef struct {
10 |    int    exists;
11 |    double xrefval, yrefval;
12 |    double xrefpix, yrefpix;
13 |    double xinc,    yinc;
14 |    double rot;
15 |    char   type[6];
16 | } WCSdata;
17 | 
18 | typedef enum {
19 |    point_rgn,
20 |    line_rgn,
21 |    circle_rgn,
22 |    annulus_rgn,
23 |    ellipse_rgn,
24 |    elliptannulus_rgn,
25 |    box_rgn,
26 |    boxannulus_rgn,
27 |    rectangle_rgn,
28 |    diamond_rgn,
29 |    sector_rgn,
30 |    poly_rgn,
31 |    panda_rgn,
32 |    epanda_rgn,
33 |    bpanda_rgn
34 | } shapeType;
35 | 
36 | typedef enum { pixel_fmt, degree_fmt, hhmmss_fmt } coordFmt;
37 |    
38 | typedef struct {
39 |    char      sign;        /*  Include or exclude?        */
40 |    shapeType shape;       /*  Shape of this region       */
41 |    int       comp;        /*  Component number for this region */
42 | 
43 |    double xmin,xmax;       /*  bounding box    */
44 |    double ymin,ymax;
45 | 
46 |    union {                /*  Parameters - In pixels     */
47 | 
48 |       /****   Generic Shape Data   ****/
49 | 
50 |       struct {
51 | 	 double p[11];       /*  Region parameters       */
52 | 	 double sinT, cosT;  /*  For rotated shapes      */
53 | 	 double a, b;        /*  Extra scratch area      */
54 |       } gen;
55 | 
56 |       /****      Polygon Data      ****/
57 | 
58 |       struct {
59 |          int    nPts;        /*  Number of Polygon pts   */
60 |          double *Pts;        /*  Polygon points          */
61 |       } poly;
62 | 
63 |    } param;
64 | 
65 | } RgnShape;
66 | 
67 | typedef struct {
68 |    int       nShapes;
69 |    RgnShape  *Shapes;
70 |    WCSdata   wcs;
71 | } SAORegion;
72 | 
73 | /*  SAO region file routines */
74 | int  fits_read_rgnfile( const char *filename, WCSdata *wcs, SAORegion **Rgn, int *status );
75 | int  fits_in_region( double X, double Y, SAORegion *Rgn );
76 | void fits_free_region( SAORegion *Rgn );
77 | void fits_set_region_components ( SAORegion *Rgn );
78 | void fits_setup_shape ( RgnShape *shape);
79 | int fits_read_fits_region ( fitsfile *fptr, WCSdata * wcs, SAORegion **Rgn, int *status);
80 | int fits_read_ascii_region ( const char *filename, WCSdata * wcs, SAORegion **Rgn, int *status);
81 | 
82 | 
83 | 


--------------------------------------------------------------------------------
/3rdparty/cfitsio/sample.tpl:
--------------------------------------------------------------------------------
  1 | # sample template - create 9 HDUs in one FITS file
  2 | 
  3 | # syntax :
  4 | 
  5 | # everything which starts with a hashmark is ignored
  6 | # the same for empty lines
  7 | 
  8 | # one can use \include filename to include other files
  9 | # equal sign after keyword name is optional
 10 | # \group must be terminated by \end
 11 | # xtension is terminated by \group, xtension or EOF
 12 | # First HDU of type image may be defined using "SIMPLE T"
 13 | # group may contain other groups and xtensions
 14 | # keywords may be indented, but indentation is limited to max 7chars.
 15 | 
 16 | # template parser processes all keywords, makes substitutions
 17 | # when necessary (hashmarks -> index), converts keyword names
 18 | # to uppercase and writes keywords to file.
 19 | # For string keywords, parser uses CFITSIO long string routines
 20 | # to store string values longer than 72 characters. Parser can
 21 | # read/process lines of any length, as long as there is enough memory.
 22 | # For a very limited set of keywords (like NAXIS1 for binary tables)
 23 | # template parser ignores values specified in template file
 24 | # (one should not specify NAXIS1 for binary tables) and computes and
 25 | # writes values respective to table structure.
 26 | # number of rows in binary/ascii tables can be specified with NAXIS2
 27 | 
 28 | # if the 1st HDU is not defined with "SIMPLE T" and is defined with
 29 | # xtension image/asciitable/bintable then dummy primary HDU is
 30 | # created by parser.
 31 | 
 32 | simple	t
 33 |  bitpix		16
 34 |  naxis		1
 35 |  naxis1		10
 36 | COMMENT
 37 |  comment  
 38 |  sdsdf / keyword without value (null type)
 39 |         if line begins with 8+ spaces everything is a comment
 40 | 
 41 | xtension image
 42 |  bitpix		16
 43 |  naxis		1
 44 |  naxis1		10
 45 |  QWERW		F / dfg dfgsd fg - boolean keyword
 46 |  FFFSDS45	3454345 /integer_or_real keyword
 47 |  SSSDFS34	32345.453   / real keyword
 48 |  adsfd34	(234234.34,2342342.3) / complex keyword - no space between ()
 49 |  SDFDF#		adfasdfasdfdfcvxccvzxcvcvcxv / autoindexed keyword, here idx=1
 50 |  SDFD#		'asf dfa dfad df dfad f ad fadfdaf dfdfa df loooooong keyyywoooord - reaaalllly verrrrrrrrrryy loooooooooong' / comment is max 80 chars
 51 |  history        history record, spaces (all but 1st) after keyname are copied
 52 |  SDFDF#		strg_value_without_spaces / autoindexed keyword, here idx=2
 53 |  comment        comment record, spaces (all but 1st) after keyname are copied
 54 |  strg45		'sdfasdfadfffdfasdfasdfasdf &'
 55 |  continue   'sdfsdfsdfsd fsdf' / 3 spaces must follow CONTINUE keyword
 56 | 
 57 | 
 58 | xtension image
 59 |  bitpix		16
 60 |  naxis		1
 61 |  naxis1		10
 62 | 
 63 | \group
 64 |  
 65 |  xtension image
 66 |   bitpix	16
 67 |   naxis		1
 68 |   naxis1	10
 69 | 
 70 | # create group inside group
 71 | 
 72 |  \group
 73 | 
 74 | # one can specify additional columns in group HDU. The first column
 75 | # specified will have index 7 however, since the first 6 columns are occupied
 76 | # by grouping table itself.
 77 | # Please note, that it is not allowed to specify EXTNAME keyword as an
 78 | # additional keyword for group HDU, since parser automatically writes
 79 | # EXTNAME = GROUPING keyword.
 80 | 
 81 |   TFORM#	13A
 82 |   TTYPE#	ADDIT_COL_IN_GRP_HDU
 83 |   TFORM#	1E
 84 |   TTYPE#	REAL_COLUMN
 85 |   COMMENT sure, there is always place for comments
 86 | 
 87 | # the following specifies empty ascii table (0 cols / 0 rows)
 88 | 
 89 |   xtension asciitable
 90 | 
 91 |  \end
 92 |  
 93 | \end
 94 | 
 95 | # one do not have to specify all NAXISn keywords. If not specified
 96 | # NAXISn equals zero.
 97 | 
 98 | xtension image
 99 |  bitpix	16
100 |  naxis	1
101 | # naxis1	10
102 | 
103 | # the following tells how to set number of rows in binary table
104 | # note also that the last line in template file does not have to
105 | # have LineFeed character as the last one.
106 | 
107 | xtension bintable
108 | naxis2	 10
109 | EXTNAME	asdjfhsdkf
110 | TTYPE#   MEMBER_XTENSION
111 | TFORM#   8A
112 | TTYPE#   MEMBER_2
113 | TFORM#   8U
114 | TTYPE#   MEMBER_3
115 | TFORM#   8V
116 | TTYPE#   MEMBER_NAME
117 | TFORM#   32A
118 | TDIM#	 '(8,4)'
119 | TTYPE#   MEMBER_VERSION
120 | TFORM#   1J
121 | TNULL#   0


--------------------------------------------------------------------------------
/3rdparty/cfitsio/simplerng.h:
--------------------------------------------------------------------------------
 1 | /* 
 2 |    Simple Random Number Generators
 3 |        - getuniform - uniform deviate [0,1]
 4 |        - getnorm    - gaussian (normal) deviate (mean=0, stddev=1)
 5 |        - getpoisson - poisson deviate for given expected mean lambda
 6 | 
 7 |    This code is adapted from SimpleRNG by John D Cook, which is
 8 |    provided in the public domain.
 9 | 
10 |    The original C++ code is found here:
11 |    http://www.johndcook.com/cpp_random_number_generation.html
12 | 
13 |    This code has been modified in the following ways compared to the
14 |    original.
15 |      1. convert to C from C++
16 |      2. keep only uniform, gaussian and poisson deviates
17 |      3. state variables are module static instead of class variables
18 |      4. provide an srand() equivalent to initialize the state
19 | */
20 | 
21 | extern void simplerng_setstate(unsigned int u, unsigned int v);
22 | extern void simplerng_getstate(unsigned int *u, unsigned int *v);
23 | extern void simplerng_srand(unsigned int seed);
24 | extern double simplerng_getuniform(void);
25 | extern double simplerng_getnorm(void);
26 | extern int simplerng_getpoisson(double lambda);
27 | extern double simplerng_logfactorial(int n);
28 | 


--------------------------------------------------------------------------------
/3rdparty/cfitsio/smem.c:
--------------------------------------------------------------------------------
 1 | #include 
 2 | #include 
 3 | #include 
 4 | #ifdef __APPLE__
 5 | #include 
 6 | #else
 7 | #include 
 8 | #endif
 9 | #include "fitsio.h"     /* needed to define LONGLONG */
10 | #include "drvrsmem.h"   /* uses LONGLONG */
11 | 
12 | int	main(int argc, char **argv)
13 | { int cmdok, listmode, longlistmode, recovermode, deletemode, id;
14 | int status;
15 | char *address;
16 | 
17 | listmode = longlistmode = recovermode = deletemode = 0;
18 | id = -1;
19 | cmdok = 1;
20 | 
21 | switch (argc)
22 |  { case 1:	listmode = 1;
23 | 		break;
24 |    case 2:
25 | 		if (0 == strcmp("-l", argv[1])) longlistmode = 1;
26 | 		else if (0 == strcmp("-r", argv[1])) recovermode = 1;
27 | 		else if (0 == strcmp("-d", argv[1])) deletemode = 1;
28 | 		else cmdok = 0;
29 | 		break;
30 |    case 3:
31 | 		if (0 == strcmp("-r", argv[1])) recovermode = 1;
32 | 		else if (0 == strcmp("-d", argv[1])) deletemode = 1;
33 | 		else
34 | 		 { cmdok = 0;		/* signal invalid cmd line syntax */
35 | 		   break;
36 | 		 }
37 | 		if (1 != sscanf(argv[2], "%d", &id)) cmdok = 0;
38 | 		break;
39 |    default:
40 | 		cmdok = 0;
41 | 		break;
42 |  }
43 | 
44 | if (0 == cmdok)
45 |   { printf("usage :\n\n");
46 |     printf("smem            - list all shared memory segments\n");
47 |     printf("\t!\tcouldn't obtain RDONLY lock - info unreliable\n");
48 |     printf("\tIdx\thandle of shared memory segment (visible by application)\n");
49 |     printf("\tKey\tcurrent system key of shared memory segment. Key\n");
50 |     printf("\t\tchanges whenever shmem segment is reallocated. Use\n");
51 |     printf("\t\tipcs (or ipcs -a) to view all shmem segments\n");
52 |     printf("\tNproc\tnumber of processes attached to segment\n");
53 |     printf("\tSize\tsize of shmem segment in bytes\n");
54 |     printf("\tFlags\tRESIZABLE - realloc allowed, PERSIST - segment is not\n");
55 |     printf("\t\tdeleted after shared_free called by last process attached\n");
56 |     printf("\t\tto it.\n");
57 |     printf("smem -d         - delete all shared memory segments (may block)\n");
58 |     printf("smem -d id      - delete specific shared memory segment (may block)\n");
59 |     printf("smem -r         - unconditionally reset all shared memory segments\n\t\t(does not block, recovers zombie handles left by kill -9)\n");
60 |     printf("smem -r id      - unconditionally reset specific shared memory segment\n");
61 |   }
62 | 
63 | if (shared_init(0))
64 |   { printf("couldn't initialize shared memory, aborting ...\n");
65 |     return(10);
66 |   }
67 | 
68 | if (listmode) shared_list(id);
69 | else if (recovermode) shared_recover(id);
70 | else if (deletemode) shared_uncond_delete(id);
71 | 
72 | for (id = 0; id <16; id++) {
73 |   status = shared_getaddr(id, &address);
74 |   if (!status)printf("id, status, address %d %d %ld %.30s\n", id, status, address, address);
75 | }
76 | return(0);
77 | }
78 | 


--------------------------------------------------------------------------------
/3rdparty/cfitsio/testf77.std:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nmellado/Super4PCS/d5ab2a407c4f8cbfd60dc97d826b1cc726bb25d8/3rdparty/cfitsio/testf77.std


--------------------------------------------------------------------------------
/3rdparty/cfitsio/testprog.std:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nmellado/Super4PCS/d5ab2a407c4f8cbfd60dc97d826b1cc726bb25d8/3rdparty/cfitsio/testprog.std


--------------------------------------------------------------------------------
/3rdparty/cfitsio/testprog.tpt:
--------------------------------------------------------------------------------
 1 | tmpcard1  1001 this is the 1st template card 
 2 | tmpcard2  ABCD this is the 2nd template card
 3 | tmpcard3  1001.23 this is the 3rd template card
 4 | tmpcard4  1001.45 this is the 4rd template card
 5 | comment this is the 5th template card
 6 | history this is the 6th template card
 7 | tmpcard7 =            / comment for null keyword
 8 | -tmpcard1 tmpcarda  change the name of tmpcard1
 9 | -tmpcard4
10 | end
11 | 
12 | junk will be ignored
13 | 


--------------------------------------------------------------------------------
/3rdparty/cfitsio/vmsieee.c:
--------------------------------------------------------------------------------
  1 | #include 
  2 | #include 
  3 | 
  4 | unsigned long CVT$CONVERT_FLOAT();
  5 | 
  6 | /* IEEVPAKR -- Pack a native floating point vector into an IEEE one.
  7 | */
  8 | void ieevpr (unsigned int *native, unsigned int *ieee, int *nelem)
  9 | {
 10 |         unsigned long status;
 11 |         unsigned long options;
 12 |         unsigned int *unanval;
 13 |         int nanval = -1;
 14 |         int     i,n;
 15 | 
 16 |         unanval = (unsigned int *) &nanval;
 17 |         options = CVT$M_BIG_ENDIAN;
 18 |         
 19 |         n = *nelem;
 20 |         status = CVT$_NORMAL;
 21 | 
 22 |         for (i = 0; i < n ; i++) {
 23 | 
 24 |             status = CVT$CONVERT_FLOAT (&native[i], CVT$K_VAX_F,
 25 |                                         &ieee[i], CVT$K_IEEE_S, 
 26 |                                         options);
 27 |            if (status != CVT$_NORMAL) {
 28 |                  ieee[i] = *unanval;
 29 |            }
 30 |         }       
 31 | 
 32 | }
 33 | /* IEEVPAKD -- Pack a native double floating point vector into an IEEE one.
 34 | */
 35 | void ieevpd (unsigned long *native, unsigned long *ieee, int *nelem)
 36 | {
 37 |         unsigned long status;
 38 |         unsigned long options;
 39 |         unsigned long *unanval;
 40 |         long nanval = -1;
 41 |         int     i,n;
 42 | 
 43 |         unanval = (unsigned long *) &nanval;
 44 |         options = CVT$M_BIG_ENDIAN;
 45 |         
 46 |         n = *nelem * 2;
 47 |         status = CVT$_NORMAL;
 48 | 
 49 |         for (i = 0; i < n ; i=i+2) {
 50 | 
 51 |             status = CVT$CONVERT_FLOAT (&native[i], CVT$K_VAX_D,
 52 |                                         &ieee[i], CVT$K_IEEE_T, 
 53 |                                         options);
 54 |            if (status != CVT$_NORMAL) {
 55 |                  ieee[i]   = *unanval;
 56 |                  ieee[i+1] = *unanval;
 57 |            }
 58 |         }       
 59 | 
 60 | }
 61 | /* IEEVUPKR -- Unpack an ieee vector into native single floating point vector.
 62 | */
 63 | void ieevur (unsigned int *ieee, unsigned int *native, int *nelem)
 64 | {
 65 |         unsigned long status;
 66 |         unsigned long options;
 67 |         unsigned int *unanval;
 68 |         int nanval = -1;
 69 |         int     j,n;
 70 | 
 71 |         unanval = (unsigned int *) &nanval;
 72 |         options = CVT$M_ERR_UNDERFLOW+CVT$M_BIG_ENDIAN;
 73 |         
 74 |         n = *nelem;
 75 | 
 76 |         status = CVT$_NORMAL;
 77 | 
 78 |         for (j = 0; j < n ; j++) {
 79 |            status = CVT$CONVERT_FLOAT (&ieee[j], CVT$K_IEEE_S,
 80 |                                         &native[j], CVT$K_VAX_F, 
 81 |                                         options);
 82 |            if (status != CVT$_NORMAL)
 83 |               switch(status) {
 84 |               case CVT$_INVVAL:
 85 |               case CVT$_NEGINF:
 86 |               case CVT$_OVERFLOW:
 87 |               case CVT$_POSINF:
 88 |                  native[j]   = *unanval;
 89 |                  break;
 90 |               default:
 91 |                  native[j] = 0;             
 92 |               }
 93 |         }
 94 | }
 95 | /* IEEVUPKD -- Unpack an ieee vector into native double floating point vector.
 96 | */
 97 | void ieevud (unsigned long *ieee, unsigned long *native, int *nelem)
 98 | {
 99 |         unsigned long status;
100 |         unsigned long options;
101 |         unsigned long *unanval;
102 |         long nanval = -1;
103 |         int     j,n;
104 | 
105 |         unanval = (unsigned long *) &nanval;
106 |         options = CVT$M_BIG_ENDIAN + CVT$M_ERR_UNDERFLOW; 
107 |         
108 |         n = *nelem * 2;
109 | 
110 |         status = CVT$_NORMAL;
111 | 
112 |         for (j = 0; j < n ; j=j+2) {
113 |            status = CVT$CONVERT_FLOAT (&ieee[j], CVT$K_IEEE_T,
114 |                                         &native[j], CVT$K_VAX_D, 
115 |                                         options);
116 |            if (status != CVT$_NORMAL)
117 |               switch(status) {
118 |               case CVT$_INVVAL:
119 |               case CVT$_NEGINF:
120 |               case CVT$_OVERFLOW:
121 |               case CVT$_POSINF:
122 |                  native[j]   = *unanval;
123 |                  native[j+1] = *unanval;
124 |                  break;
125 |               default:
126 |                  native[j]   = 0;             
127 |                  native[j+1] = 0;             
128 |               }
129 |         }
130 | }
131 | 


--------------------------------------------------------------------------------
/3rdparty/cfitsio/winDumpExts.mak:
--------------------------------------------------------------------------------
  1 | # Microsoft Developer Studio Generated NMAKE File, Based on winDumpExts.dsp
  2 | !IF "$(CFG)" == ""
  3 | CFG=Win32 Debug
  4 | !MESSAGE No configuration specified. Defaulting to Win32 Debug.
  5 | !ENDIF 
  6 | 
  7 | !IF "$(CFG)" != "Win32 Release" && "$(CFG)" != "Win32 Debug"
  8 | !MESSAGE Invalid configuration "$(CFG)" specified.
  9 | !MESSAGE You can specify a configuration when running NMAKE
 10 | !MESSAGE by defining the macro CFG on the command line. For example:
 11 | !MESSAGE 
 12 | !MESSAGE NMAKE /f "winDumpExts.mak" CFG="Win32 Debug"
 13 | !MESSAGE 
 14 | !MESSAGE Possible choices for configuration are:
 15 | !MESSAGE 
 16 | !MESSAGE "Win32 Release" (based on "Win32 (x86) Console Application")
 17 | !MESSAGE "Win32 Debug" (based on "Win32 (x86) Console Application")
 18 | !MESSAGE 
 19 | !ERROR An invalid configuration is specified.
 20 | !ENDIF 
 21 | 
 22 | !IF "$(OS)" == "Windows_NT"
 23 | NULL=
 24 | !ELSE 
 25 | NULL=nul
 26 | !ENDIF 
 27 | 
 28 | !IF  "$(CFG)" == "Win32 Release"
 29 | 
 30 | OUTDIR=.\Release
 31 | INTDIR=.\Release
 32 | # Begin Custom Macros
 33 | OutDir=.\Release
 34 | # End Custom Macros
 35 | 
 36 | ALL : "$(OUTDIR)\winDumpExts.exe"
 37 | 
 38 | 
 39 | CLEAN :
 40 | 	-@erase "$(INTDIR)\vc60.idb"
 41 | 	-@erase "$(INTDIR)\winDumpExts.obj"
 42 | 	-@erase "$(OUTDIR)\winDumpExts.exe"
 43 | 
 44 | "$(OUTDIR)" :
 45 |     if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
 46 | 
 47 | "$(INTDIR)" :
 48 |     if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)"
 49 | 
 50 | CPP=cl.exe
 51 | CPP_PROJ=/nologo /ML /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Fp"$(INTDIR)\winDumpExts.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c 
 52 | 
 53 | .c{$(INTDIR)}.obj::
 54 |    $(CPP) @<<
 55 |    $(CPP_PROJ) $< 
 56 | <<
 57 | 
 58 | .cpp{$(INTDIR)}.obj::
 59 |    $(CPP) @<<
 60 |    $(CPP_PROJ) $< 
 61 | <<
 62 | 
 63 | .cxx{$(INTDIR)}.obj::
 64 |    $(CPP) @<<
 65 |    $(CPP_PROJ) $< 
 66 | <<
 67 | 
 68 | .c{$(INTDIR)}.sbr::
 69 |    $(CPP) @<<
 70 |    $(CPP_PROJ) $< 
 71 | <<
 72 | 
 73 | .cpp{$(INTDIR)}.sbr::
 74 |    $(CPP) @<<
 75 |    $(CPP_PROJ) $< 
 76 | <<
 77 | 
 78 | .cxx{$(INTDIR)}.sbr::
 79 |    $(CPP) @<<
 80 |    $(CPP_PROJ) $< 
 81 | <<
 82 | 
 83 | RSC=rc.exe
 84 | BSC32=bscmake.exe
 85 | BSC32_FLAGS=/nologo /o"$(OUTDIR)\winDumpExts.bsc" 
 86 | BSC32_SBRS= \
 87 | 	
 88 | LINK32=link.exe
 89 | LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:no /pdb:"$(OUTDIR)\winDumpExts.pdb" /machine:I386 /out:"$(OUTDIR)\winDumpExts.exe" 
 90 | LINK32_OBJS= \
 91 | 	"$(INTDIR)\winDumpExts.obj"
 92 | 
 93 | "$(OUTDIR)\winDumpExts.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
 94 |     $(LINK32) @<<
 95 |   $(LINK32_FLAGS) $(LINK32_OBJS)
 96 | <<
 97 | 
 98 | !ELSEIF  "$(CFG)" == "Win32 Debug"
 99 | 
100 | OUTDIR=.
101 | INTDIR=.\Debug
102 | # Begin Custom Macros
103 | OutDir=.
104 | # End Custom Macros
105 | 
106 | ALL : "$(OUTDIR)\winDumpExts.exe"
107 | 
108 | 
109 | CLEAN :
110 | 	-@erase "$(INTDIR)\vc60.idb"
111 | 	-@erase "$(INTDIR)\vc60.pdb"
112 | 	-@erase "$(INTDIR)\winDumpExts.obj"
113 | 	-@erase "$(OUTDIR)\winDumpExts.exe"
114 | 	-@erase "$(OUTDIR)\winDumpExts.ilk"
115 | 	-@erase "$(OUTDIR)\winDumpExts.pdb"
116 | 
117 | "$(OUTDIR)" :
118 |     if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
119 | 
120 | "$(INTDIR)" :
121 |     if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)"
122 | 
123 | CPP=cl.exe
124 | CPP_PROJ=/nologo /MLd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Fp"$(INTDIR)\winDumpExts.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c 
125 | 
126 | .c{$(INTDIR)}.obj::
127 |    $(CPP) @<<
128 |    $(CPP_PROJ) $< 
129 | <<
130 | 
131 | .cpp{$(INTDIR)}.obj::
132 |    $(CPP) @<<
133 |    $(CPP_PROJ) $< 
134 | <<
135 | 
136 | .cxx{$(INTDIR)}.obj::
137 |    $(CPP) @<<
138 |    $(CPP_PROJ) $< 
139 | <<
140 | 
141 | .c{$(INTDIR)}.sbr::
142 |    $(CPP) @<<
143 |    $(CPP_PROJ) $< 
144 | <<
145 | 
146 | .cpp{$(INTDIR)}.sbr::
147 |    $(CPP) @<<
148 |    $(CPP_PROJ) $< 
149 | <<
150 | 
151 | .cxx{$(INTDIR)}.sbr::
152 |    $(CPP) @<<
153 |    $(CPP_PROJ) $< 
154 | <<
155 | 
156 | RSC=rc.exe
157 | BSC32=bscmake.exe
158 | BSC32_FLAGS=/nologo /o"$(OUTDIR)\winDumpExts.bsc" 
159 | BSC32_SBRS= \
160 | 	
161 | LINK32=link.exe
162 | LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:yes /pdb:"$(OUTDIR)\winDumpExts.pdb" /debug /machine:I386 /out:"$(OUTDIR)\winDumpExts.exe" /pdbtype:sept 
163 | LINK32_OBJS= \
164 | 	"$(INTDIR)\winDumpExts.obj"
165 | 
166 | "$(OUTDIR)\winDumpExts.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
167 |     $(LINK32) @<<
168 |   $(LINK32_FLAGS) $(LINK32_OBJS)
169 | <<
170 | 
171 | !ENDIF 
172 | 
173 | 
174 | !IF "$(NO_EXTERNAL_DEPS)" != "1"
175 | !IF EXISTS("winDumpExts.dep")
176 | !INCLUDE "winDumpExts.dep"
177 | !ELSE 
178 | !MESSAGE Warning: cannot find "winDumpExts.dep"
179 | !ENDIF 
180 | !ENDIF 
181 | 
182 | 
183 | !IF "$(CFG)" == "Win32 Release" || "$(CFG)" == "Win32 Debug"
184 | SOURCE=.\winDumpExts.c
185 | 
186 | "$(INTDIR)\winDumpExts.obj" : $(SOURCE) "$(INTDIR)"
187 | 
188 | 
189 | 
190 | !ENDIF 
191 | 
192 | 


--------------------------------------------------------------------------------
/3rdparty/cfitsio/zlib/inffast.h:
--------------------------------------------------------------------------------
 1 | /* inffast.h -- header to use inffast.c
 2 |  * Copyright (C) 1995-2003, 2010 Mark Adler
 3 |  * For conditions of distribution and use, see copyright notice in zlib.h
 4 |  */
 5 | 
 6 | /* WARNING: this file should *not* be used by applications. It is
 7 |    part of the implementation of the compression library and is
 8 |    subject to change. Applications should only use zlib.h.
 9 |  */
10 | 
11 | void ZLIB_INTERNAL inflate_fast OF((z_streamp strm, unsigned start));
12 | 


--------------------------------------------------------------------------------
/3rdparty/cfitsio/zlib/inftrees.h:
--------------------------------------------------------------------------------
 1 | /* inftrees.h -- header to use inftrees.c
 2 |  * Copyright (C) 1995-2005, 2010 Mark Adler
 3 |  * For conditions of distribution and use, see copyright notice in zlib.h
 4 |  */
 5 | 
 6 | /* WARNING: this file should *not* be used by applications. It is
 7 |    part of the implementation of the compression library and is
 8 |    subject to change. Applications should only use zlib.h.
 9 |  */
10 | 
11 | /* Structure for decoding tables.  Each entry provides either the
12 |    information needed to do the operation requested by the code that
13 |    indexed that table entry, or it provides a pointer to another
14 |    table that indexes more bits of the code.  op indicates whether
15 |    the entry is a pointer to another table, a literal, a length or
16 |    distance, an end-of-block, or an invalid code.  For a table
17 |    pointer, the low four bits of op is the number of index bits of
18 |    that table.  For a length or distance, the low four bits of op
19 |    is the number of extra bits to get after the code.  bits is
20 |    the number of bits in this code or part of the code to drop off
21 |    of the bit buffer.  val is the actual byte to output in the case
22 |    of a literal, the base length or distance, or the offset from
23 |    the current table to the next table.  Each entry is four bytes. */
24 | typedef struct {
25 |     unsigned char op;           /* operation, extra bits, table bits */
26 |     unsigned char bits;         /* bits in this part of the code */
27 |     unsigned short val;         /* offset in table or code value */
28 | } code;
29 | 
30 | /* op values as set by inflate_table():
31 |     00000000 - literal
32 |     0000tttt - table link, tttt != 0 is the number of table index bits
33 |     0001eeee - length or distance, eeee is the number of extra bits
34 |     01100000 - end of block
35 |     01000000 - invalid code
36 |  */
37 | 
38 | /* Maximum size of the dynamic table.  The maximum number of code structures is
39 |    1444, which is the sum of 852 for literal/length codes and 592 for distance
40 |    codes.  These values were found by exhaustive searches using the program
41 |    examples/enough.c found in the zlib distribtution.  The arguments to that
42 |    program are the number of symbols, the initial root table size, and the
43 |    maximum bit length of a code.  "enough 286 9 15" for literal/length codes
44 |    returns returns 852, and "enough 30 6 15" for distance codes returns 592.
45 |    The initial root table size (9 or 6) is found in the fifth argument of the
46 |    inflate_table() calls in inflate.c and infback.c.  If the root table size is
47 |    changed, then these maximum sizes would be need to be recalculated and
48 |    updated. */
49 | #define ENOUGH_LENS 852
50 | #define ENOUGH_DISTS 592
51 | #define ENOUGH (ENOUGH_LENS+ENOUGH_DISTS)
52 | 
53 | /* Type of code to build for inflate_table() */
54 | typedef enum {
55 |     CODES,
56 |     LENS,
57 |     DISTS
58 | } codetype;
59 | 
60 | int ZLIB_INTERNAL inflate_table OF((codetype type, unsigned short FAR *lens,
61 |                              unsigned codes, code FAR * FAR *table,
62 |                              unsigned FAR *bits, unsigned short FAR *work));
63 | 


--------------------------------------------------------------------------------
/3rdparty/cfitsio/zlib/uncompr.c:
--------------------------------------------------------------------------------
 1 | /* uncompr.c -- decompress a memory buffer
 2 |  * Copyright (C) 1995-2003, 2010 Jean-loup Gailly.
 3 |  * For conditions of distribution and use, see copyright notice in zlib.h
 4 |  */
 5 | 
 6 | #define ZLIB_INTERNAL
 7 | #include "zlib.h"
 8 | 
 9 | /* ===========================================================================
10 |      Decompresses the source buffer into the destination buffer.  sourceLen is
11 |    the byte length of the source buffer. Upon entry, destLen is the total
12 |    size of the destination buffer, which must be large enough to hold the
13 |    entire uncompressed data. (The size of the uncompressed data must have
14 |    been saved previously by the compressor and transmitted to the decompressor
15 |    by some mechanism outside the scope of this compression library.)
16 |    Upon exit, destLen is the actual size of the compressed buffer.
17 | 
18 |      uncompress returns Z_OK if success, Z_MEM_ERROR if there was not
19 |    enough memory, Z_BUF_ERROR if there was not enough room in the output
20 |    buffer, or Z_DATA_ERROR if the input data was corrupted.
21 | */
22 | int ZEXPORT uncompress (dest, destLen, source, sourceLen)
23 |     Bytef *dest;
24 |     uLongf *destLen;
25 |     const Bytef *source;
26 |     uLong sourceLen;
27 | {
28 |     z_stream stream;
29 |     int err;
30 | 
31 |     stream.next_in = (Bytef*)source;
32 |     stream.avail_in = (uInt)sourceLen;
33 |     /* Check for source > 64K on 16-bit machine: */
34 |     if ((uLong)stream.avail_in != sourceLen) return Z_BUF_ERROR;
35 | 
36 |     stream.next_out = dest;
37 |     stream.avail_out = (uInt)*destLen;
38 |     if ((uLong)stream.avail_out != *destLen) return Z_BUF_ERROR;
39 | 
40 |     stream.zalloc = (alloc_func)0;
41 |     stream.zfree = (free_func)0;
42 | 
43 |     err = inflateInit(&stream);
44 |     if (err != Z_OK) return err;
45 | 
46 |     err = inflate(&stream, Z_FINISH);
47 |     if (err != Z_STREAM_END) {
48 |         inflateEnd(&stream);
49 |         if (err == Z_NEED_DICT || (err == Z_BUF_ERROR && stream.avail_in == 0))
50 |             return Z_DATA_ERROR;
51 |         return err;
52 |     }
53 |     *destLen = stream.total_out;
54 | 
55 |     err = inflateEnd(&stream);
56 |     return err;
57 | }
58 | 


--------------------------------------------------------------------------------
/3rdparty/chealpix/CHANGES:
--------------------------------------------------------------------------------
 1 | Changes since v2.20a (incomplete):
 2 | 
 3 | - The Healpix C library has been rewritten almost completely. Algorithms are now
 4 |   as similar as possible to the ones in the C++ library, simplifying code
 5 |   maintenance. Many functions have become much faster and shorter.
 6 |   The interface is unaffected by this change, so existing codes using the
 7 |   Healpix C library should not need to be changed.
 8 | - An additional set of functions was added to support Nside values up to 2^29.
 9 | - Nside values which are not powers of 2 are supported in RING scheme.
10 | - optional compilation without libcfitsio (the cfitsio-related functions are
11 |   skipped in this mode); contributed by Yu Feng
12 | 


--------------------------------------------------------------------------------
/3rdparty/chealpix/CMakeLists.txt:
--------------------------------------------------------------------------------
 1 | cmake_minimum_required(VERSION 2.6)
 2 | project(chealpix)
 3 | 
 4 | include_directories(${CFITSIO_INCLUDE_DIRS})
 5 | 
 6 | # Set variables
 7 | set(Chealpix_INCLUDE_DIR "${PROJECT_SOURCE_DIR}/include" CACHE INTERNAL "Chealpix include dir" FORCE)
 8 | set(Chealpix_LIB_DIR "${PROJECT_BINARY_DIR}")
 9 | set(Chealpix_LIBS ${PROJECT_NAME} CACHE INTERNAL "Chealpix lib dir" FORCE)
10 | 
11 | # create the c-based healpix library.
12 | include_directories(${Chealpix_INCLUDE_DIR})
13 | 
14 | add_library(${PROJECT_NAME} SHARED ${PROJECT_SOURCE_DIR}/src/chealpix.c)
15 | target_link_libraries(${PROJECT_NAME} ${CFITSIO_LIBRARIES})
16 | add_dependencies(${PROJECT_NAME}  cfitsio)
17 | 
18 | set(targets_export_name "${PROJECT_NAME}Targets")
19 | install( TARGETS ${PROJECT_NAME}
20 |     EXPORT "${targets_export_name}"
21 |     RUNTIME DESTINATION bin
22 |     LIBRARY DESTINATION lib
23 |     ARCHIVE DESTINATION lib
24 |     INCLUDES DESTINATION include )
25 | 


--------------------------------------------------------------------------------
/3rdparty/chealpix/README:
--------------------------------------------------------------------------------
 1 | README
 2 | ======
 3 | 
 4 | Compilation and Installation
 5 | ----------------------------
 6 | 
 7 | See the header in the 'subs/Makefile'.
 8 | 
 9 | You can alternatively try to run the script 'doinstall'
10 | 
11 | Usage
12 | -----
13 | 
14 | To use in your 'c' code, include the line
15 | 
16 | #include "chealpix.h"
17 | 
18 | in your code and link with something like 
19 | 
20 | gcc -o myprog myprog.c -I -L -lchealpix
21 | 
22 | where  is where you've installed the '.h' files and 
23 |  is where you've installed the libraries (See the header of 
24 | the 'Makefile').
25 | 
26 | You will also need the 'cfitsio' library. See 
27 | http://heasarc.gsfc.nasa.gov/docs/software/fitsio/fitsio.html
28 | 
29 | Disclaimer and Acknowledgements:
30 | --------------------------------
31 | 
32 | The original HEALPix Fortran90 software was written by Gorski, Hivon, Hansen,
33 | Stompor, Banday and Bartelmann. The 'C' routines are an adaptation of parts of
34 | the Healpix C++ library, done by Martin Reinecke.
35 | 
36 | Description of Individual Files:
37 | --------------------------------
38 | 
39 | Makefile             : A UNIX makefile to build and install the library
40 | README               : This file
41 | chealpix.h           : Header file to be included to define the functions
42 | chealpix.c           : implementation of the C Healpix routines
43 | 
44 | test_chealpix.c      : Self-test for pixel operations and FITS I/O
45 | 


--------------------------------------------------------------------------------
/CHANGELOG:
--------------------------------------------------------------------------------
 1 | Super4PCS-V1.1.2
 2 | ======================
 3 | ### Purpose of this release
 4 | Stabilizing building process and source code, and improve compatibility with modern CMake before use in other contexts (wrappers to other libraries, Meshlab plugin, etc...):
 5 |  * Add a Super4PCS CMake package exporting the libraries
 6 |  * Improve testing (enable testing on windows + test library linking)
 7 | 
 8 | ### Changelog
 9 |  - Improve installation process
10 |     - Install headers db3457fa4f422ed6b7073ea3d59cc70d7888fecb 7211d7640635dc2fb3592c768178e9a060a9a808
11 |     - Add proper cmake package 9b92ebbfe6ce08535f1c21f39eeb26f248f14916. Check instructions here: https://github.com/nmellado/Super4PCS/wiki/Compilation#usage
12 |     - Update CMake minimal version to 3.3 aa21804df523554f66bcbcee8ba8d248aedba584
13 |  - API
14 |     - Refactor main namespace name as `GlobalRegistration` 036972d4ea7f5c304f6a04c690dfd789b920c656 ba79cae738e8bac8e412971c5875e316fbc558e8
15 |     - Clean `match4pcsBase` API: keep only `ComputeTransformation` as public method (+ getters), and mark other internal methods as protected. 
16 | Consequence of this change: the test applications will have to create local classes inheriting from `match4pcsBase` to allow access to these internal routines.  db3d7a06f48900f96a9af9a9fd657993fbe38806
17 |  - Continuous Integration
18 |     - Update Travis script to cope for new cmake minimal version aa21804df523554f66bcbcee8ba8d248aedba584 f9b654dfd294259b9837628d2286f72660c70a9b 43b23f6ff29d6112dc7afc9bd1e7e5775063cb9c f185cfcc48d8eba5183944779449225c493d6e0d 57aa88896510c257846b434db09c26f37a58f07a 4b78a1798113d2f02a16994610bb8ba59226ab2d
19 |     - Add new test compiling and running an external application and linking against the Super4PCS library 75671cefddf2b4535cbb1f998a3080090bfaf1f2
20 |     - [windows] Enable testing (release only, due to bad performances in debug -> hitting timeout)
21 |     - [windows] Remove support for 32 bits builds 
22 |  - Other fixes and improvements
23 |     - Remove compilation warnings in IO module (not that this module is not safer than before, but just quiet) 93e9fbf0ea6b5976fbf24487480725614e708ebd c8ad84e0460e0fc8efe8a98b169118590c8fd662
24 |     - Fix remaining logging commands not using the logging system 61b0fa229b65afee6ef586db6b4be326e8d0ca7d
25 |     - Add missing file in CMake project (`match4pcsBase.hpp` was not visible in IDEs) 65b8156a8af8cb885a75c31aacade89f099d6fc6
26 |     - Change `TransformVisitor` default behavior d2048b5534d528df5abb2d4f5c816cf2d462a99a
27 | 
28 | Super4PCS-V1.1.1
29 | ======================
30 | Minor release update including:
31 |  - fixes in the deployment system and 
32 |  - fix a compilation error when enabling timings, authored by @xinkang 
33 | 
34 | Super4PCS-V1.1.0
35 | ======================
36 | This release introduces new code structure allowing use as an actual library.
37 | 
38 |  - Build system
39 |    - Add install target in cmake
40 |    - Save binaries compiled by AppVeyor integration system as Artifacts
41 |  - Demos, scripts and assets
42 |    - assets are now added to the install folder, including downloaded datasets
43 |    - demo scripts have been updated to work directly after installation. Windows batch scripts have been added.
44 |  - Dependencies
45 |    - Chealpix dependency is marked as deprecated: it slows down the approach and reduce it's robustness. Consequently, Chealpix is still built in CI but not tested.
46 |  - Devel
47 |    - Update include directive relatively to super4pcs root dir.
48 |    - Add silent mode in matcher to avoid unwanted logging on standard output. This is implemented by adding a visitor in the matcher main loop, and set it as a logger in the Super4pcs main app.
49 | 
50 | Super4PCS-V1.0.0-alpha
51 | ======================
52 | 
53 | 
54 |  - Dependencies:
55 |    - remove ANN dependency,
56 |    - remove dependency to Chealpix. Can be controlled by the option SUPER4PCS_USE_CHEALPIX. This options will be available for some time for experiment purposes. During this time, Chealpix and Cfitsio files will still be shipped with Super4PCS source code.
57 |    - OpenCV is required only to load meshes textures. This dependency can be removed by switching option IO_USE_OPENCV to FALSE,
58 |  - remove duplicate code between 4PCS and Super4PCS,
59 |  - clean code structure,
60 |  - demo dataset + run script added
61 | 
62 | 
63 | This release has been tested on:
64 |     Debian 4.9.30-1
65 |         clang version 3.8.1-24
66 |         gcc version 6.3.0 20170516
67 |     Microsoft Windows 10
68 |         VS 2017
69 | 
70 | This release fixes issues 34 and 29.
71 | 


--------------------------------------------------------------------------------
/CTestConfig.cmake:
--------------------------------------------------------------------------------
 1 | ## This file should be placed in the root directory of your project.
 2 | ## Then modify the CMakeLists.txt file in the root directory of your
 3 | ## project to incorporate the testing dashboard.
 4 | ##
 5 | ## # The following are required to submit to the CDash dashboard:
 6 | ##   ENABLE_TESTING()
 7 | ##   INCLUDE(CTest)
 8 | 
 9 | set(CTEST_PROJECT_NAME "Super4PCS")
10 | set(CTEST_NIGHTLY_START_TIME "00:00:00 EST")
11 | 
12 | set(CTEST_DROP_METHOD "http")
13 | set(CTEST_DROP_SITE "my.cdash.org")
14 | set(CTEST_DROP_LOCATION "/submit.php?project=Super4PCS")
15 | set(CTEST_DROP_SITE_CDASH TRUE)
16 | 


--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
 1 | Copyright [2014] [Nicolas Mellado]
 2 | 
 3 | Licensed under the Apache License, Version 2.0 (the "License");
 4 | you may not use this file except in compliance with the License.
 5 | You may obtain a copy of the License at
 6 | 
 7 |     http://www.apache.org/licenses/LICENSE-2.0
 8 | 
 9 | Unless required by applicable law or agreed to in writing, software
10 | distributed under the License is distributed on an "AS IS" BASIS,
11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | See the License for the specific language governing permissions and
13 | limitations under the License.
14 | 


--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
 1 | ---
 2 | This library is not maintained anymore
 3 | ---
 4 | It is replaced by the fork OpenGR: https://github.com/STORM-IRIT/OpenGR
 5 | 
 6 | Except critical bug fix, no changes will be added to this repo. Please request support on OpenGR issue tracker.
 7 | 
 8 | ---
 9 | 
10 | 
11 | Super4PCS
12 | =========
13 | 
14 | An implementation of the Super 4-points Congruent Sets (Super 4PCS) algorithm presented in:
15 | 
16 | > Super 4PCS: Fast Global Pointcloud Registration via Smart Indexing
17 | > Nicolas Mellado, Dror Aiger, Niloy J. Mitra
18 | > Symposium on Geometry Processing 2014.
19 | 
20 | Authors: Nicolas Mellado, Dror Aiger
21 | 
22 | [stsimg-linux]: https://api.travis-ci.org/nmellado/Super4PCS.svg?branch=master
23 | [stsimg-windw]: https://ci.appveyor.com/api/projects/status/reg4cmhn309w1s8k/branch/master?svg=true
24 | 
25 | | Linux  - MacOS  | Windows         |
26 | | :----:          | :-----:         |
27 | | ![stsimg-linux] | ![stsimg-windw] |
28 | 
29 | Documentation: [http://nmellado.github.io/Super4PCS/](http://nmellado.github.io/Super4PCS/)
30 | 
31 | Paper project page: [http://geometry.cs.ucl.ac.uk/projects/2014/super4PCS](http://geometry.cs.ucl.ac.uk/projects/2014/super4PCS)
32 | 
33 | 
34 | 
35 | ## News
36 | * 28th September 2017: Super4PCS [v1.1.3](https://github.com/nmellado/Super4PCS/releases/tag/v1.1.3) is out, providing a new Meshlab plugin, PCL wrapper, doxygen-generated documentation (online [here](http://nmellado.github.io/Super4PCS/)) and several bug fixes.
37 | * 24th August 2017: Super4PCS [v1.1.2](https://github.com/nmellado/Super4PCS/releases/tag/v1.1.2) introduces Super4PCS CMake package, better testing (including on Windows plateform), cleaner code structure (moved demos away from library code).
38 | * 10th August 2017: Super4PCS [v1.1.1](https://github.com/nmellado/Super4PCS/releases/tag/v1.1.1) introduces minor fixes from previous release.
39 | * 10th August 2017: Super4PCS [v1.1.0](https://github.com/nmellado/Super4PCS/releases/tag/v1.1.0) is available, improving performances, fixing use as C++ library, and generalizing CI use.
40 | * 17th July 2017: CI integration (Windows, MacOS and Linux) enabled. Currently, only compilation is tested, but performances monitoring will be added in upcoming release.
41 | * 5th July 2017: Super4PCS got the SGP Software Award 2017 !
42 | * 19th June 2017: Super4PCS v1.0.0-alpha is available.
43 | * 18th May 2016: Super4PCS [v0.2.1-alpha](https://github.com/nmellado/Super4PCS/releases/tag/v0.2.1-alpha) is available, fixing a problematic crash introduced in previous release.
44 | * 3rd May 2016: Super4PCS [v0.2-alpha](https://github.com/nmellado/Super4PCS/releases/tag/v0.2-alpha) is out !
45 | * 23th March 2016: Super4PCS can now be compiled with Visual Studio 2015! Checkout the [Wiki](http://github.com/nmellado/Super4PCS/wiki) for more details.
46 | 
47 | ## Paper Abstract
48 | > Data acquisition in large-scale scenes regularly involves accumulating information across multiple scans. A common approach is to locally align scan pairs using Iterative Closest Point (ICP) algorithm (or its variants), but requires static scenes and small motion between scan pairs. This prevents accumulating data across multiple scan sessions and/or different acquisition modalities (e.g., stereo, depth scans). Alternatively, one can use a global registration algorithm allowing scans to be in arbitrary initial poses. The state-of-the-art global registration algorithm, 4PCS, however has a quadratic time complexity in the number of data points. This vastly limits its applicability to acquisition of large environments. We present Super 4PCS for global pointcloud registration that is optimal, i.e., runs in linear time (in the number of data points) and is also output sensitive in the complexity of the alignment problem based on the (unknown) overlap across scan pairs. Technically, we map the algorithm as an ‘instance problem’ and solve it efficiently using a smart indexing data organization. The algorithm is simple, memory-efficient, and fast. We demonstrate that Super 4PCS results in significant speedup over alternative approaches and allows unstructured efficient acquisition of scenes at scales previously not possible. Complete source code and datasets are available for research use at http://geometry.cs.ucl.ac.uk/projects/2014/super4PCS/.
49 | 


--------------------------------------------------------------------------------
/appveyor.yml:
--------------------------------------------------------------------------------
 1 | # Specify version format
 2 | version: "{build}"
 3 | 
 4 | # Operating system (build VM template)
 5 | os: Visual Studio 2015
 6 | 
 7 | # build platform, i.e. Win32 (instead of x86), x64, Any CPU. This setting is optional.
 8 | platform:
 9 |   - x64
10 | 
11 | # Do not build feature branch with open Pull Request
12 | skip_branch_with_pr: true
13 | 
14 | skip_commits:
15 |   files:
16 |     .travis.yml
17 |     .gitignore
18 | 
19 | # specify custom environment variables
20 | environment:
21 |   MSVC_DEFAULT_OPTIONS: ON
22 |   SUPER4PCS_REPOSITORY_ROOT: C:\projects\Super4PCS
23 |   SUPER4PCS_BUILD_DIR: C:\projects\Super4PCS\build
24 |   SUPER4PCS_RELEASE_DIR: C:\projects\Super4PCS\Super4PCS-%platform%-%configuration%
25 |   SUPER4PCS_RELEASE_NAME: Super4PCS-%platform%-%configuration%
26 | 
27 | # build configuration, i.e. Debug, Release, etc.
28 | configuration:
29 |   - Debug
30 |   - Release
31 | 
32 | # scripts that are called at very beginning, before repo cloning
33 | init:
34 |   - cmd: cmake --version
35 |   - cmd: msbuild /version
36 | 
37 | # clone directory
38 | clone_folder: C:\projects\Super4PCS
39 | 
40 | # branches to build
41 | branches:
42 |   # whitelist
43 |   # only:
44 |   #   - master
45 |   # blacklist
46 |   except:
47 |     - gh-pages
48 | 
49 | # scripts that run after cloning repository
50 | install:
51 | 
52 | # scripts to run before build
53 | before_build:
54 |   - cmd: md %SUPER4PCS_BUILD_DIR%
55 |   - cmd: cd %SUPER4PCS_BUILD_DIR%
56 | 
57 |   - cmd: if "%platform%"=="Win32" set CMAKE_GENERATOR_NAME=Visual Studio 14 2015
58 |   - cmd: if "%platform%"=="x64"   set CMAKE_GENERATOR_NAME=Visual Studio 14 2015 Win64
59 |   - cmd: cmake -G "%CMAKE_GENERATOR_NAME%" -DCMAKE_BUILD_TYPE=%configuration% -DSUPER4PCS_COMPILE_TESTS=TRUE -DIO_USE_OPENCV=FALSE -DENABLE_TIMING=FALSE -DSUPER4PCS_USE_CHEALPIX=FALSE -DDL_DATASETS=FALSE  -DCMAKE_INSTALL_PREFIX=%SUPER4PCS_RELEASE_DIR% ..
60 |   - cmd: dir .
61 | 
62 | build:
63 |   project: C:\projects\Super4PCS\build\INSTALL.vcxproj  # path to Visual Studio solution or project
64 |   parallel: true                           # enable MSBuild parallel builds
65 |   verbosity: quiet                         # MSBuild verbosity level (quiet|minimal|normal|detailed)
66 | 
67 | after_build:
68 |   - cmd: cd %SUPER4PCS_REPOSITORY_ROOT%
69 |   - cmd: dir %SUPER4PCS_RELEASE_DIR%
70 | 
71 | artifacts:
72 |   - path: Super4PCS-%platform%-%configuration% # use relative path
73 |     name: Super4PCS-%platform%-%configuration%
74 |     type: zip
75 | 
76 | test: on
77 | test_script:
78 |   - cmd: if "%configuration%"=="Release" msbuild %SUPER4PCS_BUILD_DIR%\buildtests.vcxproj /m /p:Configuration=%configuration%
79 |   - cmd: if "%configuration%"=="Release" msbuild %SUPER4PCS_BUILD_DIR%\RUN_TESTS.vcxproj  /m /p:Configuration=%configuration%
80 | #   - cmd: ctest --build-config %configuration% --parallel 4 --output-on-failure
81 | 
82 | 


--------------------------------------------------------------------------------
/cmake/AssetsAndScripts.cmake:
--------------------------------------------------------------------------------
 1 | 
 2 | # SCRIPTS
 3 | file (GLOB Scripts_SRC ${SCRIPTS_DIR}/*.sh
 4 |                        ${SCRIPTS_DIR}/*.bat)
 5 | 
 6 | install( FILES ${Scripts_SRC}
 7 |          DESTINATION ${CMAKE_INSTALL_PREFIX}/scripts
 8 |          PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ)
 9 | add_custom_target(super4pcs_scripts_IDE SOURCES ${Scripts_SRC})
10 | 
11 | 
12 | # ASSETS
13 | if (DL_DATASETS)
14 |     file (GLOB_RECURSE Assets_SRC  ${ASSETS_DIR}/*)
15 |     add_custom_target(super4pcs_assets SOURCES ${Assets_SRC}
16 |                                        DEPENDS dl-datasets)
17 | endif (DL_DATASETS)
18 | 
19 | install( DIRECTORY ${ASSETS_DIR}/ DESTINATION ${CMAKE_INSTALL_PREFIX}/assets )
20 | 


--------------------------------------------------------------------------------
/cmake/Config.cmake.in:
--------------------------------------------------------------------------------
 1 | # - Config file for the Super4PCS package
 2 | # It defines the following variables
 3 | #  Super4PCS_INCLUDE_DIRS - include directories for Super4PCS
 4 | #  Super4PCS_LIB_DIR    - libraries to link against
 5 | #  Super4PCS_LIBRARIES    - libraries to link against
 6 | #
 7 | #
 8 | # To use
 9 | # ::
10 | # find_package(Super4PCS REQUIRED)
11 | # include_directories(${Super4PCS_INCLUDE_DIR})
12 | # add_executable(foo foo.cc)
13 | # target_link_libraries(foo ${Super4PCS_LIBRARIES})
14 | # link_directories(${Super4PCS_LIB_DIR})
15 | #
16 | # find_package( Eigen3 REQUIRED )
17 | # include_directories( ${EIGEN3_INCLUDE_DIR} )
18 | 
19 | 
20 | @PACKAGE_INIT@
21 | 
22 | if(@SUPER4PCS_USE_CHEALPIX@)
23 |   include("${CMAKE_CURRENT_LIST_DIR}/chealpixTargets.cmake")
24 | endif(@SUPER4PCS_USE_CHEALPIX@)
25 | 
26 | include("${CMAKE_CURRENT_LIST_DIR}/Super4PCS-AccelLibTargets.cmake")
27 | include("${CMAKE_CURRENT_LIST_DIR}/Super4PCS-IOLibTargets.cmake")
28 | include("${CMAKE_CURRENT_LIST_DIR}/Super4PCS-AlgoLibTargets.cmake")
29 | include("${CMAKE_CURRENT_LIST_DIR}/Super4PCSConfigVersion.cmake")
30 | 
31 | check_required_components("@PROJECT_NAME@")
32 | 
33 | # Compute paths
34 | set(Super4PCS_INCLUDE_DIR "@Super4PCS_INSTALL_DIR@/include/")
35 | set(Super4PCS_LIB_DIR "@Super4PCS_INSTALL_DIR@/lib/")
36 | set(Super4PCS_LIBRARIES super4pcs_accel super4pcs_io super4pcs_algo)
37 | 
38 | if(@SUPER4PCS_USE_CHEALPIX@)
39 |   list(APPEND Super4PCS_LIBRARIES chealpix)
40 | endif(@SUPER4PCS_USE_CHEALPIX@)
41 | 


--------------------------------------------------------------------------------
/cmake/ConfigureChealpix.cmake:
--------------------------------------------------------------------------------
 1 | 
 2 | # EXTERNALS
 3 | # have ExternalProject available
 4 | include(ExternalProject)
 5 | message(STATUS "[Deps] Use Chealpix")
 6 | 
 7 | ExternalProject_Add(
 8 |         cfitsio
 9 |         # where the source will live
10 |         SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/cfitsio"
11 |         INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/"
12 | 
13 |         CMAKE_ARGS
14 |             -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
15 | 
16 |         # override default behaviours
17 |         UPDATE_COMMAND ""
18 | )
19 | 
20 | add_subdirectory(${PROJECT_SOURCE_DIR}/3rdparty/chealpix)
21 | add_definitions(-DSUPER4PCS_USE_CHEALPIX)
22 | include_directories(${Chealpix_INCLUDE_DIR})
23 | 


--------------------------------------------------------------------------------
/cmake/ConfigureCompiler.cmake:
--------------------------------------------------------------------------------
 1 | if( NOT cmake_build_type_tolower STREQUAL "release" )
 2 |   add_definitions(-DDEBUG)
 3 | endif()
 4 | 
 5 | if (MSVC)
 6 |   if (MSVC_VERSION LESS 1900)
 7 |         message(FATAL_ERROR "Requires Microsoft Visual Studio Compiler version 14.0 or above.")
 8 |   endif()
 9 | 
10 |   # remove exceptions from default args
11 |   add_definitions(-D_HAS_EXCEPTIONS=0)
12 |   # disable secure CRT warnings
13 |   add_definitions(-D_CRT_SECURE_NO_WARNINGS)
14 |   add_definitions(-D_SCL_SECURE_NO_WARNINGS)
15 | else()
16 |         if (NOT CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
17 |           if( cmake_build_type_tolower STREQUAL "release" )
18 |                 find_package(OpenMP)
19 | 
20 |                 if(OPENMP_FOUND)
21 |                   message(STATUS "Enable OpenMP")
22 |                   add_definitions("-DSUPER4PCS_USE_OPENMP -DEIGEN_DONT_PARALLELIZE")
23 |                   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
24 |                   set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
25 |                   set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
26 |                 endif(OPENMP_FOUND)
27 |           endif()
28 |         endif()
29 | endif()
30 | 
31 | set (CMAKE_CXX_STANDARD 11)
32 | 
33 | find_package(Meshlab QUIET)
34 | 
35 | if(MESHLAB_FOUND)
36 |     # To ease use in shared libraries, even compiling statics Sup4pcs libs
37 |     set(CMAKE_POSITION_INDEPENDENT_CODE ON)
38 |     message(STATUS "Enable position independent code")
39 | endif(MESHLAB_FOUND)
40 | 


--------------------------------------------------------------------------------
/cmake/ConfigureRPath.cmake:
--------------------------------------------------------------------------------
 1 | ## This script comes from https://cmake.org/Wiki/CMake_RPATH_handling#Always_full_RPATH
 2 | #
 3 | # It is designed 'to make sure that the required libraries are always found
 4 | # independent from LD_LIBRARY_PATH and the install location'
 5 | 
 6 | # use, i.e. don't skip the full RPATH for the build tree
 7 | SET(CMAKE_SKIP_BUILD_RPATH  FALSE)
 8 | 
 9 | # when building, don't use the install RPATH already
10 | # (but later on when installing)
11 | SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
12 | 
13 | SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
14 | 
15 | # add the automatically determined parts of the RPATH
16 | # which point to directories outside the build tree to the install RPATH
17 | SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
18 | 
19 | 
20 | # the RPATH to be used when installing, but only if it's not a system directory
21 | LIST(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir)
22 | IF("${isSystemDir}" STREQUAL "-1")
23 |    SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
24 | ENDIF("${isSystemDir}" STREQUAL "-1")
25 | 


--------------------------------------------------------------------------------
/cmake/ConfigureTesting.cmake:
--------------------------------------------------------------------------------
 1 | 
 2 | 
 3 | 
 4 | add_custom_target(buildtests)
 5 | add_custom_target(check COMMAND "ctest")
 6 | add_dependencies(check buildtests)
 7 | 
 8 | # check whether /bin/bash exists
 9 | find_file(SUPER4PCS_BIN_BASH_EXISTS "/bin/bash" PATHS "/" NO_DEFAULT_PATH)
10 | 
11 | # CMake/Ctest does not allow us to change the build command,
12 | # so we have to workaround by directly editing the generated DartConfiguration.tcl file
13 | # save CMAKE_MAKE_PROGRAM
14 | set(CMAKE_MAKE_PROGRAM_SAVE ${CMAKE_MAKE_PROGRAM})
15 | # and set a fake one
16 | set(CMAKE_MAKE_PROGRAM "@SUPER4PCS_MAKECOMMAND_PLACEHOLDER@")
17 | 
18 | # This call activates testing and generates the DartConfiguration.tcl
19 | # This adds another build target, which is test for Makefile generators,
20 | # or RUN_TESTS for integrated development environments (like Visual Studio)
21 | include(CTest)
22 | 
23 | set(SUPER4PCS_TEST_BUILD_FLAGS "" CACHE STRING "Options passed to the build command of unit tests")
24 | 
25 | # overwrite default DartConfiguration.tcl
26 | # The worarounds are different for each version of the MSVC IDE
27 | set(SUPER4PCS_TEST_TARGET buildtests)
28 | if(MSVC_IDE)
29 |   if(CMAKE_MAKE_PROGRAM_SAVE MATCHES "devenv") # devenv
30 |     set(SUPER4PCS_BUILD_COMMAND "${CMAKE_MAKE_PROGRAM_SAVE} Super4PCS.sln /build Release /project ${SUPER4PCS_TEST_TARGET}")
31 |   else() # msbuild
32 |     set(SUPER4PCS_BUILD_COMMAND "${CMAKE_MAKE_PROGRAM_SAVE} ${SUPER4PCS_TEST_TARGET}.vcxproj /p:Configuration=\${CTEST_CONFIGURATION_TYPE}")
33 |   endif()
34 | 
35 |   # append the build flags if provided
36 |   if(NOT "${SUPER4PCS_TEST_BUILD_FLAGS}" MATCHES "^[ \t]*$")
37 |     set(SUPER4PCS_BUILD_COMMAND "${SUPER4PCS_BUILD_COMMAND} ${SUPER4PCS_TEST_BUILD_FLAGS}")
38 |   endif()
39 |   
40 |   # apply the dartconfig hack ...
41 |   set(SUPER4PCS_MAKECOMMAND_PLACEHOLDER "${SUPER4PCS_BUILD_COMMAND}\n#")
42 | else()
43 |   # for make and nmake
44 |   set(SUPER4PCS_BUILD_COMMAND "${CMAKE_MAKE_PROGRAM_SAVE} ${SUPER4PCS_TEST_TARGET} ${SUPER4PCS_TEST_BUILD_FLAGS}")
45 |   set(SUPER4PCS_MAKECOMMAND_PLACEHOLDER "${SUPER4PCS_BUILD_COMMAND}")
46 | endif()
47 | 
48 | configure_file(${CMAKE_BINARY_DIR}/DartConfiguration.tcl ${CMAKE_BINARY_DIR}/DartConfiguration.tcl)
49 | 
50 | # restore default CMAKE_MAKE_PROGRAM
51 | set(CMAKE_MAKE_PROGRAM ${CMAKE_MAKE_PROGRAM_SAVE})
52 | 
53 | # un-set temporary variables so that it is like they never existed
54 | unset(CMAKE_MAKE_PROGRAM_SAVE) 
55 | unset(SUPER4PCS_MAKECOMMAND_PLACEHOLDER)
56 | 
57 | 
58 | ## Configure coverage
59 | #if(CMAKE_COMPILER_IS_GNUCXX)
60 | #  option(SUPER4PCS_COVERAGE_TESTING "Enable/disable gcov" ON)
61 |   
62 | #  if(SUPER4PCS_COVERAGE_TESTING)
63 | #    set(COVERAGE_FLAGS "-fprofile-arcs -ftest-coverage")
64 | #  else(SUPER4PCS_COVERAGE_TESTING)
65 | #    set(COVERAGE_FLAGS "")
66 | #  endif(SUPER4PCS_COVERAGE_TESTING)
67 | 
68 | #  if(SUPER4PCS_TEST_C++0x)
69 | #    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++0x")
70 | #  endif(SUPER4PCS_TEST_C++0x)
71 | 
72 | #  if(CMAKE_SYSTEM_NAME MATCHES Linux)
73 | #    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COVERAGE_FLAGS} -g2")
74 | #    set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${COVERAGE_FLAGS} -O2 -g2")
75 | #    set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${COVERAGE_FLAGS} -fno-inline-functions")
76 | #    set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${COVERAGE_FLAGS} -O0 -g3")
77 | #  endif(CMAKE_SYSTEM_NAME MATCHES Linux)
78 |   
79 | #elseif(MSVC)
80 |   
81 | #  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /D_CRT_SECURE_NO_WARNINGS /D_SCL_SECURE_NO_WARNINGS")
82 |   
83 | #endif(CMAKE_COMPILER_IS_GNUCXX)
84 | 
85 | 


--------------------------------------------------------------------------------
/cmake/FindCFITSIO.cmake:
--------------------------------------------------------------------------------
 1 | # - Try to find CFITSIO.
 2 | # Once executed, this module will define:
 3 | # Variables defined by this module:
 4 | #  CFITSIO_FOUND        - system has CFITSIO
 5 | #  CFITSIO_INCLUDE_DIR  - the CFITSIO include directory (cached)
 6 | #  CFITSIO_INCLUDE_DIRS - the CFITSIO include directories
 7 | #                         (identical to CFITSIO_INCLUDE_DIR)
 8 | #  CFITSIO_LIBRARY      - the CFITSIO library (cached)
 9 | #  CFITSIO_LIBRARIES    - the CFITSIO libraries
10 | #                         (identical to CFITSIO_LIBRARY)
11 | # 
12 | # This module will use the following enviornmental variable
13 | # when searching for CFITSIO:
14 | #  CFITSIO_ROOT_DIR     - CFITSIO root directory
15 | #
16 | 
17 | # 
18 | #  Copyright (c) 2012 Brian Kloppenborg
19 | # 
20 | #  This file is part of the C++ OIFITS Library (CCOIFITS).
21 | #  
22 | #  CCOIFITS is free software: you can redistribute it and/or modify
23 | #  it under the terms of the GNU Lesser General Public License 
24 | #  as published by the Free Software Foundation, either version 3 
25 | #  of the License, or (at your option) any later version.
26 | #  
27 | #  CCOIFITS is distributed in the hope that it will be useful,
28 | #  but WITHOUT ANY WARRANTY; without even the implied warranty of
29 | #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
30 | #  GNU Lesser General Public License for more details.
31 | #  
32 | #  You should have received a copy of the GNU Lesser General Public 
33 | #  License along with CCOIFITS.  If not, see .
34 | # 
35 | 
36 | if(NOT CFITSIO_FOUND)
37 | 
38 |     find_path(CFITSIO_INCLUDE_DIR fitsio.h
39 |         HINTS $ENV{CFITSIO_ROOT_DIR} 
40 |         PATH_SUFFIXES include include/cfitsio)
41 |     find_library(CFITSIO_LIBRARY cfitsio
42 |         HINTS $ENV{CFITSIO_ROOT_DIR} 
43 |         PATH_SUFFIXES lib)
44 |   
45 |     mark_as_advanced(CFITSIO_INCLUDE_DIR CFITSIO_LIBRARY)
46 | 
47 |     include(FindPackageHandleStandardArgs)
48 |     find_package_handle_standard_args(CFITSIO DEFAULT_MSG
49 |         CFITSIO_LIBRARY CFITSIO_INCLUDE_DIR)
50 | 
51 |     set(CFITSIO_INCLUDE_DIRS ${CFITSIO_INCLUDE_DIR})
52 |     set(CFITSIO_LIBRARIES ${CFITSIO_LIBRARY})
53 | 
54 | endif(NOT CFITSIO_FOUND)
55 | 


--------------------------------------------------------------------------------
/cmake/FindEigen3.cmake:
--------------------------------------------------------------------------------
 1 | # - Try to find Eigen3 lib
 2 | #
 3 | # This module supports requiring a minimum version, e.g. you can do
 4 | #   find_package(Eigen3 3.1.2)
 5 | # to require version 3.1.2 or newer of Eigen3.
 6 | #
 7 | # Once done this will define
 8 | #
 9 | #  EIGEN3_FOUND - system has eigen lib with correct version
10 | #  EIGEN3_INCLUDE_DIR - the eigen include directory
11 | #  EIGEN3_VERSION - eigen version
12 | 
13 | # Copyright (c) 2006, 2007 Montel Laurent, 
14 | # Copyright (c) 2008, 2009 Gael Guennebaud, 
15 | # Copyright (c) 2009 Benoit Jacob 
16 | # Redistribution and use is allowed according to the terms of the 2-clause BSD license.
17 | 
18 | if(NOT Eigen3_FIND_VERSION)
19 |   if(NOT Eigen3_FIND_VERSION_MAJOR)
20 |     set(Eigen3_FIND_VERSION_MAJOR 2)
21 |   endif(NOT Eigen3_FIND_VERSION_MAJOR)
22 |   if(NOT Eigen3_FIND_VERSION_MINOR)
23 |     set(Eigen3_FIND_VERSION_MINOR 91)
24 |   endif(NOT Eigen3_FIND_VERSION_MINOR)
25 |   if(NOT Eigen3_FIND_VERSION_PATCH)
26 |     set(Eigen3_FIND_VERSION_PATCH 0)
27 |   endif(NOT Eigen3_FIND_VERSION_PATCH)
28 | 
29 |   set(Eigen3_FIND_VERSION "${Eigen3_FIND_VERSION_MAJOR}.${Eigen3_FIND_VERSION_MINOR}.${Eigen3_FIND_VERSION_PATCH}")
30 | endif(NOT Eigen3_FIND_VERSION)
31 | 
32 | macro(_eigen3_check_version)
33 |   file(READ "${EIGEN3_INCLUDE_DIR}/Eigen/src/Core/util/Macros.h" _eigen3_version_header)
34 | 
35 |   string(REGEX MATCH "define[ \t]+EIGEN_WORLD_VERSION[ \t]+([0-9]+)" _eigen3_world_version_match "${_eigen3_version_header}")
36 |   set(EIGEN3_WORLD_VERSION "${CMAKE_MATCH_1}")
37 |   string(REGEX MATCH "define[ \t]+EIGEN_MAJOR_VERSION[ \t]+([0-9]+)" _eigen3_major_version_match "${_eigen3_version_header}")
38 |   set(EIGEN3_MAJOR_VERSION "${CMAKE_MATCH_1}")
39 |   string(REGEX MATCH "define[ \t]+EIGEN_MINOR_VERSION[ \t]+([0-9]+)" _eigen3_minor_version_match "${_eigen3_version_header}")
40 |   set(EIGEN3_MINOR_VERSION "${CMAKE_MATCH_1}")
41 | 
42 |   set(EIGEN3_VERSION ${EIGEN3_WORLD_VERSION}.${EIGEN3_MAJOR_VERSION}.${EIGEN3_MINOR_VERSION})
43 |   if(${EIGEN3_VERSION} VERSION_LESS ${Eigen3_FIND_VERSION})
44 |     set(EIGEN3_VERSION_OK FALSE)
45 |   else(${EIGEN3_VERSION} VERSION_LESS ${Eigen3_FIND_VERSION})
46 |     set(EIGEN3_VERSION_OK TRUE)
47 |   endif(${EIGEN3_VERSION} VERSION_LESS ${Eigen3_FIND_VERSION})
48 | 
49 |   if(NOT EIGEN3_VERSION_OK)
50 | 
51 |     message(STATUS "Eigen3 version ${EIGEN3_VERSION} found in ${EIGEN3_INCLUDE_DIR}, "
52 |                    "but at least version ${Eigen3_FIND_VERSION} is required")
53 |   endif(NOT EIGEN3_VERSION_OK)
54 | endmacro(_eigen3_check_version)
55 | 
56 | if (EIGEN3_INCLUDE_DIR)
57 | 
58 |   # in cache already
59 |   _eigen3_check_version()
60 |   set(EIGEN3_FOUND ${EIGEN3_VERSION_OK})
61 | 
62 | else (EIGEN3_INCLUDE_DIR)
63 | 
64 |   find_path(EIGEN3_INCLUDE_DIR NAMES signature_of_eigen3_matrix_library
65 |       PATHS
66 |       ${CMAKE_INSTALL_PREFIX}/include
67 |       ${KDE4_INCLUDE_DIR}
68 |       $ENV{EIGEN3_INCLUDE_DIR}
69 |       PATH_SUFFIXES eigen3 eigen
70 |     )
71 | 
72 |   if(EIGEN3_INCLUDE_DIR)
73 |     _eigen3_check_version()
74 |   endif(EIGEN3_INCLUDE_DIR)
75 | 
76 |   include(FindPackageHandleStandardArgs)
77 |   find_package_handle_standard_args(Eigen3 DEFAULT_MSG EIGEN3_INCLUDE_DIR EIGEN3_VERSION_OK)
78 | 
79 |   mark_as_advanced(EIGEN3_INCLUDE_DIR)
80 | 
81 | endif(EIGEN3_INCLUDE_DIR)
82 | 
83 | 


--------------------------------------------------------------------------------
/cmake/FindMeshlab.cmake:
--------------------------------------------------------------------------------
 1 | # Try to find the radium engine base folder
 2 | # Will define
 3 | # MESHLAB_SRC_DIR : the root of the Meshlab project
 4 | # MESHLAB_PLUGINS_SOURCE_DIR     : directory where meshlab plugins sources are
 5 | # MESHLAB_PROJECT_FILE           : path of the meshlab_full.pro file
 6 | # MESHLAB_EXTERNAL_DIR           : root dir of meshlab externals
 7 | # MESHLAB_EXTERNAL_INCLUDE_DIR   : path where external include files are installed
 8 | # MESHLAB_EXTERNAL_LIBRARIES_DIR : path where external libraries are installed
 9 | 
10 | 
11 | # MESHLAB_FOUND if found
12 | if( NOT MESHLAB_SRC_DIR )
13 |   find_path( MESHLAB_SRC_DIR NAMES meshlab_full.pro
14 |     PATHS
15 |     "${CMAKE_SOURCE_DIR}/../meshlab"
16 |     "${CMAKE_SOURCE_DIR}/../Meshlab"
17 |     "${CMAKE_SOURCE_DIR}/.."
18 |     "${CMAKE_SOURCE_DIR}/../.."
19 |     "${CMAKE_SOURCE_DIR}/../../.."
20 |     "${CMAKE_CURRENT_SOURCE_DIR}/../meshlab"
21 |     "${CMAKE_CURRENT_SOURCE_DIR}/../Meshlab"
22 |     "${CMAKE_CURRENT_SOURCE_DIR}/.."
23 |     "${CMAKE_CURRENT_SOURCE_DIR}/../.."
24 |     "${CMAKE_CURRENT_SOURCE_DIR}/../../.."
25 |     PATH_SUFFIXES src meshlab/src
26 |     DOC "The Meshlab src folder")
27 | endif( NOT MESHLAB_SRC_DIR )
28 | 
29 | if ( MESHLAB_SRC_DIR )
30 |   set ( MESHLAB_RELATIVE_PLUGINS_SOURCE_DIR "meshlabplugins" )
31 |   set ( MESHLAB_PLUGINS_SOURCE_DIR          "${MESHLAB_SRC_DIR}/${MESHLAB_RELATIVE_PLUGINS_SOURCE_DIR}" )
32 |   set ( MESHLAB_PROJECT_FILE                "${MESHLAB_SRC_DIR}/meshlab_full.pro" )
33 |   set ( MESHLAB_EXTERNAL_DIR                "${MESHLAB_SRC_DIR}/external" )
34 | 
35 | 
36 |   # Meshlab put include files and libraries in the following plateform dependent
37 |   # folders:
38 |   #  - includes:  linux-g++, macx, macx64, win32-gcc, win32-msvc2008
39 |   #  - libraries: linux-g++, linux-g++-64, macx64 win32-gcc, win32-msvc2008, win32-msvc2015
40 |   set (INC_PLATEFORM "linux-g++" )
41 |   set (LIB_PLATEFORM "linux-g++" )
42 | 
43 |   message(AUTHOR_WARNING "Automatic plateform detection not ready yet. Using ${INC_PLATEFORM}")
44 | 
45 | 
46 |   set ( MESHLAB_EXTERNAL_LIBRARIES_DIR "${MESHLAB_EXTERNAL_DIR}/lib/${LIB_PLATEFORM}" )
47 |   set ( MESHLAB_EXTERNAL_INCLUDE_DIR   "${MESHLAB_EXTERNAL_DIR}/inc/${INC_PLATEFORM}" )
48 | 
49 |   unset ( INC_PLATEFORM )
50 |   unset ( LIB_PLATEFORM )
51 | 
52 |   set ( MESHLAB_FOUND TRUE )
53 | 
54 | endif( MESHLAB_SRC_DIR )
55 | 
56 | if ( MESHLAB_FOUND )
57 |   if( NOT MESHLAB_FIND_QUIETLY )
58 |     message ( STATUS "Found Meshlab: ${MESHLAB_SRC_DIR}")
59 |   endif( NOT MESHLAB_FIND_QUIETLY )
60 | else( MESHLAB_FOUND )
61 |   if( MESHLAB_FIND_REQUIRED )
62 |     message( FATAL_ERROR "Could not find Meshlab src dir")
63 |   endif( MESHLAB_FIND_REQUIRED )
64 | endif( MESHLAB_FOUND )
65 | 


--------------------------------------------------------------------------------
/demos/CGalWrapper/CMakelists.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nmellado/Super4PCS/d5ab2a407c4f8cbfd60dc97d826b1cc726bb25d8/demos/CGalWrapper/CMakelists.txt


--------------------------------------------------------------------------------
/demos/CMakeLists.txt:
--------------------------------------------------------------------------------
 1 | project (Super4PCS-Demos)
 2 | 
 3 | add_subdirectory(Super4PCS)
 4 | add_subdirectory(MeshlabPlugin)
 5 | 
 6 | 
 7 | find_package( PCL 1.8 QUIET )
 8 | 
 9 | if( PCL_FOUND )
10 |     add_subdirectory(PCLWrapper)
11 | endif( PCL_FOUND )
12 | 


--------------------------------------------------------------------------------
/demos/MeshlabPlugin/CMakeLists.txt:
--------------------------------------------------------------------------------
 1 | project(Meshlab-GlobalRegistrationPlugin)
 2 | 
 3 | find_package(Meshlab QUIET)
 4 | 
 5 | if(MESHLAB_FOUND)
 6 |     message(STATUS "Preparing Meshlab plugin")
 7 | 
 8 |     set(PLUGIN_NAME "filter_globalregistration")
 9 |     set(PLUGIN_SRC_DIR              "${CMAKE_CURRENT_SOURCE_DIR}/${PLUGIN_NAME}")
10 |     set(PLUGIN_PRO_INC              "${CMAKE_CURRENT_SOURCE_DIR}/${PLUGIN_NAME}.pro.in")
11 |     set(PLUGIN_RDM_INC              "${CMAKE_CURRENT_SOURCE_DIR}/readme.md.in")
12 |     set(PLUGIN_INSTALL_DIR          "${MESHLAB_PLUGINS_SOURCE_DIR}/${PLUGIN_NAME}")
13 |     set(PLUGIN_RELATIVE_INSTALL_DIR "${MESHLAB_RELATIVE_PLUGINS_SOURCE_DIR}/${PLUGIN_NAME}")
14 |     set(PLUGIN_PRO_GEN              "${PLUGIN_INSTALL_DIR}/${PLUGIN_NAME}.pro")
15 |     set(PLUGIN_RDM_GEN              "${PLUGIN_INSTALL_DIR}/readme.md")
16 | 
17 |     configure_file(${PLUGIN_PRO_INC} ${PLUGIN_PRO_GEN} @ONLY)
18 |     configure_file(${PLUGIN_RDM_INC} ${PLUGIN_RDM_GEN} @ONLY)
19 | 
20 |     add_custom_target(internal_install_super4pcs_to_meshlab_externals
21 |        COMMAND ${CMAKE_COMMAND} -E copy_directory "${Super4PCS_INSTALL_DIR}/include/" "${MESHLAB_EXTERNAL_INCLUDE_DIR}"
22 |        COMMAND ${CMAKE_COMMAND} -E copy_directory "${Super4PCS_INSTALL_DIR}/lib/"     "${MESHLAB_EXTERNAL_LIBRARIES_DIR}"
23 |        COMMENT "Install Super4PCS library to Meshlab externals (${MESHLAB_EXTERNAL_INCLUDE_DIR})" VERBATIM
24 |        DEPENDS ForceSuper4PCSInstallation)
25 | 
26 |     add_custom_target(internal_install_meshlab_plugin_source
27 |        COMMAND ${CMAKE_COMMAND} -E copy_directory "${PLUGIN_SRC_DIR}" "${PLUGIN_INSTALL_DIR}"
28 |        COMMENT "Install plugin sources at ${PLUGIN_INSTALL_DIR}" VERBATIM
29 |        )
30 | 
31 |     # Main target visible in the project
32 |     add_custom_target(Meshlab_install_plugin
33 |        COMMENT "Performing Meshlab plugin installation (manual compilation is still requires. See ${PLUGIN_INSTALL_DIR}/readme.md)"
34 |        DEPENDS internal_install_super4pcs_to_meshlab_externals internal_install_meshlab_plugin_source)
35 | else()
36 |      message(WARNING "Skipping Meshlab plugin preparation - Meshlab not found")
37 | endif(MESHLAB_FOUND)
38 | 
39 | 
40 | 


--------------------------------------------------------------------------------
/demos/MeshlabPlugin/filter_globalregistration.pro.in:
--------------------------------------------------------------------------------
 1 | include (../../shared.pri)
 2 | 
 3 | SUPER_4PCS_PATH = @Super4PCS_INSTALL_DIR@
 4 | 
 5 | HEADERS       += globalregistration.h
 6 | SOURCES       += globalregistration.cpp
 7 | TARGET         = filter_globalregistration
 8 | 
 9 | CONFIG += create_prl
10 | CONFIG += link_prl
11 | 
12 | LIBS        += $$SUPER_4PCS_PATH/lib/libsuper4pcs_algo.a
13 | INCLUDEPATH += $$SUPER_4PCS_PATH/include/
14 | 


--------------------------------------------------------------------------------
/demos/MeshlabPlugin/filter_globalregistration/globalregistration.h:
--------------------------------------------------------------------------------
 1 | /****************************************************************************
 2 | * MeshLab                                                           o o     *
 3 | * A versatile mesh processing toolbox                             o     o   *
 4 | *                                                                _   O  _   *
 5 | * Copyright(C) 2005                                                \/)\/    *
 6 | * Visual Computing Lab                                            /\/|      *
 7 | * ISTI - Italian National Research Council                           |      *
 8 | *                                                                    \      *
 9 | * All rights reserved.                                                      *
10 | *                                                                           *
11 | * This program is free software; you can redistribute it and/or modify      *
12 | * it under the terms of the GNU General Public License as published by      *
13 | * the Free Software Foundation; either version 2 of the License, or         *
14 | * (at your option) any later version.                                       *
15 | *                                                                           *
16 | * This program is distributed in the hope that it will be useful,           *
17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of            *
18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the             *
19 | * GNU General Public License (http://www.gnu.org/licenses/gpl.txt)          *
20 | * for more details.                                                         *
21 | *                                                                           *
22 | ****************************************************************************/
23 | /****************************************************************************
24 |   History
25 | $Log: sampleplugins.h,v $
26 | Revision 1.2  2006/11/29 00:59:21  cignoni
27 | Cleaned plugins interface; changed useless help class into a plain string
28 | 
29 | Revision 1.1  2006/09/25 09:24:39  e_cerisoli
30 | add sampleplugins
31 | 
32 | ****************************************************************************/
33 | 
34 | #ifndef SAMPLEFILTERSPLUGIN_H
35 | #define SAMPLEFILTERSPLUGIN_H
36 | 
37 | #include 
38 | 
39 | class GlobalRegistrationPlugin : public QObject, public MeshFilterInterface
40 | {
41 |     Q_OBJECT
42 |     MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID)
43 |     Q_INTERFACES(MeshFilterInterface)
44 | 
45 | public:
46 |     enum { FP_GLOBAL_REGISTRATION  } ;
47 | 
48 |     GlobalRegistrationPlugin();
49 | 
50 |     virtual QString pluginName(void) const { return "GlobalRegistrationPlugin"; }
51 | 
52 |     QString filterName(FilterIDType filter) const;
53 |     QString filterInfo(FilterIDType filter) const;
54 |     void initParameterSet(QAction *, MeshDocument &/*m*/, RichParameterSet & /*parent*/);
55 |     bool applyFilter(QAction *filter, MeshDocument &md, RichParameterSet & /*parent*/, vcg::CallBackPos * cb) ;
56 |     int postCondition( QAction* ) const {return MeshModel::MM_VERTCOORD; }
57 |     FilterClass getClass(QAction *a);
58 |     FILTER_ARITY filterArity(QAction *) const {return SINGLE_MESH;}
59 | };
60 | 
61 | 
62 | #endif
63 | 


--------------------------------------------------------------------------------
/demos/MeshlabPlugin/readme.md.in:
--------------------------------------------------------------------------------
 1 | ## Super4PCS Meshlab plugin
 2 | 
 3 | Sources of this plugin has been automatically generated by the Super4PCS installer:
 4 | * Sources: `@SRC_DIR@`
 5 | * Installation path: `@Super4PCS_INSTALL_DIR@`
 6 | 
 7 | To get this plugin working in Meshlab, you need to add it to the main Meshlab project, and compile Meshlab.
 8 | On linux/macOS, this can be done from the command line:
 9 | ```bash
10 | cd @MESHLAB_SRC_DIR@
11 | echo "@PLUGIN_RELATIVE_INSTALL_DIR@ \\" >> @MESHLAB_PROJECT_FILE@
12 | qmake @MESHLAB_PROJECT_FILE@
13 | make
14 | ```
15 | 
16 | Super4PCS libraries and include files have been installed to:
17 | * `@MESHLAB_EXTERNAL_LIBRARIES_DIR@`, and
18 | * `@MESHLAB_EXTERNAL_INCLUDE_DIR@`
19 | 


--------------------------------------------------------------------------------
/demos/PCLWrapper/CMakeLists.txt:
--------------------------------------------------------------------------------
 1 | project(Super4PCS-PCLWrapper)
 2 | 
 3 | find_package( PCL 1.8 REQUIRED QUIET )
 4 | 
 5 | set(Demo_PCL_SRC
 6 |     ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp
 7 | )
 8 | file(GLOB_RECURSE Demo_PCL_headers
 9 |                   ${CMAKE_CURRENT_SOURCE_DIR}/*.h
10 |                   ${CMAKE_CURRENT_SOURCE_DIR}/*.hpp)
11 | 
12 | include_directories( ${CMAKE_CURRENT_SOURCE_DIR} )
13 | add_executable(${PROJECT_NAME} ${Demo_PCL_SRC} ${Demo_PCL_headers})
14 | target_link_libraries(${PROJECT_NAME} super4pcs_algo super4pcs_utils)
15 | 
16 | if( PCL_FOUND )
17 |   # [C/C++]>[General]>[Additional Include Directories]
18 |   include_directories( ${PCL_INCLUDE_DIRS} )
19 | 
20 |   # [C/C++]>[Preprocessor]>[Preprocessor Definitions]
21 |   add_definitions( ${PCL_DEFINITIONS} )
22 | 
23 |   # For Use Not PreCompiled Features
24 |   #add_definitions( -DPCL_NO_PRECOMPILE )
25 | 
26 |   # [Linker]>[General]>[Additional Library Directories]
27 |   link_directories( ${PCL_LIBRARY_DIRS} )
28 | 
29 |   # [Linker]>[Input]>[Additional Dependencies]
30 |   target_link_libraries( ${PROJECT_NAME} ${PCL_LIBRARIES} )
31 | endif()
32 | 
33 | 
34 | install( TARGETS ${PROJECT_NAME}
35 |          RUNTIME DESTINATION bin)
36 | install( DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/
37 |          DESTINATION include
38 |          FILES_MATCHING REGEX ".*(h|hpp)$")
39 | 


--------------------------------------------------------------------------------
/demos/PCLWrapper/CMakelists.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nmellado/Super4PCS/d5ab2a407c4f8cbfd60dc97d826b1cc726bb25d8/demos/PCLWrapper/CMakelists.txt


--------------------------------------------------------------------------------
/demos/PCLWrapper/main.cpp:
--------------------------------------------------------------------------------
  1 | #include 
  2 | #include 
  3 | #include 
  4 | #include 
  5 | #include 
  6 | #include 
  7 | #include 
  8 | #include 
  9 | #include 
 10 | #include 
 11 | 
 12 | #include 
 13 | 
 14 | #include 
 15 | #include "../demo-utils.h"
 16 | 
 17 | // Types
 18 | typedef pcl::PointNormal PointNT;
 19 | typedef pcl::PointCloud PointCloudT;
 20 | typedef pcl::visualization::PointCloudColorHandlerCustom ColorHandlerT;
 21 | 
 22 | using namespace GlobalRegistration;
 23 | 
 24 | // Align a rigid object to a scene with clutter and occlusions
 25 | int
 26 | main (int argc, char **argv)
 27 | {
 28 |   // Point clouds
 29 |   PointCloudT::Ptr object (new PointCloudT);
 30 |   PointCloudT::Ptr object_aligned (new PointCloudT);
 31 |   PointCloudT::Ptr scene (new PointCloudT);
 32 | 
 33 |   // Get input object and scene
 34 |   if (argc < 4)
 35 |   {
 36 |     pcl::console::print_error ("Syntax is: %s scene.obj object.obj [PARAMS]\n", argv[0]);
 37 |     Demo::printParameterList();
 38 |     return (-1);
 39 |   }
 40 | 
 41 |   // Load object and scene
 42 |   pcl::console::print_highlight ("Loading point clouds...\n");
 43 |   if (pcl::io::loadOBJFile (argv[2], *object) < 0 ||
 44 |       pcl::io::loadOBJFile (argv[1], *scene) < 0)
 45 |   {
 46 |     pcl::console::print_error ("Error loading object/scene file!\n");
 47 |     return (-1);
 48 |   }
 49 | 
 50 |   // Load Super4pcs parameters
 51 |   Demo::getArgs(argc, argv);
 52 | 
 53 |   pcl::Super4PCS align;
 54 |   Demo::setOptionsFromArgs(align.options_);
 55 | 
 56 |   // Downsample
 57 | //  pcl::console::print_highlight ("Downsampling...\n");
 58 | //  pcl::VoxelGrid grid;
 59 | //  const float leaf = 0.005f;r
 60 | //  grid.setLeafSize (leaf, leaf, leaf);
 61 | //  grid.setInputCloud (object);
 62 | //  grid.filter (*object);
 63 | //  grid.setInputCloud (scene);
 64 | //  grid.filter (*scene);
 65 | 
 66 |   // Perform alignment
 67 |   pcl::console::print_highlight ("Starting alignment...\n");
 68 |   align.setInputSource (object);
 69 |   align.setInputTarget (scene);
 70 | 
 71 |   {
 72 |     pcl::ScopeTime t("Alignment");
 73 |     align.align (*object_aligned);
 74 |   }
 75 | 
 76 |   if (align.hasConverged ())
 77 |   {
 78 |     // Print results
 79 |     printf ("\n");
 80 |     Eigen::Matrix4f transformation = align.getFinalTransformation ();
 81 |     pcl::console::print_info ("    | %6.3f %6.3f %6.3f | \n", transformation (0,0), transformation (0,1), transformation (0,2));
 82 |     pcl::console::print_info ("R = | %6.3f %6.3f %6.3f | \n", transformation (1,0), transformation (1,1), transformation (1,2));
 83 |     pcl::console::print_info ("    | %6.3f %6.3f %6.3f | \n", transformation (2,0), transformation (2,1), transformation (2,2));
 84 |     pcl::console::print_info ("\n");
 85 |     pcl::console::print_info ("t = < %0.3f, %0.3f, %0.3f >\n", transformation (0,3), transformation (1,3), transformation (2,3));
 86 |     pcl::console::print_info ("\n");
 87 | 
 88 |     // Show alignment
 89 |     pcl::visualization::PCLVisualizer visu("Alignment - Super4PCS");
 90 |     visu.addPointCloud (scene, ColorHandlerT (scene, 0.0, 255.0, 0.0), "scene");
 91 |     visu.addPointCloud (object_aligned, ColorHandlerT (object_aligned, 0.0, 0.0, 255.0), "object_aligned");
 92 |     visu.spin ();
 93 |   }
 94 |   else
 95 |   {
 96 |     pcl::console::print_error ("Alignment failed!\n");
 97 |     return (-1);
 98 |   }
 99 | 
100 |   return (0);
101 | }
102 | 


--------------------------------------------------------------------------------
/demos/PCLWrapper/pcl/registration/impl/super4pcs.hpp:
--------------------------------------------------------------------------------
  1 | /*
  2 |  * Software License Agreement (BSD License)
  3 |  *
  4 |  *  Point Cloud Library (PCL) - www.pointclouds.org
  5 |  *  Copyright (c) 2010-2012, Willow Garage, Inc.
  6 |  *  Copyright (c) 2012-, Open Perception, Inc.
  7 |  *
  8 |  *  All rights reserved.
  9 |  *
 10 |  *  Redistribution and use in source and binary forms, with or without
 11 |  *  modification, are permitted provided that the following conditions
 12 |  *  are met:
 13 |  *
 14 |  *   * Redistributions of source code must retain the above copyright
 15 |  *     notice, this list of conditions and the following disclaimer.
 16 |  *   * Redistributions in binary form must reproduce the above
 17 |  *     copyright notice, this list of conditions and the following
 18 |  *     disclaimer in the documentation and/or other materials provided
 19 |  *     with the distribution.
 20 |  *   * Neither the name of the copyright holder(s) nor the names of its
 21 |  *     contributors may be used to endorse or promote products derived
 22 |  *     from this software without specific prior written permission.
 23 |  *
 24 |  *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 25 |  *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 26 |  *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
 27 |  *  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
 28 |  *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
 29 |  *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
 30 |  *  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 31 |  *  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
 32 |  *  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 33 |  *  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
 34 |  *  ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 35 |  *  POSSIBILITY OF SUCH DAMAGE.
 36 |  *
 37 |  * $Id$
 38 |  *
 39 |  */
 40 | 
 41 | #ifndef PCL_REGISTRATION_SUPER4PCS_HPP_
 42 | #define PCL_REGISTRATION_SUPER4PCS_HPP_
 43 | 
 44 | #include 
 45 | #include 
 46 | #include 
 47 | 
 48 | 
 49 | struct TransformVisitor {
 50 |     inline void operator()(
 51 |             float fraction,
 52 |             float best_LCP,
 53 |             Eigen::Ref /*transformation*/) const {
 54 |       if(fraction >= 0)
 55 |         {
 56 |           printf("done: %d%c best: %f                  \r",
 57 |                  static_cast(fraction * 100), '%', best_LCP);
 58 |           fflush(stdout);
 59 |         }
 60 |     }
 61 |     constexpr bool needsGlobalTransformation() const { return false; }
 62 | };
 63 | 
 64 | 
 65 | ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 66 | template  void
 67 | pcl::Super4PCS::computeTransformation (PointCloudSource &output, const Eigen::Matrix4f& guess)
 68 | {
 69 |   using namespace GlobalRegistration;
 70 | 
 71 |   // Initialize results
 72 |   final_transformation_ = guess;
 73 | 
 74 |   constexpr Utils::LogLevel loglvl = Utils::Verbose;
 75 |   using SamplerType   = GlobalRegistration::Sampling::UniformDistSampler;
 76 |   using TrVisitorType = typename std::conditional ::type;
 79 | 
 80 |   Utils::Logger logger(loglvl);
 81 |   MatchSuper4PCS matcher(options_, logger);
 82 | 
 83 |   SamplerType sampler;
 84 |   TrVisitorType visitor;
 85 | 
 86 |   std::vector set1, set2;
 87 | 
 88 |   // init Super4PCS point cloud internal structure
 89 |   auto fillPointSet = [] (const PointCloudSource& m, std::vector& out) {
 90 |       out.clear();
 91 |       out.reserve(m.size());
 92 | 
 93 |       // TODO: copy other point-wise information, if any
 94 |       for(size_t i = 0; i< m.size(); i++){
 95 |           const auto& point = m[i];
 96 |           out.emplace_back(point.x, point.y, point.z);
 97 |       }
 98 |   };
 99 |   fillPointSet(*target_, set1);
100 |   fillPointSet(*input_, set2);;
101 | 
102 |   float score = matcher.ComputeTransformation(set1, &set2, final_transformation_, sampler, visitor);
103 | 
104 |   transformPointCloud (*input_, output, final_transformation_);
105 | 
106 |   pcl::console::print_highlight ("Final score: %f\n", score);
107 | 
108 |   converged_ = true;
109 | }
110 | 
111 | 
112 | #endif
113 | 
114 | 


--------------------------------------------------------------------------------
/demos/PCLWrapper/pcl/registration/super4pcs.h:
--------------------------------------------------------------------------------
  1 | /*
  2 |  * Software License Agreement (BSD License)
  3 |  *
  4 |  *  Point Cloud Library (PCL) - www.pointclouds.org
  5 |  *  Copyright (c) 2010-2012, Willow Garage, Inc.
  6 |  *  Copyright (c) 2012-, Open Perception, Inc.
  7 |  *
  8 |  *  All rights reserved.
  9 |  *
 10 |  *  Redistribution and use in source and binary forms, with or without
 11 |  *  modification, are permitted provided that the following conditions
 12 |  *  are met:
 13 |  *
 14 |  *   * Redistributions of source code must retain the above copyright
 15 |  *     notice, this list of conditions and the following disclaimer.
 16 |  *   * Redistributions in binary form must reproduce the above
 17 |  *     copyright notice, this list of conditions and the following
 18 |  *     disclaimer in the documentation and/or other materials provided
 19 |  *     with the distribution.
 20 |  *   * Neither the name of the copyright holder(s) nor the names of its
 21 |  *     contributors may be used to endorse or promote products derived
 22 |  *     from this software without specific prior written permission.
 23 |  *
 24 |  *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 25 |  *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 26 |  *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
 27 |  *  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
 28 |  *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
 29 |  *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
 30 |  *  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 31 |  *  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
 32 |  *  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 33 |  *  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
 34 |  *  ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 35 |  *  POSSIBILITY OF SUCH DAMAGE.
 36 |  *
 37 |  * $Id$
 38 |  *
 39 |  */
 40 | 
 41 | #ifndef PCL_REGISTRATION_SUPER4PCS_H_
 42 | #define PCL_REGISTRATION_SUPER4PCS_H_
 43 | 
 44 | #include 
 45 | #include 
 46 | #include 
 47 | 
 48 | namespace pcl
 49 | {
 50 |   /** \brief Pose estimation and alignment class using Super4CS routine.
 51 |    *
 52 |    * This class is a wrapper to use the Super4PCS library in PCL.
 53 |    * For more info, see Super4PCS library repository: https://github.com/nmellado/Super4PCS
 54 |    *
 55 |    * If you use this in academic work, please cite:
 56 |    *
 57 |    * N. Mellado, D. Aiger, N. J. Mitra
 58 |    * SUPER 4PCS: Fast Global Pointcloud Registration via Smart Indexing.
 59 |    * Computer Graphics Forum, Proceedings of SGP 2014, 2014.
 60 |    *
 61 |    * \author Nicolas Mellado (nmellado0@gmail.com)
 62 |    * \ingroup registration
 63 |    */
 64 |   template 
 65 |   class Super4PCS : public Registration
 66 |   {
 67 |     public:
 68 |       typedef typename Registration::Matrix4 Matrix4;
 69 | 
 70 |       using Registration::reg_name_;
 71 |       using Registration::getClassName;
 72 |       using Registration::input_;
 73 |       using Registration::target_;
 74 |       using Registration::transformation_estimation_;
 75 |       using Registration::final_transformation_;
 76 |       using Registration::converged_;
 77 | 
 78 |       typedef typename Registration::PointCloudSource PointCloudSource;
 79 |       typedef typename PointCloudSource::Ptr PointCloudSourcePtr;
 80 |       typedef typename PointCloudSource::ConstPtr PointCloudSourceConstPtr;
 81 | 
 82 |       typedef typename Registration::PointCloudTarget PointCloudTarget;
 83 | 
 84 |       typedef PointIndices::Ptr PointIndicesPtr;
 85 |       typedef PointIndices::ConstPtr PointIndicesConstPtr;
 86 | 
 87 | 
 88 |       GlobalRegistration::Match4PCSOptions options_;
 89 | 
 90 |       /** \brief Constructor */
 91 |       Super4PCS ()
 92 |       {
 93 |         reg_name_ = "Super4PCS";
 94 |         transformation_estimation_.reset (new pcl::registration::TransformationEstimationSVD);
 95 |       }
 96 | 
 97 |       /** \brief Destructor */
 98 |       virtual ~Super4PCS ()
 99 |       {
100 |       }
101 | 
102 |     protected:
103 | 
104 |       /** \brief Rigid transformation computation method.
105 |         * \param output the transformed input point cloud dataset using the rigid transformation found
106 |         * \param guess The computed transformation
107 |         */
108 |       void
109 |       computeTransformation (PointCloudSource &output, const Eigen::Matrix4f& guess);
110 |   };
111 | }
112 | 
113 | #include 
114 | 
115 | #endif
116 | 


--------------------------------------------------------------------------------
/demos/Super4PCS/CMakeLists.txt:
--------------------------------------------------------------------------------
 1 | project(Super4PCS)
 2 | 
 3 | set(Demo_Super4PCS_SRC
 4 |     ${CMAKE_CURRENT_SOURCE_DIR}/super4pcs_test.cc
 5 | )
 6 | 
 7 | add_executable(${PROJECT_NAME} ${Demo_Super4PCS_SRC})
 8 | target_link_libraries(${PROJECT_NAME} super4pcs_algo super4pcs_utils)
 9 | install( TARGETS ${PROJECT_NAME} RUNTIME DESTINATION bin  )
10 | 


--------------------------------------------------------------------------------
/doc/Current-release.md:
--------------------------------------------------------------------------------
 1 | # Release Notes {#currentrelease}
 2 | ## V1.1.x
 3 | This release introduces new code structure allowing use as an actual library.
 4 | 
 5 |  - Build system
 6 |    - Super4PCS now generates a CMake package, so you just need to call `find_package(Super4PCS)` to work with the library.
 7 |    - Save binaries compiled by AppVeyor integration system as Artifacts.
 8 |  - Demos, scripts and assets
 9 |    - assets are now added to the install folder, including downloaded datasets.
10 |    - demo scripts have been updated to work directly after installation. Windows batch scripts have been added.
11 |  - Dependencies
12 |    - Chealpix dependency is marked as deprecated: it slows down the approach and reduce it's robustness. Consequently, Chealpix is still built in CI but not tested.
13 |  - Devel
14 |    - Update include directive relatively to super4pcs root dir. (including fix by @xinkang when enabling timings).
15 |    - Add silent mode in matcher to avoid unwanted logging on standard output. This is implemented by adding a visitor in the matcher main loop, and set it as a logger in the Super4pcs main app.
16 |    - Change directories structure with separated library, tests and demos folders.
17 | 
18 | 
19 | ## V1.0.x-alpha
20 | Pre-release introducing the new version of the Super4PCS library.
21 | No much changes on the API, but many changes on the code internal structure, tests, etc.
22 | 
23 | Major changes:
24 |  * Dependencies:
25 |    * remove ANN dependency,
26 |    * remove dependency to Chealpix. Can be controlled by the option `SUPER4PCS_USE_CHEALPIX`. This options will be available for some time for experiment purposes. During this time, Chealpix and Cfitsio files will still be shipped with Super4PCS source code.
27 |    * OpenCV is required only to load meshes textures. This dependency can be removed by switching option `IO_USE_OPENCV` to `FALSE`,
28 |  * remove duplicate code between 4PCS and Super4PCS,
29 |  * clean code structure,
30 |  * demo dataset + run script added.
31 |  * CMake project can now be opened directly with Visual Studio 2017.
32 | 
33 | ## V0.2.x-alpha
34 | Pre-release including improved compilation system, supporting both windows and linux platforms.
35 | Binaries are available for x64 Windows platforms (tested with windows 7 and 10, requires Microsoft Visual C++ Redistributable for Visual Studio 2015).
36 | 
37 | Major changes:
38 |  * Fix segfault reported in issue #11
39 |  * fix IO bug #9
40 |  * add windows support #4. As a side effect, dependencies are now packaged with the library.
41 |  * improved Cmake configuration: c++11 flags check, add option to set/unset timing recording
42 | 
43 | Compatibility:
44 |  * add compatibility with OpenCV3.0 and greater
45 |  * fix compilation errors with gcc 4.9.1
46 | 
47 | Minor and devel changes :
48 |  * exploration is now stopped when LCP = 1
49 |  * fix several minor bugs, causing instabilities and reduced performances
50 |  * use functors in several place, to improve code reusability and prepare next milestones
51 |  * removed several compilation warnings
52 | 
53 | ## V0.1-alpha
54 | Alpha version of the Super4PCS first release, introducing:
55 | 
56 | * compilation environment using CMake.
57 | * unit-tests based on CTest: to process both sub-routines and the whole Super4PCS algorithm using an online dataset with ground truth (Standford).
58 | * improved performances and bugfixes.
59 | 
60 | 


--------------------------------------------------------------------------------
/doc/Datasets.md:
--------------------------------------------------------------------------------
 1 | # Datasets {#datasets}
 2 | 
 3 | If you want to go further, you can also download the demo datasets, including 3D models from the original paper. To do so, you can either call
 4 | 
 5 |     make dl-datasets
 6 | 
 7 | if you use Super4PCS from sources, or directly download this [file](https://www.irit.fr/~Nicolas.Mellado/dl/datasets/point-clouds/Super4PCS-dataset-demo1.zip) (MD5: `ad1e172902b41a3f17e9b4901adf3ba5`).
 8 | 
 9 | Then, call the registration script:
10 | 
11 |     cd assets/demo1
12 |     ./run.sh   # call the run.bat script on windows
13 | 
14 | The registration output can be easily checked using the meshlab projects (files `*.mlp`) provided in the dataset subfolders.
15 | 
16 | > Note that this demo does not include local registration, ICP must be ran in post-process to obtain fine alignment.
17 | 


--------------------------------------------------------------------------------
/doc/Demos.md:
--------------------------------------------------------------------------------
  1 | # Scripts, Demos and wrappers {#demos}
  2 | 
  3 | Starting from v1.1.3, the library is shipped with applications demonstrating how to use the library.
  4 | 
  5 | 
  6 | ## Standalone demo
  7 | This is the original command line application, allowing to register two views of the same object or scene.
  8 | It is available at `install_dir/bin/Super4pcs`.
  9 | 
 10 | To compile, call:
 11 | 
 12 |     make Super4PCS
 13 | 
 14 | See the @ref usage page for more details.
 15 | 
 16 | ## Meshlab Plugin
 17 | > You need to compile the library from source to use this feature.
 18 | 
 19 | A Meshlab plugin can be generated from the library.
 20 | Since we do not want to carry the full Meshlab repository, we assume that Meshlab source code can be found somewhere close to the Super4PCS sources (check `cmake/FindMeshlab.cmake` for more details).
 21 | We thus provide a cmake target `Meshlab_install_plugin` that will generate a Meshlab plugin source files, and put them in `meshlab_dir/src/meshlabplugins/filter_globalregistration`:
 22 |  - `filter_globalregistration.pro`: which properly set the link and include directories to compile the plugin
 23 |  - `globalregistration.h` and `globalregistration.cpp`: the plugin source code
 24 |  - `readme.md`: which gives you the instructions to follow to add the GlobalRegistration plugin to the Meshlab plugin compilation list.
 25 | 
 26 | Note that we also copy libraries and include files in the `meshlab_dir/src/external folder`.
 27 | 
 28 | To compile, call
 29 | 
 30 |     make Meshlab_install_plugin
 31 |     cd meshlab_dir/src
 32 |     # Follow instructions from meshlabplugins/filter_globalregistration/readme.md
 33 |     qmake meshlab_full.pro && make
 34 | 
 35 | The plugin can be found in Meshlab in `Filter > Point set > Global Registration`, or using the filter search engine.
 36 | 
 37 | 
 38 | 
 39 | ## PCLWrapper
 40 | Provides a wrapper to use Super4PCS within the Point Cloud Library, and implementing `pcl::Registration`.
 41 | 
 42 | The wrapper source code is available at `install_dir/include/pcl/registration`. Note that our file structure follows the PCL source code organization.
 43 | 
 44 | A command line application demonstrating how to use the wrapper is available here: `install_dir/bin/Super4PCS-PCLWrapper`.
 45 | To compile, call:
 46 | 
 47 |     make Super4PCS-PCLWrapper
 48 | 
 49 | The source code of the demo application is quite simple:
 50 | 
 51 | ~~~~~~~~~~~~~{.cpp}
 52 | using namespace GlobalRegistration;
 53 | 
 54 | // Align a rigid object to a scene with clutter and occlusions
 55 | int
 56 | main (int argc, char **argv)
 57 | {
 58 |   // Point clouds
 59 |   PointCloudT::Ptr object (new PointCloudT);
 60 |   PointCloudT::Ptr object_aligned (new PointCloudT);
 61 |   PointCloudT::Ptr scene (new PointCloudT);
 62 | 
 63 |   // Get input object and scene
 64 |   if (argc < 4)
 65 |   {
 66 |     pcl::console::print_error ("Syntax is: %s scene.obj object.obj [PARAMS]\n", argv[0]);
 67 |     Demo::printParameterList();
 68 |     return (-1);
 69 |   }
 70 | 
 71 |   // Load object and scene
 72 |   pcl::console::print_highlight ("Loading point clouds...\n");
 73 |   if (pcl::io::loadOBJFile (argv[2], *object) < 0 ||
 74 |       pcl::io::loadOBJFile (argv[1], *scene) < 0)
 75 |   {
 76 |     pcl::console::print_error ("Error loading object/scene file!\n");
 77 |     return (-1);
 78 |   }
 79 | 
 80 |   // Load Super4pcs parameters
 81 |   Demo::getArgs(argc, argv);
 82 | 
 83 |   pcl::Super4PCS align;
 84 |   Demo::setOptionsFromArgs(align.options_);
 85 | 
 86 |   // Perform alignment
 87 |   pcl::console::print_highlight ("Starting alignment...\n");
 88 |   align.setInputSource (object);
 89 |   align.setInputTarget (scene);
 90 | 
 91 |   {
 92 |     pcl::ScopeTime t("Alignment");
 93 |     align.align (*object_aligned);
 94 |   }
 95 | 
 96 |   if (align.hasConverged ())
 97 |   {
 98 |     // Print results
 99 |     printf ("\n");
100 |     Eigen::Matrix4f transformation = align.getFinalTransformation ();
101 |     pcl::console::print_info ("    | %6.3f %6.3f %6.3f | \n", transformation (0,0), transformation (0,1), transformation (0,2));
102 |     pcl::console::print_info ("R = | %6.3f %6.3f %6.3f | \n", transformation (1,0), transformation (1,1), transformation (1,2));
103 |     pcl::console::print_info ("    | %6.3f %6.3f %6.3f | \n", transformation (2,0), transformation (2,1), transformation (2,2));
104 |     pcl::console::print_info ("\n");
105 |     pcl::console::print_info ("t = < %0.3f, %0.3f, %0.3f >\n", transformation (0,3), transformation (1,3), transformation (2,3));
106 |     pcl::console::print_info ("\n");
107 | 
108 |     // Show alignment
109 |     pcl::visualization::PCLVisualizer visu("Alignment - Super4PCS");
110 |     visu.addPointCloud (scene, ColorHandlerT (scene, 0.0, 255.0, 0.0), "scene");
111 |     visu.addPointCloud (object_aligned, ColorHandlerT (object_aligned, 0.0, 0.0, 255.0), "object_aligned");
112 |     visu.spin ();
113 |   }
114 |   else
115 |   {
116 |     pcl::console::print_error ("Alignment failed!\n");
117 |     return (-1);
118 |   }
119 | 
120 |   return (0);
121 | }
122 | ~~~~~~~~~~~~~
123 | 


--------------------------------------------------------------------------------
/doc/File-formats.md:
--------------------------------------------------------------------------------
  1 | # Supported File Formats {#fileformats}
  2 | 
  3 | The Super4PCS library provides its own IO module, to load and save 3D point clouds, meshes and export computed matrices.
  4 | 
  5 | ## Overview
  6 | |                       |   Input    |  Output   |
  7 | |:---------------------:|:----------:|:---------:|
  8 | | Point-cloud           | ply, ptx   |  ply      |
  9 | | Mesh                  | obj        |  obj      |
 10 | | Transformation Matrix |            |  txt      |
 11 | | Sampled clouds        |            |  ply      |
 12 | 
 13 | Input/Output files are specified using the following flags:
 14 | * `-i file1 file2`: two input files,
 15 | * `-r filename`: output file,
 16 | * `-m filename`: output matrix,
 17 | * `--sampled1 filename`: cloud sampled from input 1,
 18 | * `--sampled2 filename`: cloud sampled from input 2.
 19 | 
 20 | When neither `-r` nor `-m` are specified, the result is exported to `output.obj/.ply`.
 21 | 
 22 | ## Parsers specifications
 23 | ### Transformation matrices ([2c92b29](http://github.com/nmellado/Super4PCS/commit/2c92b29d796309de3c01a43406b9054df262b84f))
 24 | 3D matrices are exported as text files, such as:
 25 | 
 26 |     VERSION	=	1
 27 |     MATRIX	=
 28 |      0.952888   0.099464  -0.286551   0.045467
 29 |     -0.096379   0.995034   0.024886  -0.372831
 30 |      0.287603   0.003904   0.957742  -0.447515
 31 |      0.000000   0.000000   0.000000   1.000000
 32 | 
 33 | These files can be loaded by Polyworks to transform geometry layers.
 34 | 
 35 | 
 36 | ### PTX ([84d079e](http://github.com/nmellado/Super4PCS/commit/84d079e8ec0b2c79c82e167164d103ffb6e40f18))
 37 | [Cyclone pointcloud export](http://w3.leica-geosystems.com/kb/?guid=5532D590-114C-43CD-A55F-FE79E5937CB2) format, available only to **load** range maps as point-clouds.
 38 | 
 39 | The scanner position and the cloud transformations are ignored, and only the first range map is considered.
 40 | 
 41 | ### PLY
 42 | The [PoLYgon file format](http://en.wikipedia.org/wiki/PLY_%28file_format%29) (.ply) is used to load/save **point-clouds** exclusively. Both ASCII and Binary encoding are supported, but ASCII encoding is in general preferred.
 43 | 
 44 | A limited set of property list is supported. Using other formats will **not** trigger any error, but will prevent the algorithm to find a solution.
 45 | 
 46 | In ASCII mode only, both float and double properties are supported (files generated by matlab).
 47 | 
 48 | The supported property lists are (any other property type will cause the program to run on wrong data!):
 49 | ####Position only
 50 | 
 51 |     property float x
 52 |     property float y
 53 |     property float z
 54 | 
 55 | ####Position + Normals
 56 | 
 57 |     property float x
 58 |     property float y
 59 |     property float z
 60 |     property float nx
 61 |     property float ny
 62 |     property float nz
 63 | 
 64 | ####Position + Colors (RGB)
 65 | 
 66 |     property float x
 67 |     property float y
 68 |     property float z
 69 |     property uchar red
 70 |     property uchar green
 71 |     property uchar blue
 72 | 
 73 | ####Position + Colors (RGBA)
 74 | 
 75 |     property float x
 76 |     property float y
 77 |     property float z
 78 |     property uchar red
 79 |     property uchar green
 80 |     property uchar blue
 81 |     property uchar alpha
 82 | 
 83 | ####Position + Normals + Colors (RGB)
 84 | 
 85 |     property float x
 86 |     property float y
 87 |     property float z
 88 |     property float nx
 89 |     property float ny
 90 |     property float nz
 91 |     property uchar red
 92 |     property uchar green
 93 |     property uchar blue
 94 | 
 95 | ####Position + Normals + Colors (RGBA)
 96 | 
 97 |     property float x
 98 |     property float y
 99 |     property float z
100 |     property float nx
101 |     property float ny
102 |     property float nz
103 |     property uchar red
104 |     property uchar green
105 |     property uchar blue
106 |     property uchar alpha
107 | 
108 | ### OBJ
109 | [Wavefront OBJ](http://en.wikipedia.org/wiki/Wavefront_.obj_file) files are used to load/save meshes.
110 | Faces lists are required, and textures are supported (per-vertex color fetched from the texture).
111 | 
112 | 


--------------------------------------------------------------------------------
/doc/Getting-started.md:
--------------------------------------------------------------------------------
 1 | # Getting Started {#gettingstarted}
 2 | 
 3 | Since Release v1.1.x we improved the usability of Super4PCS as an application or as a library.
 4 | 
 5 | To run the application, you just need to:
 6 | 
 7 |  1. Compile the source code (checkout the @ref compilation page), or download the latest [release](https://github.com/nmellado/Super4PCS/releases) to obtain the Super4PCS binary.
 8 |  2. Go to the script folder, and run the `run-example` script from there.
 9 | 
10 | Then, depending on plans, you also might want to look at:
11 |  - our @ref demos, the use the library with the Point Cloud Library or with a Meshlab plugin.
12 |  - the @ref datasets page, to *further test the application on real datasets*, including models from the original paper.
13 |  - the @ref usage page for more details on the Super4PCS parameters.
14 |  - the [Match4PCSBase](@ref GlobalRegistration::Match4PCSBase) class, if you plan to *use the library in you own software*.
15 |    This is the base class for registration algorithms, providing the [ComputeTransformation](@ref GlobalRegistration::Match4PCSBase::ComputeTransformation) method. Two different algorithms are today available: [4PCS](@ref GlobalRegistration::Match4PCS) and its more efficient variant [Super4PCS](@ref GlobalRegistration::MatchSuper4PCS)
16 | 
17 | 


--------------------------------------------------------------------------------
/doc/Road-map.md:
--------------------------------------------------------------------------------
 1 | # Roadmap  {#roadmap}
 2 | 
 3 | Super4PCS refactoring started with v1.1.x is now almost done.
 4 | Current changes are now focusing on:
 5 | * stabilizing the API
 6 | * improving testing
 7 | * adding wrappers to point-cloud and mesh processing libraries/softwares.
 8 | See the Pull Request to the next release v1.1.3 [here](https://github.com/nmellado/Super4PCS/pull/45).
 9 | 
10 | At long term, our goal is to:
11 | * implement other approaches such as [Generalized4PCS](http://dl.acm.org/citation.cfm?id=2758287) or the recent [2 -points+normal](http://ieeexplore.ieee.org/abstract/document/7989664/) variant.
12 | * add bridge to local registration implementation (PCL ?).
13 | 
14 | In parallel, we also plan to release datasets with ground-truth transformations, to ease comparison between registration techniques.
15 | 


--------------------------------------------------------------------------------
/doc/Tests.md:
--------------------------------------------------------------------------------
 1 | # Tests {#tests}
 2 | 
 3 | Tests are currently under active development. We use the following tools in this project:
 4 | * [Travis](https://travis-ci.org/nmellado/Super4PCS) : continuous integration for linux and MacOS
 5 | * [AppVeyor](https://ci.appveyor.com/project/nmellado/super4pcs) : continuous integration for windows
 6 | * [CDash](http://my.cdash.org/index.php?project=Super4PCS): reporting
 7 | 
 8 | Continuous Integration status:
 9 | 
10 | [stsimg-linux]: https://api.travis-ci.org/nmellado/Super4PCS.svg?branch=master
11 | [stsimg-windw]: https://ci.appveyor.com/api/projects/status/reg4cmhn309w1s8k/branch/master?svg=true
12 | 
13 | | Linux  \& MacOS | Windows         |
14 | | :----:          | :-----:         |
15 | | ![stsimg-linux] | ![stsimg-windw] |
16 | 
17 | 
18 | Tests currently available:
19 | * `pair_extraction`: generate random point clouds in 2, 3 and 4D, and query the pair generation structure with various radius.
20 | * `quad_extraction`: generate random point clouds in 3D and query the quad generation structure with various radius. Routines from 4PCS and Super4PCS are then compared. This test is still in development mode and would need some improvements.
21 | * `matching`: test the whole Super4PCS pipeline by registering range maps from the standford repository. You need an internet connection to build this test, since the datasets are downloaded at this time. Here range maps are registered sequentially, and the test is passed only if the estimated transformation is close enough to the GT provided in the dataset.
22 | 


--------------------------------------------------------------------------------
/doc/Usage-Part-in-Whole.md:
--------------------------------------------------------------------------------
1 | # [Usage] Part-in-whole {#usage-partinwhole}
2 | 
3 | See more details about part-in-whole matching in issue [#46](https://github.com/nmellado/Super4PCS/issues/46).
4 | 


--------------------------------------------------------------------------------
/doc/Usage.md:
--------------------------------------------------------------------------------
 1 | # Usage {#usage}
 2 | 
 3 | In this page we review the main parameters of the Super4PCS algorithm, and how to use them properly to efficiently register point-clouds.
 4 | We also list and describe difficult configurations that may arise sometime, how to detect them and sort them out.
 5 | 
 6 | Specific cases are described in dedicated pages:
 7 |  - @subpage usage-partinwhole
 8 | 
 9 | To get the exhaustive list of Super4PCS parameters, run
10 | 
11 |     ./Super4PCS -h
12 | 
13 | In the current version, you should get
14 | 
15 |     Usage: ./Super4PCS -i input1 input2
16 |         [ -o overlap (0.20) ]
17 |         [ -d delta (5.00) ]
18 |         [ -n n_points (200) ]
19 |         [ -a norm_diff (90.000000) ]
20 |         [ -c max_color_diff (150.000000) ]
21 |         [ -t max_time_seconds (10) ]
22 |         [ -r result_file_name (output.obj) ]
23 |         [ -x (use 4pcs: false by default) ]
24 | 
25 | Each parameter is described by its string identifiers, followed by the default value between (). Note that all parameters string must be followed by a value, except -x, the option to use 4PCS instead of Super4PCS.
26 | 
27 | **Note for 4PCS users:**
28 | >Super4PCS comes with exactly the same interface than 4PCS. So you can use the same settings, you should get similar results.
29 | >In case you need it, Super4PCS also includes the original 4PCS procedure. You can call it by adding -x to your command line.
30 | 
31 | ## Playing with parameters
32 | ### Parameters overview
33 | The three main parameters of the algorithm (overlap. number of samples, and accuracy) are described in the following sections.
34 | 
35 | The `-a` and `-c` parameters defines threshold used to filter pairs according to their consistency, regarding normal angles and rgb values respectively.
36 | This filtering is enabled only when the associated fields are loaded from the input files.
37 | 
38 | Super4PCS explores the transformation space to align the two input clouds.
39 | The maximum time allowed to the process is set using the option `-t`.
40 | Since the exploration is performed randomly, it is recommended to use a large time value to explore the whole space (e.g., `-t 1000`).
41 | 
42 | ### Overlap estimation (-o)
43 | This parameter defines the amount of expected overlap between the two clouds: it is ranging between 0 (no overlap) to 1 (100% overlap).
44 | 
45 | The overlap parameter controls the size of the basis used for registration, as shown in the Figure below:
46 | 
47 | 
48 | 
49 | Usually, the larger the overlap, the faster the algorithm.
50 | When the overlap is unknown, a simple way to set this parameter is to start from 100% overlap, and decrease the value until obtaining a good result.
51 | Using too small values will slow down the algorithm, and reduce the accuracy of the result.
52 | 
53 | 
54 | ### Number of samples (-n)
55 | Input clouds are sub-sampled prior exploration, to ensure fast computations.
56 | Super4PCS has a linear complexity wrt the number of input samples, allowing to use larger values than 4PCS.
57 | Simple geometry with large overlap can be matched with only 200 samples.
58 | However, with Super4PCS, smaller details can be used during the process by using up to thousands of points.
59 | There is no theoretical limit to this parameter, however using too large values leads to very a large congruent set, which requires more time and memory to be explored.
60 | 
61 | Using a large number of samples is recommended when:
62 | * **geometrical details** are _required_ to perform the matching, for instance to disambiguate between several similar configurations,
63 | * the clouds have a very low **overlap**: using a too sparse sampling can prevent to have samples in the overlapping area, causing the algorithm to fail,
64 | * the clouds are very **noisy**, and require a dense sampling.
65 | 
66 | Note that Super4PCS is a global registration algorithm, which finds a good _approximate_ of the rigid transformation aligning too clouds.
67 | Increasing the number of samples in order to get a fine registration is not optimal: it is usually faster to use less samples, and refine the transformation using a local algorithm, like the [ICP](http://pointclouds.org/documentation/tutorials/iterative_closest_point.php), or its variant [SparseICP](https://github.com/OpenGP/sparseicp).
68 | 
69 | ### Registration accuracy (-d)
70 | This parameter controls the registration accuracy (delta in the paper) : setting a small value means that the two clouds needs to be very close to be considered as well aligned. It is expressed in scene units.
71 | 
72 | A simple way to understand its impact is to consider the computation of the Largest Common Pointset (LCP), the metric used to verify how much the clouds are aligned.
73 | For each transformation matrix produced by Super4PCS, we compute the LCP measure by considering a shell around the reference cloud, and count the % of points of the target cloud lying in the shell. The thickness of the shell is defined by the parameter delta.
74 | 
75 | The LCP values are given in the standard output:
76 | 
77 |         ./run-example.sh
78 |         Use Super4PCS
79 |         create tree
80 |         create tree ... DONE (5281 points)
81 |         Work with 414 points
82 |         norm_max_dist: 0.010000
83 |         Initial LCP: 0.004831
84 |         Score: 0.748792
85 | with 0.4% points lying in the shell at the beginning of the process, and 74.8% at the end.
86 | 
87 | Using too wide values will slow down the algorithm by increasing the size of the congruent set, while using to small values prevents to find a solution.
88 | This parameter impacts other steps of the algorithm, see the paper for more details.
89 | 
90 | 


--------------------------------------------------------------------------------
/doc/img/Meshlab-UI2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nmellado/Super4PCS/d5ab2a407c4f8cbfd60dc97d826b1cc726bb25d8/doc/img/Meshlab-UI2.jpg


--------------------------------------------------------------------------------
/doc/img/VStudio-globalFolders.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nmellado/Super4PCS/d5ab2a407c4f8cbfd60dc97d826b1cc726bb25d8/doc/img/VStudio-globalFolders.jpg


--------------------------------------------------------------------------------
/doc/img/super4PCS_overlap.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nmellado/Super4PCS/d5ab2a407c4f8cbfd60dc97d826b1cc726bb25d8/doc/img/super4PCS_overlap.png


--------------------------------------------------------------------------------
/doc/overview.md:
--------------------------------------------------------------------------------
 1 | # User documentation {#mainpage}
 2 | 
 3 | ## About Super4PCS
 4 | 
 5 | The Super4PCS library is a set C++ libraries, standalone applications and plugins released under the terms of the *APACHE V2 licence*, which makes it free for commercial and research use.
 6 | 
 7 | It provides state of the art global registration techniques for 3d pointclouds. Still under active development, the library is currently improved by adding wrappers to existing software, and by stabilizing the API.
 8 | 
 9 | In a nutshell, it provides:
10 | * two core packages: [algorithms](@ref GlobalRegistration::algorithms) and [accelerators](@ref GlobalRegistration::accelerators),
11 | * two convenience packages: [io](@ref GlobalRegistration::io) and [utils](@ref GlobalRegistration::utils),
12 | * several [demonstrators](@ref Super4PCS-Demos):
13 |    * a [command line application](@ref Super4PCS-App),
14 |    * wrappers to use the algorithms with the [Point Cloud Library](@ref Super4PCS-PCL) and [CGAL](@ref Super4PCS-CGAL) (coming soon)
15 |    * a [meshlab plugin](@ref Super4PCS-Meshlab)
16 | * a [test suite](@ref GlobalRegistration::Testing)
17 | 
18 | ### Usage and documentation
19 | 
20 |  - @subpage gettingstarted : How to use the library in 180 seconds
21 |  - @subpage compilation : Compilation instructions and supported platform(s...). Also describe how to link with the library using cmake.
22 |  - @subpage demos
23 |  - @subpage datasets
24 |  - @subpage fileformats : Supported file formats
25 |  - @subpage usage : Hints for usage and parameter tuning
26 |  - @subpage tests : Monitor continuous integration, run tests on your platform
27 |  - @subpage currentrelease : Changelog and status of the current release
28 |  - @subpage roadmap
29 | 
30 | ## Compilation status
31 | [stsimg-linux]: https://api.travis-ci.org/nmellado/Super4PCS.svg?branch=master
32 | [stsimg-windw]: https://ci.appveyor.com/api/projects/status/reg4cmhn309w1s8k/branch/master?svg=true
33 | 
34 | [Travis]: https://travis-ci.org/nmellado/Super4PCS "Travis"
35 | [AppVeyor]: https://ci.appveyor.com/project/nmellado/super4pcs "AppVeyor"
36 | 
37 | | Linux  \& MacOS | Windows         |
38 | | :----:          | :-----:         |
39 | | ![stsimg-linux] | ![stsimg-windw] |
40 | | [Travis]        | [AppVeyor]      |
41 | 
42 | 
43 | ## Credits
44 | * Nicolas Mellado: conception, implementation and examples
45 | * Dror Aiger: 4pcs implementation
46 | * Niloy Mitra: 4pcs implementation
47 | 
48 | ### Contributors
49 | * [Simone Gasparini](https://github.com/simogasp) Pull-Request reviews
50 | * [xinkang](https://github.com/xinkang) Fix include path of timer.h
51 | 
52 | 
53 | ### Citation
54 | ```
55 | @misc {Super4PCSLibrary,
56 |     author = {Mellado, Nicolas and Aiger, Dror and Mitra, Niloy J.},
57 |     title = {Super 4PCS Library},
58 |     howpublished = {https://github.com/nmellado/Super4PCS},
59 |     year = {2017},
60 | }
61 | ```
62 | 


--------------------------------------------------------------------------------
/scripts/run-example.bat:
--------------------------------------------------------------------------------
 1 | :: Copyright 2014 Nicolas Mellado
 2 | ::
 3 | :: Licensed under the Apache License, Version 2.0 (the "License");
 4 | :: you may not use this file except in compliance with the License.
 5 | :: You may obtain a copy of the License at
 6 | ::
 7 | ::   http://www.apache.org/licenses/LICENSE-2.0
 8 | ::
 9 | :: Unless required by applicable law or agreed to in writing, software
10 | :: distributed under the License is distributed on an "AS IS" BASIS,
11 | :: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | :: See the License for the specific language governing permissions and
13 | :: limitations under the License.
14 | ::
15 | :: -------------------------------------------------------------------------- ::
16 | ::
17 | :: Authors: Nicolas Mellado
18 | ::
19 | :: An implementation of the Super 4-points Congruent Sets (Super 4PCS)
20 | :: algorithm presented in:
21 | ::
22 | :: Super 4PCS: Fast Global Pointcloud Registration via Smart Indexing
23 | :: Nicolas Mellado, Dror Aiger, Niloy J. Mitra
24 | :: Symposium on Geometry Processing 2014.
25 | ::
26 | :: Data acquisition in large-scale scenes regularly involves accumulating
27 | :: information across multiple scans. A common approach is to locally align scan
28 | :: pairs using Iterative Closest Point (ICP) algorithm (or its variants), but
29 | :: requires static scenes and small motion between scan pairs. This prevents
30 | :: accumulating data across multiple scan sessions and/or different acquisition
31 | :: modalities (e.g., stereo, depth scans). Alternatively, one can use a global
32 | :: registration algorithm allowing scans to be in arbitrary initial poses. The
33 | :: state-of-the-art global registration algorithm, 4PCS, however has a quadratic
34 | :: time complexity in the number of data points. This vastly limits its
35 | :: applicability to acquisition of large environments. We present Super 4PCS for
36 | :: global pointcloud registration that is optimal, i.e., runs in linear time (in
37 | :: the number of data points) and is also output sensitive in the complexity of
38 | :: the alignment problem based on the (unknown) overlap across scan pairs.
39 | :: Technically, we map the algorithm as an 'instance problem' and solve it
40 | :: efficiently using a smart indexing data organization. The algorithm is
41 | :: simple, memory-efficient, and fast. We demonstrate that Super 4PCS results in
42 | :: significant speedup over alternative approaches and allows unstructured
43 | :: efficient acquisition of scenes at scales previously not possible. Complete
44 | :: source code and datasets are available for research use at
45 | :: http://geometry.cs.ucl.ac.uk/projects/2014/super4PCS/.
46 | ::
47 | ::
48 | ::
49 | :: This file is supposed to be ran from super4pcs_install_dir/scripts/
50 | ::
51 | :: run both 4pcs and super4pcs on the hippo model.
52 | :: parameters are optimised to get an accurate alignement of the two models
53 | ::   -o input estimated overlap in [0,1]
54 | ::   -d delta, used to compute the LCP between the two models
55 | ::   -t maximum computation time in seconds
56 | ::   -n number of samples used for the matching
57 | ::
58 | :: When available, also runs the registration using the PCL wrapper
59 | 
60 | @ setx PATH "%~dp0\..\lib"
61 | 
62 | ..\bin\Super4pcs -i ..\assets\hippo1.obj ..\assets\hippo2.obj -o 0.7 -d 0.01 -t 1000 -n 200 -r super4pcs_fast.obj -m mat_super4pcs_fast.txt
63 | ..\bin\Super4pcs -i ..\assets\hippo1.obj ..\assets\hippo2.obj -o 0.7 -d 0.01 -t 1000 -n 200 -r      4pcs_fast.obj -m      mat_4pcs_fast.txt -x
64 | 
65 | if exist ..\bin\Super4PCS-PCLWrapper (
66 |     ..\bin\Super4PCS-PCLWrapper ..\assets\hippo1.obj ..\assets\hippo2.obj -o 0.7 -d 0.01 -t 1000 -n 200
67 | )
68 | 
69 | @ PAUSE
70 | 


--------------------------------------------------------------------------------
/scripts/run-example.sh:
--------------------------------------------------------------------------------
 1 | #! /bin/sh
 2 | 
 3 | # Copyright 2014 Nicolas Mellado
 4 | #
 5 | # Licensed under the Apache License, Version 2.0 (the "License");
 6 | # you may not use this file except in compliance with the License.
 7 | # You may obtain a copy of the License at
 8 | #
 9 | #   http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing, software
12 | # distributed under the License is distributed on an "AS IS" BASIS,
13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | # See the License for the specific language governing permissions and
15 | # limitations under the License.
16 | #
17 | # -------------------------------------------------------------------------- ::
18 | #
19 | # Authors: Nicolas Mellado
20 | #
21 | # An implementation of the Super 4-points Congruent Sets (Super 4PCS)
22 | # algorithm presented in:
23 | #
24 | # Super 4PCS: Fast Global Pointcloud Registration via Smart Indexing
25 | # Nicolas Mellado, Dror Aiger, Niloy J. Mitra
26 | # Symposium on Geometry Processing 2014.
27 | #
28 | # Data acquisition in large-scale scenes regularly involves accumulating
29 | # information across multiple scans. A common approach is to locally align scan
30 | # pairs using Iterative Closest Point (ICP) algorithm (or its variants), but
31 | # requires static scenes and small motion between scan pairs. This prevents
32 | # accumulating data across multiple scan sessions and/or different acquisition
33 | # modalities (e.g., stereo, depth scans). Alternatively, one can use a global
34 | # registration algorithm allowing scans to be in arbitrary initial poses. The
35 | # state-of-the-art global registration algorithm, 4PCS, however has a quadratic
36 | # time complexity in the number of data points. This vastly limits its
37 | # applicability to acquisition of large environments. We present Super 4PCS for
38 | # global pointcloud registration that is optimal, i.e., runs in linear time (in
39 | # the number of data points) and is also output sensitive in the complexity of
40 | # the alignment problem based on the (unknown) overlap across scan pairs.
41 | # Technically, we map the algorithm as an 'instance problem' and solve it
42 | # efficiently using a smart indexing data organization. The algorithm is
43 | # simple, memory-efficient, and fast. We demonstrate that Super 4PCS results in
44 | # significant speedup over alternative approaches and allows unstructured
45 | # efficient acquisition of scenes at scales previously not possible. Complete
46 | # source code and datasets are available for research use at
47 | # http://geometry.cs.ucl.ac.uk/projects/2014/super4PCS/.
48 | #
49 | #
50 | #
51 | # This file is supposed to be ran from super4pcs_install_dir/scripts/
52 | #
53 | # run both 4pcs and super4pcs on the hippo model.
54 | # parameters are optimised to get an accurate alignement of the two models
55 | # -o input estimated overlap in [0,1]
56 | # -d delta, used to compute the LCP between the two models
57 | # -t maximum computation time in seconds
58 | # -n number of samples used for the matching
59 | #
60 | # When available, also runs the registration with the PCL wrapper
61 | 
62 | export LD_LIBRARY_PATH=../lib/
63 | 
64 | SPACER="------------------------------"
65 | 
66 | echo ${SPACER}
67 | echo "Running Super4PCS"
68 | time -p ../bin/Super4PCS -i ../assets/hippo1.obj ../assets/hippo2.obj -o 0.7 -d 0.01 -t 1000 -n 200 -r super4pcs_fast.obj -m mat_super4pcs_fast.txt
69 | 
70 | 
71 | echo ${SPACER}
72 | echo "Running 4PCS"
73 | time -p ../bin/Super4PCS -i ../assets/hippo1.obj ../assets/hippo2.obj -o 0.7 -d 0.01 -t 1000 -n 200 -r      4pcs_fast.obj -m      mat_4pcs_fast.txt -x
74 | 
75 | 
76 | if [ -f ../bin/Super4PCS-PCLWrapper ]; then
77 |     echo ${SPACER}
78 |     echo "Running PCLWrapper"
79 |     ../bin/Super4PCS-PCLWrapper ../assets/hippo1.obj ../assets/hippo2.obj -o 0.7 -d 0.01 -t 1000 -n 200
80 | fi
81 | 


--------------------------------------------------------------------------------
/src/super4pcs/accelerators/CMakeLists.txt:
--------------------------------------------------------------------------------
 1 | project (Super4PCS-AccelLib)
 2 | 
 3 | set(accel_ROOT "super4pcs/accelerators")
 4 | 
 5 | #############################################
 6 | 
 7 | set(accel_relative_INCLUDE
 8 |     ${accel_ROOT}/kdtree.h
 9 |     ${accel_ROOT}/pairExtraction/bruteForceFunctor.h
10 |     ${accel_ROOT}/pairExtraction/intersectionFunctor.h
11 |     ${accel_ROOT}/pairExtraction/intersectionNode.h
12 |     ${accel_ROOT}/pairExtraction/intersectionPrimitive.h
13 |     ${accel_ROOT}/normalset.h
14 |     ${accel_ROOT}/normalset.hpp
15 |     ${accel_ROOT}/bbox.h
16 |     ${accel_ROOT}/utils.h)
17 | 
18 | 
19 | if(SUPER4PCS_USE_CHEALPIX)
20 |     include_directories(${Chealpix_INCLUDE_DIR})
21 |     set(APPEND accel_relative_INCLUDE ${accel_ROOT}/normalHealSet.h)
22 | endif(SUPER4PCS_USE_CHEALPIX)
23 | 
24 | # compute accel_INCLUDE to get absolute filenames
25 | set(accel_INCLUDE "")
26 | set(accel_installed_INCLUDE "")
27 | foreach(f ${accel_relative_INCLUDE})
28 |     list(APPEND accel_INCLUDE "${SRC_DIR}/${f}")
29 |     list(APPEND accel_installed_INCLUDE "include/${f}")
30 | endforeach(f)
31 | 
32 | add_library(super4pcs_accel INTERFACE)
33 | target_sources(super4pcs_accel INTERFACE
34 |     $
35 |     $
36 |     )
37 | 
38 | 
39 | if(SUPER4PCS_USE_CHEALPIX)
40 |     add_dependencies(super4pcs_accel chealpix)
41 | endif(SUPER4PCS_USE_CHEALPIX)
42 | 
43 | set(targets_export_name "${PROJECT_NAME}Targets")
44 | install( TARGETS super4pcs_accel
45 |     EXPORT "${targets_export_name}"
46 |     RUNTIME DESTINATION bin
47 |     LIBRARY DESTINATION lib
48 |     ARCHIVE DESTINATION lib
49 |     INCLUDES DESTINATION include  )
50 | 


--------------------------------------------------------------------------------
/src/super4pcs/accelerators/bbox.h:
--------------------------------------------------------------------------------
 1 | // Copyright 2014 Nicolas Mellado
 2 | //
 3 | // Licensed under the Apache License, Version 2.0 (the "License");
 4 | // you may not use this file except in compliance with the License.
 5 | // You may obtain a copy of the License at
 6 | //
 7 | //   http://www.apache.org/licenses/LICENSE-2.0
 8 | //
 9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 | //
15 | // -------------------------------------------------------------------------- //
16 | //
17 | // Authors: Moos Hueting, Nicolas Mellado
18 | //
19 | // This file is part of the implementation of the Super 4-points Congruent Sets
20 | // (Super 4PCS) algorithm presented in:
21 | //
22 | // Super 4PCS: Fast Global Pointcloud Registration via Smart Indexing
23 | // Nicolas Mellado, Dror Aiger, Niloy J. Mitra
24 | // Symposium on Geometry Processing 2014.
25 | //
26 | // Data acquisition in large-scale scenes regularly involves accumulating
27 | // information across multiple scans. A common approach is to locally align scan
28 | // pairs using Iterative Closest Point (ICP) algorithm (or its variants), but
29 | // requires static scenes and small motion between scan pairs. This prevents
30 | // accumulating data across multiple scan sessions and/or different acquisition
31 | // modalities (e.g., stereo, depth scans). Alternatively, one can use a global
32 | // registration algorithm allowing scans to be in arbitrary initial poses. The
33 | // state-of-the-art global registration algorithm, 4PCS, however has a quadratic
34 | // time complexity in the number of data points. This vastly limits its
35 | // applicability to acquisition of large environments. We present Super 4PCS for
36 | // global pointcloud registration that is optimal, i.e., runs in linear time (in
37 | // the number of data points) and is also output sensitive in the complexity of
38 | // the alignment problem based on the (unknown) overlap across scan pairs.
39 | // Technically, we map the algorithm as an 'instance problem' and solve it
40 | // efficiently using a smart indexing data organization. The algorithm is
41 | // simple, memory-efficient, and fast. We demonstrate that Super 4PCS results in
42 | // significant speedup over alternative approaches and allows unstructured
43 | // efficient acquisition of scenes at scales previously not possible. Complete
44 | // source code and datasets are available for research use at
45 | // http://geometry.cs.ucl.ac.uk/projects/2014/super4PCS/.
46 | 
47 | #ifndef _SUPER4PCS_ACCELERATORS_BBOX_H
48 | #define _SUPER4PCS_ACCELERATORS_BBOX_H
49 | 
50 | #include "super4pcs/utils/disablewarnings.h"
51 | #include 
52 | #include 
53 | 
54 | namespace GlobalRegistration{
55 | 
56 | template 
57 | class AABB : public Eigen::AlignedBox<_Scalar, _Dim>
58 | {
59 | public:
60 |     using Base = Eigen::AlignedBox<_Scalar, _Dim>;
61 |     using Scalar = typename Base::Scalar;
62 |     static constexpr int Dim = _Dim;
63 | 
64 |     using VectorType = Eigen::Matrix;
65 | 
66 |     using Base::extend;
67 | 
68 |     EIGEN_MAKE_ALIGNED_OPERATOR_NEW
69 | 
70 |     AABB(Scalar min =  std::numeric_limits::max() / 2,
71 |          Scalar max = -std::numeric_limits::max() / 2)
72 |       : Base(VectorType::Constant(min), VectorType::Constant(max)) {}
73 | 
74 |     template 
75 |     inline void extend(InputIt first, InputIt last)
76 |     { std::for_each(first, last,
77 |         std::bind1st(std::mem_fun(&Base::extend), this)); }
78 | 
79 | }; // class AABB
80 | 
81 | template 
82 | using AABB3D = AABB< _Scalar, 3 >;
83 | 
84 | } // namespace Super4PCS
85 | 
86 | #endif // BBOX_H
87 | 
88 | 
89 | 
90 | 
91 | 


--------------------------------------------------------------------------------
/src/super4pcs/accelerators/pairExtraction/bruteForceFunctor.h:
--------------------------------------------------------------------------------
  1 | // Copyright 2014 Nicolas Mellado
  2 | //
  3 | // Licensed under the Apache License, Version 2.0 (the "License");
  4 | // you may not use this file except in compliance with the License.
  5 | // You may obtain a copy of the License at
  6 | //
  7 | //   http://www.apache.org/licenses/LICENSE-2.0
  8 | //
  9 | // Unless required by applicable law or agreed to in writing, software
 10 | // distributed under the License is distributed on an "AS IS" BASIS,
 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12 | // See the License for the specific language governing permissions and
 13 | // limitations under the License.
 14 | //
 15 | // -------------------------------------------------------------------------- //
 16 | //
 17 | // Authors: Nicolas Mellado
 18 | //
 19 | // An implementation of the Super 4-points Congruent Sets (Super 4PCS)
 20 | // algorithm presented in:
 21 | //
 22 | // Super 4PCS: Fast Global Pointcloud Registration via Smart Indexing
 23 | // Nicolas Mellado, Dror Aiger, Niloy J. Mitra
 24 | // Symposium on Geometry Processing 2014.
 25 | //
 26 | // Data acquisition in large-scale scenes regularly involves accumulating
 27 | // information across multiple scans. A common approach is to locally align scan
 28 | // pairs using Iterative Closest Point (ICP) algorithm (or its variants), but
 29 | // requires static scenes and small motion between scan pairs. This prevents
 30 | // accumulating data across multiple scan sessions and/or different acquisition
 31 | // modalities (e.g., stereo, depth scans). Alternatively, one can use a global
 32 | // registration algorithm allowing scans to be in arbitrary initial poses. The
 33 | // state-of-the-art global registration algorithm, 4PCS, however has a quadratic
 34 | // time complexity in the number of data points. This vastly limits its
 35 | // applicability to acquisition of large environments. We present Super 4PCS for
 36 | // global pointcloud registration that is optimal, i.e., runs in linear time (in
 37 | // the number of data points) and is also output sensitive in the complexity of
 38 | // the alignment problem based on the (unknown) overlap across scan pairs.
 39 | // Technically, we map the algorithm as an ‘instance problem’ and solve it
 40 | // efficiently using a smart indexing data organization. The algorithm is
 41 | // simple, memory-efficient, and fast. We demonstrate that Super 4PCS results in
 42 | // significant speedup over alternative approaches and allows unstructured
 43 | // efficient acquisition of scenes at scales previously not possible. Complete
 44 | // source code and datasets are available for research use at
 45 | // http://geometry.cs.ucl.ac.uk/projects/2014/super4PCS/.
 46 | 
 47 | 
 48 | #ifndef _SUPER4PCS_ACCELERATORS_BRUTE_FORCE_FUNCTOR_H_
 49 | #define _SUPER4PCS_ACCELERATORS_BRUTE_FORCE_FUNCTOR_H_
 50 | 
 51 | #include "super4pcs/accelerators/pairExtraction/intersectionNode.h"
 52 | #include 
 53 | #include 
 54 | 
 55 | namespace GlobalRegistration{
 56 | namespace Accelerators{
 57 | namespace PairExtraction{
 58 | 
 59 | struct DummyPrimitive {};
 60 | 
 61 | //! \brief Extract pairs of points using brute force approach
 62 | /*!
 63 |  * Brute force approach used in 4PCS
 64 |  * \see
 65 |  * \todo Use Traits to allow custom parameters but similar API between variants
 66 |  */
 67 | template 
 68 | struct BruteForceFunctor{
 69 |   typedef _Point Point;
 70 |   typedef _Scalar Scalar;
 71 |   enum { dim = _dim };
 72 | 
 73 |   template  //!< Process the extracted pairs
 76 |   inline
 77 |   void
 78 |   process(
 79 |     const PrimitiveContainer & M, //!< Input point set \in [0:1]^d
 80 |     const PointContainer & Q, //!< Input point set \in [0:1]^d
 81 |     Scalar &epsilon,           //!< Intersection accuracy, refined
 82 |     unsigned int minNodeSize,  //!< Min number of points in nodes
 83 |     ProcessingFunctor& functor
 84 |   );
 85 | 
 86 | };
 87 | 
 88 | 
 89 | /*!
 90 |    \return Pairs< PointId, PrimitiveId>
 91 |  */
 92 | template 
 93 | template 
 96 | void
 97 | BruteForceFunctor::process(
 98 |         const PrimitiveContainer & M, //!< Input point set \in [0:1]^d
 99 |         const PointContainer & Q, //!< Input point set \in [0:1]^d
100 |         Scalar &epsilon,           //!< Intersection accuracy, refined
101 |         unsigned int /*minNodeSize*/,  //!< Min number of points in nodes
102 |         ProcessingFunctor& functor
103 |     )
104 | {
105 | 
106 |   const unsigned int sizeM = M.size();
107 |   const unsigned int sizeQ = Q.size();
108 |   for (unsigned int j = 0; j != sizeQ; ++j){
109 |     functor.beginPrimitiveCollect(j);
110 |     for (unsigned int i = 0; i != sizeM; ++i){
111 |         if( M[i].intersectPoint(Q[j], epsilon ))
112 |             functor.process(i,j);
113 |     }
114 |     functor.endPrimitiveCollect(j);
115 |   }
116 | }
117 | 
118 | } // namespace PairExtraction
119 | } // namespace Accelerators
120 | } // namespace Super4PCS
121 | 
122 | #endif // _BRUTE_FORCE_FUNCTOR_H_
123 | 
124 | 


--------------------------------------------------------------------------------
/src/super4pcs/algorithms/CMakeLists.txt:
--------------------------------------------------------------------------------
 1 | project (Super4PCS-AlgoLib)
 2 | 
 3 | set(algo_ROOT "${SRC_DIR}/super4pcs/algorithms")
 4 | 
 5 | file(GLOB_RECURSE algo_sources ${algo_ROOT}/*.cc)
 6 | file(GLOB_RECURSE algo_headers ${algo_ROOT}/*.h ${algo_ROOT}/*.hpp)
 7 | 
 8 | add_library(super4pcs_algo ${algo_headers} ${algo_sources})
 9 | # we need that since super4pcs_accel is an header only library
10 | if(SUPER4PCS_USE_CHEALPIX)
11 |     target_link_libraries(super4pcs_algo ${Chealpix_LIBS} )
12 | endif(SUPER4PCS_USE_CHEALPIX)
13 | target_link_libraries(super4pcs_algo super4pcs_io super4pcs_accel)
14 | 
15 | set(targets_export_name "${PROJECT_NAME}Targets")
16 | install( TARGETS super4pcs_algo
17 |     EXPORT "${targets_export_name}"
18 |     RUNTIME DESTINATION bin
19 |     LIBRARY DESTINATION lib
20 |     ARCHIVE DESTINATION lib
21 |     INCLUDES DESTINATION include  )
22 | 


--------------------------------------------------------------------------------
/src/super4pcs/io/CMakeLists.txt:
--------------------------------------------------------------------------------
 1 | project (Super4PCS-IOLib)
 2 | 
 3 | set(io_ROOT "${SRC_DIR}/super4pcs/io")
 4 | 
 5 | file(GLOB_RECURSE io_sources ${io_ROOT}/*.cc)
 6 | file(GLOB_RECURSE io_headers ${io_ROOT}/*.h ${io_ROOT}/*.hpp)
 7 | 
 8 | add_library(super4pcs_io ${io_sources} ${io_headers})
 9 | 
10 | if(IO_USE_OPENCV)
11 |     find_package( OpenCV REQUIRED)
12 |     if (OpenCV_FOUND)
13 |         message(STATUS "[Deps] Use OpenCV ${OpenCV_VERSION} for image loading")
14 |         add_definitions(-DUSE_OPENCV)
15 |         include_directories( ${OpenCV_INCLUDE_DIRS} )
16 |         target_link_libraries(super4pcs_io ${OpenCV_LIBS} )
17 |     else ()
18 |         message(STATUS "[Deps] OpenCV not found")
19 |     endif (OpenCV_FOUND)
20 | endif(IO_USE_OPENCV)
21 | 
22 | set(targets_export_name "${PROJECT_NAME}Targets")
23 | install( TARGETS super4pcs_io
24 |     EXPORT "${targets_export_name}"
25 |     RUNTIME DESTINATION bin
26 |     LIBRARY DESTINATION lib
27 |     ARCHIVE DESTINATION lib
28 |     INCLUDES DESTINATION include  )
29 | 


--------------------------------------------------------------------------------
/src/super4pcs/io/io.h:
--------------------------------------------------------------------------------
  1 | #ifndef _SUPER4PCS_IO_IO_H
  2 | #define _SUPER4PCS_IO_IO_H
  3 | 
  4 | #include "super4pcs/shared4pcs.h"
  5 | #include "super4pcs/utils/disablewarnings.h"
  6 | 
  7 | #include 
  8 | #include 
  9 | #include 
 10 | 
 11 | #include 
 12 | 
 13 | #ifndef _MSC_VER
 14 | #include 
 15 | #include 
 16 | #endif
 17 | #include 
 18 | 
 19 | 
 20 | struct tripple {
 21 |   int a;
 22 |   int b;
 23 |   int c;
 24 |   int n1;
 25 |   int n2;
 26 |   int n3;
 27 |   int t1;
 28 |   int t2;
 29 |   int t3;
 30 |   tripple() {}
 31 |   tripple(int _a, int _b, int _c) : a(_a), b(_b), c(_c) {}
 32 | };
 33 | 
 34 | class IOManager{
 35 | public:
 36 |   enum MATRIX_MODE {
 37 |       POLYWORKS //! <\brief Matrix file to be loaded and applied to polyworks layers
 38 |   };
 39 | 
 40 | public:
 41 |   // Obj read/write simple functions.
 42 |   bool ReadObject(const char *name,
 43 |                   std::vector &v,
 44 |                   std::vector &tex_coords,
 45 |                   std::vector &normals,
 46 |                   std::vector &tris,
 47 |                   std::vector &mtls);
 48 |   bool WriteObject(const char *name,
 49 |                    const std::vector &v,
 50 |                    const std::vector &tex_coords,
 51 |                    const std::vector &normals,
 52 |                    const std::vector &tris,
 53 |                    const std::vector &mtls);
 54 | 
 55 |   bool WriteMatrix(const std::string& name,
 56 |                    const Eigen::Ref >& mat,
 57 |                    MATRIX_MODE mode);
 58 | private:
 59 |   bool
 60 |   ReadPly(const char *name,
 61 |           std::vector &v,
 62 |           std::vector &normals);
 63 | 
 64 |   /*!
 65 |    * \brief ReadPtx
 66 |    * \param name
 67 |    * \param v
 68 |    * \return
 69 |    *
 70 |    * \note Transformations declared in file are ignored
 71 |    *
 72 |    * Implementation inspired by
 73 |    *            http://github.com/adasta/pcl_io_extra/blob/master/src/ptx_io.cpp
 74 |    */
 75 |   bool
 76 |   ReadPtx(const char *name,
 77 |           std::vector &v);
 78 | 
 79 |   bool
 80 |   ReadObj(const char *name,
 81 |           std::vector &v,
 82 |           std::vector &tex_coords,
 83 |           std::vector &normals,
 84 |           std::vector &tris,
 85 |           std::vector &mtls);
 86 | 
 87 |   bool
 88 |   WritePly(std::string name,
 89 |            const std::vector &v,
 90 |            const std::vector &normals);
 91 | 
 92 |   bool
 93 |   WriteObj(std::string name,
 94 |            const std::vector &v,
 95 |            const std::vector &tex_coords,
 96 |            const std::vector &normals,
 97 |            const std::vector &tris, const std::vector &mtls);
 98 | 
 99 | 
100 |   /*!
101 |    * \brief formatPolyworksMatrix Format 4x4 matrice so it can be loaded by polyworks
102 |    * \param mat
103 |    * \param sstr
104 |    * \return
105 |    */
106 |   std::ofstream &
107 |   formatPolyworksMatrix(const Eigen::Ref >& mat,
108 |                         std::ofstream &sstr);
109 | }; // class IOMananger
110 | 
111 | #endif // IO_H
112 | 


--------------------------------------------------------------------------------
/src/super4pcs/sampling.h:
--------------------------------------------------------------------------------
  1 | // Copyright 2017 Nicolas Mellado
  2 | //
  3 | // Licensed under the Apache License, Version 2.0 (the "License");
  4 | // you may not use this file except in compliance with the License.
  5 | // You may obtain a copy of the License at
  6 | //
  7 | //   http://www.apache.org/licenses/LICENSE-2.0
  8 | //
  9 | // Unless required by applicable law or agreed to in writing, software
 10 | // distributed under the License is distributed on an "AS IS" BASIS,
 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12 | // See the License for the specific language governing permissions and
 13 | // limitations under the License.
 14 | //
 15 | // -------------------------------------------------------------------------- //
 16 | //
 17 | // Authors: Nicolas Mellado, Dror Aiger
 18 | //
 19 | // An implementation of the Super 4-points Congruent Sets (Super 4PCS)
 20 | // algorithm presented in:
 21 | //
 22 | // Super 4PCS: Fast Global Pointcloud Registration via Smart Indexing
 23 | // Nicolas Mellado, Dror Aiger, Niloy J. Mitra
 24 | // Symposium on Geometry Processing 2014.
 25 | //
 26 | // Data acquisition in large-scale scenes regularly involves accumulating
 27 | // information across multiple scans. A common approach is to locally align scan
 28 | // pairs using Iterative Closest Point (ICP) algorithm (or its variants), but
 29 | // requires static scenes and small motion between scan pairs. This prevents
 30 | // accumulating data across multiple scan sessions and/or different acquisition
 31 | // modalities (e.g., stereo, depth scans). Alternatively, one can use a global
 32 | // registration algorithm allowing scans to be in arbitrary initial poses. The
 33 | // state-of-the-art global registration algorithm, 4PCS, however has a quadratic
 34 | // time complexity in the number of data points. This vastly limits its
 35 | // applicability to acquisition of large environments. We present Super 4PCS for
 36 | // global pointcloud registration that is optimal, i.e., runs in linear time (in
 37 | // the number of data points) and is also output sensitive in the complexity of
 38 | // the alignment problem based on the (unknown) overlap across scan pairs.
 39 | // Technically, we map the algorithm as an 'instance problem' and solve it
 40 | // efficiently using a smart indexing data organization. The algorithm is
 41 | // simple, memory-efficient, and fast. We demonstrate that Super 4PCS results in
 42 | // significant speedup over alternative approaches and allows unstructured
 43 | // efficient acquisition of scenes at scales previously not possible. Complete
 44 | // source code and datasets are available for research use at
 45 | // http://geometry.cs.ucl.ac.uk/projects/2014/super4PCS/.
 46 | 
 47 | #ifndef _PCS_UTILS_H_
 48 | #define _PCS_UTILS_H_
 49 | 
 50 | #include 
 51 | #include 
 52 | #include "super4pcs/shared4pcs.h"
 53 | 
 54 | 
 55 | namespace GlobalRegistration {
 56 | namespace Sampling {
 57 | 
 58 | 
 59 | struct UniformDistSampler{
 60 | private:
 61 |     template 
 62 |     class HashTable {
 63 |     public:
 64 |         using Scalar = _Scalar;
 65 | 
 66 |     private:
 67 |         const uint64_t MAGIC1 = 100000007;
 68 |         const uint64_t MAGIC2 = 161803409;
 69 |         const uint64_t MAGIC3 = 423606823;
 70 |         const uint64_t NO_DATA = 0xffffffffu;
 71 |         Scalar voxel_;
 72 |         Scalar scale_;
 73 |         using VoxelType = std::array;
 74 |         std::vector voxels_;
 75 |         std::vector data_;
 76 | 
 77 |     public:
 78 |         HashTable(int maxpoints, Scalar voxel) : voxel_(voxel), scale_(1.0f / voxel) {
 79 |             uint64_t n = maxpoints;
 80 |             voxels_.resize(n);
 81 |             data_.resize(n, NO_DATA);
 82 |         }
 83 |         template 
 84 |         uint64_t& operator[](const Point& p) {
 85 |             // TODO: use eigen power here.
 86 |             VoxelType c {int(floor(p.x() * scale_)),
 87 |                          int(floor(p.y() * scale_)),
 88 |                          int(floor(p.z() * scale_))};
 89 | 
 90 |             uint64_t key = (MAGIC1 * c[0] + MAGIC2 * c[1] + MAGIC3 * c[2]) % data_.size();
 91 |             while (1) {
 92 |                 if (data_[key] == NO_DATA) {
 93 |                     voxels_[key] = c;
 94 |                     break;
 95 |                 } else if (voxels_[key] == c) {
 96 |                     break;
 97 |                 }
 98 |                 key++;
 99 |                 if (key == data_.size()) key = 0;
100 |             }
101 |             return data_[key];
102 |         }
103 |     };
104 | public:
105 |     template 
106 |     inline
107 |     void operator() (const std::vector& inputset,
108 |                      const Match4PCSOptions& options,
109 |                      std::vector& output) const {
110 |       int num_input = inputset.size();
111 |       output.clear();
112 |       HashTable hash(num_input, options.delta);
113 |       for (int i = 0; i < num_input; i++) {
114 |         uint64_t& ind = hash[inputset[i]];
115 |         if (ind >= num_input) {
116 |           output.push_back(inputset[i]);
117 |           ind = output.size();
118 |         }
119 |       }
120 |     }
121 | };
122 | 
123 | 
124 | } // namespace Sampling
125 | } // namespace Super4PCS
126 | 
127 | 
128 | #endif
129 | 


--------------------------------------------------------------------------------
/src/super4pcs/utils/CMakeLists.txt:
--------------------------------------------------------------------------------
 1 | project (Super4PCS-utilsLib)
 2 | 
 3 | set(utils_ROOT "${SRC_DIR}/super4pcs/utils")
 4 | 
 5 | #############################################
 6 | 
 7 | set(utils_INCLUDE
 8 |     ${utils_ROOT}/timer.h
 9 |     ${utils_ROOT}/geometry.h
10 |     ${utils_ROOT}/disablewarnings.h
11 |     ${utils_ROOT}/logger.h)
12 | 
13 | 
14 | if(CMAKE_VERSION VERSION_GREATER 3.1)
15 |     # use library target, to make accessible to test routines
16 |     add_library(super4pcs_utils INTERFACE)
17 |     target_sources(super4pcs_utils INTERFACE ${utils_INCLUDE})
18 |     #
19 |     # HACK: have the files showing in the IDE, under the name 'super4pcs_utils_IDE'
20 |     # Source: https://stackoverflow.com/questions/27039019/how-to-have-cmake-show-headers-that-are-not-part-of-any-binary-target-in-the-ide/29214327#29214327
21 |     #
22 |     add_custom_target(super4pcs_utils_IDE SOURCES ${utils_INCLUDE})
23 | else ()
24 |     add_library(super4pcs_utils STATIC ${utils_INCLUDE})
25 |     set_target_properties(super4pcs_utils PROPERTIES LINKER_LANGUAGE CXX)
26 | endif(CMAKE_VERSION VERSION_GREATER 3.1)
27 | 
28 | 


--------------------------------------------------------------------------------
/src/super4pcs/utils/disablewarnings.h:
--------------------------------------------------------------------------------
 1 | // Copyright 2016 Nicolas Mellado
 2 | //
 3 | // Licensed under the Apache License, Version 2.0 (the "License");
 4 | // you may not use this file except in compliance with the License.
 5 | // You may obtain a copy of the License at
 6 | //
 7 | //   http://www.apache.org/licenses/LICENSE-2.0
 8 | //
 9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 | //
15 | // -------------------------------------------------------------------------- //
16 | //
17 | // Authors: Nicolas Mellado
18 | //
19 | // An implementation of the 4-points Congruent Sets (4PCS) algorithm presented
20 | // in:
21 | //
22 | // 4-points Congruent Sets for Robust Surface Registration
23 | // Dror Aiger, Niloy J. Mitra, Daniel Cohen-Or
24 | // ACM SIGGRAPH 2008 and ACM Transaction of Graphics.
25 | //
26 | // Given two sets of points in 3-space, P and Q, the algorithm applies RANSAC
27 | // in roughly O(n^2) time instead of O(n^3) for standard RANSAC, using an
28 | // efficient method based on invariants, to find the set of all 4-points in Q
29 | // that can be matched by rigid transformation to a given set of 4-points in P
30 | // called a base. This avoids the need to examine all sets of 3-points in Q
31 | // against any base of 3-points in P as in standard RANSAC.
32 | // The algorithm can use colors and normals to speed-up the matching
33 | // and to improve the quality. It can be easily extended to affine/similarity
34 | // transformation but then the speed-up is smaller because of the large number
35 | // of congruent sets. The algorithm can also limit the range of transformations
36 | // when the application knows something on the initial pose but this is not
37 | // necessary in general (though can speed the runtime significantly).
38 | 
39 | #ifndef _SUPER4PCS_UTILS_DISABLE_WIN_H_
40 | #define _SUPER4PCS_UTILS_DISABLE_WIN_H_
41 | 
42 | #   ifdef _MSC_VER
43 |         // disable warnings:
44 |         // C4244: conversion from 'double' to 'float'
45 |         // C4267: conversion from 'size_t' to 'int'
46 |         // C4305: truncation from 'double' to 'float'
47 | #       pragma warning ( disable : 4244 4267 4305 )
48 | #   endif
49 | 
50 | #endif // _SUPER4PCS_UTILS_DISABLE_WIN_H_


--------------------------------------------------------------------------------
/src/super4pcs/utils/geometry.h:
--------------------------------------------------------------------------------
 1 | // Copyright 2017 Nicolas Mellado
 2 | //
 3 | // Licensed under the Apache License, Version 2.0 (the "License");
 4 | // you may not use this file except in compliance with the License.
 5 | // You may obtain a copy of the License at
 6 | //
 7 | //   http://www.apache.org/licenses/LICENSE-2.0
 8 | //
 9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 | //
15 | // -------------------------------------------------------------------------- //
16 | //
17 | // Authors: Nicolas Mellado
18 | //
19 | // An implementation of the Super 4-points Congruent Sets (Super 4PCS)
20 | // algorithm presented in:
21 | //
22 | // Super 4PCS: Fast Global Pointcloud Registration via Smart Indexing
23 | // Nicolas Mellado, Dror Aiger, Niloy J. Mitra
24 | // Symposium on Geometry Processing 2014.
25 | //
26 | // Data acquisition in large-scale scenes regularly involves accumulating
27 | // information across multiple scans. A common approach is to locally align scan
28 | // pairs using Iterative Closest Point (ICP) algorithm (or its variants), but
29 | // requires static scenes and small motion between scan pairs. This prevents
30 | // accumulating data across multiple scan sessions and/or different acquisition
31 | // modalities (e.g., stereo, depth scans). Alternatively, one can use a global
32 | // registration algorithm allowing scans to be in arbitrary initial poses. The
33 | // state-of-the-art global registration algorithm, 4PCS, however has a quadratic
34 | // time complexity in the number of data points. This vastly limits its
35 | // applicability to acquisition of large environments. We present Super 4PCS for
36 | // global pointcloud registration that is optimal, i.e., runs in linear time (in
37 | // the number of data points) and is also output sensitive in the complexity of
38 | // the alignment problem based on the (unknown) overlap across scan pairs.
39 | // Technically, we map the algorithm as an 'instance problem' and solve it
40 | // efficiently using a smart indexing data organization. The algorithm is
41 | // simple, memory-efficient, and fast. We demonstrate that Super 4PCS results in
42 | // significant speedup over alternative approaches and allows unstructured
43 | // efficient acquisition of scenes at scales previously not possible. Complete
44 | // source code and datasets are available for research use at
45 | // http://geometry.cs.ucl.ac.uk/projects/2014/super4PCS/.
46 | 
47 | #ifndef _SUPER4PCS_UTILS_GEOMETRY_H_
48 | #define _SUPER4PCS_UTILS_GEOMETRY_H_
49 | 
50 | #include "super4pcs/utils/disablewarnings.h"
51 | 
52 | namespace GlobalRegistration{
53 | namespace Utils{
54 | 
55 | 
56 | template 
57 | static inline void CleanInvalidNormals( PointContainer &v,
58 |                                         VecContainer &normals){
59 |   using Point = typename PointContainer::value_type;
60 |   using Vector = typename VecContainer::value_type;
61 |   if (v.size() == normals.size()){
62 |     typename PointContainer::iterator itV = v.begin();
63 |     typename VecContainer::iterator itN = normals.begin();
64 | 
65 |     unsigned int nb = 0;
66 |     for( ; itV != v.end(); itV++, itN++){
67 | 
68 |       if ((*itV).normal().squaredNorm() < 0.01){
69 |         (*itN) = {0., 0., 0.};
70 |         (*itV).set_normal({0., 0., 0.});
71 |         nb++;
72 |       }else{
73 |         (*itN).normalize();
74 |         (*itV).normalize();
75 |       }
76 |     }
77 | 
78 |     if (nb != 0){
79 |       std::cout << "Found " << nb << " vertices with invalid normals" << std::endl;
80 |     }
81 |   }
82 | }
83 | 
84 | } // namespace Utils
85 | } // namespace Super4PCS
86 | 
87 | #endif // _UTILS_GEOMETRY_H_
88 | 


--------------------------------------------------------------------------------
/src/super4pcs/utils/logger.h:
--------------------------------------------------------------------------------
  1 | // Copyright 2014 Nicolas Mellado
  2 | //
  3 | // Licensed under the Apache License, Version 2.0 (the "License");
  4 | // you may not use this file except in compliance with the License.
  5 | // You may obtain a copy of the License at
  6 | //
  7 | //   http://www.apache.org/licenses/LICENSE-2.0
  8 | //
  9 | // Unless required by applicable law or agreed to in writing, software
 10 | // distributed under the License is distributed on an "AS IS" BASIS,
 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12 | // See the License for the specific language governing permissions and
 13 | // limitations under the License.
 14 | //
 15 | // -------------------------------------------------------------------------- //
 16 | //
 17 | // Authors: Nicolas Mellado
 18 | //
 19 | // An implementation of the Super 4-points Congruent Sets (Super 4PCS)
 20 | // algorithm presented in:
 21 | //
 22 | // Super 4PCS: Fast Global Pointcloud Registration via Smart Indexing
 23 | // Nicolas Mellado, Dror Aiger, Niloy J. Mitra
 24 | // Symposium on Geometry Processing 2014.
 25 | //
 26 | // Data acquisition in large-scale scenes regularly involves accumulating
 27 | // information across multiple scans. A common approach is to locally align scan
 28 | // pairs using Iterative Closest Point (ICP) algorithm (or its variants), but
 29 | // requires static scenes and small motion between scan pairs. This prevents
 30 | // accumulating data across multiple scan sessions and/or different acquisition
 31 | // modalities (e.g., stereo, depth scans). Alternatively, one can use a global
 32 | // registration algorithm allowing scans to be in arbitrary initial poses. The
 33 | // state-of-the-art global registration algorithm, 4PCS, however has a quadratic
 34 | // time complexity in the number of data points. This vastly limits its
 35 | // applicability to acquisition of large environments. We present Super 4PCS for
 36 | // global pointcloud registration that is optimal, i.e., runs in linear time (in
 37 | // the number of data points) and is also output sensitive in the complexity of
 38 | // the alignment problem based on the (unknown) overlap across scan pairs.
 39 | // Technically, we map the algorithm as an 'instance problem' and solve it
 40 | // efficiently using a smart indexing data organization. The algorithm is
 41 | // simple, memory-efficient, and fast. We demonstrate that Super 4PCS results in
 42 | // significant speedup over alternative approaches and allows unstructured
 43 | // efficient acquisition of scenes at scales previously not possible. Complete
 44 | // source code and datasets are available for research use at
 45 | // http://geometry.cs.ucl.ac.uk/projects/2014/super4PCS/.
 46 | 
 47 | #ifndef _SUPER4PCS_UTILS_LOGGER_H
 48 | #define _SUPER4PCS_UTILS_LOGGER_H
 49 | 
 50 | #include 
 51 | 
 52 | namespace GlobalRegistration{
 53 | namespace Utils{
 54 | 
 55 | enum LogLevel {
 56 |     NoLog       = 0,
 57 |     ErrorReport = 1,
 58 |     Verbose     = 2
 59 | };
 60 | 
 61 | 
 62 | class Logger {
 63 | private:
 64 |     LogLevel logLevel_;
 65 | 
 66 | 
 67 | public:
 68 |     inline Logger(LogLevel loglevel = Verbose) : logLevel_(loglevel) {}
 69 | 
 70 |     inline void setLogLevel(LogLevel loglevel) { logLevel_ = loglevel; }
 71 |     inline LogLevel logLevel() const { return logLevel_; }
 72 | 
 73 |     template 
 74 |     inline void Log(const Args&...args) const{
 75 |         switch(logLevel_) {
 76 |         case NoLog:
 77 |             LOG(args...);
 78 |             break;
 79 |         case ErrorReport:
 80 |             LOG(args...);
 81 |             break;
 82 |         case Verbose:
 83 |             LOG(args...);
 84 |             break;
 85 |         default:
 86 |             break;
 87 |         }
 88 |     }
 89 | 
 90 | protected:
 91 |     static inline void print_err_impl(){
 92 |         std::cerr << std::endl;
 93 |     }
 94 | 
 95 |     template
 96 |     static inline void print_err_impl(const First& param1, const Rest&...param){
 97 |         std::cerr << param1;
 98 |         print_err_impl(param...);
 99 |     }
100 |     static inline void print_msg_impl(){
101 |         std::cout << std::endl;
102 |     }
103 | 
104 |     template
105 |     static inline void print_msg_impl(const First& param1, const Rest&...param){
106 |         std::cout << param1;
107 |         print_msg_impl(param...);
108 |     }
109 | 
110 |     template
111 |     static inline void LOG( const Args&...args) {
112 |         if(msgLevel >= appLevel){
113 |             if (msgLevel == ErrorReport)
114 |                 print_err_impl(args...);
115 |             else
116 |                 print_msg_impl(args...);
117 |         }
118 |     }
119 | }; // class Logger
120 | } // namespace Utils
121 | } // namespace Super4PCS
122 | 
123 | 
124 | #endif // LOGGER_H
125 | 


--------------------------------------------------------------------------------
/src/super4pcs/utils/timer.h:
--------------------------------------------------------------------------------
 1 | // Copyright 2014 Nicolas Mellado
 2 | //
 3 | // Licensed under the Apache License, Version 2.0 (the "License");
 4 | // you may not use this file except in compliance with the License.
 5 | // You may obtain a copy of the License at
 6 | //
 7 | //   http://www.apache.org/licenses/LICENSE-2.0
 8 | //
 9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 | //
15 | // -------------------------------------------------------------------------- //
16 | //
17 | // Authors: Nicolas Mellado, Dror Aiger
18 | //
19 | // An implementation of the Super 4-points Congruent Sets (Super 4PCS)
20 | // algorithm presented in:
21 | //
22 | // Super 4PCS: Fast Global Pointcloud Registration via Smart Indexing
23 | // Nicolas Mellado, Dror Aiger, Niloy J. Mitra
24 | // Symposium on Geometry Processing 2014.
25 | //
26 | // Data acquisition in large-scale scenes regularly involves accumulating
27 | // information across multiple scans. A common approach is to locally align scan
28 | // pairs using Iterative Closest Point (ICP) algorithm (or its variants), but
29 | // requires static scenes and small motion between scan pairs. This prevents
30 | // accumulating data across multiple scan sessions and/or different acquisition
31 | // modalities (e.g., stereo, depth scans). Alternatively, one can use a global
32 | // registration algorithm allowing scans to be in arbitrary initial poses. The
33 | // state-of-the-art global registration algorithm, 4PCS, however has a quadratic
34 | // time complexity in the number of data points. This vastly limits its
35 | // applicability to acquisition of large environments. We present Super 4PCS for
36 | // global pointcloud registration that is optimal, i.e., runs in linear time (in
37 | // the number of data points) and is also output sensitive in the complexity of
38 | // the alignment problem based on the (unknown) overlap across scan pairs.
39 | // Technically, we map the algorithm as an 'instance problem' and solve it
40 | // efficiently using a smart indexing data organization. The algorithm is
41 | // simple, memory-efficient, and fast. We demonstrate that Super 4PCS results in
42 | // significant speedup over alternative approaches and allows unstructured
43 | // efficient acquisition of scenes at scales previously not possible. Complete
44 | // source code and datasets are available for research use at
45 | // http://geometry.cs.ucl.ac.uk/projects/2014/super4PCS/.
46 | 
47 | #ifndef _SUPER4PCS_UTILS_TIMER_H_
48 | #define _SUPER4PCS_UTILS_TIMER_H_
49 | 
50 | #include   //timers
51 | #include "super4pcs/utils/disablewarnings.h"
52 | 
53 | namespace GlobalRegistration{
54 | namespace Utils{
55 | 
56 | class Timer {
57 | public:
58 |     typedef std::chrono::high_resolution_clock clock;
59 |     typedef std::chrono::nanoseconds timestep;
60 | 
61 |     explicit inline Timer(bool run = false)
62 |     {
63 |         if (run) reset();
64 |     }
65 |     void reset()
66 |     {
67 |         _start = clock::now();
68 |     }
69 |     inline timestep elapsed() const
70 |     {
71 |         return std::chrono::duration_cast(clock::now() - _start);
72 |     }
73 |     template 
74 |     friend std::basic_ostream& operator<<(std::basic_ostream& out, const Timer& timer)
75 |     {
76 |         return out << timer.elapsed().count();
77 |     }
78 | private:
79 |     clock::time_point _start;
80 | };
81 | 
82 | } // namespace Utils
83 | } // namespace Super4PCS
84 | 
85 | #endif // _TIMER_H_
86 | 


--------------------------------------------------------------------------------
/tests/CMakeLists.txt:
--------------------------------------------------------------------------------
  1 | project (Super4PCS-Tests)
  2 | 
  3 | set(CMAKE_INCLUDE_CURRENT_DIR ON)
  4 | 
  5 | include_directories(${SRC_DIR})
  6 | 
  7 | #############################################
  8 | ## start by downloading standford datasets, that will be used
  9 | ## to test the approach
 10 | include(ExternalProject)
 11 | ExternalProject_Add(dataset-standford-armadillo
 12 |     SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/datasets/armadillo
 13 |     URL http://graphics.stanford.edu/pub/3Dscanrep/armadillo/Armadillo_scans.tar.gz
 14 |     URL_MD5 437eafa8d3d07067e17a42c727a0c28d
 15 |     CONFIGURE_COMMAND ""
 16 |     BUILD_COMMAND ""
 17 |     INSTALL_COMMAND ""
 18 | )
 19 | ExternalProject_Add(dataset-standford-bunny
 20 |     SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/datasets/bunny
 21 |     URL http://graphics.stanford.edu/pub/3Dscanrep/bunny.tar.gz
 22 |     URL_MD5 232bb90cac5f2ac77140e09a59bcffe4
 23 |     CONFIGURE_COMMAND ""
 24 |     BUILD_COMMAND ""
 25 |     INSTALL_COMMAND ""
 26 | )
 27 | 
 28 | #############################################
 29 | ## testing files
 30 | set (testing_SRCS
 31 |     testing.h
 32 | )
 33 | 
 34 | #############################################
 35 | ## externalAppTestD
 36 | 
 37 | include(ExternalProject)
 38 | ExternalProject_Add(
 39 |         externalAppTestTarget
 40 |         # where the source will live
 41 |         SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/externalAppTest"
 42 | 
 43 |         CMAKE_ARGS
 44 |             -DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_BINARY_DIR}
 45 |             -DCMAKE_MODULE_PATH=${CMAKE_MODULE_PATH}
 46 |             -DCMAKE_PREFIX_PATH=${CMAKE_INSTALL_PREFIX}/lib/cmake
 47 |             -DCMAKE_INSTALL_RPATH=${CMAKE_INSTALL_PREFIX}/lib
 48 |             -DEIGEN3_INCLUDE_DIR=${EIGEN3_INCLUDE_DIR}
 49 |             -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
 50 | 
 51 |         # override default behaviours
 52 |         UPDATE_COMMAND ""
 53 |         EXCLUDE_FROM_ALL
 54 | )
 55 | 
 56 | add_dependencies(externalAppTestTarget ForceSuper4PCSInstallation)
 57 | add_dependencies(buildtests externalAppTestTarget)
 58 | add_test(NAME externalAppTest
 59 |          COMMAND Super4PCS-externalAppTest)
 60 | 
 61 | #############################################
 62 | ## pair extraction
 63 | set(pair_extraction_SRCS
 64 |     pair_extraction.cc
 65 | )
 66 | add_executable(pair_extraction ${pair_extraction_SRCS} ${testing_SRCS})
 67 | add_dependencies(buildtests pair_extraction)
 68 | add_test(NAME pair_extraction
 69 |          #CONFIGURATIONS Release
 70 |          COMMAND pair_extraction)
 71 | target_link_libraries(pair_extraction super4pcs_accel super4pcs_algo super4pcs_utils)
 72 | if(SUPER4PCS_USE_CHEALPIX)
 73 |     target_link_libraries(pair_extraction ${Chealpix_LIBS} )
 74 | endif(SUPER4PCS_USE_CHEALPIX)
 75 | 
 76 | #############################################
 77 | ## quad extraction
 78 | #set(quad_extraction_SRCS
 79 | #    quad_extraction.cc
 80 | #)
 81 | #add_executable(quad_extraction ${quad_extraction_SRCS} ${testing_SRCS})
 82 | #add_dependencies(buildtests quad_extraction)
 83 | #add_test(NAME quad_extraction
 84 | #         #CONFIGURATIONS Release
 85 | #         COMMAND quad_extraction)
 86 | #target_link_libraries(quad_extraction super4pcs_accel super4pcs_algo)
 87 | #if(SUPER4PCS_USE_CHEALPIX)
 88 | #    target_link_libraries(quad_extraction ${Chealpix_LIBS} )
 89 | #endif(SUPER4PCS_USE_CHEALPIX)
 90 | 
 91 | #############################################
 92 | ## matching
 93 | set(matching_SRCS
 94 |     matching.cc
 95 | )
 96 | 
 97 | find_package(Boost 1.54 COMPONENTS system filesystem QUIET)
 98 | if (Boost_FOUND)
 99 |     include_directories(${Boost_INCLUDE_DIRS})
100 |     add_executable(matching ${matching_SRCS} ${testing_SRCS})
101 |     add_dependencies(buildtests matching)
102 |     set (matching_subtests 0 1)
103 |     foreach(subtest_id ${matching_subtests})
104 |         add_test(NAME "matching_${subtest_id}"
105 |                  #CONFIGURATIONS Release
106 |                  COMMAND matching ${subtest_id})
107 |         set_tests_properties ( "matching_${subtest_id}" PROPERTIES TIMEOUT 600) # in seconds
108 |     endforeach()
109 |     target_link_libraries(matching super4pcs_io super4pcs_accel super4pcs_algo super4pcs_utils)
110 |     target_link_libraries(matching ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY})
111 |     add_dependencies(matching dataset-standford-armadillo dataset-standford-bunny)
112 |     if(SUPER4PCS_USE_CHEALPIX)
113 |         target_link_libraries(matching ${Chealpix_LIBS} )
114 |     endif(SUPER4PCS_USE_CHEALPIX)
115 | endif (Boost_FOUND)
116 | 


--------------------------------------------------------------------------------
/tests/externalAppTest/CMakeLists.txt:
--------------------------------------------------------------------------------
 1 | project(Super4PCS-externalAppTest)
 2 | cmake_minimum_required(VERSION 3.3)
 3 | 
 4 | set (CMAKE_CXX_STANDARD 11)
 5 | 
 6 | find_package(Super4PCS REQUIRED)
 7 | include_directories(${Super4PCS_INCLUDE_DIR})
 8 | link_directories(${Super4PCS_LIB_DIR})
 9 | 
10 | add_executable(${PROJECT_NAME} main.cpp)
11 | target_link_libraries(${PROJECT_NAME} ${Super4PCS_LIBRARIES})
12 | 
13 | message (STATUS "Super4PCS_INCLUDE_DIR: ${Super4PCS_INCLUDE_DIR}")
14 | message (STATUS "Super4PCS_LIB_DIR    : ${Super4PCS_LIB_DIR}")
15 | message (STATUS "Super4PCS_LIBRARIES  : ${Super4PCS_LIBRARIES}")
16 | 
17 | 
18 | # we also need eigen
19 | find_package( Eigen3 REQUIRED )
20 | include_directories( ${EIGEN3_INCLUDE_DIR} )
21 | 
22 | install( TARGETS ${PROJECT_NAME} RUNTIME DESTINATION .  )
23 | 
24 | 


--------------------------------------------------------------------------------
/tests/externalAppTest/cmake_call:
--------------------------------------------------------------------------------
1 | cmake ../ -DCMAKE_MODULE_PATH=/home/nmellado/git/Super4PCS/cmake/ -DCMAKE_PREFIX_PATH=/home/nmellado/git/Super4PCS/build/install/lib/cmake/ -DEIGEN3_INCLUDE_DIR=/home/nmellado/mercurial/eigen/ -DCMAKE_BUILD_TYPE=Debug
2 | 


--------------------------------------------------------------------------------
/tests/externalAppTest/main.cpp:
--------------------------------------------------------------------------------
 1 | #include "super4pcs/algorithms/super4pcs.h"
 2 | #include "super4pcs/io/io.h"
 3 | #include "super4pcs/utils/geometry.h"
 4 | 
 5 | #include 
 6 | 
 7 | 
 8 | int main(int argc, char **argv) {
 9 |   using namespace GlobalRegistration;
10 |   using namespace std;
11 | 
12 |   vector set1, set2;
13 |   vector tex_coords1, tex_coords2;
14 |   vector normals1, normals2;
15 |   vector tris1, tris2;
16 |   vector mtls1, mtls2;
17 | 
18 |   IOManager iomanager;
19 | 
20 |   // dummy call, to test symbols accessibility
21 |   iomanager.ReadObject("", set1, tex_coords1, normals1, tris1, mtls1);
22 | 
23 |   // check availability of the Utils functions
24 |   if (tris1.size() == 0)
25 |     Utils::CleanInvalidNormals(set1, normals1);
26 | 
27 |   // Our matcher.
28 |   Match4PCSOptions options;
29 | 
30 |   // Set parameters.
31 |   Match4PCSBase::MatrixType mat;
32 |   double overlap (1);
33 |   options.configureOverlap(overlap);
34 | 
35 |   typename Point3D::Scalar score = 0;
36 | 
37 |   constexpr Utils::LogLevel loglvl = Utils::Verbose;
38 |   using TrVisitorType = Match4PCSBase::DummyTransformVisitor;
39 |   using SamplerType   = Match4PCSBase::DefaultSampler;
40 |   Utils::Logger logger(loglvl);
41 | 
42 |   MatchSuper4PCS matcher(options, logger);
43 |   score = matcher.ComputeTransformation(set1, &set2, mat);
44 | 
45 |   logger.Log( "Score: ", score );
46 | 
47 |   iomanager.WriteMatrix("output.map", mat.cast(), IOManager::POLYWORKS);
48 | 
49 |   return 0;
50 | }
51 | 
52 | 


--------------------------------------------------------------------------------