Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions .gitmodules

This file was deleted.

43 changes: 16 additions & 27 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,20 @@ if( POLICY CMP0042 )
cmake_policy(SET CMP0042 NEW)
endif()
project( OpticalFlow )

find_package(catkin REQUIRED COMPONENTS
klt_feature_tracker)

catkin_package(
INCLUDE_DIRS include
CATKIN_DEPENDS klt_feature_tracker
)

include_directories(
include
${catkin_INCLUDE_DIRS}
)

set(version_major 0)
set(version_minor 1)
set(version_patch 0)
Expand All @@ -55,15 +69,11 @@ set(${PROJECT_NAME}_INCLUDE_DIRS
find_package( OpenCV REQUIRED )
OPTION(OPENCV "ON for OpenCV" ON) # -DOPENCV=OFF

add_subdirectory( external/klt_feature_tracker klt_feature_tracker )
set( klt_feature_tracker_LIBS "klt_feature_tracker" )

if(OpenCV_FOUND AND OPENCV)
message(STATUS "Building ${PROJECT_NAME} with OpenCV")

set(OpticalFlow_INCLUDE_DIRS
${CMAKE_CURRENT_SOURCE_DIR}/include
${klt_feature_tracker_INCLUDE_DIRS}
${catkin_INCLUDE_DIRS}
${OpenCV_INCLUDE_DIRS}
)

Expand All @@ -78,7 +88,7 @@ if(OpenCV_FOUND AND OPENCV)

target_link_libraries( OpticalFlow
${OpenCV_LIBS}
${klt_feature_tracker_LIBS}
${catkin_LIBRARIES}
)
else()
message(STATUS "Building ${PROJECT_NAME} without OpenCV")
Expand All @@ -98,24 +108,3 @@ else()
endif()

target_include_directories(OpticalFlow PUBLIC include)

# Generate the Config file from the .in file, doing @VAR@ substitution only
configure_file(OpticalFlowConfig.cmake.in FindOpticalFlow.cmake @ONLY)

# INSTALL STEPS
INSTALL(
TARGETS OpticalFlow
RUNTIME DESTINATION lib
LIBRARY DESTINATION lib)

INSTALL(
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/external/klt_feature_tracker/include/
DESTINATION include)

INSTALL(
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/
DESTINATION include)

INSTALL(
FILES ${CMAKE_CURRENT_BINARY_DIR}/FindOpticalFlow.cmake
DESTINATION ${CMAKE_INSTALL_PREFIX})
8 changes: 0 additions & 8 deletions OpticalFlowConfig.cmake.in

This file was deleted.

1 change: 0 additions & 1 deletion external/klt_feature_tracker
Submodule klt_feature_tracker deleted from 9b5b56
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@
#include <opencv2/opencv.hpp>
#include <cmath>

#include "optical_flow.hpp"
#include "trackFeatures.h"
#include "OpticalFlow/optical_flow.hpp"
#include "klt_feature_tracker/trackFeatures.h"

#define DEFAULT_NUMBER_OF_FEATURES 20
#define DEFAULT_CONFIDENCE_MULTIPLIER 1.645f //90% confidence interval
Expand Down
6 changes: 3 additions & 3 deletions include/flow_px4.hpp → include/OpticalFlow/flow_px4.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@

#pragma once

#include "optical_flow.hpp"
#include "px4flow.hpp"
#include "OpticalFlow/optical_flow.hpp"
#include "OpticalFlow/px4flow.hpp"
#include <memory.h>
#include "constants.hpp"
#include "OpticalFlow/constants.hpp"

class OpticalFlowPX4 : public OpticalFlow
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
#include <stdint.h>
#include <iostream>
#include <cmath>
#include "constants.hpp"
#include "OpticalFlow/constants.hpp"

class OpticalFlow
{
Expand Down
File renamed without changes.
44 changes: 4 additions & 40 deletions package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,57 +31,21 @@
- POSSIBILITY OF SUCH DAMAGE.
-
-->
<package>
<package format="2">
<name>OpticalFlow</name>
<version>0.0.0</version>
<description>Optical flow package</description>

<!-- One maintainer tag required, multiple allowed, one person per tag -->
<!-- Example: -->
<!-- <maintainer email="jane.doe@example.com">Jane Doe</maintainer> -->
<maintainer email="christoph@px4.io">christoph</maintainer>


<!-- One license tag required, multiple allowed, one license per tag -->
<!-- Commonly used license strings: -->
<!-- BSD, MIT, Boost Software License, GPLv2, GPLv3, LGPLv2.1, LGPLv3 -->
<license>BSD</license>

<buildtool_depend>catkin</buildtool_depend>

<!-- Url tags are optional, but mutiple are allowed, one per tag -->
<!-- Optional attribute type can be: website, bugtracker, or repository -->
<!-- Example: -->
<!-- <url type="website">http://wiki.ros.org/snap_cam_publisher</url> -->


<!-- Author tags are optional, mutiple are allowed, one per tag -->
<!-- Authors do not have to be maintianers, but could be -->
<!-- Example: -->
<!-- <author email="jane.doe@example.com">Jane Doe</author> -->


<!-- The *_depend tags are used to specify dependencies -->
<!-- Dependencies can be catkin packages or system dependencies -->
<!-- Examples: -->
<!-- Use build_depend for packages you need at compile time: -->
<!-- <build_depend>message_generation</build_depend> -->
<!-- Use buildtool_depend for build tool packages: -->
<!-- <buildtool_depend>catkin</buildtool_depend> -->
<!-- Use run_depend for packages you need at runtime: -->
<!-- <run_depend>message_runtime</run_depend> -->
<!-- Use test_depend for packages you need only for testing: -->
<!-- <test_depend>gtest</test_depend> -->

<build_depend>libopencv-dev</build_depend>
<run_depend>libopencv-dev</run_depend>

<build_depend>klt_feature_tracker</build_depend>
<run_depend>klt_feature_tracker</run_depend>

<depend>libopencv-dev</depend>
<depend>klt_feature_tracker</depend>

<!-- The export tag contains other, unspecified, tags -->
<export>
<!-- Other tools can request additional information be placed here -->

</export>
</package>
2 changes: 1 addition & 1 deletion src/flow_opencv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
* Author: Christoph
*/

#include "flow_opencv.hpp"
#include "OpticalFlow/flow_opencv.hpp"

/****************************************************************************
* OpenCV optical flow calculation
Expand Down
2 changes: 1 addition & 1 deletion src/flow_px4.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
* PX4Flow flow calculation
****************************************************************************/

#include "flow_px4.hpp"
#include "OpticalFlow/flow_px4.hpp"
#include <iostream>

OpticalFlowPX4::OpticalFlowPX4(float f_length_x, float f_length_y, int ouput_rate, int img_width, int img_height,
Expand Down
2 changes: 1 addition & 1 deletion src/optical_flow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
* Author: Christoph
*/

#include "optical_flow.hpp"
#include "OpticalFlow/optical_flow.hpp"

void OpticalFlow::initLimitRate()
{
Expand Down
2 changes: 1 addition & 1 deletion src/px4flow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
#include <stdbool.h>
#include <math.h>
#include <iostream>
#include "px4flow.hpp"
#include "OpticalFlow/px4flow.hpp"

PX4Flow::PX4Flow(uint32_t image_width_, uint32_t search_size_,
uint32_t flow_feature_threshold_, uint32_t flow_value_threshold_,
Expand Down