Skip to content

Commit

Permalink
Initial reorg against track_oracle import into kwiver.
Browse files Browse the repository at this point in the history
This commit reworks the namespaces to point at kwiver::track_oracle.

Since we haven't formalized lat/lon <-> MGRS/UTM conversion yet,
all the MGRS-based scoring is ifdef'd out.

The KWE support is also temporarily disabled.
  • Loading branch information
collinsr committed Aug 4, 2016
1 parent 42dadd9 commit 22b6623
Show file tree
Hide file tree
Showing 281 changed files with 481 additions and 29,730 deletions.
Empty file.
15 changes: 14 additions & 1 deletion CMake/kwant-depends-boost.cmake
Expand Up @@ -4,6 +4,19 @@ if(WIN32)
set(Boost_USE_STATIC_LIBS TRUE)
endif()

find_package(Boost 1.50 REQUIRED COMPONENTS system timer chrono)
find_package(Boost 1.55 REQUIRED
COMPONENTS
chrono
date_time
${kwiver_boost_python_package}
filesystem
program_options
regex
system
thread)

add_definitions(-DBOOST_ALL_NO_LIB)

include_directories(SYSTEM ${Boost_INCLUDE_DIRS})
link_directories(${Boost_LIBRARY_DIRS})
###
8 changes: 8 additions & 0 deletions CMake/kwant-depends-fletch.cmake
@@ -0,0 +1,8 @@
find_package( fletch REQUIRED )
include( ${fletch_DIR}/fletchConfig.cmake )

find_package( TinyXML REQUIRED )
include_directories( SYSTEM ${TinyXML_INCLUDE_DIR} )

find_package( LIBJSON REQUIRED )
include_directories( SYSTEM ${LIBJSON_INCLUDE_DIR} )
2 changes: 2 additions & 0 deletions CMake/kwant-depends-kwiver.cmake
@@ -0,0 +1,2 @@
find_package( kwiver REQUIRED )
include_directories( SYSTEM ${KWIVER_INCLUDE_DIRS} )
6 changes: 4 additions & 2 deletions CMake/kwant-depends.cmake
@@ -1,6 +1,8 @@
# Central location for KWANT external dependency declaration and resolution

include( kwant-depends-vital )
include( kwant-depends-GeographicLib )
#include( kwant-depends-vital )
#include( kwant-depends-GeographicLib )
include( kwant-depends-kwiver )
include( kwant-depends-fletch )
include( kwant-depends-Boost )
include( kwant-depends-VXL )
52 changes: 10 additions & 42 deletions CMakeLists.txt
@@ -1,20 +1,16 @@
cmake_minimum_required(VERSION 3.0)

project( kwant )

include(CMakeDependentOption)

#Set CMP0022 to NEW so we error if someone writes older style cmake code
#See http://www.cmake.org/cmake/help/v2.8.12/cmake.html#policy:CMP0022
#for details on CMP0022
if(POLICY CMP0022)
cmake_policy(SET CMP0022 NEW)
endif()

#Set CMP0048 to OLD until we can move min cmake to 3.0
#See http://www.cmake.org/cmake/help/v3.0/policy/CMP0048.html for details
#We need OLD to maintain the old approach to versioning ( if we even use it )
if(POLICY CMP0048)
cmake_policy(SET CMP0048 OLD)
endif()

