Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into poisson
Browse files Browse the repository at this point in the history
  • Loading branch information
abellgithub committed Jun 27, 2017
2 parents 0b58e05 + 982e413 commit 6d1aad1
Show file tree
Hide file tree
Showing 41 changed files with 1,995 additions and 365 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -35,6 +35,7 @@ install_manifest.txt
#
# visual studio cruft
#
/.vs*
Debug/
Release/
RelWithDebInfo/
Expand Down
2 changes: 2 additions & 0 deletions cmake/macros.cmake
Expand Up @@ -54,6 +54,7 @@ macro(PDAL_ADD_LIBRARY _name)
set_property(TARGET ${_name} PROPERTY FOLDER "Libraries")
target_include_directories(${_name} PRIVATE
${PDAL_INCLUDE_DIR})
PDAL_TARGET_COMPILE_SETTINGS(${_name})

install(TARGETS ${_name}
EXPORT PDALTargets
Expand All @@ -73,6 +74,7 @@ macro(PDAL_ADD_FREE_LIBRARY _name _library_type)
set_property(TARGET ${_name} PROPERTY FOLDER "Libraries")
target_include_directories(${_name} PRIVATE
${PDAL_INCLUDE_DIR})
PDAL_TARGET_COMPILE_SETTINGS(${_name})

install(TARGETS ${_name}
EXPORT PDALTargets
Expand Down
4 changes: 2 additions & 2 deletions cmake/options.cmake
Expand Up @@ -8,9 +8,9 @@ add_feature_info("Bash completion" WITH_COMPLETION
"completion for PDAL command line")

option(BUILD_PLUGIN_CPD
"Choose if Coherent Point Drift kernel is built" FALSE)
"Choose if the cpd filter should be built" FALSE)
add_feature_info("CPD plugin" BUILD_PLUGIN_CPD
"run Coherent Point Drift on two datasets")
"Coherent Point Drift (CPD) computes rigid or nonrigid transformations between point sets")

option(BUILD_PLUGIN_GEOWAVE
"Choose if GeoWave support should be built" FALSE)
Expand Down
31 changes: 20 additions & 11 deletions cmake/unix_compiler_options.cmake
@@ -1,22 +1,31 @@
set(PDAL_COMMON_CXX_FLAGS "-Wextra -Wall -Wno-unused-parameter -Wno-unused-variable -Wpointer-arith -Wcast-align -Wcast-qual -Wredundant-decls -Wno-long-long -Wno-unknown-pragmas -Wno-deprecated-declarations -isystem /usr/local/include"
)

