diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 8ad738c251..d458eed576 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -14,7 +14,7 @@ concurrency: cancel-in-progress: true jobs: - build: + build-coverage: runs-on: ubuntu-latest steps: diff --git a/.github/workflows/other-arch-isolated.yml b/.github/workflows/other-arch-isolated.yml index 4592dc6008..fae718834e 100644 --- a/.github/workflows/other-arch-isolated.yml +++ b/.github/workflows/other-arch-isolated.yml @@ -15,9 +15,9 @@ concurrency: cancel-in-progress: true jobs: - build-other-architectures: + build-other-architectures-isolated: # The host should always be linux - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest name: Build on ${{ matrix.distro }} ${{ matrix.arch }} ${{ matrix.endianness }} # Run steps on a matrix of different arch/distro combinations @@ -29,19 +29,22 @@ jobs: # distro: bullseye # target: ARMV6 - arch: armv7 - distro: ubuntu22.04 + distro: ubuntu_latest target: ARMV7 endianness: (Little Endian) - arch: aarch64 - distro: ubuntu22.04 #fedora_latest - target: ARMV8 + distro: ubuntu_latest + endianness: (Little Endian) + - arch: riscv64 + distro: ubuntu_latest + target: RISC-V endianness: (Little Endian) - arch: ppc64le - distro: ubuntu22.04 + distro: ubuntu_latest target: POWER8 endianness: (Little Endian) - arch: s390x - distro: ubuntu22.04 + distro: ubuntu_latest target: Z13 endianness: (Big Endian) @@ -50,7 +53,7 @@ jobs: uses: actions/checkout@v4 - name: Run on arch - uses: uraimo/run-on-arch-action@v2.2.1 + uses: uraimo/run-on-arch-action@v2.7.2 with: githubToken: ${{ github.token }} arch: ${{ matrix.arch }} diff --git a/.github/workflows/other-arch.yml b/.github/workflows/other-arch.yml index 3bb2f741bd..18ccb7c6a1 100644 --- a/.github/workflows/other-arch.yml +++ b/.github/workflows/other-arch.yml @@ -17,7 +17,7 @@ concurrency: jobs: build-other-architectures: # The host should always be linux - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest name: Build on ${{ matrix.distro }} ${{ matrix.arch }} ${{ matrix.endianness }} # Run steps on a matrix of 3 arch/distro combinations @@ -32,14 +32,14 @@ jobs: # distro: ubuntu20.04 # target: ARMV7 - arch: aarch64 - distro: ubuntu20.04 #fedora_latest + distro: ubuntu_latest target: ARMV8 endianness: (Little Endian) # - arch: ppc64le # distro: ubuntu20.04 # target: POWER8 - arch: s390x - distro: ubuntu20.04 + distro: ubuntu_latest target: Z13 endianness: (Big Endian) @@ -48,7 +48,7 @@ jobs: uses: actions/checkout@v4 - name: Run on arch - uses: uraimo/run-on-arch-action@v2.1.1 + uses: uraimo/run-on-arch-action@v2.7.2 with: githubToken: ${{ github.token }} arch: ${{ matrix.arch }} @@ -60,7 +60,7 @@ jobs: apt-get update && apt-get install -y lsb-release git build-essential cmake lsb_release -a - apt-get update && apt-get install -y libx11-dev libdc1394-22-dev libv4l-dev gfortran liblapack-dev libopenblas-dev libeigen3-dev libopencv-dev + apt-get update && apt-get install -y libx11-dev libdc1394-dev libv4l-dev gfortran liblapack-dev libopenblas-dev libeigen3-dev libopencv-dev apt-get update && apt-get install -y libssl-dev libusb-1.0-0-dev pkg-config libgtk-3-dev libglfw3-dev libgl1-mesa-dev libglu1-mesa-dev git clone --depth 1 https://github.com/lagadic/visp-images ${HOME}/visp-images diff --git a/.github/workflows/ubuntu-3rdparty.yml b/.github/workflows/ubuntu-3rdparty.yml index ce80687b78..4c98107f86 100644 --- a/.github/workflows/ubuntu-3rdparty.yml +++ b/.github/workflows/ubuntu-3rdparty.yml @@ -14,12 +14,12 @@ concurrency: cancel-in-progress: true jobs: - build-ubuntu-dep-apt: + build-ubuntu-dep-apt-3rdparty: runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - os: [ubuntu-20.04, ubuntu-22.04] + os: [ubuntu-20.04, ubuntu-latest] compiler: [ {CC: /usr/bin/gcc-10, CXX: /usr/bin/g++-10}, {CC: /usr/bin/clang, CXX: /usr/bin/clang++} ] steps: @@ -35,12 +35,12 @@ jobs: - name: Print compiler information run: dpkg --list | grep compiler - - name: Install dependencies for ubuntu 18.04 and 20.04 - if: matrix.os != 'ubuntu-22.04' + - name: Install dependencies for ubuntu 20.04 + if: matrix.os == 'ubuntu-20.04' run: sudo apt-get update && sudo apt-get install -y libx11-dev libdc1394-22-dev libv4l-dev liblapack-dev libopenblas-dev libeigen3-dev libopencv-dev nlohmann-json3-dev - - name: Install dependencies for ubuntu 22.04 - if: matrix.os == 'ubuntu-22.04' + - name: Install dependencies for ubuntu-latest + if: matrix.os == 'ubuntu-latest' run: sudo apt-get update && sudo apt-get install -y libx11-dev libdc1394-dev libv4l-dev liblapack-dev libopenblas-dev libeigen3-dev libopencv-dev nlohmann-json3-dev - name: Clone camera_localization diff --git a/.github/workflows/ubuntu-contrib.yml b/.github/workflows/ubuntu-contrib.yml index f949c14557..92156f3bf4 100644 --- a/.github/workflows/ubuntu-contrib.yml +++ b/.github/workflows/ubuntu-contrib.yml @@ -14,12 +14,12 @@ concurrency: cancel-in-progress: true jobs: - build-ubuntu-dep-apt: + build-ubuntu-dep-apt-contrib: runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - os: [ubuntu-20.04, ubuntu-22.04] + os: [ubuntu-20.04, ubuntu-latest] compiler: [ {CC: /usr/bin/gcc-10, CXX: /usr/bin/g++-10}, {CC: /usr/bin/clang, CXX: /usr/bin/clang++} ] steps: @@ -36,11 +36,11 @@ jobs: run: dpkg --list | grep compiler - name: Install dependencies for ubuntu 20.04 - if: matrix.os != 'ubuntu-22.04' + if: matrix.os == 'ubuntu-20.04' run: sudo apt-get update && sudo apt-get install -y libx11-dev libdc1394-22-dev libv4l-dev liblapack-dev libopenblas-dev libeigen3-dev libopencv-dev nlohmann-json3-dev - - name: Install dependencies for ubuntu 22.04 - if: matrix.os == 'ubuntu-22.04' + - name: Install dependencies for ubuntu-latest + if: matrix.os == 'ubuntu-latest' run: sudo apt-get update && sudo apt-get install -y libx11-dev libdc1394-dev libv4l-dev liblapack-dev libopenblas-dev libeigen3-dev libopencv-dev nlohmann-json3-dev - name: Clone visp_contrib diff --git a/.github/workflows/ubuntu-dep-apt.yml b/.github/workflows/ubuntu-dep-apt.yml index a6d23f30dd..6595a5d656 100644 --- a/.github/workflows/ubuntu-dep-apt.yml +++ b/.github/workflows/ubuntu-dep-apt.yml @@ -19,7 +19,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-20.04, ubuntu-22.04] + os: [ubuntu-20.04, ubuntu-latest] compiler: [ {CC: /usr/bin/gcc-9, CXX: /usr/bin/g++-9}, {CC: /usr/bin/gcc-10, CXX: /usr/bin/g++-10}, {CC: /usr/bin/clang, CXX: /usr/bin/clang++} ] standard: [ 98, 11, 17 ] @@ -37,11 +37,11 @@ jobs: run: dpkg --list | grep compiler - name: Install dependencies for ubuntu 20.04 - if: matrix.os != 'ubuntu-22.04' + if: matrix.os == 'ubuntu-20.04' run: sudo apt-get update && sudo apt-get install -y libx11-dev libdc1394-22-dev libv4l-dev liblapack-dev libopenblas-dev libeigen3-dev libopencv-dev nlohmann-json3-dev - - name: Install dependencies for ubuntu 22.04 - if: matrix.os == 'ubuntu-22.04' + - name: Install dependencies for ubuntu-latest + if: matrix.os == 'ubuntu-latest' run: sudo apt-get update && sudo apt-get install -y libx11-dev libdc1394-dev libv4l-dev liblapack-dev libopenblas-dev libeigen3-dev libopencv-dev nlohmann-json3-dev - name: Clone visp-images diff --git a/.github/workflows/ubuntu-dep-src.yml b/.github/workflows/ubuntu-dep-src.yml index 8132a7216d..a4d184c424 100644 --- a/.github/workflows/ubuntu-dep-src.yml +++ b/.github/workflows/ubuntu-dep-src.yml @@ -23,7 +23,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-20.04, ubuntu-22.04] + os: [ubuntu-20.04, ubuntu-latest] steps: - name: Checkout repository @@ -36,15 +36,10 @@ jobs: run: lsb_release -a - name: Install dependencies for ubuntu 20.04 - if: matrix.os != 'ubuntu-22.04' + if: matrix.os == 'ubuntu-20.04' run: | sudo apt-get update && sudo apt-get install -y libdc1394-22-dev - - name: Install dependencies for ubuntu 22.04 - if: matrix.os == 'ubuntu-22.04' - run: | - sudo apt-get update && sudo apt-get install -y libdc1394-dev - - name: Install common dependencies for ubuntu run: | sudo apt-get update @@ -53,8 +48,8 @@ jobs: sudo apt-get install -y mesa-common-dev mesa-utils freeglut3-dev libflann-dev libboost-all-dev sudo apt-get install -y nlohmann-json3-dev - - name: Install dependencies for ubuntu 22.04 - if: matrix.os == 'ubuntu-22.04' + - name: Install dependencies for ubuntu-latest + if: matrix.os == 'ubuntu-latest' run: | sudo apt-get update && sudo apt-get install -y libx11-dev libdc1394-dev libv4l-dev gfortran liblapack-dev libeigen3-dev sudo apt-get update && sudo apt-get install -y libssl-dev libusb-1.0-0-dev pkg-config libgtk-3-dev libglfw3-dev libgl1-mesa-dev libglu1-mesa-dev diff --git a/.github/workflows/ubuntu-isolated.yml b/.github/workflows/ubuntu-isolated.yml index deb166eadc..82e11feb0c 100644 --- a/.github/workflows/ubuntu-isolated.yml +++ b/.github/workflows/ubuntu-isolated.yml @@ -15,7 +15,7 @@ concurrency: cancel-in-progress: true jobs: - build-ubuntu-dep-apt: + build-ubuntu-dep-apt-isolated: runs-on: ${{ matrix.os }} strategy: fail-fast: false diff --git a/.github/workflows/ubuntu-ustk.yml b/.github/workflows/ubuntu-ustk.yml index 2a5a539db6..3e0904ec57 100644 --- a/.github/workflows/ubuntu-ustk.yml +++ b/.github/workflows/ubuntu-ustk.yml @@ -14,12 +14,12 @@ concurrency: cancel-in-progress: true jobs: - build-ubuntu-dep-apt: + build-ubuntu-dep-apt-ustk: runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - os: [ubuntu-20.04, ubuntu-22.04] + os: [ubuntu-20.04, ubuntu-latest] steps: - name: Checkout repository @@ -35,11 +35,11 @@ jobs: run: dpkg --list | grep compiler - name: Install dependencies for ubuntu 20.04 - if: matrix.os != 'ubuntu-22.04' + if: matrix.os == 'ubuntu-20.04' run: sudo apt-get update && sudo apt-get install -y libx11-dev libdc1394-22-dev libv4l-dev liblapack-dev libopenblas-dev libeigen3-dev libopencv-dev nlohmann-json3-dev - - name: Install dependencies for ubuntu 22.04 - if: matrix.os == 'ubuntu-22.04' + - name: Install dependencies for ubuntu-latest + if: matrix.os == 'ubuntu-latest' run: sudo apt-get update && sudo apt-get install -y libx11-dev libdc1394-dev libv4l-dev liblapack-dev libopenblas-dev libeigen3-dev libopencv-dev nlohmann-json3-dev - name: Clone visp-images diff --git a/.github/workflows/ubuntu-venv.yml b/.github/workflows/ubuntu-venv.yml index e738293c4d..e7f99da60a 100644 --- a/.github/workflows/ubuntu-venv.yml +++ b/.github/workflows/ubuntu-venv.yml @@ -14,7 +14,7 @@ concurrency: cancel-in-progress: true jobs: - build-ubuntu-dep-apt: + build-ubuntu-dep-apt-venv: runs-on: ubuntu-latest steps: diff --git a/.github/workflows/windows-clang.yaml b/.github/workflows/windows-clang.yaml index c80a82dee4..89a455fefb 100644 --- a/.github/workflows/windows-clang.yaml +++ b/.github/workflows/windows-clang.yaml @@ -10,7 +10,7 @@ concurrency: cancel-in-progress: true jobs: - build: + build-windows-clang: runs-on: ${{ matrix.os }} defaults: run: diff --git a/.github/workflows/windows-conda.yml b/.github/workflows/windows-conda.yml index 9f44db81e1..419239bb1b 100644 --- a/.github/workflows/windows-conda.yml +++ b/.github/workflows/windows-conda.yml @@ -8,7 +8,7 @@ concurrency: cancel-in-progress: true jobs: - visp-conda: + build-windows-conda: name: ${{ matrix.os }} ${{ matrix.compiler }} - Python ${{ matrix.python-version }} ${{ matrix.build_type }} ${{ matrix.cxx_options }} runs-on: ${{ matrix.os }} @@ -85,7 +85,7 @@ jobs: name: check-windows-conda needs: - - visp-conda + - build-windows-conda runs-on: Ubuntu-latest diff --git a/.github/workflows/windows-msvc.yaml b/.github/workflows/windows-msvc.yaml index f9f70abf51..787902b96b 100644 --- a/.github/workflows/windows-msvc.yaml +++ b/.github/workflows/windows-msvc.yaml @@ -10,7 +10,7 @@ concurrency: cancel-in-progress: true jobs: - build: + build-windows-msvc: runs-on: ${{ matrix.os }} defaults: run: diff --git a/3rdparty/clapack/CMakeLists.txt b/3rdparty/clapack/CMakeLists.txt index 21e86557a7..3fe5ac29b8 100644 --- a/3rdparty/clapack/CMakeLists.txt +++ b/3rdparty/clapack/CMakeLists.txt @@ -37,7 +37,7 @@ if(NOT BUILD_SHARED_LIBS) vp_install_target(${LAPACK_LIBRARY} EXPORT VISPModules ARCHIVE DESTINATION ${VISP_3P_LIB_INSTALL_PATH} COMPONENT dev) endif() -if(MSVC AND NOT ((CMAKE_CXX_COMPILER MATCHES "clang") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))) +if(MSVC AND NOT ((CMAKE_CXX_COMPILER_ID MATCHES "AppleClang") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))) # Disable Visual C++ warnings foreach(f ${lib_srcs}) vp_set_source_file_compile_flag(${f} /wd4244 /wd4267 /wd4273 /wd4554 /wd4723 /wd4996) diff --git a/3rdparty/simdlib/CMakeLists.txt b/3rdparty/simdlib/CMakeLists.txt index b0a605b8be..baade3ea2e 100644 --- a/3rdparty/simdlib/CMakeLists.txt +++ b/3rdparty/simdlib/CMakeLists.txt @@ -25,7 +25,7 @@ if(X86 OR X86_64) set(AVX_FLAG "") set(AVX2_FLAG "") - if(MSVC AND NOT ((CMAKE_CXX_COMPILER MATCHES "clang") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))) + if(MSVC AND NOT ((CMAKE_CXX_COMPILER_ID MATCHES "AppleClang") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))) if(NOT MSVC64) vp_check_compiler_flag(CXX "/arch:SSE2" HAVE_SSE2_FLAG "${VISP_SOURCE_DIR}/cmake/checks/cpu_sse2.cpp") endif() @@ -137,7 +137,7 @@ if(X86 OR X86_64) set(COMMON_CXX_FLAGS "${COMMON_CXX_FLAGS} -Wno-missing-field-initializers") endif() - if(MSVC AND ((CMAKE_CXX_COMPILER MATCHES "clang") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))) + if(MSVC AND ((CMAKE_CXX_COMPILER_ID MATCHES "AppleClang") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))) # Clang under windows needs AVX flags set(COMMON_CXX_FLAGS "${COMMON_CXX_FLAGS} ${AVX_FLAG} ${AVX2_FLAG}") endif() @@ -175,7 +175,7 @@ elseif(ARM OR AARCH64) vp_check_compiler_flag(CXX "-Wno-switch" HAVE_NO_SWITCH_FLAG "${VISP_SOURCE_DIR}/cmake/checks/cpu_warning.cpp") if(CMAKE_SYSTEM_PROCESSOR MATCHES "arm") - if( NOT ((CMAKE_CXX_COMPILER_ID STREQUAL "Clang") OR (CMAKE_CXX_COMPILER MATCHES "clang"))) + if( NOT ((CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") OR (CMAKE_CXX_COMPILER_ID STREQUAL "Clang"))) set(CXX_NEON_FLAG "-mfpu=neon -mfpu=neon-fp16") endif() if(CMAKE_CXX_COMPILER_ID MATCHES "GNU") @@ -195,7 +195,7 @@ elseif(ARM OR AARCH64) set(COMMON_CXX_FLAGS "${COMMON_CXX_FLAGS} -Wno-unused-command-line-argument") endif() - if((CMAKE_CXX_COMPILER_ID STREQUAL "Clang") OR (CMAKE_CXX_COMPILER MATCHES "clang")) + if((CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") OR (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")) add_definitions(-DSIMD_NEON_FP16_DISABLE) endif() diff --git a/cmake/AddExtraCompilationFlags.cmake b/cmake/AddExtraCompilationFlags.cmake index 7adb63f986..fb17311bd6 100644 --- a/cmake/AddExtraCompilationFlags.cmake +++ b/cmake/AddExtraCompilationFlags.cmake @@ -137,9 +137,7 @@ if(BUILD_COVERAGE) endif() if(CMAKE_COMPILER_IS_GNUCXX) - #if(NOT (WIN32 AND ((CMAKE_CXX_COMPILER MATCHES "clang") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang")))) - add_extra_compiler_option(-fvisibility=hidden) - #endif() + add_extra_compiler_option(-fvisibility=hidden) if(ENABLE_AVX AND X86_64) add_extra_compiler_option(-mavx) @@ -191,59 +189,6 @@ if(MSVC) # Avoid build error C1128 list(APPEND VISP_EXTRA_CXX_FLAGS "/bigobj") endif() - #if((CMAKE_CXX_COMPILER MATCHES "clang") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang")) - # add_extra_compiler_option("-Wno-c++98-compat") # turn off warning due to json - # add_extra_compiler_option("-Wno-c++98-compat-pedantic") - # add_extra_compiler_option("-Wno-c11-extensions") - # add_extra_compiler_option("-Wno-covered-switch-default") - # add_extra_compiler_option("-Wno-unused-template") # turn off warning due to eigen - # add_extra_compiler_option("-Wno-deprecated-copy-with-dtor") - # add_extra_compiler_option("-Wno-anon-enum-enum-conversion") # turn off warning due to opencv - # add_extra_compiler_option("-Wno-cast-align") - # add_extra_compiler_option("-Wno-cast-qual") - # add_extra_compiler_option("-Wno-covered-switch-default") - # add_extra_compiler_option("-Wno-deprecated-copy-with-user-provided-dtor") - # add_extra_compiler_option("-Wno-documentation") - # add_extra_compiler_option("-Wno-documentation-deprecated-sync") - # add_extra_compiler_option("-Wno-documentation-unknown-command") - # add_extra_compiler_option("-Wno-double-promotion") - # add_extra_compiler_option("-Wno-enum-enum-conversion") - # add_extra_compiler_option("-Wno-exit-time-destructors") - # add_extra_compiler_option("-Wno-extra-semi") - # add_extra_compiler_option("-Wno-extra-semi-stmt") - # add_extra_compiler_option("-Wno-float-equal") - # add_extra_compiler_option("-Wno-implicit-int-float-conversion") - # add_extra_compiler_option("-Wno-implicit-float-conversion") - # add_extra_compiler_option("-Wno-inconsistent-missing-destructor-override") - # add_extra_compiler_option("-Wno-language-extension-token") - # add_extra_compiler_option("-Wno-microsoft-enum-value") - # add_extra_compiler_option("-Wno-newline-eof") - # add_extra_compiler_option("-Wno-old-style-cast") - # add_extra_compiler_option("-Wno-reserved-identifier") - # add_extra_compiler_option("-Wno-shift-sign-overflow") - # add_extra_compiler_option("-Wno-sign-conversion") - # add_extra_compiler_option("-Wno-undefined-reinterpret-cast") - # add_extra_compiler_option("-Wno-zero-as-null-pointer-constant") - # add_extra_compiler_option("-Wno-cast-function-type") # ViSP - # add_extra_compiler_option("-Wno-comma") - # add_extra_compiler_option("-Wno-deprecated-copy-dtor") - # add_extra_compiler_option("-Wno-deprecated-dynamic-exception-spec") - # add_extra_compiler_option("-Wno-format-nonliteral") - # add_extra_compiler_option("-Wno-global-constructors") - # add_extra_compiler_option("-Wno-implicit-int-conversion") - # add_extra_compiler_option("-Wno-implicit-fallthrough") - # add_extra_compiler_option("-Wno-missing-noreturn") - # add_extra_compiler_option("-Wno-missing-variable-declarations") - # add_extra_compiler_option("-Wno-missing-prototypes") - # add_extra_compiler_option("-Wno-nonportable-system-include-path") - # add_extra_compiler_option("-Wno-shadow") - # add_extra_compiler_option("-Wno-suggest-destructor-override") - # add_extra_compiler_option("-Wno-suggest-override") - # add_extra_compiler_option("-Wno-switch-enum") - # add_extra_compiler_option("-Wno-unreachable-code") - # add_extra_compiler_option("-Wno-unused-macros") - # add_extra_compiler_option("-Wno-unused-member-function") - #endif() endif() # adjust -Wl,-rpath-link diff --git a/cmake/FindMyPanda3D.cmake b/cmake/FindMyPanda3D.cmake index 22bbde66c8..fff1399d55 100644 --- a/cmake/FindMyPanda3D.cmake +++ b/cmake/FindMyPanda3D.cmake @@ -83,7 +83,7 @@ foreach(lib_name ${PANDA3D_LIBS}) endforeach() find_path(Panda3D_INCLUDE_DIRS panda.h PATHS ${PANDA3D_INCLUDE_SEARCH_PATHS}) -message(${Panda3D_INCLUDE_DIRS}) + include(FindPackageHandleStandardArgs) # Handle the QUIETLY and REQUIRED arguments and set the Panda3D_FOUND to TRUE # if all listed variables are TRUE diff --git a/cmake/VISPGenerateConfig.cmake b/cmake/VISPGenerateConfig.cmake index 340cff6308..589dad8dc5 100644 --- a/cmake/VISPGenerateConfig.cmake +++ b/cmake/VISPGenerateConfig.cmake @@ -113,6 +113,8 @@ foreach(m ${VISP_MODULES_BUILD}) list(APPEND VISP_INCLUDE_DIRS_CONFIGCMAKE "${VISP_MODULE_${m}_LOCATION}/include") endif() list(APPEND VISP_INCLUDE_DIRS_CONFIGCMAKE ${VISP_MODULE_${m}_INC_DEPS}) + list(APPEND VISP_INCLUDE_DIRS_CONFIGCMAKE ${VISP_MODULE_${m}_SYSTEM_INC_DEPS}) + endforeach() vp_list_unique(VISP_INCLUDE_DIRS_CONFIGCMAKE) @@ -142,6 +144,7 @@ if(UNIX) set(VISP_INCLUDE_DIRS_CONFIGCMAKE "\${VISP_INSTALL_PATH}/${VISP_INC_INSTALL_PATH}") foreach(m ${VISP_MODULES_BUILD}) list(APPEND VISP_INCLUDE_DIRS_CONFIGCMAKE ${VISP_MODULE_${m}_INC_DEPS}) + list(APPEND VISP_INCLUDE_DIRS_CONFIGCMAKE ${VISP_MODULE_${m}_SYSTEM_INC_DEPS}) endforeach() vp_list_unique(VISP_INCLUDE_DIRS_CONFIGCMAKE) endif() @@ -162,6 +165,7 @@ if(WIN32) set(VISP_INCLUDE_DIRS_CONFIGCMAKE "\${VISP_CONFIG_PATH}/${VISP_INC_INSTALL_PATH}") foreach(m ${VISP_MODULES_BUILD}) list(APPEND VISP_INCLUDE_DIRS_CONFIGCMAKE ${VISP_MODULE_${m}_INC_DEPS}) + list(APPEND VISP_INCLUDE_DIRS_CONFIGCMAKE ${VISP_MODULE_${m}_SYSTEM_INC_DEPS}) endforeach() vp_list_unique(VISP_INCLUDE_DIRS_CONFIGCMAKE) diff --git a/cmake/VISPModule.cmake b/cmake/VISPModule.cmake index 0089104ad9..c4fc939f4e 100644 --- a/cmake/VISPModule.cmake +++ b/cmake/VISPModule.cmake @@ -86,6 +86,7 @@ foreach(mod ${VISP_MODULES_BUILD} ${VISP_MODULES_DISABLED_USER} ${VISP_MODULES_D unset(VISP_MODULE_${mod}_PRIVATE_OPT_DEPS CACHE) unset(VISP_MODULE_${mod}_LINK_DEPS CACHE) unset(VISP_MODULE_${mod}_INC_DEPS CACHE) + unset(VISP_MODULE_${mod}_SYSTEM_INC_DEPS CACHE) unset(VISP_MODULE_${mod}_WRAPPERS CACHE) endforeach() @@ -179,6 +180,7 @@ macro(vp_add_module _name) set(VISP_MODULE_${the_module}_LINK_DEPS "" CACHE INTERNAL "") set(VISP_MODULE_${the_module}_INC_DEPS "" CACHE INTERNAL "") + set(VISP_MODULE_${the_module}_SYSTEM_INC_DEPS "" CACHE INTERNAL "") # parse list of dependencies if("${ARGV1}" STREQUAL "INTERNAL" OR "${ARGV1}" STREQUAL "BINDINGS") @@ -586,18 +588,26 @@ endfunction() # setup include paths for the list of passed modules macro(vp_target_include_modules target) + set(is_system "") foreach(d ${ARGN}) - if(d MATCHES "^visp_" AND HAVE_${d}) + if("${d}" STREQUAL "SYSTEM") + set(is_system "SYSTEM") + elseif(d MATCHES "^visp_" AND HAVE_${d}) if (EXISTS "${VISP_MODULE_${d}_LOCATION}/include") vp_target_include_directories(${target} "${VISP_MODULE_${d}_LOCATION}/include") endif() elseif(EXISTS "${d}") # FS keep external deps inc - set(VISP_MODULE_${the_module}_INC_DEPS "${VISP_MODULE_${the_module}_INC_DEPS};${d}" CACHE INTERNAL "") - vp_target_include_directories(${target} "${d}") + if(is_system) + set(VISP_MODULE_${the_module}_SYSTEM_INC_DEPS "${VISP_MODULE_${the_module}_SYSTEM_INC_DEPS};${d}" CACHE INTERNAL "") + else() + set(VISP_MODULE_${the_module}_INC_DEPS "${VISP_MODULE_${the_module}_INC_DEPS};${d}" CACHE INTERNAL "") + endif() + vp_target_include_directories(${target} "${is_system}" "${d}") endif() endforeach() vp_list_unique(VISP_MODULE_${the_module}_INC_DEPS) + vp_list_unique(VISP_MODULE_${the_module}_SYSTEM_INC_DEPS) endmacro() # setup include paths for the list of passed modules and recursively add dependent modules @@ -827,10 +837,22 @@ macro(_vp_create_module) target_compile_definitions(${the_module} PRIVATE visp_EXPORTS) endif() - - set_property(TARGET ${the_module} APPEND PROPERTY - INTERFACE_INCLUDE_DIRECTORIES ${VISP_MODULE_${the_module}_INC_DEPS} - ) + #set_property(TARGET ${the_module} APPEND PROPERTY + # # Here we need also to add system include dirs, otherwise they are missing + # INTERFACE_INCLUDE_DIRECTORIES ${VISP_MODULE_${the_module}_INC_DEPS} ${VISP_MODULE_${the_module}_SYSTEM_INC_DEPS} + #) + #set_property(TARGET ${the_module} APPEND PROPERTY + # INTERFACE_SYSTEM_INCLUDE_DIRECTORIES ${VISP_MODULE_${the_module}_SYSTEM_INC_DEPS} + #) + set(inc "${VISP_MODULE_${the_module}_INC_DEPS};${VISP_MODULE_${the_module}_SYSTEM_INC_DEPS}") + if(NOT (CMAKE_VERSION VERSION_LESS "3.11.0")) # https://gitlab.kitware.com/cmake/cmake/-/merge_requests/1264 : eliminates "Cannot specify compile definitions for imported target" error message + target_include_directories(${the_module} SYSTEM INTERFACE "$") + else() + set_target_properties(${the_module} PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "$" + INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "$" + ) + endif() # For dynamic link numbering convenions if(NOT ANDROID) diff --git a/cmake/VISPUtils.cmake b/cmake/VISPUtils.cmake index 6207c74f0f..e3094740e1 100644 --- a/cmake/VISPUtils.cmake +++ b/cmake/VISPUtils.cmake @@ -182,18 +182,26 @@ endfunction() # adds include directories in such way that directories from the ViSP source tree go first function(vp_target_include_directories target) set(__params "") + set(__system_params "") + set(__var_name __params) + foreach(dir ${ARGN}) - get_filename_component(__abs_dir "${dir}" ABSOLUTE) - string(REPLACE "+" "\\+" __VISP_BINARY_DIR_filtered ${VISP_BINARY_DIR}) -# if("${__abs_dir}" MATCHES "^${VISP_SOURCE_DIR}" OR "${__abs_dir}" MATCHES "^${__VISP_BINARY_DIR_filtered}") # not compatible with cmake 2.8.12.2 - if("${__abs_dir}" MATCHES "^${VISP_SOURCE_DIR}") - list(APPEND __params "${__abs_dir}") - elseif("${__abs_dir}" MATCHES "^${__VISP_BINARY_DIR_filtered}") - list(APPEND __params "${__abs_dir}") + if("${dir}" STREQUAL "SYSTEM") + set(__var_name __system_params) else() - list(APPEND __params "${dir}") + get_filename_component(__abs_dir "${dir}" ABSOLUTE) + string(REPLACE "+" "\\+" __VISP_BINARY_DIR_filtered ${VISP_BINARY_DIR}) + # if("${__abs_dir}" MATCHES "^${VISP_SOURCE_DIR}" OR "${__abs_dir}" MATCHES "^${__VISP_BINARY_DIR_filtered}") # not compatible with cmake 2.8.12.2 + if("${__abs_dir}" MATCHES "^${VISP_SOURCE_DIR}") + list(APPEND ${__var_name} "${__abs_dir}") + elseif("${__abs_dir}" MATCHES "^${__VISP_BINARY_DIR_filtered}") + list(APPEND ${__var_name} "${__abs_dir}") + else() + list(APPEND ${__var_name} "${dir}") + endif() endif() endforeach() + if(__params) if(TARGET ${target}) target_include_directories(${target} PRIVATE ${__params}) @@ -202,6 +210,14 @@ function(vp_target_include_directories target) set(VP_TARGET_INCLUDE_DIRS_${target} "${__new_inc}" CACHE INTERNAL "") endif() endif() + if(__system_params) + if(TARGET ${target}) + target_include_directories(${target} SYSTEM PRIVATE ${__system_params}) + else() + set(__new_inc "${VP_TARGET_INCLUDE_SYSTEM_DIRS_${target}};${__system_params}") + set(VP_TARGET_INCLUDE_SYSTEM_DIRS_${target} "${__new_inc}" CACHE INTERNAL "") + endif() + endif() endfunction() # clears all passed variables @@ -776,10 +792,16 @@ function(vp_target_link_libraries target) endfunction() function(_vp_append_target_includes target) + # Only defined for visp_ targets if(DEFINED VP_TARGET_INCLUDE_DIRS_${target}) target_include_directories(${target} PRIVATE ${VP_TARGET_INCLUDE_DIRS_${target}}) unset(VP_TARGET_INCLUDE_DIRS_${target} CACHE) endif() + # Only defined for visp_ targets + if(DEFINED VP_TARGET_INCLUDE_SYSTEM_DIRS_${target}) + target_include_directories(${target} SYSTEM PRIVATE ${VP_TARGET_INCLUDE_SYSTEM_DIRS_${target}}) + unset(VP_TARGET_INCLUDE_SYSTEM_DIRS_${target} CACHE) + endif() endfunction() function(vp_add_executable target) @@ -1621,6 +1643,8 @@ macro(vp_get_all_includes _includes_modules _includes_extra _system_include_dirs foreach(m ${VISP_MODULES_BUILD}) list(APPEND ${_includes_extra} ${VISP_MODULE_${m}_INC_DEPS}) + list(APPEND ${_includes_extra} ${VISP_MODULE_${m}_SYSTEM_INC_DEPS}) + if(EXISTS "${VISP_MODULE_${m}_LOCATION}/include") list(INSERT ${_includes_modules} 0 "${VISP_MODULE_${m}_LOCATION}/include") endif() diff --git a/modules/ar/CMakeLists.txt b/modules/ar/CMakeLists.txt index 4185627be7..15c70e9c76 100644 --- a/modules/ar/CMakeLists.txt +++ b/modules/ar/CMakeLists.txt @@ -35,6 +35,8 @@ # Add optional 3rd parties set(opt_incs "") +set(opt_system_incs "") + set(opt_libs "") if(USE_OGRE) @@ -45,14 +47,14 @@ if(USE_OGRE) mark_as_advanced(OGRE_SAMPLES_INCLUDEPATH) #message("OGRE_SAMPLES_INCLUDEPATH: ${OGRE_SAMPLES_INCLUDEPATH}") if(OGRE_SAMPLES_INCLUDEPATH) - list(APPEND opt_incs ${OGRE_SAMPLES_INCLUDEPATH}) + list(APPEND opt_system_incs ${OGRE_SAMPLES_INCLUDEPATH}) endif() # hack to fix possible presence of NOTFOUND in OGRE_INCLUDE_DIRS #message("OGRE_INCLUDE_DIRS: ${OGRE_INCLUDE_DIRS}") foreach(inc_ ${OGRE_INCLUDE_DIRS}) if(NOT ${inc_} MATCHES "NOTFOUND") - list(APPEND opt_incs ${inc_}) + list(APPEND opt_system_incs ${inc_}) endif() endforeach() if(WIN32) @@ -69,7 +71,7 @@ if(USE_OGRE) endif(USE_OGRE) if(USE_OIS AND USE_OGRE) - list(APPEND opt_incs ${OIS_INCLUDE_DIR}) + list(APPEND opt_system_incs ${OIS_INCLUDE_DIR}) list(APPEND opt_libs ${OIS_LIBRARIES}) if(APPLE) # With Ogre 1.7.4 and 1.8.1 to be able to link with libOIS.a, Cocoa framework is requested. @@ -175,7 +177,8 @@ endif() if(USE_PANDA3D) if(Panda3D_INCLUDE_DIRS) - list(APPEND opt_incs ${Panda3D_INCLUDE_DIRS}) + # Add Panda3D include dirs as system to avoid warnings due to Panda3D headers + list(APPEND opt_system_incs ${Panda3D_INCLUDE_DIRS}) endif() if(Panda3D_LIBRARIES) list(APPEND opt_libs ${Panda3D_LIBRARIES}) @@ -185,22 +188,6 @@ endif() vp_add_module(ar visp_core) vp_glob_module_sources() -if(USE_OGRE) - # Add specific build flag to turn off warnings coming from libogre and libois 3rd party - vp_set_source_file_compile_flag(src/ogre-simulator/vpAROgre.cpp -Wno-unused-parameter -Wno-unused-but-set-parameter -Wno-overloaded-virtual -Wno-float-equal -Wno-deprecated-copy -Wno-register) -endif() - -if(USE_PANDA3D) - set(PANDA3D_CXX_FLAGS -Wno-unused-parameter -Wno-unused-variable -Wno-extra -Wno-reorder-ctor) - set(PANDA3D_MODULE_SOURCES - vpPanda3DBaseRenderer.cpp vpPanda3DGeometryRenderer.cpp - vpPanda3DRGBRenderer.cpp vpPanda3DRenderParameters.cpp - vpPanda3DRendererSet.cpp vpPanda3DPostProcessFilter.cpp vpPanda3DCommonFilters.cpp - ) - foreach(panda_src_name ${PANDA3D_MODULE_SOURCES}) - vp_set_source_file_compile_flag(src/panda3d-simulator/${panda_src_name} ${PANDA3D_CXX_FLAGS}) - endforeach() -endif() -vp_module_include_directories(${opt_incs}) +vp_module_include_directories(${opt_incs} SYSTEM ${opt_system_incs}) vp_create_module(${opt_libs}) diff --git a/modules/ar/src/panda3d-simulator/vpPanda3DBaseRenderer.cpp b/modules/ar/src/panda3d-simulator/vpPanda3DBaseRenderer.cpp index 948d999f7a..734a00b6b9 100644 --- a/modules/ar/src/panda3d-simulator/vpPanda3DBaseRenderer.cpp +++ b/modules/ar/src/panda3d-simulator/vpPanda3DBaseRenderer.cpp @@ -199,7 +199,6 @@ void vpPanda3DBaseRenderer::computeNearAndFarPlanesFromNode(const std::string &n } if (!fast) { LPoint3 minP, maxP; - double t1 = vpTime::measureTimeMs(); object.calc_tight_bounds(minP, maxP); const BoundingBox box(minP, maxP); float minZ = std::numeric_limits::max(), maxZ = 0.f; diff --git a/modules/ar/src/panda3d-simulator/vpPanda3DGeometryRenderer.cpp b/modules/ar/src/panda3d-simulator/vpPanda3DGeometryRenderer.cpp index 41edf3e0f0..c1f98c116b 100644 --- a/modules/ar/src/panda3d-simulator/vpPanda3DGeometryRenderer.cpp +++ b/modules/ar/src/panda3d-simulator/vpPanda3DGeometryRenderer.cpp @@ -203,8 +203,6 @@ void vpPanda3DGeometryRenderer::getRender(vpImage &normals, vpImage(std::max(0.0, bb.getTop())); const unsigned left = static_cast(std::max(0.0, bb.getLeft())); - const unsigned bottom = static_cast(std::min(static_cast(h), bb.getBottom())); - const unsigned right = static_cast(std::min(static_cast(w), bb.getRight())); const unsigned numComponents = m_normalDepthTexture->get_num_components(); const unsigned rowIncrement = m_renderParameters.getImageWidth() * numComponents; // we ask for only 8 bits image, but we may get an rgb image const float *data = (float *)(&(m_normalDepthTexture->get_ram_image().front())); diff --git a/modules/ar/src/panda3d-simulator/vpPanda3DRGBRenderer.cpp b/modules/ar/src/panda3d-simulator/vpPanda3DRGBRenderer.cpp index cc429ab31d..93b441f14e 100644 --- a/modules/ar/src/panda3d-simulator/vpPanda3DRGBRenderer.cpp +++ b/modules/ar/src/panda3d-simulator/vpPanda3DRGBRenderer.cpp @@ -221,15 +221,15 @@ void vpPanda3DRGBRenderer::addNodeToScene(const NodePath &object) NodePath objectInScene = object.copy_to(m_renderRoot); objectInScene.set_name(object.get_name()); TextureCollection txs = objectInScene.find_all_textures(); - bool hasTexture = txs.size() > 0; + bool hasTexture = (static_cast(txs.size()) > 0); // gltf2bam and other tools may store some fallback textures. We shouldnt use them as they whiten the result if (hasTexture) { std::vector fallbackNames { "pbr-fallback", "normal-fallback", "emission-fallback" }; - unsigned numMatches = 0; + unsigned int numMatches = 0; for (const std::string &fallbackName: fallbackNames) { numMatches += static_cast(txs.find_texture(fallbackName) != nullptr); } - hasTexture = txs.size() > numMatches; // Some textures are not fallback textures + hasTexture = (static_cast(txs.size()) > numMatches); // Some textures are not fallback textures } PT(Shader) shader = Shader::make(Shader::ShaderLanguage::SL_GLSL, diff --git a/modules/ar/src/panda3d-simulator/vpPanda3DRendererSet.cpp b/modules/ar/src/panda3d-simulator/vpPanda3DRendererSet.cpp index 4cfa2c35f0..576c9bf5f3 100644 --- a/modules/ar/src/panda3d-simulator/vpPanda3DRendererSet.cpp +++ b/modules/ar/src/panda3d-simulator/vpPanda3DRendererSet.cpp @@ -114,7 +114,7 @@ void vpPanda3DRendererSet::setNodePose(const std::string &name, const vpHomogene } } -void vpPanda3DRendererSet::setNodePose(NodePath &object, const vpHomogeneousMatrix &wTo) +void vpPanda3DRendererSet::setNodePose(NodePath &, const vpHomogeneousMatrix &) { throw vpException(vpException::badValue, "NodePath setNodePose is not supported in renderer set, prefer the string version"); } @@ -130,7 +130,7 @@ vpHomogeneousMatrix vpPanda3DRendererSet::getNodePose(const std::string &name) return m_subRenderers[0]->getNodePose(name); } -vpHomogeneousMatrix vpPanda3DRendererSet::getNodePose(NodePath &object) +vpHomogeneousMatrix vpPanda3DRendererSet::getNodePose(NodePath &) { throw vpException(vpException::badValue, "NodePath getNodePose is not supported in renderer set, prefer the string version"); } diff --git a/modules/core/CMakeLists.txt b/modules/core/CMakeLists.txt index 69db0c63a3..77f4685a4e 100644 --- a/modules/core/CMakeLists.txt +++ b/modules/core/CMakeLists.txt @@ -37,6 +37,7 @@ # Add optional 3rd parties set(opt_incs "") +set(opt_system_incs "") set(opt_libs "") set(opt_libs_private "") @@ -156,6 +157,7 @@ if(USE_OPENCV) list(APPEND opt_libs ${OpenCV_LIBS}) endif() if(OpenCV_INCLUDE_DIRS) + # Append OpenCV include dirs as system to avoid warnings coming from OpenCV headers list(APPEND opt_incs ${OpenCV_INCLUDE_DIRS}) endif() endif(USE_OPENCV) @@ -206,9 +208,9 @@ endif(USE_YARP) # Math: eigen3, gsl, mkl, openblas, atlas, netlib, OpenCV if(USE_EIGEN3) if(EIGEN3_INCLUDE_DIRS) - list(APPEND opt_incs ${EIGEN3_INCLUDE_DIRS}) + list(APPEND opt_system_incs ${EIGEN3_INCLUDE_DIRS}) else() - list(APPEND opt_incs ${EIGEN3_INCLUDE_DIR}) + list(APPEND opt_system_incs ${EIGEN3_INCLUDE_DIR}) endif() endif() @@ -300,109 +302,6 @@ if(WITH_SIMDLIB) list(APPEND opt_libs_private ${SIMDLIB_LIBRARIES}) endif() -if(MSVC) - # Disable Visual C++ C4996 warning - # warning C4996: 'gethostbyname': Use getaddrinfo() or GetAddrInfoW() instead - # warning C4996: 'inet_ntoa': Use inet_ntop() or InetNtop() instead - # warning C4996: 'inet_addr': Use inet_pton() or InetPton() instead - if(BUILD_SHARED_LIBS) - vp_set_source_file_compile_flag(src/tools/network/vpClient.cpp /wd4996) - vp_set_source_file_compile_flag(src/tools/network/vpServer.cpp /wd4996) - vp_set_source_file_compile_flag(src/tools/network/vpNetwork.cpp /wd4996) - vp_set_source_file_compile_flag(src/math/random-generator/vpUniRand.cpp /wd4146) - if(BUILD_TESTS) - vp_set_source_file_compile_flag(test/network/testClient.cpp /wd4996) - vp_set_source_file_compile_flag(test/network/testServer.cpp /wd4996) - endif() - else() - vp_warnings_disable(CMAKE_CXX_FLAGS /wd4996) - endif() -endif() - -if(USE_EIGEN3) - vp_set_source_file_compile_flag(src/math/matrix/vpMatrix_svd.cpp -Wno-float-equal -Wno-strict-overflow -Wno-misleading-indentation -Wno-int-in-bool-context -Wno-deprecated-copy -Wno-shadow -Wno-maybe-uninitialized) - vp_set_source_file_compile_flag(src/math/matrix/vpMatrix_lu.cpp -Wno-float-equal -Wno-strict-overflow -Wno-misleading-indentation -Wno-int-in-bool-context -Wno-deprecated-copy -Wno-shadow) - vp_set_source_file_compile_flag(src/math/matrix/vpEigenConversion.cpp -Wno-float-equal -Wno-strict-overflow -Wno-misleading-indentation -Wno-int-in-bool-context -Wno-shadow) - vp_set_source_file_compile_flag(test/math/testEigenConversion.cpp -Wno-float-equal -Wno-strict-overflow -Wno-misleading-indentation -Wno-int-in-bool-context -Wno-shadow) - vp_set_source_file_compile_flag(test/math/perfMatrixMultiplication.cpp -Wno-strict-overflow -Wno-misleading-indentation -Wno-float-equal -Wno-deprecated-copy -Wno-int-in-bool-context -Wno-shadow) - vp_set_source_file_compile_flag(test/math/perfMatrixTranspose.cpp -Wno-misleading-indentation -Wno-float-equal -Wno-deprecated-copy -Wno-int-in-bool-context -Wno-shadow) -endif() - -vp_set_source_file_compile_flag(src/image/vpImageConvert.cpp -Wno-strict-overflow -Wno-sign-compare -Wno-float-equal) -vp_set_source_file_compile_flag(src/image/vpImageFilter.cpp -Wno-strict-overflow -Wno-float-equal) -vp_set_source_file_compile_flag(src/image/vpImageTools.cpp -Wno-strict-overflow -Wno-float-equal) -vp_set_source_file_compile_flag(src/tools/network/vpServer.cpp -Wno-strict-overflow) -vp_set_source_file_compile_flag(src/tools/optimization/vpQuadProg.cpp -Wno-strict-overflow) -vp_set_source_file_compile_flag(src/tools/optimization/vpLinProg.cpp -Wno-strict-overflow) -vp_set_source_file_compile_flag(src/tools/histogram/vpHistogram.cpp -Wno-strict-overflow) -vp_set_source_file_compile_flag(src/image/vpFont.cpp -Wno-float-equal -Wno-strict-overflow) -# To avoid warnings with basisu_miniz.h such as: -# basisu_miniz.h:1184:9: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] -vp_set_source_file_compile_flag(src/tools/file/vpIoTools.cpp -Wno-misleading-indentation -Wno-strict-aliasing -Wno-strict-overflow) -vp_set_source_file_compile_flag(src/munkres/vpMunkres.cpp /wd26812 /wd4244) -vp_set_source_file_compile_flag(test/image/testImageBinarise.cpp -Wno-strict-overflow) -vp_set_source_file_compile_flag(test/image/testImageOwnership.cpp -Wno-pessimizing-move) -vp_set_source_file_compile_flag(test/network/testClient.cpp -Wno-strict-overflow) -vp_set_source_file_compile_flag(test/network/testServer.cpp -Wno-strict-overflow) - -if(USE_OPENCV) - vp_set_source_file_compile_flag(src/camera/vpColorDepthConversion.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(src/camera/vpMeterPixelConversion.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(src/camera/vpPixelMeterConversion.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(src/display/vpDisplay.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(src/display/vpDisplay_rgba.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(src/display/vpDisplay_uchar.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(src/display/vpFeatureDisplay.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(src/image/vpGaussianFilter.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(src/image/vpImageDraw.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(src/math/matrix/vpMatrix_cholesky.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(src/tools/convert/vpConvert.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(src/tools/geometry/vpPolygon.cpp -Wno-float-equal -Wno-strict-overflow) - vp_set_source_file_compile_flag(src/tools/geometry/vpPolygon3D.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(src/tools/histogram/vpHistogram.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(src/tracking/moments/vpMomentObject.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(test/camera/testCameraParametersConversion.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(test/image/testImageResize.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(test/image/testImageMorphology.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(test/image-with-dataset/testColorConversion.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(test/image-with-dataset/testConversion.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(test/image-with-dataset/testCrop.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(test/image-with-dataset/testCropAdvanced.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(test/image-with-dataset/testGaussianFilter.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(test/image-with-dataset/testImageAddSub.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(test/image-with-dataset/testImageFilter.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(test/image-with-dataset/testImageComparison.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(test/image-with-dataset/testImageNormalizedCorrelation.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(test/image-with-dataset/testImageTemplateMatching.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(test/image-with-dataset/testImageWarp.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(test/image-with-dataset/testIoPGM.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(test/image-with-dataset/testIoPPM.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(test/image-with-dataset/testReadImage.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(test/image-with-dataset/testPerformanceLUT.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(test/image-with-dataset/testUndistortImage.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(test/image-with-dataset/perfImageAddSub.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(test/image-with-dataset/perfImageMorphology.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(test/image-with-dataset/perfImageResize.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(test/image-with-dataset/perfImageWarp.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(test/image-with-dataset/perfGaussianFilter.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(test/image-with-dataset/perfColorConversion.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(test/image/testImageDraw.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(test/image/testImageDifference.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(test/math/testMomentAlpha.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(test/tools/convert/testConvert.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(test/tools/histogram-with-dataset/testHistogram.cpp -Wno-float-equal) -endif() - -if(USE_XML2) - if(MSVC) - vp_set_source_file_compile_flag(src/tools/xml/vpXmlParser.cpp /wd4996) - vp_set_source_file_compile_flag(test/tools/xml/testXmlParser.cpp /wd4996) - else() - vp_set_source_file_compile_flag(src/tools/xml/vpXmlParser.cpp -Wno-deprecated-declarations) - vp_set_source_file_compile_flag(test/tools/xml/testXmlParser.cpp -Wno-deprecated-declarations) - endif() -endif() - vp_add_module(core PRIVATE_OPTIONAL ${opt_libs_private} WRAP java) #----------------------------------------------------------------------------- @@ -421,7 +320,7 @@ endif() vp_source_group("Src" FILES "${VISP_MODULE_visp_core_BINARY_DIR}/version_string.inc") vp_glob_module_sources(SOURCES "${VISP_MODULE_visp_core_BINARY_DIR}/version_string.inc") -vp_module_include_directories(${opt_incs}) +vp_module_include_directories(${opt_incs} SYSTEM ${opt_system_incs}) vp_create_module(${opt_libs}) vp_create_compat_headers("include/visp3/core/vpConfig.h") vp_add_tests(CTEST_EXCLUDE_PATH network DEPENDS_ON visp_io visp_gui) @@ -430,3 +329,5 @@ vp_add_tests(CTEST_EXCLUDE_PATH network DEPENDS_ON visp_io visp_gui) vp_glob_module_copy_data("test/math/data/*.pgm" "modules/core" NO_INSTALL) # copy font vp_glob_module_copy_data("src/image/private/Rubik-Regular.ttf" "data/font") + +vp_set_source_file_compile_flag(src/tools/file/vpIoTools_npy.cpp -Wno-misleading-indentation) diff --git a/modules/core/include/visp3/core/vpIoTools.h b/modules/core/include/visp3/core/vpIoTools.h index 246624d377..511b1333b5 100644 --- a/modules/core/include/visp3/core/vpIoTools.h +++ b/modules/core/include/visp3/core/vpIoTools.h @@ -316,7 +316,7 @@ template void npz_save(std::string zipname, std::string fname, const //write everything fwrite(&local_header[0], sizeof(char), local_header.size(), fp); fwrite(&npy_header[0], sizeof(char), npy_header.size(), fp); - fwrite(data, sizeof(T), nels, fp); + fwrite(&data[0], sizeof(T), nels, fp); fwrite(&global_header[0], sizeof(char), global_header.size(), fp); fwrite(&footer[0], sizeof(char), footer.size(), fp); fclose(fp); diff --git a/modules/core/include/visp3/core/vpPlane.h b/modules/core/include/visp3/core/vpPlane.h index d57f03039a..df0a8ab5cb 100644 --- a/modules/core/include/visp3/core/vpPlane.h +++ b/modules/core/include/visp3/core/vpPlane.h @@ -48,10 +48,9 @@ BEGIN_VISP_NAMESPACE \brief This class defines the container for a plane geometrical structure. - A plane is given by the equation \f$Ax + By + Cz + D = 0\f$ where - (x,y,z) are the coordinates of a point and where \f$[A,B,C]^T\f$ is a normal + A plane is given by the equation \f$A*X + B*Y + C*Z + D = 0\f$ where + (X,Y,Z) are the coordinates of a point and where \f$[A,B,C]^T\f$ is the normal vector of the plane. - */ class VISP_EXPORT vpPlane { @@ -66,14 +65,15 @@ class VISP_EXPORT vpPlane vpPlane(); vpPlane(const vpPlane &P); vpPlane(double A, double B, double C, double D); - vpPlane(const vpPoint &P, const vpColVector &n, vpPlaneFrame frame = camera_frame); + vpPlane(const vpPoint &P, const vpColVector &normal, vpPlaneFrame frame = camera_frame); vpPlane(const vpPoint &P, const vpPoint &Q, const vpPoint &R, vpPlaneFrame frame = camera_frame); double computeZ(double x, double y) const; - void init(const vpPoint &P, const vpPoint &Q, const vpPoint &R, vpPlaneFrame frame = camera_frame); - void init(const vpColVector &P, const vpColVector &n); - void init(const vpPlane &P); + vpPlane &init(const vpPoint &P, const vpColVector &normal, vpPlaneFrame frame = camera_frame); + vpPlane &init(const vpPoint &P, const vpPoint &Q, const vpPoint &R, vpPlaneFrame frame = camera_frame); + vpPlane &init(const vpColVector &P, const vpColVector &n); + vpPlane &init(const vpPlane &P); // SET the parameter /*! Set plane parameter A. */ @@ -157,7 +157,7 @@ class VISP_EXPORT vpPlane friend VISP_EXPORT std::ostream &operator<<(std::ostream &os, const vpPlane &p); // Operation with Plane - void projectionPointOnPlan(const vpPoint &P, vpPoint &Pproj) const; + void projectionPointOnPlan(const vpPoint &P, vpPoint &Pproj, vpPlaneFrame frame = camera_frame) const; double rayIntersection(const vpPoint &M0, const vpPoint &M1, vpColVector &H) const; diff --git a/modules/core/src/tools/geometry/vpPlane.cpp b/modules/core/src/tools/geometry/vpPlane.cpp index d2fdf7805e..9ed44bda0a 100644 --- a/modules/core/src/tools/geometry/vpPlane.cpp +++ b/modules/core/src/tools/geometry/vpPlane.cpp @@ -29,8 +29,7 @@ * * Description: * Plane geometrical structure. - * -*****************************************************************************/ + */ /*! \file vpPlane.cpp @@ -64,8 +63,8 @@ vpPlane::vpPlane() : A(0), B(0), C(0), D(0) { } /*! Plane constructor from A, B, C, D parameters. - A plane is given by the equation \f$Ax + By + Cz + D = 0\f$ where - (x,y,z) are the coordinates of a point and \f$[A,B,C]^T\f$ is the normal + A plane is given by the equation \f$A*X + B*Y + C*Z + D = 0\f$ where + (X,Y,Z) are the coordinates of a point and \f$[A,B,C]^T\f$ is the normal vector of the plane. \param a, b, c, d : Parameters of the plane. @@ -85,33 +84,34 @@ vpPlane::vpPlane(const vpPlane &P) : A(0), B(0), C(0), D(0) } /*! + Plane constructor from a point \e P on the plane and the \e normal to the plane. - Plane constructor from a point \e P on the plane and the normal - \e n to the plane. - - A plane is given by the equation \f$Ax + By + Cz + D = 0\f$ where - (x,y,z) are the coordinates of a point and \f$[A,B,C]^T\f$ is the normal + A plane is given by the equation \f$A*X + B*Y + C*Z + D = 0\f$ where + (X,Y,Z) are the coordinates of a point and \f$[A,B,C]^T\f$ is the normal vector of the plane. - \param P : A point with coordinates (x,y,z) on the plane. The \e frame - parameter indicates if the coordinates of this points that are used are - expressed in the camera of object frame. + \param P : A point with coordinates (X,Y,Z) on the plane. The \e frame + parameter indicates if the coordinates of this point are + expressed in the camera or object frame. - \param n : The normal to the plane. + \param normal : The normal to the plane. \param frame: Indicates if the plane should be initialized from the point P coordinates expressed in the camera or object frame. - + - When expressed in the camera frame we get the coordinates of the point using + (`P.get_X()`, `P.get_Y()`, `P.get_Z()`). + - When expressed in the object frame we get the coordinates of the point using + (`P.get_oX()`, `P.get_oY()`, `P.get_oZ()`). */ -vpPlane::vpPlane(const vpPoint &P, const vpColVector &n, vpPlaneFrame frame) : A(0), B(0), C(0), D(0) +vpPlane::vpPlane(const vpPoint &P, const vpColVector &normal, vpPlaneFrame frame) : A(0), B(0), C(0), D(0) { const unsigned int index_0 = 0; const unsigned int index_1 = 1; const unsigned int index_2 = 2; // Equation of the plane is given by: - A = n[index_0]; - B = n[index_1]; - C = n[index_2]; + A = normal[index_0]; + B = normal[index_1]; + C = normal[index_2]; if (frame == vpPlane::camera_frame) { D = -((A * P.get_X()) + (B * P.get_Y()) + (C * P.get_Z())); @@ -126,12 +126,52 @@ vpPlane::vpPlane(const vpPoint &P, const vpColVector &n, vpPlaneFrame frame) : A \param P : Plane used as initializer. */ -void vpPlane::init(const vpPlane &P) +vpPlane &vpPlane::init(const vpPlane &P) { setA(P.getA()); setB(P.getB()); setC(P.getC()); setD(P.getD()); + + return *this; +} + +/*! + Initialize the plane from a point \e P on the plane and the \e normal to the plane. + + \param P : A point with coordinates (X,Y,Z) on the plane. The \e frame + parameter indicates if the coordinates of this point are + expressed in the camera or object frame. + + \param normal : The normal to the plane. + + \param frame: Indicates if the plane should be initialized from the point P + coordinates expressed in the camera (X, Y, Z) or object frame (oX, oY, oZ). + - When expressed in the camera frame we get the coordinates of the point using + (`P.get_X()`, `P.get_Y()`, `P.get_Z()`). + - When expressed in the object frame we get the coordinates of the point using + (`P.get_oX()`, `P.get_oY()`, `P.get_oZ()`). + + \sa vpPlane(const vpPoint&, const vpColVector &) +*/ +vpPlane &vpPlane::init(const vpPoint &P, const vpColVector &normal, vpPlaneFrame frame) +{ + const unsigned int index_0 = 0; + const unsigned int index_1 = 1; + const unsigned int index_2 = 2; + // Equation of the plane is given by: + A = normal[index_0]; + B = normal[index_1]; + C = normal[index_2]; + + if (frame == vpPlane::camera_frame) { + D = -((A * P.get_X()) + (B * P.get_Y()) + (C * P.get_Z())); + } + else { + D = -((A * P.get_oX()) + (B * P.get_oY()) + (C * P.get_oZ())); + } + + return *this; } /*! @@ -141,21 +181,23 @@ void vpPlane::init(const vpPlane &P) \param P : A point with coordinates (x,y,z) on the plane. The size of the vector should be 3, with P[0]=x, with P[1]=y, with P[2]=z. - \param n : The normal to the plane. + \param normal : The normal to the plane. \sa vpPlane(const vpPoint&, const vpColVector &) */ -void vpPlane::init(const vpColVector &P, const vpColVector &n) +vpPlane &vpPlane::init(const vpColVector &P, const vpColVector &normal) { const unsigned int index_0 = 0; const unsigned int index_1 = 1; const unsigned int index_2 = 2; // Equation of the plane is given by: - A = n[index_0]; - B = n[index_1]; - C = n[index_2]; + A = normal[index_0]; + B = normal[index_1]; + C = normal[index_2]; D = -((A * P[0]) + (B * P[1]) + (C * P[index_2])); + + return *this; } /*! @@ -169,7 +211,7 @@ void vpPlane::init(const vpColVector &P, const vpColVector &n) coordinates expressed in the camera or object frame. */ -void vpPlane::init(const vpPoint &P, const vpPoint &Q, const vpPoint &R, vpPlaneFrame frame) +vpPlane &vpPlane::init(const vpPoint &P, const vpPoint &Q, const vpPoint &R, vpPlaneFrame frame) { vpColVector a(3); vpColVector b(3); @@ -218,6 +260,8 @@ void vpPlane::init(const vpPoint &P, const vpPoint &Q, const vpPoint &R, vpPlane B /= norm; C /= norm; D /= norm; + + return *this; } /*! @@ -250,7 +294,7 @@ double vpPlane::computeZ(double x, double y) const /*! Return the normal to the plane. - A plane is given by the equation \f$Ax + By + Cz + D = 0\f$ where + A plane is given by the equation \f$A*X + B*Y + C*Z + D = 0\f$ where (x,y,z) is a point of R^3 and (A,B,C) are the coordinates of the normal. \sa getNormal(vpColVector &n) @@ -271,8 +315,8 @@ vpColVector vpPlane::getNormal() const /*! Return the normal to the plane. - A plane is given by the equation \f$Ax + By + Cz + D = 0\f$ where - (x,y,z) are the coordinates of a point and \f$[A,B,C]^T\f$ is normal + A plane is given by the equation \f$A*X + B*Y + C*Z + D = 0\f$ where + (X,Y,Z) are the coordinates of a point and \f$[A,B,C]^T\f$ is the normal vector of the plane. \sa getNormal() @@ -292,24 +336,43 @@ void vpPlane::getNormal(vpColVector &n) const /*! Compute the coordinates of the projection of a point on the plane. - \param P : point to be projected on the plane - \param Pproj : result of the projection (pproj belongs to the plane) + \param[in] P : Point to be projected on the plane. + \param[out] Pproj : Projected point. + \param[in] frame : Indicates if the point P coordinates are expressed in the camera or object frame. + - When expressed in the camera frame we get the coordinates of the point using + (`P.get_X()`, `P.get_Y()`, `P.get_Z()`). + - When expressed in the object frame we get the coordinates of the point using + (`P.get_oX()`, `P.get_oY()`, `P.get_oZ()`). */ -void vpPlane::projectionPointOnPlan(const vpPoint &P, vpPoint &Pproj) const +void vpPlane::projectionPointOnPlan(const vpPoint &P, vpPoint &Pproj, vpPlaneFrame frame) const { double x0, y0, z0; double rho; - x0 = P.get_X() / P.get_W(); - y0 = P.get_Y() / P.get_W(); - z0 = P.get_Z() / P.get_W(); + if (frame == vpPlane::camera_frame) { + x0 = P.get_X() / P.get_W(); + y0 = P.get_Y() / P.get_W(); + z0 = P.get_Z() / P.get_W(); - rho = -((A * x0) + (B * y0) + (C * z0) + D) / ((A * A) + (B * B) + (C * C)); + rho = -((A * x0) + (B * y0) + (C * z0) + D) / ((A * A) + (B * B) + (C * C)); - Pproj.set_X(x0 + (A * rho)); - Pproj.set_Y(y0 + (B * rho)); - Pproj.set_Z(z0 + (C * rho)); - Pproj.set_W(1); + Pproj.set_X(x0 + (A * rho)); + Pproj.set_Y(y0 + (B * rho)); + Pproj.set_Z(z0 + (C * rho)); + Pproj.set_W(1); + } + else { + x0 = P.get_oX() / P.get_oW(); + y0 = P.get_oY() / P.get_oW(); + z0 = P.get_oZ() / P.get_oW(); + + rho = -((A * x0) + (B * y0) + (C * z0) + D) / ((A * A) + (B * B) + (C * C)); + + Pproj.set_oX(x0 + (A * rho)); + Pproj.set_oY(y0 + (B * rho)); + Pproj.set_oZ(z0 + (C * rho)); + Pproj.set_oW(1); + } } double vpPlane::rayIntersection(const vpPoint &M0, const vpPoint &M1, vpColVector &H) const diff --git a/modules/core/test/image/testImageOwnership.cpp b/modules/core/test/image/testImageOwnership.cpp index 516284ec92..90399154d9 100644 --- a/modules/core/test/image/testImageOwnership.cpp +++ b/modules/core/test/image/testImageOwnership.cpp @@ -143,7 +143,7 @@ int main(int /* argc */, const char ** /* argv */) #if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11) { unsigned char *bitmap = new unsigned char[12]; - vpImage I = std::move(vpImage(bitmap, 3, 4, false)); + vpImage I = vpImage(bitmap, 3, 4, false); if (bitmap != I.bitmap) { std::cout << "std::move(vpImage) failed" << std::endl; return EXIT_FAILURE; @@ -152,7 +152,7 @@ int main(int /* argc */, const char ** /* argv */) } { unsigned char *bitmap = new unsigned char[12]; - vpImage I(std::move(vpImage(bitmap, 3, 4, false))); + vpImage I(vpImage(bitmap, 3, 4, false)); if (bitmap != I.bitmap) { std::cout << "vpImage(td::move(vpImage)) failed" << std::endl; return EXIT_FAILURE; diff --git a/modules/detection/CMakeLists.txt b/modules/detection/CMakeLists.txt index 1d6faf556e..fc62ba2f44 100644 --- a/modules/detection/CMakeLists.txt +++ b/modules/detection/CMakeLists.txt @@ -35,10 +35,11 @@ # Add optional 3rd parties set(opt_incs "") +set(opt_system_incs "") set(opt_libs "") if(USE_ZBAR) - list(APPEND opt_incs ${ZBAR_INCLUDE_DIRS}) + list(APPEND opt_system_incs ${ZBAR_INCLUDE_DIRS}) list(APPEND opt_libs ${ZBAR_LIBRARIES}) endif() @@ -47,11 +48,6 @@ if(USE_DMTX) list(APPEND opt_libs ${DMTX_LIBRARIES}) endif() -if(USE_ZBAR) - # Add specific build flag to turn off warnings coming from zbar 3rd party - vp_set_source_file_compile_flag(src/barcode/vpDetectorQRCode.cpp -Wno-unused-parameter -Wno-deprecated-declarations) -endif() - if(WITH_APRILTAG) # April Tag is private include_directories(${APRILTAG_INCLUDE_DIRS}) @@ -195,6 +191,6 @@ endif(USE_OPENCV) vp_add_module(detection visp_core visp_vision PRIVATE_OPTIONAL ${APRILTAG_LIBRARIES} WRAP java) vp_glob_module_sources() -vp_module_include_directories(${opt_incs}) +vp_module_include_directories(${opt_incs} SYSTEM ${opt_system_incs}) vp_create_module(${opt_libs}) vp_add_tests(DEPENDS_ON visp_detection visp_gui visp_io) diff --git a/modules/gui/CMakeLists.txt b/modules/gui/CMakeLists.txt index 67d27e5ccf..d9cd8ac7b8 100644 --- a/modules/gui/CMakeLists.txt +++ b/modules/gui/CMakeLists.txt @@ -76,29 +76,3 @@ vp_glob_module_sources() vp_module_include_directories(${opt_incs}) vp_create_module(${opt_libs}) vp_add_tests(DEPENDS_ON visp_io) - -if(USE_X11) - vp_set_source_file_compile_flag(src/display/vpDisplayX.cpp -Wno-strict-overflow) -endif() -if(USE_OPENCV) - vp_set_source_file_compile_flag(src/display/vpDisplayOpenCV.cpp -Wno-strict-overflow -Wno-float-equal) - vp_set_source_file_compile_flag(src/forward-projection/vpProjectionDisplay.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(src/plot/vpPlot.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(src/plot/vpPlotCurve.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(src/plot/vpPlotGraph.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(test/display/testDisplayPolygonLines.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(test/display/testDisplayRoi.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(test/display/testDisplays.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(test/display/testVideoDevice.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(test/display/testVideoDeviceDual.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(test/display-with-dataset/testMouseEvent.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(test/display-with-dataset/testDisplayScaled.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(test/display-with-dataset/testClick.cpp -Wno-float-equal) -endif() -if(USE_GTK2) - vp_set_source_file_compile_flag(src/display/vpDisplayGTK.cpp -Wno-deprecated-declarations) -endif() -if(USE_PCL) - vp_set_source_file_compile_flag(src/pointcloud/vpDisplayPCL.cpp -Wno-unused-parameter) - vp_set_source_file_compile_flag(src/pointcloud/vpPclViewer.cpp -Wno-unused-parameter) -endif() diff --git a/modules/imgproc/CMakeLists.txt b/modules/imgproc/CMakeLists.txt index 5d281d34f4..114f9d2e5f 100644 --- a/modules/imgproc/CMakeLists.txt +++ b/modules/imgproc/CMakeLists.txt @@ -49,19 +49,3 @@ vp_module_include_directories() vp_create_module() vp_add_tests(DEPENDS_ON visp_imgproc visp_io) - -vp_set_source_file_compile_flag(src/vpCLAHE.cpp -Wno-strict-overflow) -vp_set_source_file_compile_flag(src/vpThreshold.cpp -Wno-strict-overflow) -vp_set_source_file_compile_flag(src/vpFloodFill.cpp -Wno-strict-overflow) -vp_set_source_file_compile_flag(test/testContours.cpp -Wno-strict-overflow) - -if(USE_OPENCV) - vp_set_source_file_compile_flag(src/vpCLAHE.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(src/vpImgproc.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(test/with-dataset/testAutoThreshold.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(test/with-dataset/testImgproc.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(test/with-dataset/testConnectedComponents.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(test/with-dataset/testFloodFill.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(test/with-dataset/testContours.cpp -Wno-float-equal) - vp_set_source_file_compile_flag( -Wno-float-equal) -endif() diff --git a/modules/io/CMakeLists.txt b/modules/io/CMakeLists.txt index f93ece86d2..fb65d48983 100644 --- a/modules/io/CMakeLists.txt +++ b/modules/io/CMakeLists.txt @@ -199,20 +199,5 @@ vp_module_include_directories(${opt_incs}) vp_create_module(${opt_libs}) vp_add_tests() -vp_set_source_file_compile_flag(src/tools/vpParseArgv.cpp -Wno-strict-overflow) -vp_set_source_file_compile_flag(src/image/vpImageIo.cpp -Wno-missing-field-initializers) # since stb_image_write.h update from v1.13 to v1.16 vp_set_source_file_compile_flag(src/image/private/vpImageIoStb.cpp -Wno-missing-field-initializers -Wno-strict-overflow) vp_set_source_file_compile_flag(src/image/private/vpImageIoTinyEXR.cpp -Wno-strict-overflow -Wno-sign-compare -Wno-type-limits -Wno-unused-but-set-variable) - -if(USE_OPENCV) - vp_set_source_file_compile_flag(src/image/private/vpImageIoLibjpeg.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(src/image/private/vpImageIoLibpng.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(src/image/private/vpImageIoOpenCV.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(src/image/private/vpImageIoPortable.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(src/image/vpImageIo.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(src/video/vpDiskGrabber.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(src/video/vpVideoReader.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(src/video/vpVideoWriter.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(test/video/testVideo.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(test/image-with-dataset/perfImageLoadSave.cpp -Wno-float-equal) -endif() diff --git a/modules/robot/CMakeLists.txt b/modules/robot/CMakeLists.txt index 0287a79924..1cc26584d3 100644 --- a/modules/robot/CMakeLists.txt +++ b/modules/robot/CMakeLists.txt @@ -35,6 +35,7 @@ # Add optional 3rd parties set(opt_incs "") +set(opt_system_incs "") set(opt_libs "") set(opt_libs_private "") @@ -47,7 +48,7 @@ set(opt_libs_private "") # Haption Virtuose SDK. # This 3rd party should be the first used by the module (see warning below) if(USE_VIRTUOSE) - list(APPEND opt_incs ${VIRTUOSE_INCLUDE_DIRS}) + list(APPEND opt_system_incs ${VIRTUOSE_INCLUDE_DIRS}) list(APPEND opt_libs ${VIRTUOSE_LIBRARIES}) if(USE_THREADS AND RT_FOUND AND DL_FOUND) @@ -61,21 +62,6 @@ if(USE_VIRTUOSE) if(MSVC) # Work around to remove warning LNK4099; PDB vc120.pdb not found with virtuoseDLL.lib set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /ignore:4099") - - # Disable Visual C++ C4312 warning occuring on 3rd party VirtuoseAPI.h file - # VirtuoseAPI.h(280): warning C4312: 'type cast': conversion from 'int' to 'char *' of greater size - # VirtuoseAPI.h(302): warning C4312: 'type cast': conversion from 'int' to 'VirtContext' of greater size - if(BUILD_SHARED_LIBS) - vp_set_source_file_compile_flag(src/haptic-device/virtuose/vpVirtuose.cpp /wd4312) - vp_set_source_file_compile_flag(test/virtuose/testVirtuose.cpp /wd4312) - vp_set_source_file_compile_flag(test/virtuose/testVirtuoseAfma6.cpp /wd4312) - vp_set_source_file_compile_flag(test/virtuose/testVirtuoseHapticBox.cpp /wd4312) - vp_set_source_file_compile_flag(test/virtuose/testVirtuoseJointLimits.cpp /wd4312) - vp_set_source_file_compile_flag(test/virtuose/testVirtuosePeriodicFunction.cpp /wd4312) - vp_set_source_file_compile_flag(test/virtuose/testVirtuoseWithGlove.cpp /wd4312) - else() - vp_warnings_disable(CMAKE_CXX_FLAGS /wd4312) - endif() endif() endif() @@ -124,7 +110,7 @@ endif() if(USE_ARIA AND UNIX AND USE_PTHREAD AND RT_FOUND AND DL_FOUND) # Under Unix we need Aria, pthread, dl and rt libraries - list(APPEND opt_incs ${ARIA_INCLUDE_DIRS}) + list(APPEND opt_system_incs ${ARIA_INCLUDE_DIRS}) list(APPEND opt_libs ${ARIA_LIBRARIES}) if(CMAKE_THREAD_LIBS_INIT) list(APPEND opt_libs "${CMAKE_THREAD_LIBS_INIT}") @@ -132,7 +118,7 @@ if(USE_ARIA AND UNIX AND USE_PTHREAD AND RT_FOUND AND DL_FOUND) list(APPEND opt_libs ${RT_LIBRARIES}) list(APPEND opt_libs ${DL_LIBRARIES}) elseif(USE_ARIA AND NOT UNIX) - list(APPEND opt_incs ${ARIA_INCLUDE_DIRS}) + list(APPEND opt_system_incs ${ARIA_INCLUDE_DIRS}) list(APPEND opt_libs ${ARIA_LIBRARIES}) endif() @@ -196,96 +182,17 @@ vp_glob_module_sources() vp_set_source_file_compile_flag(src/wireframe-simulator/vpKeyword.cpp -Wno-sign-conversion) -if(USE_VIRTUOSE) - # Add specific build flag to turn off warnings coming from VirtuoseAPI 3rd party - vp_set_source_file_compile_flag(src/haptic-device/virtuose/vpVirtuose.cpp -Wno-int-to-pointer-cast) -endif() - -if(USE_ARIA) - # Add specific build flag to turn off warnings coming from libaria 3rd party - vp_set_source_file_compile_flag(src/real-robot/pioneer/vpRobotPioneer.cpp -Wno-unused-parameter -Wno-type-limits) -endif() - -if(USE_COIN3D) - # Add specific build flag to turn off warnings coming from libcoin 3rd party - vp_set_source_file_compile_flag(src/wireframe-simulator/vpWireFrameSimulator.cpp -Wno-unused-parameter) - vp_set_source_file_compile_flag(src/wireframe-simulator/vpScene.cpp -Wno-unused-parameter -Wno-deprecated-copy) - vp_set_source_file_compile_flag(src/image-simulator/vpImageSimulator.cpp -Wno-unused-parameter) - vp_set_source_file_compile_flag(src/robot-simulator/vpRobotCamera.cpp -Wno-unused-parameter) - vp_set_source_file_compile_flag(src/robot-simulator/vpSimulatorCamera.cpp -Wno-unused-parameter) - vp_set_source_file_compile_flag(src/robot-simulator/vpSimulatorViper850.cpp -Wno-unused-parameter) - vp_set_source_file_compile_flag(src/robot-simulator/vpSimulatorAfma6.cpp -Wno-unused-parameter) - vp_set_source_file_compile_flag(src/robot-simulator/vpRobotWireFrameSimulator.cpp -Wno-unused-parameter) - - if(USE_VIPER850) - vp_set_source_file_compile_flag(src/real-robot/viper/vpRobotViper850.cpp -Wno-unused-parameter) - endif() -else() - vp_set_source_file_compile_flag(src/wireframe-simulator/vpWireFrameSimulator.cpp -Wno-strict-overflow) -endif() - -if(USE_UR_RTDE) - vp_set_source_file_compile_flag(src/real-robot/universal-robots/vpRobotUniversalRobots.cpp -Wno-unused-parameter) -endif() - -if(USE_MAVSDK) - vp_set_source_file_compile_flag(src/real-robot/mavsdk/vpRobotMavsdk.cp -Wno-unused-but-set-variable) -endif() - -if(USE_BICLOPS) - vp_set_source_file_compile_flag(src/real-robot/biclops/vpRobotBiclops.cpp -Wno-unused-parameter) - vp_set_source_file_compile_flag(src/real-robot/biclops/private/vpRobotBiclopsController_impl.cpp -Wno-unused-parameter) -endif() - -vp_set_source_file_compile_flag(src/light/vpRingLight.cpp -Wno-strict-overflow) -vp_set_source_file_compile_flag(src/wireframe-simulator/vpClipping.cpp -Wno-strict-overflow) -vp_set_source_file_compile_flag(src/wireframe-simulator/vpBoundio.cpp -Wno-strict-overflow) -vp_set_source_file_compile_flag(src/wireframe-simulator/vpCoreDisplay.cpp -Wno-strict-overflow) -vp_set_source_file_compile_flag(src/wireframe-simulator/vpLex.cpp -Wno-strict-overflow) -vp_set_source_file_compile_flag(src/wireframe-simulator/vpBound.cpp -Wno-strict-overflow) -vp_set_source_file_compile_flag(src/wireframe-simulator/vpArit.cpp -Wno-strict-overflow) - # copy robot and wireframe simulator data vp_glob_module_copy_data("src/robot-simulator/arms/*.bnd" data/robot-simulator) vp_glob_module_copy_data("src/wireframe-simulator/scene/*.bnd" data/wireframe-simulator) vp_glob_module_copy_data("src/wireframe-simulator/scene/*.sld" data/wireframe-simulator) -vp_module_include_directories(${opt_incs}) +vp_module_include_directories(${opt_incs} SYSTEM ${opt_system_incs}) vp_create_module(${opt_libs}) vp_add_tests( DEPENDS_ON visp_sensor visp_vision visp_blob visp_gui CTEST_EXCLUDE_PATH bebop2 qbdevice servo-afma4 servo-afma6 servo-franka servo-pixhawk servo-pololu servo-universal-robots - servo-viper virtuose) - -if(USE_VIRTUOSE) - # Add specific build flag to turn off warnings coming from VirtuoseAPI 3rd party - vp_set_source_file_compile_flag(test/virtuose/testVirtuose.cpp -Wno-int-to-pointer-cast) - vp_set_source_file_compile_flag(test/virtuose/testVirtuoseAfma6.cpp -Wno-int-to-pointer-cast) - vp_set_source_file_compile_flag(test/virtuose/testVirtuoseWithGlove.cpp -Wno-int-to-pointer-cast) - vp_set_source_file_compile_flag(test/virtuose/testVirtuose.cpp -Wno-int-to-pointer-cast) - vp_set_source_file_compile_flag(test/virtuose/testVirtuoseHapticBox.cpp -Wno-int-to-pointer-cast) - vp_set_source_file_compile_flag(test/virtuose/testVirtuoseJointLimits.cpp -Wno-int-to-pointer-cast) - vp_set_source_file_compile_flag(test/virtuose/testVirtuosePeriodicFunction.cpp -Wno-int-to-pointer-cast) -endif() - -if(USE_ARSDK) - vp_set_source_file_compile_flag(src/real-robot/bebop2/vpRobotBebop2.cpp -Wno-old-style-cast -Wno-implicit-fallthrough -Wno-cast-qual -Wno-deprecated-declarations) -endif() - -if(USE_FRANKA) - vp_set_source_file_compile_flag(src/real-robot/franka/vpForceTorqueGenerator_impl.cpp -Wno-shadow -Wno-deprecated-copy) -endif() - -if(USE_FLIRPTUSDK) - vp_set_source_file_compile_flag(test/servo-flir-ptu/testRobotFlirPtu.cpp -Wno-unused-result) -endif() - -if(USE_UR_RTDE) - vp_set_source_file_compile_flag(test/servo-universal-robots/testUniversalRobotsCartPosition.cpp -Wno-unused-parameter) - vp_set_source_file_compile_flag(test/servo-universal-robots/testUniversalRobotsCartVelocity.cpp -Wno-unused-parameter) - vp_set_source_file_compile_flag(test/servo-universal-robots/testUniversalRobotsGetData.cpp -Wno-unused-parameter) - vp_set_source_file_compile_flag(test/servo-universal-robots/testUniversalRobotsJointPosition.cpp -Wno-unused-parameter) - vp_set_source_file_compile_flag(test/servo-universal-robots/testUniversalRobotsJointVelocity.cpp -Wno-unused-parameter) -endif() + servo-viper virtuose +) diff --git a/modules/sensor/CMakeLists.txt b/modules/sensor/CMakeLists.txt index ccd858c29c..5f8596fac0 100644 --- a/modules/sensor/CMakeLists.txt +++ b/modules/sensor/CMakeLists.txt @@ -37,6 +37,7 @@ # Add optional 3rd parties set(opt_incs "") +set(opt_system_incs "") set(opt_libs "") # camera devices: v4l, dc1394, cmu1394, directshow ?, freenect, @@ -86,7 +87,7 @@ if(USE_REALSENSE) list(APPEND opt_libs ${REALSENSE_LIBRARIES}) endif() if(USE_REALSENSE2) - list(APPEND opt_incs ${REALSENSE2_INCLUDE_DIRS}) + list(APPEND opt_system_incs ${REALSENSE2_INCLUDE_DIRS}) list(APPEND opt_libs ${REALSENSE2_LIBRARIES}) endif() if(USE_OCCIPITAL_STRUCTURE) @@ -123,127 +124,9 @@ endif() vp_add_module(sensor visp_core PRIVATE_OPTIONAL ${ATIDAQ_LIBRARIES}) vp_glob_module_sources() -vp_module_include_directories(${opt_incs}) +vp_module_include_directories(${opt_incs} SYSTEM ${opt_system_incs}) vp_create_module(${opt_libs}) vp_add_tests(CTEST_EXCLUDE_PATH force-torque framegrabber mocap rgb-depth DEPENDS_ON visp_io visp_gui) # Add configuration file for IIT FT sensor besides testForceTorqueIitSensor.cpp binary configure_file(test/force-torque/configurationSettings.ini configurationSettings.ini COPYONLY) - -if(USE_FLYCAPTURE) - # Add specific build flag to turn off warnings coming from PointGrey flycapture 3rd party - list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-unknown-pragmas") - list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-ignored-qualifiers") -endif() - -if(USE_PYLON) - # Add specific build flag to turn off warnings coming from Basler - # pylon headers - if(MSVC) - list(APPEND CXX_FLAGS_MUTE_WARNINGS "/wd4244") - list(APPEND CXX_FLAGS_MUTE_WARNINGS "/wd4267") - else() - list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-unknown-pragmas") - list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-unused-parameter") - list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-overloaded-virtual") - list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-deprecated-copy") - list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-unused-variable") - endif() -endif() - -if(USE_REALSENSE) - # Add specific build flag to turn off warnings coming from RealSense 3rd party - list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-strict-aliasing") - list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-pessimizing-move") - list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-unused-parameter") -endif() - -if(USE_REALSENSE2) - if(UNIX) - # Add specific build flag to turn off warnings coming from PCL 3rd party - list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-reorder") - list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-unused-function") - list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-sign-compare") - list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-overloaded-virtual") - list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-deprecated-declarations") - list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-inconsistent-missing-override") - list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-sign-conversion") - list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-float-equal") - list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-pessimizing-move") - list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-unused-parameter") - list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-comment") - list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-ignored-qualifiers") - list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-deprecated-copy") - list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-unqualified-std-cast-call") - list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-missing-field-initializers") - else() - list(APPEND CXX_FLAGS_MUTE_WARNINGS "/wd4244") - list(APPEND CXX_FLAGS_MUTE_WARNINGS "/wd4267") - endif() -endif() - -if(USE_LIBFREENECT) - list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-unused-parameter") -endif() - -if(USE_UEYE) - if(UNIX) - list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-deprecated-declarations") - else() - list(APPEND CXX_FLAGS_MUTE_WARNINGS "/wd4996") - endif() -endif() - -if(USE_OPENCV) - list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-float-equal") -endif() - -if(USE_OCCIPITAL_STRUCTURE) - list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-reorder") - list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-unused-function") - list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-unused-parameter") - list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-sign-compare") - list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-overloaded-virtual") - list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-ignored-qualifiers") - list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-maybe-uninitialized") - list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-deprecated-declarations") - list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-inconsistent-missing-override") - list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-sign-conversion") - list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-float-equal") - list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-pessimizing-move") -endif() - -vp_set_source_file_compile_flag(src/force-torque/vpForceTorqueAtiNetFTSensor.cpp "-Wno-strict-aliasing") - -if(CXX_FLAGS_MUTE_WARNINGS) - # Add specific build flag to turn off warnings - vp_set_source_file_compile_flag(src/framegrabber/1394/vp1394TwoGrabber.cpp ${CXX_FLAGS_MUTE_WARNINGS}) - vp_set_source_file_compile_flag(src/framegrabber/directshow/vpDirectShowSampleGrabberI.cpp ${CXX_FLAGS_MUTE_WARNINGS}) - vp_set_source_file_compile_flag(src/framegrabber/flycapture/vpFlyCaptureGrabber.cpp ${CXX_FLAGS_MUTE_WARNINGS}) - vp_set_source_file_compile_flag(src/framegrabber/pylon/vpPylonFactory.cpp ${CXX_FLAGS_MUTE_WARNINGS}) - vp_set_source_file_compile_flag(src/framegrabber/pylon/vpPylonGrabberGigE.cpp ${CXX_FLAGS_MUTE_WARNINGS}) - vp_set_source_file_compile_flag(src/framegrabber/pylon/vpPylonGrabberUsb.cpp ${CXX_FLAGS_MUTE_WARNINGS}) - vp_set_source_file_compile_flag(src/framegrabber/ueye/vpUeyeGrabber.cpp ${CXX_FLAGS_MUTE_WARNINGS}) - vp_set_source_file_compile_flag(src/rgb-depth/kinect/vpKinect.cpp ${CXX_FLAGS_MUTE_WARNINGS}) - vp_set_source_file_compile_flag(src/rgb-depth/occipital_structure/vpOccipitalStructure.cpp ${CXX_FLAGS_MUTE_WARNINGS}) - vp_set_source_file_compile_flag(src/rgb-depth/realsense/vpRealSense.cpp ${CXX_FLAGS_MUTE_WARNINGS}) - vp_set_source_file_compile_flag(src/rgb-depth/realsense/vpRealSense2.cpp ${CXX_FLAGS_MUTE_WARNINGS}) - - vp_set_source_file_compile_flag(test/framegrabber/test1394TwoResetBus.cpp ${CXX_FLAGS_MUTE_WARNINGS}) - vp_set_source_file_compile_flag(test/framegrabber/test1394TwoGrabber.cpp ${CXX_FLAGS_MUTE_WARNINGS}) - vp_set_source_file_compile_flag(test/framegrabber/testPylonGrabber.cpp ${CXX_FLAGS_MUTE_WARNINGS}) - vp_set_source_file_compile_flag(test/rgb-depth/testOccipitalStructure_Core_images.cpp ${CXX_FLAGS_MUTE_WARNINGS}) - vp_set_source_file_compile_flag(test/rgb-depth/testOccipitalStructure_Core_imu.cpp ${CXX_FLAGS_MUTE_WARNINGS}) - vp_set_source_file_compile_flag(test/rgb-depth/testOccipitalStructure_Core_pcl.cpp ${CXX_FLAGS_MUTE_WARNINGS}) - vp_set_source_file_compile_flag(test/rgb-depth/testRealSense2_SR300.cpp ${CXX_FLAGS_MUTE_WARNINGS}) - vp_set_source_file_compile_flag(test/rgb-depth/testRealSense2_D435.cpp ${CXX_FLAGS_MUTE_WARNINGS}) - vp_set_source_file_compile_flag(test/rgb-depth/testRealSense2_D435_align.cpp ${CXX_FLAGS_MUTE_WARNINGS}) - vp_set_source_file_compile_flag(test/rgb-depth/testRealSense2_D435_opencv.cpp ${CXX_FLAGS_MUTE_WARNINGS}) - vp_set_source_file_compile_flag(test/rgb-depth/testRealSense2_D435_pcl.cpp ${CXX_FLAGS_MUTE_WARNINGS}) - vp_set_source_file_compile_flag(test/rgb-depth/testRealSense2_T265_images.cpp ${CXX_FLAGS_MUTE_WARNINGS}) - vp_set_source_file_compile_flag(test/rgb-depth/testRealSense2_T265_images_odometry.cpp ${CXX_FLAGS_MUTE_WARNINGS}) - vp_set_source_file_compile_flag(test/rgb-depth/testRealSense2_T265_images_odometry_async.cpp ${CXX_FLAGS_MUTE_WARNINGS}) - vp_set_source_file_compile_flag(test/rgb-depth/testRealSense2_T265_imu.cpp ${CXX_FLAGS_MUTE_WARNINGS}) - vp_set_source_file_compile_flag(test/rgb-depth/testRealSense2_T265_odometry.cpp ${CXX_FLAGS_MUTE_WARNINGS}) - vp_set_source_file_compile_flag(test/rgb-depth/testRealSense2_T265_undistort.cpp ${CXX_FLAGS_MUTE_WARNINGS}) -endif() diff --git a/modules/sensor/src/rgb-depth/realsense/vpRealSense2.cpp b/modules/sensor/src/rgb-depth/realsense/vpRealSense2.cpp index 3b51fe78f0..e63d1df584 100644 --- a/modules/sensor/src/rgb-depth/realsense/vpRealSense2.cpp +++ b/modules/sensor/src/rgb-depth/realsense/vpRealSense2.cpp @@ -45,6 +45,7 @@ #define MANUAL_POINTCLOUD 1 +#if defined(VISP_HAVE_PCL) && defined(VISP_HAVE_PCL_COMMON) namespace { bool operator==(const rs2_extrinsics &lhs, const rs2_extrinsics &rhs) @@ -64,6 +65,7 @@ bool operator==(const rs2_extrinsics &lhs, const rs2_extrinsics &rhs) return true; } } // namespace +#endif BEGIN_VISP_NAMESPACE /*! diff --git a/modules/sensor/test/rgb-depth/testRealSense2_D435_opencv.cpp b/modules/sensor/test/rgb-depth/testRealSense2_D435_opencv.cpp index b58015fe2d..06b4a146a3 100644 --- a/modules/sensor/test/rgb-depth/testRealSense2_D435_opencv.cpp +++ b/modules/sensor/test/rgb-depth/testRealSense2_D435_opencv.cpp @@ -101,36 +101,6 @@ unsigned char getDepthColor(const std::vector &histogram, float z, flo return static_cast(histogram[static_cast(z * depth_scale)] * 255 / histogram[0xFFFF]); } -void getNativeFrame(const rs2::frame &frame, unsigned char *const data) -{ - auto vf = frame.as(); - int size = vf.get_width() * vf.get_height(); - - switch (frame.get_profile().format()) { - case RS2_FORMAT_RGB8: - case RS2_FORMAT_BGR8: - memcpy(data, frame.get_data(), size * 3); - break; - - case RS2_FORMAT_RGBA8: - case RS2_FORMAT_BGRA8: - memcpy(data, frame.get_data(), size * 4); - break; - - case RS2_FORMAT_Y16: - case RS2_FORMAT_Z16: - memcpy(data, frame.get_data(), size * 2); - break; - - case RS2_FORMAT_Y8: - memcpy(data, frame.get_data(), size); - break; - - default: - break; - } -} - void frame_to_mat(const rs2::frame &f, cv::Mat &img) { auto vf = f.as(); diff --git a/modules/tracker/blob/CMakeLists.txt b/modules/tracker/blob/CMakeLists.txt index 59184123ef..2d1de0ee2a 100644 --- a/modules/tracker/blob/CMakeLists.txt +++ b/modules/tracker/blob/CMakeLists.txt @@ -38,5 +38,3 @@ vp_glob_module_sources() vp_module_include_directories() vp_create_module() vp_add_tests(DEPENDS_ON visp_visual_features visp_gui visp_io) - -vp_set_source_file_compile_flag(src/dots/vpDot2.cpp -Wno-strict-overflow) diff --git a/modules/tracker/klt/CMakeLists.txt b/modules/tracker/klt/CMakeLists.txt index b7893a5f3f..f001ed5962 100644 --- a/modules/tracker/klt/CMakeLists.txt +++ b/modules/tracker/klt/CMakeLists.txt @@ -149,9 +149,3 @@ vp_glob_module_sources() vp_module_include_directories(${opt_incs}) vp_create_module(${opt_libs}) vp_add_tests() - -vp_set_source_file_compile_flag(src/vpKltOpencv.cpp -Wno-strict-overflow) - -if(USE_OPENCV) - vp_set_source_file_compile_flag(src/vpKltOpencv.cpp -Wno-float-equal) -endif() diff --git a/modules/tracker/mbt/CMakeLists.txt b/modules/tracker/mbt/CMakeLists.txt index 9b87e7c378..55c643170f 100644 --- a/modules/tracker/mbt/CMakeLists.txt +++ b/modules/tracker/mbt/CMakeLists.txt @@ -35,6 +35,7 @@ # Add optional 3rd parties set(opt_incs "") +set(opt_system_incs "") set(opt_libs "") set(opt_libs_private "") @@ -145,29 +146,6 @@ endif() vp_add_module(mbt visp_vision visp_core visp_me visp_visual_features OPTIONAL visp_ar visp_klt visp_gui PRIVATE_OPTIONAL ${opt_libs_private} WRAP java) vp_glob_module_sources() -if(USE_OGRE) - # Add specific build flag to turn off warnings coming from libogre and libois 3rd party - vp_set_source_file_compile_flag(src/edge/vpMbEdgeTracker.cpp -Wno-unused-parameter -Wno-unused-but-set-parameter -Wno-overloaded-virtual -Wno-deprecated-declarations -Wno-float-equal -Wno-deprecated-copy -Wno-register) - vp_set_source_file_compile_flag(src/edge/vpMbtDistanceCircle.cpp -Wno-unused-parameter -Wno-unused-but-set-parameter -Wno-overloaded-virtual -Wno-float-equal -Wno-deprecated-copy -Wno-register) - vp_set_source_file_compile_flag(src/edge/vpMbtDistanceCylinder.cpp -Wno-unused-parameter -Wno-unused-but-set-parameter -Wno-overloaded-virtual -Wno-float-equal -Wno-deprecated-copy -Wno-register) - vp_set_source_file_compile_flag(src/edge/vpMbtDistanceLine.cpp -Wno-unused-parameter -Wno-unused-but-set-parameter -Wno-overloaded-virtual -Wno-float-equal -Wno-deprecated-copy -Wno-register) - vp_set_source_file_compile_flag(src/hybrid/vpMbEdgeKltTracker.cpp -Wno-unused-parameter -Wno-unused-but-set-parameter -Wno-overloaded-virtual -Wno-float-equal -Wno-deprecated-copy -Wno-register) - vp_set_source_file_compile_flag(src/klt/vpMbKltTracker.cpp -Wno-unused-parameter -Wno-unused-but-set-parameter -Wno-overloaded-virtual -Wno-strict-overflow -Wno-float-equal -Wno-deprecated-copy -Wno-register) - vp_set_source_file_compile_flag(src/klt/vpMbtDistanceKltCylinder.cpp -Wno-unused-parameter -Wno-unused-but-set-parameter -Wno-overloaded-virtual -Wno-float-equal -Wno-deprecated-copy -Wno-register) - vp_set_source_file_compile_flag(src/klt/vpMbtDistanceKltPoints.cpp -Wno-unused-parameter -Wno-unused-but-set-parameter -Wno-overloaded-virtual -Wno-float-equal -Wno-deprecated-copy -Wno-register) - vp_set_source_file_compile_flag(src/vpMbTracker.cpp -Wno-unused-parameter -Wno-unused-but-set-parameter -Wno-overloaded-virtual -Wno-strict-overflow -Wno-float-equal -Wno-deprecated-copy -Wno-register) - vp_set_source_file_compile_flag(src/depth/vpMbtFaceDepthDense.cpp -Wno-unused-parameter -Wno-unused-but-set-parameter -Wno-overloaded-virtual -Wno-float-equal -Wno-deprecated-copy -Wno-register) - vp_set_source_file_compile_flag(src/depth/vpMbtFaceDepthNormal.cpp -Wno-unused-parameter -Wno-unused-but-set-parameter -Wno-overloaded-virtual -Wno-deprecated-declarations -Wno-float-equal -Wno-deprecated-copy -Wno-shadow -Wno-register) - vp_set_source_file_compile_flag(src/depth/vpMbDepthDenseTracker.cpp -Wno-unused-parameter -Wno-unused-but-set-parameter -Wno-overloaded-virtual -Wno-float-equal -Wno-deprecated-copy -Wno-register) - vp_set_source_file_compile_flag(src/depth/vpMbDepthNormalTracker.cpp -Wno-unused-parameter -Wno-unused-but-set-parameter -Wno-overloaded-virtual -Wno-float-equal -Wno-deprecated-copy -Wno-register) - vp_set_source_file_compile_flag(src/vpMbtXmlGenericParser.cpp -Wno-unused-parameter -Wno-unused-but-set-parameter -Wno-overloaded-virtual -Wno-float-equal -Wno-deprecated-copy -Wno-register) - vp_set_source_file_compile_flag(src/vpMbGenericTracker.cpp -Wno-unused-parameter -Wno-unused-but-set-parameter -Wno-overloaded-virtual -Wno-float-equal -Wno-deprecated-copy -Wno-register) -else() - vp_set_source_file_compile_flag(src/vpMbTracker.cpp -Wno-strict-overflow) - vp_set_source_file_compile_flag(src/klt/vpMbKltTracker.cpp -Wno-strict-overflow) - vp_set_source_file_compile_flag(src/edge/vpMbEdgeTracker.cpp -Wno-deprecated-declarations) - vp_set_source_file_compile_flag(src/depth/vpMbtFaceDepthNormal.cpp -Wno-deprecated-declarations -Wno-shadow -Wno-deprecated-copy) -endif() if(MSVC) if(BUILD_SHARED_LIBS) vp_set_source_file_compile_flag(src/depth/vpMbtTukeyEstimator.cpp /wd4244) @@ -183,18 +161,6 @@ endif() vp_module_include_directories(${opt_incs}) vp_create_module(${opt_libs}) -if(BUILD_TESTS) - if(USE_OGRE) - vp_set_source_file_compile_flag(test/generic-with-dataset/perfGenericTracker.cpp -Wno-unused-parameter -Wno-unused-but-set-parameter -Wno-overloaded-virtual -Wno-float-equal -Wno-deprecated-copy -Wno-register) - vp_set_source_file_compile_flag(test/generic-with-dataset/testGenericTracker.cpp -Wno-unused-parameter -Wno-unused-but-set-parameter -Wno-overloaded-virtual -Wno-float-equal -Wno-deprecated-copy -Wno-register) - vp_set_source_file_compile_flag(test/generic-with-dataset/testGenericTrackerCAOParsing.cpp -Wno-unused-parameter -Wno-unused-but-set-parameter -Wno-overloaded-virtual -Wno-float-equal -Wno-deprecated-copy -Wno-register) - vp_set_source_file_compile_flag(test/generic-with-dataset/testGenericTrackerDepth.cpp -Wno-unused-parameter -Wno-unused-but-set-parameter -Wno-overloaded-virtual -Wno-float-equal -Wno-deprecated-copy -Wno-register) - vp_set_source_file_compile_flag(test/generic-with-dataset/testGenericTrackerDeterminist.cpp -Wno-unused-parameter -Wno-unused-but-set-parameter -Wno-overloaded-virtual -Wno-float-equal -Wno-deprecated-copy -Wno-register) - vp_set_source_file_compile_flag(test/generic-with-dataset/testMbtXmlGenericParser.cpp -Wno-unused-parameter -Wno-unused-but-set-parameter -Wno-overloaded-virtual -Wno-float-equal -Wno-deprecated-copy -Wno-register) - vp_set_source_file_compile_flag(test/generic-with-dataset/testMbtJsonSettings.cpp -Wno-unused-parameter -Wno-unused-but-set-parameter -Wno-overloaded-virtual -Wno-float-equal -Wno-deprecated-copy -Wno-register) - endif() -endif() - vp_add_tests(DEPENDS_ON visp_core visp_gui visp_io) if(VISP_DATASET_FOUND) diff --git a/modules/tracker/mbt/include/visp3/mbt/vpMbDepthNormalTracker.h b/modules/tracker/mbt/include/visp3/mbt/vpMbDepthNormalTracker.h index c3eb11ae3e..f66d0f7bf7 100644 --- a/modules/tracker/mbt/include/visp3/mbt/vpMbDepthNormalTracker.h +++ b/modules/tracker/mbt/include/visp3/mbt/vpMbDepthNormalTracker.h @@ -1,6 +1,6 @@ /* * ViSP, open source Visual Servoing Platform software. - * Copyright (C) 2005 - 2023 by Inria. All rights reserved. + * Copyright (C) 2005 - 2024 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -31,8 +31,8 @@ * Model-based tracker using depth normal features. */ -#ifndef _vpMbDepthNormalTracker_h_ -#define _vpMbDepthNormalTracker_h_ +#ifndef VP_MB_DEPTH_NORMAL_TRACKER_H +#define VP_MB_DEPTH_NORMAL_TRACKER_H #include #include diff --git a/modules/tracker/mbt/include/visp3/mbt/vpMbtFaceDepthNormal.h b/modules/tracker/mbt/include/visp3/mbt/vpMbtFaceDepthNormal.h index f641100151..dbe83e219b 100644 --- a/modules/tracker/mbt/include/visp3/mbt/vpMbtFaceDepthNormal.h +++ b/modules/tracker/mbt/include/visp3/mbt/vpMbtFaceDepthNormal.h @@ -133,6 +133,8 @@ class VISP_EXPORT vpMbtFaceDepthNormal void computeVisibility(); void computeVisibilityDisplay(); + bool planeIsInvalid(const vpHomogeneousMatrix &cMo, double maxAngle); + void computeNormalVisibility(double nx, double ny, double nz, const vpColVector ¢roid_point, vpColVector &face_normal); #if defined(VISP_HAVE_PCL) && defined(VISP_HAVE_PCL_COMMON) && defined(VISP_HAVE_PCL_SEGMENTATION) && defined(VISP_HAVE_PCL_FILTERS) diff --git a/modules/tracker/mbt/src/depth/vpMbDepthNormalTracker.cpp b/modules/tracker/mbt/src/depth/vpMbDepthNormalTracker.cpp index 9f6612e75b..0f50af016a 100644 --- a/modules/tracker/mbt/src/depth/vpMbDepthNormalTracker.cpp +++ b/modules/tracker/mbt/src/depth/vpMbDepthNormalTracker.cpp @@ -267,12 +267,21 @@ void vpMbDepthNormalTracker::computeVVSInteractionMatrixAndResidu() it != m_depthNormalListOfActiveFaces.end(); ++it) { vpMatrix L_face; vpColVector features_face; + (*it)->computeInteractionMatrix(m_cMo, L_face, features_face); vpColVector face_error = features_face - m_depthNormalListOfDesiredFeatures[(size_t)cpt]; - m_error_depthNormal.insert(cpt * 3, face_error); - m_L_depthNormal.insert(L_face, cpt * 3, 0); + if (!(*it)->planeIsInvalid(m_cMo, angleDisappears)) { + m_error_depthNormal.insert(cpt * 3, face_error); + m_L_depthNormal.insert(L_face, cpt * 3, 0); + } + else { + face_error = 0; + L_face = 0; + m_error_depthNormal.insert(cpt * 3, face_error); + m_L_depthNormal.insert(L_face, cpt * 3, 0); + } cpt++; } diff --git a/modules/tracker/mbt/src/depth/vpMbtFaceDepthNormal.cpp b/modules/tracker/mbt/src/depth/vpMbtFaceDepthNormal.cpp index 4c9e75caec..9be38b48b4 100644 --- a/modules/tracker/mbt/src/depth/vpMbtFaceDepthNormal.cpp +++ b/modules/tracker/mbt/src/depth/vpMbtFaceDepthNormal.cpp @@ -1038,6 +1038,32 @@ void vpMbtFaceDepthNormal::computeNormalVisibility(double nx, double ny, double } } +/** + * Returns true when the plane is nearly parallalel to the optical axis and close to the optical center. + * In this case, the interaction matrix related to this face may "explode" leading to a tracking failure. + */ +bool vpMbtFaceDepthNormal::planeIsInvalid(const vpHomogeneousMatrix &cMo, double maxAngle) +{ + m_planeCamera = m_planeObject; + m_planeCamera.changeFrame(cMo); + const vpTranslationVector t = cMo.getTranslationVector(); + // const double D = -(t[0] * m_planeCamera.getA() + t[1] * m_planeCamera.getB() + t[2] * m_planeCamera.getC()); + const double D = m_planeCamera.getD(); + vpPoint centroid; + std::vector polyPts; + m_polygon->getPolygonClipped(polyPts); + computePolygonCentroid(polyPts, centroid); + centroid.changeFrame(cMo); + centroid.project(); + vpColVector c(3); + c[0] = centroid.get_X(); + c[1] = centroid.get_Y(); + c[2] = centroid.get_Z(); + const double L = c.frobeniusNorm(); + const double minD = L * cos(maxAngle); + return fabs(D) <= minD; +} + void vpMbtFaceDepthNormal::computeInteractionMatrix(const vpHomogeneousMatrix &cMo, vpMatrix &L, vpColVector &features) { L.resize(3, 6, false, false); diff --git a/modules/tracker/me/CMakeLists.txt b/modules/tracker/me/CMakeLists.txt index 282745524a..aa254e19fb 100644 --- a/modules/tracker/me/CMakeLists.txt +++ b/modules/tracker/me/CMakeLists.txt @@ -39,14 +39,7 @@ vp_module_include_directories() vp_create_module() vp_add_tests(DEPENDS_ON visp_io visp_gui) -vp_set_source_file_compile_flag(src/moving-edges/vpMeSite.cpp -Wno-strict-overflow) - -if(USE_OPENCV) - vp_set_source_file_compile_flag(src/moving-edges/vpMeNurbs.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(test/testNurbs.cpp -Wno-float-equal) -endif() - if(WITH_CATCH2) # catch2 is private include_directories(${CATCH2_INCLUDE_DIRS}) -endif() \ No newline at end of file +endif() diff --git a/modules/tracker/rbt/include/visp3/rbt/vpColorHistogram.h b/modules/tracker/rbt/include/visp3/rbt/vpColorHistogram.h index 114625c7e7..92ed08d20e 100644 --- a/modules/tracker/rbt/include/visp3/rbt/vpColorHistogram.h +++ b/modules/tracker/rbt/include/visp3/rbt/vpColorHistogram.h @@ -1,5 +1,4 @@ -/**************************************************************************** - * +/* * ViSP, open source Visual Servoing Platform software. * Copyright (C) 2005 - 2024 by Inria. All rights reserved. * @@ -27,8 +26,7 @@ * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * -*****************************************************************************/ + */ /*! \file vpColorHistogram.h diff --git a/modules/tracker/rbt/include/visp3/rbt/vpColorHistogramMask.h b/modules/tracker/rbt/include/visp3/rbt/vpColorHistogramMask.h index 71e40bd3f3..99e07f3866 100644 --- a/modules/tracker/rbt/include/visp3/rbt/vpColorHistogramMask.h +++ b/modules/tracker/rbt/include/visp3/rbt/vpColorHistogramMask.h @@ -1,5 +1,4 @@ -/**************************************************************************** - * +/* * ViSP, open source Visual Servoing Platform software. * Copyright (C) 2005 - 2024 by Inria. All rights reserved. * @@ -27,8 +26,7 @@ * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * -*****************************************************************************/ + */ /*! \file vpColorHistogramMask.h @@ -59,6 +57,7 @@ class VISP_EXPORT vpColorHistogramMask : public vpObjectMask { public: vpColorHistogramMask(); + virtual ~vpColorHistogramMask() = default; void updateMask(const vpRBFeatureTrackerInput &frame, const vpRBFeatureTrackerInput &previousFrame, @@ -112,14 +111,12 @@ class VISP_EXPORT vpColorHistogramMask : public vpObjectMask #endif private: - vpColorHistogram m_histObject, m_histBackground, m_histObjectFrame, m_histBackgroundFrame; float m_depthErrorTolerance; float m_objectUpdateRate, m_backgroundUpdateRate; vpImage m_mask; vpImage m_probaObject, m_probaBackground; - }; END_VISP_NAMESPACE diff --git a/modules/tracker/rbt/include/visp3/rbt/vpDynamicFactory.h b/modules/tracker/rbt/include/visp3/rbt/vpDynamicFactory.h index ac17b9cf47..abf961dade 100644 --- a/modules/tracker/rbt/include/visp3/rbt/vpDynamicFactory.h +++ b/modules/tracker/rbt/include/visp3/rbt/vpDynamicFactory.h @@ -1,5 +1,4 @@ -/**************************************************************************** - * +/* * ViSP, open source Visual Servoing Platform software. * Copyright (C) 2005 - 2024 by Inria. All rights reserved. * @@ -27,8 +26,7 @@ * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * -*****************************************************************************/ + */ /*! \file vpDynamicFactory.h diff --git a/modules/tracker/rbt/include/visp3/rbt/vpObjectCentricRenderer.h b/modules/tracker/rbt/include/visp3/rbt/vpObjectCentricRenderer.h index bff891b1aa..b1525de595 100644 --- a/modules/tracker/rbt/include/visp3/rbt/vpObjectCentricRenderer.h +++ b/modules/tracker/rbt/include/visp3/rbt/vpObjectCentricRenderer.h @@ -1,5 +1,4 @@ -/**************************************************************************** - * +/* * ViSP, open source Visual Servoing Platform software. * Copyright (C) 2005 - 2024 by Inria. All rights reserved. * @@ -27,8 +26,7 @@ * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * -*****************************************************************************/ + */ /*! \file vpObjectCentricRenderer.h diff --git a/modules/tracker/rbt/include/visp3/rbt/vpObjectMask.h b/modules/tracker/rbt/include/visp3/rbt/vpObjectMask.h index 75ff6f1b86..2258b39f31 100644 --- a/modules/tracker/rbt/include/visp3/rbt/vpObjectMask.h +++ b/modules/tracker/rbt/include/visp3/rbt/vpObjectMask.h @@ -1,5 +1,4 @@ -/**************************************************************************** - * +/* * ViSP, open source Visual Servoing Platform software. * Copyright (C) 2005 - 2024 by Inria. All rights reserved. * @@ -27,8 +26,7 @@ * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * -*****************************************************************************/ + */ /*! \file vpObjectMask.h diff --git a/modules/tracker/rbt/include/visp3/rbt/vpObjectMaskFactory.h b/modules/tracker/rbt/include/visp3/rbt/vpObjectMaskFactory.h index cd954ca357..61d78ab834 100644 --- a/modules/tracker/rbt/include/visp3/rbt/vpObjectMaskFactory.h +++ b/modules/tracker/rbt/include/visp3/rbt/vpObjectMaskFactory.h @@ -1,5 +1,4 @@ -/**************************************************************************** - * +/* * ViSP, open source Visual Servoing Platform software. * Copyright (C) 2005 - 2024 by Inria. All rights reserved. * @@ -27,8 +26,7 @@ * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * -*****************************************************************************/ + */ /*! \file vpObjectMaskFactory.h diff --git a/modules/tracker/rbt/include/visp3/rbt/vpPanda3DDepthFilters.h b/modules/tracker/rbt/include/visp3/rbt/vpPanda3DDepthFilters.h index 574346bbc4..bde78f018b 100644 --- a/modules/tracker/rbt/include/visp3/rbt/vpPanda3DDepthFilters.h +++ b/modules/tracker/rbt/include/visp3/rbt/vpPanda3DDepthFilters.h @@ -1,5 +1,4 @@ -/**************************************************************************** - * +/* * ViSP, open source Visual Servoing Platform software. * Copyright (C) 2005 - 2024 by Inria. All rights reserved. * @@ -27,8 +26,7 @@ * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * -*****************************************************************************/ + */ /*! \file vpPanda3DDepthFilters.h diff --git a/modules/tracker/rbt/include/visp3/rbt/vpRBDenseDepthTracker.h b/modules/tracker/rbt/include/visp3/rbt/vpRBDenseDepthTracker.h index 9914ceedc9..be8d43ece2 100644 --- a/modules/tracker/rbt/include/visp3/rbt/vpRBDenseDepthTracker.h +++ b/modules/tracker/rbt/include/visp3/rbt/vpRBDenseDepthTracker.h @@ -1,5 +1,4 @@ -/**************************************************************************** - * +/* * ViSP, open source Visual Servoing Platform software. * Copyright (C) 2005 - 2024 by Inria. All rights reserved. * @@ -27,8 +26,7 @@ * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * -*****************************************************************************/ + */ /*! \file vpRBDenseDepthTracker.h @@ -72,6 +70,8 @@ class VISP_EXPORT vpRBDenseDepthTracker : public vpRBFeatureTracker vpRBDenseDepthTracker() : vpRBFeatureTracker(), m_step(2), m_useMask(false), m_minMaskConfidence(0.f) { } + virtual ~vpRBDenseDepthTracker() = default; + bool requiresRGB() const VP_OVERRIDE { return false; } bool requiresDepth() const VP_OVERRIDE { return true; } bool requiresSilhouetteCandidates() const VP_OVERRIDE { return false; } @@ -154,6 +154,7 @@ class VISP_EXPORT vpRBDenseDepthTracker : public vpRBFeatureTracker e[i] = D + projNormal; //e[i] = f.get_LogZoverZstar(); } + inline void interaction(vpMatrix &L, unsigned i) { const double X = currentPoint[0], Y = currentPoint[1], Z = currentPoint[2]; @@ -180,7 +181,7 @@ class VISP_EXPORT vpRBDenseDepthTracker : public vpRBFeatureTracker }; #if defined(VISP_HAVE_NLOHMANN_JSON) - virtual void loadJsonConfiguration(const nlohmann::json &j) + virtual void loadJsonConfiguration(const nlohmann::json &j) VP_OVERRIDE { vpRBFeatureTracker::loadJsonConfiguration(j); m_step = j.value("step", m_step); @@ -197,9 +198,8 @@ class VISP_EXPORT vpRBDenseDepthTracker : public vpRBFeatureTracker unsigned int m_step; bool m_useMask; float m_minMaskConfidence; - - }; + END_VISP_NAMESPACE #endif diff --git a/modules/tracker/rbt/include/visp3/rbt/vpRBDriftDetector.h b/modules/tracker/rbt/include/visp3/rbt/vpRBDriftDetector.h index f02710bea4..b7673357c6 100644 --- a/modules/tracker/rbt/include/visp3/rbt/vpRBDriftDetector.h +++ b/modules/tracker/rbt/include/visp3/rbt/vpRBDriftDetector.h @@ -1,5 +1,4 @@ -/**************************************************************************** - * +/* * ViSP, open source Visual Servoing Platform software. * Copyright (C) 2005 - 2024 by Inria. All rights reserved. * @@ -27,8 +26,7 @@ * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * -*****************************************************************************/ + */ /*! \file vpRBDriftDetector.h diff --git a/modules/tracker/rbt/include/visp3/rbt/vpRBDriftDetectorFactory.h b/modules/tracker/rbt/include/visp3/rbt/vpRBDriftDetectorFactory.h index e4e3c05a95..2d4c5de638 100644 --- a/modules/tracker/rbt/include/visp3/rbt/vpRBDriftDetectorFactory.h +++ b/modules/tracker/rbt/include/visp3/rbt/vpRBDriftDetectorFactory.h @@ -1,5 +1,4 @@ -/**************************************************************************** - * +/* * ViSP, open source Visual Servoing Platform software. * Copyright (C) 2005 - 2024 by Inria. All rights reserved. * @@ -27,8 +26,7 @@ * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * -*****************************************************************************/ + */ /*! \file vpRBDriftDetectorFactory.h diff --git a/modules/tracker/rbt/include/visp3/rbt/vpRBFeatureTracker.h b/modules/tracker/rbt/include/visp3/rbt/vpRBFeatureTracker.h index a5e7cbe347..3ff030027e 100644 --- a/modules/tracker/rbt/include/visp3/rbt/vpRBFeatureTracker.h +++ b/modules/tracker/rbt/include/visp3/rbt/vpRBFeatureTracker.h @@ -1,5 +1,4 @@ -/**************************************************************************** - * +/* * ViSP, open source Visual Servoing Platform software. * Copyright (C) 2005 - 2024 by Inria. All rights reserved. * @@ -27,8 +26,7 @@ * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * -*****************************************************************************/ + */ /*! \file vpRBFeatureTracker.h @@ -110,7 +108,6 @@ class VISP_EXPORT vpRBFeatureTracker * @} */ - /** * \name Core Tracking methods * @{ @@ -197,7 +194,6 @@ class VISP_EXPORT vpRBFeatureTracker */ const vpColVector &getWeightedError() const { return m_weighted_error; } - #if defined(VISP_HAVE_NLOHMANN_JSON) virtual void loadJsonConfiguration(const nlohmann::json &j) { diff --git a/modules/tracker/rbt/include/visp3/rbt/vpRBFeatureTrackerFactory.h b/modules/tracker/rbt/include/visp3/rbt/vpRBFeatureTrackerFactory.h index a357581a3f..320db68570 100644 --- a/modules/tracker/rbt/include/visp3/rbt/vpRBFeatureTrackerFactory.h +++ b/modules/tracker/rbt/include/visp3/rbt/vpRBFeatureTrackerFactory.h @@ -1,5 +1,4 @@ -/**************************************************************************** - * +/* * ViSP, open source Visual Servoing Platform software. * Copyright (C) 2005 - 2024 by Inria. All rights reserved. * @@ -27,8 +26,7 @@ * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * -*****************************************************************************/ + */ /*! \file vpRBFeatureTrackerFactory.h @@ -51,6 +49,7 @@ class VISP_EXPORT vpRBFeatureTrackerFactory : public vpDynamicFactory &I, const vpImage &IRGB, const vpImage &depth, const vpRBFeatureDisplayType type) const VP_OVERRIDE; - /** * \name Settings * @{ @@ -156,7 +155,7 @@ class VISP_EXPORT vpRBKltTracker : public vpRBFeatureTracker vpKltOpencv &getKltTracker() { return m_klt; } #if defined(VISP_HAVE_NLOHMANN_JSON) - virtual void loadJsonConfiguration(const nlohmann::json &j) + virtual void loadJsonConfiguration(const nlohmann::json &j) VP_OVERRIDE { vpRBFeatureTracker::loadJsonConfiguration(j); @@ -239,7 +238,6 @@ class VISP_EXPORT vpRBKltTracker : public vpRBFeatureTracker } }; - private: void tryAddNewPoint(const vpRBFeatureTrackerInput &frame, std::map &points, @@ -256,13 +254,6 @@ class VISP_EXPORT vpRBKltTracker : public vpRBFeatureTracker double m_maxErrorOutliersPixels; //! Max 3D reprojection error before a point is considered an outlier and rejected from tracking. In meters - /*! - * Reject points where the render normals's dot product - * with the inverse camera vector is above this angle threshold. - * Helps removing uncertain keypoints or keypoints that may disappear in the next frame. - */ - double m_normalAcceptanceThresholdDeg; - std::map m_points; bool m_useMask; diff --git a/modules/tracker/rbt/include/visp3/rbt/vpRBProbabilistic3DDriftDetector.h b/modules/tracker/rbt/include/visp3/rbt/vpRBProbabilistic3DDriftDetector.h index 53cd98e2b5..db2743d3ae 100644 --- a/modules/tracker/rbt/include/visp3/rbt/vpRBProbabilistic3DDriftDetector.h +++ b/modules/tracker/rbt/include/visp3/rbt/vpRBProbabilistic3DDriftDetector.h @@ -1,5 +1,4 @@ -/**************************************************************************** - * +/* * ViSP, open source Visual Servoing Platform software. * Copyright (C) 2005 - 2024 by Inria. All rights reserved. * @@ -27,8 +26,7 @@ * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * -*****************************************************************************/ + */ /*! \file vpRBProbabilistic3DDriftDetector.h @@ -42,14 +40,10 @@ #include #include - #include - #include - - BEGIN_VISP_NAMESPACE template class vpImage; @@ -59,12 +53,12 @@ template class vpImage; * * \brief Algorithm that uses tracks object surface points in order to estimate the probability that tracking is successful. * - * Given a set of surface points \f$ \mathbf{X}_0, ..., \mathbf{X}_N, \f$, each point \f$\mathbf{X}_i\f$ being associated to: + * Given a set of surface points \f$ \mathbf{X}_0, ..., \mathbf{X}_N\f$, each point \f$\mathbf{X}_i\f$ being associated to: * * - a color distribution \f$\mathcal{N}(\mathbf{\bar c_i}, \mathbf{\Sigma_{c_i}^2})\f$, * - its distance to the camera being \f$Z_i\f$, * - its projection in the current color and depth images \f$\mathbf{I_c}, \mathbf{I_Z}\f$ having coordinates \f$u_i, v_i\f$. - * - its visibility V(\mathbf{X_i}), which is 1 if \f$u_i, v_i\f$ lie in the image, + * - its visibility \f$V(\mathbf{X_i})\f$, which is 1 if \f$u_i, v_i\f$ lie in the image, * \f$Z_i\f$ is close to the rendered depth value * and the normal at the surface marks the point as visible from the camera's point of view. * @@ -81,7 +75,6 @@ template class vpImage; * \end{aligned} * \f] * - * * if the depth is unavailable, then we set \f$p(\mathbf{I_Z}(u_i, v_i) | \mathcal{N}(Z_i, \sigma_Z^2)) = 1\f$ * * Here, the color distribution is estimated online for each point separately using exponential moving average/variance techniques. @@ -89,9 +82,9 @@ template class vpImage; * * For the depth, \f$\sigma_Z\f$ is a fixed parameter to be tweaked by the user. * - * Every time update is called, the set of points \f$ \mathbf{X}_0, ..., \mathbf{X}_N, \f$ may grow larger: If a new candidate point is visible and is far enough from points already in the set, it is added to it. - * -*/ + * Every time update() is called, the set of points \f$ \mathbf{X}_0, ..., \mathbf{X}_N, \f$ may grow larger. + * If a new candidate point is visible and is far enough from points already in the set, it is added to it. + */ class VISP_EXPORT vpRBProbabilistic3DDriftDetector : public vpRBDriftDetector { @@ -213,7 +206,6 @@ class VISP_EXPORT vpRBProbabilistic3DDriftDetector : public vpRBDriftDetector public: - vpRBProbabilistic3DDriftDetector() : m_colorUpdateRate(0.2), m_initialColorSigma(25.0), m_depthSigma(0.04), m_maxError3D(0.001), m_minDist3DNewPoint(0.003) { } diff --git a/modules/tracker/rbt/include/visp3/rbt/vpRBSilhouetteCCDTracker.h b/modules/tracker/rbt/include/visp3/rbt/vpRBSilhouetteCCDTracker.h index 463cda23f7..602b566049 100644 --- a/modules/tracker/rbt/include/visp3/rbt/vpRBSilhouetteCCDTracker.h +++ b/modules/tracker/rbt/include/visp3/rbt/vpRBSilhouetteCCDTracker.h @@ -1,5 +1,4 @@ -/**************************************************************************** - * +/* * ViSP, open source Visual Servoing Platform software. * Copyright (C) 2005 - 2024 by Inria. All rights reserved. * @@ -27,8 +26,7 @@ * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * -*****************************************************************************/ + */ /*! \file vpRBSilhouetteCCDTracker.h @@ -176,7 +174,6 @@ class VISP_EXPORT vpCCDStatistics } }; - /** * \brief Tracking based on the Contracting Curve Density algorithm. * @@ -187,6 +184,7 @@ class VISP_EXPORT vpRBSilhouetteCCDTracker : public vpRBFeatureTracker public: vpRBSilhouetteCCDTracker(); + virtual ~vpRBSilhouetteCCDTracker() = default; bool requiresRGB() const VP_OVERRIDE { return true; } bool requiresDepth() const VP_OVERRIDE { return false; } @@ -218,7 +216,6 @@ class VISP_EXPORT vpRBSilhouetteCCDTracker : public vpRBFeatureTracker * @} */ - void onTrackingIterStart() VP_OVERRIDE { } void onTrackingIterEnd() VP_OVERRIDE { } @@ -237,7 +234,7 @@ class VISP_EXPORT vpRBSilhouetteCCDTracker : public vpRBFeatureTracker void display(const vpCameraParameters &cam, const vpImage &I, const vpImage &IRGB, const vpImage &depth, const vpRBFeatureDisplayType type) const VP_OVERRIDE; #if defined(VISP_HAVE_NLOHMANN_JSON) - virtual void loadJsonConfiguration(const nlohmann::json &j) + virtual void loadJsonConfiguration(const nlohmann::json &j) VP_OVERRIDE { vpRBFeatureTracker::loadJsonConfiguration(j); m_vvsConvergenceThreshold = j.value("convergenceThreshold", m_vvsConvergenceThreshold); diff --git a/modules/tracker/rbt/include/visp3/rbt/vpRBSilhouetteControlPoint.h b/modules/tracker/rbt/include/visp3/rbt/vpRBSilhouetteControlPoint.h index 0d2ef46914..b593058f04 100644 --- a/modules/tracker/rbt/include/visp3/rbt/vpRBSilhouetteControlPoint.h +++ b/modules/tracker/rbt/include/visp3/rbt/vpRBSilhouetteControlPoint.h @@ -1,5 +1,4 @@ -/**************************************************************************** - * +/* * ViSP, open source Visual Servoing Platform software. * Copyright (C) 2005 - 2024 by Inria. All rights reserved. * @@ -27,8 +26,7 @@ * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * -*****************************************************************************/ + */ /*! \file vpRBSilhouetteControlPoint.h @@ -76,31 +74,19 @@ class VISP_EXPORT vpRBSilhouetteControlPoint bool m_valid; - public: const vpCameraParameters *cam; - //int imin, imax; - //int jmin, jmax; - //double expecteddensity; - // the image point vpImagePoint icpoint; - // the 3D point vpPoint cpoint; vpPoint cpointo; - //! The moving edge container associated to the control point - //vpMbtMeLine *meline; - //! The 3D line associated to the control point - //vpLine *line; - - //! Normale to surface where the control point lies + //! Normal to surface where the control point lies vpColVector norm; vpColVector normw; - //! Gradient profile associated to the control Points double error; @@ -112,7 +98,6 @@ class VISP_EXPORT vpRBSilhouetteControlPoint bool isSilhouette; bool invnormal; - public: void init(); @@ -143,7 +128,6 @@ class VISP_EXPORT vpRBSilhouetteControlPoint const vpLine &getLine() const { return line; } double getTheta() const { return theta; } - void setMovingEdge(vpMe *_me) { me = _me; } void setCameraParameters(const vpCameraParameters *_cam) { cam = _cam; } @@ -179,10 +163,8 @@ class VISP_EXPORT vpRBSilhouetteControlPoint private: void sample(const vpImage &) { } bool isLineDegenerate() const; - - - }; + END_VISP_NAMESPACE #endif diff --git a/modules/tracker/rbt/include/visp3/rbt/vpRBSilhouetteMeTracker.h b/modules/tracker/rbt/include/visp3/rbt/vpRBSilhouetteMeTracker.h index 85ebaeceda..b7f068b4ea 100644 --- a/modules/tracker/rbt/include/visp3/rbt/vpRBSilhouetteMeTracker.h +++ b/modules/tracker/rbt/include/visp3/rbt/vpRBSilhouetteMeTracker.h @@ -1,5 +1,4 @@ -/**************************************************************************** - * +/* * ViSP, open source Visual Servoing Platform software. * Copyright (C) 2005 - 2024 by Inria. All rights reserved. * @@ -27,8 +26,7 @@ * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * -*****************************************************************************/ + */ /*! \file vpRBSilhouetteMeTracker.h @@ -51,7 +49,12 @@ class VISP_EXPORT vpRBSilhouetteMeTracker : public vpRBFeatureTracker { public: - vpRBSilhouetteMeTracker() : vpRBFeatureTracker(), m_me(), m_numCandidates(1), m_globalVVSConvergenceThreshold(1.0), m_singlePointConvergedThresholdPixels(3), m_useMask(false), m_minMaskConfidence(0.f) { } + vpRBSilhouetteMeTracker() : + vpRBFeatureTracker(), m_me(), m_numCandidates(1), m_globalVVSConvergenceThreshold(1.0), + m_singlePointConvergedThresholdPixels(3), m_useMask(false), m_minMaskConfidence(0.f) + { } + + virtual ~vpRBSilhouetteMeTracker() = default; bool requiresRGB() const VP_OVERRIDE { return false; } @@ -82,7 +85,7 @@ class VISP_EXPORT vpRBSilhouetteMeTracker : public vpRBFeatureTracker void display(const vpCameraParameters &cam, const vpImage &I, const vpImage &IRGB, const vpImage &depth, const vpRBFeatureDisplayType type) const VP_OVERRIDE; #if defined(VISP_HAVE_NLOHMANN_JSON) - virtual void loadJsonConfiguration(const nlohmann::json &j) + virtual void loadJsonConfiguration(const nlohmann::json &j) VP_OVERRIDE { vpRBFeatureTracker::loadJsonConfiguration(j); m_numCandidates = j.value("numCandidates", m_numCandidates); diff --git a/modules/tracker/rbt/include/visp3/rbt/vpRBSilhouettePoint.h b/modules/tracker/rbt/include/visp3/rbt/vpRBSilhouettePoint.h index 44fb271894..7933b2ae16 100644 --- a/modules/tracker/rbt/include/visp3/rbt/vpRBSilhouettePoint.h +++ b/modules/tracker/rbt/include/visp3/rbt/vpRBSilhouettePoint.h @@ -1,5 +1,4 @@ -/**************************************************************************** - * +/* * ViSP, open source Visual Servoing Platform software. * Copyright (C) 2005 - 2024 by Inria. All rights reserved. * @@ -27,8 +26,7 @@ * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * -*****************************************************************************/ + */ /*! \file vpRBSilhouettePoint.h diff --git a/modules/tracker/rbt/include/visp3/rbt/vpRBSilhouettePointsExtractionSettings.h b/modules/tracker/rbt/include/visp3/rbt/vpRBSilhouettePointsExtractionSettings.h index 5e1540a4fa..834f3064db 100644 --- a/modules/tracker/rbt/include/visp3/rbt/vpRBSilhouettePointsExtractionSettings.h +++ b/modules/tracker/rbt/include/visp3/rbt/vpRBSilhouettePointsExtractionSettings.h @@ -1,5 +1,4 @@ -/**************************************************************************** - * +/* * ViSP, open source Visual Servoing Platform software. * Copyright (C) 2005 - 2024 by Inria. All rights reserved. * @@ -27,8 +26,7 @@ * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * -*****************************************************************************/ + */ /*! \file vpRBSilhouettePointsExtractionSettings.h diff --git a/modules/tracker/rbt/include/visp3/rbt/vpRBTracker.h b/modules/tracker/rbt/include/visp3/rbt/vpRBTracker.h index 60cd3d0b6f..ed66edc3db 100644 --- a/modules/tracker/rbt/include/visp3/rbt/vpRBTracker.h +++ b/modules/tracker/rbt/include/visp3/rbt/vpRBTracker.h @@ -1,5 +1,4 @@ -/**************************************************************************** - * +/* * ViSP, open source Visual Servoing Platform software. * Copyright (C) 2005 - 2024 by Inria. All rights reserved. * @@ -27,8 +26,7 @@ * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * -*****************************************************************************/ + */ /*! \file vpRBTracker.h diff --git a/modules/tracker/rbt/include/visp3/rbt/vpRBTrackerLogger.h b/modules/tracker/rbt/include/visp3/rbt/vpRBTrackerLogger.h index 47f8d8e910..b4ca76cdd7 100644 --- a/modules/tracker/rbt/include/visp3/rbt/vpRBTrackerLogger.h +++ b/modules/tracker/rbt/include/visp3/rbt/vpRBTrackerLogger.h @@ -1,5 +1,4 @@ -/**************************************************************************** - * +/* * ViSP, open source Visual Servoing Platform software. * Copyright (C) 2005 - 2024 by Inria. All rights reserved. * @@ -27,8 +26,7 @@ * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * -*****************************************************************************/ + */ /*! \file vpRBTrackerLogger.h diff --git a/modules/tracker/rbt/src/core/vpRBSilhouetteControlPoint.cpp b/modules/tracker/rbt/src/core/vpRBSilhouetteControlPoint.cpp index 9fe41b14fb..41f11628f5 100644 --- a/modules/tracker/rbt/src/core/vpRBSilhouetteControlPoint.cpp +++ b/modules/tracker/rbt/src/core/vpRBSilhouetteControlPoint.cpp @@ -1,5 +1,4 @@ -/**************************************************************************** - * +/* * ViSP, open source Visual Servoing Platform software. * Copyright (C) 2005 - 2024 by Inria. All rights reserved. * @@ -27,8 +26,7 @@ * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * -*****************************************************************************/ + */ #include #include @@ -189,23 +187,14 @@ void vpRBSilhouetteControlPoint::trackMultipleHypotheses(const vpImage 1e-2) { @@ -242,7 +230,8 @@ vpRBSilhouetteControlPoint::buildPLine(const vpHomogeneousMatrix &oMc) } void -vpRBSilhouetteControlPoint::buildPoint(int n, int m, const double &Z, double orient, const vpColVector &normo, const vpHomogeneousMatrix &cMo, const vpHomogeneousMatrix &oMc) +vpRBSilhouetteControlPoint::buildPoint(int n, int m, const double &Z, double orient, const vpColVector &normo, + const vpHomogeneousMatrix &cMo, const vpHomogeneousMatrix &oMc) { vpRotationMatrix R; cMo.extract(R); @@ -397,12 +386,8 @@ void vpRBSilhouetteControlPoint::detectSilhouette(const vpImage &I) } /*! - Construct a list of vpMeSite moving edges at a particular sampling - step between the two extremities of the line. - - \param I : Image in which the line appears. + Initialize the interaction matrix and the error to 0. */ - void vpRBSilhouetteControlPoint::initInteractionMatrixError() { diff --git a/modules/tracker/rbt/src/core/vpRBSilhouettePointsExtractionSettings.cpp b/modules/tracker/rbt/src/core/vpRBSilhouettePointsExtractionSettings.cpp index b3f69c2279..afdb5aa528 100644 --- a/modules/tracker/rbt/src/core/vpRBSilhouettePointsExtractionSettings.cpp +++ b/modules/tracker/rbt/src/core/vpRBSilhouettePointsExtractionSettings.cpp @@ -1,6 +1,5 @@ -/**************************************************************************** - * +/* * ViSP, open source Visual Servoing Platform software. * Copyright (C) 2005 - 2024 by Inria. All rights reserved. * @@ -28,8 +27,7 @@ * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * -*****************************************************************************/ + */ #include diff --git a/modules/tracker/rbt/src/core/vpRBTracker.cpp b/modules/tracker/rbt/src/core/vpRBTracker.cpp index 8b9ec2e849..7c9b525166 100644 --- a/modules/tracker/rbt/src/core/vpRBTracker.cpp +++ b/modules/tracker/rbt/src/core/vpRBTracker.cpp @@ -1,5 +1,4 @@ -/**************************************************************************** - * +/* * ViSP, open source Visual Servoing Platform software. * Copyright (C) 2005 - 2024 by Inria. All rights reserved. * @@ -27,8 +26,7 @@ * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * -*****************************************************************************/ + */ #include diff --git a/modules/tracker/rbt/src/drift/vpRBDriftDetectorFactory.cpp b/modules/tracker/rbt/src/drift/vpRBDriftDetectorFactory.cpp index 4a41ce3fb0..c98330ad1d 100644 --- a/modules/tracker/rbt/src/drift/vpRBDriftDetectorFactory.cpp +++ b/modules/tracker/rbt/src/drift/vpRBDriftDetectorFactory.cpp @@ -1,5 +1,4 @@ -/**************************************************************************** - * +/* * ViSP, open source Visual Servoing Platform software. * Copyright (C) 2005 - 2024 by Inria. All rights reserved. * @@ -27,8 +26,7 @@ * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * -*****************************************************************************/ + */ #include #include diff --git a/modules/tracker/rbt/src/drift/vpRBProbabilistic3DDriftDetector.cpp b/modules/tracker/rbt/src/drift/vpRBProbabilistic3DDriftDetector.cpp index 9e60668df4..6f8142b9c3 100644 --- a/modules/tracker/rbt/src/drift/vpRBProbabilistic3DDriftDetector.cpp +++ b/modules/tracker/rbt/src/drift/vpRBProbabilistic3DDriftDetector.cpp @@ -1,5 +1,4 @@ -/**************************************************************************** - * +/* * ViSP, open source Visual Servoing Platform software. * Copyright (C) 2005 - 2024 by Inria. All rights reserved. * @@ -27,8 +26,7 @@ * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * -*****************************************************************************/ + */ #include diff --git a/modules/tracker/rbt/src/features/vpRBDenseDepthTracker.cpp b/modules/tracker/rbt/src/features/vpRBDenseDepthTracker.cpp index f2486f1eab..bfb71cfd5d 100644 --- a/modules/tracker/rbt/src/features/vpRBDenseDepthTracker.cpp +++ b/modules/tracker/rbt/src/features/vpRBDenseDepthTracker.cpp @@ -1,5 +1,4 @@ -/**************************************************************************** - * +/* * ViSP, open source Visual Servoing Platform software. * Copyright (C) 2005 - 2024 by Inria. All rights reserved. * @@ -27,8 +26,7 @@ * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * -*****************************************************************************/ + */ #include #include diff --git a/modules/tracker/rbt/src/features/vpRBFeatureTracker.cpp b/modules/tracker/rbt/src/features/vpRBFeatureTracker.cpp index d07379d2a6..4d485413f9 100644 --- a/modules/tracker/rbt/src/features/vpRBFeatureTracker.cpp +++ b/modules/tracker/rbt/src/features/vpRBFeatureTracker.cpp @@ -1,5 +1,4 @@ -/**************************************************************************** - * +/* * ViSP, open source Visual Servoing Platform software. * Copyright (C) 2005 - 2024 by Inria. All rights reserved. * @@ -27,8 +26,7 @@ * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * -*****************************************************************************/ + */ #include diff --git a/modules/tracker/rbt/src/features/vpRBFeatureTrackerFactory.cpp b/modules/tracker/rbt/src/features/vpRBFeatureTrackerFactory.cpp index 92eeba5238..7729bd8028 100644 --- a/modules/tracker/rbt/src/features/vpRBFeatureTrackerFactory.cpp +++ b/modules/tracker/rbt/src/features/vpRBFeatureTrackerFactory.cpp @@ -1,5 +1,4 @@ -/**************************************************************************** - * +/* * ViSP, open source Visual Servoing Platform software. * Copyright (C) 2005 - 2024 by Inria. All rights reserved. * @@ -27,8 +26,7 @@ * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * -*****************************************************************************/ + */ #include diff --git a/modules/tracker/rbt/src/features/vpRBKltTracker.cpp b/modules/tracker/rbt/src/features/vpRBKltTracker.cpp index 170e82d59d..736ecd3f5f 100644 --- a/modules/tracker/rbt/src/features/vpRBKltTracker.cpp +++ b/modules/tracker/rbt/src/features/vpRBKltTracker.cpp @@ -1,5 +1,4 @@ -/**************************************************************************** - * +/* * ViSP, open source Visual Servoing Platform software. * Copyright (C) 2005 - 2024 by Inria. All rights reserved. * @@ -27,8 +26,7 @@ * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * -*****************************************************************************/ + */ #include diff --git a/modules/tracker/rbt/src/features/vpRBSilhouetteCCDTracker.cpp b/modules/tracker/rbt/src/features/vpRBSilhouetteCCDTracker.cpp index 2f4c196afc..a884fb07c5 100644 --- a/modules/tracker/rbt/src/features/vpRBSilhouetteCCDTracker.cpp +++ b/modules/tracker/rbt/src/features/vpRBSilhouetteCCDTracker.cpp @@ -1,6 +1,5 @@ -/**************************************************************************** - * +/* * ViSP, open source Visual Servoing Platform software. * Copyright (C) 2005 - 2024 by Inria. All rights reserved. * @@ -28,8 +27,7 @@ * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * -*****************************************************************************/ + */ #include #include diff --git a/modules/tracker/rbt/src/features/vpRBSilhouetteMeTracker.cpp b/modules/tracker/rbt/src/features/vpRBSilhouetteMeTracker.cpp index b072871a84..7833e7228c 100644 --- a/modules/tracker/rbt/src/features/vpRBSilhouetteMeTracker.cpp +++ b/modules/tracker/rbt/src/features/vpRBSilhouetteMeTracker.cpp @@ -1,5 +1,4 @@ -/**************************************************************************** - * +/* * ViSP, open source Visual Servoing Platform software. * Copyright (C) 2005 - 2024 by Inria. All rights reserved. * @@ -27,8 +26,7 @@ * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * -*****************************************************************************/ + */ #include diff --git a/modules/tracker/rbt/src/mask/vpColorHistogram.cpp b/modules/tracker/rbt/src/mask/vpColorHistogram.cpp index b1ddff5087..48e0304b38 100644 --- a/modules/tracker/rbt/src/mask/vpColorHistogram.cpp +++ b/modules/tracker/rbt/src/mask/vpColorHistogram.cpp @@ -1,5 +1,4 @@ -/**************************************************************************** - * +/* * ViSP, open source Visual Servoing Platform software. * Copyright (C) 2005 - 2024 by Inria. All rights reserved. * @@ -27,8 +26,7 @@ * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * -*****************************************************************************/ + */ #include diff --git a/modules/tracker/rbt/src/mask/vpColorHistogramMask.cpp b/modules/tracker/rbt/src/mask/vpColorHistogramMask.cpp index e3ef3ba6ab..cbb4ba5772 100644 --- a/modules/tracker/rbt/src/mask/vpColorHistogramMask.cpp +++ b/modules/tracker/rbt/src/mask/vpColorHistogramMask.cpp @@ -1,5 +1,4 @@ -/**************************************************************************** - * +/* * ViSP, open source Visual Servoing Platform software. * Copyright (C) 2005 - 2024 by Inria. All rights reserved. * @@ -27,8 +26,7 @@ * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * -*****************************************************************************/ + */ #include diff --git a/modules/tracker/rbt/src/mask/vpObjectMask.cpp b/modules/tracker/rbt/src/mask/vpObjectMask.cpp index 9df639c876..4c720a4b72 100644 --- a/modules/tracker/rbt/src/mask/vpObjectMask.cpp +++ b/modules/tracker/rbt/src/mask/vpObjectMask.cpp @@ -1,5 +1,4 @@ -/**************************************************************************** - * +/* * ViSP, open source Visual Servoing Platform software. * Copyright (C) 2005 - 2024 by Inria. All rights reserved. * @@ -27,8 +26,7 @@ * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * -*****************************************************************************/ + */ #include diff --git a/modules/tracker/rbt/src/mask/vpObjectMaskFactory.cpp b/modules/tracker/rbt/src/mask/vpObjectMaskFactory.cpp index 6c4d4af712..2dc1b28545 100644 --- a/modules/tracker/rbt/src/mask/vpObjectMaskFactory.cpp +++ b/modules/tracker/rbt/src/mask/vpObjectMaskFactory.cpp @@ -1,5 +1,4 @@ -/**************************************************************************** - * +/* * ViSP, open source Visual Servoing Platform software. * Copyright (C) 2005 - 2024 by Inria. All rights reserved. * @@ -27,8 +26,7 @@ * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * -*****************************************************************************/ + */ #include #include diff --git a/modules/tracker/rbt/src/rendering/vpObjectCentricRenderer.cpp b/modules/tracker/rbt/src/rendering/vpObjectCentricRenderer.cpp index 0c5492be25..57e5f6de44 100644 --- a/modules/tracker/rbt/src/rendering/vpObjectCentricRenderer.cpp +++ b/modules/tracker/rbt/src/rendering/vpObjectCentricRenderer.cpp @@ -1,5 +1,4 @@ -/**************************************************************************** - * +/* * ViSP, open source Visual Servoing Platform software. * Copyright (C) 2005 - 2024 by Inria. All rights reserved. * @@ -27,8 +26,7 @@ * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * -*****************************************************************************/ + */ #include @@ -82,7 +80,6 @@ void vpObjectCentricRenderer::beforeFrameRendered() for (std::shared_ptr &subrenderer : m_subRenderers) { subrenderer->setRenderParameters(subParams); } - } } @@ -98,14 +95,12 @@ void vpObjectCentricRenderer::computeBoundingBox3DPoints() } m_bb3DPoints.clear(); LPoint3 minP, maxP; - double t1 = vpTime::measureTimeMs(); object.calc_tight_bounds(minP, maxP); const BoundingBox box(minP, maxP); for (unsigned int i = 0; i < 8; ++i) { const LPoint3 p = box.get_point(i); m_bb3DPoints.push_back(vpColVector({ p.get_x(), -p.get_z(), p.get_y(), 1.0 })); - } } diff --git a/modules/tracker/rbt/src/rendering/vpPanda3DDepthFilters.cpp b/modules/tracker/rbt/src/rendering/vpPanda3DDepthFilters.cpp index 9ade57dd31..ac9f64c5f4 100644 --- a/modules/tracker/rbt/src/rendering/vpPanda3DDepthFilters.cpp +++ b/modules/tracker/rbt/src/rendering/vpPanda3DDepthFilters.cpp @@ -1,5 +1,4 @@ -/**************************************************************************** - * +/* * ViSP, open source Visual Servoing Platform software. * Copyright (C) 2005 - 2024 by Inria. All rights reserved. * @@ -27,8 +26,7 @@ * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * -*****************************************************************************/ + */ #include diff --git a/modules/tracker/tt/CMakeLists.txt b/modules/tracker/tt/CMakeLists.txt index 7d6792ffd4..3cf492d48a 100644 --- a/modules/tracker/tt/CMakeLists.txt +++ b/modules/tracker/tt/CMakeLists.txt @@ -37,7 +37,3 @@ vp_add_module(tt visp_vision visp_core) vp_glob_module_sources() vp_module_include_directories() vp_create_module() - -vp_set_source_file_compile_flag(src/vpTemplateTracker.cpp -Wno-strict-overflow) -vp_set_source_file_compile_flag(src/warp/vpTemplateTrackerWarp.cpp -Wno-strict-overflow) -vp_set_source_file_compile_flag(src/warp/vpTemplateTrackerWarpHomographySL3.cpp -Wno-strict-overflow) diff --git a/modules/tracker/tt_mi/CMakeLists.txt b/modules/tracker/tt_mi/CMakeLists.txt index d43c03efdc..048db737ac 100644 --- a/modules/tracker/tt_mi/CMakeLists.txt +++ b/modules/tracker/tt_mi/CMakeLists.txt @@ -35,9 +35,6 @@ vp_define_module(tt_mi visp_tt) -vp_set_source_file_compile_flag(src/mi/vpTemplateTrackerMIInverseCompositional.cpp -Wno-strict-overflow) -vp_set_source_file_compile_flag(src/tools/vpTemplateTrackerMIBSpline.cpp -Wno-strict-overflow) - # The previous line is similar to the following: #vp_add_module(tt_mi visp_tt) #vp_glob_module_sources() diff --git a/modules/vision/CMakeLists.txt b/modules/vision/CMakeLists.txt index b2a93126ab..7538843b83 100644 --- a/modules/vision/CMakeLists.txt +++ b/modules/vision/CMakeLists.txt @@ -159,17 +159,6 @@ vp_module_include_directories(${opt_incs}) vp_create_module(${opt_libs}) vp_add_tests(DEPENDS_ON visp_mbt visp_gui visp_io) -if(USE_OGRE) - # Add specific build flag to turn off warnings coming from libogre and libois 3rd party - vp_set_source_file_compile_flag(test/keypoint-with-dataset/testKeyPoint-2.cpp -Wno-unused-parameter -Wno-unused-but-set-parameter -Wno-overloaded-virtual -Wno-float-equal -Wno-deprecated-copy -Wno-register) - vp_set_source_file_compile_flag(test/keypoint-with-dataset/testKeyPoint-4.cpp -Wno-unused-parameter -Wno-unused-but-set-parameter -Wno-overloaded-virtual -Wno-float-equal -Wno-deprecated-copy -Wno-register) -endif() - -vp_set_source_file_compile_flag(src/pose-estimation/vpPoseFeatures.cpp -Wno-strict-overflow) -vp_set_source_file_compile_flag(src/pose-estimation/vpPoseRansac.cpp -Wno-strict-overflow) -vp_set_source_file_compile_flag(src/pose-estimation/private/vpLevenbergMarquartd.cpp -Wno-strict-overflow) -vp_set_source_file_compile_flag(src/keypoint/vpKeyPoint.cpp -Wno-strict-overflow) - if(BUILD_MODULE_visp_mbt AND BUILD_MODULE_visp_gui AND BUILD_MODULE_visp_io) if(VISP_DATASET_FOUND) add_test(testKeyPoint-2-multithreaded testKeyPoint-2 -c ${OPTION_TO_DESACTIVE_DISPLAY} -p) diff --git a/modules/visual_features/CMakeLists.txt b/modules/visual_features/CMakeLists.txt index 0789619ec8..a878b3765a 100644 --- a/modules/visual_features/CMakeLists.txt +++ b/modules/visual_features/CMakeLists.txt @@ -43,12 +43,3 @@ if(WITH_CATCH2) # catch2 is private include_directories(${CATCH2_INCLUDE_DIRS}) endif() - -if(USE_OPENCV) - vp_set_source_file_compile_flag(src/feature-builder/vpFeatureBuilderEllipse.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(src/feature-builder/vpFeatureBuilderLine.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(src/feature-builder/vpFeatureBuilderPoint.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(src/feature-builder/vpFeatureBuilderPoint3D.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(src/feature-builder/vpFeatureBuilderPointPolar.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(src/feature-builder/vpFeatureBuilderSegment.cpp -Wno-float-equal) -endif() diff --git a/tutorial/ar/CMakeLists.txt b/tutorial/ar/CMakeLists.txt index d8591335f6..bb3d849a2c 100644 --- a/tutorial/ar/CMakeLists.txt +++ b/tutorial/ar/CMakeLists.txt @@ -1,16 +1,14 @@ cmake_minimum_required(VERSION 3.5) -project(color_segmentation) +project(tutorial-panda3d) -find_package(VISP REQUIRED visp_core visp_gui visp_ar) +find_package(VISP REQUIRED visp_core visp_gui visp_ar visp_io) # set the list of source files set(tutorial_cpp tutorial-panda3d-renderer.cpp ) -visp_set_source_file_compile_flag(tutorial-panda3d-renderer.cpp -Wno-extra -Wno-unused-parameter -Wno-unused-variable) - foreach(cpp ${tutorial_cpp}) visp_add_target(${cpp}) if(COMMAND visp_add_dependency) diff --git a/tutorial/ar/tutorial-panda3d-renderer.cpp b/tutorial/ar/tutorial-panda3d-renderer.cpp index 39cf1d8aba..617938e784 100644 --- a/tutorial/ar/tutorial-panda3d-renderer.cpp +++ b/tutorial/ar/tutorial-panda3d-renderer.cpp @@ -32,7 +32,7 @@ void displayNormals(const vpImage &normalsImage, #if defined(_OPENMP) #pragma omp parallel for #endif - for (int i = 0; i < normalsImage.getSize(); ++i) { + for (unsigned int i = 0; i < normalsImage.getSize(); ++i) { normalDisplayImage.bitmap[i].R = static_cast((normalsImage.bitmap[i].R + 1.0) * 127.5f); normalDisplayImage.bitmap[i].G = static_cast((normalsImage.bitmap[i].G + 1.0) * 127.5f); normalDisplayImage.bitmap[i].B = static_cast((normalsImage.bitmap[i].B + 1.0) * 127.5f); @@ -48,7 +48,7 @@ void displayDepth(const vpImage &depthImage, #if defined(_OPENMP) #pragma omp parallel for #endif - for (int i = 0; i < depthImage.getSize(); ++i) { + for (unsigned int i = 0; i < depthImage.getSize(); ++i) { float val = std::max(0.f, (depthImage.bitmap[i] - nearV) / (farV - nearV)); depthDisplayImage.bitmap[i] = static_cast(val * 255.f); } @@ -61,7 +61,7 @@ void displayLightDifference(const vpImage &colorImage, const vpImage(round(abs(I1 - I2))); @@ -76,7 +76,7 @@ void displayCanny(const vpImage &cannyRawData, #if defined(_OPENMP) #pragma omp parallel for #endif - for (int i = 0; i < cannyRawData.getSize(); ++i) { + for (unsigned int i = 0; i < cannyRawData.getSize(); ++i) { vpRGBf &px = cannyRawData.bitmap[i]; canny.bitmap[i] = 255 * (px.R * px.R + px.G * px.G > 0); //canny.bitmap[i] = static_cast(127.5f + 127.5f * atan(px.B)); @@ -258,10 +258,8 @@ int main(int argc, const char **argv) } renderer.renderFrame(); bool end = false; - bool firstFrame = true; std::vector renderTime, fetchTime, displayTime; while (!end) { - const double beforeComputeBB = vpTime::measureTimeMs(); //! [Updating render parameters] float nearV = 0, farV = 0; geometryRenderer->computeNearAndFarPlanesFromNode(objectName, nearV, farV, true); diff --git a/tutorial/gui/pcl-visualizer/CMakeLists.txt b/tutorial/gui/pcl-visualizer/CMakeLists.txt index 088dcaf465..de775cc076 100644 --- a/tutorial/gui/pcl-visualizer/CMakeLists.txt +++ b/tutorial/gui/pcl-visualizer/CMakeLists.txt @@ -15,8 +15,3 @@ foreach(cpp ${tutorial_cpp}) visp_add_dependency(${cpp} "tutorials") endif() endforeach() - -if(VISP_HAVE_PCL) -vp_set_source_file_compile_flag(tutorial-pcl-viewer.cpp -Wno-unused-parameter) -vp_set_source_file_compile_flag(ClassUsingPclViewer.cpp -Wno-unused-parameter) -endif() diff --git a/tutorial/particle-filter-curve-fitting/vpTutoCommonData.h b/tutorial/particle-filter-curve-fitting/vpTutoCommonData.h index f6d6757681..01d422a96c 100644 --- a/tutorial/particle-filter-curve-fitting/vpTutoCommonData.h +++ b/tutorial/particle-filter-curve-fitting/vpTutoCommonData.h @@ -83,14 +83,10 @@ typedef struct vpTutoCommonData VISP_NAMESPACE_ADDRESSING vpImage m_mask; /*!< A binary mask where 255 means that a pixel belongs to the HSV range delimited by the HSV thresholds.*/ VISP_NAMESPACE_ADDRESSING vpImage m_Iskeleton; /*!< The image resulting from the skeletonization of the mask.*/ VISP_NAMESPACE_ADDRESSING vpImage m_IskeletonNoisy; /*!< The image resulting from the skeletonization of the mask, to which is added some salt and pepper noise.*/ -#if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11) && defined(VISP_HAVE_DISPLAY) +#if defined(VISP_HAVE_DISPLAY) std::shared_ptr m_displayOrig; std::shared_ptr m_displaySegmented; std::shared_ptr m_displayNoisy; -#elif defined(VISP_HAVE_DISPLAY) - VISP_NAMESPACE_ADDRESSING vpDisplay *m_displayOrig; - VISP_NAMESPACE_ADDRESSING vpDisplay *m_displaySegmented; - VISP_NAMESPACE_ADDRESSING vpDisplay *m_displayNoisy; #endif /// Particle filter parameters @@ -106,11 +102,6 @@ typedef struct vpTutoCommonData , m_stepbystep(true) , m_ratioSaltPepperNoise(0.15) , m_degree(2) -#if (VISP_CXX_STANDARD < VISP_CXX_STANDARD_11) && defined(VISP_HAVE_DISPLAY) - , m_displayOrig(nullptr) - , m_displaySegmented(nullptr) - , m_displayNoisy(nullptr) -#endif , m_pfMaxDistanceForLikelihood(40) , m_pfN(300) , m_pfRatiosAmpliMax({ 0.25, 0.25, 0.25 }) @@ -118,25 +109,6 @@ typedef struct vpTutoCommonData , m_pfNbThreads(-1) { } -#if (VISP_CXX_STANDARD < VISP_CXX_STANDARD_11) && defined(VISP_HAVE_DISPLAY) - ~vpTutoCommonData() - { - if (m_displayOrig != nullptr) { - delete m_displayOrig; - m_displayOrig = nullptr; - } - if (m_displaySegmented != nullptr) { - delete m_displaySegmented; - m_displaySegmented = nullptr; - } - - if (m_displayNoisy != nullptr) { - delete m_displayNoisy; - m_displayNoisy = nullptr; - } - } -#endif - /** * \brief Print the help about the program optional parameters. * @@ -291,18 +263,14 @@ typedef struct vpTutoCommonData m_IskeletonNoisy.resize(m_I_orig.getHeight(), m_I_orig.getWidth()); // Resize the edge-map. // Init the displays +#if defined(VISP_HAVE_DISPLAY) const int horOffset = 20, vertOffset = 25; std::string skeletonTitle("Skeletonized image ("); skeletonTitle += (m_ratioSaltPepperNoise == 0 ? "without" : std::to_string(static_cast(m_ratioSaltPepperNoise * 100.)) + "%"); skeletonTitle += " noise)"; -#if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11) && defined(VISP_HAVE_DISPLAY) m_displayOrig = VISP_NAMESPACE_ADDRESSING vpDisplayFactory::createDisplay(m_I_orig, horOffset, vertOffset, "Original image"); m_displaySegmented = VISP_NAMESPACE_ADDRESSING vpDisplayFactory::createDisplay(m_I_segmented, 2 * horOffset + m_I_orig.getWidth(), vertOffset, "Segmented image"); m_displayNoisy = VISP_NAMESPACE_ADDRESSING vpDisplayFactory::createDisplay(m_IskeletonNoisy, 2 * horOffset + m_I_orig.getWidth(), 2 * vertOffset + m_I_orig.getHeight(), skeletonTitle); -#elif defined(VISP_HAVE_DISPLAY) - m_displayOrig = VISP_NAMESPACE_ADDRESSING vpDisplayFactory::allocateDisplay(m_I_orig, horOffset, vertOffset, "Original image"); - m_displaySegmented = VISP_NAMESPACE_ADDRESSING vpDisplayFactory::allocateDisplay(m_I_segmented, 2 * horOffset + m_I_orig.getWidth(), vertOffset, "Segmented image"); - m_displayNoisy = VISP_NAMESPACE_ADDRESSING vpDisplayFactory::allocateDisplay(m_IskeletonNoisy, 2 * horOffset + m_I_orig.getWidth(), 2 * vertOffset + m_I_orig.getHeight(), skeletonTitle); #endif return SOFTWARE_CONTINUE; } diff --git a/tutorial/particle-filter/tutorial-pf.cpp b/tutorial/particle-filter/tutorial-pf.cpp index 737ea9e21b..bcb5b48de7 100644 --- a/tutorial/particle-filter/tutorial-pf.cpp +++ b/tutorial/particle-filter/tutorial-pf.cpp @@ -740,6 +740,32 @@ int main(const int argc, const char *argv[]) double dtUKF = vpTime::measureTimeMs() - tUKF; //! [UKF_filtering] + // Get the filtered states + vpColVector XestPF = pfFilter.computeFilteredState(); + vpColVector XestUKF = ukf.getXest(); + + // Compute satistics + vpColVector cX_GT = cMw * object_pos; + vpColVector wX_UKF(4, 1.); + vpColVector wX_PF(4, 1.); + for (unsigned int i = 0; i < 3; ++i) { + wX_PF[i] = XestPF[i]; + wX_UKF[i] = XestUKF[i]; + } + vpColVector cX_PF = cMw * wX_PF; + vpColVector cX_UKF = cMw * wX_UKF; + vpColVector error_PF = cX_PF - cX_GT; + vpColVector error_UKF = cX_UKF - cX_GT; + + // Log statistics + std::cout << " [Particle Filter method] " << std::endl; + std::cout << " Norm of the error = " << error_PF.frobeniusNorm() << " m^2" << std::endl; + std::cout << " Fitting duration = " << dtPF << " ms" << std::endl; + + std::cout << " [Unscented Kalman Filter method] " << std::endl; + std::cout << " Norm of the error = " << error_UKF.frobeniusNorm() << " m^2" << std::endl; + std::cout << " Fitting duration = " << dtUKF << " ms" << std::endl; + //! [Update_displays] #ifdef VISP_HAVE_DISPLAY //! [Noisy_pose] @@ -763,37 +789,15 @@ int main(const int argc, const char *argv[]) plot.plot(0, 0, object_pos[0], object_pos[1]); // Plot the PF filtered state - vpColVector XestPF = pfFilter.computeFilteredState(); plot.plot(0, 1, XestPF[0], XestPF[1]); // Plot the UKF filtered state - vpColVector XestUKF = ukf.getXest(); plot.plot(0, 2, XestUKF[0], XestUKF[1]); // Plot the noisy pose plot.plot(0, 3, wXnoisy, wYnoisy); - vpColVector cX_GT = cMw * object_pos; - vpColVector wX_UKF(4, 1.); - vpColVector wX_PF(4, 1.); - for (unsigned int i = 0; i < 3; ++i) { - wX_PF[i] = XestPF[i]; - wX_UKF[i] = XestUKF[i]; - } - vpColVector cX_PF = cMw * wX_PF; - vpColVector cX_UKF = cMw * wX_UKF; - vpColVector error_PF = cX_PF - cX_GT; - vpColVector error_UKF = cX_UKF - cX_GT; - - std::cout << " [Particle Filter method] " << std::endl; - std::cout << " Norm of the error = " << error_PF.frobeniusNorm() << " m^2" << std::endl; - std::cout << " Fitting duration = " << dtPF << " ms" << std::endl; - - std::cout << " [Unscented Kalman Filter method] " << std::endl; - std::cout << " Norm of the error = " << error_UKF.frobeniusNorm() << " m^2" << std::endl; - std::cout << " Fitting duration = " << dtUKF << " ms" << std::endl; - // Plot the PF filtered state error plotError.plot(0, 0, t, error_PF.frobeniusNorm()); diff --git a/tutorial/tracking/model-based/generic-rgbd-blender/model/teabox/teabox_depth.xml b/tutorial/tracking/model-based/generic-rgbd-blender/model/teabox/teabox_depth.xml index 19bd860683..49808f5f4c 100644 --- a/tutorial/tracking/model-based/generic-rgbd-blender/model/teabox/teabox_depth.xml +++ b/tutorial/tracking/model-based/generic-rgbd-blender/model/teabox/teabox_depth.xml @@ -1,7 +1,7 @@ - 2 + 0 2 200 diff --git a/tutorial/tracking/model-based/generic-rgbd-blender/tutorial-mb-generic-tracker-rgbd-blender.cpp b/tutorial/tracking/model-based/generic-rgbd-blender/tutorial-mb-generic-tracker-rgbd-blender.cpp index 30b67c045c..683cd22e7c 100644 --- a/tutorial/tracking/model-based/generic-rgbd-blender/tutorial-mb-generic-tracker-rgbd-blender.cpp +++ b/tutorial/tracking/model-based/generic-rgbd-blender/tutorial-mb-generic-tracker-rgbd-blender.cpp @@ -410,7 +410,7 @@ int main(int argc, const char **argv) { std::stringstream ss; ss << "Features: edges " << tracker.getNbFeaturesEdge() << ", klt " << tracker.getNbFeaturesKlt() - << ", depth " << tracker.getNbFeaturesDepthDense(); + << ", dense depth " << tracker.getNbFeaturesDepthDense() << ", depth normals " << tracker.getNbFeaturesDepthNormal(); vpDisplay::displayText(I, I.getHeight() - 30, 20, ss.str(), vpColor::red); } } diff --git a/tutorial/tracking/render-based/render-based-tutorial-utils.h b/tutorial/tracking/render-based/render-based-tutorial-utils.h index a6bcd27ae7..5bc4db0da2 100644 --- a/tutorial/tracking/render-based/render-based-tutorial-utils.h +++ b/tutorial/tracking/render-based/render-based-tutorial-utils.h @@ -10,7 +10,6 @@ #include #include - #include #include #include @@ -42,7 +41,7 @@ using namespace VISP_NAMESPACE_NAME; struct BaseArguments { - BaseArguments() : trackerConfiguration(""), display(true), debugDisplay(false), enableRenderProfiling(false), maxDepthDisplay(1.f) { } + BaseArguments() : trackerConfiguration(""), maxDepthDisplay(1.f), display(true), debugDisplay(false), enableRenderProfiling(false) { } void registerArguments(vpJsonArgumentParser &parser) { @@ -164,7 +163,6 @@ class vpRBExperimentLogger iterLog["cMo"] = cMo; log.push_back(iterLog); - } void close() @@ -177,7 +175,6 @@ class vpRBExperimentLogger f.close(); } - private: bool enabled; std::string folder; @@ -188,19 +185,15 @@ class vpRBExperimentLogger vpImage ImaskOverlay; vpImage Iout; - bool videoEnabled; unsigned int framerate; vpVideoWriter videoWriter; - nlohmann::json log; - }; class vpRBExperimentPlotter { - public: vpRBExperimentPlotter() : enabled(false), plotPose(false), plotPose3d(false), plotDivergenceMetrics(false), plotCovariance(false) { } @@ -217,13 +210,10 @@ class vpRBExperimentPlotter void postProcessArguments(bool displayEnabled) { - enabled = plotPose || plotDivergenceMetrics || plotPose3d || plotCovariance; if (enabled && !displayEnabled) { throw vpException(vpException::badValue, "Tried to plot data, but display is disabled"); } - - } void init(std::vector> &displays) @@ -326,8 +316,6 @@ class vpRBExperimentPlotter vpPlot plotter; }; - - std::vector> createDisplays( vpImage &Id, vpImage &Icol, vpImage &depthDisplay, vpImage &probaDisplay) @@ -356,7 +344,6 @@ std::vector> createDisplays( ); } - void enableRendererProfiling() { if (PStatClient::is_connected()) { @@ -368,7 +355,6 @@ void enableRendererProfiling() if (!PStatClient::connect(host, port)) { std::cout << "Could not connect to PStat server." << std::endl; } - } void displayNormals(const vpImage &normalsImage, vpImage &normalDisplayImage) @@ -376,7 +362,7 @@ void displayNormals(const vpImage &normalsImage, vpImage &normal #ifdef VISP_HAVE_OPENMP #pragma omp parallel for #endif - for (int i = 0; i < normalsImage.getSize(); ++i) { + for (unsigned int i = 0; i < normalsImage.getSize(); ++i) { normalDisplayImage.bitmap[i].R = static_cast((normalsImage.bitmap[i].R + 1.0) * 127.5f); normalDisplayImage.bitmap[i].G = static_cast((normalsImage.bitmap[i].G + 1.0) * 127.5f); normalDisplayImage.bitmap[i].B = static_cast((normalsImage.bitmap[i].B + 1.0) * 127.5f); @@ -392,8 +378,8 @@ void displayCanny(const vpImage &cannyRawData, #ifdef VISP_HAVE_OPENMP #pragma omp parallel for #endif - for (int i = 0; i < cannyRawData.getSize(); ++i) { - vpRGBf &px = cannyRawData.bitmap[i]; + for (unsigned int i = 0; i < cannyRawData.getSize(); ++i) { + //vpRGBf &px = cannyRawData.bitmap[i]; canny.bitmap[i] = valid.bitmap[i] * 255; //canny.bitmap[i] = static_cast(127.5f + 127.5f * atan(px.B)); } diff --git a/tutorial/tracking/render-based/tutorial-rbt-realsense.cpp b/tutorial/tracking/render-based/tutorial-rbt-realsense.cpp index 0ef099127a..403b76d373 100644 --- a/tutorial/tracking/render-based/tutorial-rbt-realsense.cpp +++ b/tutorial/tracking/render-based/tutorial-rbt-realsense.cpp @@ -1,3 +1,4 @@ +//! \example tutorial-rbt-realsense.cpp #include #include @@ -197,9 +198,7 @@ int main(int argc, const char **argv) if (baseArgs.debugDisplay) { const vpRBFeatureTrackerInput &lastFrame = tracker.getMostRecentFrame(); - vpRBTrackerTutorial::displayCanny(lastFrame.renders.silhouetteCanny, cannyDisplay, lastFrame.renders.isSilhouette); - } vpDisplay::display(IdepthDisplay); diff --git a/tutorial/tracking/render-based/tutorial-rbt-sequence.cpp b/tutorial/tracking/render-based/tutorial-rbt-sequence.cpp index 9d950f7e5c..cc4e7853be 100644 --- a/tutorial/tracking/render-based/tutorial-rbt-sequence.cpp +++ b/tutorial/tracking/render-based/tutorial-rbt-sequence.cpp @@ -1,5 +1,4 @@ - - +//! \example tutorial-rbt-sequence.cpp #include #include #include @@ -16,8 +15,6 @@ using namespace VISP_NAMESPACE_NAME; #include "render-based-tutorial-utils.h" - - struct CmdArguments { CmdArguments() : startFrame(0), frameStep(1), stepByStep(false) @@ -49,7 +46,6 @@ struct CmdArguments bool stepByStep; }; - int main(int argc, const char **argv) { vpRBTrackerTutorial::BaseArguments baseArgs; @@ -157,7 +153,7 @@ int main(int argc, const char **argv) while (true) { double frameStart = vpTime::measureTimeMs(); // Acquire images - for (int sp = 0; sp < sequenceArgs.frameStep; sp++) { + for (unsigned int sp = 0; sp < sequenceArgs.frameStep; ++sp) { readerRGB.acquire(Icol); vpImageConvert::convert(Icol, Id); @@ -245,6 +241,4 @@ int main(int argc, const char **argv) logger.close(); return EXIT_SUCCESS; - - }