if(POLICY CMP0054)
cmake_policy(SET CMP0054 NEW)
endif()
Expand Down Expand Up @@ -43,46 +39,18 @@ list(INSERT CMAKE_MODULE_PATH 0
###
# Options and setup
#
include(CMakeDependentOption)

OPTION(KWANT_BUILD_SHARED "Build KWANT components shared or not" TRUE )
set(BUILD_SHARED_LIBS ${KWANT_BUILD_SHARED})

include(CMakeDependentOption)

include_directories( ${kwant_SOURCE_DIR} )
include_directories( ${kwant_BINARY_DIR} )

find_package( fletch REQUIRED )
find_package( vital REQUIRED )
include(kwiver-utils)
include( vital-flags ) # use same compile flags as vital
include( kwant-depends )
include( kwiver-utils )
include( kwiver-flags ) # use same compile flags as kwiver

add_subdirectory( scoring_framework )

find_package( Boost 1.42 REQUIRED COMPONENTS thread filesystem system date_time regex)
add_definitions( -DBOOST_ALL_NO_LIB )
include_directories(SYSTEM ${Boost_INCLUDE_DIRS})

add_subdirectory( wrappers )
include_directories( SYSTEM wrappers )
include_directories( SYSTEM ${CMAKE_CURRENT_BINARY_DIR}/wrappers )

# we can't build shared libraries on Windows so we leave it off by default;
# we haven't set up DLL exports or anything like that
option(BUILD_SHARED_LIBS "Build with shared libraries." OFF)

option( KWANT_ENABLE_SHAPELIB "Enable Shapelib dependent code" OFF)
option( KWANT_ENABLE_4676 "Enable stanag_4676 format" OFF)
option( KWANT_ENABLE_SCORING "Build the scoring code" ON)

find_package( TinyXML REQUIRED )
include_directories( SYSTEM ${TinyXML_INCLUDE_DIR} )

find_package(LIBJSON REQUIRED)
include_directories ( SYSTEM ${LIBJSON_INCLUDE_DIR} )

add_subdirectory( utilities )
# add_subdirectory( stanag_4676 )

add_subdirectory( track_oracle )

if (KWANT_ENABLE_SCORING)
add_subdirectory( scoring_framework )
endif()
60 changes: 0 additions & 60 deletions event_detectors/event_names.h

This file was deleted.

53 changes: 0 additions & 53 deletions event_detectors/event_types.h

This file was deleted.

1 change: 0 additions & 1 deletion scoring_framework/.#track_synthesizer.h

This file was deleted.

15 changes: 11 additions & 4 deletions scoring_framework/CMakeLists.txt
@@ -1,5 +1,11 @@
find_package( GeographicLib REQUIRED )
include_directories ( ${GeographicLib_INCLUDE_DIR} )
OPTION(KWANT_ENABLE_MGRS "Enable track_oracle's lat/lon <-> MGRS capabilities (disable until further notice)" OFF )

if (KWANT_ENABLE_MGRS)
message( FATAL_ERROR "Building the MGRS code is blocked until lat/lon <-> MGRS capabilities are available" )
endif()

#find_package( GeographicLib REQUIRED )
#include_directories ( ${GeographicLib_INCLUDE_DIR} )

########################################
# timestamp utilities
Expand Down Expand Up @@ -78,7 +84,7 @@ kwiver_add_library( score_core

target_link_libraries( score_core
PUBLIC track_oracle
track_scorable_mgrs
${TRACK_ORACLE_SCORABLE_MGRS_LIBRARY}
timestamp_utilities
vul
vgl
Expand Down Expand Up @@ -217,5 +223,6 @@ kwiver_add_library( track_synthesizer
target_link_libraries( track_synthesizer
PUBLIC track_oracle
score_core
PRIVATE vnl
PRIVATE vital_logger
vnl
)
27 changes: 22 additions & 5 deletions scoring_framework/phase1_parameters.cxx
Expand Up @@ -18,7 +18,10 @@
#include <vul/vul_reg_exp.h>
#include <vul/vul_sprintf.h>

#ifdef KWANT_ENABLE_MGRS
#include <track_oracle/track_scorable_mgrs/track_scorable_mgrs.h>
#endif

#include <scoring_framework/matching_args_type.h>

#include <vital/logger/logger.h>
Expand All @@ -33,11 +36,19 @@ using std::runtime_error;
using std::string;
using std::vector;

using kwiver::track_oracle::field_handle_type;
using kwiver::track_oracle::frame_handle_type;
using kwiver::track_oracle::frame_handle_list_type;
using kwiver::track_oracle::track_handle_type;
using kwiver::track_oracle::track_handle_list_type;
using kwiver::track_oracle::track_oracle_core;

namespace // anon
{

using namespace ::kwiver::kwant;

#ifdef KWANT_ENABLE_MGRS
bool
create_geo_poly( const vector< scorable_mgrs >& corners,
vector< mgrs_aoi >& aoi_list )
Expand Down Expand Up @@ -110,7 +121,8 @@ create_geo_poly( const vector< scorable_mgrs >& corners,

return true;
}

#endif

} // anon

namespace kwiver {
Expand Down Expand Up @@ -213,6 +225,7 @@ ::setAOI( const string& aoi_string )
this->setAOI( aoi, /* inclusive = */ true );
} // ...if pixel AOI

#ifdef KWANT_ENABLE_MGRS
else if ( geo_4_corner_aoi_re.find( aoi_string ))
{
vector< scorable_mgrs > corners;
Expand Down Expand Up @@ -254,7 +267,7 @@ ::setAOI( const string& aoi_string )

return create_geo_poly( corners, this->mgrs_aoi_list );
} // .. if geo 2-corner AOI

#endif
else
{
LOG_ERROR( main_logger, "AOI string '" << aoi_string << "' failed to parse as either pixel or geo AOI" );
Expand Down Expand Up @@ -302,7 +315,7 @@ ::frame_within_pixel_aoi( const frame_handle_type& fh ) const

// default to false because this method is called only if an AOI is defined
bool frame_in_aoi = false;
if ( track_oracle::field_has_row( fh.row, bbox_field ))
if ( track_oracle_core::field_has_row( fh.row, bbox_field ))
{
vgl_box_2d<double> box = track[ fh ].bounding_box();
if (this->expand_bbox)
Expand All @@ -326,6 +339,9 @@ bool
phase1_parameters
::frame_within_geo_aoi( const frame_handle_type& fh ) const
{
#ifndef KWANT_ENABLE_MGRS
throw std::runtime_error( "MGRS method called before MGRS code ported over" );
#else
static scorable_track_type dbg;
static track_scorable_mgrs_type track;
field_handle_type mgrs_field = track.mgrs.get_field_handle();
Expand Down Expand Up @@ -362,6 +378,7 @@ ::frame_within_geo_aoi( const frame_handle_type& fh ) const

}
return frame_in_aoi;
#endif
}


Expand All @@ -385,13 +402,13 @@ ::filter_track_list_on_aoi( const track_handle_list_type& in,
if ((aoi_status == NO_AOI_USED) && ( ! this->frame_window.is_set ) )
{
keep_track = true;
frames_in_aoi += track_oracle::get_n_frames( in[i] );
frames_in_aoi += track_oracle_core::get_n_frames( in[i] );
}
else
{
// otherwise, must examine each frame to see if it's in the AOI or frame window

frame_handle_list_type frames = track_oracle::get_frames( in[i] );
frame_handle_list_type frames = track_oracle_core::get_frames( in[i] );
for (unsigned j=0; j<frames.size(); ++j)
{
const frame_handle_type& f = frames[j];
Expand Down

0 comments on commit 22b6623

Please sign in to comment.