if (${CMAKE_CXX_COMPILER_ID} MATCHES "GNU")
if (${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS 4.7)
set(CXX_STANDARD "-std=c++0x")
set(PDAL_CXX_STANDARD "-std=c++0x")
else()
set(CXX_STANDARD "-std=c++11")
endif()
if (${CMAKE_CXX_COMPILER_VERSION} VERSION_GREATER 4.6)
set(PDAL_NO_AS_NEEDED_START "-Wl,--no-as-needed")
set(PDAL_NO_AS_NEEDED_END "-Wl,--as-needed")
set(PDAL_CXX_STANDARD "-std=c++11")
endif()
set(PDAL_COMPILER_GCC 1)
elseif (${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
set(CXX_STANDARD "-std=c++11")
set(PDAL_CXX_STANDARD "-std=c++11")
set(PDAL_COMPILER_CLANG 1)
else()
message(FATAL_ERROR "Unsupported C++ compiler")
endif()

set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${PDAL_COMMON_CXX_FLAGS} ${CXX_STANDARD}")
function(PDAL_TARGET_COMPILE_SETTINGS target)
target_compile_options(${target} PUBLIC
${PDAL_CXX_STANDARD}
-Wextra
-Wall
-Wno-unused-parameter
-Wno-unused-variable
-Wpointer-arith
-Wcast-align
-Wcast-qual
-Wredundant-decls
-Wno-long-long
-Wno-unknown-pragmas
-Wno-deprecated-declarations
)
target_include_directories(${target} SYSTEM PUBLIC /usr/local/include)
endfunction()
106 changes: 53 additions & 53 deletions cmake/win32_compiler_options.cmake
Expand Up @@ -11,77 +11,77 @@ if (MSVC)
elseif (MSVC8)
set(PDAL_COMPILER_VC8 1)
endif()
endif()

add_definitions(-DBOOST_ALL_NO_LIB)
function(PDAL_TARGET_COMPILE_SETTINGS target)
target_compile_definitions(${target} PUBLIC -DWIN32_LEAN_AND_MEAN)
if (MSVC)
target_compile_definitions(${target} PUBLIC -DBOOST_ALL_NO_LIB)

# check for MSVC 8+
if (NOT (MSVC_VERSION VERSION_LESS 1400))
add_definitions(-D_CRT_SECURE_NO_DEPRECATE)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
add_definitions(-D_CRT_NONSTDC_NO_WARNING)
add_definitions(-D_SCL_SECURE_NO_WARNINGS)
add_definitions(-DNOMINMAX)
# check for MSVC 8+
if (NOT (MSVC_VERSION VERSION_LESS 1400))
target_compile_definitions(${target} PUBLIC
-D_CRT_SECURE_NO_DEPRECATE
-D_CRT_SECURE_NO_WARNINGS
-D_CRT_NONSTDC_NO_WARNING
-D_SCL_SECURE_NO_WARNINGS
-DNOMINMAX
)
target_compile_options(${target} PUBLIC
# Nitro makes use of Exception Specifications, which results in
# numerous warnings when compiling in MSVC. We will ignore them for
# now.
/wd4290
/wd4800
# Windows warns about integer narrowing like crazy and it's annoying.
# In most cases the programmer knows what they're doing. A good
# static analysis tool would be better than turning this warning off.
/wd4267
)
endif()

# check for MSVC 9+
if (NOT (MSVC_VERSION VERSION_LESS 1500))
include(ProcessorCount)
ProcessorCount(N)
if(NOT N EQUAL 0)
target_compile_options(${target} PRIVATE "/MP${N}")
endif()
endif()

# Nitro makes use of Exception Specifications, which results in
# numerous warnings when compiling in MSVC. We will ignore them for
# now.
add_definitions("/wd4290")
add_definitions("/wd4800")
option(PDAL_USE_STATIC_RUNTIME "Use the static runtime" FALSE)
if (PDAL_USE_STATIC_RUNTIME)
target_compile_options(${target} PRIVATE /MT)
endif()

# Windows warns about integer narrowing like crazy and it's annoying.
# In most cases the programmer knows what they're doing. A good
# static analysis tool would be better than turning this warning off.
add_definitions("/wd4267")
endif()
endfunction()

if (MSVC)
if (CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
string(REGEX REPLACE "/W[0-4]" "/W3"
CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W3")
endif()

# check for MSVC 9+
if (NOT (MSVC_VERSION VERSION_LESS 1500))
include(ProcessorCount)
ProcessorCount(N)
if(NOT N EQUAL 0)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /MP${N}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP${N}")
endif()
endif()

option(PDAL_USE_STATIC_RUNTIME "Use the static runtime" FALSE)
if (PDAL_USE_STATIC_RUNTIME)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MT")

# Note that the CMake cache will still show /MD
# http://www.cmake.org/Wiki/CMake_FAQ#Dynamic_Replace
foreach(flag_var
CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
if(${flag_var} MATCHES "/MD")
string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
endif(${flag_var} MATCHES "/MD")
endforeach(flag_var)
# Note that the CMake cache will still show /MD
# http://www.cmake.org/Wiki/CMake_FAQ#Dynamic_Replace
foreach(flag_var
CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
if(${flag_var} MATCHES "/MD")
string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
endif(${flag_var} MATCHES "/MD")
endforeach(flag_var)
endif()

endif(MSVC)
add_definitions(-DWIN32_LEAN_AND_MEAN)

# note we default to debug mode
#if(NOT MSVC_IDE)
# if(NOT CMAKE_BUILD_TYPE)
# set(CMAKE_BUILD_TYPE Debug CACHE STRING
# "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel" FORCE)
# endif()
# message(STATUS "Setting PDAL build type - ${CMAKE_BUILD_TYPE}")
#endif()
endif()

set(CMAKE_INCLUDE_PATH "c:/OSGeo4W64/include;$ENV{CMAKE_INCLUDE_PATH}")
set(CMAKE_LIBRARY_PATH "c:/OSGeo4W64/lib;$ENV{CMAKE_LIBRARY_PATH}")
set(CMAKE_PREFIX_PATH "c:/OSGeo4W64/cmake;$ENV{CMAKE_LIBRARY_PATH}")

#ABELL - WHY?
#ABELL (& gadomski) - WHY?
set(PDAL_PLATFORM_WIN32 1)
set(WINSOCK_LIBRARY ws2_32)
1 change: 1 addition & 0 deletions dimbuilder/CMakeLists.txt
Expand Up @@ -26,6 +26,7 @@ add_executable(dimbuilder
target_include_directories(dimbuilder PRIVATE
${PDAL_INCLUDE_DIR}
${PDAL_JSONCPP_INCLUDE_DIR})
PDAL_TARGET_COMPILE_SETTINGS(dimbuilder)
if (PDAL_HAVE_JSONCPP)
target_link_libraries(dimbuilder PRIVATE ${PDAL_JSONCPP_LIB_NAME})
endif()
Expand Down
3 changes: 2 additions & 1 deletion doc/development/goals.rst
Expand Up @@ -9,7 +9,7 @@ Project Goals
command line tools are provided. As `GDAL`_ is to 2D pixels, `OGR`_ is to
geospatial vector geometry, PDAL is to multidimensional points.

2. From a market perspective, PDAL is "version 2" of libLAS. The actual
2. From a market perspective, PDAL is "version 2" of `libLAS`_. The actual
code base will be different, however, and the APIs will not be
compatible.

Expand All @@ -30,3 +30,4 @@ Project Goals

.. _`GDAL`: http://gdal.org
.. _`OGR`: http://gdal.org/ogr/
.. _`libLAS`: https://www.liblas.org
73 changes: 73 additions & 0 deletions doc/stages/filters.cpd.rst
@@ -0,0 +1,73 @@
.. _filters.cpd:

filters.cpd
==============

The CPD filter uses the Coherent Point Drift :cite:`Myronenko` algorithm to compute a rigid, nonrigid, or affine transformation between datasets.
The rigid and affine are what you'd expect; the nonrigid transformation uses Motion Coherence Theory :cite:`Yuille1998` to "bend" the points to find a best alignment.

.. note::

CPD is computationally intensive and can be slow when working with many points (i.e. > 10 000).
Nonrigid is significatly slower than rigid and affine.

The first input to the change filter are considered the "fixed" points, and all subsequent inputs are "moving" points.
The output from the change filter are the "moving" points after the calculated transformation has been applied, one point view per input.
Any additional information about the cpd registration, e.g. the rigid transformation matrix, will be placed in the stage's metadata.

Examples
--------

.. code-block:: json
{
"pipeline": [
"fixed.las",
"moving.las",
{
"type": "filters.rigid",
"method": "rigid"
},
"output.las"
]
}
If "method" is not provided, the cpd filter will default to using the rigid registration method.
To get the transform matrix, you'll need to use the ``--metadata`` option:

::

$ pdal pipeline cpd-pipeline.json --metadata cpd-metadata.json

The metadata output might start something like:

.. code-block:: json
{
"stages":
{
"filters.cpd":
{
"iterations": 10,
"method": "rigid",
"runtime": 0.003839,
"sigma2": 5.684342128e-16,
"transform": " 1 -6.21722e-17 1.30104e-18 5.29303e-11-8.99346e-17 1 2.60209e-18 -3.49247e-10 -2.1684e-19 1.73472e-18 1 -1.53477e-12 0 0 0 1"
},
},
.. seealso::
:ref:`filters.transformation` to apply a transform to other points.
Options
--------
method
Change detection method to use.
Valid values are "rigid", "affine", and "nonrigid".
[Default: **rigid**]
.. _Coherent Point Drift (CPD): https://github.com/gadomski/cpd
.. bibliography:: references.bib
75 changes: 75 additions & 0 deletions doc/stages/filters.head.rst
@@ -0,0 +1,75 @@
.. _filters.head:

filters.head
===============================================================================

The HeadFilter returns a specified number of points from the beginning of the
PointView.

.. note::

If the requested number of points exceeds the size of the point cloud, all
points are passed with a warning.


Example #1
----------

Thin a point cloud by first shuffling the point order with
:ref:`filters.randomize` and then picking the first 10000 using the HeadFilter.


.. code-block:: json
{
"pipeline":[
{
"type":"filters.randomize"
},
{
"type":"filters.head",
"count":10000
}
]
}
Example #2
----------

Compute height above ground and extract the ten highest points.


.. code-block:: json
{
"pipeline":[
{
"type":"filters.smrf"
},
{
"type":"filters.hag"
},
{
"type":"filters.sort",
"dimension":"HeightAboveGround",
"order":"DESC"
},
{
"type":"filters.head",
"count":10
}
]
}
.. seealso::

:ref:`filters.tail` is the dual to :ref:`filters.head`.


Options
-------------------------------------------------------------------------------

count
Number of points to return. [Default: **10**]

0 comments on commit 6d1aad1

Please sign in to comment.