diff --git a/find-object/.appveyor.yml b/find-object/.appveyor.yml
deleted file mode 100644
index bad8627c..00000000
--- a/find-object/.appveyor.yml
+++ /dev/null
@@ -1,55 +0,0 @@
-
-branches:
- only:
- - master
- - devel
-
-os: Visual Studio 2015
-
-clone_folder: c:\projects\find-object
-
-platform: x64
-configuration: Release
-
-init:
- - cmake --version
- - call "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64
- - call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86_amd64
-
-install:
- # Qt
- - set QTDIR=C:\Qt\5.10.1\msvc2015_64
- # make sure Qt bin path is before cmake bin path to avoid copying qt5 dlls from cmake before qt installation
- - set PATH=%QTDIR%\bin;%PATH%
- # OpenCV
- - ps: wget 'https://dl.dropboxusercontent.com/s/o6ofn491bc0jso1/opencv450_vc14.exe?dl=0' -outfile opencv.exe
- - cmd: opencv.exe -o"C:\Program Files" -y
- - ECHO "Installed OpenCV:"
- - ps: "ls \"C:/Program Files/opencv\""
- - set PATH=%PATH%;C:\Program Files\opencv\x64\vc14\bin
- # zlib
- - ps: wget 'https://docs.google.com/uc?authuser=0&id=0B46akLGdg-uaYm9MTTI4MUtUcmc&export=download' -outfile zlib-1.2.8-vc2010-x64.zip
- - ps: Expand-Archive zlib-1.2.8-vc2010-x64.zip -DestinationPath 'C:\Program Files'
- - ECHO "Installed zlib:"
- - ps: "ls \"C:/Program Files/zlib\""
- - set PATH=%PATH%;C:\Program Files\zlib\bin
-
-before_build:
- - cd c:\projects\find-object\build
- - ECHO %PROGRAMFILES%
- - ECHO %PATH%
- - cmake -G "Visual Studio 14 2015 Win64" -DOpenCV_DIR="C:\Program Files\opencv\build" ..
-
-after_build :
- - cmake --build . --config Release --target package
-
-artifacts:
- - path: build\Find-Object-*
-
-notifications:
- - provider: Email
- to:
- - matlabbe@email.com
- on_build_success: false
- on_build_failure: false
- on_build_status_changed: true
diff --git a/find-object/.cproject b/find-object/.cproject
deleted file mode 100644
index 25e2e9bc..00000000
--- a/find-object/.cproject
+++ /dev/null
@@ -1,221 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- cmake
- -E chdir build/ cmake -G "MinGW Makefiles" -D CMAKE_BUILD_TYPE=Debug ../
-
- true
- false
- true
-
-
- cmake
- -E chdir build/ cmake -G "MinGW Makefiles" -D CMAKE_BUILD_TYPE=Release ../
-
- true
- false
- true
-
-
- cmake
- -E chdir build/ cmake -G "Unix Makefiles" -D CMAKE_BUILD_TYPE=Debug ../
-
- true
- false
- true
-
-
- cmake
- -E chdir build/ cmake -G "Unix Makefiles" -D CMAKE_BUILD_TYPE=Release ../
-
- true
- false
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- cmake
- -E chdir build/ cmake -G "MinGW Makefiles" -D CMAKE_BUILD_TYPE=Debug ../
-
- true
- false
- true
-
-
- cmake
- -E chdir build/ cmake -G "MinGW Makefiles" -D CMAKE_BUILD_TYPE=Release ../
-
- true
- false
- true
-
-
- cmake
- -E chdir build/ cmake -G "Unix Makefiles" -D CMAKE_BUILD_TYPE=Debug ../
-
- true
- false
- true
-
-
- cmake
- -E chdir build/ cmake -G "Unix Makefiles" -D CMAKE_BUILD_TYPE=Release ../
-
- true
- false
- true
-
-
-
-
-
-
-
-
-
-
-
- cmake
- -E chdir build/ cmake -G "MinGW Makefiles" -D CMAKE_BUILD_TYPE=Debug ../
-
- true
- false
- true
-
-
- cmake
- -E chdir build/ cmake -G "MinGW Makefiles" -D CMAKE_BUILD_TYPE=Release ../
-
- true
- false
- true
-
-
- cmake
- -E chdir build/ cmake -G "Unix Makefiles" -D CMAKE_BUILD_TYPE=Debug ../
-
- true
- false
- true
-
-
- cmake
- -E chdir build/ cmake -G "Unix Makefiles" -D CMAKE_BUILD_TYPE=Release ../
-
- true
- false
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/find-object/.github/workflows/cmake.yml b/find-object/.github/workflows/cmake.yml
deleted file mode 100644
index 273581a1..00000000
--- a/find-object/.github/workflows/cmake.yml
+++ /dev/null
@@ -1,36 +0,0 @@
-name: CMake
-
-on:
- push:
- branches: [ master ]
- pull_request:
- branches: [ master ]
-
-env:
- BUILD_TYPE: Release
-
-jobs:
- build:
- name: ${{ matrix.os }}
- runs-on: ${{ matrix.os }}
- strategy:
- matrix:
- os: [ubuntu-22.04, ubuntu-20.04, ubuntu-18.04]
-
- steps:
- - name: Install dependencies
- run: |
- DEBIAN_FRONTEND=noninteractive
- sudo apt-get update
- sudo apt-get -y install libopencv-dev qtbase5-dev git cmake software-properties-common
-
- - uses: actions/checkout@v2
-
- - name: Configure CMake
- run: |
- cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
-
- - name: Build
- run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
-
-
diff --git a/find-object/.github/workflows/ros1.yml b/find-object/.github/workflows/ros1.yml
deleted file mode 100644
index bcc9713f..00000000
--- a/find-object/.github/workflows/ros1.yml
+++ /dev/null
@@ -1,59 +0,0 @@
-name: ros1
-
-on:
- push:
- branches: [ master ]
- pull_request:
- branches: [ master ]
-
-env:
- # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
- BUILD_TYPE: Release
-
-jobs:
- build:
- # The CMake configure and build commands are platform agnostic and should work equally
- # well on Windows or Mac. You can convert this to a matrix build if you need
- # cross-platform coverage.
- # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
- name: Build on ros ${{ matrix.ros_distro }} and ${{ matrix.os }}
- runs-on: ${{ matrix.os }}
- strategy:
- matrix:
- os: [ubuntu-20.04, ubuntu-18.04]
- include:
- - os: ubuntu-20.04
- ros_distro: 'noetic'
- - os: ubuntu-18.04
- ros_distro: 'melodic'
-
- steps:
- - uses: ros-tooling/setup-ros@v0.2
- with:
- required-ros-distributions: ${{ matrix.ros_distro }}
-
- - name: Install dependencies
- run: |
- sudo apt-get update
- sudo apt-get -y install ros-${{ matrix.ros_distro }}-cv-bridge qtbase5-dev
-
- - name: Setup catkin workspace
- run: |
- source /opt/ros/${{ matrix.ros_distro }}/setup.bash
- mkdir -p ${{github.workspace}}/catkin_ws/src
- cd ${{github.workspace}}/catkin_ws/src
- catkin_init_workspace
- cd ..
- catkin_make
-
- - uses: actions/checkout@v2
- with:
- path: 'catkin_ws/src/find_object_2d'
-
- - name: caktkin_make
- run: |
- source /opt/ros/${{ matrix.ros_distro }}/setup.bash
- source ${{github.workspace}}/catkin_ws/devel/setup.bash
- cd ${{github.workspace}}/catkin_ws
- catkin_make -DSETUPTOOLS_DEB_LAYOUT=OFF
- catkin_make install
diff --git a/find-object/.github/workflows/ros2.yml b/find-object/.github/workflows/ros2.yml
deleted file mode 100644
index 364bebb7..00000000
--- a/find-object/.github/workflows/ros2.yml
+++ /dev/null
@@ -1,58 +0,0 @@
-
-name: ros2
-
-on:
- push:
- branches: [ master ]
- pull_request:
- branches: [ master ]
-
-env:
- # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
- BUILD_TYPE: Release
-
-jobs:
- build:
- # The CMake configure and build commands are platform agnostic and should work equally
- # well on Windows or Mac. You can convert this to a matrix build if you need
- # cross-platform coverage.
- # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
- name: Build on ros2 ${{ matrix.ros_distro }} and ${{ matrix.os }}
- runs-on: ${{ matrix.os }}
- strategy:
- matrix:
- ros_distro: [foxy, galactic, humble]
- include:
- - ros_distro: 'foxy'
- os: ubuntu-20.04
- - ros_distro: 'galactic'
- os: ubuntu-20.04
- - ros_distro: 'humble'
- os: ubuntu-22.04
-
- steps:
- - uses: ros-tooling/setup-ros@v0.4
- with:
- required-ros-distributions: ${{ matrix.ros_distro }}
-
- - name: Install dependencies
- run: |
- sudo apt-get update
- sudo apt-get -y install ros-${{ matrix.ros_distro }}-cv-bridge qtbase5-dev
-
- - name: Setup ros2 workspace
- run: |
- source /opt/ros/${{ matrix.ros_distro }}/setup.bash
- mkdir -p ${{github.workspace}}/ros2_ws/src
- cd ${{github.workspace}}/ros2_ws
- colcon build
-
- - uses: actions/checkout@v2
- with:
- path: 'ros2_ws/src/find_object_2d'
-
- - name: colcon build
- run: |
- source /opt/ros/${{ matrix.ros_distro }}/setup.bash
- cd ${{github.workspace}}/ros2_ws
- colcon build --event-handlers console_direct+
diff --git a/find-object/.project b/find-object/.project
deleted file mode 100644
index 8c1ffa4b..00000000
--- a/find-object/.project
+++ /dev/null
@@ -1,79 +0,0 @@
-
-
- find_object
-
-
-
-
-
- org.eclipse.cdt.managedbuilder.core.genmakebuilder
- clean,full,incremental,
-
-
- ?name?
-
-
-
- org.eclipse.cdt.make.core.append_environment
- true
-
-
- org.eclipse.cdt.make.core.autoBuildTarget
- all
-
-
- org.eclipse.cdt.make.core.buildArguments
- -C ${ProjDirPath}/build VERBOSE=true
-
-
- org.eclipse.cdt.make.core.buildCommand
- make
-
-
- org.eclipse.cdt.make.core.cleanBuildTarget
- clean
-
-
- org.eclipse.cdt.make.core.contents
- org.eclipse.cdt.make.core.activeConfigSettings
-
-
- org.eclipse.cdt.make.core.enableAutoBuild
- false
-
-
- org.eclipse.cdt.make.core.enableCleanBuild
- true
-
-
- org.eclipse.cdt.make.core.enableFullBuild
- true
-
-
- org.eclipse.cdt.make.core.fullBuildTarget
- all
-
-
- org.eclipse.cdt.make.core.stopOnError
- true
-
-
- org.eclipse.cdt.make.core.useDefaultBuildCmd
- false
-
-
-
-
- org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder
- full,incremental,
-
-
-
-
-
- org.eclipse.cdt.core.cnature
- org.eclipse.cdt.core.ccnature
- org.eclipse.cdt.managedbuilder.core.managedBuildNature
- org.eclipse.cdt.managedbuilder.core.ScannerConfigNature
-
-
diff --git a/find-object/.travis.yml b/find-object/.travis.yml
deleted file mode 100644
index 3472067a..00000000
--- a/find-object/.travis.yml
+++ /dev/null
@@ -1,22 +0,0 @@
-sudo: true
-dist: trusty
-language: cpp
-
-compiler:
- - gcc
- - clang
-
-addons:
- apt:
- packages:
- - cmake
- - libopencv-dev
- - libqt4-dev
-
-script:
- - mkdir -p build && cd build
- - cmake ..
- - make
-
-notifications:
- email: false
diff --git a/find-object/CMakeLists.txt b/find-object/CMakeLists.txt
deleted file mode 100644
index aee50230..00000000
--- a/find-object/CMakeLists.txt
+++ /dev/null
@@ -1,472 +0,0 @@
-cmake_minimum_required(VERSION 3.5)
-
-SET(CATKIN_BUILD FALSE)
-SET(COLCON_BUILD FALSE)
-
-# Detect if it is called by catkin (ros1)
-IF(CATKIN_TOPLEVEL OR CATKIN_BUILD_BINARY_PACKAGE OR CATKIN_SKIP_TESTING OR CATKIN_ENABLE_TESTING OR CATKIN_DEVEL_PREFIX)
- SET(CATKIN_BUILD TRUE)
-ELSE()
- # Detect if it is called by colcon (ros2)
- IF(DEFINED AMENT_PREFIX_PATH) # buildfarm
- SET(COLCON_BUILD TRUE)
- ELSE() # colcon local build in ros2_ws
- string(FIND ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} POS)
- IF(${POS} EQUAL -1)
- SET(COLCON_BUILD TRUE)
- ENDIF()
- ENDIF()
-ENDIF()
-
-MESSAGE(STATUS "CATKIN_BUILD=${CATKIN_BUILD}")
-MESSAGE(STATUS "COLCON_BUILD=${COLCON_BUILD}")
-SET(ROS_BUILD FALSE)
-IF(CATKIN_BUILD OR COLCON_BUILD)
- SET(ROS_BUILD TRUE)
-ENDIF()
-
-IF(NOT ROS_BUILD)
- #Standalone build
- PROJECT( Find-Object )
-ELSE()
- #ROS build
- PROJECT( find_object_2d )
- MESSAGE(STATUS "ROS_DISTRO=$ENV{ROS_DISTRO}")
-ENDIF()
-
-# Catkin doesn't support multiarch library path,
-# fix to "lib" if not set by user.
-IF(NOT DEFINED CMAKE_INSTALL_LIBDIR)
- set(CMAKE_INSTALL_LIBDIR "lib")
-ENDIF(NOT DEFINED CMAKE_INSTALL_LIBDIR)
-
-INCLUDE(GNUInstallDirs)
-
-####### local cmake modules #######
-SET(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake_modules")
-
-# Policy CMP0043 introduced in cmake version 3.0 IGNORES the use of COMPILE_DEFINITIONS suffixed variables, e.g. COMPILE_DEFINITIONS_DEBUG
-# Set to OLD behavior until minimum cmake version >= 2.8.10 (version that COMPILE_DEFINITIONS can be set by generator expressions instead)
-if (POLICY CMP0043)
- cmake_policy(SET CMP0043 OLD)
-endif (POLICY CMP0043)
-# Policy CMP0042 introduced in cmake version 3.0 enables the use of @rpath in an install name via MACOSX_RPATH by default
-# Set to OLD behavior so that all versions use the same behavior, or until minimum cmake version >= 2.8.12 (version where @rpath is available)
-if (POLICY CMP0042)
- cmake_policy(SET CMP0042 OLD)
-endif (POLICY CMP0042)
-
-#######################
-# VERSION
-#######################
-SET(PROJECT_VERSION "0.7.0")
-SET(PROJECT_PREFIX find_object)
-
-STRING(REGEX MATCHALL "[0-9]" PROJECT_VERSION_PARTS "${PROJECT_VERSION}")
-LIST(GET PROJECT_VERSION_PARTS 0 PROJECT_VERSION_MAJOR)
-LIST(GET PROJECT_VERSION_PARTS 1 PROJECT_VERSION_MINOR)
-LIST(GET PROJECT_VERSION_PARTS 2 PROJECT_VERSION_PATCH)
-
-ADD_DEFINITIONS(-DPROJECT_PREFIX="${PROJECT_PREFIX}")
-ADD_DEFINITIONS(-DPROJECT_VERSION="${PROJECT_VERSION}")
-ADD_DEFINITIONS(-DPROJECT_NAME="${PROJECT_NAME}")
-
-####### DEPENDENCIES #######
-FIND_PACKAGE(OpenCV REQUIRED) # tested on 2.3.1
-
-# check if version status is "-dev" (SIFT compatibility issue between 4.3.0 vs 4.3.0-dev)
-FIND_FILE(OpenCV_VERSION_HPP opencv2/core/version.hpp
- PATHS ${OpenCV_INCLUDE_DIRS}
- NO_DEFAULT_PATH)
-FILE(READ ${OpenCV_VERSION_HPP} TMPTXT)
-STRING(FIND "${TMPTXT}" "-dev" matchres)
-IF(NOT ${matchres} EQUAL -1)
- add_definitions(-DOPENCV_DEV)
-ENDIF(NOT ${matchres} EQUAL -1)
-
-# For SuperPoint
-SET(TORCH 0)
-FIND_PACKAGE(Torch QUIET)
-IF(TORCH_FOUND)
- MESSAGE(STATUS "Found Torch: ${TORCH_INCLUDE_DIRS}")
- SET(TORCH 1)
-ENDIF(TORCH_FOUND)
-
-IF(NOT MSVC)
- IF(TORCH_FOUND)
- include(CheckCXXCompilerFlag)
- CHECK_CXX_COMPILER_FLAG("-std=c++14" COMPILER_SUPPORTS_CXX14)
- IF(COMPILER_SUPPORTS_CXX14)
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
- set(CMAKE_CXX_STANDARD 14)
- ELSE()
- message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++14 support. Please use a different C++ compiler if you want to use Torch.")
- ENDIF()
- ENDIF(TORCH_FOUND)
-
- IF( NOT CMAKE_CXX_STANDARD AND OpenCV_VERSION_MAJOR EQUAL 4)
- #Newest versions require std11
- include(CheckCXXCompilerFlag)
- CHECK_CXX_COMPILER_FLAG("-std=c++17" COMPILER_SUPPORTS_CXX17)
- CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
- CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
- IF(COMPILER_SUPPORTS_CXX17)
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
- ELSEIF(COMPILER_SUPPORTS_CXX11)
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
- ELSEIF(COMPILER_SUPPORTS_CXX0X)
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
- ELSE()
- message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
- ENDIF()
- ENDIF()
-ENDIF()
-
-# look for Qt5 before Qt4
-FIND_PACKAGE(Qt5 COMPONENTS Widgets Core Gui Network QUIET)
-IF(NOT Qt5_FOUND)
- FIND_PACKAGE(Qt4 COMPONENTS QtCore QtGui QtNetwork REQUIRED)
-ENDIF(NOT Qt5_FOUND)
-ADD_DEFINITIONS(-DQT_NO_KEYWORDS) # To avoid conflicts with boost signals used in ROS
-
-FIND_PACKAGE(Tcmalloc QUIET)
-
-FIND_PACKAGE(ZLIB REQUIRED QUIET)
-
-SET(NONFREE 1)
-IF(NOT (OPENCV_NONFREE_FOUND OR OPENCV_XFEATURES2D_FOUND))
- SET(NONFREE 0)
-ELSEIF(OpenCV_VERSION VERSION_GREATER "3.4.2")
- FIND_FILE(OpenCV_MODULES_HPP opencv2/opencv_modules.hpp
- PATHS ${OpenCV_INCLUDE_DIRS}
- NO_DEFAULT_PATH)
- FILE(READ ${OpenCV_MODULES_HPP} TMPTXT)
- STRING(FIND "${TMPTXT}" "#define OPENCV_ENABLE_NONFREE" matchres)
- IF(${matchres} EQUAL -1)
- SET(NONFREE 0)
- ENDIF(${matchres} EQUAL -1)
-ENDIF()
-
-CONFIGURE_FILE(Version.h.in ${PROJECT_SOURCE_DIR}/include/${PROJECT_PREFIX}/Version.h)
-
-IF(NOT ROS_BUILD)
- #Standalone build
- IF(WIN32 AND NOT MINGW)
- ADD_DEFINITIONS("-wd4251")
- ELSE ()
- ADD_DEFINITIONS( "-Wall" )
- ENDIF()
- #ADD_DEFINITIONS("-DUNICODE") # to test with UNICODE projects
-
- ####### COMPILATION PARAMS #######
- # In case of Makefiles if the user does not setup CMAKE_BUILD_TYPE, assume it's Release:
- IF(${CMAKE_GENERATOR} MATCHES ".*Makefiles")
- IF("${CMAKE_BUILD_TYPE}" STREQUAL "")
- set(CMAKE_BUILD_TYPE Release)
- ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "")
- ENDIF(${CMAKE_GENERATOR} MATCHES ".*Makefiles")
-
- SET(CMAKE_DEBUG_POSTFIX "d")
-
- ####### Build libraries as shared or static #######
- OPTION( BUILD_SHARED_LIBS "Set to OFF to build static libraries" ON )
-
- ####### OUTPUT DIR #######
- SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin)
- SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin)
- SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib)
-
- ####### INSTALL DIR #######
- # Offer the user the choice of overriding the installation directories
- set(INSTALL_INCLUDE_DIR include/${PROJECT_PREFIX}-${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR} CACHE PATH
- "Installation directory for header files")
- if(WIN32 AND NOT CYGWIN)
- set(DEF_INSTALL_CMAKE_DIR CMake)
- else()
- set(DEF_INSTALL_CMAKE_DIR ${CMAKE_INSTALL_LIBDIR}/${PROJECT_PREFIX}-${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR})
- endif()
- set(INSTALL_CMAKE_DIR ${DEF_INSTALL_CMAKE_DIR} CACHE PATH
- "Installation directory for CMake files")
-
-
- ####### OSX BUNDLE CMAKE_INSTALL_PREFIX #######
- IF(APPLE)
- OPTION(BUILD_AS_BUNDLE "Set to ON to build as bundle (DragNDrop)" OFF)
- ENDIF(APPLE)
- IF(APPLE AND BUILD_AS_BUNDLE)
- # Required when packaging, and set CMAKE_INSTALL_PREFIX to "/".
- SET(CPACK_SET_DESTDIR TRUE)
-
- SET(CMAKE_BUNDLE_NAME
- "${PROJECT_NAME}")
- SET(CMAKE_BUNDLE_LOCATION "/")
-
- # make sure CMAKE_INSTALL_PREFIX ends in /
- SET(CMAKE_INSTALL_PREFIX
- "/${CMAKE_BUNDLE_NAME}.app/Contents")
- ENDIF(APPLE AND BUILD_AS_BUNDLE)
-
- ####### SOURCES (Projects) #######
- ADD_SUBDIRECTORY( src )
- ADD_SUBDIRECTORY( app )
- ADD_SUBDIRECTORY( tools )
- IF(NONFREE OR OpenCV_VERSION VERSION_GREATER "4.2.0") # SIFT is free from 4.3.0
- ADD_SUBDIRECTORY( example )
- ENDIF(NONFREE OR OpenCV_VERSION VERSION_GREATER "4.2.0")
-
- #######################
- # Uninstall target, for "make uninstall"
- #######################
- CONFIGURE_FILE(
- "${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
- "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
- IMMEDIATE @ONLY)
-
- ADD_CUSTOM_TARGET(uninstall
- "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
-
- #######################
- # Setup FindObjectConfig.cmake
- #######################
- # Create the FindObjectConfig.cmake and FindObjectConfigVersion files
- file(RELATIVE_PATH REL_INCLUDE_DIR "${CMAKE_INSTALL_PREFIX}/${INSTALL_CMAKE_DIR}" "${CMAKE_INSTALL_PREFIX}/${INSTALL_INCLUDE_DIR}")
- file(RELATIVE_PATH REL_LIB_DIR "${CMAKE_INSTALL_PREFIX}/${INSTALL_CMAKE_DIR}" "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
-
- # ... for the build tree
- set(CONF_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/include")
- set(CONF_LIB_DIR "${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}")
- configure_file(FindObjectConfig.cmake.in
- "${PROJECT_BINARY_DIR}/FindObjectConfig.cmake" @ONLY)
-
- # ... for the install tree
- set(CONF_INCLUDE_DIRS "\${FindObject_CMAKE_DIR}/${REL_INCLUDE_DIR}")
- set(CONF_LIB_DIR "\${FindObject_CMAKE_DIR}/${REL_LIB_DIR}")
- configure_file(FindObjectConfig.cmake.in
- "${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/FindObjectConfig.cmake" @ONLY)
-
- # ... for both
- configure_file(FindObjectConfigVersion.cmake.in
- "${PROJECT_BINARY_DIR}/FindObjectConfigVersion.cmake" @ONLY)
-
- # Install the FindObjectConfig.cmake and FindObjectConfigVersion.cmake
- install(FILES
- "${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/FindObjectConfig.cmake"
- "${PROJECT_BINARY_DIR}/FindObjectConfigVersion.cmake"
- DESTINATION "${INSTALL_CMAKE_DIR}" COMPONENT devel)
- ####
-
- #######################
- # CPACK (Packaging)
- #######################
- INCLUDE(InstallRequiredSystemLibraries)
-
- SET(CPACK_PACKAGE_NAME "${PROJECT_NAME}")
- SET(CPACK_PACKAGE_VENDOR "${PROJECT_NAME} project")
- SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Find-Object")
- SET(CPACK_PACKAGE_VERSION_MAJOR "${PROJECT_VERSION_MAJOR}")
- SET(CPACK_PACKAGE_VERSION_MINOR "${PROJECT_VERSION_MINOR}")
- SET(CPACK_PACKAGE_VERSION_PATCH "${PROJECT_VERSION_PATCH}")
- SET(CPACK_PACKAGE_CONTACT "matlabbe@gmail.com")
-
- set(CPACK_SOURCE_IGNORE_FILES
- "\\\\.svn/"
- "${PROJECT_SOURCE_DIR}/build/[a-zA-Z0-9_]+"
- "~$"
- "${PROJECT_SOURCE_DIR}/bin/.*${PROJECT_PREFIX}"
- "${PROJECT_SOURCE_DIR}/bin/.*${PROJECT_NAME}"
- "\\\\.DS_Store"
- )
-
- IF(WIN32)
- SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE")
- IF(CMAKE_CL_64)
- SET(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES64")
- ELSE()
- SET(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES")
- ENDIF()
- SET(CPACK_GENERATOR "ZIP;NSIS")
- SET(CPACK_SOURCE_GENERATOR "ZIP")
- SET(CPACK_NSIS_PACKAGE_NAME "${PROJECT_NAME}")
- SET(ICON_PATH "${PROJECT_SOURCE_DIR}/app/${PROJECT_NAME}.ico")
- SET(CPACK_NSIS_MUI_ICON ${ICON_PATH})
- SET(CPACK_NSIS_MUI_UNIICON ${ICON_PATH})
- SET(CPACK_NSIS_DISPLAY_NAME "${PROJECT_NAME}")
- SET(CPACK_NSIS_CONTACT ${CPACK_PACKAGE_CONTACT})
- # Set the icon used for the Windows "Add or Remove Programs" tool.
- SET(CPACK_NSIS_INSTALLED_ICON_NAME bin\\\\${PROJECT_NAME}.exe)
- SET(CPACK_PACKAGE_EXECUTABLES "${PROJECT_NAME}" "${PROJECT_NAME}" ${CPACK_PACKAGE_EXECUTABLES})
- SET(CPACK_CREATE_DESKTOP_LINKS "${PROJECT_NAME}" ${CPACK_CREATE_DESKTOP_LINKS})
- SET(CPACK_PACKAGE_INSTALL_DIRECTORY "${PROJECT_NAME}")
- ELSEIF(APPLE)
- IF(BUILD_AS_BUNDLE)
- # On APPLE and if BUILD_AS_BUNDLE=ON, the project is created as a bundle
- # over the main app (see ./src).Here we package only this bundle. Note
- # that we set CMAKE_INSTALL_PREFIX to "/" when packaging to DragNDrop...
- SET(CPACK_GENERATOR "DragNDrop")
- ELSE()
- SET(CPACK_GENERATOR "PackageMaker;TBZ2")
- ENDIF()
-
- SET(CPACK_SOURCE_GENERATOR "TBZ2")
-
- SET(CPACK_PACKAGE_ICON "${PROJECT_SOURCE_DIR}/app/${PROJECT_NAME}.icns")
- ELSE()
- SET(CPACK_SOURCE_GENERATOR "ZIP")
- ENDIF()
-
- INCLUDE(CPack)
-
- #######################
- # OUTPUT INFO
- #######################
- MESSAGE(STATUS "--------------------------------------------")
- MESSAGE(STATUS "Info :")
- MESSAGE(STATUS " CMAKE_INSTALL_PREFIX = ${CMAKE_INSTALL_PREFIX}")
- MESSAGE(STATUS " CMAKE_BUILD_TYPE = ${CMAKE_BUILD_TYPE}")
- MESSAGE(STATUS " PROJECT_VERSION = ${PROJECT_VERSION}")
-
- IF(OpenCV_VERSION_MAJOR EQUAL 2)
- IF(OPENCV_NONFREE_FOUND)
- MESSAGE(STATUS " With OpenCV 2 nonfree module (SIFT/SURF) = YES")
- ELSE()
- MESSAGE(STATUS " With OpenCV 2 nonfree module (SIFT/SURF) = NO (not found)")
- ENDIF()
- ELSE()
- IF(OPENCV_XFEATURES2D_FOUND)
- MESSAGE(STATUS " With OpenCV ${OpenCV_VERSION} xfeatures2d module (BRIEF/FREAK/KAZE) = YES")
- ELSE()
- MESSAGE(STATUS " With OpenCV ${OpenCV_VERSION} xfeatures2d module (BRIEF/FREAK/KAZE) = NO (not found)")
- ENDIF()
- IF(OpenCV_VERSION VERSION_GREATER "4.2.0")
- IF(NONFREE)
- MESSAGE(STATUS " With OpenCV ${OpenCV_VERSION} nonfree module (SURF) = YES")
- ELSE()
- MESSAGE(STATUS " With OpenCV ${OpenCV_VERSION} nonfree module (SURF) = NO")
- ENDIF()
- ELSEIF()
- IF(NONFREE)
- MESSAGE(STATUS " With OpenCV ${OpenCV_VERSION} nonfree module (SIFT/SURF) = YES")
- ELSE()
- MESSAGE(STATUS " With OpenCV ${OpenCV_VERSION} nonfree module (SIFT/SURF) = NO")
- ENDIF()
- ENDIF()
- ENDIF()
-
- IF(QT4_FOUND)
- MESSAGE(STATUS " With Qt4 = YES")
- ELSEIF(Qt5_FOUND)
- MESSAGE(STATUS " With Qt5 = YES")
- ELSE()
- MESSAGE(STATUS " With Qt = NO (Qt not found)")
- ENDIF()
-
- IF(Tcmalloc_FOUND)
- MESSAGE(STATUS " With tcmalloc = YES")
- ELSE()
- MESSAGE(STATUS " With tcmalloc = NO (tcmalloc not found)")
- ENDIF(Tcmalloc_FOUND)
-
- IF(TORCH_FOUND)
- MESSAGE(STATUS " With Torch = YES")
- ELSE()
- MESSAGE(STATUS " With Torch = NO (libtorch not found)")
- ENDIF(TORCH_FOUND)
-
- IF(APPLE)
- MESSAGE(STATUS " BUILD_AS_BUNDLE = ${BUILD_AS_BUNDLE}")
- ENDIF(APPLE)
- MESSAGE(STATUS "--------------------------------------------")
-
-ELSEIF(CATKIN_BUILD)
- #ROS Catkin build
-
- ## Find catkin macros and libraries
- ## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
- ## is used, also find other catkin packages
- find_package(catkin REQUIRED COMPONENTS
- cv_bridge roscpp sensor_msgs std_msgs image_transport message_filters tf message_generation
- )
-
- ## Generate messages in the 'msg' folder
- add_message_files(
- FILES
- ObjectsStamped.msg
- DetectionInfo.msg
- )
-
- ## Generate added messages and services with any dependencies listed here
- generate_messages(
- DEPENDENCIES
- std_msgs
- sensor_msgs
- )
-
- ###################################
- ## catkin specific configuration ##
- ###################################
- ## The catkin_package macro generates cmake config files for your package
- ## Declare things to be passed to dependent projects
- ## INCLUDE_DIRS: uncomment this if you package contains header files
- ## LIBRARIES: libraries you create in this project that dependent projects also need
- ## CATKIN_DEPENDS: catkin_packages dependent projects also need
- ## DEPENDS: system dependencies of this project that dependent projects also need
- catkin_package(
- CATKIN_DEPENDS cv_bridge roscpp sensor_msgs std_msgs image_transport message_filters tf message_runtime
- DEPENDS OpenCV
- )
-
- ###########
- ## Build ##
- ###########
- ADD_SUBDIRECTORY( src )
-
- #############
- ## Install ##
- #############
- ## Mark other files for installation (e.g. launch and bag files, etc.)
- install(DIRECTORY
- launch/ros1
- DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch
- )
-ELSE() # COLCON_BUILD
- #ROS Colcon build
-
- find_package(ament_cmake REQUIRED)
- find_package(builtin_interfaces REQUIRED)
- find_package(rosidl_default_generators REQUIRED)
- find_package(rclcpp REQUIRED)
- find_package(rclcpp_components REQUIRED)
- find_package(cv_bridge REQUIRED)
- find_package(sensor_msgs REQUIRED)
- find_package(std_msgs REQUIRED)
- find_package(image_transport REQUIRED)
- find_package(message_filters REQUIRED)
- find_package(tf2 REQUIRED)
- find_package(tf2_ros REQUIRED)
- find_package(tf2_geometry_msgs REQUIRED)
- find_package(geometry_msgs REQUIRED)
-
- ## Generate messages and services
- rosidl_generate_interfaces(${PROJECT_NAME}
- msg/ObjectsStamped.msg
- msg/DetectionInfo.msg
- DEPENDENCIES std_msgs sensor_msgs
- )
- ament_export_dependencies(rosidl_default_runtime)
-
- ###########
- ## Build ##
- ###########
- ADD_SUBDIRECTORY( src )
-
- #############
- ## Install ##
- #############
- install(DIRECTORY
- launch/ros2/.
- DESTINATION share/${PROJECT_NAME}/launch
- )
-
- ament_package()
-ENDIF()
-
diff --git a/find-object/FindObjectConfig.cmake.in b/find-object/FindObjectConfig.cmake.in
deleted file mode 100644
index f9d908e5..00000000
--- a/find-object/FindObjectConfig.cmake.in
+++ /dev/null
@@ -1,10 +0,0 @@
-# - Config file for the FindObject package
-# It defines the following variables
-# FindObject_INCLUDE_DIRS - include directories for FindObject
-# FindObject_LIBRARIES - libraries to link against
-
-# Compute paths
-get_filename_component(FindObject_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
-set(FindObject_INCLUDE_DIRS "@CONF_INCLUDE_DIRS@")
-
-find_library(FindObject_LIBRARIES NAMES find_object NO_DEFAULT_PATH HINTS "@CONF_LIB_DIR@")
\ No newline at end of file
diff --git a/find-object/FindObjectConfigVersion.cmake.in b/find-object/FindObjectConfigVersion.cmake.in
deleted file mode 100644
index 22ffec0f..00000000
--- a/find-object/FindObjectConfigVersion.cmake.in
+++ /dev/null
@@ -1,11 +0,0 @@
-set(PACKAGE_VERSION "@PROJECT_VERSION@")
-
-# Check whether the requested PACKAGE_FIND_VERSION is compatible
-if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}")
- set(PACKAGE_VERSION_COMPATIBLE FALSE)
-else()
- set(PACKAGE_VERSION_COMPATIBLE TRUE)
- if ("${PACKAGE_VERSION}" VERSION_EQUAL "${PACKAGE_FIND_VERSION}")
- set(PACKAGE_VERSION_EXACT TRUE)
- endif()
-endif()
diff --git a/find-object/LICENSE b/find-object/LICENSE
deleted file mode 100644
index 871d6f6e..00000000
--- a/find-object/LICENSE
+++ /dev/null
@@ -1,27 +0,0 @@
-Copyright (c) 2011-2014, Mathieu Labbe - IntRoLab - Universite de Sherbrooke
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
-* Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
-* Neither the name of the Universite de Sherbrooke nor the names of its
- contributors may be used to endorse or promote products derived from
- this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
-FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\ No newline at end of file
diff --git a/find-object/README.md b/find-object/README.md
deleted file mode 100644
index c547630c..00000000
--- a/find-object/README.md
+++ /dev/null
@@ -1,92 +0,0 @@
-# find-object
-
-
-
-
- | Linux |
-
- |
-
-
- | Windows |
-
- |
-
-
-
-
-## Standalone
-Find-Object project, visit the [home page](http://introlab.github.io/find-object/) for more information.
-
-## ROS1
-
-### Install
-
-Binaries:
-```bash
-sudo apt-get install ros-$ROS_DISTRO-find-object-2d
-```
-
-Source:
-
- * To include `xfeatures2d` and/or `nonfree` modules of OpenCV, to avoid conflicts with `cv_bridge`, build same OpenCV version that is used by `cv_bridge`. Install it in `/usr/local` (default).
-
-```bash
-cd ~/catkin_ws
-git clone https://github.com/introlab/find-object.git src/find_object_2d
-catkin_make
-```
-
-### Run
-```bash
-roscore
-# Launch your preferred usb camera driver
-rosrun uvc_camera uvc_camera_node
-rosrun find_object_2d find_object_2d image:=image_raw
-```
-See [find_object_2d](http://wiki.ros.org/find_object_2d) for more information.
-
-## ROS2
-
-### Install
-
-Binaries:
-```bash
-To come...
-```
-
-Source:
-
-```bash
-cd ~/ros2_ws
-git clone https://github.com/introlab/find-object.git src/find_object_2d
-colcon build
-```
-
-### Run
-```bash
-# Launch your preferred usb camera driver
-ros2 launch realsense2_camera rs_launch.py
-
-# Launch find_object_2d node:
-ros2 launch find_object_2d find_object_2d.launch.py image:=/camera/color/image_raw
-
-# Draw objects detected on an image:
-ros2 run find_object_2d print_objects_detected --ros-args -r image:=/camera/color/image_raw
-```
-#### 3D Pose (TF)
-A RGB-D camera is required. Example with Realsense D400 camera:
-```bash
-# Launch your preferred usb camera driver
-ros2 launch realsense2_camera rs_launch.py align_depth.enable:=true
-
-# Launch find_object_2d node:
-ros2 launch find_object_2d find_object_3d.launch.py \
- rgb_topic:=/camera/color/image_raw \
- depth_topic:=/camera/aligned_depth_to_color/image_raw \
- camera_info_topic:=/camera/color/camera_info
-
-# Show 3D pose in camera frame:
-ros2 run find_object_2d tf_example
-```
-See [find_object_2d](http://wiki.ros.org/find_object_2d) for more information (same parameters/topics are used between ROS1 and ROS2 versions).
diff --git a/find-object/Version.h.in b/find-object/Version.h.in
deleted file mode 100644
index 31bfe1de..00000000
--- a/find-object/Version.h.in
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
-Copyright (c) 2010-2014, Mathieu Labbe - IntRoLab - Universite de Sherbrooke
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- * Neither the name of the Universite de Sherbrooke nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#ifndef VERSION_H_
-#define VERSION_H_
-
-// This is auto-generated!
-#define FINDOBJECT_VERSION "@PROJECT_VERSION@"
-
-#define FINDOBJECT_VERSION_MAJOR @PROJECT_VERSION_MAJOR@
-#define FINDOBJECT_VERSION_MINOR @PROJECT_VERSION_MINOR@
-#define FINDOBJECT_VERSION_PATCH @PROJECT_VERSION_PATCH@
-
-#define FINDOBJECT_VERSION_COMPARE(major, minor, patch) (major>=@PROJECT_VERSION_MAJOR@ || (major==@PROJECT_VERSION_MAJOR@ && minor>=@PROJECT_VERSION_MINOR@) || (major==@PROJECT_VERSION_MAJOR@ && minor==@PROJECT_VERSION_MINOR@ && patch >=@PROJECT_VERSION_PATCH@))
-
-#define FINDOBJECT_NONFREE @NONFREE@
-#define FINDOBJECT_TORCH @TORCH@
-
-#endif /* VERSION_H_ */
-
diff --git a/find-object/app/CMakeLists.txt b/find-object/app/CMakeLists.txt
deleted file mode 100644
index d8cda88f..00000000
--- a/find-object/app/CMakeLists.txt
+++ /dev/null
@@ -1,164 +0,0 @@
-
-SET(headers_ui
- TcpServerPool.h
-)
-
-IF(QT4_FOUND)
- QT4_WRAP_CPP(moc_srcs ${headers_ui})
-ELSE()
- QT5_WRAP_CPP(moc_srcs ${headers_ui})
-ENDIF()
-
-SET(INCLUDE_DIRS
- ${CMAKE_CURRENT_SOURCE_DIR}/../include
- ${CMAKE_CURRENT_SOURCE_DIR}
- ${OpenCV_INCLUDE_DIRS}
-)
-
-IF(QT4_FOUND)
- INCLUDE(${QT_USE_FILE})
-ENDIF(QT4_FOUND)
-
-SET(LIBRARIES
- ${QT_LIBRARIES}
- ${OpenCV_LIBS}
-)
-
-if(Tcmalloc_FOUND)
- SET(LIBRARIES
- ${LIBARIES}
- ${Tcmalloc_LIBRARIES}
- )
-endif(Tcmalloc_FOUND)
-
-
-#include files
-INCLUDE_DIRECTORIES(${INCLUDE_DIRS})
-
-SET(SRC_FILES main.cpp ${moc_srcs} )
-
-# For Apple set the icns file containing icons
-IF(APPLE AND BUILD_AS_BUNDLE)
- # set how it shows up in the Info.plist file
- SET(MACOSX_BUNDLE_ICON_FILE ${PROJECT_NAME}.icns)
- # set where in the bundle to put the icns file
- SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}.icns PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
- # include the icns file in the target
- SET(SRC_FILES ${SRC_FILES} ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}.icns)
-ENDIF(APPLE AND BUILD_AS_BUNDLE)
-
-# Add exe icon resource
-IF(WIN32)
- IF( MINGW )
- # resource compilation for MinGW
- ADD_CUSTOM_COMMAND( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/AppIco.o
- COMMAND windres.exe -I${CMAKE_CURRENT_SOURCE_DIR} -i${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}.rc
- -o ${CMAKE_CURRENT_BINARY_DIR}/AppIco.o )
- SET(SRC_FILES ${SRC_FILES} ${CMAKE_CURRENT_BINARY_DIR}/AppIco.o)
- ELSE( MINGW )
- SET(SRC_FILES ${SRC_FILES} ${PROJECT_NAME}.rc) # Error on visual studio 2008
- ENDIF( MINGW )
-ENDIF(WIN32)
-
-# create an executable file
-IF(APPLE AND BUILD_AS_BUNDLE)
- ADD_EXECUTABLE(find_object_app MACOSX_BUNDLE ${SRC_FILES})
-ELSEIF(MINGW)
- ADD_EXECUTABLE(find_object_app WIN32 ${SRC_FILES})
-ELSE()
- ADD_EXECUTABLE(find_object_app ${SRC_FILES})
-ENDIF()
-# Linking with Qt libraries
-TARGET_LINK_LIBRARIES(find_object_app find_object ${LIBRARIES})
-IF(Qt5_FOUND)
- QT5_USE_MODULES(find_object_app Widgets Core Gui Network PrintSupport)
-ENDIF(Qt5_FOUND)
-
-IF(APPLE AND BUILD_AS_BUNDLE)
- SET_TARGET_PROPERTIES(find_object_app PROPERTIES
- OUTPUT_NAME ${CMAKE_BUNDLE_NAME})
-ELSEIF(WIN32)
- SET_TARGET_PROPERTIES(find_object_app PROPERTIES
- OUTPUT_NAME ${PROJECT_NAME})
-ELSE()
- SET_TARGET_PROPERTIES(find_object_app PROPERTIES
- OUTPUT_NAME ${PROJECT_PREFIX})
-ENDIF()
-
-#---------------------------
-# Installation stuff
-#---------------------------
-INSTALL(TARGETS find_object_app
- RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT runtime
- BUNDLE DESTINATION "${CMAKE_BUNDLE_LOCATION}" COMPONENT runtime)
-
-#---------------------------
-# Dependencies packaging
-#---------------------------
-IF(APPLE AND BUILD_AS_BUNDLE)
- INSTALL(CODE "execute_process(COMMAND ln -s \"../MacOS/${CMAKE_BUNDLE_NAME}\" ${PROJECT_NAME}
- WORKING_DIRECTORY \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/bin)")
-ENDIF(APPLE AND BUILD_AS_BUNDLE)
-
-IF((APPLE AND BUILD_AS_BUNDLE) OR WIN32)
- SET(APPS "\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/bin/${PROJECT_NAME}${CMAKE_EXECUTABLE_SUFFIX}")
- SET(plugin_dest_dir bin)
- SET(qtconf_dest_dir bin)
- IF(APPLE)
- SET(plugin_dest_dir MacOS)
- SET(qtconf_dest_dir Resources)
- SET(APPS "\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/MacOS/${CMAKE_BUNDLE_NAME}")
- ENDIF(APPLE)
-
- # Install needed Qt plugins by copying directories from the qt installation
- # One can cull what gets copied by using 'REGEX "..." EXCLUDE'
- # Exclude debug libraries
- IF(QT_PLUGINS_DIR)
- INSTALL(DIRECTORY "${QT_PLUGINS_DIR}/imageformats"
- DESTINATION ${plugin_dest_dir}/plugins
- COMPONENT runtime
- REGEX ".*d4.dll" EXCLUDE
- REGEX ".*d4.a" EXCLUDE)
- ELSE()
- #Qt5
- foreach(plugin ${Qt5Gui_PLUGINS})
- get_target_property(plugin_loc ${plugin} LOCATION)
- get_filename_component(plugin_dir ${plugin_loc} DIRECTORY)
- string(REPLACE "plugins" ";" loc_list ${plugin_dir})
- list(GET loc_list 1 plugin_type)
- #MESSAGE(STATUS "Qt5 plugin \"${plugin_loc}\" installed in \"${plugin_dest_dir}/plugins${plugin_type}\"")
- INSTALL(FILES ${plugin_loc}
- DESTINATION ${plugin_dest_dir}/plugins${plugin_type}
- COMPONENT runtime)
- endforeach()
- ENDIF()
-
- # install a qt.conf file
- # this inserts some cmake code into the install script to write the file
- SET(QT_CONF_FILE [Paths]\nPlugins=plugins)
- IF(APPLE)
- SET(QT_CONF_FILE [Paths]\nPlugins=MacOS/plugins)
- ENDIF(APPLE)
- INSTALL(CODE "
- file(WRITE \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${qtconf_dest_dir}/qt.conf\" \"${QT_CONF_FILE}\")
- " COMPONENT runtime)
-
- # directories to look for dependencies
- SET(DIRS ${QT_LIBRARY_DIRS} ${PROJECT_SOURCE_DIR}/bin)
- IF(APPLE)
- SET(DIRS ${DIRS} /usr/local /usr/local/lib)
- ENDIF(APPLE)
-
- # Now the work of copying dependencies into the bundle/package
- # The quotes are escaped and variables to use at install time have their $ escaped
- # An alternative is the do a configure_file() on a script and use install(SCRIPT ...).
- # Note that the image plugins depend on QtSvg and QtXml, and it got those copied
- # over.
- # To find dependencies, cmake use "otool" on Apple and "dumpbin" on Windows (make sure you have one of them).
- install(CODE "
- file(GLOB_RECURSE QTPLUGINS \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${plugin_dest_dir}/plugins/*${CMAKE_SHARED_LIBRARY_SUFFIX}\")
- include(\"BundleUtilities\")
- fixup_bundle(\"${APPS}\" \"\${QTPLUGINS}\" \"${DIRS}\")
- " COMPONENT runtime)
-ENDIF((APPLE AND BUILD_AS_BUNDLE) OR WIN32)
-
diff --git a/find-object/app/Find-Object.icns b/find-object/app/Find-Object.icns
deleted file mode 100644
index a0d1e741..00000000
Binary files a/find-object/app/Find-Object.icns and /dev/null differ
diff --git a/find-object/app/Find-Object.ico b/find-object/app/Find-Object.ico
deleted file mode 100644
index a4d84855..00000000
Binary files a/find-object/app/Find-Object.ico and /dev/null differ
diff --git a/find-object/app/Find-Object.ifx b/find-object/app/Find-Object.ifx
deleted file mode 100644
index 773ed036..00000000
Binary files a/find-object/app/Find-Object.ifx and /dev/null differ
diff --git a/find-object/app/Find-Object.rc b/find-object/app/Find-Object.rc
deleted file mode 100644
index 1809e18d..00000000
--- a/find-object/app/Find-Object.rc
+++ /dev/null
@@ -1 +0,0 @@
-IDI_ICON1 ICON DISCARDABLE "Find-Object.ico"
diff --git a/find-object/app/TcpServerPool.h b/find-object/app/TcpServerPool.h
deleted file mode 100644
index 98306d5a..00000000
--- a/find-object/app/TcpServerPool.h
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * TcpServerPool.h
- *
- * Created on: Nov 29, 2015
- * Author: mathieu
- */
-
-#ifndef TCPSERVERPOOL_H_
-#define TCPSERVERPOOL_H_
-
-#include
-#include
-#include
-#include
-#include
-
-class FindObjectWorker : public QObject
-{
- Q_OBJECT;
-
-public:
- FindObjectWorker(
- find_object::FindObject * sharedFindObject,
- QSemaphore * sharedSemaphore,
- int maxSemaphoreResources,
- QObject * parent = 0) :
- QObject(parent),
- sharedFindObject_(sharedFindObject),
- sharedSemaphore_(sharedSemaphore),
- maxSemaphoreResources_(maxSemaphoreResources)
- {
- UASSERT(sharedFindObject != 0);
- UASSERT(sharedSemaphore != 0);
- UASSERT(maxSemaphoreResources > 0);
- }
-
-public Q_SLOTS:
- void detect(const cv::Mat & image)
- {
- sharedSemaphore_->acquire(1);
- UINFO("Thread %p detecting...", (void *)this->thread());
- find_object::DetectionInfo info;
- sharedFindObject_->detect(image, info);
- Q_EMIT objectsFound(info);
- sharedSemaphore_->release(1);
- }
-
- void addObjectAndUpdate(const cv::Mat & image, int id, const QString & filePath)
- {
- //block everyone!
- sharedSemaphore_->acquire(maxSemaphoreResources_);
- UINFO("Thread %p adding object %d (%s)...", (void *)this->thread(), id, filePath.toStdString().c_str());
- sharedFindObject_->addObjectAndUpdate(image, id, filePath);
- sharedSemaphore_->release(maxSemaphoreResources_);
- }
- void removeObjectAndUpdate(int id)
- {
- //block everyone!
- sharedSemaphore_->acquire(maxSemaphoreResources_);
- UINFO("Thread %p removing object %d...", (void *)this->thread(), id);
- sharedFindObject_->removeObjectAndUpdate(id);
- sharedSemaphore_->release(maxSemaphoreResources_);
- }
-
-Q_SIGNALS:
- void objectsFound(const find_object::DetectionInfo &);
-
-private:
- find_object::FindObject * sharedFindObject_; //shared findobject
- QSemaphore * sharedSemaphore_;
- int maxSemaphoreResources_;
-};
-
-class TcpServerPool : public QObject
-{
- Q_OBJECT;
-public:
- TcpServerPool(find_object::FindObject * sharedFindObject, int threads, int port) :
- sharedSemaphore_(threads)
- {
- UASSERT(sharedFindObject != 0);
- UASSERT(threads>=1);
-
- qRegisterMetaType("cv::Mat");
-
- threadPool_.resize(threads);
- for(int i=0; igetPort(),
- tcpServer->getHostAddress().toString().toStdString().c_str());
-
- threadPool_[i] = new QThread(this);
- FindObjectWorker * worker = new FindObjectWorker(sharedFindObject, &sharedSemaphore_, threads);
-
- tcpServer->moveToThread(threadPool_[i]);
- worker->moveToThread(threadPool_[i]);
- connect(threadPool_[i], SIGNAL(finished()), tcpServer, SLOT(deleteLater()));
- connect(threadPool_[i], SIGNAL(finished()), worker, SLOT(deleteLater()));
-
- // connect stuff:
- QObject::connect(worker, SIGNAL(objectsFound(find_object::DetectionInfo)), tcpServer, SLOT(publishDetectionInfo(find_object::DetectionInfo)));
- QObject::connect(tcpServer, SIGNAL(detectObject(const cv::Mat &)), worker, SLOT(detect(const cv::Mat &)));
- QObject::connect(tcpServer, SIGNAL(addObject(const cv::Mat &, int, const QString &)), worker, SLOT(addObjectAndUpdate(const cv::Mat &, int, const QString &)));
- QObject::connect(tcpServer, SIGNAL(removeObject(int)), worker, SLOT(removeObjectAndUpdate(int)));
- threadPool_[i]->start();
- }
- }
-
- virtual ~TcpServerPool()
- {
- for(int i=0; iquit();
- threadPool_[i]->wait();
- }
- }
-
-private:
- QVector threadPool_;
- QSemaphore sharedSemaphore_;
-};
-
-
-
-#endif /* TCPSERVERPOOL_H_ */
diff --git a/find-object/app/main.cpp b/find-object/app/main.cpp
deleted file mode 100644
index 9ee019d2..00000000
--- a/find-object/app/main.cpp
+++ /dev/null
@@ -1,685 +0,0 @@
-/*
-Copyright (c) 2011-2014, Mathieu Labbe - IntRoLab - Universite de Sherbrooke
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- * Neither the name of the Universite de Sherbrooke nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include
-#include
-#include
-#include
-#include
-#include "find_object/MainWindow.h"
-#include "find_object/Settings.h"
-#include "find_object/FindObject.h"
-#include "find_object/Camera.h"
-#include "find_object/TcpServer.h"
-#include "find_object/JsonWriter.h"
-#include "find_object/utilite/ULogger.h"
-#include "TcpServerPool.h"
-
-bool running = true;
-
-#ifdef WIN32
-#include
-BOOL WINAPI my_handler(DWORD signal)
-{
- if (signal == CTRL_C_EVENT)
- {
- printf("\nCtrl-C caught! Quitting application...\n");
- QCoreApplication::quit();
- }
- return TRUE;
- running = false;
-}
-#else
-#include
-void my_handler(int s)
-{
- printf("\nCtrl-C caught! Quitting application...\n");
- QCoreApplication::quit();
- running = false;
-}
-inline void Sleep(unsigned int ms)
-{
- struct timespec req;
- struct timespec rem;
- req.tv_sec = ms / 1000;
- req.tv_nsec = (ms - req.tv_sec * 1000) * 1000 * 1000;
- nanosleep (&req, &rem);
-}
-#endif
-
-void setupQuitSignal()
-{
-// Catch ctrl-c to close Qt
-#ifdef WIN32
- if (!SetConsoleCtrlHandler(my_handler, TRUE))
- {
- UERROR("Could not set control (ctrl-c) handler");
- }
-#else
- struct sigaction sigIntHandler;
- sigIntHandler.sa_handler = my_handler;
- sigemptyset(&sigIntHandler.sa_mask);
- sigIntHandler.sa_flags = 0;
- sigaction(SIGINT, &sigIntHandler, NULL);
-#endif
-}
-
-void showUsage()
-{
- printf("\nUsage:\n"
-#ifdef WIN32
- " Find-Object.exe [options]\n"
-#else
- " find_object [options]\n"
-#endif
- "Options:\n"
- " --console Don't use the GUI (by default the camera will be\n"
- " started automatically). Option --objects must also be\n"
- " used with valid objects.\n"
- " --session \"path\" Path to a session to load (*.bin). Use \"--session_new\" to\n"
- " create a session instead (will be saved to \"path\" on exit, only\n"
- " on console mode).\n"
- " --object \"path\" Path to an object to detect.\n"
- " --objects \"path\" Directory of the objects to detect (--object is ignored).\n"
- " --config \"path\" Path to configuration file (default: %s).\n"
- " If set to \"\", default parameters are used\n"
- " without saving modified parameters on closing.\n"
- " --scene \"path\" Path to a scene image file.\n"
- " --vocabulary \"path\" Path to a vocabulary file (*.yaml *.xml). Parameters \"General/invertedSearch\"\n"
- " and \"General/vocabularyFixed\" will be also enabled. Ignored if \"--session\" is set.\n"
- " --images_not_saved Don't keep images in RAM after the features are extracted (only\n"
- " in console mode). Images won't be saved if an output session is set.\n"
- " --tcp_threads # Number of TCP threads (default 1, only in --console mode). \"--General/port\" parameter should not be 0.\n"
- " Port numbers start from \"General/port\" value. \"Detect\" TCP service can be\n"
- " executed at the same time by multiple threads. \"Add/Remove\" TCP services\n"
- " cannot be called by multiple threads, so calling these services on a port\n "
- " will block all other threads on the other ports.\n"
- " --debug Show debug log.\n"
- " --log-time Show log with time.\n"
- " --params Show all parameters.\n"
- " --defaults Use default parameters (--config is ignored).\n"
- " --My/Parameter \"value\" Set find-Object's parameter (look --params for parameters' name).\n"
- " It will override the one in --config. Example to set 4 threads:\n"
- " $ find_object --General/threads 4\n"
- " --json \"path\" Path to an output JSON file (only in --console mode with --scene).\n"
- " --help Show usage.\n"
- , find_object::Settings::iniDefaultPath().toStdString().c_str());
- exit(-1);
-}
-
-int main(int argc, char* argv[])
-{
- ULogger::setType(ULogger::kTypeConsole);
- ULogger::setLevel(ULogger::kInfo);
- ULogger::setPrintWhere(false);
- ULogger::setPrintTime(false);
-
- //////////////////////////
- // parse options BEGIN
- //////////////////////////
- bool guiMode = true;
- QString sessionPath = "";
- bool sessionNew = false;
- QString objectsPath = "";
- QString objectPath = "";
- QString scenePath = "";
- QString configPath = "";
- QString vocabularyPath = "";
- QString jsonPath;
- find_object::ParametersMap customParameters;
- bool imagesSaved = true;
- int tcpThreads = 1;
-
- for(int i=1; i= 1!\n");
- showUsage();
- }
- }
- else
- {
- showUsage();
- }
- continue;
- }
- if(strcmp(argv[i], "--params") == 0)
- {
- find_object::ParametersMap parameters = find_object::Settings::getDefaultParameters();
- for(find_object::ParametersMap::iterator iter=parameters.begin(); iter!=parameters.end(); ++iter)
- {
- std::string str = "Param: " + iter.key().toStdString() + " = \"" + iter.value().toString().toStdString() + "\"";
- std::cout <<
- str <<
- std::setw(60 - str.size()) <<
- " [" <<
- find_object::Settings::getDescriptions().value(iter.key()).toStdString().c_str() <<
- "]" <<
- std::endl;
- }
- UINFO("Node will now exit after showing default Find-Object's parameters because "
- "argument \"--params\" is detected!");
- exit(0);
- }
-
- // Check for custom parameters:
- find_object::ParametersMap parameters = find_object::Settings::getDefaultParameters();
- QString name = argv[i];
- if(name.size() > 2)
- {
- //strip the "--"
- name.remove(0, 2);
- if(parameters.contains(name))
- {
- ++i;
- if(i < argc)
- {
- customParameters.insert(name, argv[i]);
- }
- else
- {
- showUsage();
- }
- continue;
- }
- }
-
- UERROR("Unrecognized option : %s", argv[i]);
- showUsage();
- }
-
- UINFO("Options:");
- UINFO(" GUI mode = %s", guiMode?"true":"false");
- if(!sessionPath.isEmpty())
- {
- if(sessionNew)
- {
- UINFO(" Session path: \"%s\" [NEW]", sessionPath.toStdString().c_str());
- if(configPath.isEmpty() && guiMode)
- {
- configPath = find_object::Settings::iniDefaultPath();
- }
- }
- else
- {
- UINFO(" Session path: \"%s\"", sessionPath.toStdString().c_str());
- if(!vocabularyPath.isEmpty())
- {
- UWARN("Vocabulary \"%s\" is not loaded as a session \"%s\" is already "
- "loaded, ignoring vocabulary file...",
- vocabularyPath.toStdString().c_str(),
- sessionPath.toStdString().c_str());
- vocabularyPath.clear();
- }
- if(!configPath.isEmpty())
- {
- UWARN("A session \"%s\" is loaded and a config file is also used, "
- "the parameters of the session will be overwritten by "
- "those in the config file \"%s\".",
- sessionPath.toStdString().c_str(),
- configPath.toStdString().c_str());
- }
- }
- }
- else if(configPath.isEmpty() && guiMode)
- {
- configPath = find_object::Settings::iniDefaultPath();
- }
- if(!objectsPath.isEmpty())
- {
- UINFO(" Objects path: \"%s\"", objectsPath.toStdString().c_str());
- }
- else if(!objectPath.isEmpty())
- {
- UINFO(" Object path: \"%s\"", objectPath.toStdString().c_str());
- }
- UINFO(" Scene path: \"%s\"", scenePath.toStdString().c_str());
- if(!guiMode)
- {
- UINFO(" JSON path: \"%s\"", jsonPath.toStdString().c_str());
- }
- UINFO(" Settings path: \"%s\"", configPath.toStdString().c_str());
- UINFO(" Vocabulary path: \"%s\"", vocabularyPath.toStdString().c_str());
-
- if(!vocabularyPath.isEmpty())
- {
- if(customParameters.contains(find_object::Settings::kGeneral_vocabularyFixed()))
- {
- UWARN("\"General/vocabularyFixed\" custom parameter overwritten as a fixed vocabulary is used.");
- }
- if(customParameters.contains(find_object::Settings::kGeneral_invertedSearch()))
- {
- UWARN("\"General/invertedSearch\" custom parameter overwritten as a fixed vocabulary is used.");
- }
- customParameters[find_object::Settings::kGeneral_vocabularyFixed()] = true;
- customParameters[find_object::Settings::kGeneral_invertedSearch()] = true;
- }
-
- for(find_object::ParametersMap::iterator iter= customParameters.begin(); iter!=customParameters.end(); ++iter)
- {
- UINFO(" Param \"%s\"=\"%s\"", iter.key().toStdString().c_str(), iter.value().toString().toStdString().c_str());
- }
-
- //////////////////////////
- // parse options END
- //////////////////////////
-
- // Load settings, should be loaded before creating other objects
- find_object::ParametersMap parameters;
- if(!configPath.isEmpty())
- {
- parameters = find_object::Settings::init(configPath);
- }
-
- // Override custom parameters:
- for(find_object::ParametersMap::iterator iter= customParameters.begin(); iter!=customParameters.end(); ++iter)
- {
- find_object::Settings::setParameter(iter.key(), iter.value());
- parameters.insert(iter.key(), iter.value());
- }
-
-
- // Create FindObject
- find_object::FindObject * findObject = new find_object::FindObject(guiMode || imagesSaved);
-
- // Load objects if path is set
- int objectsLoaded = 0;
- if(!sessionPath.isEmpty() && !sessionNew)
- {
- if(!findObject->loadSession(sessionPath, parameters))
- {
- UERROR("Could not load session \"%s\"", sessionPath.toStdString().c_str());
- }
- else
- {
- objectsLoaded = findObject->objects().size();
- }
- }
- else if(!vocabularyPath.isEmpty() && !findObject->loadVocabulary(vocabularyPath))
- {
- UERROR("Failed to load vocabulary \"%s\"", vocabularyPath.toStdString().c_str());
- }
-
- if(!objectsPath.isEmpty())
- {
- if(!vocabularyPath.isEmpty() && !findObject->loadVocabulary(vocabularyPath))
- {
- UERROR("Failed to load vocabulary \"%s\"", vocabularyPath.toStdString().c_str());
- }
- objectsLoaded = findObject->loadObjects(objectsPath);
- if(!objectsLoaded)
- {
- UWARN("No objects loaded from \"%s\"", objectsPath.toStdString().c_str());
- }
- }
- else if(!objectPath.isEmpty())
- {
- if(!vocabularyPath.isEmpty() && !findObject->loadVocabulary(vocabularyPath))
- {
- UERROR("Failed to load vocabulary \"%s\"", vocabularyPath.toStdString().c_str());
- }
-
- const find_object::ObjSignature * obj = findObject->addObject(objectPath);
- if(obj)
- {
- ++objectsLoaded;
- findObject->updateObjects();
- findObject->updateVocabulary();
- }
- else
- {
- UWARN("No object loaded from \"%s\"", objectsPath.toStdString().c_str());
- }
- }
-
- cv::Mat scene;
- if(!scenePath.isEmpty())
- {
- scene = cv::imread(scenePath.toStdString());
- if(scene.empty())
- {
- UERROR("Failed to load scene \"%s\"", scenePath.toStdString().c_str());
- }
- }
-
- if(guiMode)
- {
- QApplication app(argc, argv);
- find_object::MainWindow mainWindow(findObject, 0); // ownership transfered
-
- app.connect( &app, SIGNAL( lastWindowClosed() ), &app, SLOT( quit() ) );
- mainWindow.show();
-
- if(!scene.empty())
- {
- mainWindow.update(scene);
- }
-
- app.exec();
-
- // Save settings
- find_object::Settings::saveSettings();
- }
- else
- {
- QCoreApplication app(argc, argv);
-
- if(!scene.empty())
- {
- // process the scene and exit
- QTime time;
- time.start();
- find_object::DetectionInfo info;
- findObject->detect(scene, info);
-
- if(info.objDetected_.size() > 1)
- {
- UINFO("%d objects detected! (%d ms)", (int)info.objDetected_.size(), time.elapsed());
- }
- else if(info.objDetected_.size() == 1)
- {
- UINFO("Object %d detected! (%d ms)", (int)info.objDetected_.begin().key(), time.elapsed());
- }
- else if(find_object::Settings::getGeneral_sendNoObjDetectedEvents())
- {
- UINFO("No objects detected. (%d ms)", time.elapsed());
- }
-
- if(!jsonPath.isEmpty())
- {
- find_object::JsonWriter::write(info, jsonPath);
- UINFO("JSON written to \"%s\"", jsonPath.toStdString().c_str());
- }
- }
- else
- {
- TcpServerPool tcpServerPool(findObject, tcpThreads, find_object::Settings::getGeneral_port());
-
- setupQuitSignal();
-
- //If TCP camera is used
- find_object::Camera * camera = 0;
- if(find_object::Settings::getCamera_6useTcpCamera())
- {
- camera = new find_object::Camera();
-
- // [Camera] ---Image---> [FindObject]
- QObject::connect(camera, SIGNAL(imageReceived(const cv::Mat &)), findObject, SLOT(detect(const cv::Mat &)));
- QObject::connect(camera, SIGNAL(finished()), &app, SLOT(quit()));
-
- if(!camera->start())
- {
- UERROR("Camera initialization failed!");
- running = false;
- }
- }
-
- // start processing!
- if(running)
- {
- app.exec();
-
- if(!sessionPath.isEmpty())
- {
- if(findObject->isSessionModified())
- {
- UINFO("The session has been modified, updating the session file...");
- if(findObject->saveSession(sessionPath))
- {
- UINFO("Session \"%s\" successfully saved (%d objects)!",
- sessionPath.toStdString().c_str(), findObject->objects().size());
- }
- }
- else if(sessionNew)
- {
- UINFO("The session has not been modified, session file not created...");
- }
- }
- }
-
- // cleanup
- if(camera)
- {
- camera->stop();
- delete camera;
- }
- }
-
- delete findObject;
- }
- return 0;
-}
diff --git a/find-object/bin/.gitignore b/find-object/bin/.gitignore
deleted file mode 100644
index bef66adf..00000000
--- a/find-object/bin/.gitignore
+++ /dev/null
@@ -1,8 +0,0 @@
-# Ignore everything in this directory
-*
-# Except this file
-!.gitignore
-!box_in_scene.png
-!box.png
-!multi-objs
-!multi-scene.jpg
diff --git a/find-object/bin/box.png b/find-object/bin/box.png
deleted file mode 100644
index 6f01082f..00000000
Binary files a/find-object/bin/box.png and /dev/null differ
diff --git a/find-object/bin/box_in_scene.png b/find-object/bin/box_in_scene.png
deleted file mode 100644
index cff246a3..00000000
Binary files a/find-object/bin/box_in_scene.png and /dev/null differ
diff --git a/find-object/bin/multi-objs/38.bmp b/find-object/bin/multi-objs/38.bmp
deleted file mode 100644
index 8f034516..00000000
Binary files a/find-object/bin/multi-objs/38.bmp and /dev/null differ
diff --git a/find-object/bin/multi-objs/39.bmp b/find-object/bin/multi-objs/39.bmp
deleted file mode 100644
index 38e1ffbc..00000000
Binary files a/find-object/bin/multi-objs/39.bmp and /dev/null differ
diff --git a/find-object/bin/multi-scene.jpg b/find-object/bin/multi-scene.jpg
deleted file mode 100644
index 45a411a5..00000000
Binary files a/find-object/bin/multi-scene.jpg and /dev/null differ
diff --git a/find-object/build/.empty b/find-object/build/.empty
deleted file mode 100644
index e69de29b..00000000
diff --git a/find-object/build/.gitignore b/find-object/build/.gitignore
deleted file mode 100644
index 5e7d2734..00000000
--- a/find-object/build/.gitignore
+++ /dev/null
@@ -1,4 +0,0 @@
-# Ignore everything in this directory
-*
-# Except this file
-!.gitignore
diff --git a/find-object/cmake_modules/FindTcmalloc.cmake b/find-object/cmake_modules/FindTcmalloc.cmake
deleted file mode 100644
index fbfe24fb..00000000
--- a/find-object/cmake_modules/FindTcmalloc.cmake
+++ /dev/null
@@ -1,34 +0,0 @@
-# - Find Tcmalloc
-# Find the native Tcmalloc library
-#
-# Tcmalloc_LIBRARIES - List of libraries when using Tcmalloc.
-# Tcmalloc_FOUND - True if Tcmalloc found.
-
-if (USE_TCMALLOC)
- set(Tcmalloc_NAMES tcmalloc)
-else ()
- set(Tcmalloc_NAMES tcmalloc_minimal tcmalloc)
-endif ()
-
-find_library(Tcmalloc_LIBRARY NAMES ${Tcmalloc_NAMES})
-
-if (Tcmalloc_LIBRARY)
- set(Tcmalloc_FOUND TRUE)
- set( Tcmalloc_LIBRARIES ${Tcmalloc_LIBRARY} )
-else ()
- set(Tcmalloc_FOUND FALSE)
- set( Tcmalloc_LIBRARIES )
-endif ()
-
-if (Tcmalloc_FOUND)
- message(STATUS "Found Tcmalloc: ${Tcmalloc_LIBRARY}")
-else ()
- message(STATUS "Not Found Tcmalloc: ${Tcmalloc_LIBRARY}")
- if (Tcmalloc_FIND_REQUIRED)
- message(STATUS "Looked for Tcmalloc libraries named ${Tcmalloc_NAMES}.")
- message(FATAL_ERROR "Could NOT find Tcmalloc library")
- endif ()
-endif ()
-
-mark_as_advanced(Tcmalloc_LIBRARY)
-
diff --git a/find-object/cmake_uninstall.cmake.in b/find-object/cmake_uninstall.cmake.in
deleted file mode 100644
index 14e60101..00000000
--- a/find-object/cmake_uninstall.cmake.in
+++ /dev/null
@@ -1,27 +0,0 @@
-# -----------------------------------------------
-# File that provides "make uninstall" target
-# We use the file 'install_manifest.txt'
-# -----------------------------------------------
-IF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
- MESSAGE(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"")
-ENDIF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
-
-FILE(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
-STRING(REGEX REPLACE "\n" ";" files "${files}")
-FOREACH(file ${files})
- MESSAGE(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"")
- IF(EXISTS "$ENV{DESTDIR}${file}")
- EXEC_PROGRAM(
- "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
- OUTPUT_VARIABLE rm_out
- RETURN_VALUE rm_retval
- )
- IF(NOT "${rm_retval}" STREQUAL 0)
- MESSAGE(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"")
- ENDIF(NOT "${rm_retval}" STREQUAL 0)
- ELSE(EXISTS "$ENV{DESTDIR}${file}")
- MESSAGE(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.")
- ENDIF(EXISTS "$ENV{DESTDIR}${file}")
-ENDFOREACH(file)
-
-
diff --git a/find-object/example/CMakeLists.txt b/find-object/example/CMakeLists.txt
deleted file mode 100644
index 61dd9fa6..00000000
--- a/find-object/example/CMakeLists.txt
+++ /dev/null
@@ -1,38 +0,0 @@
-
-SET(SRC_FILES
- main.cpp
-)
-
-SET(INCLUDE_DIRS
- ${CMAKE_CURRENT_SOURCE_DIR}
- ${OpenCV_INCLUDE_DIRS}
- ${CMAKE_CURRENT_SOURCE_DIR}/../include
-)
-
-IF(QT4_FOUND)
- INCLUDE(${QT_USE_FILE})
-ENDIF(QT4_FOUND)
-
-SET(LIBRARIES
- ${OpenCV_LIBS}
- ${QT_LIBRARIES}
-)
-
-# Make sure the compiler can find include files from our library.
-INCLUDE_DIRECTORIES(${INCLUDE_DIRS})
-
-# Add binary called "example" that is built from the source file "main.cpp".
-# The extension is automatically found.
-ADD_EXECUTABLE(example ${SRC_FILES})
-TARGET_LINK_LIBRARIES(example find_object ${LIBRARIES})
-IF(Qt5_FOUND)
- QT5_USE_MODULES(example Widgets Core Gui Network PrintSupport)
-ENDIF(Qt5_FOUND)
-
-SET_TARGET_PROPERTIES( example
- PROPERTIES OUTPUT_NAME ${PROJECT_PREFIX}-example)
-
-INSTALL(TARGETS example
- RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT runtime
- BUNDLE DESTINATION "${CMAKE_BUNDLE_LOCATION}" COMPONENT runtime)
-
diff --git a/find-object/example/main.cpp b/find-object/example/main.cpp
deleted file mode 100644
index 7e47b1e1..00000000
--- a/find-object/example/main.cpp
+++ /dev/null
@@ -1,346 +0,0 @@
-/*
-Copyright (c) 2011-2014, Mathieu Labbe - IntRoLab - Universite de Sherbrooke
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- * Neither the name of the Universite de Sherbrooke nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include
-
-// Qt stuff
-#include
-#include
-#include
-#include
-#include
-#include
-
-// OpenCV stuff
-#include
-#include
-#include
-#include // for homography
-
-#include
-
-#ifdef HAVE_OPENCV_NONFREE
- #if CV_MAJOR_VERSION == 2 && CV_MINOR_VERSION >=4
- #include
- #include
- #endif
-#endif
-#ifdef HAVE_OPENCV_XFEATURES2D
- #include
- #include
-#endif
-
-
-// From this project
-#include "find_object/ObjWidget.h"
-#include "find_object/QtOpenCV.h"
-
-using namespace find_object;
-
-void showUsage()
-{
- printf("\n");
- printf("Usage :\n");
- printf(" ./example object.png scene.png\n");
- exit(1);
-}
-
-int main(int argc, char * argv[])
-{
- if(argc<3)
- {
- showUsage();
- }
- QTime time;
-
- // GUI stuff
- QApplication app(argc, argv);
-
- time.start();
- //Load as grayscale
- cv::Mat objectImg = cv::imread(argv[1], cv::IMREAD_GRAYSCALE);
- cv::Mat sceneImg = cv::imread(argv[2], cv::IMREAD_GRAYSCALE);
-
- if(!objectImg.empty() && !sceneImg.empty())
- {
- printf("Loading images: %d ms\n", time.restart());
- std::vector objectKeypoints;
- std::vector sceneKeypoints;
- cv::Mat objectDescriptors;
- cv::Mat sceneDescriptors;
-
- ////////////////////////////
- // EXTRACT KEYPOINTS
- ////////////////////////////
- cv::Ptr detector;
- // The detector can be any of (see OpenCV features2d.hpp):
-#if CV_MAJOR_VERSION == 2
- // detector = cv::Ptr(new cv::DenseFeatureDetector());
- // detector = cv::Ptr(new cv::FastFeatureDetector());
- // detector = cv::Ptr(new cv::GFTTDetector());
- // detector = cv::Ptr(new cv::MSER());
- // detector = cv::Ptr(new cv::ORB());
- detector = cv::Ptr(new cv::SIFT());
- // detector = cv::Ptr(new cv::StarFeatureDetector());
- // detector = cv::Ptr(new cv::SURF(600.0));
- // detector = cv::Ptr(new cv::BRISK());
-#elif CV_MAJOR_VERSION < 4 || (CV_MAJOR_VERSION == 4 && CV_MINOR_VERSION < 3)
- detector = cv::xfeatures2d::SIFT::create();
-#else // >= 4.3.0
- detector = cv::SIFT::create();
-#endif
- detector->detect(objectImg, objectKeypoints);
- printf("Object: %d keypoints detected in %d ms\n", (int)objectKeypoints.size(), time.restart());
- detector->detect(sceneImg, sceneKeypoints);
- printf("Scene: %d keypoints detected in %d ms\n", (int)sceneKeypoints.size(), time.restart());
-
- ////////////////////////////
- // EXTRACT DESCRIPTORS
- ////////////////////////////
- cv::Ptr extractor;
-#if CV_MAJOR_VERSION == 2
- // The extractor can be any of (see OpenCV features2d.hpp):
- // extractor = cv::Ptr(new cv::BriefDescriptorExtractor());
- // extractor = cv::Ptr(new cv::ORB());
- extractor = cv::Ptr(new cv::SIFT());
- // extractor = cv::Ptr(new cv::SURF(600.0));
- // extractor = cv::Ptr(new cv::BRISK());
- // extractor = cv::Ptr(new cv::FREAK());
-#elif CV_MAJOR_VERSION < 4 || (CV_MAJOR_VERSION == 4 && CV_MINOR_VERSION < 3)
- extractor = cv::xfeatures2d::SIFT::create();
-#else // >= 4.3.0
- extractor = cv::SIFT::create();
-#endif
- extractor->compute(objectImg, objectKeypoints, objectDescriptors);
- printf("Object: %d descriptors extracted in %d ms\n", objectDescriptors.rows, time.restart());
- extractor->compute(sceneImg, sceneKeypoints, sceneDescriptors);
- printf("Scene: %d descriptors extracted in %d ms\n", sceneDescriptors.rows, time.restart());
-
- ////////////////////////////
- // NEAREST NEIGHBOR MATCHING USING FLANN LIBRARY (included in OpenCV)
- ////////////////////////////
- cv::Mat results;
- cv::Mat dists;
- std::vector > matches;
- int k=2; // find the 2 nearest neighbors
- bool useBFMatcher = false; // SET TO TRUE TO USE BRUTE FORCE MATCHER
- if(objectDescriptors.type()==CV_8U)
- {
- // Binary descriptors detected (from ORB, Brief, BRISK, FREAK)
- printf("Binary descriptors detected...\n");
- if(useBFMatcher)
- {
- cv::BFMatcher matcher(cv::NORM_HAMMING); // use cv::NORM_HAMMING2 for ORB descriptor with WTA_K == 3 or 4 (see ORB constructor)
- matcher.knnMatch(objectDescriptors, sceneDescriptors, matches, k);
- }
- else
- {
- // Create Flann LSH index
- cv::flann::Index flannIndex(sceneDescriptors, cv::flann::LshIndexParams(12, 20, 2), cvflann::FLANN_DIST_HAMMING);
- printf("Time creating FLANN LSH index = %d ms\n", time.restart());
-
- // search (nearest neighbor)
- flannIndex.knnSearch(objectDescriptors, results, dists, k, cv::flann::SearchParams() );
- }
- }
- else
- {
- // assume it is CV_32F
- printf("Float descriptors detected...\n");
- if(useBFMatcher)
- {
- cv::BFMatcher matcher(cv::NORM_L2);
- matcher.knnMatch(objectDescriptors, sceneDescriptors, matches, k);
- }
- else
- {
- // Create Flann KDTree index
- cv::flann::Index flannIndex(sceneDescriptors, cv::flann::KDTreeIndexParams(), cvflann::FLANN_DIST_EUCLIDEAN);
- printf("Time creating FLANN KDTree index = %d ms\n", time.restart());
-
- // search (nearest neighbor)
- flannIndex.knnSearch(objectDescriptors, results, dists, k, cv::flann::SearchParams() );
- }
- }
- printf("Time nearest neighbor search = %d ms\n", time.restart());
-
- // Conversion to CV_32F if needed
- if(dists.type() == CV_32S)
- {
- cv::Mat temp;
- dists.convertTo(temp, CV_32F);
- dists = temp;
- }
-
-
- ////////////////////////////
- // PROCESS NEAREST NEIGHBOR RESULTS
- ////////////////////////////
- // Set gui data
- ObjWidget objWidget(0, objectKeypoints, QMultiMap(), cvtCvMat2QImage(objectImg));
- ObjWidget sceneWidget(0, sceneKeypoints, QMultiMap(), cvtCvMat2QImage(sceneImg));
-
- // Find correspondences by NNDR (Nearest Neighbor Distance Ratio)
- float nndrRatio = 0.8f;
- std::vector mpts_1, mpts_2; // Used for homography
- std::vector indexes_1, indexes_2; // Used for homography
- std::vector outlier_mask; // Used for homography
- // Check if this descriptor matches with those of the objects
- if(!useBFMatcher)
- {
- for(int i=0; i(i,0), dists.at(i,1));
- if(results.at(i,0) >= 0 && results.at(i,1) >= 0 &&
- dists.at(i,0) <= nndrRatio * dists.at(i,1))
- {
- mpts_1.push_back(objectKeypoints.at(i).pt);
- indexes_1.push_back(i);
-
- mpts_2.push_back(sceneKeypoints.at(results.at(i,0)).pt);
- indexes_2.push_back(results.at(i,0));
- }
- }
- }
- else
- {
- for(unsigned int i=0; i= minInliers)
- {
- time.start();
- cv::Mat H = findHomography(mpts_1,
- mpts_2,
- cv::RANSAC,
- 1.0,
- outlier_mask);
- printf("Time finding homography = %d ms\n", time.restart());
- int inliers=0, outliers=0;
- for(unsigned int k=0; k(0,0), H.at(1,0), H.at(2,0),
- H.at(0,1), H.at(1,1), H.at(2,1),
- H.at(0,2), H.at(1,2), H.at(2,2));
-
- // GUI : Change color and add homography rectangle
- QColor color(Qt::green);
- int alpha = 130;
- color.setAlpha(alpha);
- for(unsigned int k=0; ksetPen(rectPen);
- rectItem->setTransform(hTransform);
- sceneWidget.addRect(rectItem);
- printf("Inliers=%d Outliers=%d\n", inliers, outliers);
- }
- else
- {
- printf("Not enough matches (%d) for homography...\n", (int)mpts_1.size());
- }
-
- // Wait for gui
- objWidget.setGraphicsViewMode(false);
- objWidget.setWindowTitle("Object");
- if(objWidget.pixmap().width() <= 800)
- {
- objWidget.setMinimumSize(objWidget.pixmap().width(), objWidget.pixmap().height());
- }
- else
- {
- objWidget.setMinimumSize(800, 600);
- objWidget.setAutoScale(false);
- }
-
- sceneWidget.setGraphicsViewMode(false);
- sceneWidget.setWindowTitle("Scene");
- if(sceneWidget.pixmap().width() <= 800)
- {
- sceneWidget.setMinimumSize(sceneWidget.pixmap().width(), sceneWidget.pixmap().height());
- }
- else
- {
- sceneWidget.setMinimumSize(800, 600);
- sceneWidget.setAutoScale(false);
- }
-
- sceneWidget.show();
- objWidget.show();
-
- int r = app.exec();
- printf("Closing...\n");
-
- return r;
- }
- else
- {
- printf("Images are not valid!\n");
- showUsage();
- }
-
- return 1;
-}
diff --git a/find-object/include/find_object/.gitignore b/find-object/include/find_object/.gitignore
deleted file mode 100644
index 3503265b..00000000
--- a/find-object/include/find_object/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/Version.h
diff --git a/find-object/include/find_object/Camera.h b/find-object/include/find_object/Camera.h
deleted file mode 100644
index bd739522..00000000
--- a/find-object/include/find_object/Camera.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
-Copyright (c) 2011-2014, Mathieu Labbe - IntRoLab - Universite de Sherbrooke
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- * Neither the name of the Universite de Sherbrooke nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#ifndef CAMERA_H_
-#define CAMERA_H_
-
-#include
-#include "find_object/FindObjectExp.h" // DLL export/import defines
-#include
-#include
-#include
-#include
-
-namespace find_object {
-
-class CameraTcpServer;
-
-class FINDOBJECT_EXP Camera : public QObject {
- Q_OBJECT
-public:
- Camera(QObject * parent = 0);
- virtual ~Camera();
-
- virtual bool start();
- virtual void stop();
- virtual bool isRunning() {return cameraTimer_.isActive();}
-
- void pause();
- int getTotalFrames();
- int getCurrentFrameIndex();
- int getPort();
- void moveToFrame(int frame);
-
-Q_SIGNALS:
- void imageReceived(const cv::Mat & image);
- void imageReceived(const cv::Mat & image, const find_object::Header & header, const cv::Mat & depth, float depthConstant);
- void finished();
-
-public Q_SLOTS:
- virtual void updateImageRate();
- virtual void takeImage();
-
-protected:
- void startTimer();
- void stopTimer();
-
-private:
- cv::VideoCapture capture_;
- QTimer cameraTimer_;
- QList images_;
- unsigned int currentImageIndex_;
- CameraTcpServer * cameraTcpServer_;
-};
-
-} // namespace find_object
-
-#endif /* CAMERA_H_ */
diff --git a/find-object/include/find_object/DetectionInfo.h b/find-object/include/find_object/DetectionInfo.h
deleted file mode 100644
index 9ce34057..00000000
--- a/find-object/include/find_object/DetectionInfo.h
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
-Copyright (c) 2011-2014, Mathieu Labbe - IntRoLab - Universite de Sherbrooke
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- * Neither the name of the Universite de Sherbrooke nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#ifndef DETECTIONINFO_H_
-#define DETECTIONINFO_H_
-
-#include
-#include
-#include
-#include
-#include
-#include
-
-namespace find_object {
-
-class DetectionInfo
-{
-public:
- enum TimeStamp{
- kTimeKeypointDetection,
- kTimeDescriptorExtraction,
- kTimeSubPixelRefining,
- kTimeSkewAffine,
- kTimeIndexing,
- kTimeMatching,
- kTimeHomography,
- kTimeTotal
- };
- enum RejectedCode{
- kRejectedUndef,
- kRejectedLowMatches,
- kRejectedLowInliers,
- kRejectedSuperposed,
- kRejectedAllInliers,
- kRejectedNotValid,
- kRejectedCornersOutside,
- kRejectedByAngle
- };
-
-public:
- DetectionInfo() :
- minMatchedDistance_(-1),
- maxMatchedDistance_(-1)
- {}
-
-public:
- // Those maps have the same size
- QMultiMap objDetected_;
- QMultiMap objDetectedSizes_; // Object ID match the number of detected objects
- QMultiMap objDetectedFilePaths_; // Object ID match the number of detected objects
- QMultiMap objDetectedInliersCount_; // ObjectID match the number of detected objects
- QMultiMap objDetectedOutliersCount_; // ObjectID match the number of detected objects
- QMultiMap > objDetectedInliers_; // ObjectID Map< ObjectDescriptorIndex, SceneDescriptorIndex >, match the number of detected objects
- QMultiMap > objDetectedOutliers_; // ObjectID Map< ObjectDescriptorIndex, SceneDescriptorIndex >, match the number of detected objects
-
- QMap timeStamps_;
- std::vector sceneKeypoints_;
- cv::Mat sceneDescriptors_;
- QMultiMap sceneWords_;
- QMap > matches_; // ObjectID Map< ObjectDescriptorIndex, SceneDescriptorIndex >, match the number of objects
-
- // Those maps have the same size
- QMultiMap > rejectedInliers_; // ObjectID Map< ObjectDescriptorIndex, SceneDescriptorIndex >
- QMultiMap > rejectedOutliers_; // ObjectID Map< ObjectDescriptorIndex, SceneDescriptorIndex >
- QMultiMap rejectedCodes_; // ObjectID rejected code
-
- float minMatchedDistance_;
- float maxMatchedDistance_;
-};
-
-inline QDataStream & operator<<(QDataStream &out, const DetectionInfo & info)
-{
- out << quint32(info.objDetected_.size());
-
- QMultiMap::const_iterator iterInliers = info.objDetectedInliersCount_.constBegin();
- QMultiMap::const_iterator iterOutliers = info.objDetectedOutliersCount_.constBegin();
- QMultiMap::const_iterator iterSizes = info.objDetectedSizes_.constBegin();
- QMultiMap::const_iterator iterFilenames = info.objDetectedFilePaths_.constBegin();
- for(QMultiMap::const_iterator iter=info.objDetected_.constBegin();
- iter!=info.objDetected_.constEnd();
- ++iter)
- {
- // ID
- out << iter.key();
-
- // Size
- out << iterSizes.value();
-
- // Transform
- out << iter.value();
-
- // Filename
- out << iterFilenames.value();
-
- // inliers and outliers count
- out << iterInliers.value();
- out << iterOutliers.value();
-
- ++iterInliers;
- ++iterOutliers;
- ++iterSizes;
- ++iterFilenames;
- }
- return out;
-}
-
-inline QDataStream & operator>>(QDataStream &in, DetectionInfo & info)
-{
- QDataStream::Status oldStatus = in.status();
- in.resetStatus();
- info = DetectionInfo();
-
- quint32 n;
- in >> n;
-
- for (quint32 i = 0; i < n; ++i) {
- if (in.status() != QDataStream::Ok)
- break;
-
- int id;
- QSize size;
- QTransform homography;
- QString filename;
- int inliers, outliers;
- in >> id >> size >> homography >> filename >> inliers >> outliers;
- info.objDetected_.insert(id, homography);
- info.objDetectedSizes_.insert(id, size);
- info.objDetectedFilePaths_.insert(id, filename);
- info.objDetectedInliersCount_.insert(id, inliers);
- info.objDetectedOutliersCount_.insert(id, outliers);
- }
- if (in.status() != QDataStream::Ok)
- info = DetectionInfo();
- if (oldStatus != QDataStream::Ok)
- in.setStatus(oldStatus);
- return in;
-}
-
-} // namespace find_object
-
-#endif /* DETECTIONINFO_H_ */
diff --git a/find-object/include/find_object/FindObject.h b/find-object/include/find_object/FindObject.h
deleted file mode 100644
index d8702315..00000000
--- a/find-object/include/find_object/FindObject.h
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
-Copyright (c) 2011-2014, Mathieu Labbe - IntRoLab - Universite de Sherbrooke
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- * Neither the name of the Universite de Sherbrooke nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#ifndef FINDOBJECT_H_
-#define FINDOBJECT_H_
-
-#include
-#include "find_object/FindObjectExp.h" // DLL export/import defines
-
-#include "find_object/DetectionInfo.h"
-#include "find_object/Settings.h"
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-namespace find_object {
-
-class ObjSignature;
-class Vocabulary;
-class Feature2D;
-
-class FINDOBJECT_EXP FindObject : public QObject
-{
- Q_OBJECT;
-public:
- static void affineSkew(float tilt,
- float phi,
- const cv::Mat & image,
- cv::Mat & skewImage,
- cv::Mat & skewMask,
- cv::Mat & Ai);
-
-public:
- FindObject(bool keepImagesInRAM_ = true, QObject * parent = 0);
- virtual ~FindObject();
-
- bool loadSession(const QString & path, const ParametersMap & customParameters = ParametersMap());
- bool saveSession(const QString & path);
- bool isSessionModified() const {return sessionModified_;}
-
- bool saveVocabulary(const QString & filePath) const;
- bool loadVocabulary(const QString & filePath);
-
- int loadObjects(const QString & dirPath, bool recursive = false); // call updateObjects()
- const ObjSignature * addObject(const QString & filePath);
- const ObjSignature * addObject(const cv::Mat & image, int id=0, const QString & filePath = QString());
- bool addObject(ObjSignature * obj); // take ownership when true is returned
- void removeObject(int id);
- void removeAllObjects();
-
- bool detect(const cv::Mat & image, find_object::DetectionInfo & info) const;
-
- void updateDetectorExtractor();
- void updateObjects(const QList & ids = QList());
- void updateVocabulary(const QList & ids = QList());
-
- const QMap & objects() const {return objects_;}
- const Vocabulary * vocabulary() const {return vocabulary_;}
-
-public Q_SLOTS:
- void addObjectAndUpdate(const cv::Mat & image, int id=0, const QString & filePath = QString());
- void removeObjectAndUpdate(int id);
- void detect(const cv::Mat & image); // emit objectsFound()
- void detect(const cv::Mat & image, const find_object::Header & header, const cv::Mat & depth, float depthConstant); // emit objectsFound()
-
-Q_SIGNALS:
- void objectsFound(const find_object::DetectionInfo &, const find_object::Header &, const cv::Mat &, float);
-
-private:
- void clearVocabulary();
-
-private:
- QMap objects_;
- Vocabulary * vocabulary_;
- QMap objectsDescriptors_;
- QMap dataRange_; //
- Feature2D * detector_;
- Feature2D * extractor_;
- bool sessionModified_;
- bool keepImagesInRAM_;
-};
-
-} // namespace find_object
-
-#endif /* FINDOBJECT_H_ */
diff --git a/find-object/include/find_object/FindObjectExp.h b/find-object/include/find_object/FindObjectExp.h
deleted file mode 100644
index d1b41793..00000000
--- a/find-object/include/find_object/FindObjectExp.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
-Copyright (c) 2011-2014, Mathieu Labbe - IntRoLab - Universite de Sherbrooke
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- * Neither the name of the Universite de Sherbrooke nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#ifndef FINDOBJECTEXP_H
-#define FINDOBJECTEXP_H
-
-#if defined(_WIN32)
- #if defined(find_object_EXPORTS)
- #define FINDOBJECT_EXP __declspec( dllexport )
- #else
- #define FINDOBJECT_EXP __declspec( dllimport )
- #endif
-#else
- #define FINDOBJECT_EXP
-#endif
-
-#endif // RTABMAPEXP_H
diff --git a/find-object/include/find_object/Header.h b/find-object/include/find_object/Header.h
deleted file mode 100644
index a08a4296..00000000
--- a/find-object/include/find_object/Header.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
-Copyright (c) 2011-2021, Mathieu Labbe - IntRoLab - Universite de Sherbrooke
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- * Neither the name of the Universite de Sherbrooke nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#ifndef INCLUDE_FIND_OBJECT_HEADER_H_
-#define INCLUDE_FIND_OBJECT_HEADER_H_
-
-#include
-#include
-
-namespace find_object {
-
-class Header {
-public:
- Header() :
- sec_(0),
- nsec_(0)
- {
- }
- Header(const char * frameId, uint64_t sec, uint64_t nsec) :
- frameId_(frameId),
- sec_(sec),
- nsec_(nsec)
- {
- }
- QString frameId_;
- uint64_t sec_;
- uint64_t nsec_;
-};
-
-}
-
-#endif /* INCLUDE_FIND_OBJECT_HEADER_H_ */
diff --git a/find-object/include/find_object/JsonWriter.h b/find-object/include/find_object/JsonWriter.h
deleted file mode 100644
index 9de2f361..00000000
--- a/find-object/include/find_object/JsonWriter.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
-Copyright (c) 2011-2014, Mathieu Labbe - IntRoLab - Universite de Sherbrooke
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- * Neither the name of the Universite de Sherbrooke nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#ifndef JSONWRITER_H_
-#define JSONWRITER_H_
-
-#include "find_object/FindObjectExp.h" // DLL export/import defines
-
-#include "find_object/DetectionInfo.h"
-
-namespace find_object {
-
-class FINDOBJECT_EXP JsonWriter
-{
-public:
- static void write(const DetectionInfo & info, const QString & path);
-};
-
-} // namespace find_object
-
-
-#endif /* JSONWRITER_H_ */
diff --git a/find-object/include/find_object/MainWindow.h b/find-object/include/find_object/MainWindow.h
deleted file mode 100644
index c7195c9d..00000000
--- a/find-object/include/find_object/MainWindow.h
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
-Copyright (c) 2011-2014, Mathieu Labbe - IntRoLab - Universite de Sherbrooke
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- * Neither the name of the Universite de Sherbrooke nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#ifndef MAINWINDOW_H_
-#define MAINWINDOW_H_
-
-#include "find_object/FindObjectExp.h" // DLL export/import defines
-
-#include "find_object/DetectionInfo.h"
-#include "find_object/Header.h"
-
-#include
-#include
-#include
-#include
-#include
-#include
-
-#include
-
-namespace rtabmap
-{
-class PdfPlotCurve;
-}
-
-class Ui_mainWindow;
-class QLabel;
-
-namespace find_object {
-
-class ObjWidget;
-class Camera;
-class ParametersToolBox;
-class AboutDialog;
-class TcpServer;
-class KeypointDetector;
-class DescriptorExtractor;
-class Vocabulary;
-class FindObject;
-
-class FINDOBJECT_EXP MainWindow : public QMainWindow
-{
- Q_OBJECT
-
-public:
- MainWindow(find_object::FindObject * findObject, find_object::Camera * camera = 0, QWidget * parent = 0);
- virtual ~MainWindow();
-
- void setSourceImageText(const QString & text);
-
-protected:
- virtual void closeEvent(QCloseEvent * event);
- virtual void keyPressEvent(QKeyEvent *event);
-
-public Q_SLOTS:
- void startProcessing();
- void stopProcessing();
- void pauseProcessing();
- void update(const cv::Mat & image);
- void update(const cv::Mat & image, const find_object::Header & header, const cv::Mat & depth, float depthConstant);
-
-private Q_SLOTS:
- void loadSession();
- void saveSession();
- void loadSettings();
- void saveSettings();
- void loadObjects();
- bool saveObjects();
- void loadVocabulary();
- void saveVocabulary();
- void addObjectFromScene();
- void addObjectsFromFiles(const QStringList & fileNames);
- void addObjectsFromFiles();
- void addObjectFromTcp(const cv::Mat & image, int id, const QString & filePath);
- void loadSceneFromFile(const QStringList & fileNames);
- void loadSceneFromFile();
- void setupCameraFromVideoFile();
- void setupCameraFromImagesDirectory();
- void setupCameraFromTcpIp();
- void removeObject(find_object::ObjWidget * object);
- void removeObject(int id);
- void removeAllObjects();
- void updateObjectsSize();
- void updateMirrorView();
- void showHideControls();
- void showObjectsFeatures();
- void hideObjectsFeatures();
- void updateObjects();
- void notifyParametersChanged(const QStringList & param);
- void moveCameraFrame(int frame);
- void rectHovered(int objId);
-
-Q_SIGNALS:
- void objectsFound(const find_object::DetectionInfo &, const find_object::Header & header, const cv::Mat & depth, float depthConstant);
-
-private:
- bool loadSettings(const QString & path);
- bool saveSettings(const QString & path) const;
- int loadObjects(const QString & dirPath, bool recursive = false);
- int saveObjects(const QString & dirPath);
- void setupTCPServer();
- int addObjectFromFile(const QString & filePath);
- void showObject(find_object::ObjWidget * obj);
- void updateObjectSize(find_object::ObjWidget * obj);
- void updateVocabulary(const QList & ids = QList());
- void updateObjects(const QList & ids);
-
-private:
- Ui_mainWindow * ui_;
- Camera * camera_;
- FindObject * findObject_;
- rtabmap::PdfPlotCurve * likelihoodCurve_;
- rtabmap::PdfPlotCurve * inliersCurve_;
- AboutDialog * aboutDialog_;
- QMap objWidgets_;
- QTime updateRate_;
- QTime refreshStartTime_;
- int lowestRefreshRate_;
- bool objectsModified_;
- QMap imagesMap_;
- QMap lastObjectsUpdateParameters_; // ParametersMap
- TcpServer * tcpServer_;
- cv::Mat sceneImage_;
-};
-
-} // namespace find_object
-
-#endif /* MainWindow_H_ */
diff --git a/find-object/include/find_object/ObjWidget.h b/find-object/include/find_object/ObjWidget.h
deleted file mode 100644
index 73c2b75d..00000000
--- a/find-object/include/find_object/ObjWidget.h
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
-Copyright (c) 2011-2014, Mathieu Labbe - IntRoLab - Universite de Sherbrooke
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- * Neither the name of the Universite de Sherbrooke nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#ifndef OBJWIDGET_H_
-#define OBJWIDGET_H_
-
-#include "find_object/FindObjectExp.h" // DLL export/import defines
-
-#include
-#include
-#include
-
-class QAction;
-class QMenu;
-class QGraphicsView;
-class QGraphicsScene;
-class QGraphicsRectItem;
-class QGraphicsItem;
-class QLabel;
-
-namespace find_object {
-
-class KeypointItem;
-class ImageKptsView;
-
-class FINDOBJECT_EXP ObjWidget : public QWidget
-{
- Q_OBJECT
-
-public:
- ObjWidget(QWidget * parent = 0);
- ObjWidget(int id, const std::vector & keypoints, const QMultiMap & words, const QImage & image, QWidget * parent = 0);
- virtual ~ObjWidget();
-
- void setId(int id);
- void updateImage(const QImage & image);
- void updateData(const std::vector & keypoints, const QMultiMap & words=QMultiMap());
- void updateWords(const QMultiMap & words);
- void setTextLabel(const QString & text);
- void resetKptsColor();
- void resetKptsWordID();
- void setKptColor(int index, const QColor & color);
- void setKptWordID(int index, int wordId);
- void setGraphicsViewMode(bool on);
- void setAutoScale(bool autoScale);
- void setSizedFeatures(bool on);
- void setMirrorView(bool on);
- void setAlpha(int alpha);
- void setDeletable(bool deletable);
- void setImageShown(bool shown);
- void setFeaturesShown(bool shown);
- void addRect(QGraphicsRectItem * rect);
- void clearRoiSelection() {mousePressedPos_ = mouseCurrentPos_ = QPoint();update();}
-
- int id() const {return id_;}
- const QColor & color() const {return color_;}
- const std::vector keypoints() const {return keypoints_;}
- const QMap & words() const {return words_;}
- const QPixmap & pixmap() const {return pixmap_;}
- QColor defaultColor(int id) const;
- bool isImageShown() const;
- bool isFeaturesShown() const;
- bool isSizedFeatures() const;
- bool isMirrorView() const;
- //QGraphicsScene * scene() const;
- std::vector selectedKeypoints() const;
- QList selectedItems() const;
-
- QPixmap getSceneAsPixmap();
-
-protected:
- virtual void paintEvent(QPaintEvent *event);
- virtual void contextMenuEvent(QContextMenuEvent * event);
- virtual void resizeEvent(QResizeEvent* event);
- virtual void mousePressEvent(QMouseEvent * event);
- virtual void mouseMoveEvent(QMouseEvent * event);
- virtual void mouseReleaseEvent(QMouseEvent * event);
-
-Q_SIGNALS:
- void removalTriggered(find_object::ObjWidget *);
- void selectionChanged();
- void roiChanged(const cv::Rect &);
-
-private:
- void setupGraphicsView();
- void drawKeypoints(QPainter * painter = 0);
- void setupUi();
- void updateItemsShown();
- void computeScaleOffsets(float & scale, float & offsetX, float & offsetY);
-
-private:
- int id_;
- std::vector keypoints_;
- QMap words_; //
- QPixmap pixmap_;
- QRect rect_;
- QList keypointItems_;
- QGraphicsView * graphicsView_;
- QVector kptColors_;
- QList rectItems_;
- bool graphicsViewInitialized_;
- int alpha_;
- QLabel * label_;
- QColor color_;
-
- // menu stuff
- QString savedFileName_;
- QMenu * menu_;
- QAction * showImage_;
- QAction * showFeatures_;
- QAction * saveImage_;
- QAction * mirrorView_;
- QAction * delete_;
- QAction * graphicsViewMode_;
- QAction * autoScale_;
- QAction * sizedFeatures_;
- QAction * setAlpha_;
- QAction * setColor_;
-
- // selection stuff
- QPoint mousePressedPos_;
- QPoint mouseCurrentPos_;
-};
-
-} // namespace find_object
-
-#endif /* OBJWIDGET_H_ */
diff --git a/find-object/include/find_object/QtOpenCV.h b/find-object/include/find_object/QtOpenCV.h
deleted file mode 100644
index 3faacc0d..00000000
--- a/find-object/include/find_object/QtOpenCV.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
-Copyright (c) 2011-2014, Mathieu Labbe - IntRoLab - Universite de Sherbrooke
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- * Neither the name of the Universite de Sherbrooke nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#ifndef QTOPENCV_H
-#define QTOPENCV_H
-
-#include "find_object/FindObjectExp.h" // DLL export/import defines
-
-#include
-#include
-
-namespace find_object {
-
-// Convert OpenCV matrix to QImage
-FINDOBJECT_EXP QImage cvtCvMat2QImage(const cv::Mat & image, bool isBgr = true);
-
-// Convert QImage to OpenCV matrix
-FINDOBJECT_EXP cv::Mat cvtQImage2CvMat(const QImage & image);
-
-#if CV_MAJOR_VERSION < 3
-// Convert IplImage to QImage
-FINDOBJECT_EXP QImage cvtIplImage2QImage(const IplImage * image);
-
-// Convert QImage to IplImage
-FINDOBJECT_EXP IplImage * cvtQImage2IplImage(const QImage & image);
-#endif
-
-} // namespace find_object
-
-#endif // QTOPENCV_H
diff --git a/find-object/include/find_object/Settings.h b/find-object/include/find_object/Settings.h
deleted file mode 100644
index ccf70015..00000000
--- a/find-object/include/find_object/Settings.h
+++ /dev/null
@@ -1,404 +0,0 @@
-/*
-Copyright (c) 2011-2014, Mathieu Labbe - IntRoLab - Universite de Sherbrooke
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- * Neither the name of the Universite de Sherbrooke nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#ifndef SETTINGS_H_
-#define SETTINGS_H_
-
-#include "find_object/FindObjectExp.h" // DLL export/import defines
-#include "find_object/Version.h" // DLL export/import defines
-
-#include
-#include
-#include
-#include
-
-namespace find_object {
-
-class Feature2D;
-
-typedef QMap ParametersMap; // Key, value
-typedef QMap ParametersType; // Key, type
-typedef QMap DescriptionsMap; // Key, description
-
-typedef unsigned int uint;
-
-// MACRO BEGIN
-
-#define PARAMETER_GETTER_bool(PREFIX, NAME) \
- static bool get##PREFIX##_##NAME() {return parameters_.value(#PREFIX "/" #NAME).toBool();}
-#define PARAMETER_GETTER_int(PREFIX, NAME) \
- static int get##PREFIX##_##NAME() {return parameters_.value(#PREFIX "/" #NAME).toInt();}
-#define PARAMETER_GETTER_uint(PREFIX, NAME) \
- static uint get##PREFIX##_##NAME() {return parameters_.value(#PREFIX "/" #NAME).toUInt();}
-#define PARAMETER_GETTER_float(PREFIX, NAME) \
- static float get##PREFIX##_##NAME() {return parameters_.value(#PREFIX "/" #NAME).toFloat();}
-#define PARAMETER_GETTER_double(PREFIX, NAME) \
- static double get##PREFIX##_##NAME() {return parameters_.value(#PREFIX "/" #NAME).toDouble();}
-#define PARAMETER_GETTER_QString(PREFIX, NAME) \
- static QString get##PREFIX##_##NAME() {return parameters_.value(#PREFIX "/" #NAME).toString();}
-
-#define PARAMETER(PREFIX, NAME, TYPE, DEFAULT_VALUE, DESCRIPTION) \
- public: \
- static QString k##PREFIX##_##NAME() {return QString(#PREFIX "/" #NAME);} \
- static TYPE default##PREFIX##_##NAME() {return DEFAULT_VALUE;} \
- static QString type##PREFIX##_##NAME() {return QString(#TYPE);} \
- static QString description##PREFIX##_##NAME() {return QString(DESCRIPTION);} \
- PARAMETER_GETTER_##TYPE(PREFIX, NAME) \
- static void set##PREFIX##_##NAME(const TYPE & value) {parameters_[#PREFIX "/" #NAME] = value;} \
- private: \
- class Dummy##PREFIX##_##NAME { \
- public: \
- Dummy##PREFIX##_##NAME() { \
- defaultParameters_.insert(#PREFIX "/" #NAME, QVariant(DEFAULT_VALUE)); \
- parameters_.insert(#PREFIX "/" #NAME, DEFAULT_VALUE); \
- parametersType_.insert(#PREFIX "/" #NAME, #TYPE); \
- descriptions_.insert(#PREFIX "/" #NAME, DESCRIPTION);} \
- }; \
- Dummy##PREFIX##_##NAME dummy##PREFIX##_##NAME;
-
-#define PARAMETER_COND(PREFIX, NAME, TYPE, COND, DEFAULT_VALUE1, DEFAULT_VALUE2, DESCRIPTION) \
- public: \
- static QString k##PREFIX##_##NAME() {return QString(#PREFIX "/" #NAME);} \
- static TYPE default##PREFIX##_##NAME() {return COND?DEFAULT_VALUE1:DEFAULT_VALUE2;} \
- static QString type##PREFIX##_##NAME() {return QString(#TYPE);} \
- static QString description##PREFIX##_##NAME() {return QString(DESCRIPTION);} \
- PARAMETER_GETTER_##TYPE(PREFIX, NAME) \
- static void set##PREFIX##_##NAME(const TYPE & value) {parameters_[#PREFIX "/" #NAME] = value;} \
- private: \
- class Dummy##PREFIX##_##NAME { \
- public: \
- Dummy##PREFIX##_##NAME() { \
- defaultParameters_.insert(#PREFIX "/" #NAME, QVariant(COND?DEFAULT_VALUE1:DEFAULT_VALUE2)); \
- parameters_.insert(#PREFIX "/" #NAME, COND?DEFAULT_VALUE1:DEFAULT_VALUE2); \
- parametersType_.insert(#PREFIX "/" #NAME, #TYPE); \
- descriptions_.insert(#PREFIX "/" #NAME, DESCRIPTION);} \
- }; \
- Dummy##PREFIX##_##NAME dummy##PREFIX##_##NAME;
-// MACRO END
-
-class FINDOBJECT_EXP Settings
-{
- PARAMETER(Camera, 1deviceId, int, 0, "Device ID (default 0).");
- PARAMETER(Camera, 2imageWidth, int, 0, "Image width (0 means default width from camera).");
- PARAMETER(Camera, 3imageHeight, int, 0, "Image height (0 means default height from camera).");
- PARAMETER(Camera, 4imageRate, double, 10.0, "Image rate in Hz (0 Hz means as fast as possible)."); // Hz
- PARAMETER(Camera, 5mediaPath, QString, "", "Video file or directory of images. If set, the camera is not used. See General->videoFormats and General->imageFormats for available formats.");
- PARAMETER(Camera, 6useTcpCamera, bool, false, "Use TCP/IP input camera.");
- PARAMETER(Camera, 8port, int, 0, "The images server's port when useTcpCamera is checked. Only one client at the same time is allowed.");
- PARAMETER(Camera, 9queueSize, int, 1, "Maximum images buffered from TCP. If 0, all images are buffered.");
-
- //List format : [Index:item0;item1;item3;...]
-#if CV_MAJOR_VERSION < 3 || (CV_MAJOR_VERSION == 4 && CV_MINOR_VERSION <= 3) || (CV_MAJOR_VERSION == 3 && (CV_MINOR_VERSION < 4 || (CV_MINOR_VERSION==4 && CV_SUBMINOR_VERSION<11)))
-#if CV_MAJOR_VERSION >= 3 // NONFREE=SURF, DEFAULT=KAZE
- PARAMETER_COND(Feature2D, 1Detector, QString, FINDOBJECT_NONFREE, "7:Dense;Fast;GFTT;MSER;ORB;SIFT;Star;SURF;BRISK;AGAST;KAZE;AKAZE;SuperPointTorch" , "10:Dense;Fast;GFTT;MSER;ORB;SIFT;Star;SURF;BRISK;AGAST;KAZE;AKAZE;SuperPointTorch", "Keypoint detector.");
- PARAMETER_COND(Feature2D, 2Descriptor, QString, FINDOBJECT_NONFREE, "3:Brief;ORB;SIFT;SURF;BRISK;FREAK;KAZE;AKAZE;LUCID;LATCH;DAISY;SuperPointTorch", "6:Brief;ORB;SIFT;SURF;BRISK;FREAK;KAZE;AKAZE;LUCID;LATCH;DAISY;SuperPointTorch", "Keypoint descriptor.");
-#else // NONFREE=SURF, DEFAULT=ORB
- PARAMETER_COND(Feature2D, 1Detector, QString, FINDOBJECT_NONFREE, "7:Dense;Fast;GFTT;MSER;ORB;SIFT;Star;SURF;BRISK;AGAST;KAZE;AKAZE;SuperPointTorch" , "4:Dense;Fast;GFTT;MSER;ORB;SIFT;Star;SURF;BRISK;AGAST;KAZE;AKAZE;SuperPointTorch", "Keypoint detector.");
- PARAMETER_COND(Feature2D, 2Descriptor, QString, FINDOBJECT_NONFREE, "3:Brief;ORB;SIFT;SURF;BRISK;FREAK;KAZE;AKAZE;LUCID;LATCH;DAISY;SuperPointTorch", "1:Brief;ORB;SIFT;SURF;BRISK;FREAK;KAZE;AKAZE;LUCID;LATCH;DAISY;SuperPointTorch", "Keypoint descriptor.");
-#endif
-#else // >=4.4 >=3.4.11: NONFREE=SURF, DEFAULT=SIFT
- PARAMETER_COND(Feature2D, 1Detector, QString, FINDOBJECT_NONFREE, "7:Dense;Fast;GFTT;MSER;ORB;SIFT;Star;SURF;BRISK;AGAST;KAZE;AKAZE;SuperPointTorch" , "5:Dense;Fast;GFTT;MSER;ORB;SIFT;Star;SURF;BRISK;AGAST;KAZE;AKAZE;SuperPointTorch", "Keypoint detector.");
- PARAMETER_COND(Feature2D, 2Descriptor, QString, FINDOBJECT_NONFREE, "3:Brief;ORB;SIFT;SURF;BRISK;FREAK;KAZE;AKAZE;LUCID;LATCH;DAISY;SuperPointTorch", "2:Brief;ORB;SIFT;SURF;BRISK;FREAK;KAZE;AKAZE;LUCID;LATCH;DAISY;SuperPointTorch", "Keypoint descriptor.");
-#endif
- PARAMETER(Feature2D, 3MaxFeatures, int, 0, "Maximum features per image. If the number of features extracted is over this threshold, only X features with the highest response are kept. 0 means all features are kept.");
- PARAMETER(Feature2D, 4Affine, bool, false, "(ASIFT) Extract features on multiple affine transformations of the image.");
- PARAMETER(Feature2D, 5AffineCount, int, 6, "(ASIFT) Higher the value, more affine transformations will be done.");
- PARAMETER(Feature2D, 6SubPix, bool, false, "Refines the corner locations. With SIFT/SURF, features are already subpixel, so no need to activate this.");
- PARAMETER(Feature2D, 7SubPixWinSize, int, 3, "Half of the side length of the search window. For example, if winSize=Size(5,5) , then a 5*2+1 x 5*2+1 = 11 x 11 search window is used.");
- PARAMETER(Feature2D, 8SubPixIterations, int, 30, "The process of corner position refinement stops after X iterations.");
- PARAMETER(Feature2D, 9SubPixEps, float, 0.02f, "The process of corner position refinement stops when the corner position moves by less than epsilon on some iteration.");
-
- PARAMETER(Feature2D, Brief_bytes, int, 32, "Bytes is a length of descriptor in bytes. It can be equal 16, 32 or 64 bytes.");
-
-#if CV_MAJOR_VERSION < 3
- PARAMETER(Feature2D, Dense_initFeatureScale, float, 1.f, "");
- PARAMETER(Feature2D, Dense_featureScaleLevels, int, 1, "");
- PARAMETER(Feature2D, Dense_featureScaleMul, float, 0.1f, "");
- PARAMETER(Feature2D, Dense_initXyStep, int, 6, "");
- PARAMETER(Feature2D, Dense_initImgBound, int, 0, "");
- PARAMETER(Feature2D, Dense_varyXyStepWithScale, bool, true, "");
- PARAMETER(Feature2D, Dense_varyImgBoundWithScale, bool, false, "");
-#endif
-
- PARAMETER(Feature2D, Fast_threshold, int, 10, "Threshold on difference between intensity of the central pixel and pixels of a circle around this pixel.");
- PARAMETER(Feature2D, Fast_nonmaxSuppression, bool, true, "If true, non-maximum suppression is applied to detected corners (keypoints).");
- PARAMETER(Feature2D, Fast_gpu, bool, false, "GPU-FAST: Use GPU version of FAST. This option is enabled only if OpenCV is built with CUDA and GPUs are detected.");
- PARAMETER(Feature2D, Fast_keypointsRatio, double, 0.05, "Used with FAST GPU (OpenCV 2).");
- PARAMETER(Feature2D, Fast_maxNpoints, int, 5000, "Used with FAST GPU (OpenCV 3).");
-
- PARAMETER(Feature2D, AGAST_threshold, int, 10, "Threshold on difference between intensity of the central pixel and pixels of a circle around this pixel.");
- PARAMETER(Feature2D, AGAST_nonmaxSuppression, bool, true, "If true, non-maximum suppression is applied to detected corners (keypoints).");
-
- PARAMETER(Feature2D, KAZE_extended, bool, false, "Set to enable extraction of extended (128-byte) descriptor.");
- PARAMETER(Feature2D, KAZE_upright, bool, false, "Set to enable use of upright descriptors (non rotation-invariant).");
- PARAMETER(Feature2D, KAZE_threshold, float, 0.001f, "Detector response threshold to accept point");
- PARAMETER(Feature2D, KAZE_nOctaves, int, 4, "Maximum octave evolution of the image.");
- PARAMETER(Feature2D, KAZE_nOctaveLayers, int, 4, "Default number of sublevels per scale level.");
-
- PARAMETER(Feature2D, AKAZE_descriptorSize, int, 0, "Size of the descriptor in bits. 0 -> Full size.");
- PARAMETER(Feature2D, AKAZE_descriptorChannels, int, 3, "Number of channels in the descriptor (1, 2, 3).");
- PARAMETER(Feature2D, AKAZE_threshold, float, 0.001f, "Detector response threshold to accept point.");
- PARAMETER(Feature2D, AKAZE_nOctaves, int, 4, "Maximum octave evolution of the image.");
- PARAMETER(Feature2D, AKAZE_nOctaveLayers, int, 4, "Default number of sublevels per scale level.");
-
- PARAMETER(Feature2D, GFTT_maxCorners, int, 1000, "Maximum number of corners to return. If there are more corners than are found, the strongest of them is returned.");
- PARAMETER(Feature2D, GFTT_qualityLevel, double, 0.01, "Parameter characterizing the minimal accepted quality of image corners. The parameter value is multiplied by the best corner quality measure, which is the minimal eigenvalue (see cornerMinEigenVal ) or the Harris function response (see cornerHarris ). The corners with the quality measure less than the product are rejected. For example, if the best corner has the quality measure = 1500, and the qualityLevel=0.01 , then all the corners with the quality measure less than 15 are rejected.");
- PARAMETER(Feature2D, GFTT_minDistance, double, 1, "Minimum possible Euclidean distance between the returned corners.");
- PARAMETER(Feature2D, GFTT_blockSize, int, 3, "Size of an average block for computing a derivative covariation matrix over each pixel neighborhood. See cornerEigenValsAndVecs.");
- PARAMETER(Feature2D, GFTT_useHarrisDetector, bool, false, "Parameter indicating whether to use a Harris detector (see cornerHarris) or cornerMinEigenVal.");
- PARAMETER(Feature2D, GFTT_k, double, 0.04, "Free parameter of the Harris detector.");
-
- PARAMETER(Feature2D, ORB_nFeatures, int, 500, "The maximum number of features to retain.");
- PARAMETER(Feature2D, ORB_scaleFactor, float, 1.2f, "Pyramid decimation ratio, greater than 1. scaleFactor==2 means the classical pyramid, where each next level has 4x less pixels than the previous, but such a big scale factor will degrade feature matching scores dramatically. On the other hand, too close to 1 scale factor will mean that to cover certain scale range you will need more pyramid levels and so the speed will suffer.");
- PARAMETER(Feature2D, ORB_nLevels, int, 8, "The number of pyramid levels. The smallest level will have linear size equal to input_image_linear_size/pow(scaleFactor, nlevels).");
- PARAMETER(Feature2D, ORB_edgeThreshold, int, 31, "This is size of the border where the features are not detected. It should roughly match the patchSize parameter.");
- PARAMETER(Feature2D, ORB_firstLevel, int, 0, "It should be 0 in the current implementation.");
- PARAMETER(Feature2D, ORB_WTA_K, int, 2, "The number of points that produce each element of the oriented BRIEF descriptor. The default value 2 means the BRIEF where we take a random point pair and compare their brightnesses, so we get 0/1 response. Other possible values are 3 and 4. For example, 3 means that we take 3 random points (of course, those point coordinates are random, but they are generated from the pre-defined seed, so each element of BRIEF descriptor is computed deterministically from the pixel rectangle), find point of maximum brightness and output index of the winner (0, 1 or 2). Such output will occupy 2 bits, and therefore it will need a special variant of Hamming distance, denoted as NORM_HAMMING2 (2 bits per bin). When WTA_K=4, we take 4 random points to compute each bin (that will also occupy 2 bits with possible values 0, 1, 2 or 3).");
- PARAMETER(Feature2D, ORB_scoreType, int, 0, "The default HARRIS_SCORE=0 means that Harris algorithm is used to rank features (the score is written to KeyPoint::score and is used to retain best nfeatures features); FAST_SCORE=1 is alternative value of the parameter that produces slightly less stable keypoints, but it is a little faster to compute.");
- PARAMETER(Feature2D, ORB_patchSize, int, 31, "size of the patch used by the oriented BRIEF descriptor. Of course, on smaller pyramid layers the perceived image area covered by a feature will be larger.");
- PARAMETER(Feature2D, ORB_gpu, bool, false, "GPU-ORB: Use GPU version of ORB. This option is enabled only if OpenCV is built with CUDA and GPUs are detected.");
- PARAMETER(Feature2D, ORB_blurForDescriptor, bool, false, "GPU-ORB: blurForDescriptor parameter (OpenCV 3).");
-
- PARAMETER(Feature2D, MSER_delta, int, 5, "");
- PARAMETER(Feature2D, MSER_minArea, int, 60, "");
- PARAMETER(Feature2D, MSER_maxArea, int, 14400, "");
- PARAMETER(Feature2D, MSER_maxVariation, double, 0.25, "");
- PARAMETER(Feature2D, MSER_minDiversity, double, 0.2, "");
- PARAMETER(Feature2D, MSER_maxEvolution, int, 200, "");
- PARAMETER(Feature2D, MSER_areaThreshold, double, 1.01, "");
- PARAMETER(Feature2D, MSER_minMargin, double, 0.003, "");
- PARAMETER(Feature2D, MSER_edgeBlurSize, int, 5, "");
-
- PARAMETER(Feature2D, SIFT_nfeatures, int, 0, "The number of best features to retain. The features are ranked by their scores (measured in SIFT algorithm as the local contrast).");
- PARAMETER(Feature2D, SIFT_nOctaveLayers, int, 3, "The number of layers in each octave. 3 is the value used in D. Lowe paper. The number of octaves is computed automatically from the image resolution.");
- PARAMETER(Feature2D, SIFT_contrastThreshold, double, 0.04, "The contrast threshold used to filter out weak features in semi-uniform (low-contrast) regions. The larger the threshold, the less features are produced by the detector.");
- PARAMETER(Feature2D, SIFT_edgeThreshold, double, 10, "The threshold used to filter out edge-like features. Note that the its meaning is different from the contrastThreshold, i.e. the larger the edgeThreshold, the less features are filtered out (more features are retained).");
- PARAMETER(Feature2D, SIFT_sigma, double, 1.6, "The sigma of the Gaussian applied to the input image at the octave #0. If your image is captured with a weak camera with soft lenses, you might want to reduce the number.");
- PARAMETER(Feature2D, SIFT_rootSIFT, bool, false, "RootSIFT descriptors.");
-
- PARAMETER(Feature2D, SURF_hessianThreshold, double, 600.0, "Threshold for hessian keypoint detector used in SURF.");
- PARAMETER(Feature2D, SURF_nOctaves, int, 4, "Number of pyramid octaves the keypoint detector will use.");
- PARAMETER(Feature2D, SURF_nOctaveLayers, int, 2, "Number of octave layers within each octave.");
- PARAMETER(Feature2D, SURF_extended, bool, true, "Extended descriptor flag (true - use extended 128-element descriptors; false - use 64-element descriptors).");
- PARAMETER(Feature2D, SURF_upright, bool, false, "Up-right or rotated features flag (true - do not compute orientation of features; false - compute orientation).");
- PARAMETER(Feature2D, SURF_gpu, bool, false, "GPU-SURF: Use GPU version of SURF. This option is enabled only if OpenCV is built with CUDA and GPUs are detected.");
- PARAMETER(Feature2D, SURF_keypointsRatio, float, 0.01f, "Used with SURF GPU.");
-
- PARAMETER(Feature2D, Star_maxSize, int, 45, "");
- PARAMETER(Feature2D, Star_responseThreshold, int, 30, "");
- PARAMETER(Feature2D, Star_lineThresholdProjected, int, 10, "");
- PARAMETER(Feature2D, Star_lineThresholdBinarized, int, 8, "");
- PARAMETER(Feature2D, Star_suppressNonmaxSize, int, 5, "");
-
- PARAMETER(Feature2D, BRISK_thresh, int, 30, "FAST/AGAST detection threshold score.");
- PARAMETER(Feature2D, BRISK_octaves, int, 3, "Detection octaves. Use 0 to do single scale.");
- PARAMETER(Feature2D, BRISK_patternScale, float, 1.0f, "Apply this scale to the pattern used for sampling the neighbourhood of a keypoint.");
-
- PARAMETER(Feature2D, FREAK_orientationNormalized, bool, true, "Enable orientation normalization.");
- PARAMETER(Feature2D, FREAK_scaleNormalized, bool, true, "Enable scale normalization.");
- PARAMETER(Feature2D, FREAK_patternScale, float, 22.0f, "Scaling of the description pattern.");
- PARAMETER(Feature2D, FREAK_nOctaves, int, 4, "Number of octaves covered by the detected keypoints.");
-
- PARAMETER(Feature2D, LUCID_kernel, int, 1, "Kernel for descriptor construction, where 1=3x3, 2=5x5, 3=7x7 and so forth.");
- PARAMETER(Feature2D, LUCID_blur_kernel, int, 2, "Kernel for blurring image prior to descriptor construction, where 1=3x3, 2=5x5, 3=7x7 and so forth.");
-
- PARAMETER(Feature2D, LATCH_bytes, int, 32, "Size of the descriptor - can be 64, 32, 16, 8, 4, 2 or 1.");
- PARAMETER(Feature2D, LATCH_rotationInvariance, bool, true, "Whether or not the descriptor should compansate for orientation changes.");
- PARAMETER(Feature2D, LATCH_half_ssd_size, int, 3, "The size of half of the mini-patches size. For example, if we would like to compare triplets of patches of size 7x7x then the half_ssd_size should be (7-1)/2 = 3.");
-
- PARAMETER(Feature2D, DAISY_radius, float, 15, "Radius of the descriptor at the initial scale.");
- PARAMETER(Feature2D, DAISY_q_radius, int, 3, "Amount of radial range division quantity.");
- PARAMETER(Feature2D, DAISY_q_theta, int, 8, "Amount of angular range division quantity.");
- PARAMETER(Feature2D, DAISY_q_hist, int, 8, "Amount of gradient orientations range division quantity.");
- PARAMETER(Feature2D, DAISY_interpolation, bool, true, "Switch to disable interpolation for speed improvement at minor quality loss.");
- PARAMETER(Feature2D, DAISY_use_orientation, bool, false, "Sample patterns using keypoints orientation, disabled by default.");
-
- PARAMETER(Feature2D, SuperPointTorch_modelPath, QString, "", "[Required] Path to pre-trained weights Torch file of SuperPoint (*.pt).");
- PARAMETER(Feature2D, SuperPointTorch_threshold, float, 0.2, "Detector response threshold to accept keypoint.");
- PARAMETER(Feature2D, SuperPointTorch_NMS, bool, true, "If true, non-maximum suppression is applied to detected keypoints.");
- PARAMETER(Feature2D, SuperPointTorch_NMS_radius, int, 4, "[%s=true] Minimum distance (pixels) between keypoints");
- PARAMETER(Feature2D, SuperPointTorch_cuda, bool, false, "Use Cuda device for Torch, otherwise CPU device is used by default.");
-
- PARAMETER_COND(NearestNeighbor, 1Strategy, QString, FINDOBJECT_NONFREE || CV_MAJOR_VERSION >= 3, "1:Linear;KDTree;KMeans;Composite;Autotuned;Lsh;BruteForce", "6:Linear;KDTree;KMeans;Composite;Autotuned;Lsh;BruteForce", "Nearest neighbor strategy.");
- PARAMETER_COND(NearestNeighbor, 2Distance_type, QString, FINDOBJECT_NONFREE || CV_MAJOR_VERSION >= 3, "0:EUCLIDEAN_L2;MANHATTAN_L1;MINKOWSKI;MAX;HIST_INTERSECT;HELLINGER;CHI_SQUARE_CS;KULLBACK_LEIBLER_KL;HAMMING", "1:EUCLIDEAN_L2;MANHATTAN_L1;MINKOWSKI;MAX;HIST_INTERSECT;HELLINGER;CHI_SQUARE_CS;KULLBACK_LEIBLER_KL;HAMMING", "Distance type.");
- PARAMETER(NearestNeighbor, 3nndrRatioUsed, bool, true, "Nearest neighbor distance ratio approach to accept the best match.");
- PARAMETER(NearestNeighbor, 4nndrRatio, float, 0.8f, "Nearest neighbor distance ratio.");
- PARAMETER(NearestNeighbor, 5minDistanceUsed, bool, false, "Minimum distance with the nearest descriptor to accept a match.");
- PARAMETER(NearestNeighbor, 6minDistance, float, 1.6f, "Minimum distance. You can look at top of this panel where minimum and maximum distances are shown to properly set this parameter depending of the descriptor used.");
- PARAMETER(NearestNeighbor, 7ConvertBinToFloat, bool, false, "Convert binary descriptor to float before quantization, so you can use FLANN strategies with them.");
-
-
- PARAMETER(NearestNeighbor, BruteForce_gpu, bool, false, "Brute force GPU");
-
- PARAMETER(NearestNeighbor, search_checks, int, 32, "The number of times the tree(s) in the index should be recursively traversed. A higher value for this parameter would give better search precision, but also take more time. If automatic configuration was used when the index was created, the number of checks required to achieve the specified precision was also computed, in which case this parameter is ignored.");
- PARAMETER(NearestNeighbor, search_eps, float, 0, "");
- PARAMETER(NearestNeighbor, search_sorted, bool, true, "");
-
- PARAMETER(NearestNeighbor, KDTree_trees, int, 4, "The number of parallel kd-trees to use. Good values are in the range [1..16].");
-
- PARAMETER(NearestNeighbor, Composite_trees, int, 4, "The number of parallel kd-trees to use. Good values are in the range [1..16].");
- PARAMETER(NearestNeighbor, Composite_branching, int, 32, "The branching factor to use for the hierarchical k-means tree.");
- PARAMETER(NearestNeighbor, Composite_iterations, int, 11, "The maximum number of iterations to use in the k-means clustering stage when building the k-means tree. A value of -1 used here means that the k-means clustering should be iterated until convergence.");
- PARAMETER(NearestNeighbor, Composite_centers_init, QString, "0:RANDOM;GONZALES;KMEANSPP", "The algorithm to use for selecting the initial centers when performing a k-means clustering step. The possible values are CENTERS_RANDOM (picks the initial cluster centers randomly), CENTERS_GONZALES (picks the initial centers using Gonzales’ algorithm) and CENTERS_KMEANSPP (picks the initial centers using the algorithm suggested in arthur_kmeanspp_2007 ).");
- PARAMETER(NearestNeighbor, Composite_cb_index, double, 0.2, "This parameter (cluster boundary index) influences the way exploration is performed in the hierarchical kmeans tree. When cb_index is zero the next kmeans domain to be explored is chosen to be the one with the closest center. A value greater then zero also takes into account the size of the domain.");
-
- PARAMETER(NearestNeighbor, Autotuned_target_precision, double, 0.8, "Is a number between 0 and 1 specifying the percentage of the approximate nearest-neighbor searches that return the exact nearest-neighbor. Using a higher value for this parameter gives more accurate results, but the search takes longer. The optimum value usually depends on the application.");
- PARAMETER(NearestNeighbor, Autotuned_build_weight, double, 0.01, "Specifies the importance of the index build time raported to the nearest-neighbor search time. In some applications it’s acceptable for the index build step to take a long time if the subsequent searches in the index can be performed very fast. In other applications it’s required that the index be build as fast as possible even if that leads to slightly longer search times.");
- PARAMETER(NearestNeighbor, Autotuned_memory_weight, double, 0, "Is used to specify the tradeoff between time (index build time and search time) and memory used by the index. A value less than 1 gives more importance to the time spent and a value greater than 1 gives more importance to the memory usage.");
- PARAMETER(NearestNeighbor, Autotuned_sample_fraction, double, 0.1, "Is a number between 0 and 1 indicating what fraction of the dataset to use in the automatic parameter configuration algorithm. Running the algorithm on the full dataset gives the most accurate results, but for very large datasets can take longer than desired. In such case using just a fraction of the data helps speeding up this algorithm while still giving good approximations of the optimum parameters.");
-
- PARAMETER(NearestNeighbor, KMeans_branching, int, 32, "The branching factor to use for the hierarchical k-means tree.");
- PARAMETER(NearestNeighbor, KMeans_iterations, int, 11, "The maximum number of iterations to use in the k-means clustering stage when building the k-means tree. A value of -1 used here means that the k-means clustering should be iterated until convergence.");
- PARAMETER(NearestNeighbor, KMeans_centers_init, QString, "0:RANDOM;GONZALES;KMEANSPP", "The algorithm to use for selecting the initial centers when performing a k-means clustering step. The possible values are CENTERS_RANDOM (picks the initial cluster centers randomly), CENTERS_GONZALES (picks the initial centers using Gonzales’ algorithm) and CENTERS_KMEANSPP (picks the initial centers using the algorithm suggested in arthur_kmeanspp_2007 ).");
- PARAMETER(NearestNeighbor, KMeans_cb_index, double, 0.2, "This parameter (cluster boundary index) influences the way exploration is performed in the hierarchical kmeans tree. When cb_index is zero the next kmeans domain to be explored is chosen to be the one with the closest center. A value greater then zero also takes into account the size of the domain.");
-
- PARAMETER(NearestNeighbor, Lsh_table_number, int, 12, "The number of hash tables to use (between 10 and 30 usually).");
- PARAMETER(NearestNeighbor, Lsh_key_size, int, 20, "The size of the hash key in bits (between 10 and 20 usually).");
- PARAMETER(NearestNeighbor, Lsh_multi_probe_level, int, 2, "The number of bits to shift to check for neighboring buckets (0 is regular LSH, 2 is recommended).");
-
- PARAMETER(General, autoStartCamera, bool, false, "Automatically start the camera when the application is opened.");
- PARAMETER(General, autoUpdateObjects, bool, true, "Automatically update objects on every parameter changes, otherwise you would need to press \"Update objects\" on the objects panel.");
- PARAMETER(General, nextObjID, uint, 1, "Next object ID to use.");
- PARAMETER(General, imageFormats, QString, "*.png *.jpg *.bmp *.tiff *.ppm *.pgm", "Image formats supported.");
- PARAMETER(General, videoFormats, QString, "*.avi *.m4v *.mp4", "Video formats supported.");
- PARAMETER(General, mirrorView, bool, false, "Flip the camera image horizontally (like all webcam applications).");
- PARAMETER(General, invertedSearch, bool, true, "Instead of matching descriptors from the objects to those in a vocabulary created with descriptors extracted from the scene, we create a vocabulary from all the objects' descriptors and we match scene's descriptors to this vocabulary. It is the inverted search mode.");
- PARAMETER(General, controlsShown, bool, false, "Show play/image seek controls (useful with video file and directory of images modes).");
- PARAMETER(General, threads, int, 1, "Number of threads used for objects matching and homography computation. 0 means as many threads as objects. On InvertedSearch mode, multi-threading has only effect on homography computation.");
- PARAMETER(General, multiDetection, bool, false, "Multiple detection of the same object.");
- PARAMETER(General, multiDetectionRadius, int, 30, "Ignore detection of the same object in X pixels radius of the previous detections.");
- PARAMETER(General, port, int, 0, "Port on objects detected are published. If port=0, a port is chosen automatically.")
- PARAMETER(General, autoScroll, bool, true, "Auto scroll to detected object in Objects panel.");
- PARAMETER(General, vocabularyFixed, bool, false, "If the vocabulary is fixed, no new words will be added to it when adding new objects.");
- PARAMETER(General, vocabularyIncremental, bool, false, "The vocabulary is created incrementally. When new objects are added, their descriptors are compared to those already in vocabulary to find if the visual word already exist or not. \"NearestNeighbor/nndrRatio\" and \"NearestNeighbor/minDistance\" are used to compare descriptors.");
- PARAMETER(General, vocabularyUpdateMinWords, int, 2000, "When the vocabulary is incremental (see \"General/vocabularyIncremental\"), after X words added to vocabulary, the internal index is updated with new words. This parameter lets avoiding to reconstruct the whole nearest neighbor index after each time descriptors of an object are added to vocabulary. 0 means no incremental update.");
- PARAMETER(General, sendNoObjDetectedEvents, bool, true, "When there are no objects detected, send an empty object detection event.");
- PARAMETER(General, autoPauseOnDetection, bool, false, "Auto pause the camera when an object is detected.");
- PARAMETER(General, autoScreenshotPath, QString, "", "Path to a directory to save screenshot of the current camera view when there is a detection.");
- PARAMETER(General, debug, bool, false, "Show debug logs on terminal.");
-
- PARAMETER(Homography, homographyComputed, bool, true, "Compute homography? On ROS, this is required to publish objects detected.");
- PARAMETER(Homography, method, QString, "1:LMEDS;RANSAC;RHO", "Type of the robust estimation algorithm: least-median algorithm or RANSAC algorithm.");
- PARAMETER(Homography, ransacReprojThr, double, 3.0, "Maximum allowed reprojection error to treat a point pair as an inlier (used in the RANSAC method only). It usually makes sense to set this parameter somewhere in the range of 1 to 10.");
-#if CV_MAJOR_VERSION >= 3
- PARAMETER(Homography, maxIterations, int, 2000, "The maximum number of RANSAC iterations, 2000 is the maximum it can be.");
- PARAMETER(Homography, confidence, double, 0.995, "Confidence level, between 0 and 1.");
-#endif
- PARAMETER(Homography, minimumInliers, int, 10, "Minimum inliers to accept the homography. Value must be >= 4.");
- PARAMETER(Homography, ignoreWhenAllInliers, bool, false, "Ignore homography when all features are inliers (sometimes when the homography doesn't converge, it returns the best homography with all features as inliers).");
- PARAMETER(Homography, rectBorderWidth, int, 4, "Homography rectangle border width.");
- PARAMETER(Homography, allCornersVisible, bool, false, "All corners of the detected object must be visible in the scene.");
- PARAMETER(Homography, minAngle, int, 0, "(Degrees) Homography minimum angle. Set 0 to disable. When the angle is very small, this is a good indication that the homography is wrong. A good value is over 60 degrees.");
- PARAMETER(Homography, opticalFlow, bool, false, "Activate optical flow to refine matched features before computing the homography.");
- PARAMETER(Homography, opticalFlowWinSize, int, 16, "Size of the search window at each pyramid level.");
- PARAMETER(Homography, opticalFlowMaxLevel, int, 3, "0-based maximal pyramid level number; if set to 0, pyramids are not used (single level), if set to 1, two levels are used, and so on; if pyramids are passed to input then algorithm will use as many levels as pyramids have but no more than maxLevel.");
- PARAMETER(Homography, opticalFlowIterations, int, 30, "Specifying the termination criteria of the iterative search algorithm (after the specified maximum number of iterations).");
- PARAMETER(Homography, opticalFlowEps, float, 0.01f, "Specifying the termination criteria of the iterative search algorithm (when the search window moves by less than epsilon).");
-
-public:
- virtual ~Settings(){}
-
- static QString workingDirectory();
- static QString iniDefaultPath();
- static QString iniDefaultFileName() {return "config.ini";}
- static QString iniPath();
-
- static ParametersMap init(const QString & fileName);
-
- static ParametersMap loadSettings(const QString & fileName = QString());
- static void loadWindowSettings(QByteArray & windowGeometry, QByteArray & windowState, const QString & fileName = QString());
- static void saveSettings(const QString & fileName = QString());
- static void saveWindowSettings(const QByteArray & windowGeometry, const QByteArray & windowState, const QString & fileName = QString());
-
- static const ParametersMap & getDefaultParameters() {return defaultParameters_;}
- static const ParametersMap & getParameters() {return parameters_;}
- static const ParametersType & getParametersType() {return parametersType_;}
- static const DescriptionsMap & getDescriptions() {return descriptions_;}
- static void setParameter(const QString & key, const QVariant & value) {if(parameters_.contains(key))parameters_[key] = value;}
- static void resetParameter(const QString & key) {if(defaultParameters_.contains(key)) parameters_.insert(key, defaultParameters_.value(key));}
- static QVariant getParameter(const QString & key) {return parameters_.value(key, QVariant());}
-
- static Feature2D * createKeypointDetector();
- static Feature2D * createDescriptorExtractor();
-
- static QString currentDescriptorType();
- static QString currentDetectorType();
- static QString currentNearestNeighborType();
-
- static bool isBruteForceNearestNeighbor();
- static cv::flann::IndexParams * createFlannIndexParams();
- static cvflann::flann_distance_t getFlannDistanceType();
-
- static int getHomographyMethod();
-
-private:
- Settings(){}
-
-private:
- static ParametersMap defaultParameters_;
- static ParametersMap parameters_;
- static ParametersType parametersType_;
- static DescriptionsMap descriptions_;
- static Settings dummyInit_;
- static QString iniPath_;
-};
-
-class Feature2D
-{
-public:
-#if CV_MAJOR_VERSION < 3
- Feature2D(cv::Ptr featureDetector);
- Feature2D(cv::Ptr descriptorExtractor);
-#endif
- Feature2D(cv::Ptr feature2D);
- Feature2D() {}
- virtual ~Feature2D() {}
-
- virtual void detect(const cv::Mat & image,
- std::vector & keypoints,
- const cv::Mat & mask = cv::Mat());
-
- virtual void compute(const cv::Mat & image,
- std::vector & keypoints,
- cv::Mat & descriptors);
-
- virtual void detectAndCompute(const cv::Mat & image,
- std::vector & keypoints,
- cv::Mat & descriptors,
- const cv::Mat & mask = cv::Mat());
-
-private:
-#if CV_MAJOR_VERSION < 3
- cv::Ptr featureDetector_;
- cv::Ptr descriptorExtractor_;
-#endif
- cv::Ptr feature2D_;
-};
-
-} // namespace find_object
-
-#endif /* SETTINGS_H_ */
diff --git a/find-object/include/find_object/TcpServer.h b/find-object/include/find_object/TcpServer.h
deleted file mode 100644
index 5a82f9ad..00000000
--- a/find-object/include/find_object/TcpServer.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
-Copyright (c) 2011-2014, Mathieu Labbe - IntRoLab - Universite de Sherbrooke
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- * Neither the name of the Universite de Sherbrooke nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#ifndef TCPSERVER_H_
-#define TCPSERVER_H_
-
-#include "find_object/FindObjectExp.h" // DLL export/import defines
-
-#include "find_object/DetectionInfo.h"
-#include
-
-#include
-
-namespace find_object {
-
-class QNetworkSession;
-
-class FINDOBJECT_EXP TcpServer : public QTcpServer
-{
- Q_OBJECT
-
-public:
- enum Service {
- kAddObject, // id fileName imageSize image
- kRemoveObject, // id
- kDetectObject // image
- };
-
-public:
- TcpServer(quint16 port = 0, QObject * parent = 0);
-
- QHostAddress getHostAddress() const;
- quint16 getPort() const;
-
-public Q_SLOTS:
- void publishDetectionInfo(const find_object::DetectionInfo & info);
-
-private Q_SLOTS:
- void addClient();
- void readReceivedData();
- void displayError(QAbstractSocket::SocketError socketError);
- void connectionLost();
-
-Q_SIGNALS:
- void addObject(const cv::Mat &, int, const QString &);
- void removeObject(int);
- void detectObject(const cv::Mat &);
-
-private:
- QMap blockSizes_;
-};
-
-} // namespace find_object
-
-#endif /* TCPSERVER_H_ */
diff --git a/find-object/include/find_object/utilite/UDestroyer.h b/find-object/include/find_object/utilite/UDestroyer.h
deleted file mode 100644
index de0ad8e3..00000000
--- a/find-object/include/find_object/utilite/UDestroyer.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
-* utilite is a cross-platform library with
-* useful utilities for fast and small developing.
-* Copyright (C) 2010 Mathieu Labbe
-*
-* utilite is free library: you can redistribute it and/or modify
-* it under the terms of the GNU Lesser General Public License as published by
-* the Free Software Foundation, either version 3 of the License, or
-* (at your option) any later version.
-*
-* utilite is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public License
-* along with this program. If not, see .
-*/
-
-#ifndef UDESTROYER_H
-#define UDESTROYER_H
-
-//#include "utilite/UtiLiteExp.h" // DLL export/import defines
-
-/**
- * This class is used to delete a dynamically created
- * objects. It was mainly designed to remove dynamically created Singleton.
- * Created on the stack of a Singleton, when the
- * application is finished, his destructor make sure that the
- * Singleton is deleted.
- *
- */
-template
-class UDestroyer
-{
-public:
- /**
- * The constructor. Set the doomed object (take ownership of the object). The object is deleted
- * when this object is deleted.
- */
- UDestroyer(T* doomed = 0) : doomed_(doomed) {}
-
- ~UDestroyer()
- {
- if(doomed_)
- {
- delete doomed_;
- doomed_ = 0;
- }
- }
-
- /**
- * Set the doomed object. If a doomed object is already set, the function returns false.
- * @param doomed the doomed object
- * @return false if an object is already set and the new object is not null, otherwise true
- */
- bool setDoomed(T* doomed)
- {
- if(doomed_ && doomed)
- {
- return false;
- }
- doomed_ = doomed;
- return true;
- }
-
-private:
- // Prevent users from making copies of a
- // Destroyer to avoid double deletion:
- UDestroyer(const UDestroyer&);
- void operator=(const UDestroyer&);
-
-private:
- T* doomed_;
-};
-
-#endif // UDESTROYER_H
diff --git a/find-object/include/find_object/utilite/ULogger.h b/find-object/include/find_object/utilite/ULogger.h
deleted file mode 100644
index f9269b35..00000000
--- a/find-object/include/find_object/utilite/ULogger.h
+++ /dev/null
@@ -1,536 +0,0 @@
-/*
-* utilite is a cross-platform library with
-* useful utilities for fast and small developing.
-* Copyright (C) 2010 Mathieu Labbe
-*
-* utilite is free library: you can redistribute it and/or modify
-* it under the terms of the GNU Lesser General Public License as published by
-* the Free Software Foundation, either version 3 of the License, or
-* (at your option) any later version.
-*
-* utilite is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public License
-* along with this program. If not, see .
-*/
-
-#ifndef ULOGGER_H
-#define ULOGGER_H
-
-#include "find_object/FindObjectExp.h" // DLL export/import defines
-
-#include "find_object/utilite/UMutex.h"
-#include "find_object/utilite/UDestroyer.h"
-
-#include
-#include
-#include
-#include
-
-#include
-
-#if _MSC_VER
- #undef min
- #undef max
-#endif
-
-/**
- * \file ULogger.h
- * \brief ULogger class and convenient macros
- *
- * This contains macros useful for logging a message anywhere in the
- * application. Once the ULogger is set, use these macros like a printf to
- * print debug messages.
-*/
-
-/*
- * Convenient macros for logging...
- */
-#define ULOGGER_LOG(level, ...) ULogger::write(level, __FILE__, __LINE__, __FUNCTION__, __VA_ARGS__)
-
-#define ULOGGER_DEBUG(...) ULOGGER_LOG(ULogger::kDebug, __VA_ARGS__)
-#define ULOGGER_INFO(...) ULOGGER_LOG(ULogger::kInfo, __VA_ARGS__)
-#define ULOGGER_WARN(...) ULOGGER_LOG(ULogger::kWarning, __VA_ARGS__)
-#define ULOGGER_ERROR(...) ULOGGER_LOG(ULogger::kError, __VA_ARGS__)
-#define ULOGGER_FATAL(...) ULOGGER_LOG(ULogger::kFatal, __VA_ARGS__)
-
-#define UDEBUG(...) ULOGGER_DEBUG(__VA_ARGS__)
-#define UINFO(...) ULOGGER_INFO(__VA_ARGS__)
-#define UWARN(...) ULOGGER_WARN(__VA_ARGS__)
-#define UERROR(...) ULOGGER_ERROR(__VA_ARGS__)
-#define UFATAL(...) ULOGGER_FATAL(__VA_ARGS__)
-
-#define UASSERT(condition) if(!(condition)) ULogger::write(ULogger::kFatal, __FILE__, __LINE__, __FUNCTION__, "Condition (%s) not met!", #condition)
-#define UASSERT_MSG(condition, msg_str) if(!(condition)) ULogger::write(ULogger::kFatal, __FILE__, __LINE__, __FUNCTION__, "Condition (%s) not met! [%s]", #condition, msg_str)
-
-/**
- * \def UDEBUG(...)
- * Print a debug level message in the logger. Format is the same as a printf:
- * @code
- * UDEBUG("This is a debug message with the number %d", 42);
- * @endcode
- */
-/**
- * \def UINFO(...)
- * Print a information level message in the logger. Format is the same as a printf:
- * @code
- * UINFO("This is a information message with the number %d", 42);
- * @endcode
- */
-/**
- * \def UWARN(...)
- * Print a warning level message in the logger. Format is the same as a printf:
- * @code
- * UWARN("This is a warning message with the number %d", 42);
- * @endcode
- */
-/**
- * \def UERROR(...)
- * Print an error level message in the logger. Format is the same as a printf:
- * @code
- * UERROR("This is an error message with the number %d", 42);
- * @endcode
- */
-/**
- * \def UFATAL(...)
- * Print a fatal error level message in the logger. The application will exit on
- * fatal error. Format is the same as a printf:
- * @code
- * UFATAL("This is a fatal error message with the number %d", 42);
- * @endcode
- */
-/**
- * \def UASSERT(condition, ...)
- * Print a fatal error level message in the logger if condition is not met. The application will exit on
- * fatal error. Format is the same as a printf:
- * @code
- * UASSERT(a!=42, "This is a fatal error message with the number %d", 42);
- * @endcode
- */
-
-
-/**
- * This class is used to log messages with time on a console, in a file
- * and/or with an event. At the start of the application, call
- * ULogger::setType() with the type of the logger you want (see ULogger::Type, the type of the output
- * can be changed at the run-time.). To use it,
- * simply call the convenient macros UDEBUG(), UINFO(), UWARN(), UERROR(), UFATAL() depending of
- * the severity of the message. You can disable some messages by setting the logger
- * level ULogger::setLevel() to severity you want, defined by ULogger::Level. A fatal message
- * will make the application to exit, printing the message on console (whatever the logger type) and
- * posting a ULogEvent (synchronously... see UEventsManager::post()) before exiting.
- *
- * The display of the logged messages can be modified:
- * - If you don't want the level label, set ULogger::setPrintLevel() to false.
- * - If you don't want the time label, set ULogger::setPrintTime() to false.
- * - If you don't want the end of line added, set ULogger::setPrintEndline() to false.
- * - If you don't the full path of the message, set ULogger::setPrintWhereFullPath() to false.
- * - If you don't the path of the message, set ULogger::setPrintWhere() to false.
- *
- * When using a file logger (kTypeLogger), it can be useful in some
- * application to buffer messages before writing them to hard drive (avoiding
- * hard drive latencies). You can set ULogger::setBuffered() to true to do that. When the
- * buffered messages will be written to file on appllciation exit (ULogger destructor) or when
- * ULogger::flush() is called.
- *
- * If you want the application to exit on a lower severity level than kFatal,
- * you can set ULogger::setExitLevel() to any ULogger::Type you want.
- *
- * Example:
- * @code
- * #include
- * int main(int argc, char * argv[])
- * {
- * // Set the logger type. The choices are kTypeConsole,
- * // kTypeFile or kTypeNoLog (nothing is logged).
- * ULogger::setType(ULogger::kTypeConsole);
- *
- * // Set the logger severity level (kDebug, kInfo, kWarning, kError, kFatal).
- * // All log entries under the severity level are not logged. Here,
- * // only debug messages are not logged.
- * ULogger::setLevel(ULogger::kInfo);
- *
- * // Use a predefined Macro to easy logging. It can be
- * // called anywhere in the application as the logger is
- * // a Singleton.
- * UDEBUG("This message won't be logged because the "
- * "severity level of the logger is set to kInfo.");
- *
- * UINFO("This message is logged.");
- *
- * UWARN("A warning message...");
- *
- * UERROR("An error message with code %d.", 42);
- *
- * return 0;
- * }
- * @endcode
- * Output:
- * @code
- * [ INFO] (2010-09-25 18:08:20) main.cpp:18::main() This message is logged.
- * [ WARN] (2010-09-25 18:08:20) main.cpp:20::main() A warning message...
- * [ERROR] (2010-09-25 18:08:20) main.cpp:22::main() An error message with code 42.
- * @endcode
- *
- * Another useful form of the ULogger is to use it with the UTimer class. Here an example:
- * @code
- * #include
- * #include
- * ...
- * UTimer timer; // automatically starts
- * // do some works for part A
- * UINFO("Time for part A = %f s", timer.ticks());
- * // do some works for part B
- * UINFO("Time for part B = %f s", timer.ticks());
- * // do some works for part C
- * UINFO("Time for part C = %f s", timer.ticks());
- * ...
- * @endcode
- *
- * @see setType()
- * @see setLevel()
- * @see UDEBUG(), UINFO(), UWARN(), UERROR(), UFATAL()
- *
- */
-class FINDOBJECT_EXP ULogger
-{
-
-public:
- /**
- * The default log file name.
- */
- static const std::string kDefaultLogFileName;
-
- /**
- * Loggers available:
- * @code
- * kTypeNoLog, kTypeConsole, kTypeFile
- * @endcode
- */
- enum Type{kTypeNoLog, kTypeConsole, kTypeFile};
-
- /**
- * Logger levels, from lowest severity to highest:
- * @code
- * kDebug, kInfo, kWarning, kError, kFatal
- * @endcode
- */
- enum Level{kDebug, kInfo, kWarning, kError, kFatal};
-
- /**
- * Set the type of the logger. When using kTypeFile, the parameter "fileName" would be
- * changed (default is "./ULog.txt"), and optionally "append" if we want the
- * logger to append messages to file or to overwrite the file.
- * @param type the ULogger::Type of the logger.
- * @param fileName file name used with a file logger type.
- * @param append if true, the file isn't overwritten, otherwise it is.
- *
- * TODO : Can it be useful to have 2 or more types at the same time ? Print
- * in console and file at the same time.
- */
- static void setType(Type type, const std::string &fileName = kDefaultLogFileName, bool append = true);
- static Type type() {return type_;}
-
- // Setters
- /**
- * Print time: default true.
- * @param printTime true to print time, otherwise set to false.
- */
- static void setPrintTime(bool printTime) {printTime_ = printTime;}
- static bool isPrintTime() {return printTime_;}
-
- /**
- * Print level: default true.
- * @param printLevel true to print level, otherwise set to false.
- */
- static void setPrintLevel(bool printLevel) {printLevel_ = printLevel;}
- static bool isPrintLevel() {return printLevel_;}
-
- /**
- * Print end of line: default true.
- * @param printLevel true to print end of line, otherwise set to false.
- */
- static void setPrintEndline(bool printEndline) {printEndline_ = printEndline;}
- static bool isPrintEndLine() {return printEndline_;}
-
- /**
- * Print text with color: default true.
- * Dark green for Debug, white for Info, yellow for Warning, red for Error and Fatal.
- * @param printColored true to print text with color, otherwise set to false.
- */
- static void setPrintColored(bool printColored) {printColored_ = printColored;}
- static bool isPrintColored() {return printColored_;}
-
- /**
- * Print where is this message in source code: default true.
- * @param printWhere true to print where, otherwise set to false.
- */
- static void setPrintWhere(bool printWhere) {printWhere_ = printWhere;}
- static bool isPrintWhere() {return printWhere_;}
-
- /**
- * Print the full path: default true. ULogger::setPrintWhere() must be true to have path printed.
- * @param printWhereFullPath true to print the full path, otherwise set to false.
- */
- static void setPrintWhereFullPath(bool printWhereFullPath) {printWhereFullPath_ = printWhereFullPath;}
- static bool isPrintWhereFullPath() {return printWhereFullPath_;}
-
- /**
- * Set is the logger buffers messages, default false. When true, the messages are
- * buffered until the application is closed or ULogger::flush() is called.
- * @see ULogger::flush()
- * @param buffered true to buffer messages, otherwise set to false.
- */
- static void setBuffered(bool buffered);
- static bool isBuffered() {return buffered_;}
-
- /**
- * Set logger level: default kInfo. All messages over the severity set
- * are printed, other are ignored. The severity is from the lowest to
- * highest:
- * - kDebug
- * - kInfo
- * - kWarning
- * - kError
- * - kFatal
- * @param level the minimum level of the messages printed.
- */
- static void setLevel(ULogger::Level level) {level_ = level;}
- static ULogger::Level level() {return level_;}
-
- /**
- * Make application to exit when a log with level is written (useful for debugging). The message is printed to
- * console (whatever the logger type) and an ULogEvent is sent (synchronously... see UEventsManager::post()) before exiting.
- *
- * Note : A kFatal level will always exit whatever the level specified here.
- */
- static void setExitLevel(ULogger::Level exitLevel) {exitLevel_ = exitLevel;}
- static ULogger::Level exitLevel() {return exitLevel_;}
-
- /**
- * An ULogEvent is sent on each message logged at the specified level.
- * Note : On message with level >= exitLevel, the event is sent synchronously (see UEventsManager::post()).
- * @see ULogEvent
- * @see setExitLevel()
- */
- static void setEventLevel(ULogger::Level eventSentLevel) {eventLevel_ = eventSentLevel;}
- static ULogger::Level eventLevel() {return eventLevel_;}
-
- /**
- * Reset to default parameters.
- */
- static void reset();
-
- /**
- * Flush buffered messages.
- * @see setBuffered()
- */
- static void flush();
-
- /**
- * Write a message directly to logger without level handling.
- * @param msg the message to write.
- * @param ... the variable arguments
- * @deprecated use UDEBUG(), UINFO(), UWARN(), UERROR() or UFATAL()
- */
- static void write(const char* msg, ...);
-
- /*
- * Write a message to logger: use UDEBUG(), UINFO(), UWARN(), UERROR() or UFATAL() instead.
- * @param level the log level of this message
- * @param file the file path
- * @param line the line in the file
- * @param function the function name in which the message is logged
- * @param msg the message to write
- * @param ... the variable arguments
- */
- static void write(ULogger::Level level,
- const char * file,
- int line,
- const char *function,
- const char* msg,
- ...);
-
- /**
- * Get the time in the format "2008-7-13 12:23:44".
- * @param timeStr string were the time will be copied.
- * @return the number of characters written, or 0 if an error occurred.
- */
- static int getTime(std::string &timeStr);
-
-protected:
- /*
- * This method is used to have a reference on the
- * Logger. When no Logger exists, one is
- * created. There is only one instance in the application.
- * Must be protected by loggerMutex_.
- * See the Singleton pattern for further explanation.
- *
- * @return the reference on the Logger
- */
- static ULogger* getInstance();
-
- /*
- * Called only once in getInstance(). It can't be instanciated
- * by the user.
- *
- * @see getInstance()
- */
- ULogger() {}
-
- /*
- * Only called by a Destroyer.
- * @see Destroyer
- */
- virtual ~ULogger();
-
- /*
- * Flush buffered messages
- */
- void _flush();
-
- /*
- * A Destroyer is used to remove a dynamicaly created
- * Singleton. It is friend here to have access to the
- * destructor.
- *
- * @see Destroyer
- */
- friend class UDestroyer;
-
- /*
- * The log file name.
- */
- static std::string logFileName_;
-
- /*
- * Default true, it doesn't overwrite the file.
- */
- static bool append_;
-
-private:
- /*
- * Create an instance according to type. See the Abstract factory
- * pattern for further explanation.
- * @see type_
- * @return the reference on the new logger
- */
- static ULogger* createInstance();
-
- /*
- * Write a message on the output with the format :
- * "A message". Inherited class
- * must override this method to output the message. It
- * does nothing by default.
- * @param msg the message to write.
- * @param arg the variable arguments
- */
- virtual void _write(const char* msg, va_list arg) {} // Do nothing by default
- virtual void _writeStr(const char* msg) {} // Do nothing by default
-
-private:
- /*
- * The Logger instance pointer.
- */
- static ULogger* instance_;
-
- /*
- * The Logger's destroyer
- */
- static UDestroyer destroyer_;
-
- /*
- * If the logger prints the time for each message.
- * Default is true.
- */
- static bool printTime_;
-
- /*
- * If the logger prints the level for each message.
- * Default is true.
- */
- static bool printLevel_;
-
- /*
- * If the logger prints the end line for each message.
- * Default is true.
- */
- static bool printEndline_;
-
- /*
- * If the logger prints text with color.
- * Default is true.
- */
- static bool printColored_;
-
- /*
- * If the logger prints where the message is logged (fileName::function():line).
- * Default is true.
- */
- static bool printWhere_;
-
- /*
- * If the logger prints the full path of the source file
- * where the message is written. Only works when
- * "printWhere_" is true.
- * Default is false.
- */
- static bool printWhereFullPath_;
-
- /*
- * If the logger limit the size of the "where" path to
- * characters. If the path is over 8 characters, a "~"
- * is added. Only works when "printWhereFullPath_" is false.
- * Default is false.
- */
- static bool limitWhereLength_;
-
- /*
- * The type of the logger.
- */
- static Type type_;
-
- /*
- * The severity of the log.
- */
- static Level level_;
-
- /*
- * The severity at which the application exits.
- * Note : A FATAL level will always exit whatever the level specified here.
- */
- static Level exitLevel_;
-
- /*
- * The severity at which the message is also sent in a ULogEvent.
- */
- static Level eventLevel_;
-
- static const char * levelName_[5];
-
- /*
- * Mutex used when accessing public functions.
- */
- static UMutex loggerMutex_;
-
- /*
- * If the logger prints messages only when ULogger::flush() is called.
- * Default is false.
- */
- static bool buffered_;
-
- static std::string bufferedMsgs_;
-
- /*
- * State attribute. This state happens when an exit level
- * message is received.
- * Messages received during this state are not logged.
- * @see exitLevel_
- */
- static bool exitingState_;
-};
-
-#endif // ULOGGER_H
diff --git a/find-object/include/find_object/utilite/UMutex.h b/find-object/include/find_object/utilite/UMutex.h
deleted file mode 100644
index bb1fceaf..00000000
--- a/find-object/include/find_object/utilite/UMutex.h
+++ /dev/null
@@ -1,179 +0,0 @@
-/*
-* utilite is a cross-platform library with
-* useful utilities for fast and small developing.
-* Copyright (C) 2010 Mathieu Labbe
-*
-* utilite is free library: you can redistribute it and/or modify
-* it under the terms of the GNU Lesser General Public License as published by
-* the Free Software Foundation, either version 3 of the License, or
-* (at your option) any later version.
-*
-* utilite is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public License
-* along with this program. If not, see .
-*/
-
-#ifndef UMUTEX_H
-#define UMUTEX_H
-
-#include
-
-#ifdef WIN32
- #include "find_object/utilite/UWin32.h"
-#else
- #include
-#endif
-
-
-/**
- * A mutex class.
- *
- * On a lock() call, the calling thread is blocked if the
- * UMutex was previously locked by another thread. It is unblocked when unlock() is called.
- *
- * On Unix (not yet tested on Windows), UMutex is recursive: the same thread can
- * call multiple times lock() without being blocked.
- *
- * Example:
- * @code
- * UMutex m; // Mutex shared with another thread(s).
- * ...
- * m.lock();
- * // Data is protected here from the second thread
- * //(assuming the second one protects also with the same mutex the same data).
- * m.unlock();
- *
- * @endcode
- *
- * @see USemaphore
- */
-class UMutex
-{
-
-public:
-
- /**
- * The constructor.
- */
- UMutex()
- {
-#ifdef WIN32
- InitializeCriticalSection(&C);
-#else
- pthread_mutexattr_t attr;
- pthread_mutexattr_init(&attr);
- pthread_mutexattr_settype(&attr,PTHREAD_MUTEX_RECURSIVE);
- pthread_mutex_init(&M,&attr);
- pthread_mutexattr_destroy(&attr);
-#endif
- }
-
- virtual ~UMutex()
- {
-#ifdef WIN32
- DeleteCriticalSection(&C);
-#else
- pthread_mutex_unlock(&M); pthread_mutex_destroy(&M);
-#endif
- }
-
- /**
- * Lock the mutex.
- */
- int lock() const
- {
-#ifdef WIN32
- EnterCriticalSection(&C); return 0;
-#else
- return pthread_mutex_lock(&M);
-#endif
- }
-
-#ifdef WIN32
- #if(_WIN32_WINNT >= 0x0400)
- int lockTry() const
- {
- return (TryEnterCriticalSection(&C)?0:EBUSY);
- }
- #endif
-#else
- int lockTry() const
- {
- return pthread_mutex_trylock(&M);
- }
-#endif
-
- /**
- * Unlock the mutex.
- */
- int unlock() const
- {
-#ifdef WIN32
- LeaveCriticalSection(&C); return 0;
-#else
- return pthread_mutex_unlock(&M);
-#endif
- }
-
- private:
-#ifdef WIN32
- mutable CRITICAL_SECTION C;
-#else
- mutable pthread_mutex_t M;
-#endif
- void operator=(UMutex &M) {}
- UMutex( const UMutex &M ) {}
-};
-
-/**
- * Automatically lock the referenced mutex on constructor and unlock mutex on destructor.
- *
- * Example:
- * @code
- * UMutex m; // Mutex shared with another thread(s).
- * ...
- * int myMethod()
- * {
- * UScopeMutex sm(m); // automatically lock the mutex m
- * if(cond1)
- * {
- * return 1; // automatically unlock the mutex m
- * }
- * else if(cond2)
- * {
- * return 2; // automatically unlock the mutex m
- * }
- * return 0; // automatically unlock the mutex m
- * }
- *
- * @endcode
- *
- * @see UMutex
- */
-class UScopeMutex
-{
-public:
- UScopeMutex(const UMutex & mutex) :
- mutex_(mutex)
- {
- mutex_.lock();
- }
- // backward compatibility
- UScopeMutex(UMutex * mutex) :
- mutex_(*mutex)
- {
- mutex_.lock();
- }
- ~UScopeMutex()
- {
- mutex_.unlock();
- }
-private:
- const UMutex & mutex_;
-};
-
-#endif // UMUTEX_H
diff --git a/find-object/include/find_object/utilite/UWin32.h b/find-object/include/find_object/utilite/UWin32.h
deleted file mode 100644
index 49d02b69..00000000
--- a/find-object/include/find_object/utilite/UWin32.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/////////////////////////////////////////////////////////////////////
-// Written by Phillip Sitbon
-// Copyright 2003
-//
-// Win32.h
-// - Windows includes
-//
-/////////////////////////////////////////////////////////////////////
-#ifndef _U_Win32_
-#define _U_Win32_
-
- #if !defined(_WINDOWS_)
- // WIN32 Excludes
- #ifdef WIN32_LEAN_AND_MEAN
- # define VC_EXTRALEAN
- # define WIN32_LEAN_AND_MEAN
- # define _PRSHT_H_
- # define NOGDICAPMASKS // CC_*, LC_*, PC_*, CP_*, TC_*, RC_
- # define NOVIRTUALKEYCODES // VK_*
- # define NOWINMESSAGES // WM_*, EM_*, LB_*, CB_*
- # define NOWINSTYLES // WS_*, CS_*, ES_*, LBS_*, SBS_*, CBS_*
- # define NOSYSMETRICS // SM_*
- # define NOMENUS // MF_*
- # define NOICONS // IDI_*
- # define NOKEYSTATES // MK_*
- # define NOSYSCOMMANDS // SC_*
- # define NORASTEROPS // Binary and Tertiary raster ops
- # define NOSHOWWINDOW // SW_*
- # define OEMRESOURCE // OEM Resource values
- # define NOATOM // Atom Manager routines
- # define NOCLIPBOARD // Clipboard routines
- # define NOCOLOR // Screen colors
- # define NOCTLMGR // Control and Dialog routines
- # define NODRAWTEXT // DrawText() and DT_*
- # define NOGDI // All GDI defines and routines
- # define NOKERNEL // All KERNEL defines and routines
- # define NOUSER // All USER defines and routines
- # define NONLS // All NLS defines and routines
- # define NOMB // MB_* and MessageBox()
- # define NOMEMMGR // GMEM_*, LMEM_*, GHND, LHND, associated routines
- # define NOMETAFILE // typedef METAFILEPICT
- # define NOMINMAX // Macros min(a,b) and max(a,b)
- # define NOMSG // typedef MSG and associated routines
- # define NOOPENFILE // OpenFile(), OemToAnsi, AnsiToOem, and OF_*
- # define NOSCROLL // SB_* and scrolling routines
- # define NOSERVICE // All Service Controller routines, SERVICE_ equates, etc.
- # define NOSOUND // Sound driver routines
- # define NOTEXTMETRIC // typedef TEXTMETRIC and associated routines
- # define NOWH // SetWindowsHook and WH_*
- # define NOWINOFFSETS // GWL_*, GCL_*, associated routines
- # define NOCOMM // COMM driver routines
- # define NOKANJI // Kanji support stuff.
- # define NOHELP // Help engine interface.
- # define NOPROFILER // Profiler interface.
- # define NODEFERWINDOWPOS // DeferWindowPos routines
- # define NOMCX // Modem Configuration Extensions
- #endif // WIN32_LEAN_AND_MEAN
- //
- # include
- #endif
-
-#endif // !_U_Win32_
diff --git a/find-object/launch/ros1/find_object_2d.launch b/find-object/launch/ros1/find_object_2d.launch
deleted file mode 100644
index 649a821e..00000000
--- a/find-object/launch/ros1/find_object_2d.launch
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/find-object/launch/ros1/find_object_3d.launch b/find-object/launch/ros1/find_object_3d.launch
deleted file mode 100644
index eb544568..00000000
--- a/find-object/launch/ros1/find_object_3d.launch
+++ /dev/null
@@ -1,35 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/find-object/launch/ros1/find_object_3d_kinect2.launch b/find-object/launch/ros1/find_object_3d_kinect2.launch
deleted file mode 100644
index 56289880..00000000
--- a/find-object/launch/ros1/find_object_3d_kinect2.launch
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/find-object/launch/ros1/find_object_3d_zed.launch b/find-object/launch/ros1/find_object_3d_zed.launch
deleted file mode 100644
index 5fb63e6f..00000000
--- a/find-object/launch/ros1/find_object_3d_zed.launch
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/find-object/launch/ros2/find_object_2d.launch.py b/find-object/launch/ros2/find_object_2d.launch.py
deleted file mode 100644
index 504242ff..00000000
--- a/find-object/launch/ros2/find_object_2d.launch.py
+++ /dev/null
@@ -1,30 +0,0 @@
-
-from launch import LaunchDescription
-from launch.actions import DeclareLaunchArgument, SetEnvironmentVariable
-from launch.substitutions import LaunchConfiguration
-from launch_ros.actions import Node
-
-def generate_launch_description():
-
- return LaunchDescription([
-
- SetEnvironmentVariable('RCUTILS_LOGGING_USE_STDOUT', '1'),
- SetEnvironmentVariable('RCUTILS_LOGGING_BUFFERED_STREAM', '0'),
-
- # Launch arguments
- DeclareLaunchArgument('gui', default_value='true', description='Launch GUI.'),
- DeclareLaunchArgument('image_topic', default_value='image', description='Image topic to subscribe to.'),
- DeclareLaunchArgument('objects_path', default_value='~/objects', description='Directory containing objects to load on initialization.'),
- DeclareLaunchArgument('settings_path', default_value='~/.ros/find_object_2d.ini', description='Config file.'),
-
- # Nodes to launch
- Node(
- package='find_object_2d', executable='find_object_2d', output='screen',
- parameters=[{
- 'gui':LaunchConfiguration('gui'),
- 'objects_path':LaunchConfiguration('objects_path'),
- 'settings_path':LaunchConfiguration('settings_path')
- }],
- remappings=[
- ('image', LaunchConfiguration('image_topic'))]),
- ])
diff --git a/find-object/launch/ros2/find_object_3d.launch.py b/find-object/launch/ros2/find_object_3d.launch.py
deleted file mode 100644
index e883486f..00000000
--- a/find-object/launch/ros2/find_object_3d.launch.py
+++ /dev/null
@@ -1,42 +0,0 @@
-
-from launch import LaunchDescription
-from launch.actions import DeclareLaunchArgument, SetEnvironmentVariable
-from launch.substitutions import LaunchConfiguration
-from launch_ros.actions import Node
-
-def generate_launch_description():
-
- return LaunchDescription([
-
- SetEnvironmentVariable('RCUTILS_LOGGING_USE_STDOUT', '1'),
- SetEnvironmentVariable('RCUTILS_LOGGING_BUFFERED_STREAM', '0'),
-
- # Launch arguments
- DeclareLaunchArgument('gui', default_value='true', description='Launch GUI.'),
- DeclareLaunchArgument('approx_sync', default_value='true', description=''),
- DeclareLaunchArgument('pnp', default_value='true', description=''),
- DeclareLaunchArgument('object_prefix', default_value='object', description='TF prefix of objects.'),
- DeclareLaunchArgument('objects_path', default_value='~/objects', description='Directory containing objects to load on initialization.'),
- DeclareLaunchArgument('settings_path', default_value='~/.ros/find_object_2d.ini', description='Config file.'),
-
- DeclareLaunchArgument('rgb_topic', default_value='camera/rgb/image_rect_color', description='Image topic.'),
- DeclareLaunchArgument('depth_topic', default_value='camera/depth_registered/image_raw', description='Registered depth topic.'),
- DeclareLaunchArgument('camera_info_topic', default_value='camera/rgb/camera_info', description='Camera info topic.'),
-
- # Nodes to launch
- Node(
- package='find_object_2d', executable='find_object_2d', output='screen',
- parameters=[{
- 'subscribe_depth':True,
- 'gui':LaunchConfiguration('gui'),
- 'approx_sync':LaunchConfiguration('approx_sync'),
- 'pnp':LaunchConfiguration('pnp'),
- 'object_prefix':LaunchConfiguration('object_prefix'),
- 'objects_path':LaunchConfiguration('objects_path'),
- 'settings_path':LaunchConfiguration('settings_path')
- }],
- remappings=[
- ('rgb/image_rect_color', LaunchConfiguration('rgb_topic')),
- ('depth_registered/image_raw', LaunchConfiguration('depth_topic')),
- ('depth_registered/camera_info', LaunchConfiguration('camera_info_topic'))]),
- ])
diff --git a/find-object/msg/DetectionInfo.msg b/find-object/msg/DetectionInfo.msg
deleted file mode 100644
index d9825f05..00000000
--- a/find-object/msg/DetectionInfo.msg
+++ /dev/null
@@ -1,12 +0,0 @@
-
-std_msgs/Header header
-
-# All arrays should have the same size
-std_msgs/Int32[] ids
-std_msgs/Int32[] widths
-std_msgs/Int32[] heights
-std_msgs/String[] file_paths
-std_msgs/Int32[] inliers
-std_msgs/Int32[] outliers
-# 3x3 homography matrix: [h11, h12, h13, h21, h22, h23, h31, h32, h33] (h31 = dx and h32 = dy, see QTransform)
-std_msgs/Float32MultiArray[] homographies
diff --git a/find-object/msg/ObjectsStamped.msg b/find-object/msg/ObjectsStamped.msg
deleted file mode 100644
index c1d191a9..00000000
--- a/find-object/msg/ObjectsStamped.msg
+++ /dev/null
@@ -1,5 +0,0 @@
-# objects format:
-# [ObjectId1, objectWidth, objectHeight, h11, h12, h13, h21, h22, h23, h31, h32, h33, ObjectId2...]
-# where h## is a 3x3 homography matrix (h31 = dx and h32 = dy, see QTransform)
-std_msgs/Header header
-std_msgs/Float32MultiArray objects
\ No newline at end of file
diff --git a/find-object/package.xml b/find-object/package.xml
deleted file mode 100644
index 2d8c135c..00000000
--- a/find-object/package.xml
+++ /dev/null
@@ -1,53 +0,0 @@
-
-
-
- find_object_2d
- 0.7.0
- The find_object_2d package
- Mathieu Labbe
- Mathieu Labbe
- BSD
- https://github.com/introlab/find-object/issues
- https://github.com/introlab/find-object
-
- catkin
- ament_cmake
-
- roscpp
- tf
- rclcpp
- tf2
- tf2_ros
- tf2_geometry_msgs
-
- ros_environment
- builtin_interfaces
- rosidl_default_generators
- rosidl_default_runtime
- rosidl_interface_packages
-
- message_generation
- qtbase5-dev
- cv_bridge
- sensor_msgs
- std_msgs
- std_srvs
- geometry_msgs
- image_transport
- message_filters
-
- message_runtime
- qtbase5-dev
- cv_bridge
- sensor_msgs
- std_msgs
- std_srvs
- geometry_msgs
- image_transport
- message_filters
-
-
- catkin
- ament_cmake
-
-
diff --git a/find-object/snap/snapcraft.yaml.in b/find-object/snap/snapcraft.yaml.in
deleted file mode 100644
index 932ad263..00000000
--- a/find-object/snap/snapcraft.yaml.in
+++ /dev/null
@@ -1,67 +0,0 @@
-name: find-object
-base: core18
-version: '@PROJECT_VERSION@+git'
-summary: Find-Object project, visit http://introlab.github.io/find-object/
-description: |
- Features:
- - You can change any parameters at runtime, make it easier to test feature detectors and descriptors without always recompiling.
- - Detectors/descriptors supported (from OpenCV): BRIEF, Dense, FAST, GoodFeaturesToTrack, MSER, ORB, SIFT, STAR, SURF, FREAK and BRISK.
- - Sample code with the OpenCV C++ interface below...
- - For an example of an application using SURF descriptors: see my project RTAB-Map (an appearance-based loop closure detector for SLAM).
-
-grade: devel # must be 'stable' to release into candidate/stable channels
-confinement: devmode # use 'strict' once you have the right plugs and slots
-
-apps:
- find-object:
- command: desktop-launch find_object
- plugs: [unity7, x11, opengl, home, network, network-bind, removable-media, raw-usb, wayland, desktop-legacy, desktop]
-
-parts:
- desktop-qt5:
- source: https://github.com/ubuntu/snapcraft-desktop-helpers.git
- source-subdir: qt
- plugin: make
- make-parameters: ["FLAVOR=qt5"]
- build-packages:
- - qtbase5-dev
- - dpkg-dev
- stage-packages:
- - libxkbcommon0
- - ttf-ubuntu-font-family
- - dmz-cursor-theme
- - light-themes
- - adwaita-icon-theme
- - gnome-themes-standard
- - shared-mime-info
- - libqt5gui5
- - libgdk-pixbuf2.0-0
- - libgtk2.0-0
- - libqt5svg5 # for loading icon themes which are svg
- - try: [appmenu-qt5] # not available on core18
- - locales-all
-
- find-object:
- after: [desktop-qt5]
- plugin: cmake
- source: .
- build-packages:
- - libopencv-dev
- - qtbase5-dev
- organize:
- usr/lib/x86_64-linux-gnu/blas/libblas.so.3: usr/lib/x86_64-linux-gnu/libblas.so.3
- usr/lib/x86_64-linux-gnu/blas/libblas.so.3.7.1: usr/lib/x86_64-linux-gnu/libblas.so.3.7.1
- usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3: usr/lib/x86_64-linux-gnu/liblapack.so.3
- usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.7.1: usr/lib/x86_64-linux-gnu/liblapack.so.3.7.1
- stage-packages:
- - libopencv-calib3d3.2
- - libopencv-core3.2
- - libopencv-features2d3.2
- - libopencv-flann3.2
- - libopencv-imgcodecs3.2
- - libopencv-imgproc3.2
- - libopencv-video3.2
- - libqt5core5a
- - libqt5gui5
- - libqt5network5
- - libqt5widgets5
diff --git a/find-object/src/AboutDialog.cpp b/find-object/src/AboutDialog.cpp
deleted file mode 100644
index 9a805816..00000000
--- a/find-object/src/AboutDialog.cpp
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
-Copyright (c) 2011-2014, Mathieu Labbe - IntRoLab - Universite de Sherbrooke
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- * Neither the name of the Universite de Sherbrooke nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "AboutDialog.h"
-#include "ui_aboutDialog.h"
-#include
-#include "find_object/Version.h"
-
-namespace find_object {
-
-AboutDialog::AboutDialog(QWidget * parent) :
- QDialog(parent)
-{
- ui_ = new Ui_aboutDialog();
- ui_->setupUi(this);
- ui_->label_version->setText(PROJECT_VERSION);
-
- QString cv_version = CV_VERSION;
- #if FINDOBJECT_NONFREE == 1
- cv_version.append(" [With nonfree]");
- #else
- cv_version.append(" [Without nonfree]");
- #endif
-
- ui_->label_version_opencv->setText(cv_version);
- ui_->label_version_qt->setText(QT_VERSION_STR);
-}
-
-AboutDialog::~AboutDialog()
-{
- delete ui_;
-}
-
-}
diff --git a/find-object/src/AboutDialog.h b/find-object/src/AboutDialog.h
deleted file mode 100644
index 2d99fbc4..00000000
--- a/find-object/src/AboutDialog.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
-Copyright (c) 2011-2014, Mathieu Labbe - IntRoLab - Universite de Sherbrooke
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- * Neither the name of the Universite de Sherbrooke nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#ifndef ABOUTDIALOG_H_
-#define ABOUTDIALOG_H_
-
-#include
-#include
-
-class Ui_aboutDialog;
-
-namespace find_object {
-
-class AboutDialog : public QDialog
-{
- Q_OBJECT
-
-public:
- AboutDialog(QWidget * parent = 0);
-
- virtual ~AboutDialog();
-
-private:
- Ui_aboutDialog * ui_;
-};
-
-} // namespace find_object
-
-#endif /* ABOUTDIALOG_H_ */
diff --git a/find-object/src/AddObjectDialog.cpp b/find-object/src/AddObjectDialog.cpp
deleted file mode 100644
index 7e097b0a..00000000
--- a/find-object/src/AddObjectDialog.cpp
+++ /dev/null
@@ -1,461 +0,0 @@
-/*
-Copyright (c) 2011-2014, Mathieu Labbe - IntRoLab - Universite de Sherbrooke
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- * Neither the name of the Universite de Sherbrooke nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "find_object/Camera.h"
-#include "find_object/Settings.h"
-#include "find_object/utilite/ULogger.h"
-#include "find_object/ObjWidget.h"
-#include "find_object/QtOpenCV.h"
-
-#include "AddObjectDialog.h"
-#include "ui_addObjectDialog.h"
-#include "KeypointItem.h"
-#include "ObjSignature.h"
-
-#include
-
-#include
-#include
-#include
-
-#include
-#include
-#include
-
-namespace find_object {
-
-AddObjectDialog::AddObjectDialog(Camera * camera, const cv::Mat & image, bool mirrorView, QWidget * parent, Qt::WindowFlags f) :
- QDialog(parent, f),
- camera_(camera),
- objWidget_(0),
- objSignature_(0)
-{
- ui_ = new Ui_addObjectDialog();
- ui_->setupUi(this);
-
- detector_ = Settings::createKeypointDetector();
- extractor_ = Settings::createDescriptorExtractor();
- UASSERT(detector_ != 0 && extractor_ != 0);
-
- connect(ui_->pushButton_cancel, SIGNAL(clicked()), this, SLOT(cancel()));
- connect(ui_->pushButton_back, SIGNAL(clicked()), this, SLOT(back()));
- connect(ui_->pushButton_next, SIGNAL(clicked()), this, SLOT(next()));
- connect(ui_->pushButton_takePicture, SIGNAL(clicked()), this, SLOT(takePicture()));
- connect(ui_->comboBox_selection, SIGNAL(currentIndexChanged(int)), this, SLOT(changeSelectionMode()));
-
- connect(ui_->cameraView, SIGNAL(selectionChanged()), this, SLOT(updateNextButton()));
- connect(ui_->cameraView, SIGNAL(roiChanged(const cv::Rect &)), this, SLOT(updateNextButton(const cv::Rect &)));
- ui_->cameraView->setMirrorView(mirrorView);
-
- if((camera_ && camera_->isRunning()) || image.empty())
- {
- this->setState(kTakePicture);
- }
- else if(!image.empty())
- {
- update(image);
- this->setState(kSelectFeatures);
- }
-}
-
-AddObjectDialog::~AddObjectDialog()
-{
- delete detector_;
- delete extractor_;
- if(objWidget_)
- {
- delete objWidget_;
- objWidget_ = 0;
- }
- if(objSignature_)
- {
- delete objSignature_;
- objSignature_ = 0;
- }
- delete ui_;
-}
-
-void AddObjectDialog::retrieveObject(ObjWidget ** widget, ObjSignature ** signature)
-{
- *widget = objWidget_;
- objWidget_= 0;
- *signature = objSignature_;
- objSignature_ = 0;
-}
-
-void AddObjectDialog::closeEvent(QCloseEvent* event)
-{
- if(camera_)
- {
- disconnect(camera_, SIGNAL(imageReceived(const cv::Mat &)), this, SLOT(update(const cv::Mat &)));
- disconnect(camera_, SIGNAL(imageReceived(const cv::Mat &, const find_object::Header &, const cv::Mat &, float)), this, SLOT(update(const cv::Mat &, const find_object::Header &, const cv::Mat &, float)));
- }
- QDialog::closeEvent(event);
-}
-
-void AddObjectDialog::next()
-{
- setState(state_+1);
-}
-void AddObjectDialog::back()
-{
- setState(state_-1);
-}
-void AddObjectDialog::cancel()
-{
- this->reject();
-}
-void AddObjectDialog::takePicture()
-{
- next();
-}
-
-void AddObjectDialog::updateNextButton()
-{
- updateNextButton(cv::Rect());
-}
-
-void AddObjectDialog::updateNextButton(const cv::Rect & rect)
-{
- roi_ = rect;
- if(roi_.height && roi_.width && cameraImage_.cols)
- {
- //clip roi
- if( roi_.x >= cameraImage_.cols ||
- roi_.x+roi_.width <= 0 ||
- roi_.y >= cameraImage_.rows ||
- roi_.y+roi_.height <= 0)
- {
- //Not valid...
- roi_ = cv::Rect();
- }
- else
- {
- if(roi_.x < 0)
- {
- roi_.x = 0;
- }
- if(roi_.x + roi_.width > cameraImage_.cols)
- {
- roi_.width = cameraImage_.cols - roi_.x;
- }
- if(roi_.y < 0)
- {
- roi_.y = 0;
- }
- if(roi_.y + roi_.height > cameraImage_.rows)
- {
- roi_.height = cameraImage_.rows - roi_.y;
- }
- }
- }
- if(state_ == kSelectFeatures)
- {
- if(ui_->comboBox_selection->currentIndex() == 1)
- {
- if(ui_->cameraView->selectedItems().size() > 0)
- {
- ui_->pushButton_next->setEnabled(true);
- }
- else
- {
- ui_->pushButton_next->setEnabled(false);
- }
- }
- else
- {
- if(roi_.width == 0 || roi_.height == 0)
- {
- ui_->pushButton_next->setEnabled(false);
- }
- else
- {
- ui_->pushButton_next->setEnabled(true);
- }
- }
- }
-}
-
-void AddObjectDialog::changeSelectionMode()
-{
- this->setState(kSelectFeatures);
-}
-
-void AddObjectDialog::setState(int state)
-{
- state_ = state;
- if(state == kTakePicture)
- {
- ui_->pushButton_cancel->setEnabled(true);
- ui_->pushButton_back->setEnabled(false);
- ui_->pushButton_next->setEnabled(false);
- ui_->pushButton_takePicture->setEnabled(true);
- ui_->label_instruction->setText(tr("Place the object in front of the camera and click \"Take picture\"."));
- ui_->pushButton_next->setText(tr("Next"));
- ui_->cameraView->setVisible(true);
- ui_->cameraView->clearRoiSelection();
- ui_->objectView->setVisible(false);
- ui_->cameraView->setGraphicsViewMode(false);
- ui_->comboBox_selection->setVisible(false);
- if(!camera_ || !camera_->start())
- {
- QMessageBox::critical(this, tr("Camera error"), tr("Camera is not started!"));
- ui_->pushButton_takePicture->setEnabled(false);
- }
- else
- {
- connect(camera_, SIGNAL(imageReceived(const cv::Mat &)), this, SLOT(update(const cv::Mat &)));
- connect(camera_, SIGNAL(imageReceived(const cv::Mat &, const find_object::Header &, const cv::Mat &, float)), this, SLOT(update(const cv::Mat &, const find_object::Header &, const cv::Mat &, float)));
- }
- }
- else if(state == kSelectFeatures)
- {
- if(camera_)
- {
- disconnect(camera_, SIGNAL(imageReceived(const cv::Mat &)), this, SLOT(update(const cv::Mat &)));
- disconnect(camera_, SIGNAL(imageReceived(const cv::Mat &, const find_object::Header &, const cv::Mat &, float)), this, SLOT(update(const cv::Mat &, const find_object::Header &, const cv::Mat &, float)));
- camera_->pause();
- }
-
- ui_->pushButton_cancel->setEnabled(true);
- ui_->pushButton_back->setEnabled(camera_);
- ui_->pushButton_next->setEnabled(false);
- ui_->pushButton_takePicture->setEnabled(false);
- ui_->pushButton_next->setText(tr("Next"));
- ui_->cameraView->setVisible(true);
- ui_->cameraView->clearRoiSelection();
- ui_->objectView->setVisible(false);
- ui_->comboBox_selection->setVisible(true);
-
- if(ui_->comboBox_selection->currentIndex() == 1)
- {
- ui_->label_instruction->setText(tr("Select features representing the object."));
- ui_->cameraView->setGraphicsViewMode(true);
- }
- else
- {
- ui_->label_instruction->setText(tr("Select region representing the object."));
- ui_->cameraView->setGraphicsViewMode(false);
- }
- updateNextButton(cv::Rect());
- }
- else if(state == kVerifySelection)
- {
- if(camera_)
- {
- disconnect(camera_, SIGNAL(imageReceived(const cv::Mat &)), this, SLOT(update(const cv::Mat &)));
- disconnect(camera_, SIGNAL(imageReceived(const cv::Mat &, const find_object::Header &, const cv::Mat &, float)), this, SLOT(update(const cv::Mat &, const find_object::Header &, const cv::Mat &, float)));
- camera_->pause();
- }
-
- ui_->pushButton_cancel->setEnabled(true);
- ui_->pushButton_back->setEnabled(true);
- ui_->pushButton_takePicture->setEnabled(false);
- ui_->pushButton_next->setText(tr("End"));
- ui_->cameraView->setVisible(true);
- ui_->objectView->setVisible(true);
- ui_->objectView->setMirrorView(ui_->cameraView->isMirrorView());
- ui_->objectView->setSizedFeatures(ui_->cameraView->isSizedFeatures());
- ui_->comboBox_selection->setVisible(false);
- if(ui_->comboBox_selection->currentIndex() == 1)
- {
- ui_->cameraView->setGraphicsViewMode(true);
- }
- else
- {
- ui_->cameraView->setGraphicsViewMode(false);
- }
-
- std::vector selectedKeypoints = ui_->cameraView->selectedKeypoints();
-
- // Select keypoints
- if(!cameraImage_.empty() &&
- ((ui_->comboBox_selection->currentIndex() == 1 && selectedKeypoints.size()) ||
- (ui_->comboBox_selection->currentIndex() == 0 && roi_.width && roi_.height)))
- {
- if(ui_->comboBox_selection->currentIndex() == 1)
- {
- roi_ = computeROI(selectedKeypoints);
- }
-
- cv::Mat imgRoi = cv::Mat(cameraImage_, roi_).clone();
-
- if(ui_->comboBox_selection->currentIndex() == 1)
- {
- if(roi_.x != 0 || roi_.y != 0)
- {
- for(unsigned int i=0; idetect(imgRoi, selectedKeypoints);
- }
- ui_->objectView->updateImage(cvtCvMat2QImage(imgRoi));
- ui_->objectView->updateData(selectedKeypoints, QMultiMap());
- ui_->objectView->setMinimumSize(roi_.width, roi_.height);
- ui_->objectView->update();
- ui_->pushButton_next->setEnabled(true);
- }
- else
- {
- UINFO("Please select items");
- ui_->pushButton_next->setEnabled(false);
- }
- ui_->label_instruction->setText(tr("Selection : %1 features").arg(selectedKeypoints.size()));
- }
- else if(state == kClosing)
- {
- std::vector keypoints = ui_->objectView->keypoints();
- if((ui_->comboBox_selection->currentIndex() == 1 && keypoints.size()) ||
- (ui_->comboBox_selection->currentIndex() == 0 && roi_.width && roi_.height))
- {
- cv::Mat descriptors;
- cv::Mat imgRoi(cameraImage_, roi_);
- if(keypoints.size())
- {
- // Extract descriptors
- if(Settings::currentDetectorType() == Settings::currentDescriptorType())
- {
- detector_->compute(imgRoi, keypoints, descriptors);
- }
- else
- {
- extractor_->compute(imgRoi, keypoints, descriptors);
- }
-
- if(keypoints.size() != (unsigned int)descriptors.rows)
- {
- UERROR("keypoints=%d != descriptors=%d", (int)keypoints.size(), descriptors.rows);
- }
- }
-
- if(objWidget_)
- {
- delete objWidget_;
- objWidget_ = 0;
- }
- if(objSignature_)
- {
- delete objSignature_;
- objSignature_ = 0;
- }
- objSignature_ = new ObjSignature(0, imgRoi.clone(), "");
- objSignature_->setData(keypoints, descriptors);
- objWidget_ = new ObjWidget(0, keypoints, QMultiMap(), cvtCvMat2QImage(imgRoi.clone()));
-
- this->accept();
- }
- }
-}
-
-void AddObjectDialog::update(const cv::Mat & image)
-{
- update(image, Header(), cv::Mat(), 0.0);
-}
-
-void AddObjectDialog::update(const cv::Mat & image, const Header & header, const cv::Mat & depth, float depthConstant)
-{
- cameraImage_ = cv::Mat();
- if(!image.empty())
- {
- // convert to grayscale
- if(image.channels() != 1 || image.depth() != CV_8U)
- {
- cv::cvtColor(image, cameraImage_, CV_BGR2GRAY);
- }
- else
- {
- cameraImage_ = image.clone();
- }
-
- // Extract keypoints
- std::vector keypoints;
- detector_->detect(cameraImage_, keypoints);
-
- ui_->cameraView->updateImage(cvtCvMat2QImage(cameraImage_));
- ui_->cameraView->updateData(keypoints, QMultiMap());
- ui_->cameraView->update();
- }
- else
- {
- UWARN("Camera cannot get more images (maybe the end of stream is reached)...");
- camera_->stop();
- }
-}
-
-cv::Rect AddObjectDialog::computeROI(const std::vector & kpts)
-{
- cv::Rect roi(0,0,0,0);
- int x1=0,x2=0,h1=0,h2=0;
- for(unsigned int i=0; i int(kpts.at(i).pt.x - radius))
- {
- x1 = int(kpts.at(i).pt.x - radius);
- }
- else if(x2 < int(kpts.at(i).pt.x + radius))
- {
- x2 = int(kpts.at(i).pt.x + radius);
- }
- if(h1 > int(kpts.at(i).pt.y - radius))
- {
- h1 = int(kpts.at(i).pt.y - radius);
- }
- else if(h2 < int(kpts.at(i).pt.y + radius))
- {
- h2 = int(kpts.at(i).pt.y + radius);
- }
- }
- roi.x = x1;
- roi.y = h1;
- roi.width = x2-x1;
- roi.height = h2-h1;
- //UINFO("ptx=%d, pty=%d", (int)kpts.at(i).pt.x, (int)kpts.at(i).pt.y);
- //UINFO("x=%d, y=%d, w=%d, h=%d", roi.x, roi.y, roi.width, roi.height);
- }
-
- return roi;
-}
-
-} // namespace find_object
diff --git a/find-object/src/AddObjectDialog.h b/find-object/src/AddObjectDialog.h
deleted file mode 100644
index b75d9c97..00000000
--- a/find-object/src/AddObjectDialog.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
-Copyright (c) 2011-2014, Mathieu Labbe - IntRoLab - Universite de Sherbrooke
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- * Neither the name of the Universite de Sherbrooke nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#ifndef ADDOBJECTDIALOG_H_
-#define ADDOBJECTDIALOG_H_
-
-#include
-#include
-#include
-#include
-#include "find_object/Header.h"
-
-class Ui_addObjectDialog;
-
-namespace find_object {
-
-class ObjWidget;
-class Camera;
-class KeypointItem;
-class Feature2D;
-class ObjSignature;
-
-class AddObjectDialog : public QDialog {
-
- Q_OBJECT
-
-public:
- AddObjectDialog(Camera * camera, const cv::Mat & image, bool mirrorView, QWidget * parent = 0, Qt::WindowFlags f = 0);
- virtual ~AddObjectDialog();
-
- // ownership transferred to caller
- void retrieveObject(ObjWidget ** widget, ObjSignature ** signature);
-
-private Q_SLOTS:
- void update(const cv::Mat &);
- void update(const cv::Mat &, const find_object::Header &, const cv::Mat &, float);
- void next();
- void back();
- void cancel();
- void takePicture();
- void updateNextButton();
- void updateNextButton(const cv::Rect &);
- void changeSelectionMode();
-
-protected:
- virtual void closeEvent(QCloseEvent* event);
-
-private:
- void setState(int state);
- cv::Rect computeROI(const std::vector & kpts);
-private:
- Ui_addObjectDialog * ui_;
- Camera * camera_;
- ObjWidget * objWidget_;
- ObjSignature * objSignature_;
- cv::Mat cameraImage_;
- cv::Rect roi_;
- Feature2D * detector_;
- Feature2D * extractor_;
-
- enum State{kTakePicture, kSelectFeatures, kVerifySelection, kClosing};
- int state_;
-};
-
-} // namespace find_object
-
-#endif /* ADDOBJECTDIALOG_H_ */
diff --git a/find-object/src/CMakeLists.txt b/find-object/src/CMakeLists.txt
deleted file mode 100644
index c6a95a69..00000000
--- a/find-object/src/CMakeLists.txt
+++ /dev/null
@@ -1,281 +0,0 @@
-
-
-### Qt Gui stuff ###
-SET(headers_ui
- ../include/${PROJECT_PREFIX}/MainWindow.h
- ../include/${PROJECT_PREFIX}/FindObject.h
- ../include/${PROJECT_PREFIX}/Camera.h
- ../include/${PROJECT_PREFIX}/TcpServer.h
- ../include/${PROJECT_PREFIX}/ObjWidget.h
- ./AddObjectDialog.h
- ./CameraTcpServer.h
- ./ParametersToolBox.h
- ./AboutDialog.h
- ./RectItem.h
- ./ImageDropWidget.h
- ./rtabmap/PdfPlot.h
- ./utilite/UPlot.h
-)
-IF(CATKIN_BUILD)
- SET(headers_ui
- ${headers_ui}
- ./ros1/CameraROS.h
- ./ros1/FindObjectROS.h
- )
-ENDIF(CATKIN_BUILD)
-IF(COLCON_BUILD)
- SET(headers_ui
- ${headers_ui}
- ./ros2/CameraROS.h
- ./ros2/FindObjectROS.h
- )
-ENDIF(COLCON_BUILD)
-
-SET(uis
- ./ui/mainWindow.ui
- ./ui/addObjectDialog.ui
- ./ui/aboutDialog.ui
-)
-
-SET(qrc
- ./resources.qrc
-)
-
-IF(QT4_FOUND)
- # generate rules for building source files from the resources
- QT4_ADD_RESOURCES(srcs_qrc ${qrc})
-
- #Generate .h files from the .ui files
- QT4_WRAP_UI(moc_uis ${uis})
-
- #This will generate moc_* for Qt
- QT4_WRAP_CPP(moc_srcs ${headers_ui})
- ### Qt Gui stuff end###
-ELSE()
- QT5_ADD_RESOURCES(srcs_qrc ${qrc})
- QT5_WRAP_UI(moc_uis ${uis})
- QT5_WRAP_CPP(moc_srcs ${headers_ui})
-ENDIF()
-
-SET(SRC_FILES
- ./MainWindow.cpp
- ./AddObjectDialog.cpp
- ./KeypointItem.cpp
- ./RectItem.cpp
- ./QtOpenCV.cpp
- ./Camera.cpp
- ./CameraTcpServer.cpp
- ./ParametersToolBox.cpp
- ./Settings.cpp
- ./ObjWidget.cpp
- ./ImageDropWidget.cpp
- ./FindObject.cpp
- ./AboutDialog.cpp
- ./TcpServer.cpp
- ./Vocabulary.cpp
- ./JsonWriter.cpp
- ./utilite/ULogger.cpp
- ./utilite/UPlot.cpp
- ./utilite/UDirectory.cpp
- ./utilite/UFile.cpp
- ./utilite/UConversion.cpp
- ./rtabmap/PdfPlot.cpp
- ./json/jsoncpp.cpp
- ./Compression.cpp
- ${moc_srcs}
- ${moc_uis}
- ${srcs_qrc}
-)
-IF(CATKIN_BUILD)
- SET(SRC_FILES
- ${SRC_FILES}
- ./ros1/CameraROS.cpp
- ./ros1/FindObjectROS.cpp
- )
-ENDIF(CATKIN_BUILD)
-IF(COLCON_BUILD)
- SET(SRC_FILES
- ${SRC_FILES}
- ./ros2/CameraROS.cpp
- ./ros2/FindObjectROS.cpp
- )
-ENDIF(COLCON_BUILD)
-
-SET(INCLUDE_DIRS
- ${CMAKE_CURRENT_SOURCE_DIR}/../include
- ${CMAKE_CURRENT_SOURCE_DIR}
- ${OpenCV_INCLUDE_DIRS}
- ${CMAKE_CURRENT_BINARY_DIR} # for qt ui generated in binary dir
- ${ZLIB_INCLUDE_DIRS}
-)
-
-IF(QT4_FOUND)
- INCLUDE(${QT_USE_FILE})
-ENDIF(QT4_FOUND)
-
-SET(LIBRARIES
- ${QT_LIBRARIES}
- ${OpenCV_LIBS}
- ${ZLIB_LIBRARIES}
-)
-IF(CATKIN_BUILD)
- SET(LIBRARIES
- ${LIBRARIES}
- ${catkin_LIBRARIES}
- )
-ENDIF(CATKIN_BUILD)
-IF(COLCON_BUILD)
- SET(AMENT_LIBRARIES
- rclcpp
- rclcpp_components
- cv_bridge
- sensor_msgs
- std_msgs
- image_transport
- message_filters
- tf2
- tf2_ros
- tf2_geometry_msgs
- geometry_msgs
- )
-ENDIF(COLCON_BUILD)
-
-
-IF(TORCH_FOUND)
- SET(LIBRARIES
- ${LIBRARIES}
- ${TORCH_LIBRARIES}
- )
- SET(SRC_FILES
- ${SRC_FILES}
- superpoint_torch/SuperPoint.cc
- )
- SET(INCLUDE_DIRS
- ${TORCH_INCLUDE_DIRS}
- ${CMAKE_CURRENT_SOURCE_DIR}/superpoint_torch
- ${INCLUDE_DIRS}
- )
- ADD_DEFINITIONS("-DWITH_TORCH")
-ENDIF(TORCH_FOUND)
-
-
-#include files
-INCLUDE_DIRECTORIES(${INCLUDE_DIRS})
-
-IF(CATKIN_BUILD)
- INCLUDE_DIRECTORIES(SYSTEM ${catkin_INCLUDE_DIRS})
-ENDIF(CATKIN_BUILD)
-
-# create a library from the source files
-ADD_LIBRARY(find_object ${SRC_FILES})
-# Linking with Qt libraries
-IF(Qt5_FOUND)
- QT5_USE_MODULES(find_object Widgets Core Gui Network PrintSupport)
-ENDIF(Qt5_FOUND)
-
-IF(NOT COLCON_BUILD)
- TARGET_LINK_LIBRARIES(find_object ${LIBRARIES})
-ENDIF()
-IF(CATKIN_BUILD)
- set_target_properties(find_object PROPERTIES OUTPUT_NAME find_object_2d)
- add_dependencies(find_object ${${PROJECT_NAME}_EXPORTED_TARGETS})
-ENDIF(CATKIN_BUILD)
-IF(COLCON_BUILD)
- ament_target_dependencies(find_object ${AMENT_LIBRARIES})
-
- if("$ENV{ROS_DISTRO}" STRGREATER_EQUAL "humble")
- rosidl_get_typesupport_target(cpp_typesupport_target ${PROJECT_NAME} "rosidl_typesupport_cpp")
- target_link_libraries(find_object ${cpp_typesupport_target} ${LIBRARIES})
- else()
- # foxy, galatic
- target_link_libraries(find_object ${LIBRARIES})
- rosidl_target_interfaces(find_object ${PROJECT_NAME} "rosidl_typesupport_cpp")
-
- function(rosidl_get_typesupport_target var generate_interfaces_target typesupport_name)
- rosidl_target_interfaces(${var} ${generate_interfaces_target} ${typesupport_name})
- endfunction()
- add_definitions(-DPRE_ROS_HUMBLE)
- endif()
-ENDIF(COLCON_BUILD)
-
-IF(NOT ROS_BUILD)
- INSTALL(TARGETS find_object
- RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT runtime
- LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT devel
- ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT devel)
-
- install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../include/ DESTINATION "${INSTALL_INCLUDE_DIR}" COMPONENT devel FILES_MATCHING PATTERN "*.h" PATTERN ".svn" EXCLUDE)
-ELSEIF(CATKIN_BUILD)
- add_executable(find_object_2d ros1/find_object_2d_node.cpp)
- target_link_libraries(find_object_2d find_object ${LIBRARIES})
-
- add_executable(print_objects_detected ros1/print_objects_detected_node.cpp)
- target_link_libraries(print_objects_detected ${LIBRARIES})
- add_dependencies(print_objects_detected ${${PROJECT_NAME}_EXPORTED_TARGETS})
-
- add_executable(tf_example ros1/tf_example_node.cpp)
- target_link_libraries(tf_example ${LIBRARIES})
- add_dependencies(tf_example ${${PROJECT_NAME}_EXPORTED_TARGETS})
-
- IF(Qt5_FOUND)
- QT5_USE_MODULES(find_object_2d Widgets Core Gui Network PrintSupport)
- QT5_USE_MODULES(print_objects_detected Widgets Core Gui Network PrintSupport)
- QT5_USE_MODULES(tf_example Widgets Core Gui Network PrintSupport)
- ENDIF(Qt5_FOUND)
-
- ## Mark executables and/or libraries for installation
- install(TARGETS
- find_object
- find_object_2d
- print_objects_detected
- tf_example
- ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
- LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
- RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
- )
-ELSE() # COLCON_BUILD
- add_executable(find_object_2d_node ros2/find_object_2d_node.cpp)
- set_target_properties(find_object_2d_node PROPERTIES OUTPUT_NAME find_object_2d)
- ament_target_dependencies(find_object_2d_node ${AMENT_LIBRARIES})
- target_link_libraries(find_object_2d_node find_object ${LIBRARIES})
-
- add_executable(print_objects_detected ros2/print_objects_detected_node.cpp)
- ament_target_dependencies(print_objects_detected ${AMENT_LIBRARIES})
- target_link_libraries(print_objects_detected find_object ${LIBRARIES})
-
- add_executable(tf_example ros2/tf_example_node.cpp)
- ament_target_dependencies(tf_example ${AMENT_LIBRARIES})
- target_link_libraries(tf_example find_object ${LIBRARIES})
-
- # Only required when using messages built from the same package
- # https://index.ros.org/doc/ros2/Tutorials/Rosidl-Tutorial/
- get_default_rmw_implementation(rmw_implementation)
- find_package("${rmw_implementation}" REQUIRED)
- get_rmw_typesupport(typesupport_impls "${rmw_implementation}" LANGUAGE "cpp")
-
- foreach(typesupport_impl ${typesupport_impls})
- rosidl_get_typesupport_target(find_object_2d_node
- ${PROJECT_NAME} ${typesupport_impl}
- )
- rosidl_get_typesupport_target(print_objects_detected
- ${PROJECT_NAME} ${typesupport_impl}
- )
- rosidl_get_typesupport_target(tf_example
- ${PROJECT_NAME} ${typesupport_impl}
- )
- endforeach()
-
- ## Mark executables and/or libraries for installation
- install(TARGETS
- find_object
- ARCHIVE DESTINATION lib
- LIBRARY DESTINATION lib
- RUNTIME DESTINATION bin
- )
- install(TARGETS
- find_object_2d_node
- print_objects_detected
- tf_example
- DESTINATION lib/${PROJECT_NAME}
- )
-ENDIF()
diff --git a/find-object/src/Camera.cpp b/find-object/src/Camera.cpp
deleted file mode 100644
index 6630b6b3..00000000
--- a/find-object/src/Camera.cpp
+++ /dev/null
@@ -1,296 +0,0 @@
-/*
-Copyright (c) 2011-2014, Mathieu Labbe - IntRoLab - Universite de Sherbrooke
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- * Neither the name of the Universite de Sherbrooke nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "find_object/Camera.h"
-#include "find_object/Settings.h"
-#include "find_object/utilite/ULogger.h"
-#include "find_object/QtOpenCV.h"
-
-#include
-#include
-#if CV_MAJOR_VERSION > 3
-#include
-#endif
-#include
-#include "utilite/UDirectory.h"
-#include "CameraTcpServer.h"
-
-namespace find_object {
-
-Camera::Camera(QObject * parent) :
- QObject(parent),
- currentImageIndex_(0),
- cameraTcpServer_(0)
-{
- qRegisterMetaType("cv::Mat");
- connect(&cameraTimer_, SIGNAL(timeout()), this, SLOT(takeImage()));
-}
-
-Camera::~Camera()
-{
- this->stop();
-}
-
-void Camera::stop()
-{
- stopTimer();
- capture_.release();
- images_.clear();
- currentImageIndex_ = 0;
- if(cameraTcpServer_)
- {
- cameraTcpServer_->close();
- delete cameraTcpServer_;
- cameraTcpServer_ = 0;
- }
-}
-
-void Camera::pause()
-{
- stopTimer();
-}
-
-int Camera::getTotalFrames()
-{
- if(images_.size())
- {
- return images_.size();
- }
- else if(capture_.isOpened())
- {
- return (int)capture_.get(CV_CAP_PROP_FRAME_COUNT);
- }
- return 0;
-}
-
-int Camera::getCurrentFrameIndex()
-{
- if(images_.size())
- {
- return currentImageIndex_;
- }
- else if(capture_.isOpened())
- {
- return (int)capture_.get(CV_CAP_PROP_POS_FRAMES);
- }
- return 0;
-}
-
-void Camera::moveToFrame(int frame)
-{
- if(frame < images_.size())
- {
- currentImageIndex_ = frame;
- }
- else if(capture_.isOpened() && frame < (int)capture_.get(CV_CAP_PROP_FRAME_COUNT))
- {
- capture_.set(CV_CAP_PROP_POS_FRAMES, frame);
- }
-}
-
-int Camera::getPort()
-{
- if(cameraTcpServer_)
- {
- return cameraTcpServer_->getPort();
- }
- return 0;
-}
-
-void Camera::takeImage()
-{
- cv::Mat img;
- if(capture_.isOpened())
- {
- capture_.read(img);// capture a frame
- }
- else if(!images_.empty())
- {
- if(currentImageIndex_ < (unsigned int)images_.size())
- {
- img = cv::imread(images_[currentImageIndex_++]);
- }
- }
- else if(cameraTcpServer_)
- {
- img = cameraTcpServer_->getImage();
- if(cameraTcpServer_->imagesBuffered() > 0 && Settings::getCamera_9queueSize() == 0)
- {
- UWARN("%d images buffered so far...", cameraTcpServer_->imagesBuffered());
- }
- }
-
- if(img.empty())
- {
- if(cameraTcpServer_)
- {
- if(!cameraTcpServer_->isConnected())
- {
- cameraTcpServer_->waitForNewConnection(100);
- }
- }
- else
- {
- // In case of a directory of images or a video
- this->stop();
- Q_EMIT finished(); // notify that there are no more images
- }
- }
- else
- {
- //resize
- if( Settings::getCamera_2imageWidth() &&
- Settings::getCamera_3imageHeight() &&
- Settings::getCamera_2imageWidth() != img.cols &&
- Settings::getCamera_3imageHeight() != img.rows)
- {
- cv::Mat resampled;
- cv::resize(img, resampled, cv::Size(Settings::getCamera_2imageWidth(), Settings::getCamera_3imageHeight()));
- Q_EMIT imageReceived(resampled);
- }
- else if(capture_.isOpened())
- {
- Q_EMIT imageReceived(img.clone()); // clone required with VideoCapture::read()
- }
- else
- {
- Q_EMIT imageReceived(img); // clone not required with cv::imread()
- }
- }
-}
-
-bool Camera::start()
-{
- if(!capture_.isOpened() && images_.empty() && cameraTcpServer_ == 0)
- {
- if(Settings::getCamera_6useTcpCamera())
- {
- cameraTcpServer_ = new CameraTcpServer(Settings::getCamera_8port(), this);
- if(!cameraTcpServer_->isListening())
- {
- UWARN("CameraTCP: Cannot listen to port %d", cameraTcpServer_->getPort());
- delete cameraTcpServer_;
- cameraTcpServer_ = 0;
- }
- else
- {
- UINFO("CameraTCP: listening to port %d (IP=%s)",
- cameraTcpServer_->getPort(),
- cameraTcpServer_->getHostAddress().toString().toStdString().c_str());
- }
- }
- else
- {
- QString path = Settings::getCamera_5mediaPath();
- if(UDirectory::exists(path.toStdString()))
- {
- //Images directory
- QString ext = Settings::getGeneral_imageFormats();
- ext.remove('*');
- ext.remove('.');
- UDirectory dir(path.toStdString(), ext.toStdString()); // this will load fileNames matching the extensions (in natural order)
- const std::list & fileNames = dir.getFileNames();
- currentImageIndex_ = 0;
- images_.clear();
- // Modify to have full path
- for(std::list::const_iterator iter = fileNames.begin(); iter!=fileNames.end(); ++iter)
- {
- images_.append(path.toStdString() + UDirectory::separator() + *iter);
- }
- UINFO("Camera: Reading %d images from directory \"%s\"...", (int)images_.size(), path.toStdString().c_str());
- if(images_.isEmpty())
- {
- UWARN("Camera: Directory \"%s\" is empty (no images matching the \"%s\" extensions). "
- "If you want to disable loading automatically this directory, "
- "clear the Camera/mediaPath parameter. By default, webcam will be used instead of the directory.",
- path.toStdString().c_str(),
- ext.toStdString().c_str());
- }
- }
- else if(!path.isEmpty())
- {
- //Video file
- capture_.open(path.toStdString().c_str());
- if(!capture_.isOpened())
- {
- UWARN("Camera: Cannot open file \"%s\". If you want to disable loading "
- "automatically this video file, clear the Camera/mediaPath parameter. "
- "By default, webcam will be used instead of the file.", path.toStdString().c_str());
- }
- else
- {
- UINFO("Camera: Reading from video file \"%s\"...", path.toStdString().c_str());
- }
- }
- if(!capture_.isOpened() && images_.empty())
- {
- //set camera device
- capture_.open(Settings::getCamera_1deviceId());
- if(Settings::getCamera_2imageWidth() && Settings::getCamera_3imageHeight())
- {
- capture_.set(CV_CAP_PROP_FRAME_WIDTH, double(Settings::getCamera_2imageWidth()));
- capture_.set(CV_CAP_PROP_FRAME_HEIGHT, double(Settings::getCamera_3imageHeight()));
- }
- UINFO("Camera: Reading from camera device %d...", Settings::getCamera_1deviceId());
- }
- }
- }
- if(!capture_.isOpened() && images_.empty() && cameraTcpServer_ == 0)
- {
- UERROR("Camera: Failed to open a capture object!");
- return false;
- }
-
- startTimer();
- return true;
-}
-
-void Camera::startTimer()
-{
- updateImageRate();
- cameraTimer_.start();
-}
-
-void Camera::stopTimer()
-{
- cameraTimer_.stop();
-}
-
-void Camera::updateImageRate()
-{
- if(Settings::getCamera_4imageRate())
- {
- cameraTimer_.setInterval((int)(1000.0/Settings::getCamera_4imageRate()));
- }
- else
- {
- cameraTimer_.setInterval(0);
- }
-}
-
-} // namespace find_object
-
diff --git a/find-object/src/CameraTcpServer.cpp b/find-object/src/CameraTcpServer.cpp
deleted file mode 100644
index ca4fadb2..00000000
--- a/find-object/src/CameraTcpServer.cpp
+++ /dev/null
@@ -1,190 +0,0 @@
-/*
-Copyright (c) 2011-2014, Mathieu Labbe - IntRoLab - Universite de Sherbrooke
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- * Neither the name of the Universite de Sherbrooke nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#include "find_object/Settings.h"
-#include "find_object/utilite/ULogger.h"
-
-#include "CameraTcpServer.h"
-#include
-#include
-#include
-
-namespace find_object {
-
-CameraTcpServer::CameraTcpServer(quint16 port, QObject *parent) :
- QTcpServer(parent),
- blockSize_(0)
-{
- if (!this->listen(QHostAddress::Any, port))
- {
- UERROR("Unable to start the Camera TCP server: %s", this->errorString().toStdString().c_str());
- return;
- }
-}
-
-cv::Mat CameraTcpServer::getImage()
-{
- cv::Mat img;
- if(images_.size())
- {
- // if queue changed after tcp connection ended with images still in the buffer
- int queue = Settings::getCamera_9queueSize();
- while(queue > 0 && images_.size() > queue)
- {
- images_.pop_front();
- }
-
- img = images_.front();
- images_.pop_front();
- }
- if(this->findChildren().size() == 1)
- {
- this->findChildren().first()->waitForReadyRead(100);
- }
- return img;
-}
-
-bool CameraTcpServer::isConnected() const
-{
- return this->findChildren().size() > 0;
-}
-
-QHostAddress CameraTcpServer::getHostAddress() const
-{
- QHostAddress hostAddress;
-
- QList ipAddressesList = QNetworkInterface::allAddresses();
- // use the first non-localhost IPv4 address
- for (int i = 0; i < ipAddressesList.size(); ++i)
- {
- if (ipAddressesList.at(i) != QHostAddress::LocalHost && ipAddressesList.at(i).toIPv4Address())
- {
- hostAddress = ipAddressesList.at(i).toString();
- break;
- }
- }
-
- // if we did not find one, use IPv4 localhost
- if (hostAddress.isNull())
- {
- hostAddress = QHostAddress(QHostAddress::LocalHost);
- }
-
- return hostAddress;
-}
-
-quint16 CameraTcpServer::getPort() const
-{
- return this->serverPort();
-}
-#if QT_VERSION >= 0x050000
-void CameraTcpServer::incomingConnection(qintptr socketDescriptor)
-#else
-void CameraTcpServer::incomingConnection(int socketDescriptor)
-#endif
-{
- QList clients = this->findChildren();
- if(clients.size() >= 1)
- {
- UWARN("A client is already connected. Only one connection allowed at the same time.");
- QTcpSocket socket;
- socket.setSocketDescriptor(socketDescriptor);
- socket.close(); // close without sending an acknowledge
- }
- else
- {
- QTcpSocket * socket = new QTcpSocket(this);
- connect(socket, SIGNAL(readyRead()), this, SLOT(readReceivedData()));
- connect(socket, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(displayError(QAbstractSocket::SocketError)));
- connect(socket, SIGNAL(disconnected()), this, SLOT(connectionLost()));
- socket->setSocketDescriptor(socketDescriptor);
- socket->write(QByteArray("1")); // send acknowledge
- }
-}
-
-void CameraTcpServer::readReceivedData()
-{
- QTcpSocket * client = (QTcpSocket*)sender();
- QDataStream in(client);
- in.setVersion(QDataStream::Qt_4_0);
-
- if (blockSize_ == 0)
- {
- if (client->bytesAvailable() < (int)sizeof(quint64))
- {
- return;
- }
-
- in >> blockSize_;
- }
-
- if (client->bytesAvailable() < (int)blockSize_)
- {
- return;
- }
-
- std::vector buf(blockSize_);
- in.readRawData((char*)buf.data(), blockSize_);
- images_.push_back(cv::imdecode(buf, cv::IMREAD_UNCHANGED));
- int queue = Settings::getCamera_9queueSize();
- while(queue > 0 && images_.size() > queue)
- {
- images_.pop_front();
- }
- blockSize_ = 0;
-}
-
-void CameraTcpServer::displayError(QAbstractSocket::SocketError socketError)
-{
- switch (socketError)
- {
- case QAbstractSocket::RemoteHostClosedError:
- break;
- case QAbstractSocket::HostNotFoundError:
- UWARN("CameraTcp: Tcp error: The host was not found. Please "
- "check the host name and port settings.\n");
- break;
- case QAbstractSocket::ConnectionRefusedError:
- UWARN("CameraTcp: The connection was refused by the peer. "
- "Make sure your images server is running, "
- "and check that the host name and port "
- "settings are correct.");
- break;
- default:
- //UERROR("The following error occurred: %s.", this->errorString().toStdString().c_str());
- break;
- }
-}
-
-void CameraTcpServer::connectionLost()
-{
- //printf("[WARNING] CameraTcp: Connection lost!\n");
- ((QTcpSocket*)sender())->close();
- sender()->deleteLater();
- blockSize_ = 0; // reset
-}
-
-} // namespace find_object
diff --git a/find-object/src/CameraTcpServer.h b/find-object/src/CameraTcpServer.h
deleted file mode 100644
index af1581cf..00000000
--- a/find-object/src/CameraTcpServer.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
-Copyright (c) 2011-2014, Mathieu Labbe - IntRoLab - Universite de Sherbrooke
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- * Neither the name of the Universite de Sherbrooke nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#ifndef CAMERATCPCLIENT_H_
-#define CAMERATCPCLIENT_H_
-
-#include
-#include
-#include
-
-namespace find_object {
-
-class CameraTcpServer : public QTcpServer
-{
- Q_OBJECT;
-public:
- CameraTcpServer(quint16 port = 0, QObject * parent = 0);
- cv::Mat getImage();
- int imagesBuffered() const {return images_.size();}
- bool isConnected() const;
-
- QHostAddress getHostAddress() const;
- quint16 getPort() const;
-
-protected:
-#if QT_VERSION >= 0x050000
- virtual void incomingConnection ( qintptr socketDescriptor );
-#else
- virtual void incomingConnection ( int socketDescriptor );
-#endif
-
-private Q_SLOTS:
- void readReceivedData();
- void displayError(QAbstractSocket::SocketError socketError);
- void connectionLost();
-
-private:
- quint64 blockSize_;
- QVector images_;
-};
-
-} // namespace find_object
-
-#endif /* CAMERATCPCLIENT_H_ */
diff --git a/find-object/src/Compression.cpp b/find-object/src/Compression.cpp
deleted file mode 100644
index dfcd89e9..00000000
--- a/find-object/src/Compression.cpp
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Compression.cpp
- *
- * Created on: Sep 10, 2018
- * Author: labm2414
- */
-
-#include
-#include
-#include "find_object/utilite/ULogger.h"
-
-namespace find_object {
-
-std::vector compressData(const cv::Mat & data)
-{
- std::vector bytes;
- if(!data.empty())
- {
- uLong sourceLen = uLong(data.total())*uLong(data.elemSize());
- uLong destLen = compressBound(sourceLen);
- bytes.resize(destLen);
- int errCode = compress(
- (Bytef *)bytes.data(),
- &destLen,
- (const Bytef *)data.data,
- sourceLen);
-
- bytes.resize(destLen+3*sizeof(int));
- *((int*)&bytes[destLen]) = data.rows;
- *((int*)&bytes[destLen+sizeof(int)]) = data.cols;
- *((int*)&bytes[destLen+2*sizeof(int)]) = data.type();
-
- if(errCode == Z_MEM_ERROR)
- {
- UERROR("Z_MEM_ERROR : Insufficient memory.");
- }
- else if(errCode == Z_BUF_ERROR)
- {
- UERROR("Z_BUF_ERROR : The buffer dest was not large enough to hold the uncompressed data.");
- }
- }
- return bytes;
-}
-
-cv::Mat uncompressData(const unsigned char * bytes, unsigned long size)
-{
- cv::Mat data;
- if(bytes && size>=3*sizeof(int))
- {
- //last 3 int elements are matrix size and type
- int height = *((int*)&bytes[size-3*sizeof(int)]);
- int width = *((int*)&bytes[size-2*sizeof(int)]);
- int type = *((int*)&bytes[size-1*sizeof(int)]);
-
- data = cv::Mat(height, width, type);
- uLongf totalUncompressed = uLongf(data.total())*uLongf(data.elemSize());
-
- int errCode = uncompress(
- (Bytef*)data.data,
- &totalUncompressed,
- (const Bytef*)bytes,
- uLong(size));
-
- if(errCode == Z_MEM_ERROR)
- {
- UERROR("Z_MEM_ERROR : Insufficient memory.");
- }
- else if(errCode == Z_BUF_ERROR)
- {
- UERROR("Z_BUF_ERROR : The buffer dest was not large enough to hold the uncompressed data.");
- }
- else if(errCode == Z_DATA_ERROR)
- {
- UERROR("Z_DATA_ERROR : The compressed data (referenced by source) was corrupted.");
- }
- }
- return data;
-}
-} /* namespace find_object */
diff --git a/find-object/src/Compression.h b/find-object/src/Compression.h
deleted file mode 100644
index 1676c8ea..00000000
--- a/find-object/src/Compression.h
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Compression.h
- *
- * Created on: Sep 10, 2018
- * Author: labm2414
- */
-
-#ifndef SRC_COMPRESSION_H_
-#define SRC_COMPRESSION_H_
-
-#include
-
-namespace find_object {
-
-std::vector compressData(const cv::Mat & data);
-cv::Mat uncompressData(const unsigned char * bytes, unsigned long size);
-
-}
-
-#endif /* SRC_COMPRESSION_H_ */
diff --git a/find-object/src/FindObject.cpp b/find-object/src/FindObject.cpp
deleted file mode 100644
index 77701157..00000000
--- a/find-object/src/FindObject.cpp
+++ /dev/null
@@ -1,1829 +0,0 @@
-/*
-Copyright (c) 2011-2014, Mathieu Labbe - IntRoLab - Universite de Sherbrooke
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- * Neither the name of the Universite de Sherbrooke nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "find_object/FindObject.h"
-#include "find_object/Settings.h"
-#include "find_object/utilite/ULogger.h"
-#include "utilite/UConversion.h"
-
-#include "ObjSignature.h"
-#include "utilite/UDirectory.h"
-#include "Vocabulary.h"
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-#if CV_MAJOR_VERSION > 3
-#include
-#endif
-
-namespace find_object {
-
-FindObject::FindObject(bool keepImagesInRAM, QObject * parent) :
- QObject(parent),
- vocabulary_(new Vocabulary()),
- detector_(Settings::createKeypointDetector()),
- extractor_(Settings::createDescriptorExtractor()),
- sessionModified_(false),
- keepImagesInRAM_(keepImagesInRAM)
-{
- qRegisterMetaType("find_object::DetectionInfo");
- qRegisterMetaType("find_object::Header");
- UASSERT(detector_ != 0 && extractor_ != 0);
-
- if(Settings::getGeneral_debug())
- {
- ULogger::setPrintWhere(true);
- ULogger::setLevel(ULogger::kDebug);
- }
- else
- {
- ULogger::setPrintWhere(false);
- ULogger::setLevel(ULogger::kInfo);
- }
-}
-
-FindObject::~FindObject() {
- delete detector_;
- delete extractor_;
- delete vocabulary_;
- objectsDescriptors_.clear();
-}
-
-bool FindObject::loadSession(const QString & path, const ParametersMap & customParameters)
-{
- if(QFile::exists(path) && !path.isEmpty() && QFileInfo(path).suffix().compare("bin") == 0)
- {
- QFile file(path);
- file.open(QIODevice::ReadOnly);
- QDataStream in(&file);
-
- ParametersMap parameters;
-
- // load parameters
- in >> parameters;
- for(QMap::iterator iter=parameters.begin(); iter!=parameters.end(); ++iter)
- {
- QMap::const_iterator cter = customParameters.find(iter.key());
- if(cter != customParameters.constEnd())
- {
- Settings::setParameter(cter.key(), cter.value());
- }
- else
- {
- Settings::setParameter(iter.key(), iter.value());
- }
- }
-
- updateDetectorExtractor();
-
- // load vocabulary
- vocabulary_->load(in);
-
- // load objects
- while(!in.atEnd())
- {
- ObjSignature * obj = new ObjSignature();
- obj->load(in, !keepImagesInRAM_);
- if(obj->id() >= 0)
- {
- objects_.insert(obj->id(), obj);
- }
- else
- {
- UERROR("Failed to load and object!");
- delete obj;
- }
- }
- file.close();
-
- if(!Settings::getGeneral_invertedSearch())
- {
- // this will fill objectsDescriptors_ matrix
- updateVocabulary();
- }
- sessionModified_ = false;
- return true;
- }
- else
- {
- UERROR("Invalid session file (should be *.bin): \"%s\"", path.toStdString().c_str());
- }
- return false;
-}
-
-bool FindObject::saveSession(const QString & path)
-{
- if(!path.isEmpty() && QFileInfo(path).suffix().compare("bin") == 0)
- {
- QFile file(path);
- file.open(QIODevice::WriteOnly);
- QDataStream out(&file);
-
- // save parameters
- out << Settings::getParameters();
-
- // save vocabulary
- vocabulary_->save(out);
-
- // save objects
- for(QMultiMap