diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 932052f985..173363ec17 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -19,7 +19,7 @@ jobs: access_token: ${{ github.token }} - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Print system information run: lscpu @@ -31,7 +31,7 @@ jobs: run: dpkg --list | grep compiler - name: Install dependencies - run: sudo apt-get update && sudo apt-get install -y libx11-dev libdc1394-dev libv4l-dev liblapack-dev libopenblas-dev libeigen3-dev libopencv-dev lcov gcovr + 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 lcov gcovr - name: Clone visp-images env: @@ -46,7 +46,7 @@ jobs: run: | mkdir build cd build - cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_COVERAGE=ON + cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_COVERAGE=ON -DBUILD_DEPRECATED_FUNCTIONS=OFF cat ViSP-third-party.txt - name: Compile @@ -58,10 +58,22 @@ jobs: working-directory: build run: | lcov --zerocounters --directory . - cmake --build . --target all - cmake --build . --target test + cmake --build . --target all -j$(nproc) + cmake --build . --target test -j$(nproc) lcov --directory . --capture --output-file visp-coverage.info - lcov --remove visp-coverage.info '/usr/*' '/home/runner/work/visp/visp/3rdparty/*' --output-file visp-coverage.cleaned + lcov --remove visp-coverage.info \ + '/usr/*' \ + '*/private/*' \ + '*/test/*' \ + "/home/runner/work/visp/visp/3rdparty/*" \ + "/home/runner/work/visp/visp/demo/*" \ + "/home/runner/work/visp/visp/example/*" \ + "/home/runner/work/visp/visp/samples/*" \ + "/home/runner/work/visp/visp/modules/gui*" \ + "/home/runner/work/visp/visp/modules/io/src/parallel-port*" \ + "/home/runner/work/visp/visp/modules/robot*" \ + "/home/runner/work/visp/visp/modules/sensor*" \ + --output-file visp-coverage.cleaned - name: Upload report to Codecov uses: codecov/codecov-action@v2 diff --git a/.github/workflows/ios.yml b/.github/workflows/ios.yml index 5db4081160..c8e0432fd3 100644 --- a/.github/workflows/ios.yml +++ b/.github/workflows/ios.yml @@ -23,7 +23,7 @@ jobs: access_token: ${{ github.token }} - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Print system information run: | diff --git a/.github/workflows/macos-ustk.yml b/.github/workflows/macos-ustk.yml index 81c865cb35..7590fe1878 100644 --- a/.github/workflows/macos-ustk.yml +++ b/.github/workflows/macos-ustk.yml @@ -23,7 +23,7 @@ jobs: access_token: ${{ github.token }} - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Print system information run: | @@ -34,7 +34,7 @@ jobs: run: system_profiler SPSoftwareDataType - name: Install dependencies - run: brew install libpng libjpeg libdc1394 opencv pcl librealsense zbar vtk fftw armadillo + run: brew install libpng libjpeg libdc1394 opencv pcl librealsense zbar vtk fftw armadillo nlohmann-json - name: Clone visp-images env: @@ -42,7 +42,7 @@ jobs: # https://remarkablemark.org/blog/2022/09/25/check-git-branch-exists-in-remote-repository/ run: | git clone --depth 1 https://github.com/lagadic/visp-images ${HOME}/visp-images - echo "VISP_INPUT_IMAGE_PATH=$HOME" >> $GITHUB_ENV + echo "VISP_INPUT_IMAGE_PATH=$HOME/visp-images" >> $GITHUB_ENV echo ${VISP_INPUT_IMAGE_PATH} - name: Clone ustk-dataset diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index bb61576c66..2f4e351f10 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -23,7 +23,7 @@ jobs: access_token: ${{ github.token }} - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Print system information run: | @@ -34,7 +34,7 @@ jobs: run: system_profiler SPSoftwareDataType - name: Install dependencies - run: brew install libpng libjpeg libdc1394 opencv pcl librealsense zbar pkg-config + run: brew install libpng libjpeg libdc1394 opencv pcl librealsense zbar pkg-config nlohmann-json - name: Install java dependencies run: | @@ -49,7 +49,7 @@ jobs: # https://remarkablemark.org/blog/2022/09/25/check-git-branch-exists-in-remote-repository/ run: | git clone --depth 1 https://github.com/lagadic/visp-images ${HOME}/visp-images - echo "VISP_INPUT_IMAGE_PATH=$HOME" >> $GITHUB_ENV + echo "VISP_INPUT_IMAGE_PATH=$HOME/visp-images" >> $GITHUB_ENV echo ${VISP_INPUT_IMAGE_PATH} - name: Clone visp_sample @@ -76,7 +76,7 @@ jobs: - name: Run unit tests working-directory: build - run: ctest -j$(sysctl -n hw.logicalcpu) --output-on-failure + run: ctest -j$(sysctl -n hw.logicalcpu) --output-on-failure -V - name: ViSP as 3rdparty with cmake run: | @@ -111,7 +111,8 @@ jobs: run: | cd ${HOME}/visp_sample export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/tmp/usr/local/lib/pkgconfig - /tmp/usr/local/bin/visp-config --cflags - /tmp/usr/local/bin/visp-config --libs + export VISP_INSTALL_PREFIX=/tmp/usr/local + $VISP_INSTALL_PREFIX/bin/visp-config --cflags + $VISP_INSTALL_PREFIX/bin/visp-config --libs make -j$(sysctl -n hw.logicalcpu) -f Makefile.visp-config make -j$(sysctl -n hw.logicalcpu) -f Makefile.visp-config clean diff --git a/.github/workflows/other-arch-isolated.yml b/.github/workflows/other-arch-isolated.yml index 433c1f206d..71d9e8ed55 100644 --- a/.github/workflows/other-arch-isolated.yml +++ b/.github/workflows/other-arch-isolated.yml @@ -47,7 +47,7 @@ jobs: access_token: ${{ github.token }} - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Run on arch uses: uraimo/run-on-arch-action@v2.2.1 diff --git a/.github/workflows/other-arch.yml b/.github/workflows/other-arch.yml index 11478403c1..2818fda11a 100644 --- a/.github/workflows/other-arch.yml +++ b/.github/workflows/other-arch.yml @@ -45,7 +45,7 @@ jobs: access_token: ${{ github.token }} - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Run on arch uses: uraimo/run-on-arch-action@v2.1.1 @@ -64,7 +64,7 @@ jobs: 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 - export VISP_INPUT_IMAGE_PATH=$HOME + export VISP_INPUT_IMAGE_PATH=$HOME/visp-images echo ${VISP_INPUT_IMAGE_PATH} pwd diff --git a/.github/workflows/ubuntu-3rdparty.yml b/.github/workflows/ubuntu-3rdparty.yml index 05e7e1c402..c500260066 100644 --- a/.github/workflows/ubuntu-3rdparty.yml +++ b/.github/workflows/ubuntu-3rdparty.yml @@ -24,7 +24,7 @@ jobs: access_token: ${{ github.token }} - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Print system information run: lscpu @@ -37,11 +37,11 @@ jobs: - name: Install dependencies for ubuntu 18.04 and 20.04 if: matrix.os != 'ubuntu-22.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 + 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' - run: sudo apt-get update && sudo apt-get install -y libx11-dev libdc1394-dev libv4l-dev liblapack-dev libopenblas-dev libeigen3-dev libopencv-dev + 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 run: | diff --git a/.github/workflows/ubuntu-contrib.yml b/.github/workflows/ubuntu-contrib.yml index 6d0aba0aab..7a417e34d1 100644 --- a/.github/workflows/ubuntu-contrib.yml +++ b/.github/workflows/ubuntu-contrib.yml @@ -24,7 +24,7 @@ jobs: access_token: ${{ github.token }} - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Print system information run: lscpu @@ -37,11 +37,11 @@ jobs: - name: Install dependencies for ubuntu 18.04 and 20.04 if: matrix.os != 'ubuntu-22.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 + 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' - run: sudo apt-get update && sudo apt-get install -y libx11-dev libdc1394-dev libv4l-dev liblapack-dev libopenblas-dev libeigen3-dev libopencv-dev + 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 run: | diff --git a/.github/workflows/ubuntu-dep-apt.yml b/.github/workflows/ubuntu-dep-apt.yml index b8a5e60796..48f47dfcf2 100644 --- a/.github/workflows/ubuntu-dep-apt.yml +++ b/.github/workflows/ubuntu-dep-apt.yml @@ -25,7 +25,7 @@ jobs: access_token: ${{ github.token }} - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Print system information run: lscpu @@ -38,11 +38,11 @@ jobs: - name: Install dependencies for ubuntu 18.04 and 20.04 if: matrix.os != 'ubuntu-22.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 + 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' - run: sudo apt-get update && sudo apt-get install -y libx11-dev libdc1394-dev libv4l-dev liblapack-dev libopenblas-dev libeigen3-dev libopencv-dev + 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 env: @@ -50,7 +50,7 @@ jobs: # https://remarkablemark.org/blog/2022/09/25/check-git-branch-exists-in-remote-repository/ run: | git clone --depth 1 https://github.com/lagadic/visp-images ${HOME}/visp-images - echo "VISP_INPUT_IMAGE_PATH=$HOME" >> $GITHUB_ENV + echo "VISP_INPUT_IMAGE_PATH=$HOME/visp-images" >> $GITHUB_ENV echo ${VISP_INPUT_IMAGE_PATH} - name: Clone visp_sample @@ -104,9 +104,10 @@ jobs: run: | cd ${HOME}/visp_sample export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/tmp/usr/local/lib/pkgconfig + export VISP_INSTALL_PREFIX=/tmp/usr/local CC=${{ matrix.compiler.CC }} CXX=${{ matrix.compiler.CXX }} - /tmp/usr/local/bin/visp-config --cflags - /tmp/usr/local/bin/visp-config --libs + $VISP_INSTALL_PREFIX/bin/visp-config --cflags + $VISP_INSTALL_PREFIX/bin/visp-config --libs make CXX=${{ matrix.compiler.CXX }} -j$(nproc) -f Makefile.visp-config make CXX=${{ matrix.compiler.CXX }} -j$(nproc) -f Makefile.visp-config clean diff --git a/.github/workflows/ubuntu-dep-src.yml b/.github/workflows/ubuntu-dep-src.yml index c68fa9c05c..dff5233a84 100644 --- a/.github/workflows/ubuntu-dep-src.yml +++ b/.github/workflows/ubuntu-dep-src.yml @@ -23,7 +23,7 @@ jobs: access_token: ${{ github.token }} - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Print system information run: lscpu @@ -47,6 +47,7 @@ jobs: sudo apt-get install -y libx11-dev libv4l-dev gfortran liblapack-dev libeigen3-dev 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 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' @@ -117,7 +118,7 @@ jobs: # https://remarkablemark.org/blog/2022/09/25/check-git-branch-exists-in-remote-repository/ run: | git clone --depth 1 https://github.com/lagadic/visp-images ${HOME}/visp-images - echo "VISP_INPUT_IMAGE_PATH=$HOME" >> $GITHUB_ENV + echo "VISP_INPUT_IMAGE_PATH=$HOME/visp-images" >> $GITHUB_ENV echo ${VISP_INPUT_IMAGE_PATH} - name: Configure CMake diff --git a/.github/workflows/ubuntu-isolated.yml b/.github/workflows/ubuntu-isolated.yml index 116988dfa0..206d8130e2 100644 --- a/.github/workflows/ubuntu-isolated.yml +++ b/.github/workflows/ubuntu-isolated.yml @@ -26,7 +26,7 @@ jobs: access_token: ${{ github.token }} - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Print system information run: lscpu diff --git a/.github/workflows/sanitizers.yml b/.github/workflows/ubuntu-sanitizers.yml similarity index 87% rename from .github/workflows/sanitizers.yml rename to .github/workflows/ubuntu-sanitizers.yml index 0c3d1b9938..46bc99623a 100644 --- a/.github/workflows/sanitizers.yml +++ b/.github/workflows/ubuntu-sanitizers.yml @@ -25,7 +25,7 @@ jobs: access_token: ${{ github.token }} - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Print system information run: lscpu @@ -34,7 +34,12 @@ jobs: run: lsb_release -a - name: Install dependencies - run: sudo apt-get update && sudo apt-get install -y libx11-dev libdc1394-dev libv4l-dev liblapack-dev libopenblas-dev libeigen3-dev + run: sudo apt-get update && sudo apt-get install -y libx11-dev libdc1394-dev libv4l-dev liblapack-dev libblas-dev libeigen3-dev nlohmann-json3-dev + + - name: Linear algebra liblapack/libblas alternatives + run: | + update-alternatives --list liblapack.so.3-x86_64-linux-gnu + update-alternatives --list libblas.so.3-x86_64-linux-gnu - name: Clone visp-images env: @@ -42,14 +47,14 @@ jobs: # https://remarkablemark.org/blog/2022/09/25/check-git-branch-exists-in-remote-repository/ run: | git clone --depth 1 https://github.com/lagadic/visp-images ${HOME}/visp-images - echo "VISP_INPUT_IMAGE_PATH=$HOME" >> $GITHUB_ENV + echo "VISP_INPUT_IMAGE_PATH=$HOME/visp-images" >> $GITHUB_ENV echo ${VISP_INPUT_IMAGE_PATH} - name: Configure CMake run: | mkdir build cd build - cmake .. -DCMAKE_C_FLAGS=${{ matrix.flags }} -DCMAKE_CXX_FLAGS=${{ matrix.flags }} -DCMAKE_LDFLAGS=${{ matrix.flags }} -DCMAKE_BUILD_TYPE=Debug + cmake .. -DCMAKE_C_FLAGS=${{ matrix.flags }} -DCMAKE_CXX_FLAGS=${{ matrix.flags }} -DCMAKE_LDFLAGS=${{ matrix.flags }} -DCMAKE_BUILD_TYPE=RelWithDebInfo -DUSE_OPENMP=OFF cat ViSP-third-party.txt - name: Compile diff --git a/.github/workflows/ubuntu-ustk.yml b/.github/workflows/ubuntu-ustk.yml index 1682bec1af..23eea4f098 100644 --- a/.github/workflows/ubuntu-ustk.yml +++ b/.github/workflows/ubuntu-ustk.yml @@ -23,7 +23,7 @@ jobs: access_token: ${{ github.token }} - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Print system information run: lscpu @@ -36,11 +36,11 @@ jobs: - name: Install dependencies for ubuntu 18.04 and 20.04 if: matrix.os != 'ubuntu-22.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 + 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' - run: sudo apt-get update && sudo apt-get install -y libx11-dev libdc1394-dev libv4l-dev liblapack-dev libopenblas-dev libeigen3-dev libopencv-dev + 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 env: @@ -48,7 +48,7 @@ jobs: # https://remarkablemark.org/blog/2022/09/25/check-git-branch-exists-in-remote-repository/ run: | git clone --depth 1 https://github.com/lagadic/visp-images ${HOME}/visp-images - echo "VISP_INPUT_IMAGE_PATH=$HOME" >> $GITHUB_ENV + echo "VISP_INPUT_IMAGE_PATH=$HOME/visp-images" >> $GITHUB_ENV echo ${VISP_INPUT_IMAGE_PATH} - name: Clone ustk-dataset diff --git a/.github/workflows/valgrind.yml b/.github/workflows/valgrind.yml index 7e4db4029f..6095eb2034 100644 --- a/.github/workflows/valgrind.yml +++ b/.github/workflows/valgrind.yml @@ -19,7 +19,7 @@ jobs: access_token: ${{ github.token }} - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Print system information run: lscpu @@ -28,7 +28,7 @@ jobs: run: lsb_release -a - name: Install dependencies - run: sudo apt-get update && sudo apt-get install -y libx11-dev libdc1394-dev libv4l-dev liblapack-dev libopenblas-dev libeigen3-dev libopencv-dev valgrind + 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 valgrind - name: Clone visp-images env: @@ -36,7 +36,7 @@ jobs: # https://remarkablemark.org/blog/2022/09/25/check-git-branch-exists-in-remote-repository/ run: | git clone --depth 1 https://github.com/lagadic/visp-images ${HOME}/visp-images - echo "VISP_INPUT_IMAGE_PATH=$HOME" >> $GITHUB_ENV + echo "VISP_INPUT_IMAGE_PATH=$HOME/visp-images" >> $GITHUB_ENV echo ${VISP_INPUT_IMAGE_PATH} - name: Configure CMake diff --git a/.github/workflows/windows-clang.yaml b/.github/workflows/windows-clang.yaml new file mode 100644 index 0000000000..7868044bf9 --- /dev/null +++ b/.github/workflows/windows-clang.yaml @@ -0,0 +1,82 @@ +name: Windows - clang +on: + pull_request: + push: + +jobs: + build: + runs-on: ${{ matrix.os }} + defaults: + run: + shell: cmd + strategy: + fail-fast: false + matrix: + name: [windows-latest-clang] + + include: + - name: windows-latest-clang + os: windows-2022 + compiler: clang-cl + + steps: + # https://github.com/marketplace/actions/cancel-workflow-action + - name: Cancel Previous Runs + uses: styfle/cancel-workflow-action@0.9.1 + with: + access_token: ${{ github.token }} + + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Display the workspace path + working-directory: ${{ github.workspace }} + run: pwd + + - name: Clone visp-images + shell: bash + # https://remarkablemark.org/blog/2022/09/25/check-git-branch-exists-in-remote-repository/ + run: | + git clone --depth 1 https://github.com/lagadic/visp-images ${HOME}/visp-images + echo "VISP_INPUT_IMAGE_PATH=$HOME/visp-images" >> $GITHUB_ENV + echo "VISP_INPUT_IMAGE_PATH: ${{ env.VISP_INPUT_IMAGE_PATH }}" + + - name: Configure ViSP + working-directory: ${{ github.workspace }} + run: | + set VISP_INPUT_IMAGE_PATH=${{ env.VISP_INPUT_IMAGE_PATH }} + echo "VISP_INPUT_IMAGE_PATH: " + echo %VISP_INPUT_IMAGE_PATH% + mkdir build + cd build + cmake .. -G "Visual Studio 17 2022" -T "ClangCl" -A "x64" + type ViSP-third-party.txt + + - name: Build ViSP + working-directory: build + run: | + cmake --build . --config Release + + - name: Install ViSP + working-directory: build + run: | + cmake --build . --config Release --target install + + - name: Check installation folder + working-directory: build + run: | + dir ${{ github.workspace }}\build\install\ + dir ${{ github.workspace }}\build\install\x64\ + dir ${{ github.workspace }}\build\install\x64\vc17\ + dir ${{ github.workspace }}\build\install\x64\vc17\bin + + - name: Test ViSP + working-directory: build + run: | + set VISP_INPUT_IMAGE_PATH=${{ env.VISP_INPUT_IMAGE_PATH }} + echo "VISP_INPUT_IMAGE_PATH: " + echo %VISP_INPUT_IMAGE_PATH% + set PATH=%PATH%;${{ github.workspace }}\build\install\x64\vc17\bin + echo "PATH: " + echo %PATH% + ctest --output-on-failure -C Release -V diff --git a/.github/workflows/windows-msvc.yaml b/.github/workflows/windows-msvc.yaml new file mode 100644 index 0000000000..4a3b846ce3 --- /dev/null +++ b/.github/workflows/windows-msvc.yaml @@ -0,0 +1,77 @@ +name: Windows - Visual 2019 +on: + pull_request: + push: + +jobs: + build: + runs-on: ${{ matrix.os }} + defaults: + run: + shell: cmd + strategy: + fail-fast: false + matrix: + name: [windows-latest] + + include: + - name: windows-latest + os: windows-2019 + + steps: + # https://github.com/marketplace/actions/cancel-workflow-action + - name: Cancel Previous Runs + uses: styfle/cancel-workflow-action@0.9.1 + with: + access_token: ${{ github.token }} + + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Display the workspace path + working-directory: ${{ github.workspace }} + run: pwd + + - name: Clone visp-images + shell: bash + # https://remarkablemark.org/blog/2022/09/25/check-git-branch-exists-in-remote-repository/ + run: | + git clone --depth 1 https://github.com/lagadic/visp-images ${HOME}/visp-images + echo "VISP_INPUT_IMAGE_PATH=$HOME/visp-images" >> $GITHUB_ENV + + - name: Configure ViSP + working-directory: ${{ github.workspace }} + run: | + set VISP_INPUT_IMAGE_PATH=${{ env.VISP_INPUT_IMAGE_PATH }} + echo "VISP_INPUT_IMAGE_PATH: " + echo %VISP_INPUT_IMAGE_PATH% + mkdir build + cd build + cmake .. -G "Visual Studio 16 2019" -A "x64" + type ViSP-third-party.txt + + - name: Build ViSP + working-directory: build + run: | + cmake --build . --config Release + + - name: Install ViSP + working-directory: build + run: | + cmake --build . --config Release --target install + + - name: Check installation folder + working-directory: build + run: | + dir ${{ github.workspace }}\build\install\x64\vc16\bin + + - name: Test ViSP + working-directory: build + run: | + set VISP_INPUT_IMAGE_PATH=${{ env.VISP_INPUT_IMAGE_PATH }} + echo "VISP_INPUT_IMAGE_PATH: " + echo %VISP_INPUT_IMAGE_PATH% + set PATH=%PATH%;${{ github.workspace }}\build\install\x64\vc16\bin + echo "PATH: " + echo %PATH% + ctest --output-on-failure -C Release -V diff --git a/.gitignore b/.gitignore index 0fdc41b205..9ff307aa99 100644 --- a/.gitignore +++ b/.gitignore @@ -6,7 +6,7 @@ CMakeLists.txt.user* platforms/ios/build_framework.pyc *.bak *.pyc +*.pdf modules/java/\.idea/ .scannerwork build -.vscode diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000000..1a735c4e79 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,131 @@ +{ + "editor.tabSize": 2, + "C_Cpp.vcFormat.indent.braces": false, + "C_Cpp.vcFormat.newLine.beforeOpenBrace.block": "sameLine", + "C_Cpp.vcFormat.newLine.beforeOpenBrace.namespace": "newLine", + "C_Cpp.vcFormat.newLine.beforeOpenBrace.type": "newLine", + "C_Cpp.vcFormat.newLine.closeBraceSameLine.emptyFunction": true, + "C_Cpp.vcFormat.newLine.closeBraceSameLine.emptyType": true, + "C_Cpp.vcFormat.space.beforeInitializerListOpenBrace": true, + "C_Cpp.vcFormat.space.betweenEmptyBraces": true, + "C_Cpp.clang_format_style": "Visual Studio", + "C_Cpp.vcFormat.newLine.beforeOpenBrace.function": "newLine", + "C_Cpp.vcFormat.space.pointerReferenceAlignment": "right", + "C_Cpp.vcFormat.space.beforeEmptySquareBrackets": false, + "C_Cpp.vcFormat.space.beforeOpenSquareBracket": false, + "files.associations": { + "bitset": "cpp", + "optional": "cpp", + "*.in": "cpp", + "cctype": "cpp", + "clocale": "cpp", + "cmath": "cpp", + "csignal": "cpp", + "cstdarg": "cpp", + "cstddef": "cpp", + "cstdio": "cpp", + "cstdlib": "cpp", + "cstring": "cpp", + "ctime": "cpp", + "cwchar": "cpp", + "cwctype": "cpp", + "array": "cpp", + "atomic": "cpp", + "strstream": "cpp", + "bit": "cpp", + "*.tcc": "cpp", + "chrono": "cpp", + "codecvt": "cpp", + "complex": "cpp", + "condition_variable": "cpp", + "cstdint": "cpp", + "deque": "cpp", + "forward_list": "cpp", + "list": "cpp", + "map": "cpp", + "set": "cpp", + "unordered_map": "cpp", + "unordered_set": "cpp", + "vector": "cpp", + "exception": "cpp", + "algorithm": "cpp", + "functional": "cpp", + "iterator": "cpp", + "memory": "cpp", + "memory_resource": "cpp", + "numeric": "cpp", + "random": "cpp", + "ratio": "cpp", + "regex": "cpp", + "string": "cpp", + "string_view": "cpp", + "system_error": "cpp", + "tuple": "cpp", + "type_traits": "cpp", + "utility": "cpp", + "hash_map": "cpp", + "hash_set": "cpp", + "fstream": "cpp", + "future": "cpp", + "initializer_list": "cpp", + "iomanip": "cpp", + "iosfwd": "cpp", + "iostream": "cpp", + "istream": "cpp", + "limits": "cpp", + "mutex": "cpp", + "new": "cpp", + "ostream": "cpp", + "shared_mutex": "cpp", + "sstream": "cpp", + "stdexcept": "cpp", + "streambuf": "cpp", + "thread": "cpp", + "cfenv": "cpp", + "cinttypes": "cpp", + "typeindex": "cpp", + "typeinfo": "cpp", + "valarray": "cpp", + "variant": "cpp", + "__bit_reference": "cpp", + "__bits": "cpp", + "__config": "cpp", + "__debug": "cpp", + "__errc": "cpp", + "__hash_table": "cpp", + "__locale": "cpp", + "__mutex_base": "cpp", + "__node_handle": "cpp", + "__split_buffer": "cpp", + "__threading_support": "cpp", + "__tree": "cpp", + "__tuple": "cpp", + "__verbose_abort": "cpp", + "ios": "cpp", + "locale": "cpp", + "queue": "cpp", + "stack": "cpp", + "__nullptr": "cpp", + "__string": "cpp", + "compare": "cpp", + "concepts": "cpp", + "*.ipp": "cpp" + }, + "C_Cpp.vcFormat.indent.namespaceContents": false, + "editor.formatOnSave": true, + "C_Cpp.vcFormat.indent.accessSpecifiers": false, + "C_Cpp.vcFormat.indent.preserveWithinParentheses": true, + "C_Cpp.vcFormat.indent.preprocessor": "leftmostColumn", + "C_Cpp.vcFormat.indent.multiLineRelativeTo": "innermostParenthesis", + "C_Cpp.vcFormat.indent.withinParentheses": "alignToParenthesis", + "editor.detectIndentation": false, + "files.trimTrailingWhitespace": true, + "files.trimFinalNewlines": true, + "editor.defaultFormatter": "ms-vscode.cpptools", + "editor.formatOnSaveMode": "file", + "C_Cpp.formatting": "vcFormat", + "C_Cpp.vcFormat.space.aroundBinaryOperator": "ignore", + "editor.comments.insertSpace": true, + "C_Cpp.vcFormat.indent.preserveComments": true, + "C_Cpp.doxygen.generatedStyle": "/*!" +} diff --git a/3rdparty/clapack/CMakeLists.txt b/3rdparty/clapack/CMakeLists.txt index b8f4699e88..21e86557a7 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) +if(MSVC AND NOT ((CMAKE_CXX_COMPILER MATCHES "clang") 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/clapack/src/dlasrt.c b/3rdparty/clapack/src/dlasrt.c index 5df285c3a7..206285513f 100644 --- a/3rdparty/clapack/src/dlasrt.c +++ b/3rdparty/clapack/src/dlasrt.c @@ -85,7 +85,7 @@ /* .. */ /* .. Executable Statements .. */ -/* Test the input paramters. */ +/* Test the input parameters. */ /* Parameter adjustments */ --d__; diff --git a/3rdparty/pthreads4w/WinCE-PORT b/3rdparty/pthreads4w/WinCE-PORT index 28e5034388..88a3621722 100644 --- a/3rdparty/pthreads4w/WinCE-PORT +++ b/3rdparty/pthreads4w/WinCE-PORT @@ -1,5 +1,5 @@ NOTE: The comments in this file relate to the original WinCE port -done by Tristan Savatier. The semaphore routines have been +done by Tristan Savatier. The semaphore routines have been completely rewritten since (2005-04-25), having been progressively broken more and more by changes to the library. All of the semaphore routines implemented for W9x/WNT/2000 and up should now also work for @@ -152,7 +152,7 @@ to detect the case of multiple calls to __ptw32_processInitialize. Rational: In order to debug pthread-win32, it is easier to compile it as a regular library (it is not possible to debug DLL's on winCE). In that case, the application must call __ptw32_rocessInitialize() -explicitely, to initialize pthread-win32. It is safer in this circumstance +explicitly, to initialize pthread-win32. It is safer in this circumstance to handle the case where __ptw32_processInitialize() is called on an already initialized library: @@ -160,10 +160,10 @@ int __ptw32_processInitialize (void) { if (__ptw32_processInitialized) { - /* - * ignore if already initialized. this is useful for + /* + * ignore if already initialized. this is useful for * programs that uses a non-dll pthread - * library. such programs must call __ptw32_processInitialize() explicitely, + * library. such programs must call __ptw32_processInitialize() explicitly, * since this initialization routine is automatically called only when * the dll is loaded. */ diff --git a/3rdparty/pthreads4w/pthread.h b/3rdparty/pthreads4w/pthread.h index f35a39b571..ab267a4e0e 100644 --- a/3rdparty/pthreads4w/pthread.h +++ b/3rdparty/pthreads4w/pthread.h @@ -444,7 +444,7 @@ enum PTHREAD_SCOPE_PROCESS = 0, PTHREAD_SCOPE_SYSTEM = 1, /* Default */ /* - * pthread_setcancelstate paramters + * pthread_setcancelstate parameters */ PTHREAD_CANCEL_ENABLE = 0, /* Default */ PTHREAD_CANCEL_DISABLE = 1, diff --git a/3rdparty/qbdevice/README.txt b/3rdparty/qbdevice/README.txt index e008396b00..0d3b6713f4 100644 --- a/3rdparty/qbdevice/README.txt +++ b/3rdparty/qbdevice/README.txt @@ -1,3 +1,7 @@ These files are part of https://bitbucket.org/qbrobotics/qbdevice-ros.git and located in qb_device_driver/api/src/* +Below we give the list of the main changes introduced for ViSP + +- 2023.09.12 (see PR #1230) + - Fix compatibility with Debian GNU/Hurd adding __gnu_hurd__ macro to specialize the code \ No newline at end of file diff --git a/3rdparty/qbdevice/qbmove_communications.cpp b/3rdparty/qbdevice/qbmove_communications.cpp index a9091949eb..1d85d1643f 100644 --- a/3rdparty/qbdevice/qbmove_communications.cpp +++ b/3rdparty/qbdevice/qbmove_communications.cpp @@ -64,11 +64,11 @@ #include #endif -#if !(defined(_WIN32) || defined(_WIN64)) && !(defined(__APPLE__)) && !(defined(__FreeBSD__)) +#if !(defined(_WIN32) || defined(_WIN64)) && !(defined(__APPLE__)) && !(defined(__FreeBSD__)) && !(defined(__gnu_hurd__)) #include #endif -#if (defined(__FreeBSD__)) +#if defined(__FreeBSD__) || defined(__gnu_hurd__) #include #endif @@ -320,7 +320,7 @@ void openRS485(comm_settings *comm_settings_t, const char *port_s, int BAUD_RATE goto error; } -#if (defined __APPLE__) || (defined __FreeBSD__) +#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__gnu_hurd__) // set baud rate if (BAUD_RATE > 460800){ diff --git a/3rdparty/simdlib/CMakeLists.txt b/3rdparty/simdlib/CMakeLists.txt index 6260825803..b3a56b4f80 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) + if(MSVC AND NOT ((CMAKE_CXX_COMPILER MATCHES "clang") 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() @@ -136,6 +136,11 @@ if(X86 OR X86_64) if(HAVE_NO_MISSING_FIELD_FLAG) 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"))) + # Clang under windows needs AVX flags + set(COMMON_CXX_FLAGS "${COMMON_CXX_FLAGS} ${AVX_FLAG} ${AVX2_FLAG}") + endif() endif() file(GLOB_RECURSE SIMD_BASE_SRC ${CMAKE_CURRENT_SOURCE_DIR}/Simd/SimdBase*.cpp) @@ -148,22 +153,10 @@ if(X86 OR X86_64) set_source_files_properties(${SIMD_SSE41_SRC} PROPERTIES COMPILE_FLAGS "${COMMON_CXX_FLAGS} ${SSE4_2_FLAG}") file(GLOB_RECURSE SIMD_AVX1_SRC ${CMAKE_CURRENT_SOURCE_DIR}/Simd/SimdAvx1*.cpp) - if(MSVC) - set_source_files_properties(${SIMD_AVX1_SRC} PROPERTIES COMPILE_FLAGS "${COMMON_CXX_FLAGS} ${AVX_FLAG}") - elseif((CMAKE_CXX_COMPILER MATCHES "clang") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang")) - set_source_files_properties(${SIMD_AVX1_SRC} PROPERTIES COMPILE_FLAGS "${COMMON_CXX_FLAGS} ${AVX_FLAG}") - else() - set_source_files_properties(${SIMD_AVX1_SRC} PROPERTIES COMPILE_FLAGS "${COMMON_CXX_FLAGS} ${AVX_FLAG}") - endif() + set_source_files_properties(${SIMD_AVX1_SRC} PROPERTIES COMPILE_FLAGS "${COMMON_CXX_FLAGS} ${AVX_FLAG}") file(GLOB_RECURSE SIMD_AVX2_SRC ${CMAKE_CURRENT_SOURCE_DIR}/Simd/SimdAvx2*.cpp) - if(MSVC) - set_source_files_properties(${SIMD_AVX2_SRC} PROPERTIES COMPILE_FLAGS "${COMMON_CXX_FLAGS} ${AVX2_FLAG}") - elseif((CMAKE_CXX_COMPILER MATCHES "clang") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang")) - set_source_files_properties(${SIMD_AVX2_SRC} PROPERTIES COMPILE_FLAGS "${COMMON_CXX_FLAGS} ${AVX2_FLAG}") - else() - set_source_files_properties(${SIMD_AVX2_SRC} PROPERTIES COMPILE_FLAGS "${COMMON_CXX_FLAGS} ${AVX2_FLAG}") - endif() + set_source_files_properties(${SIMD_AVX2_SRC} PROPERTIES COMPILE_FLAGS "${COMMON_CXX_FLAGS} ${AVX2_FLAG}") set(SIMD_LIB_FLAGS "${COMMON_CXX_FLAGS} ${AVX2_FLAG}") set(SIMD_ALG_SRC ${SIMD_BASE_SRC} ${SIMD_SSE2_SRC} ${SIMD_SSE41_SRC} ${SIMD_AVX1_SRC} ${SIMD_AVX2_SRC}) diff --git a/3rdparty/simdlib/README.ViSP.md b/3rdparty/simdlib/README.ViSP.md index f227030ea1..79631cdb84 100644 --- a/3rdparty/simdlib/README.ViSP.md +++ b/3rdparty/simdlib/README.ViSP.md @@ -1,5 +1,8 @@ Here we give the list of the main changes introduced in Simdlib for ViSP +- 2023.09.12 (see PR #1230) + - Fix compatibility with Debian GNU/Hurd defining PATH_MAX macro + - 2022.10.19: (see PR #1108) - Update Simd lib using https://github.com/ermig1979/Simd diff --git a/3rdparty/simdlib/Simd/SimdBaseCpu.cpp b/3rdparty/simdlib/Simd/SimdBaseCpu.cpp index 94ce0e3b20..ab0cf38d6f 100755 --- a/3rdparty/simdlib/Simd/SimdBaseCpu.cpp +++ b/3rdparty/simdlib/Simd/SimdBaseCpu.cpp @@ -60,182 +60,169 @@ #endif #endif +#ifndef PATH_MAX +#ifdef _MAX_PATH +#define PATH_MAX _MAX_PATH +#else +#define PATH_MAX 1024 +#endif +#endif + #else # error Do not know how to detect CPU info #endif -namespace Simd -{ - namespace Base - { +namespace Simd { + namespace Base { #if defined(SIMD_X86_ENABLE) || defined(SIMD_X64_ENABLE) - bool CheckBit(int eax, int ecx, Cpuid::Register index, Cpuid::Bit bit) - { - unsigned int registers[4] = { 0, 0, 0, 0 }; + bool CheckBit(int eax, int ecx, Cpuid::Register index, Cpuid::Bit bit) { + unsigned int registers[4] = { 0, 0, 0, 0 }; #if defined(_MSC_VER) - __cpuidex((int*)registers, eax, ecx); + __cpuidex((int*)registers, eax, ecx); #elif (defined __GNUC__) - if (__get_cpuid_max(0, NULL) < eax) - return false; - __cpuid_count(eax, ecx, - registers[Cpuid::Eax], - registers[Cpuid::Ebx], - registers[Cpuid::Ecx], - registers[Cpuid::Edx]); + if (__get_cpuid_max(0, NULL) < eax) + return false; + __cpuid_count(eax, ecx, + registers[Cpuid::Eax], + registers[Cpuid::Ebx], + registers[Cpuid::Ecx], + registers[Cpuid::Edx]); #else #error Do not know how to detect CPU info! #endif - return (registers[index] & bit) == bit; - } + return (registers[index] & bit) == bit; + } #endif//defined(SIMD_X86_ENABLE) || defined(SIMD_X64_ENABLE) #if defined(__GNUC__) && (defined(SIMD_PPC_ENABLE) || defined(SIMD_PPC64_ENABLE) || defined(SIMD_ARM_ENABLE) || defined(SIMD_ARM64_ENABLE)) && !defined(__APPLE__) - bool CheckBit(int at, int bit) - { - bool result = false; - int file = ::open("/proc/self/auxv", O_RDONLY); - if (file < 0) - return false; - const ssize_t size = 64; - unsigned long buffer[size]; - for (ssize_t count = size; count == size;) - { - count = ::read(file, buffer, sizeof(buffer)) / sizeof(unsigned long); - for (int i = 0; i < count; i += 2) - { - if (buffer[i] == (unsigned)at) - { - result = !!(buffer[i + 1] & bit); - count = 0; - } - if (buffer[i] == AT_NULL) - count = 0; - } + bool CheckBit(int at, int bit) { + bool result = false; + int file = ::open("/proc/self/auxv", O_RDONLY); + if (file < 0) + return false; + const ssize_t size = 64; + unsigned long buffer[size]; + for (ssize_t count = size; count == size;) { + count = ::read(file, buffer, sizeof(buffer)) / sizeof(unsigned long); + for (int i = 0; i < count; i += 2) { + if (buffer[i] == (unsigned)at) { + result = !!(buffer[i + 1] & bit); + count = 0; } - ::close(file); - return result; + if (buffer[i] == AT_NULL) + count = 0; + } } + ::close(file); + return result; + } #endif//defined(__GNUC__) && (defined(SIMD_PPC_ENABLE) || defined(SIMD_PPC64_ENABLE) || defined(SIMD_ARM_ENABLE) || defined(SIMD_ARM64_ENABLE)) && !defined(__APPLE__) #ifdef SIMD_CPP_2011_ENABLE - size_t CpuThreadNumber() - { - return std::thread::hardware_concurrency(); - } + size_t CpuThreadNumber() { + return std::thread::hardware_concurrency(); + } #endif #if defined(_MSC_VER) - typedef SYSTEM_LOGICAL_PROCESSOR_INFORMATION Info; - - void GetLogicalProcessorInformation(std::vector & info) - { - DWORD size = 0; - ::GetLogicalProcessorInformation(0, &size); - info.resize(size / sizeof(Info)); - ::GetLogicalProcessorInformation(info.data(), &size); + typedef SYSTEM_LOGICAL_PROCESSOR_INFORMATION Info; + + void GetLogicalProcessorInformation(std::vector& info) { + DWORD size = 0; + ::GetLogicalProcessorInformation(0, &size); + info.resize(size / sizeof(Info)); + ::GetLogicalProcessorInformation(info.data(), &size); + } + + size_t CpuSocketNumber() { + std::vector info; + GetLogicalProcessorInformation(info); + size_t number = 0; + for (size_t i = 0; i < info.size(); ++i) + if (info[i].Relationship == ::RelationNumaNode) + number++; + return number; + } + + size_t CpuCoreNumber() { + std::vector info; + GetLogicalProcessorInformation(info); + size_t number = 0; + for (size_t i = 0; i < info.size(); ++i) + if (info[i].Relationship == ::RelationProcessorCore) + number++; + return number; + } + + size_t CpuCacheSize(size_t level) { + std::vector info; + GetLogicalProcessorInformation(info); + for (size_t i = 0; i < info.size(); ++i) + if (info[i].Relationship == ::RelationCache && info[i].Cache.Level == level && (info[i].Cache.Type == ::CacheData || info[i].Cache.Type == CacheUnified)) + return info[i].Cache.Size; + return 0; + } +#elif defined(__GNUC__) + size_t CpuSocketNumber() { + uint32_t number = 0; + ::FILE* p = ::popen("lscpu -b -p=Socket 2>/dev/null | grep -v '^#' | sort -u 2>/dev/null | wc -l 2>/dev/null", "r"); + if (p) { + char buffer[PATH_MAX]; + while (::fgets(buffer, PATH_MAX, p)); + number = ::atoi(buffer); + ::pclose(p); } - - size_t CpuSocketNumber() - { - std::vector info; - GetLogicalProcessorInformation(info); - size_t number = 0; - for (size_t i = 0; i < info.size(); ++i) - if (info[i].Relationship == ::RelationNumaNode) - number++; - return number; + return number; + } + + size_t CpuCoreNumber() { + uint32_t number = 0; + ::FILE* p = ::popen("lscpu -b -p=Core 2>/dev/null | grep -v '^#' | sort -u 2>/dev/null | wc -l 2>/dev/null", "r"); + if (p) { + char buffer[PATH_MAX]; + while (::fgets(buffer, PATH_MAX, p)); + number = ::atoi(buffer); + ::pclose(p); } + return number; + } - size_t CpuCoreNumber() - { - std::vector info; - GetLogicalProcessorInformation(info); - size_t number = 0; - for (size_t i = 0; i < info.size(); ++i) - if (info[i].Relationship == ::RelationProcessorCore) - number++; - return number; - } + SIMD_INLINE size_t CorrectIfZero(size_t value, size_t otherwise) { + return value ? value : otherwise; + } - size_t CpuCacheSize(size_t level) - { - std::vector info; - GetLogicalProcessorInformation(info); - for (size_t i = 0; i < info.size(); ++i) - if (info[i].Relationship == ::RelationCache && info[i].Cache.Level == level && (info[i].Cache.Type == ::CacheData || info[i].Cache.Type == CacheUnified)) - return info[i].Cache.Size; - return 0; - } -#elif defined(__GNUC__) - size_t CpuSocketNumber() +#if defined(_SC_LEVEL1_DCACHE_SIZE) && defined(_SC_LEVEL2_CACHE_SIZE) && defined(_SC_LEVEL3_CACHE_SIZE) + size_t CpuCacheSize(size_t level) { + switch (level) { + case 1: { - uint32_t number = 0; - ::FILE * p = ::popen("lscpu -b -p=Socket 2>/dev/null | grep -v '^#' | sort -u 2>/dev/null | wc -l 2>/dev/null", "r"); - if (p) - { - char buffer[PATH_MAX]; - while (::fgets(buffer, PATH_MAX, p)); - number = ::atoi(buffer); - ::pclose(p); - } - return number; + const size_t sz = ::sysconf(_SC_LEVEL1_DCACHE_SIZE) < 0 ? 0 : ::sysconf(_SC_LEVEL1_DCACHE_SIZE); + return CorrectIfZero(sz, 32 * 1024); } - - size_t CpuCoreNumber() + case 2: { - uint32_t number = 0; - ::FILE * p = ::popen("lscpu -b -p=Core 2>/dev/null | grep -v '^#' | sort -u 2>/dev/null | wc -l 2>/dev/null", "r"); - if (p) - { - char buffer[PATH_MAX]; - while (::fgets(buffer, PATH_MAX, p)); - number = ::atoi(buffer); - ::pclose(p); - } - return number; + const size_t sz = ::sysconf(_SC_LEVEL2_CACHE_SIZE) < 0 ? 0 : ::sysconf(_SC_LEVEL2_CACHE_SIZE); + return CorrectIfZero(sz, 256 * 1024); } - - SIMD_INLINE size_t CorrectIfZero(size_t value, size_t otherwise) + case 3: { - return value ? value : otherwise; + const size_t sz = ::sysconf(_SC_LEVEL3_CACHE_SIZE) < 0 ? 0 : ::sysconf(_SC_LEVEL3_CACHE_SIZE); + return CorrectIfZero(sz, 2048 * 1024); } - -#if defined(_SC_LEVEL1_DCACHE_SIZE) && defined(_SC_LEVEL2_CACHE_SIZE) && defined(_SC_LEVEL3_CACHE_SIZE) - size_t CpuCacheSize(size_t level) - { - switch (level) - { - case 1: - { - const size_t sz = ::sysconf(_SC_LEVEL1_DCACHE_SIZE) < 0 ? 0 : ::sysconf(_SC_LEVEL1_DCACHE_SIZE); - return CorrectIfZero(sz, 32 * 1024); - } - case 2: - { - const size_t sz = ::sysconf(_SC_LEVEL2_CACHE_SIZE) < 0 ? 0 : ::sysconf(_SC_LEVEL2_CACHE_SIZE); - return CorrectIfZero(sz, 256 * 1024); - } - case 3: - { - const size_t sz = ::sysconf(_SC_LEVEL3_CACHE_SIZE) < 0 ? 0 : ::sysconf(_SC_LEVEL3_CACHE_SIZE); - return CorrectIfZero(sz, 2048 * 1024); - } - default: - return 0; - } + default: + return 0; } + } #else - size_t CpuCacheSize(size_t level) - { - switch (level) - { - case 1: return 32 * 1024; - case 2: return 256 * 1024; - case 3: return 2048 * 1024; - default: - return 0; - } + size_t CpuCacheSize(size_t level) { + switch (level) { + case 1: return 32 * 1024; + case 2: return 256 * 1024; + case 3: return 2048 * 1024; + default: + return 0; } + } #endif #else @@ -243,15 +230,14 @@ namespace Simd #endif } - namespace Cpu - { - const size_t SOCKET_NUMBER = Base::CpuSocketNumber(); - const size_t CORE_NUMBER = Base::CpuCoreNumber(); + namespace Cpu { + const size_t SOCKET_NUMBER = Base::CpuSocketNumber(); + const size_t CORE_NUMBER = Base::CpuCoreNumber(); #ifdef SIMD_CPP_2011_ENABLE - const size_t THREAD_NUMBER = Base::CpuThreadNumber(); + const size_t THREAD_NUMBER = Base::CpuThreadNumber(); #endif - const size_t L1_CACHE_SIZE = Base::CpuCacheSize(1); - const size_t L2_CACHE_SIZE = Base::CpuCacheSize(2); - const size_t L3_CACHE_SIZE = Base::CpuCacheSize(3); + const size_t L1_CACHE_SIZE = Base::CpuCacheSize(1); + const size_t L2_CACHE_SIZE = Base::CpuCacheSize(2); + const size_t L3_CACHE_SIZE = Base::CpuCacheSize(3); } -} + } diff --git a/CMakeLists.txt b/CMakeLists.txt index f1b7c34b22..52b6d125fa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ ############################################################################# # # ViSP, open source Visual Servoing Platform software. -# Copyright (C) 2005 - 2022 by Inria. All rights reserved. +# Copyright (C) 2005 - 2023 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 @@ -14,7 +14,7 @@ # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://visp.inria.fr for more information. +# See https://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique @@ -31,9 +31,6 @@ # Description: # ViSP overall configuration file. Detect third party libraries (X11, GTK, ...) # -# Authors: -# Fabien Spindler -# ############################################################################# # Detect crosscompiling; need to be before project(VISP) to work @@ -81,7 +78,7 @@ if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." FORCE) endif() -cmake_minimum_required(VERSION 3.0) # needs to be before project() for policy CMP0025 +cmake_minimum_required(VERSION 3.5) # needs to be before project() for policy CMP0025 # Detect if the toolchain is for Aldebaran naoqi if(CMAKE_TOOLCHAIN_FILE AND I_AM_A_ROBOT) @@ -284,7 +281,7 @@ VP_OPTION(ENABLE_SSE2 "" "" "Enable SSE2 instructions" "" ON IF ((MSVC OR CMAK VP_OPTION(ENABLE_SSE3 "" "" "Enable SSE3 instructions" "" ON IF ((MSVC OR CMAKE_COMPILER_IS_GNUCXX) AND (X86 OR X86_64)) ) VP_OPTION(ENABLE_SSSE3 "" "" "Enable SSSE3 instructions" "" ON IF ((MSVC OR CMAKE_COMPILER_IS_GNUCXX) AND (X86_64)) ) # X86 disabled since it produces an issue on Debian i386 if(X86_64) - VP_OPTION(ENABLE_AVX "" "" "Enable AVX instructions" "" OFF) # should be explicitely enabled, used in matrix transpose code + VP_OPTION(ENABLE_AVX "" "" "Enable AVX instructions" "" OFF) # should be explicitly enabled, used in matrix transpose code endif() #---------------------------------------------------------------------- @@ -333,12 +330,13 @@ endif() # add the path to detect Ogre3D if(WIN32) list(APPEND CMAKE_MODULE_PATH "${OGRE_DIR}/cmake") - list(APPEND CMAKE_MODULE_PATH "${OGRE_DIR}/CMake") + list(APPEND CMAKE_MODULE_PATH "${OGRE_DIR}") endif(WIN32) if(UNIX) list(APPEND CMAKE_MODULE_PATH "${OGRE_DIR}/cmake") list(APPEND CMAKE_MODULE_PATH "${OGRE_DIR}/CMake") + list(APPEND CMAKE_MODULE_PATH "${OGRE_DIR}") list(APPEND CMAKE_MODULE_PATH "/usr/local/lib/OGRE/cmake") list(APPEND CMAKE_MODULE_PATH "/usr/lib/OGRE/cmake") list(APPEND CMAKE_MODULE_PATH "/usr/local/lib64/OGRE/cmake") @@ -384,40 +382,15 @@ if(WIN32) endif() endif() -# Add library ws2_32.a or ws2_32.lib for vpNetwork class if(WIN32 AND NOT CYGWIN) - if(MINGW) - set(WS2_32_LIBRARY "ws2_32.a") - check_library_exists(${WS2_32_LIBRARY} getch "" HAVE_LIBWS2_32) # for inet_ntoa() and socket functionalities - if(HAVE_LIBWS2_32) - list(APPEND VISP_LINKER_LIBS ${WS2_32_LIBRARY}) - else() - find_library(HAVE_LIBWS2_32 ${WS2_32_LIBRARY} - "$ENV{MINGW_DIR}/lib" - "$ENV{MINGW_DIR}/mingw/lib" - C:/mingw/mingw/lib) - if(HAVE_LIBWS2_32) - list(APPEND VISP_LINKER_LIBS "${WS2_32_LIBRARY}") - endif() - endif() - elseif(WINRT) - # Since check_library_exists() and find_library() does't work to detect ws2_32.lib we add the lib that is part of Windows SDK - set(WS2_32_LIBRARY "ws2_32.lib") - list(APPEND VISP_LINKER_LIBS ${WS2_32_LIBRARY}) - else() # pure WIN32 - set(WS2_32_LIBRARY "ws2_32.lib") - #check_library_exists("ws2_32.lib" getch "" HAVE_LIBWS2_32) # for inet_ntoa() and socket functionalities - check_library_exists(${WS2_32_LIBRARY} getch "" HAVE_LIBWS2_32) # for inet_ntoa() and socket functionalities - if(HAVE_LIBWS2_32) - list(APPEND VISP_LINKER_LIBS ${WS2_32_LIBRARY}) - endif() - endif() - mark_as_advanced(HAVE_LIBWS2_32) + VP_CHECK_PACKAGE(WS2_32) + # Should be before include(cmake/VISPDetectCXXStandard.cmake) + VP_CHECK_FUNCTION_EXISTS(inet_ntop "${WS2_32_LIBRARY}") +else() + # Should be before include(cmake/VISPDetectCXXStandard.cmake) + VP_CHECK_FUNCTION_EXISTS(inet_ntop "") endif() -# Should be before include(cmake/VISPDetectCXXStandard.cmake) -VP_CHECK_FUNCTION_EXISTS(inet_ntop "${VISP_LINKER_LIBS}") - #-------------------------------------------------------------------- # Option management #-------------------------------------------------------------------- @@ -573,19 +546,18 @@ if(SOQT_FOUND) # SoQt < 1.6.0 that depends on Qt4 was found. We need an explicit VP_OPTION(USE_QT Qt "" "Include Coin/SoQt/Qt support" "" ON IF USE_SOQT AND NOT WINRT AND NOT IOS) endif() VP_OPTION(USE_SOXT SOXT "" "Include Coin/SoXt support" "" OFF IF USE_COIN3D AND NOT WINRT AND NOT IOS) -if (ANDROID) - VP_OPTION(USE_PTHREAD Threads "" "Include pthread support" "" ON) -else() - VP_OPTION(USE_PTHREAD PTHREAD "" "Include pthread support" "" ON) -endif() +set(THREADS_PREFER_PTHREAD_FLAG ON) +VP_OPTION(USE_PTHREAD Threads "" "Include pthread support" "" ON IF NOT (WIN32 OR MINGW)) + # We need threads with c++11 if((VISP_CXX_STANDARD GREATER VISP_CXX_STANDARD_98) AND NOT USE_PTHREAD) - if(Threads_FOUND OR PTHREAD_FOUND) + if(Threads_FOUND) message(WARNING "We need threads. Turn USE_PTHREAD=ON.") unset(USE_PTHREAD) set(USE_PTHREAD ON CACHE BOOL "Include pthread support" FORCE) endif() endif() + VP_OPTION(USE_XML2 XML2 "" "Include xml support" "" ON IF NOT WINRT) if(CMAKE_TOOLCHAIN_FILE) # Find opencv2.framework for ios and naoqi @@ -610,6 +582,7 @@ VP_OPTION(USE_ZBAR ZBAR "" "Include zbar support" "" O VP_OPTION(USE_DMTX DMTX "" "Include dmtx support" "" ON IF NOT WINRT AND NOT IOS) VP_OPTION(USE_PCL PCL QUIET "Include Point Cloud Library support" "" ON IF NOT WINRT AND NOT IOS) VP_OPTION(USE_TENSORRT TensorRT "" "Include TensorRT support" "" ON IF NOT WINRT AND NOT IOS) +VP_OPTION(USE_NLOHMANN_JSON nlohmann_json QUIET "Include nlohmann json support" "" ON) # ---------------------------------------------------------------------------- # Handle cxx standard depending on specific 3rd parties. Should be before module parsing and VISP3rdParty.cmake include @@ -702,6 +675,7 @@ VP_CHECK_PACKAGE(IsInf) VP_CHECK_PACKAGE(Round) VP_CHECK_PACKAGE(Erfc) VP_CHECK_PACKAGE(Strtof) +VP_CHECK_PACKAGE(IsFinite) VP_CHECK_PACKAGE(Log1p) #---------------------------------------------------------------------- @@ -918,6 +892,7 @@ VP_SET(VISP_HAVE_PTHREAD TRUE IF (BUILD_MODULE_visp_core AND USE_PTHREAD)) VP_SET(VISP_HAVE_XML2 TRUE IF (BUILD_MODULE_visp_core AND USE_XML2)) VP_SET(VISP_HAVE_PCL TRUE IF (BUILD_MODULE_visp_core AND USE_PCL)) VP_SET(VISP_HAVE_TENSORRT TRUE IF (BUILD_MODULE_visp_core AND USE_TENSORRT)) +VP_SET(VISP_HAVE_NLOHMANN_JSON TRUE IF (BUILD_MODULE_visp_core AND USE_NLOHMANN_JSON)) VP_SET(VISP_HAVE_OGRE TRUE IF (BUILD_MODULE_visp_ar AND USE_OGRE)) VP_SET(VISP_HAVE_OIS TRUE IF (BUILD_MODULE_visp_ar AND USE_OIS)) @@ -1042,12 +1017,6 @@ if(USE_OPENCV) message(STATUS "opencv nonfree not found") set(VISP_HAVE_OPENCV_VERSION "(0)") # for vpConfig.h endif() - if(OPENCV_DNN_FOUND) - set(VISP_HAVE_OPENCV_DNN TRUE) # for header vpConfig.h - endif() - if(OPENCV_OBJDETECT_FOUND) - set(VISP_HAVE_OPENCV_OBJDETECT TRUE) # for header vpConfig.h - endif() endif() # coin and gui @@ -1515,6 +1484,14 @@ status(" Build with moment combine:" ENABLE_MOMENTS_COMBINE_MATRICES THEN "y # ===================== Optional 3rd parties ===================== status("") +status(" OpenCV: ") +status(" Version:" USE_OPENCV THEN "${OpenCV_VERSION}" ELSE "n/a") +if(USE_OPENCV) + vp_list_replace_string(OpenCV_LIB_COMPONENTS OpenCV_LIB_COMPONENTS_FILTERED "^opencv_+" "") + status(" Modules:" "${OpenCV_LIB_COMPONENTS_FILTERED}") + status(" OpenCV dir:" "${OpenCV_DIR}") +endif() +status("") status(" Mathematics: ") status(" Blas/Lapack:" (USE_LAPACK OR WITH_LAPACK) THEN "yes" ELSE "no") status(" \\- Use MKL:" USE_MKL THEN "yes" ELSE "no") @@ -1617,6 +1594,7 @@ status(" Misc: ") status(" Use Clipper (built-in):" WITH_CLIPPER THEN "yes (ver ${CLIPPER_VERSION})" ELSE "no") status(" Use pugixml (built-in):" "yes (ver ${PUGIXML_VERSION})") status(" Use libxml2:" USE_XML2 THEN "yes (ver ${XML2_VERSION_STRING})" ELSE "no") +status(" Use json (nlohmann):" USE_NLOHMANN_JSON THEN "yes (ver ${nlohmann_json_VERSION})" ELSE "no") status("") status(" Optimization: ") status(" Use OpenMP:" USE_OPENMP THEN "yes" ELSE "no") diff --git a/CTestConfig.cmake b/CTestConfig.cmake index 44b702f6ec..10adf905ff 100644 --- a/CTestConfig.cmake +++ b/CTestConfig.cmake @@ -1,7 +1,7 @@ ############################################################################# # # ViSP, open source Visual Servoing Platform software. -# Copyright (C) 2005 - 2019 by Inria. All rights reserved. +# Copyright (C) 2005 - 2023 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 @@ -14,7 +14,7 @@ # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://visp.inria.fr for more information. +# See https://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique @@ -31,9 +31,6 @@ # Description: # CDash configuration. # -# Authors: -# Fabien Spindler -# ############################################################################# set(CTEST_PROJECT_NAME "ViSP") diff --git a/ChangeLog.txt b/ChangeLog.txt index d08ffa4b45..88b1bede12 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -7,22 +7,50 @@ ViSP 3.5.1 (under development) - Contributors: - . Fabien Spindler, Souriya Trinh, Romain Lagneau, Antonio Marino, Samuel Felton + . Fabien Spindler, Souriya Trinh, Romain Lagneau, Antonio Marino, Samuel Felton, + Francois Chaumette, Olivier Roussel, Julien Dufour, Joudy Nader + - New classes + . vpMocapVicon an interface over Vicon motion capture system + . vpMocapQualisys an interface over Qualisys motion capture system + . vpPclViewer that enables real time plotting of 3D point clouds based on PCL library + . vpRobotUniversalRobots that allows to control an Universal Robots robot + . vpRobotMavsdk that allows to control a robot equipped with a Pixhawk (drone, rover...) + . vpDetectorDNNOpenCV a wrapper over the OpenCV DNN module that allows + to detect objects using Faster-RCNN, SSD-MobileNet, ResNet 10, Yolo v3, Yolo v4, + Yolo v5, Yolo v7 and Yolo v8 convolutional networks + . vpImageCircle that refers to a 2D circle in an image + . vpCircleHoughTransform that allows to detect circles in an image + . vpCannyEdgeDetection that allows to detect Canny edges without using OpenCV + . vpMegaPose and vpMegaPoseTracker classes that are wrapper over MegaPose + https://megapose6d.github.io/ that allows 6D pose estimation using a DNN approach - New features and improvements . Video writer is now able to create the output folder recursively (see vpVideoWriter) - . Introduce Universal Robots support with new vpRobotUniversalRobots class that - allows to control an UR robot - . Introduce Vicon and Qualisys motion capture system interfaces in vpMocapVicon and - vpMocapQualisys classes respectively - . Image-based and position-based examples with UR robot + . New image-based and position-based examples with UR robot . Tutorial for extrinsic calibration improved with UR robot and Panda robot use cases . Tutorials in tutorial/grabber folder have now a new --no-display command line option that allows to grab a video remotely . Introduce MAVLink interface using MAVSDK 3rd party library interfaced in vpRobotMavsdk - class that allows to control a robot equiped with a Pixhawk (drone, rover...) + class that allows to control a robot equipped with a Pixhawk (drone, rover...) . Image-based visual-servoing, position and velocity control examples to control robots equipped with Pixhawk (see vpRobotMavsdk doc) . Windows 11 support + . New capabilities to ease C++ inference to detect objects using convolutional networks + (see vpDetectorDNNOpenCV) + . Support of JSON for modern C++ third-party to enable serialization capabilities + in vpArray2D, vpCameraParameters, vpCircleHoughTransform, vpColVector, vpDetectorDNNOpenCV, + vpHomogeneousMatrix, vpMbGenericTracker, vpMe, vpPolygon3D, vpPoseVector to load/save + internal data or settings from/to JSON files + . Remove deprecated OpenCV IplImage interfaces + . Remove deprecated vpOpenCVGrabber, vpKeyPointSurf classes and corresponding + tutorials + . Minimum OpenCV version is 2.4.8 + . Introduce a new moving-edges threshold parameter for the contrast between each side + of the feature to track. Its value corresponds to a gray level in range [0; 255] + . In moving-edges ellipse tracker (vpMeEllipse and vpMbTracker and its derived classes), + change sample step parameter to consider the distance between moving-edges in pixels + rather than an angular value in deg as it was in the previous releases + . ViSP is available as a Conda package + . Fix compatibility with Debian GNU/Hurd - Tutorials . New tutorial to list all the hardware (robot, camera, depth camera, lidar, mocap, haptic devices, F/T sensor) supported by ViSP @@ -37,11 +65,29 @@ ViSP 3.5.1 (under development) https://visp-doc.inria.fr/doxygen/visp-daily/tutorial-universal-robot-pbvs.html . New tutorial: Image-based visual-servoing on a drone equipped with a Pixhawk https://visp-doc.inria.fr/doxygen/visp-daily/tutorial-pixhawk-vs.html - . New Tutorial: Installation from source for Windows 11 with MinGW-w64 + . New tutorial: Installation from source for Windows 11 with MinGW-w64 https://visp-doc.inria.fr/doxygen/visp-daily/tutorial-install-win11-mingw-w64.html - . New Tutorial: Installation from source for Windows 11 with Visual C++ 2022 (vc17) + . New tutorial: Installation from source for Windows 11 with Visual C++ 2022 (vc17) https://visp-doc.inria.fr/doxygen/visp-daily/tutorial-install-win11-msvc17.html + . New tutorial: Deep learning object detection + https://visp-doc.inria.fr/doxygen/visp-daily/tutorial-detection-dnn.html + . New tutorial: Using JSON serialization to save your data and read program arguments + https://visp-doc.inria.fr/doxygen/visp-daily/tutorial-json.html + . New tutorial: Loading a model-based generic tracker from JSON + https://visp-doc.inria.fr/doxygen/visp-daily/tutorial-mb-generic-json.html + . New tutorial: Threaded PCL viewer + https://visp-doc.inria.fr/doxygen/visp-daily/tutorial-pcl-viewer.html + . New tutorial: Tracking with MegaPose + https://visp-doc.inria.fr/doxygen/visp-daily/tutorial-tracking-megapose.html + . New tutorial: Exporting a 3D model to MegaPose after reconstruction with NeRF + https://visp-doc.inria.fr/doxygen/visp-daily/tutorial-megapose-model.html + . New tutorial: Generating synthetic data for deep learning with Blenderproc + https://visp-doc.inria.fr/doxygen/visp-daily/tutorial-synthetic-blenderproc.html + . New tutorial: Gradient-based Circle Hough Transform + https://visp-doc.inria.fr/doxygen/visp-daily/tutorial-imgproc-cht.html - Bug fixed + . [#1041] [example/device/framegrabber/saveRealSenseData] Wrong camera parameters + and depth_M_color homogeneous matrix when aligned depth is requested . [#1042] testColorConversion.cpp segfault randomly . [#1045] CXX standard not propagated when using pkg-config or visp-config . [#1046] vpIoTools::getParent() returns an empty string when folder separator is not found @@ -51,6 +97,11 @@ ViSP 3.5.1 (under development) . [#1094] vpIoTools::makeTempDirectory() fails to create a temporary directory inside a parent directory on Unix . [#1106] SIFT Illegal Instruction error on macOS Intel with OpenCV 4.6.0 installed with brew + . [#1155] Wrong representation of the ellipse in model-based tracker + . [#1160] MBT does not estimate dof set by the user using vpMbTracker::setEstimatedDoF() + . [#1176] ViSP cannot be built with a subset of OpenCV modules + . [#1198] Unable to save multiple cameras in a same xml file + . [#1228] Unable to use visp conda package to link visp as a 3rd party ---------------------------------------------- ViSP 3.5.0 (released February 15, 2022) - Contributors: @@ -159,7 +210,7 @@ ViSP 3.4.0 (released February 26, 2021) . [#763] VISP does not support the latest PCL release 1.11.0 . [#767] Compile from source on Ubuntu Focal raises CMake error with Ogre 1.9 or 2.1 . [#777] Issue when calling vpMatrix::eigenValues() using lapack built-in - . [#780] Projects have to explicitely link against Boost when compiling ViSP with ar module + . [#780] Projects have to explicitly link against Boost when compiling ViSP with ar module . [#781] Wrong share install path on unix-like system . [#785] Static variable in vpServo . [#787] Unable to build simdlib 3rd party for iOS @@ -590,7 +641,7 @@ ViSP 3.0.0 (released December 18th, 2015) . Compatibility with Odroid XU4 . Source code migrates to GitHub: http://github.com/lagadic/visp . Introduce Travis continuous integration - . New website: http://visp.inria.fr + . New website: https://visp.inria.fr . Reorganize source in modules (core, vision, mbt, tt, …) with a library per module named libvisp_. Keep compat with previous releases. . Allow to link contributions to ViSP source code using @@ -648,7 +699,7 @@ ViSP 3.0.0 (released December 18th, 2015) . [19326] segfault when using vpDisplayX::init(unsigned int, unsigned int, ...) . [19368] Invalid rotation parameters in vpSimulatorViper850::getPosition() . [#3] Issue when comparing two vpRGBa - . [#5] Unable to get calibration matrix K when model with distorsion is + . [#5] Unable to get calibration matrix K when model with distortion is used . [#6] Issue with vpMath::round() . [#18] Issues with vpColVector::median() + with assignment operator of @@ -790,7 +841,7 @@ ViSP 2.8.0 (released July 24th, 2013) tracing when faces are concave or not oriented counter clockwise. . Still in model-based trackers, add functionalities to use clipping planes. . ViSP can now be used with pkg-config - . New fonctions in vp1394TwoGrabber to turn auto shutter and auto gain + . New functions in vp1394TwoGrabber to turn auto shutter and auto gain on. Also new getter for auto shutter and auto gain min/max values. . Support Visual Studio 2012 (MSVC11) . Introduce C++ visibility support as described here @@ -889,7 +940,7 @@ ViSP 2.6.2 (released July 15, 2012) - New vpClient and vpServer classes for a multiclients TCP network. - New vpPoseFeatures class for pose computation from any visual features. To be able to consider other user defined features the compiler should - be compatible with C++ 11 standart. + be compatible with C++ 11 standard. - Improvements - Introduce a new Denavit Hartenberg representation of the Biclops head in vpBiclops. @@ -1163,7 +1214,7 @@ ViSP 2.4.4-rc1 (released December 21th, 2009) - [7994] vpMeLine : initialization problem for horizontal lines - [8001] Coin and SoQt are not detected during CMake configuration under Fedora 10 - - [8032] Link error whith GSL while compiling HelloWorld.cpp on OSX + - [8032] Link error with GSL while compiling HelloWorld.cpp on OSX - [8225] Bug in the multiplication of a twist matrix (6x6) by a matrix (6xn) - [8248] Compilation error under Windows MSCV8 if deprecated functions are not build @@ -1318,7 +1369,7 @@ ViSP 2.4.2 (released March 27th, 2008) in your programs. Otherwise an exception vpServoException::notKilledProperly is launched by vpServo::~vpServo() destructor. - - vpMatrix : Change Infinity Norm and Euclidian Norm formula to match with + - vpMatrix : Change Infinity Norm and Euclidean Norm formula to match with the standard matrix norms definitions. Change determinant formula for 3x3 matrices to match with the standard determinant definition. diff --git a/INSTALL.txt b/INSTALL.txt index 0d9b5a7d89..db8fca5ef9 100644 --- a/INSTALL.txt +++ b/INSTALL.txt @@ -1,14 +1,14 @@ ViSP Visual Servoing Platform - Copyright (C) 2005 - 2021 by Inria. All rights reserved. + Copyright (C) 2005 - 2023 by Inria. All rights reserved. https://visp.inria.fr INSTALL howto for the ViSP library -QUICKINSTALL: +QUICKINSTALL: > get ViSP source > install CMake (see http://www.cmake.org) > cmake . @@ -22,13 +22,13 @@ projects. To do the installation, you don't need to be root. Building ViSP with CMake ------------------------ -Prerequsits: +Prerequsits: (1) Install newest cmake release from http://www.cmake.org (2) checkout/install ViSP source code. -(3) configure -run cmake to change options and to generate makefiles. +(3) configure +run cmake to change options and to generate makefiles. example for a build on Linux: cd to source directory of ViSP @@ -42,11 +42,11 @@ See the bottom line for usage instructions, in particular: - finally press 'g' to generate Makefiles On Win32: -> CMakeSetup.exe +> CMakeSetup.exe The GUI is self-explaining. Note: -You can also use +You can also use > cmake . directly if you prefer command line instead of graphical interface. @@ -64,7 +64,7 @@ Copy visp-config shell script in ${CMAKE_INSTALL_PREFIX}/bin > make uninstall Dual from install. Remove headers in ${CMAKE_INSTALL_PREFIX}/include -Remove library and cmake files in ${CMAKE_INSTALL_PREFIX}/lib +Remove library and cmake files in ${CMAKE_INSTALL_PREFIX}/lib Remove visp-config shell script in ${CMAKE_INSTALL_PREFIX}/bin (7) clean: diff --git a/README.md b/README.md index 22d9926244..68eddc51f5 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@

ViSP: Open source Visual Servoing Platform

[![Github Releases](https://img.shields.io/github/release/lagadic/visp.svg)](https://github.com/lagadic/visp/releases) -[![License](https://img.shields.io/badge/License-GPLv2-bright)](https://opensource.org/licenses/GPL-2.0) +[![License](https://eddelbuettel.github.io/badges/GPL2+.svg)](https://opensource.org/license/gpl-2-0/) Platform | Build Status | -------- | ------------ | @@ -9,16 +9,13 @@ Ubuntu 18.04, 20.04, 22.04 (amd64)| [![ubuntu dep apt workflow](https://github.c macOS 11 and 12 | [![macos workflow](https://github.com/lagadic/visp/actions/workflows/macos.yml/badge.svg)](https://github.com/lagadic/visp/actions/workflows/macos.yml) iOS on macOS 11.0| [![ios workflow](https://github.com/lagadic/visp/actions/workflows/ios.yml/badge.svg)](https://github.com/lagadic/visp/actions/workflows/ios.yml) Windows 10 | [![Build status](https://ci.appveyor.com/api/projects/status/121dscdkryf5dbn0/branch/master?svg=true)](https://ci.appveyor.com/project/fspindle/visp/branch/master) -ARM | [![Build Status](https://cloud.drone.io/api/badges/lagadic/visp/status.svg)](https://cloud.drone.io/lagadic/visp) -Other arch Ubuntu 20.04 (aarch64, s390x)| [![other arch workflow](https://github.com/lagadic/visp/actions/workflows/other-arch.yml/badge.svg)](https://github.com/lagadic/visp/actions/workflows/other-arch.yml) -ROS Melodic Ubuntu 18.04 Bionic | [![Build Status](https://build.ros.org/buildStatus/icon?job=Mdev__visp__ubuntu_bionic_amd64)](https://build.ros.org/job/Mdev__visp__ubuntu_bionic_amd64) -ROS Noetic Ubuntu 20.04 Focal | [![Build Status](https://build.ros.org/buildStatus/icon?job=Ndev__visp__ubuntu_focal_amd64)](https://build.ros.org/job/Ndev__visp__ubuntu_focal_amd64/) -ROS Noetic Debian 10.13 Buster | [![Build Status](https://build.ros.org/buildStatus/icon?job=Ndev_db__visp__debian_buster_amd64)](https://build.ros.org/job/Ndev_db__visp__debian_buster_amd64) -ROS2 Foxy Ubuntu 20.04 Focal| [![Build Status](https://build.ros2.org/buildStatus/icon?job=Fdev__visp__ubuntu_focal_amd64)](https://build.ros2.org/job/Fdev__visp__ubuntu_focal_amd64/) -ROS2 Galactic Ubuntu 20.04 Focal| [![Build Status](https://build.ros2.org/buildStatus/icon?job=Gdev__visp__ubuntu_focal_amd64)](https://build.ros2.org/job/Gdev__visp__ubuntu_focal_amd64/) +Other arch Ubuntu 22.04 (aarch64, s390x)| [![other arch workflow](https://github.com/lagadic/visp/actions/workflows/other-arch.yml/badge.svg)](https://github.com/lagadic/visp/actions/workflows/other-arch.yml) +ROS1 Noetic Ubuntu 20.04 Focal | [![Build Status](https://build.ros.org/buildStatus/icon?job=Ndev__visp__ubuntu_focal_amd64)](https://build.ros.org/job/Ndev__visp__ubuntu_focal_amd64/) +ROS2 Humble Ubuntu 22.04 Jammy| [![Build Status](https://build.ros2.org/buildStatus/icon?job=Hdev__visp__ubuntu_jammy_amd64)](https://build.ros2.org/job/Hdev__visp__ubuntu_jammy_amd64/) +ROS2 Iron Ubuntu 22.04 Jammy| [![Build Status](https://build.ros2.org/buildStatus/icon?job=Idev__visp__ubuntu_jammy_amd64)](https://build.ros2.org/job/Idev__visp__ubuntu_jammy_amd64/) ROS2 Rolling Ubuntu 22.04 Jammy| [![Build Status](https://build.ros2.org/buildStatus/icon?job=Rdev__visp__ubuntu_jammy_amd64)](https://build.ros2.org/job/Rdev__visp__ubuntu_jammy_amd64) Valgrind | [![valgrind workflow](https://github.com/lagadic/visp/actions/workflows/valgrind.yml/badge.svg)](https://github.com/lagadic/visp/actions/workflows/valgrind.yml) -Sanitizer | [![sanitizers workflow](https://github.com/lagadic/visp/actions/workflows/sanitizers.yml/badge.svg)](https://github.com/lagadic/visp/actions/workflows/sanitizers.yml) +Sanitizer | [![sanitizers workflow](https://github.com/lagadic/visp/actions/workflows/ubuntu-sanitizers.yml/badge.svg)](https://github.com/lagadic/visp/actions/workflows/ubuntu-sanitizers.yml) Code coverage | [![Code coverage](https://codecov.io/gh/lagadic/visp/branch/master/graph/badge.svg?token=GQIiKbA3BC)](https://codecov.io/gh/lagadic/visp) Other projects | Build Status | @@ -60,13 +57,13 @@ To cite the generic model-based tracker: ``` #### Resources -- Homepage: http://visp.inria.fr +- Homepage: https://visp.inria.fr - Wiki: https://github.com/lagadic/visp/wiki -- Code documentation: http://visp-doc.inria.fr/doxygen/visp-daily -- Q&A forum: http://gforge.inria.fr/forum/?group_id=397 +- Code documentation: https://visp-doc.inria.fr/doxygen/visp-daily +- Q&A forum: https://github.com/lagadic/visp/discussions - Issue tracking: https://github.com/lagadic/visp/issues - YouTube: https://www.youtube.com/user/VispTeam #### Contributing -Please read before starting work on a pull request: http://visp.inria.fr/contributing-code/ +Please read before starting work on a pull request: https://visp.inria.fr/contributing-code/ diff --git a/appveyor.yml b/appveyor.yml index 792ba14a14..ad766e90ec 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -21,7 +21,7 @@ environment: matrix: - TARGET: mingw - - TARGET: msvc + # - TARGET: msvc - TARGET: uwp - TARGET: visp_sample @@ -130,7 +130,7 @@ build_script: - if "%TARGET%"=="msvc" ctest --output-on-failure # uwp case - - if "%TARGET%"=="uwp" cmake -G "Visual Studio 15 2017" -A %platform% -DCMAKE_SYSTEM_NAME:String=WindowsStore -DCMAKE_SYSTEM_VERSION:String="10.0" -DBUILD_DEMOS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_TESTS=OFF -DBUILD_TUTORIALS=OFF ..\visp + - if "%TARGET%"=="uwp" cmake -G "Visual Studio 15 2017" -A %platform% -DCMAKE_SYSTEM_NAME="WindowsStore" -DCMAKE_SYSTEM_VERSION="10.0" -DBUILD_DEMOS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_TESTS=OFF -DBUILD_TUTORIALS=OFF ..\visp - if "%TARGET%"=="uwp" cmake --build . --config %configuration% -- /m:2 # visp_sample case: ViSP as 3rdparty with cmake diff --git a/cmake/AddExtraCompilationFlags.cmake b/cmake/AddExtraCompilationFlags.cmake index 0924064d0a..95f15d0d29 100644 --- a/cmake/AddExtraCompilationFlags.cmake +++ b/cmake/AddExtraCompilationFlags.cmake @@ -1,7 +1,7 @@ ############################################################################# # # ViSP, open source Visual Servoing Platform software. -# Copyright (C) 2005 - 2019 by Inria. All rights reserved. +# Copyright (C) 2005 - 2023 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 @@ -14,7 +14,7 @@ # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://visp.inria.fr for more information. +# See https://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique @@ -31,9 +31,6 @@ # Description: # ViSP overall configuration file. Add extra compilation flags. # -# Authors: -# Fabien Spindler -# ############################################################################# # Warning: here ViSPDetectPlatform.cmake should be called before this file to set ARM var used below @@ -45,14 +42,14 @@ macro(add_extra_compiler_option option) if(CMAKE_BUILD_TYPE) set(CMAKE_TRY_COMPILE_CONFIGURATION ${CMAKE_BUILD_TYPE}) endif() - vp_check_flag_support(CXX "${option}" _varname "") + vp_check_flag_support(CXX "${option}" _varname "${VISP_EXTRA_CXX_FLAGS} ${ARGN}") if(_varname) - list(APPEND VISP_EXTRA_CXX_FLAGS ${option}) + set(VISP_EXTRA_CXX_FLAGS "${VISP_EXTRA_CXX_FLAGS} ${option}") endif() - vp_check_flag_support(C "${option}" _varname "") + vp_check_flag_support(C "${option}" _varname "${VISP_EXTRA_C_FLAGS} ${ARGN}") if(_varname) - list(APPEND VISP_EXTRA_C_FLAGS ${option}) + set(VISP_EXTRA_C_FLAGS "${VISP_EXTRA_C_FLAGS} ${option}") endif() endmacro() @@ -86,9 +83,11 @@ if(CMAKE_COMPILER_IS_GNUCXX OR MINGW OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") # add_extra_compiler_option_enabling(-Wfloat-equal ACTIVATE_WARNING_FLOAT_EQUAL OFF) add_extra_compiler_option_enabling(-Wsign-conversion ACTIVATE_WARNING_SIGN_CONVERSION OFF) add_extra_compiler_option_enabling(-Wshadow ACTIVATE_WARNING_SHADOW OFF) + add_extra_compiler_option_enabling(-ffast-math ENABLE_FAST_MATH OFF) elseif(MSVC) # Add specific compilation flags for Windows Visual add_extra_compiler_option_enabling(/Wall ACTIVATE_WARNING_ALL OFF) + add_extra_compiler_option_enabling(/fp:fast ENABLE_FAST_MATH OFF) if(MSVC80 OR MSVC90 OR MSVC10 OR MSVC11 OR MSVC14) # To avoid compiler warning (level 4) C4571, compile with /EHa if you still want # your catch(...) blocks to catch structured exceptions. @@ -114,6 +113,12 @@ if(USE_OPENMP) add_extra_compiler_option("${OpenMP_CXX_FLAGS}") endif() +if(USE_PTHREAD) + if(THREADS_HAVE_PTHREAD_ARG) + add_extra_compiler_option("-pthread") + endif() +endif() + if((VISP_CXX_STANDARD EQUAL VISP_CXX_STANDARD_11) AND CXX11_CXX_FLAGS) add_extra_compiler_option("${CXX11_CXX_FLAGS}") elseif((VISP_CXX_STANDARD EQUAL VISP_CXX_STANDARD_14) AND CXX14_CXX_FLAGS) @@ -127,7 +132,9 @@ if(BUILD_COVERAGE) endif() if(CMAKE_COMPILER_IS_GNUCXX) - add_extra_compiler_option(-fvisibility=hidden) + #if(NOT (WIN32 AND ((CMAKE_CXX_COMPILER MATCHES "clang") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang")))) + add_extra_compiler_option(-fvisibility=hidden) + #endif() if(ENABLE_AVX AND X86_64) add_extra_compiler_option(-mavx) @@ -179,6 +186,59 @@ 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/CPackConfig.cmake b/cmake/CPackConfig.cmake index 7176fac3fe..e66cfcf3f1 100644 --- a/cmake/CPackConfig.cmake +++ b/cmake/CPackConfig.cmake @@ -1,7 +1,7 @@ ############################################################################# # # ViSP, open source Visual Servoing Platform software. -# Copyright (C) 2005 - 2019 by Inria. All rights reserved. +# Copyright (C) 2005 - 2023 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 @@ -14,7 +14,7 @@ # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://visp.inria.fr for more information. +# See https://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique @@ -31,9 +31,6 @@ # Description: # ViSP packaging configuration file. # -# Authors: -# Fabien Spindler -# ############################################################################# @@ -60,7 +57,7 @@ SET(CPACK_COMPONENT_LIBRARIES_DESCRIPTION "ViSP ${VISP_VERSION} libraries") SET(CPACK_COMPONENT_HEADERS_DESCRIPTION "C/C++ header files for use with ViSP ${VISP_VERSION} libraries") SET(CPACK_COMPONENT_HEADERS_DEPENDS libraries) SET(CPACK_COMPONENT_LIBRARIES_GROUP "Development") -SET(CPACK_COMPONENT_HEADERS_GROUP "Development") +SET(CPACK_COMPONENT_HEADERS_GROUP "Development") SET(CPACK_COMPONENT_GROUP_DEVELOPMENT_DESCRIPTION "All of the tools you'll ever need to develop software with ViSP") SET(CPACK_ALL_INSTALL_TYPES Full Developer) SET(CPACK_COMPONENT_LIBRARIES_INSTALL_TYPES Developer Full) diff --git a/cmake/CPackConfigDeb.cmake b/cmake/CPackConfigDeb.cmake index b498e77a8e..ae4f8eddea 100644 --- a/cmake/CPackConfigDeb.cmake +++ b/cmake/CPackConfigDeb.cmake @@ -1,7 +1,7 @@ ############################################################################# # # ViSP, open source Visual Servoing Platform software. -# Copyright (C) 2005 - 2019 by Inria. All rights reserved. +# Copyright (C) 2005 - 2023 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 @@ -14,7 +14,7 @@ # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://visp.inria.fr for more information. +# See https://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique @@ -31,9 +31,6 @@ # Description: # ViSP packaging configuration file. # -# Authors: -# Fabien Spindler -# ############################################################################# diff --git a/cmake/CPackConfigNsis.cmake b/cmake/CPackConfigNsis.cmake index e5675f7437..d1c2cb5c0e 100644 --- a/cmake/CPackConfigNsis.cmake +++ b/cmake/CPackConfigNsis.cmake @@ -1,7 +1,7 @@ ############################################################################# # # ViSP, open source Visual Servoing Platform software. -# Copyright (C) 2005 - 2019 by Inria. All rights reserved. +# Copyright (C) 2005 - 2023 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 @@ -14,7 +14,7 @@ # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://visp.inria.fr for more information. +# See https://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique @@ -31,9 +31,6 @@ # Description: # ViSP packaging configuration file. # -# Authors: -# Fabien Spindler -# ############################################################################# set(BUILD_SHARED_LIBS CACHE FORCE "Build ViSP with shared libraries." ON) diff --git a/cmake/CPackConfigRpm.cmake b/cmake/CPackConfigRpm.cmake index 01c42c09a0..5e06c15bae 100644 --- a/cmake/CPackConfigRpm.cmake +++ b/cmake/CPackConfigRpm.cmake @@ -1,7 +1,7 @@ ############################################################################# # # ViSP, open source Visual Servoing Platform software. -# Copyright (C) 2005 - 2019 by Inria. All rights reserved. +# Copyright (C) 2005 - 2023 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 @@ -14,7 +14,7 @@ # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://visp.inria.fr for more information. +# See https://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique @@ -31,9 +31,6 @@ # Description: # ViSP packaging configuration file. # -# Authors: -# Fabien Spindler -# ############################################################################# @@ -52,7 +49,7 @@ ELSE() ENDIF() # create a fedora short name from cat /etc/fedora-release -# for example, cat .. return "Fedora release 13 (Goddard)" we build "fc13" +# for example, cat .. return "Fedora release 13 (Goddard)" we build "fc13" FIND_PROGRAM(CAT_CMD cat) MARK_AS_ADVANCED(CAT_CMD) IF(NOT CAT_CMD) diff --git a/cmake/FindARIA.cmake b/cmake/FindARIA.cmake index 775847bffd..e044d2ded8 100644 --- a/cmake/FindARIA.cmake +++ b/cmake/FindARIA.cmake @@ -1,7 +1,7 @@ ############################################################################# # # ViSP, open source Visual Servoing Platform software. -# Copyright (C) 2005 - 2019 by Inria. All rights reserved. +# Copyright (C) 2005 - 2023 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 @@ -14,7 +14,7 @@ # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://visp.inria.fr for more information. +# See https://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique @@ -30,15 +30,12 @@ # # Description: # Try to find Aria libraries and headers to control Pioneer mobile robots. -# Once run this will define: +# Once run this will define: # # ARIA_FOUND # ARIA_INCLUDE_DIRS # ARIA_LIBRARIES # -# Authors: -# Fabien Spindler -# ############################################################################# find_path(ARIA_INCLUDE_DIR Aria.h @@ -51,12 +48,12 @@ find_path(ARIA_INCLUDE_DIR Aria.h /usr/local/include/Aria "C:/Program Files/MobileRobots/Aria/include" ) -#MESSAGE("DBG ARIA_INCLUDE_DIR=${ARIA_INCLUDE_DIR}") +#MESSAGE("DBG ARIA_INCLUDE_DIR=${ARIA_INCLUDE_DIR}") -if(UNIX) +if(UNIX) find_library(ARIA_LIBRARY NAMES Aria - PATHS + PATHS $ENV{ARIA_HOME}/lib /usr/local/Aria/lib /usr/Aria/lib @@ -80,7 +77,7 @@ else() else() set(ARIA_SUFFIX_NAME "") endif() - + set(ARIA_LIB_SEARCH_PATH "") if(CMAKE_CL_64) list(APPEND ARIA_LIB_SEARCH_PATH "C:/Program Files/MobileRobots/Aria/lib64") @@ -92,17 +89,17 @@ else() find_library(ARIA_LIBRARY_DEBUG NAMES AriaDebug${ARIA_SUFFIX_NAME} - PATHS + PATHS ${ARIA_LIB_SEARCH_PATH} ) find_library(ARIA_LIBRARY_RELEASE NAMES Aria${ARIA_SUFFIX_NAME} - PATHS + PATHS ${ARIA_LIB_SEARCH_PATH} ) endif() - -if(UNIX) + +if(UNIX) if(ARIA_LIBRARY AND ARIA_INCLUDE_DIR) set(ARIA_INCLUDE_DIRS ${ARIA_INCLUDE_DIR}) set(ARIA_LIBRARIES ${ARIA_LIBRARY}) @@ -124,7 +121,7 @@ else() endif() endif() - + mark_as_advanced( ARIA_INCLUDE_DIR ARIA_LIBRARY diff --git a/cmake/FindARSDK.cmake b/cmake/FindARSDK.cmake index 0d0b9e3c04..d1206ac13c 100644 --- a/cmake/FindARSDK.cmake +++ b/cmake/FindARSDK.cmake @@ -1,7 +1,7 @@ ############################################################################# # # ViSP, open source Visual Servoing Platform software. -# Copyright (C) 2005 - 2019 by Inria. All rights reserved. +# Copyright (C) 2005 - 2023 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 @@ -14,7 +14,7 @@ # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://visp.inria.fr for more information. +# See https://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique @@ -36,9 +36,6 @@ # BICLOPS_INCLUDE_DIRS # BICLOPS_LIBRARIES # -# Authors: -# Fabien Spindler -# ############################################################################# find_path(ARSDK_INCLUDE_DIR libARCommands/ARCommands.h diff --git a/cmake/FindAfma6_data.cmake b/cmake/FindAfma6_data.cmake index 9e5d6b8fea..f86baadd56 100644 --- a/cmake/FindAfma6_data.cmake +++ b/cmake/FindAfma6_data.cmake @@ -1,7 +1,7 @@ ############################################################################# # # ViSP, open source Visual Servoing Platform software. -# Copyright (C) 2005 - 2019 by Inria. All rights reserved. +# Copyright (C) 2005 - 2023 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 @@ -14,7 +14,7 @@ # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://visp.inria.fr for more information. +# See https://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique @@ -30,17 +30,14 @@ # # Description: # Try to determine if calibration data (camera intrinsic/extrinsic, FT calib file) -# are available for Inria's Viper 650 robot. +# are available for Inria's Viper 650 robot. # # AFMA6_DATA_FOUND # AFMA6_DATA_PATH # -# Authors: -# Fabien Spindler -# ############################################################################# - + find_path(AFMA6_DATA_PATH NAMES include/const_camera_Afma6.xml PATHS @@ -51,7 +48,7 @@ find_path(AFMA6_DATA_PATH ) #message("DBG AFMA6_DATA_PATH=${AFMA6_DATA_PATH}") - + if(AFMA6_DATA_PATH) set(AFMA6_DATA_FOUND TRUE) else() diff --git a/cmake/FindBICLOPS.cmake b/cmake/FindBICLOPS.cmake index 7820330b2a..31e0f5da60 100644 --- a/cmake/FindBICLOPS.cmake +++ b/cmake/FindBICLOPS.cmake @@ -1,7 +1,7 @@ ############################################################################# # # ViSP, open source Visual Servoing Platform software. -# Copyright (C) 2005 - 2019 by Inria. All rights reserved. +# Copyright (C) 2005 - 2023 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 @@ -14,7 +14,7 @@ # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://visp.inria.fr for more information. +# See https://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique @@ -30,15 +30,12 @@ # # Description: # Try to find libBiclops, libPMD and libUtils for Biclops head. -# Once run this will define: +# Once run this will define: # # BICLOPS_FOUND # BICLOPS_INCLUDE_DIRS # BICLOPS_LIBRARIES # -# Authors: -# Fabien Spindler -# ############################################################################# @@ -50,8 +47,8 @@ ELSE(NOT UNIX AND NOT WIN32) FIND_PATH(BICLOPS_INCLUDE_DIR Biclops.h $ENV{BICLOPS_HOME}/include /usr/include ) - - #MESSAGE("DBG BICLOPS_INCLUDE_DIR=${BICLOPS_INCLUDE_DIR}") + + #MESSAGE("DBG BICLOPS_INCLUDE_DIR=${BICLOPS_INCLUDE_DIR}") FIND_PATH(PMD_INCLUDE_DIR PMD.h $ENV{BICLOPS_HOME}/include @@ -65,14 +62,14 @@ ELSE(NOT UNIX AND NOT WIN32) FIND_LIBRARY(BICLOPS_LIBRARY NAMES Biclops libBiclops libBiclopsD - PATHS + PATHS $ENV{BICLOPS_HOME}/lib /usr/lib ) FIND_LIBRARY(PMD_LIBRARY NAMES PMD libPMD libPMDD - PATHS + PATHS $ENV{BICLOPS_HOME}/lib $ENV{BICLOPS_PMD_HOME}/lib /usr/lib @@ -80,7 +77,7 @@ ELSE(NOT UNIX AND NOT WIN32) FIND_LIBRARY(UTILS_LIBRARY NAMES Utils libUtils libUtilsD - PATHS + PATHS $ENV{BICLOPS_HOME}/lib $ENV{BICLOPS_UTILS_HOME}/lib /usr/lib @@ -98,11 +95,11 @@ ELSE(NOT UNIX AND NOT WIN32) IF(NOT BICLOPS_INCLUDE_DIR) # MESSAGE(SEND_ERROR "Biclops include dir not found. Set USE_BICLOPS option OFF") ENDIF(NOT BICLOPS_INCLUDE_DIR) - + IF(NOT PMD_INCLUDE_DIR) # MESSAGE(SEND_ERROR "PMD include dir not found. Set USE_BICLOPS option OFF") ENDIF(NOT PMD_INCLUDE_DIR) - + IF(NOT UTILS_INCLUDE_DIR) # MESSAGE(SEND_ERROR "Utils include dir not found. Set USE_BICLOPS option OFF ") ENDIF(NOT UTILS_INCLUDE_DIR) diff --git a/cmake/FindC99.cmake b/cmake/FindC99.cmake index 1447886281..d992ee60be 100644 --- a/cmake/FindC99.cmake +++ b/cmake/FindC99.cmake @@ -1,7 +1,7 @@ ############################################################################# # # ViSP, open source Visual Servoing Platform software. -# Copyright (C) 2005 - 2019 by Inria. All rights reserved. +# Copyright (C) 2005 - 2023 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 @@ -14,7 +14,7 @@ # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://visp.inria.fr for more information. +# See https://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique diff --git a/cmake/FindCALINUX.cmake b/cmake/FindCALINUX.cmake index 3e7cea0ab5..1a25c33057 100644 --- a/cmake/FindCALINUX.cmake +++ b/cmake/FindCALINUX.cmake @@ -1,7 +1,7 @@ ############################################################################# # # ViSP, open source Visual Servoing Platform software. -# Copyright (C) 2005 - 2022 by Inria. All rights reserved. +# Copyright (C) 2005 - 2023 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 @@ -14,7 +14,7 @@ # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://visp.inria.fr for more information. +# See https://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique @@ -35,9 +35,6 @@ # CALINUX_INCLUDE_DIRS # CALINUX_LIBRARIES # -# Authors: -# Fabien Spindler -# ############################################################################# if(NOT UNIX) diff --git a/cmake/FindCMU1394.cmake b/cmake/FindCMU1394.cmake index 6d310abc0d..5454743282 100644 --- a/cmake/FindCMU1394.cmake +++ b/cmake/FindCMU1394.cmake @@ -1,7 +1,7 @@ ############################################################################# # # ViSP, open source Visual Servoing Platform software. -# Copyright (C) 2005 - 2019 by Inria. All rights reserved. +# Copyright (C) 2005 - 2023 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 @@ -14,7 +14,7 @@ # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://visp.inria.fr for more information. +# See https://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique @@ -29,17 +29,14 @@ # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # # Description: -# Try to find CMU 1394 Digital Camera SDK to acquire images from firewire +# Try to find CMU 1394 Digital Camera SDK to acquire images from firewire # cameras on Windows. -# Once run this will define: +# Once run this will define: # # CMU1394_FOUND # CMU1394_INCLUDE_DIRS # CMU1394_LIBRARIES # -# Authors: -# Fabien Spindler -# ############################################################################# if(WIN32) @@ -48,20 +45,20 @@ if(WIN32) "C:/Program Files (x86)/CMU/1394Camera/include" "C:/Program Files/CMU/1394Camera/include" ) - #MESSAGE("DBG CMU1394_INCLUDE_DIR=${CMU1394_INCLUDE_DIR}") - + #MESSAGE("DBG CMU1394_INCLUDE_DIR=${CMU1394_INCLUDE_DIR}") + if(CMAKE_CL_64) FIND_LIBRARY(CMU1394_LIBRARY_DEBUG NAMES 1394camerad - PATHS + PATHS $ENV{CMU1394_HOME}/lib64/x64 "C:/Program Files (x86)/CMU/1394Camera/lib64/x64" "C:/Program Files/CMU/1394Camera/lib64/x64" ) - + FIND_LIBRARY(CMU1394_LIBRARY_RELEASE NAMES 1394camera - PATHS + PATHS $ENV{CMU1394_HOME}/lib64/x64 "C:/Program Files (x86)/CMU/1394Camera/lib64/x64" "C:/Program Files/CMU/1394Camera/lib64/x64" @@ -69,15 +66,15 @@ if(WIN32) else() FIND_LIBRARY(CMU1394_LIBRARY_DEBUG NAMES 1394camerad - PATHS + PATHS $ENV{CMU1394_HOME}/lib "C:/Program Files (x86)/CMU/1394Camera/lib" "C:/Program Files/CMU/1394Camera/lib" ) - + FIND_LIBRARY(CMU1394_LIBRARY_RELEASE NAMES 1394camera - PATHS + PATHS $ENV{CMU1394_HOME}/lib "C:/Program Files (x86)/CMU/1394Camera/lib" "C:/Program Files/CMU/1394Camera/lib" diff --git a/cmake/FindComedi.cmake b/cmake/FindComedi.cmake index eb8f3266ab..fc4892e73c 100644 --- a/cmake/FindComedi.cmake +++ b/cmake/FindComedi.cmake @@ -1,7 +1,7 @@ ############################################################################# # # ViSP, open source Visual Servoing Platform software. -# Copyright (C) 2005 - 2019 by Inria. All rights reserved. +# Copyright (C) 2005 - 2023 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 @@ -14,7 +14,7 @@ # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://visp.inria.fr for more information. +# See https://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique @@ -36,9 +36,6 @@ # COMEDI_LIBRARIES # COMEDI_VERSION # -# Authors: -# Fabien Spindler -# ############################################################################# find_path(COMEDI_INCLUDE_DIRS comedilib.h @@ -50,7 +47,7 @@ find_path(COMEDI_INCLUDE_DIRS comedilib.h find_library(COMEDI_LIBRARIES NAMES comedi - PATHS + PATHS $ENV{COMEDI_HOME}/lib /usr/lib /usr/local/lib @@ -65,7 +62,7 @@ if(COMEDI_LIBRARIES AND COMEDI_INCLUDE_DIRS) else() set(COMEDI_FOUND FALSE) endif() - + mark_as_advanced( COMEDI_INCLUDE_DIRS COMEDI_LIBRARIES diff --git a/cmake/FindDC1394.cmake b/cmake/FindDC1394.cmake index b65f2a98ac..2ffea3a7e3 100644 --- a/cmake/FindDC1394.cmake +++ b/cmake/FindDC1394.cmake @@ -1,7 +1,7 @@ ############################################################################# # # ViSP, open source Visual Servoing Platform software. -# Copyright (C) 2005 - 2019 by Inria. All rights reserved. +# Copyright (C) 2005 - 2023 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 @@ -14,7 +14,7 @@ # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://visp.inria.fr for more information. +# See https://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique @@ -31,7 +31,7 @@ # Description: # Try to find libDC1394 for IEEE1394 camera. First search for libdc1394-2.x # and if not found, search for libdc1394-1.x -# Once run this will define: +# Once run this will define: # # DC1394_FOUND # DC1394_INCLUDE_DIRS @@ -39,18 +39,15 @@ # DC1394_VERSION # # The two defines below are only useful to compile with libdc1394-2.x. In -# that case DC1394_VERSION=2. Since the libdc1394-2.x API is not stable, we -# need to determine if dc1394_find_cameras() or dc1394_enumerate_cameras() -# functions are available. dc1394_enumerate_cameras() was introduced after -# libdc1394-2.0.0-rc7. DC1394_CAMERA_ENUMERATE_FOUND is TRUE when -# dc1394_camera_enumerate() function is found. DC1394_FIND_CAMERAS_FOUND is +# that case DC1394_VERSION=2. Since the libdc1394-2.x API is not stable, we +# need to determine if dc1394_find_cameras() or dc1394_enumerate_cameras() +# functions are available. dc1394_enumerate_cameras() was introduced after +# libdc1394-2.0.0-rc7. DC1394_CAMERA_ENUMERATE_FOUND is TRUE when +# dc1394_camera_enumerate() function is found. DC1394_FIND_CAMERAS_FOUND is # TRUE when dc1394_find_cameras() is found. # DC1394_CAMERA_ENUMERATE_FOUND # DC1394_FIND_CAMERAS_FOUND # -# Authors: -# Fabien Spindler -# ############################################################################# if(NOT UNIX) @@ -62,11 +59,11 @@ else(NOT UNIX) $ENV{DC1394_HOME}/include $ENV{DC1394_DIR}/include /usr/include ) - #MESSAGE("DBG DC1394_INCLUDE_DIR=${DC1394_INCLUDE_DIR}") + #MESSAGE("DBG DC1394_INCLUDE_DIR=${DC1394_INCLUDE_DIR}") find_library(DC1394_LIBRARY NAMES dc1394 - PATHS + PATHS $ENV{DC1394_HOME}/lib $ENV{DC1394_DIR}/lib /usr/lib @@ -87,10 +84,10 @@ else(NOT UNIX) # introduced after libdc1394-2.0.0-rc7 include(CheckCXXSourceCompiles) - + set(CMAKE_REQUIRED_LIBRARIES ${DC1394_LIBRARY}) set(CMAKE_REQUIRED_INCLUDES ${DC1394_INCLUDE_DIR}) - + check_cxx_source_compiles(" #include #include diff --git a/cmake/FindDIRECT3D.cmake b/cmake/FindDIRECT3D.cmake index 6212198e4f..2cb80de0e5 100644 --- a/cmake/FindDIRECT3D.cmake +++ b/cmake/FindDIRECT3D.cmake @@ -1,7 +1,7 @@ ############################################################################# # # ViSP, open source Visual Servoing Platform software. -# Copyright (C) 2005 - 2019 by Inria. All rights reserved. +# Copyright (C) 2005 - 2023 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 @@ -14,7 +14,7 @@ # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://visp.inria.fr for more information. +# See https://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique @@ -37,9 +37,6 @@ # DIRECT3D_INCLUDE_DIRS - include directory for DirectShow # DIRECT3D_LIBRARIES - libraries you need to link to # -# Authors: -# Bruno Renier -# ############################################################################# SET(DIRECT3D_FOUND "NO") @@ -63,7 +60,7 @@ IF(WIN32 AND NOT MINGW) IF(DIRECT3D_INCLUDE_DIR) IF(CMAKE_CL_64) FIND_LIBRARY(DIRECT3D_d3d9_LIBRARY d3d9 - "$ENV{DXSDK_DIR}/Lib" + "$ENV{DXSDK_DIR}/Lib" "$ENV{DXSDK_DIR}/Lib/x64" "C:/Program Files/Microsoft DirectX SDK/Lib/x64" "C:/DXSDK/Include/Lib/x64" @@ -72,7 +69,7 @@ IF(WIN32 AND NOT MINGW) ) ELSE(CMAKE_CL_64) FIND_LIBRARY(DIRECT3D_d3d9_LIBRARY d3d9 - "$ENV{DXSDK_DIR}/Lib" + "$ENV{DXSDK_DIR}/Lib" "$ENV{DXSDK_DIR}/Lib/x86" "C:/Program Files/Microsoft DirectX SDK/Lib/x86" "C:/DXSDK/Include/Lib/x86" @@ -102,7 +99,7 @@ IF(WIN32 AND NOT MINGW) NO_DEFAULT_PATH DOC "Where can the Direct3D d3dx9 library be found" ) - ENDIF(CMAKE_CL_64) + ENDIF(CMAKE_CL_64) FIND_LIBRARY(DIRECT3D_d3dx9_LIBRARY d3dx9 DOC "Where can the Direct3D d3dx9 library be found" ) diff --git a/cmake/FindDIRECTSHOW.cmake b/cmake/FindDIRECTSHOW.cmake index 51c1afb346..02fc43b49e 100644 --- a/cmake/FindDIRECTSHOW.cmake +++ b/cmake/FindDIRECTSHOW.cmake @@ -1,7 +1,7 @@ ############################################################################# # # ViSP, open source Visual Servoing Platform software. -# Copyright (C) 2005 - 2019 by Inria. All rights reserved. +# Copyright (C) 2005 - 2023 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 @@ -14,7 +14,7 @@ # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://visp.inria.fr for more information. +# See https://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique @@ -37,9 +37,6 @@ # DIRECTSHOW_INCLUDE_DIRS - include directory for DirectShow # DIRECTSHOW_LIBRARIES - libraries you need to link to # -# Authors: -# Fabien Spindler -# ############################################################################# SET(DIRECTSHOW_FOUND "NO") @@ -80,7 +77,7 @@ IF(WIN32 AND NOT MINGW) FIND_PATH(DIRECTSHOW_dshow_INCLUDE_PATH dshow.h DOC "What is the path where the file dshow.h can be found" ) - + FIND_PATH(DIRECTSHOW_qedit_INCLUDE_PATH qedit.h "$ENV{WINSDK_HOME}/Include" "$ENV{DXSDK_DIR}/Include" @@ -97,7 +94,7 @@ IF(WIN32 AND NOT MINGW) FIND_PATH(DIRECTSHOW_qedit_INCLUDE_PATH qedit.h DOC "What is the path where the file qedit.h can be found" ) - + FIND_PATH(DIRECTSHOW_atlbase_INCLUDE_PATH atlbase.h DOC "What is the path where the file atlbase.h can be found" ) @@ -168,7 +165,7 @@ IF(WIN32 AND NOT MINGW) DOC "Where can the DirectShow strmiids library be found" ) ELSE(CMAKE_CL_64) - FIND_LIBRARY(DIRECTSHOW_strmiids_LIBRARY + FIND_LIBRARY(DIRECTSHOW_strmiids_LIBRARY NAMES strmiids PATHS "$ENV{WINSDK_HOME}/Lib" @@ -188,13 +185,13 @@ IF(WIN32 AND NOT MINGW) "C:/Program Files/Microsoft Platform SDK/Lib" NO_DEFAULT_PATH DOC "Where can the DirectShow strmiids library be found" - ) - ENDIF(CMAKE_CL_64) + ) + ENDIF(CMAKE_CL_64) FIND_LIBRARY(DIRECTSHOW_strmiids_LIBRARY NAMES strmiids DOC "Where can the DirectShow strmiids library be found" ) - + IF(CMAKE_CL_64) FIND_LIBRARY(DIRECTSHOW_quartz_LIBRARY diff --git a/cmake/FindDL.cmake b/cmake/FindDL.cmake index 6a91a37b3e..ec8335c380 100644 --- a/cmake/FindDL.cmake +++ b/cmake/FindDL.cmake @@ -1,7 +1,7 @@ ############################################################################# # # ViSP, open source Visual Servoing Platform software. -# Copyright (C) 2005 - 2019 by Inria. All rights reserved. +# Copyright (C) 2005 - 2023 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 @@ -14,7 +14,7 @@ # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://visp.inria.fr for more information. +# See https://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique @@ -30,34 +30,31 @@ # # Description: # Try to find dl library. -# Once run this will define: +# Once run this will define: # # DL_FOUND # DL_LIBRARIES # -# Authors: -# Fabien Spindler -# ############################################################################# FIND_LIBRARY(DL_LIBRARY NAMES dl - PATHS + PATHS $ENV{DL_HOME}/lib /usr/lib /usr/local/lib ) - + #MESSAGE("DBG DL_LIBRARY=${DL_LIBRARY}") - + IF(DL_LIBRARY) SET(DL_LIBRARIES ${DL_LIBRARY}) SET(DL_FOUND TRUE) ELSE() SET(DL_FOUND FALSE) ENDIF() - + MARK_AS_ADVANCED( DL_LIBRARY ) diff --git a/cmake/FindDMTX.cmake b/cmake/FindDMTX.cmake index 9c5e29660d..86fcf28340 100644 --- a/cmake/FindDMTX.cmake +++ b/cmake/FindDMTX.cmake @@ -1,7 +1,7 @@ ############################################################################# # # ViSP, open source Visual Servoing Platform software. -# Copyright (C) 2005 - 2019 by Inria. All rights reserved. +# Copyright (C) 2005 - 2023 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 @@ -14,7 +14,7 @@ # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://visp.inria.fr for more information. +# See https://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique @@ -30,28 +30,25 @@ # # Description: # Try to find dmtx library. -# Once run this will define: +# Once run this will define: # # DMTX_FOUND # DMTX_INCLUDE_DIRS # DMTX_LIBRARIES # DMTX_VERSION # -# Authors: -# Fabien Spindler -# ############################################################################# - + find_path(DMTX_INCLUDE_DIRS dmtx.h $ENV{DMTX_DIR}/include /usr/include - /usr/local/include + /usr/local/include ) find_library(DMTX_LIBRARIES NAMES dmtx - PATHS + PATHS $ENV{DMTX_DIR}/lib /usr/lib /usr/local/lib @@ -66,7 +63,7 @@ if(DMTX_INCLUDE_DIRS AND DMTX_LIBRARIES) else() set(DMTX_FOUND FALSE) endif() - + mark_as_advanced( DMTX_INCLUDE_DIRS DMTX_LIBRARIES diff --git a/cmake/FindErfc.cmake b/cmake/FindErfc.cmake index 898c5cd7c5..0e7dc8dbff 100644 --- a/cmake/FindErfc.cmake +++ b/cmake/FindErfc.cmake @@ -1,7 +1,7 @@ ############################################################################# # # ViSP, open source Visual Servoing Platform software. -# Copyright (C) 2005 - 2022 by Inria. All rights reserved. +# Copyright (C) 2005 - 2023 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 @@ -14,7 +14,7 @@ # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://visp.inria.fr for more information. +# See https://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique diff --git a/cmake/FindFFMPEG.cmake b/cmake/FindFFMPEG.cmake index 678d8339d0..b3af75074b 100644 --- a/cmake/FindFFMPEG.cmake +++ b/cmake/FindFFMPEG.cmake @@ -1,7 +1,7 @@ ############################################################################# # # ViSP, open source Visual Servoing Platform software. -# Copyright (C) 2005 - 2019 by Inria. All rights reserved. +# Copyright (C) 2005 - 2023 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 @@ -14,7 +14,7 @@ # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://visp.inria.fr for more information. +# See https://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique @@ -30,15 +30,12 @@ # # Description: # Try to find FFMPEG. FFMpeg depend son Zlib. -# Once run this will define: +# Once run this will define: # # FFMPEG_FOUND - system has FFMPEG # FFMPEG_INCLUDE_DIRS - the FFMPEG include directory # FFMPEG_LIBRARIES - Link these to use FFMPEG # -# Authors: -# Fabien Spindler -# ############################################################################# # detection of the FFMPEG headers location @@ -235,13 +232,13 @@ endif(MINGW) # FFMpeg depend son Zlib find_package(ZLIB) if(NOT ZLIB_FOUND) - find_package(MyZLIB) + find_package(MyZLIB) endif() # FFMpeg depend son BZip2 # with CMake 2.6, the CMake bzip2 package material is named FindBZip2.cmake # while with CMake 2.8, the name is FindBZIP2.cmake - # that is why we need to call FIND_PACKAGE(BZip2) and FIND_PACKAGE(BZIP2) + # that is why we need to call FIND_PACKAGE(BZip2) and FIND_PACKAGE(BZIP2) find_package(BZIP2 QUIET) # MESSAGE("BZIP2_FOUND: ${BZIP2_FOUND}") if(NOT BZIP2_FOUND) diff --git a/cmake/FindFTIITSDK.cmake b/cmake/FindFTIITSDK.cmake index ec74bbe11f..f9f7720b37 100644 --- a/cmake/FindFTIITSDK.cmake +++ b/cmake/FindFTIITSDK.cmake @@ -1,4 +1,4 @@ -# See http://visp.inria.fr for more information. +# See https://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique @@ -19,9 +19,6 @@ # FTIIT_INCLUDE_DIRS # FTIIT_LIBRARIES # -# Authors: -# Fabien Spindler -# ############################################################################# # platform detection diff --git a/cmake/FindFlirPtuSDK.cmake b/cmake/FindFlirPtuSDK.cmake index 4f5bb59138..62dcdb7be1 100644 --- a/cmake/FindFlirPtuSDK.cmake +++ b/cmake/FindFlirPtuSDK.cmake @@ -1,4 +1,4 @@ -# See http://visp.inria.fr for more information. +# See https://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique @@ -19,9 +19,6 @@ # FLIRPTUSDK_INCLUDE_DIRS # FLIRPTUSDK_LIBRARIES # -# Authors: -# Fabien Spindler -# ############################################################################# set(FLIRPTUSDK_INC_SEARCH_PATH) diff --git a/cmake/FindFlyCapture.cmake b/cmake/FindFlyCapture.cmake index a03be3bc7e..ea3bab51ee 100644 --- a/cmake/FindFlyCapture.cmake +++ b/cmake/FindFlyCapture.cmake @@ -1,7 +1,7 @@ ############################################################################# # # ViSP, open source Visual Servoing Platform software. -# Copyright (C) 2005 - 2019 by Inria. All rights reserved. +# Copyright (C) 2005 - 2023 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 @@ -14,7 +14,7 @@ # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://visp.inria.fr for more information. +# See https://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique @@ -36,9 +36,6 @@ # FLYCAPTURE_LIBRARIES # FLYCAPTURE_VERSION # -# Authors: -# Fabien Spindler -# ############################################################################# set(FLYCAPTURE_INC_SEARCH_PATH /usr/include/flycapture) @@ -67,7 +64,7 @@ find_path(FLYCAPTURE_INCLUDE_DIRS FlyCapture2.h find_library(FLYCAPTURE_LIBRARIES NAMES flycapture FlyCapture2 FlyCapture2_v100 - PATHS + PATHS ${FLYCAPTURE_LIB_SEARCH_PATH} NO_DEFAULT_PATH ) @@ -77,7 +74,7 @@ if(FLYCAPTURE_LIBRARIES AND FLYCAPTURE_INCLUDE_DIRS) else() set(FLYCAPTURE_FOUND FALSE) endif() - + mark_as_advanced( FLYCAPTURE_INCLUDE_DIRS FLYCAPTURE_LIBRARIES diff --git a/cmake/FindGDI.cmake b/cmake/FindGDI.cmake index d56233b255..13446c450d 100644 --- a/cmake/FindGDI.cmake +++ b/cmake/FindGDI.cmake @@ -1,7 +1,7 @@ ############################################################################# # # ViSP, open source Visual Servoing Platform software. -# Copyright (C) 2005 - 2022 by Inria. All rights reserved. +# Copyright (C) 2005 - 2023 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 @@ -14,7 +14,7 @@ # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://visp.inria.fr for more information. +# See https://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique @@ -37,12 +37,14 @@ # ############################################################################# -SET(GDI_FOUND "NO") +set(GDI_FOUND "NO") # GDI (Graphics Device Interface) is only available on Windows platforms -IF(WIN32) - IF(MINGW) - FIND_LIBRARY(GDI_LIBRARY gdi32 +if(WIN32) + if(MINGW) + find_library(GDI_LIBRARY gdi32 + "C:/mingw64/lib" + "C:/mingw64/x86_64-w64-mingw32/lib" "C:/MinGW/lib" "C:/mingw/mingw/lib" "C:/mingw32/lib" @@ -52,12 +54,12 @@ IF(WIN32) DOC "Where can the GDI (Graphics Device Interface) library be found" NO_DEFAULT_PATH ) - ELSE(MINGW) - IF(CMAKE_CL_64) + else() + if(CMAKE_CL_64) # Generic path search file(GLOB _gdi_search_path "C:/Program Files (x86)/Windows Kits/*/Lib/*/um/x64") list(REVERSE _gdi_search_path) # to search first in the more recent SDK - FIND_LIBRARY(GDI_LIBRARY gdi32 + find_library(GDI_LIBRARY gdi32 "$ENV{WINSDK_DIR}/Lib/x64" "$ENV{WINSDK_HOME}/Lib/x64" "$ENV{DXSDK_DIR}/Lib/x64" @@ -76,35 +78,35 @@ IF(WIN32) ) # Specific path search for Visual Studio .NET 2003 - IF(MSVC71) - IF(NOT GDI_LIBRARY) - FIND_LIBRARY(GDI_LIBRARY gdi32 + if(MSVC71) + if(NOT GDI_LIBRARY) + find_library(GDI_LIBRARY gdi32 "C:/Program Files/Microsoft Visual Studio .NET 2003/Vc7/PlatformSDK/Lib" ) - ENDIF(NOT GDI_LIBRARY) - ENDIF(MSVC71) + endif(NOT GDI_LIBRARY) + endif(MSVC71) # Specific path search for Visual Studio 2005 - IF(MSVC80) - IF(NOT GDI_LIBRARY) - FIND_LIBRARY(GDI_LIBRARY gdi32 + if(MSVC80) + if(NOT GDI_LIBRARY) + find_library(GDI_LIBRARY gdi32 "C:/Program Files/Microsoft Visual Studio 8/VC/PlatformSDK/Lib/AMD64" ) - ENDIF(NOT GDI_LIBRARY) - ENDIF(MSVC80) + endif(NOT GDI_LIBRARY) + endif(MSVC80) # Specific path search for Visual Studio 2008 - IF(MSVC90) - IF(NOT GDI_LIBRARY) - FIND_LIBRARY(GDI_LIBRARY gdi32 + if(MSVC90) + if(NOT GDI_LIBRARY) + find_library(GDI_LIBRARY gdi32 "C:/Program Files/Microsoft Visual Studio 9/VC/PlatformSDK/Lib/AMD64" ) - ENDIF(NOT GDI_LIBRARY) - ENDIF(MSVC90) + endif(NOT GDI_LIBRARY) + endif(MSVC90) - ELSE(CMAKE_CL_64) + else(CMAKE_CL_64) # Generic path search file(GLOB _gdi_search_path "C:/Program Files (x86)/Windows Kits/*/Lib/*/um/x86") list(REVERSE _gdi_search_path) # to search first in the more recent SDK - FIND_LIBRARY(GDI_LIBRARY gdi32 + find_library(GDI_LIBRARY gdi32 "$ENV{WINSDK_DIR}/Lib" "$ENV{WINSDK_HOME}/Lib" "$ENV{DXSDK_DIR}/Lib" @@ -126,39 +128,39 @@ IF(WIN32) ) # Specific path search for Visual Studio .NET 2003 - IF(MSVC71) - IF(NOT GDI_LIBRARY) - FIND_LIBRARY(GDI_LIBRARY gdi32 + if(MSVC71) + if(NOT GDI_LIBRARY) + find_library(GDI_LIBRARY gdi32 "C:/Program Files/Microsoft Visual Studio .NET 2003/Vc7/PlatformSDK/Lib" ) - ENDIF(NOT GDI_LIBRARY) - ENDIF(MSVC71) + endif(NOT GDI_LIBRARY) + endif(MSVC71) # Specific path search for Visual Studio 2005 - IF(MSVC80) - IF(NOT GDI_LIBRARY) - FIND_LIBRARY(GDI_LIBRARY gdi32 + if(MSVC80) + if(NOT GDI_LIBRARY) + find_library(GDI_LIBRARY gdi32 "C:/Program Files/Microsoft Visual Studio 8/VC/PlatformSDK/Lib" ) - ENDIF(NOT GDI_LIBRARY) - ENDIF(MSVC80) + endif(NOT GDI_LIBRARY) + endif(MSVC80) # Specific path search for Visual Studio 2008 - IF(MSVC90) - IF(NOT GDI_LIBRARY) - FIND_LIBRARY(GDI_LIBRARY gdi32 + if(MSVC90) + if(NOT GDI_LIBRARY) + find_library(GDI_LIBRARY gdi32 "C:/Program Files/Microsoft Visual Studio 9/VC/PlatformSDK/Lib" ) - ENDIF(NOT GDI_LIBRARY) - ENDIF(MSVC90) - ENDIF(CMAKE_CL_64) - ENDIF(MINGW) + endif(NOT GDI_LIBRARY) + endif(MSVC90) + endif(CMAKE_CL_64) + endif(MINGW) # if GDI libraries found, then we're ok - IF(GDI_LIBRARY) + if(GDI_LIBRARY) SET(GDI_FOUND "YES") SET(GDI_LIBRARIES ${GDI_LIBRARY}) - ENDIF(GDI_LIBRARY) + endif(GDI_LIBRARY) MARK_AS_ADVANCED(GDI_LIBRARY) -ENDIF(WIN32) +endif() diff --git a/cmake/FindGSL.cmake b/cmake/FindGSL.cmake index 2b3166d119..f933c2628e 100644 --- a/cmake/FindGSL.cmake +++ b/cmake/FindGSL.cmake @@ -1,7 +1,7 @@ ############################################################################# # # ViSP, open source Visual Servoing Platform software. -# Copyright (C) 2005 - 2019 by Inria. All rights reserved. +# Copyright (C) 2005 - 2023 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 @@ -14,7 +14,7 @@ # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://visp.inria.fr for more information. +# See https://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique @@ -29,18 +29,15 @@ # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # # Description: -# Try to find gnu scientific library GSL +# Try to find gnu scientific library GSL # (see http://www.gnu.org/software/gsl/) -# Once run this will define: -# +# Once run this will define: +# # GSL_FOUND : system has GSL lib # GSL_LIBRARIES : full path to the libraries # GSL_INCLUDE_DIRS : where to find headers # GSL_VERSION : which version # -# Authors: -# Fabien Spindler -# ############################################################################# # it seems that a macro() can't accept a list as input. That's why we have diff --git a/cmake/FindICONV.cmake b/cmake/FindICONV.cmake index ac1766ad3c..d9fe2046bb 100644 --- a/cmake/FindICONV.cmake +++ b/cmake/FindICONV.cmake @@ -1,7 +1,7 @@ ############################################################################# # # ViSP, open source Visual Servoing Platform software. -# Copyright (C) 2005 - 2019 by Inria. All rights reserved. +# Copyright (C) 2005 - 2023 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 @@ -14,7 +14,7 @@ # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://visp.inria.fr for more information. +# See https://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique @@ -30,15 +30,12 @@ # # Description: # Try to find ICONV library. -# Once run this will define: +# Once run this will define: # # ICONV_FOUND # ICONV_INCLUDE_DIRS # ICONV_LIBRARIES # -# Authors: -# Anthony Saunier -# ############################################################################# if(MINGW) diff --git a/cmake/FindIRISA.cmake b/cmake/FindIRISA.cmake index 5d490d9328..70999f61f2 100644 --- a/cmake/FindIRISA.cmake +++ b/cmake/FindIRISA.cmake @@ -1,7 +1,7 @@ ############################################################################# # # ViSP, open source Visual Servoing Platform software. -# Copyright (C) 2005 - 2022 by Inria. All rights reserved. +# Copyright (C) 2005 - 2023 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 @@ -14,7 +14,7 @@ # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://visp.inria.fr for more information. +# See https://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique @@ -35,9 +35,6 @@ # IRISA_INCLUDE_DIRS # IRISA_LIBRARIES # -# Authors: -# Fabien Spindler -# ############################################################################# if(NOT UNIX) diff --git a/cmake/FindIsFinite.cmake b/cmake/FindIsFinite.cmake new file mode 100644 index 0000000000..788908df0f --- /dev/null +++ b/cmake/FindIsFinite.cmake @@ -0,0 +1,40 @@ +############################################################################# +# +# ViSP, open source Visual Servoing Platform software. +# Copyright (C) 2005 - 2023 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 +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# See the file LICENSE.txt at the root directory of this source +# distribution for additional information about the GNU GPL. +# +# For using ViSP with software that can not be combined with the GNU +# GPL, please contact Inria about acquiring a ViSP Professional +# Edition License. +# +# See http://visp.inria.fr for more information. +# +# This software was developed at: +# Inria Rennes - Bretagne Atlantique +# Campus Universitaire de Beaulieu +# 35042 Rennes Cedex +# France +# +# If you have questions regarding the use of this file, please contact +# Inria at visp@inria.fr +# +# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +# +# Description: +# Try to find the isfinite macro, the std::isfinite function or the _finite function. +# +############################################################################# + +include(VISPFindUtils) + +check_math_expr("isfinite(1.0)" "" HAVE_FUNC_ISFINITE) +check_math_expr("std::isfinite(1.0)" "" HAVE_FUNC_STD_ISFINITE) +check_math_expr("_finite(1.0)" "" HAVE_FUNC__FINITE) diff --git a/cmake/FindIsInf.cmake b/cmake/FindIsInf.cmake index 8441a9643c..2ff5776341 100644 --- a/cmake/FindIsInf.cmake +++ b/cmake/FindIsInf.cmake @@ -1,7 +1,7 @@ ############################################################################# # # ViSP, open source Visual Servoing Platform software. -# Copyright (C) 2005 - 2022 by Inria. All rights reserved. +# Copyright (C) 2005 - 2023 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 @@ -14,7 +14,7 @@ # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://visp.inria.fr for more information. +# See https://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique @@ -36,4 +36,4 @@ include(VISPFindUtils) check_math_expr("isinf(1.0)" "" HAVE_FUNC_ISINF) -check_math_expr("std::isinf(1.0))" "" HAVE_FUNC_STD_ISINF) +check_math_expr("std::isinf(1.0)" "" HAVE_FUNC_STD_ISINF) diff --git a/cmake/FindIsNaN.cmake b/cmake/FindIsNaN.cmake index a2f186ed93..85e2852eb6 100644 --- a/cmake/FindIsNaN.cmake +++ b/cmake/FindIsNaN.cmake @@ -1,7 +1,7 @@ ############################################################################# # # ViSP, open source Visual Servoing Platform software. -# Copyright (C) 2005 - 2022 by Inria. All rights reserved. +# Copyright (C) 2005 - 2023 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 @@ -14,7 +14,7 @@ # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://visp.inria.fr for more information. +# See https://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique @@ -36,5 +36,5 @@ include(VISPFindUtils) check_math_expr("isnan(1.0)" "" HAVE_FUNC_ISNAN) -check_math_expr("std::isnan(1.0))" "" HAVE_FUNC_STD_ISNAN) -check_math_expr("_isnan(1.0))" "" HAVE_FUNC__ISNAN) +check_math_expr("std::isnan(1.0)" "" HAVE_FUNC_STD_ISNAN) +check_math_expr("_isnan(1.0)" "" HAVE_FUNC__ISNAN) diff --git a/cmake/FindJacoSDK.cmake b/cmake/FindJacoSDK.cmake index 66ab8f3daa..68e4bb5acc 100644 --- a/cmake/FindJacoSDK.cmake +++ b/cmake/FindJacoSDK.cmake @@ -1,4 +1,4 @@ -# See http://visp.inria.fr for more information. +# See https://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique @@ -19,8 +19,6 @@ # JACOSDK_INCLUDE_DIRS # JACOSDK_LIBRARIES # -# Authors: -# Fabien Spindler ############################################################################# set(JACOSDK_INC_SEARCH_PATH /usr/JACO-SDK/API) @@ -39,7 +37,7 @@ if(UNIX) else() set(JACOSDK_LIBRARIES "") endif() - + if(JACOSDK_INCLUDE_DIRS) set(JACOSDK_FOUND TRUE) else() diff --git a/cmake/FindLIBFREENECT.cmake b/cmake/FindLIBFREENECT.cmake index d291458049..dacf8ca571 100644 --- a/cmake/FindLIBFREENECT.cmake +++ b/cmake/FindLIBFREENECT.cmake @@ -1,7 +1,7 @@ ############################################################################# # # ViSP, open source Visual Servoing Platform software. -# Copyright (C) 2005 - 2019 by Inria. All rights reserved. +# Copyright (C) 2005 - 2023 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 @@ -14,7 +14,7 @@ # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://visp.inria.fr for more information. +# See https://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique @@ -36,9 +36,8 @@ # LIBFREENECT_LIBRARIES # LIBFREENECT_VERSION # -# Authors: -# Celine Teuliere -# Fabien Spindler +############################################################################# + if(WIN32) find_path(LIBFREENECT_HPP_INCLUDE_DIR libfreenect.hpp diff --git a/cmake/FindLIBUSB_1.cmake b/cmake/FindLIBUSB_1.cmake index 1bdbf383b4..4eaf8ae1ce 100644 --- a/cmake/FindLIBUSB_1.cmake +++ b/cmake/FindLIBUSB_1.cmake @@ -1,7 +1,7 @@ ############################################################################# # # ViSP, open source Visual Servoing Platform software. -# Copyright (C) 2005 - 2019 by Inria. All rights reserved. +# Copyright (C) 2005 - 2023 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 @@ -14,7 +14,7 @@ # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://visp.inria.fr for more information. +# See https://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique @@ -36,9 +36,6 @@ # LIBUSB_1_INCLUDE_DIRS # LIBUSB_1_VERSION # -# Authors: -# Celine Teuliere -# Fabien Spindler ############################################################################# if(WIN32) diff --git a/cmake/FindLog1p.cmake b/cmake/FindLog1p.cmake index 8f6f564604..708f94fad0 100644 --- a/cmake/FindLog1p.cmake +++ b/cmake/FindLog1p.cmake @@ -1,7 +1,7 @@ ############################################################################# # # ViSP, open source Visual Servoing Platform software. -# Copyright (C) 2005 - 2022 by Inria. All rights reserved. +# Copyright (C) 2005 - 2023 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 @@ -14,7 +14,7 @@ # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://visp.inria.fr for more information. +# See https://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique @@ -31,9 +31,6 @@ # Description: # Try to find log1p function. # -# Authors: -# Fabien Spindler -# ############################################################################# include(VISPFindUtils) diff --git a/cmake/FindMyCoin3D.cmake b/cmake/FindMyCoin3D.cmake index bbbc41241d..4c37a7b5b9 100644 --- a/cmake/FindMyCoin3D.cmake +++ b/cmake/FindMyCoin3D.cmake @@ -1,7 +1,7 @@ ############################################################################# # # ViSP, open source Visual Servoing Platform software. -# Copyright (C) 2005 - 2019 by Inria. All rights reserved. +# Copyright (C) 2005 - 2023 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 @@ -14,7 +14,7 @@ # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://visp.inria.fr for more information. +# See https://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique @@ -31,15 +31,12 @@ # Description: # Try to find Coin library. Try first to see if Coin3D-3 is available. If not, # check for Coin3D-2. -# Once run this will define: +# Once run this will define: # # COIN3D_FOUND # COIN3D_LIBRARIES # COIN3D_INCLUDE_DIRS # -# Authors: -# Fabien Spindler -# ############################################################################# macro(TRY_COMPILE_WITH_COIN COIN3D_LIB COIN3D_INC) @@ -57,7 +54,7 @@ macro(TRY_COMPILE_WITH_COIN COIN3D_LIB COIN3D_INC) SoSeparator *scene = new SoSeparator; return 0; } - " IS_COMPILER_COMPATIBLE) + " IS_COMPILER_COMPATIBLE) #message("DBG1 IS_COMPILER_COMPATIBLE ${IS_COMPILER_COMPATIBLE}") endmacro() diff --git a/cmake/FindMyGTK2.cmake b/cmake/FindMyGTK2.cmake index 5deb2bac6d..5b95fb4698 100644 --- a/cmake/FindMyGTK2.cmake +++ b/cmake/FindMyGTK2.cmake @@ -1,7 +1,7 @@ ############################################################################# # # ViSP, open source Visual Servoing Platform software. -# Copyright (C) 2005 - 2019 by Inria. All rights reserved. +# Copyright (C) 2005 - 2023 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 @@ -14,7 +14,7 @@ # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://visp.inria.fr for more information. +# See https://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique @@ -30,7 +30,7 @@ # # Description: # Try to find GTK (and glib). -# Once run this will define: +# Once run this will define: # # GTK2_INCLUDE_DIRS - Directories to include to use GTK # GTK2_LIBRARIES - Files to link against to use GTK @@ -38,9 +38,6 @@ # GTK2_GL_FOUND - If false, don't try to use GTK's GL features # GTK2_VERSION # -# Authors: -# Fabien Spindler -# ############################################################################# if(UNIX OR WIN32) @@ -243,7 +240,7 @@ if(UNIX OR WIN32) if(GTK2_harfbuzz_INCLUDE_PATH) LIST(APPEND GTK2_INCLUDE_DIRS ${GTK2_harfbuzz_INCLUDE_PATH} ) endif() - + set( GTK2_LIBRARIES ${GTK2_gtk_LIBRARY} ${GTK2_gdk_LIBRARY} ${GTK2_glib_LIBRARY} @@ -296,7 +293,7 @@ if(UNIX OR WIN32) GTK2_atk_INCLUDE_PATH GTK2_gdkconfig_INCLUDE_PATH GTK2_gobject_LIBRARY - GTK2_pango_INCLUDE_PATH + GTK2_pango_INCLUDE_PATH GTK2_cairo_INCLUDE_PATH GTK2_harfbuzz_INCLUDE_PATH GTK2_gdkpixbuf_INCLUDE_PATH diff --git a/cmake/FindMyJPEG.cmake b/cmake/FindMyJPEG.cmake index 6ec571fea3..299704dc38 100644 --- a/cmake/FindMyJPEG.cmake +++ b/cmake/FindMyJPEG.cmake @@ -1,7 +1,7 @@ ############################################################################# # # ViSP, open source Visual Servoing Platform software. -# Copyright (C) 2005 - 2019 by Inria. All rights reserved. +# Copyright (C) 2005 - 2023 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 @@ -14,7 +14,7 @@ # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://visp.inria.fr for more information. +# See https://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique @@ -30,20 +30,17 @@ # # Description: # Try to find libjpeg library. -# Once run this will define: +# Once run this will define: # # JPEG_FOUND # JPEG_INCLUDE_DIRS # JPEG_LIBRARIES # -# Authors: -# Nicolas Melchior -# ############################################################################# # detection of the Libjpeg headers location if(MINGW) - find_path(JPEG_INCLUDE_DIR + find_path(JPEG_INCLUDE_DIR NAMES jpeglib.h PATHS @@ -60,7 +57,7 @@ if(MINGW) C:/mingw/lib64 ) else() - find_path(JPEG_INCLUDE_DIR + find_path(JPEG_INCLUDE_DIR NAMES jpeglib.h PATHS @@ -92,26 +89,26 @@ endif() JPEG_LIBRARY JPEG_INCLUDE_DIR ) - + ## -------------------------------- - + IF(JPEG_LIBRARY AND JPEG_INCLUDE_DIR) # The material is found. Check if it works on the requested architecture include(CheckCXXSourceCompiles) - + SET(CMAKE_REQUIRED_LIBRARIES ${JPEG_LIBRARY}) SET(CMAKE_REQUIRED_INCLUDES ${JPEG_INCLUDE_DIR}) CHECK_CXX_SOURCE_COMPILES(" - #include + #include #include // Contrib for jpeg image io - #include + #include int main() { struct jpeg_decompress_struct cinfo; struct jpeg_error_mgr jerr; cinfo.err = jpeg_std_error(&jerr); } - " JPEG_BUILD_TEST) + " JPEG_BUILD_TEST) #MESSAGE("JPEG_BUILD_TEST: ${JPEG_BUILD_TEST}") IF(JPEG_BUILD_TEST) SET(JPEG_INCLUDE_DIRS ${JPEG_INCLUDE_DIR}) @@ -120,7 +117,7 @@ IF(JPEG_LIBRARY AND JPEG_INCLUDE_DIR) ELSE() SET(JPEG_FOUND FALSE) #MESSAGE("libjpeg library found but not compatible with architecture.") - ENDIF() + ENDIF() ELSE(JPEG_LIBRARY AND JPEG_INCLUDE_DIR) SET(JPEG_FOUND FALSE) diff --git a/cmake/FindMyOpenCV.cmake b/cmake/FindMyOpenCV.cmake index a9f22bbfad..2be344b3ea 100644 --- a/cmake/FindMyOpenCV.cmake +++ b/cmake/FindMyOpenCV.cmake @@ -1,7 +1,7 @@ ############################################################################# # # ViSP, open source Visual Servoing Platform software. -# Copyright (C) 2005 - 2019 by Inria. All rights reserved. +# Copyright (C) 2005 - 2023 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 @@ -14,7 +14,7 @@ # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://visp.inria.fr for more information. +# See https://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique @@ -29,7 +29,7 @@ # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # # Description: -# Try to find OpenCV framework. +# Try to find OpenCV framework. # # OpenCV_FOUND # OpenCV_INCLUDE_DIRS (only for naoqi) @@ -39,9 +39,6 @@ # OpenCV_VERSION_PATCH # OpenCV_VERSION # -# Authors: -# Fabien Spindler -# ############################################################################# # Parse FILENAME in order to find the cxx macro DEFINE @@ -60,7 +57,7 @@ macro(vp_get_opencv_version_from_hpp FILENAME DEFINE VAR) set(${__var} 0) endif() else() - message("Warning: Cannot retrive OpenCV version from non existing file ${FILENAME}. This may produce build issues.") + message("Warning: Cannot retrieve OpenCV version from non existing file ${FILENAME}. This may produce build issues.") set(${__var} 0) endif() endmacro() @@ -204,4 +201,3 @@ if(CMAKE_TOOLCHAIN_FILE AND I_AM_A_ROBOT) endforeach() endif() endif() - diff --git a/cmake/FindMyPNG.cmake b/cmake/FindMyPNG.cmake index 38dac33153..0c5edb7fc8 100644 --- a/cmake/FindMyPNG.cmake +++ b/cmake/FindMyPNG.cmake @@ -1,7 +1,7 @@ ############################################################################# # # ViSP, open source Visual Servoing Platform software. -# Copyright (C) 2005 - 2019 by Inria. All rights reserved. +# Copyright (C) 2005 - 2023 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 @@ -14,7 +14,7 @@ # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://visp.inria.fr for more information. +# See https://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique @@ -31,21 +31,18 @@ # Description: # Try to find libpng library. # To use the libpng library, the zlib library is required. -# Once run this will define: +# Once run this will define: # # PNG_FOUND # PNG_INCLUDE_DIR # PNG_LIBRARIES # PNG_VERSION_STRING # -# Authors: -# Nicolas Melchior -# ############################################################################# # detection of the Libpng headers location if(MINGW) - find_path(PNG_INCLUDE_DIR + find_path(PNG_INCLUDE_DIR NAMES png.h PATHS @@ -53,7 +50,7 @@ if(MINGW) "$ENV{MINGW_DIR}/include/libpng14" ) else() - find_path(PNG_INCLUDE_DIR + find_path(PNG_INCLUDE_DIR NAMES png.h PATHS @@ -128,7 +125,7 @@ set(PNG_FOUND FALSE) find_package(ZLIB) if(NOT ZLIB_FOUND) - find_package(MyZLIB) + find_package(MyZLIB) endif() if(UNIX) @@ -140,7 +137,7 @@ if(UNIX) vp_get_version_from_pkg("libpng" "${PNG_LIB_DIR}/pkgconfig" PNG_VERSION_STRING) set(PNG_FOUND TRUE) - + endif() else(UNIX) set(PNG_LIBRARIES "") @@ -154,7 +151,7 @@ else(UNIX) list(APPEND PNG_LIBRARIES debug ${PNG_LIBRARY_DEBUG}) set(PNG_FOUND TRUE) endif() -endif(UNIX) +endif(UNIX) if(PNG_FOUND) vp_parse_header2(PNG "${PNG_INCLUDE_DIR}/png.h" PNG_LIBPNG_VER_STRING) @@ -164,12 +161,12 @@ if(ZLIB_FOUND) if(PNG_FOUND) # The material is found. Check if it works on the requested architecture include(CheckCXXSourceCompiles) - + #message(PNG_LIBRARIES: ${PNG_LIBRARIES}) #message(ZLIB_LIBRARIES: ${ZLIB_LIBRARIES}) set(CMAKE_REQUIRED_LIBRARIES ${PNG_LIBRARIES} ${ZLIB_LIBRARIES}) - set(CMAKE_REQUIRED_INCLUDES ${PNG_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIRS}) + set(CMAKE_REQUIRED_INCLUDES ${PNG_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIRS}) CHECK_CXX_SOURCE_COMPILES(" #include // Contrib for png image io int main() @@ -177,7 +174,7 @@ if(ZLIB_FOUND) /* create a png read struct */ png_structp png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); } - " PNG_BUILD_TEST) + " PNG_BUILD_TEST) #message("PNG_BUILD_TEST: ${PNG_BUILD_TEST}") if(PNG_BUILD_TEST) set(PNG_FOUND TRUE) diff --git a/cmake/FindMyZLIB.cmake b/cmake/FindMyZLIB.cmake index 168e0159bb..1e037d7ec7 100644 --- a/cmake/FindMyZLIB.cmake +++ b/cmake/FindMyZLIB.cmake @@ -1,7 +1,7 @@ ############################################################################# # # ViSP, open source Visual Servoing Platform software. -# Copyright (C) 2005 - 2019 by Inria. All rights reserved. +# Copyright (C) 2005 - 2023 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 @@ -14,7 +14,7 @@ # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://visp.inria.fr for more information. +# See https://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique @@ -29,19 +29,16 @@ # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # # Description: -# Try to find zlib library. +# Try to find zlib library. # This file should be used only if FindZLIB.cmake provided with CMake # is not able to detect zlib. -# The detection can be eased by setting ZLIB_HOME environment variable +# The detection can be eased by setting ZLIB_HOME environment variable # especially under windows. # # ZLIB_FOUND # ZLIB_INCLUDE_DIRS # ZLIB_LIBRARIES # -# Authors: -# Fabien Spindler -# ############################################################################# if(MINGW) diff --git a/cmake/FindNetlib.cmake b/cmake/FindNetlib.cmake index be554dd42b..9f835fb98d 100644 --- a/cmake/FindNetlib.cmake +++ b/cmake/FindNetlib.cmake @@ -1,7 +1,7 @@ ############################################################################# # # ViSP, open source Visual Servoing Platform software. -# Copyright (C) 2005 - 2019 by Inria. All rights reserved. +# Copyright (C) 2005 - 2023 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 @@ -14,7 +14,7 @@ # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://visp.inria.fr for more information. +# See https://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique @@ -36,10 +36,6 @@ # NETLIB_LIBRARIES # NETLIB_VERSION # -# Authors: -# Filip Novotny -# Fabien Spindler -# ############################################################################# set(NETLIB_FOUND FALSE) @@ -66,12 +62,12 @@ if(WIN32) NAMES blas PATHS ${NETLIB_LIB_SEARCH_PATH} ) - + find_library(NETLIB_LIBRARY_F2C_RELEASE NAMES libf2c PATHS ${NETLIB_LIB_SEARCH_PATH} ) - + find_library(NETLIB_LIBRARY_NETLIB_DEBUG NAMES lapackd PATHS ${NETLIB_LIB_SEARCH_PATH} @@ -81,12 +77,12 @@ if(WIN32) NAMES blasd PATHS ${NETLIB_LIB_SEARCH_PATH} ) - + find_library(NETLIB_LIBRARY_F2C_DEBUG NAMES libf2cd PATHS ${NETLIB_LIB_SEARCH_PATH} ) - + if((NETLIB_LIBRARY_NETLIB_RELEASE AND NETLIB_LIBRARY_BLAS_RELEASE AND NETLIB_LIBRARY_F2C_RELEASE)) list(APPEND NETLIB_LIBRARIES optimized ${NETLIB_LIBRARY_NETLIB_RELEASE}) list(APPEND NETLIB_LIBRARIES optimized ${NETLIB_LIBRARY_BLAS_RELEASE}) diff --git a/cmake/FindOccipital_Structure.cmake b/cmake/FindOccipital_Structure.cmake index 16d080af63..ccf42d2cf6 100644 --- a/cmake/FindOccipital_Structure.cmake +++ b/cmake/FindOccipital_Structure.cmake @@ -1,7 +1,7 @@ ############################################################################# # # ViSP, open source Visual Servoing Platform software. -# Copyright (C) 2005 - 2021 by Inria. All rights reserved. +# Copyright (C) 2005 - 2023 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 @@ -14,7 +14,7 @@ # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://visp.inria.fr for more information. +# See https://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique diff --git a/cmake/FindPARPORT.cmake b/cmake/FindPARPORT.cmake index e9a111de5d..693024ab26 100644 --- a/cmake/FindPARPORT.cmake +++ b/cmake/FindPARPORT.cmake @@ -1,7 +1,7 @@ ############################################################################# # # ViSP, open source Visual Servoing Platform software. -# Copyright (C) 2005 - 2019 by Inria. All rights reserved. +# Copyright (C) 2005 - 2023 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 @@ -14,7 +14,7 @@ # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://visp.inria.fr for more information. +# See https://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique @@ -30,28 +30,25 @@ # # Description: # Try to find linux/parport.h.h for parallel port usage. -# Once run this will define: +# Once run this will define: # # PARPORT_FOUND # PARPORT_INCLUDE_DIRS # -# Authors: -# Fabien Spindler -# ############################################################################# find_path(PARPORT_INCLUDE_DIRS linux/parport.h - /usr/include + /usr/include /usr/src/linux/include ) mark_as_advanced( PARPORT_INCLUDE_DIRS ) - + if(PARPORT_INCLUDE_DIRS) set(PARPORT_FOUND TRUE) else() set(PARPORT_FOUND FALSE) endif() - + diff --git a/cmake/FindPTHREAD.cmake b/cmake/FindPTHREAD.cmake deleted file mode 100644 index 5a024b90dd..0000000000 --- a/cmake/FindPTHREAD.cmake +++ /dev/null @@ -1,102 +0,0 @@ -############################################################################# -# -# ViSP, open source Visual Servoing Platform software. -# Copyright (C) 2005 - 2019 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 -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# See the file LICENSE.txt at the root directory of this source -# distribution for additional information about the GNU GPL. -# -# For using ViSP with software that can not be combined with the GNU -# GPL, please contact Inria about acquiring a ViSP Professional -# Edition License. -# -# See http://visp.inria.fr for more information. -# -# This software was developed at: -# Inria Rennes - Bretagne Atlantique -# Campus Universitaire de Beaulieu -# 35042 Rennes Cedex -# France -# -# If you have questions regarding the use of this file, please contact -# Inria at visp@inria.fr -# -# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -# -# Description: -# Try to find pthread library. -# Once run this will define: -# -# PTHREAD_FOUND -# PTHREAD_INCLUDE_DIRS -# PTHREAD_LIBRARIES -# -# Authors: -# Fabien Spindler -# -############################################################################# - -if(MINGW) - find_path(PTHREAD_INCLUDE_DIR pthread.h - "$ENV{MINGW_DIR}/include" - "$ENV{MINGW_DIR}/mingw/include" - C:/mingw/mingw/include - ) - - # pthreadVSE pthreadGCE pthreadGC pthreadVC1 pthreadVC2 are comming from web - find_library(PTHREAD_LIBRARY - NAMES pthread pthreadGC2 pthreadVSE pthreadGCE pthreadGC pthreadVC1 pthreadVC2 - PATHS - "$ENV{MINGW_DIR}/lib" - "$ENV{MINGW_DIR}/mingw/lib" - C:/mingw/mingw/lib - ) -else() - find_path(PTHREAD_INCLUDE_DIR pthread.h - "$ENV{PTHREAD_HOME}/include" - "$ENV{PTHREAD_DIR}/include" - /usr/include - ) - # pthreadVSE pthreadGCE pthreadGC pthreadVC1 pthreadVC2 are comming from web - find_library(PTHREAD_LIBRARY - NAMES pthread pthreadGC2 pthreadVSE pthreadGCE pthreadGC pthreadVC1 pthreadVC2 - PATHS - "$ENV{PTHREAD_HOME}/lib" - "$ENV{PTHREAD_DIR}/lib" - /usr/lib - /usr/local/lib - /lib - ) -endif() - #MESSAGE("DBG PTHREAD_INCLUDE_DIR=${PTHREAD_INCLUDE_DIR}") - #MESSAGE(STATUS "DBG PTHREAD_LIBRARY=${PTHREAD_LIBRARY}") - - ## -------------------------------- - - IF(PTHREAD_LIBRARY) - SET(PTHREAD_LIBRARIES ${PTHREAD_LIBRARY}) - ELSE(PTHREAD_LIBRARY) - #MESSAGE(SEND_ERROR "pthread library not found.") - ENDIF(PTHREAD_LIBRARY) - - IF(NOT PTHREAD_INCLUDE_DIR) - #MESSAGE(SEND_ERROR "pthread include dir not found.") - ENDIF(NOT PTHREAD_INCLUDE_DIR) - - IF(PTHREAD_LIBRARIES AND PTHREAD_INCLUDE_DIR) - SET(PTHREAD_INCLUDE_DIRS ${PTHREAD_INCLUDE_DIR}) - SET(PTHREAD_FOUND TRUE) - ELSE(PTHREAD_LIBRARIES AND PTHREAD_INCLUDE_DIR) - SET(PTHREAD_FOUND FALSE) - ENDIF(PTHREAD_LIBRARIES AND PTHREAD_INCLUDE_DIR) - - MARK_AS_ADVANCED( - PTHREAD_INCLUDE_DIR - PTHREAD_LIBRARY - ) - #MESSAGE(STATUS "PTHREAD_FOUND : ${PTHREAD_FOUND}") diff --git a/cmake/FindPTU46.cmake b/cmake/FindPTU46.cmake index 67839cef9a..9e026994a0 100644 --- a/cmake/FindPTU46.cmake +++ b/cmake/FindPTU46.cmake @@ -1,7 +1,7 @@ ############################################################################# # # ViSP, open source Visual Servoing Platform software. -# Copyright (C) 2005 - 2019 by Inria. All rights reserved. +# Copyright (C) 2005 - 2023 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 @@ -14,7 +14,7 @@ # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://visp.inria.fr for more information. +# See https://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique @@ -30,58 +30,55 @@ # # Description: # Try to find libraries for Irisa's Ptu-46 pan-tilt head. -# Once run this will define: +# Once run this will define: # # PTU46_FOUND # PTU46_INCLUDE_DIRS # PTU46_LIBRARIES # -# Authors: -# Fabien Spindler -# ############################################################################# IF(NOT UNIX) # MESSAGE("FindPTU46.cmake: Ptu-46 only available for Unix.") SET(PTU46_FOUND FALSE) ELSE(NOT UNIX) - + FIND_PATH(PTU46_INCLUDE_DIR ptu.h $ENV{PTU46_HOME}/include /udd/fspindle/robot/Ptu-Evi/current/include /local/soft/Ptu-Evi/current/include ) - #MESSAGE("DBG PTU46_INCLUDE_DIR=${PTU46_INCLUDE_DIR}") - + #MESSAGE("DBG PTU46_INCLUDE_DIR=${PTU46_INCLUDE_DIR}") + FIND_LIBRARY(PTUPTU46_LIBRARY NAMES ptu - PATHS + PATHS $ENV{PTU46_HOME}/lib /udd/fspindle/robot/Ptu-Evi/current/lib /local/soft/Ptu-Evi/current/lib ) FIND_LIBRARY(EVIPTU46_LIBRARY NAMES evi - PATHS + PATHS $ENV{PTU46_HOME}/lib /udd/fspindle/robot/Ptu-Evi/current/lib /local/soft/Ptu-Evi/current/lib ) FIND_LIBRARY(SERIALPTU46_LIBRARY NAMES serial - PATHS + PATHS $ENV{PTU46_HOME}/lib /udd/fspindle/robot/Ptu-Evi/current/lib /local/soft/Ptu-Evi/current/lib ) #MESSAGE("DBG PTU46_LIBRARY=${PTU46_LIBRARY}") - + ## -------------------------------- - + IF(PTUPTU46_LIBRARY AND EVIPTU46_LIBRARY AND SERIALPTU46_LIBRARY) # The material is found. Check if it works on the requested architecture include(CheckCXXSourceCompiles) - + SET(CMAKE_REQUIRED_LIBRARIES ${PTUPTU46_LIBRARY} ${SERIALPTU46_LIBRARY}) SET(CMAKE_REQUIRED_INCLUDES ${PTU46_INCLUDE_DIR}) CHECK_CXX_SOURCE_COMPILES(" @@ -91,10 +88,10 @@ ELSE(NOT UNIX) Ptu ptu; return 0; } - " PTU46_BUILD_TEST) + " PTU46_BUILD_TEST) #MESSAGE("PTU46_BUILD_TEST: ${PTU46_BUILD_TEST}") IF(PTU46_BUILD_TEST) - SET(PTU46_LIBRARIES ${PTUPTU46_LIBRARY} ${EVIPTU46_LIBRARY} + SET(PTU46_LIBRARIES ${PTUPTU46_LIBRARY} ${EVIPTU46_LIBRARY} ${SERIALPTU46_LIBRARY}) # ELSE() # MESSAGE("Ptu-46 library found but not compatible with architecture.") @@ -103,18 +100,18 @@ ELSE(NOT UNIX) ELSE(PTUPTU46_LIBRARY AND EVIPTU46_LIBRARY AND SERIALPTU46_LIBRARY) # MESSAGE(SEND_ERROR "Ptu-46 library not found.") ENDIF(PTUPTU46_LIBRARY AND EVIPTU46_LIBRARY AND SERIALPTU46_LIBRARY) - + IF(NOT PTU46_INCLUDE_DIR) # MESSAGE(SEND_ERROR "Ptu-46 include dir not found.") ENDIF(NOT PTU46_INCLUDE_DIR) - + IF(PTU46_LIBRARIES AND PTU46_INCLUDE_DIR) SET(PTU46_INCLUDE_DIRS ${PTU46_INCLUDE_DIR}) SET(PTU46_FOUND TRUE) ELSE(PTU46_LIBRARIES AND PTU46_INCLUDE_DIR) SET(PTU46_FOUND FALSE) ENDIF(PTU46_LIBRARIES AND PTU46_INCLUDE_DIR) - + MARK_AS_ADVANCED( PTU46_INCLUDE_DIR PTU46_LIBRARIES diff --git a/cmake/FindPylon.cmake b/cmake/FindPylon.cmake index 48c05d9726..b4f2f015fb 100644 --- a/cmake/FindPylon.cmake +++ b/cmake/FindPylon.cmake @@ -1,7 +1,7 @@ ############################################################################# # # ViSP, open source Visual Servoing Platform software. -# Copyright (C) 2005 - 2019 by Inria. All rights reserved. +# Copyright (C) 2005 - 2023 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 @@ -14,7 +14,7 @@ # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://visp.inria.fr for more information. +# See https://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique @@ -36,9 +36,6 @@ # PYLON_LIBRARIES # PYLON_VERSION # -# Authors: -# Wenfeng CAI -# Fabien Spindler : compat with OSX and Windows # ############################################################################# diff --git a/cmake/FindQualisys.cmake b/cmake/FindQualisys.cmake index 01575762e7..c2c789847d 100644 --- a/cmake/FindQualisys.cmake +++ b/cmake/FindQualisys.cmake @@ -1,7 +1,7 @@ # ############################################################################ # # ViSP, open source Visual Servoing Platform software. -# Copyright (C) 2005 - 2022 by Inria. All rights reserved. +# Copyright (C) 2005 - 2023 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 @@ -14,7 +14,7 @@ # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://visp.inria.fr for more information. +# See https://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique diff --git a/cmake/FindRAW1394.cmake b/cmake/FindRAW1394.cmake index b84e67d93f..2aae60d7c5 100644 --- a/cmake/FindRAW1394.cmake +++ b/cmake/FindRAW1394.cmake @@ -1,7 +1,7 @@ ############################################################################# # # ViSP, open source Visual Servoing Platform software. -# Copyright (C) 2005 - 2019 by Inria. All rights reserved. +# Copyright (C) 2005 - 2023 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 @@ -14,7 +14,7 @@ # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://visp.inria.fr for more information. +# See https://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique @@ -30,54 +30,51 @@ # # Description: # Try to find libraw1394 for IEEE1394 camera under Linux. -# Once run this will define: +# Once run this will define: # # RAW1394_FOUND # RAW1394_INCLUDE_DIRS # RAW1394_LIBRARIES # -# Authors: -# Fabien Spindler -# ############################################################################# IF(NOT UNIX) # MESSAGE("FindRAW1394.cmake: libraw1394 only available for Unix.") SET(RAW1394_FOUND FALSE) ELSE(NOT UNIX) - + FIND_PATH(RAW1394_INCLUDE_DIR libraw1394/raw1394.h $ENV{RAW1394_HOME}/include /usr/include ) - #MESSAGE("DBG RAW1394_INCLUDE_DIR=${RAW1394_INCLUDE_DIR}") - + #MESSAGE("DBG RAW1394_INCLUDE_DIR=${RAW1394_INCLUDE_DIR}") + FIND_LIBRARY(RAW1394_LIBRARY NAMES raw1394 - PATHS + PATHS $ENV{RAW1394_HOME}/lib /usr/lib ) #MESSAGE("DBG RAW1394_LIBRARY=${RAW1394_LIBRARY}") - + ## -------------------------------- - + IF(RAW1394_LIBRARY) SET(RAW1394_LIBRARIES ${RAW1394_LIBRARY}) ELSE(RAW1394_LIBRARY) #MESSAGE("libraw1394 library not found.") ENDIF(RAW1394_LIBRARY) - + IF(NOT RAW1394_INCLUDE_DIR) #MESSAGE("libraw1394 include dir not found.") ENDIF(NOT RAW1394_INCLUDE_DIR) - + IF(RAW1394_LIBRARIES AND RAW1394_INCLUDE_DIR) SET(RAW1394_INCLUDE_DIRS ${RAW1394_INCLUDE_DIR}) SET(RAW1394_FOUND TRUE) ELSE(RAW1394_LIBRARIES AND RAW1394_INCLUDE_DIR) SET(RAW1394_FOUND FALSE) ENDIF(RAW1394_LIBRARIES AND RAW1394_INCLUDE_DIR) - + MARK_AS_ADVANCED( RAW1394_INCLUDE_DIR RAW1394_LIBRARIES diff --git a/cmake/FindRT.cmake b/cmake/FindRT.cmake index 91d1779801..68a34875c3 100644 --- a/cmake/FindRT.cmake +++ b/cmake/FindRT.cmake @@ -1,7 +1,7 @@ ############################################################################# # # ViSP, open source Visual Servoing Platform software. -# Copyright (C) 2005 - 2019 by Inria. All rights reserved. +# Copyright (C) 2005 - 2023 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 @@ -14,7 +14,7 @@ # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://visp.inria.fr for more information. +# See https://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique @@ -29,33 +29,30 @@ # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # # Description: -# Try to find RT library material +# Try to find RT library material # # RT_FOUND # RT_LIBRARIES # -# Authors: -# Fabien Spindler -# ############################################################################# IF(NOT UNIX) # MESSAGE("FindRT.cmake: only available for Unix.") SET(RT_FOUND FALSE) ELSE(NOT UNIX) - + FIND_LIBRARY(RT_LIBRARY NAMES rt - PATHS + PATHS $ENV{RT_HOME}/lib /usr/lib /usr/local/lib ) #MESSAGE("DBG RT_LIBRARY=${RT_LIBRARY}") - + ## -------------------------------- - + IF(RT_LIBRARY) SET(RT_LIBRARIES ${RT_LIBRARY}) SET(RT_FOUND TRUE) @@ -63,7 +60,7 @@ ELSE(NOT UNIX) SET(RT_FOUND FALSE) #MESSAGE(SEND_ERROR "rt library not found.") ENDIF(RT_LIBRARY) - + MARK_AS_ADVANCED( RT_LIBRARIES RT_LIBRARY diff --git a/cmake/FindRealSense.cmake b/cmake/FindRealSense.cmake index 5043fcbb79..4fa847c4ff 100644 --- a/cmake/FindRealSense.cmake +++ b/cmake/FindRealSense.cmake @@ -1,7 +1,7 @@ ############################################################################# # # ViSP, open source Visual Servoing Platform software. -# Copyright (C) 2005 - 2019 by Inria. All rights reserved. +# Copyright (C) 2005 - 2023 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 @@ -14,7 +14,7 @@ # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://visp.inria.fr for more information. +# See https://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique @@ -30,16 +30,13 @@ # # Description: # Try to find Intel RealSense SDK to work with R200, F200 and SR300 devices. -# Once run this will define: +# Once run this will define: # # REALSENSE_FOUND # REALSENSE_INCLUDE_DIRS # REALSENSE_LIBRARIES # REALSENSE_VERSION # -# Authors: -# Fabien Spindler -# ############################################################################# set(REALSENSE_INC_SEARCH_PATH /usr/local/include) @@ -121,7 +118,7 @@ if(REALSENSE_LIBRARIES AND REALSENSE_INCLUDE_DIRS) else() set(REALSENSE_FOUND FALSE) endif() - + mark_as_advanced( REALSENSE_INCLUDE_DIRS REALSENSE_LIBRARIES diff --git a/cmake/FindRealSense2.cmake b/cmake/FindRealSense2.cmake index 35f0e1a5bd..b6c8b3072c 100644 --- a/cmake/FindRealSense2.cmake +++ b/cmake/FindRealSense2.cmake @@ -1,7 +1,7 @@ ############################################################################# # # ViSP, open source Visual Servoing Platform software. -# Copyright (C) 2005 - 2019 by Inria. All rights reserved. +# Copyright (C) 2005 - 2023 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 @@ -14,7 +14,7 @@ # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://visp.inria.fr for more information. +# See https://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique diff --git a/cmake/FindRound.cmake b/cmake/FindRound.cmake index 5501dd1166..c285d7caec 100644 --- a/cmake/FindRound.cmake +++ b/cmake/FindRound.cmake @@ -1,7 +1,7 @@ ############################################################################# # # ViSP, open source Visual Servoing Platform software. -# Copyright (C) 2005 - 2022 by Inria. All rights reserved. +# Copyright (C) 2005 - 2023 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 @@ -14,7 +14,7 @@ # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://visp.inria.fr for more information. +# See https://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique diff --git a/cmake/FindSOQT.cmake b/cmake/FindSOQT.cmake index 156c1a2f1c..120dea7b5f 100644 --- a/cmake/FindSOQT.cmake +++ b/cmake/FindSOQT.cmake @@ -1,7 +1,7 @@ ############################################################################# # # ViSP, open source Visual Servoing Platform software. -# Copyright (C) 2005 - 2019 by Inria. All rights reserved. +# Copyright (C) 2005 - 2023 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 @@ -14,7 +14,7 @@ # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://visp.inria.fr for more information. +# See https://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique @@ -30,15 +30,12 @@ # # Description: # Try to find SoQt library. -# Once run this will define: +# Once run this will define: # # SOQT_FOUND # SOQT_INCLUDE_DIRS # SOQT_LIBRARIES # -# Authors: -# Fabien Spindler -# ############################################################################# set(SOQT_FOUND FALSE) diff --git a/cmake/FindSOWIN.cmake b/cmake/FindSOWIN.cmake index 14dcf2649b..4b9102c347 100644 --- a/cmake/FindSOWIN.cmake +++ b/cmake/FindSOWIN.cmake @@ -1,7 +1,7 @@ ############################################################################# # # ViSP, open source Visual Servoing Platform software. -# Copyright (C) 2005 - 2019 by Inria. All rights reserved. +# Copyright (C) 2005 - 2023 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 @@ -14,7 +14,7 @@ # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://visp.inria.fr for more information. +# See https://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique @@ -30,7 +30,7 @@ # # Description: # Try to find SoQt library. -# Once run this will define: +# Once run this will define: # # SOWIN_FOUND # SOWIN_INCLUDE_DIRS @@ -38,9 +38,6 @@ # SOWIN_LIBRARY_RELEASE # SOWIN_LIBRARY_DEBUG # -# Authors: -# Fabien Spindler -# Anthony Saunier # ############################################################################# @@ -60,14 +57,14 @@ if(WIN32) "$ENV{COINDIR}/lib" "$ENV{COIN_DIR}/lib" "$ENV{SOWIN_DIR}/lib" - ) + ) FIND_PATH(SOWIN_INCLUDE_DIR Inventor/Win/SoWin.h "$ENV{COINDIR}/include" "$ENV{COIN_DIR}/include" "$ENV{SOWIN_DIR}/include" ) - + ## -------------------------------- set(SOWIN_LIBRARIES "") diff --git a/cmake/FindSOXT.cmake b/cmake/FindSOXT.cmake index 3d6afa8648..6d9922ea6d 100644 --- a/cmake/FindSOXT.cmake +++ b/cmake/FindSOXT.cmake @@ -1,7 +1,7 @@ ############################################################################# # # ViSP, open source Visual Servoing Platform software. -# Copyright (C) 2005 - 2019 by Inria. All rights reserved. +# Copyright (C) 2005 - 2023 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 @@ -14,7 +14,7 @@ # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://visp.inria.fr for more information. +# See https://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique @@ -30,14 +30,11 @@ # # Description: # Try to find SoXt library. -# Once run this will define: +# Once run this will define: # # SOXT_FOUND # SOXT_LIBRARIES # -# Authors: -# Fabien Spindler -# ############################################################################# IF(UNIX) @@ -57,9 +54,9 @@ MARK_AS_ADVANCED( #MESSAGE(STATUS "DBG SOXT_LIBRARY=${SOXT_LIBRARY}") ## -------------------------------- - + IF(SOXT_LIBRARY) - + SET(SOXT_LIBRARIES ${SOXT_LIBRARY}) SET(SOXT_FOUND TRUE) MARK_AS_ADVANCED( diff --git a/cmake/FindStrtof.cmake b/cmake/FindStrtof.cmake index 0e9785f85f..9f18c6e2fa 100644 --- a/cmake/FindStrtof.cmake +++ b/cmake/FindStrtof.cmake @@ -1,7 +1,7 @@ ############################################################################# # # ViSP, open source Visual Servoing Platform software. -# Copyright (C) 2005 - 2019 by Inria. All rights reserved. +# Copyright (C) 2005 - 2023 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 @@ -14,7 +14,7 @@ # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://visp.inria.fr for more information. +# See https://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique @@ -31,9 +31,6 @@ # Description: # Try to find erfc function. # -# Authors: -# Souriya Trinh -# ############################################################################# include(CheckCXXSourceCompiles) diff --git a/cmake/FindTensorRT.cmake b/cmake/FindTensorRT.cmake index 64ef6c5934..439f1957bc 100644 --- a/cmake/FindTensorRT.cmake +++ b/cmake/FindTensorRT.cmake @@ -1,7 +1,7 @@ ############################################################################# # # ViSP, open source Visual Servoing Platform software. -# Copyright (C) 2005 - 2021 by Inria. All rights reserved. +# Copyright (C) 2005 - 2023 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 @@ -14,7 +14,7 @@ # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://visp.inria.fr for more information. +# See https://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique diff --git a/cmake/FindUeye.cmake b/cmake/FindUeye.cmake index c9c8741914..2d6cb277a0 100644 --- a/cmake/FindUeye.cmake +++ b/cmake/FindUeye.cmake @@ -1,7 +1,7 @@ ############################################################################# # # ViSP, open source Visual Servoing Platform software. -# Copyright (C) 2005 - 2019 by Inria. All rights reserved. +# Copyright (C) 2005 - 2023 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 @@ -14,7 +14,7 @@ # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://visp.inria.fr for more information. +# See https://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique diff --git a/cmake/FindV4L2.cmake b/cmake/FindV4L2.cmake index 84c861bb0a..bc5e0e926c 100644 --- a/cmake/FindV4L2.cmake +++ b/cmake/FindV4L2.cmake @@ -1,7 +1,7 @@ ############################################################################# # # ViSP, open source Visual Servoing Platform software. -# Copyright (C) 2005 - 2019 by Inria. All rights reserved. +# Copyright (C) 2005 - 2023 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 @@ -14,7 +14,7 @@ # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://visp.inria.fr for more information. +# See https://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique @@ -29,30 +29,27 @@ # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # # Description: -# Try to find linux/videodev.h for Video For Linux Two framegrabbing +# Try to find linux/videodev.h for Video For Linux Two framegrabbing # capabilities. -# Once run this will define: +# Once run this will define: # # V4L2_FOUND # V4L2_INCLUDE_DIRS # V4L2_LIBRARIES # V4L2_VERSION # -# Authors: -# Fabien Spindler -# ############################################################################# if(NOT UNIX) # MESSAGE("FindV4L2.cmake: only available for Unix.") set(V4L2_FOUND FALSE) else(NOT UNIX) - + find_path(V4L2_INCLUDE_VIDEODEV2 linux/videodev2.h $ENV{V4L2_HOME}/include $ENV{V4L2_DIR}/include - /usr/include - /usr/local/include + /usr/include + /usr/local/include /usr/src/linux/include ) #MESSAGE("DBG V4L2_INCLUDE_VIDEODEV2=${V4L2_INCLUDE_VIDEODEV2}") @@ -60,33 +57,33 @@ else(NOT UNIX) find_path(V4L2_INCLUDE_LIBV4L2 libv4l2.h $ENV{V4L2_HOME}/include $ENV{V4L2_DIR}/include - /usr/include + /usr/include /usr/local/include ) - #MESSAGE("DBG V4L2_INCLUDE_LIBV4L2=${V4L2_INCLUDE_LIBV4L2}") - + #MESSAGE("DBG V4L2_INCLUDE_LIBV4L2=${V4L2_INCLUDE_LIBV4L2}") + find_library(V4L2_LIBRARY_LIBV4L2 NAMES v4l2 - PATHS + PATHS $ENV{V4L2_HOME}/lib - $ENV{V4L2_DIR}/lib + $ENV{V4L2_DIR}/lib /usr/lib /usr/local/lib ) find_library(V4L2_LIBRARY_LIBV4LCONVERT NAMES v4lconvert - PATHS + PATHS $ENV{V4L2_HOME}/lib - $ENV{V4L2_DIR}/lib + $ENV{V4L2_DIR}/lib /usr/lib /usr/local/lib ) - + ## -------------------------------- - - + + if(V4L2_INCLUDE_VIDEODEV2 AND V4L2_INCLUDE_LIBV4L2 AND V4L2_LIBRARY_LIBV4L2 AND V4L2_LIBRARY_LIBV4LCONVERT) set(V4L2_INCLUDE_DIRS ${V4L2_INCLUDE_VIDEODEV2} ${V4L2_INCLUDE_LIBV4L2}) set(V4L2_LIBRARIES ${V4L2_LIBRARY_LIBV4L2} ${V4L2_LIBRARY_LIBV4LCONVERT}) @@ -97,7 +94,7 @@ else(NOT UNIX) else() set(V4L2_FOUND FALSE) endif() - + mark_as_advanced( V4L2_INCLUDE_DIRS V4L2_INCLUDE_VIDEODEV2 diff --git a/cmake/FindVicon.cmake b/cmake/FindVicon.cmake index 41290aa45c..d006680b56 100644 --- a/cmake/FindVicon.cmake +++ b/cmake/FindVicon.cmake @@ -1,7 +1,7 @@ ############################################################################# # # ViSP, open source Visual Servoing Platform software. -# Copyright (C) 2005 - 2022 by Inria. All rights reserved. +# Copyright (C) 2005 - 2023 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 @@ -14,7 +14,7 @@ # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://visp.inria.fr for more information. +# See https://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique diff --git a/cmake/FindViper650_data.cmake b/cmake/FindViper650_data.cmake index 8c9a4107b0..c5bf37b909 100644 --- a/cmake/FindViper650_data.cmake +++ b/cmake/FindViper650_data.cmake @@ -1,7 +1,7 @@ ############################################################################# # # ViSP, open source Visual Servoing Platform software. -# Copyright (C) 2005 - 2019 by Inria. All rights reserved. +# Copyright (C) 2005 - 2023 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 @@ -14,7 +14,7 @@ # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://visp.inria.fr for more information. +# See https://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique @@ -30,17 +30,14 @@ # # Description: # Try to determine if calibration data (camera intrinsic/extrinsic, FT calib file) -# are available for Inria's Viper 650 robot. +# are available for Inria's Viper 650 robot. # # VIPER650_DATA_FOUND # VIPER650_DATA_PATH # -# Authors: -# Fabien Spindler -# ############################################################################# - + find_path(VIPER650_DATA_PATH NAMES include/const_camera_Viper650.xml PATHS @@ -52,7 +49,7 @@ find_path(VIPER650_DATA_PATH ) #message("DBG VIPER650_DATA_PATH=${VIPER650_DATA_PATH}") - + if(VIPER650_DATA_PATH) set(VIPER650_DATA_FOUND TRUE) else() diff --git a/cmake/FindViper850_data.cmake b/cmake/FindViper850_data.cmake index 5ea00f9c7d..b20f9b05f0 100644 --- a/cmake/FindViper850_data.cmake +++ b/cmake/FindViper850_data.cmake @@ -1,7 +1,7 @@ ############################################################################# # # ViSP, open source Visual Servoing Platform software. -# Copyright (C) 2005 - 2019 by Inria. All rights reserved. +# Copyright (C) 2005 - 2023 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 @@ -14,7 +14,7 @@ # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://visp.inria.fr for more information. +# See https://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique @@ -30,17 +30,14 @@ # # Description: # Try to determine if calibration data (camera intrinsic/extrinsic, FT calib file) -# are available for Inria's Viper 850 robot. +# are available for Inria's Viper 850 robot. # # VIPER850_DATA_FOUND # VIPER850_DATA_PATH # -# Authors: -# Fabien Spindler -# ############################################################################# - + find_path(VIPER850_DATA_PATH NAMES include/const_camera_Viper850.xml PATHS @@ -52,7 +49,7 @@ find_path(VIPER850_DATA_PATH ) #message("DBG VIPER850_DATA_PATH=${VIPER850_DATA_PATH}") - + if(VIPER850_DATA_PATH) set(VIPER850_DATA_FOUND TRUE) else() diff --git a/cmake/FindVirtuose.cmake b/cmake/FindVirtuose.cmake index cf2e0d5bf5..9f611f5d1b 100644 --- a/cmake/FindVirtuose.cmake +++ b/cmake/FindVirtuose.cmake @@ -1,7 +1,7 @@ ############################################################################# # # ViSP, open source Visual Servoing Platform software. -# Copyright (C) 2005 - 2019 by Inria. All rights reserved. +# Copyright (C) 2005 - 2023 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 @@ -14,7 +14,7 @@ # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://visp.inria.fr for more information. +# See https://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique @@ -35,9 +35,6 @@ # VIRTUOSE_INCLUDE_DIRS # VIRTUOSE_LIBRARIES # -# Authors: -# Fabien Spindler -# ############################################################################# set(VIRTUOSE_API $ENV{VIRTUOSE_HOME}) @@ -47,9 +44,9 @@ if(UNIX) list(APPEND VIRTUOSE_API /home/soft/virtuose/Livraison_3_97/VirtuoseAPI_v3_97) list(APPEND VIRTUOSE_API /home/soft/virtuose/Livraison_3_90/VirtuoseAPI_v3_93) list(APPEND VIRTUOSE_API /local/virtuose-6D/Livraison_3_90/VirtuoseAPI_v3_93) - + set(VIRTUOSE_OS "linux") - + if(CMAKE_SIZEOF_VOID_P EQUAL 8) list(APPEND VIRTUOSE_ARCH "x64") else() @@ -62,7 +59,7 @@ elseif(MSVC) list(APPEND VIRTUOSE_API "C:/VirtuoseAPI_v3_93") set(VIRTUOSE_OS win) - + if(CMAKE_CL_64) list(APPEND VIRTUOSE_ARCH "x64") else() @@ -92,13 +89,13 @@ elseif(MSVC) else() return() endif() - + set(VIRTUOSE_API_INC "") set(VIRTUOSE_API_LIB "") if(UNIX) foreach(api_ ${VIRTUOSE_API}) - list(APPEND VIRTUOSE_API_INC "${api_}") - list(APPEND VIRTUOSE_API_LIB "${api_}/${VIRTUOSE_OS}/lib/${VIRTUOSE_ARCH}") + list(APPEND VIRTUOSE_API_INC "${api_}") + list(APPEND VIRTUOSE_API_LIB "${api_}/${VIRTUOSE_OS}/lib/${VIRTUOSE_ARCH}") endforeach() elseif(MSVC) foreach(api_ ${VIRTUOSE_API}) @@ -116,7 +113,7 @@ find_path(VIRTUOSE_INCLUDE_DIRS VirtuoseAPI.h if(UNIX) find_library(VIRTUOSE_LIBRARIES NAMES virtuose - PATHS + PATHS ${VIRTUOSE_API_LIB} ) elseif(MSVC) @@ -128,33 +125,33 @@ elseif(MSVC) endforeach() find_library(VIRTUOSE_LIBRARIES_DEBUG NAMES virtuoseDLL - PATHS + PATHS ${VIRTUOSE_API_LIB_DEBUG} ) find_library(VIRTUOSE_LIBRARIES_RELEASE NAMES virtuoseDLL - PATHS + PATHS ${VIRTUOSE_API_LIB_RELEASE} ) - + if(VIRTUOSE_LIBRARIES_DEBUG AND VIRTUOSE_LIBRARIES_RELEASE) set(VIRTUOSE_LIBRARIES debug ${VIRTUOSE_LIBRARIES_DEBUG} optimized ${VIRTUOSE_LIBRARIES_RELEASE}) - + elseif(VIRTUOSE_LIBRARIES_DEBUG) set(VIRTUOSE_LIBRARIES ${VIRTUOSE_LIBRARIES_DEBUG}) elseif(VIRTUOSE_LIBRARIES_RELEASE) set(VIRTUOSE_LIBRARIES ${VIRTUOSE_LIBRARIES_RELEASE}) endif() -endif() +endif() if(VIRTUOSE_LIBRARIES AND VIRTUOSE_INCLUDE_DIRS) set(VIRTUOSE_FOUND TRUE) else() set(VIRTUOSE_FOUND FALSE) endif() - + mark_as_advanced( VIRTUOSE_INCLUDE_DIRS VIRTUOSE_LIBRARIES diff --git a/cmake/FindWS2_32.cmake b/cmake/FindWS2_32.cmake new file mode 100644 index 0000000000..cf8a34a184 --- /dev/null +++ b/cmake/FindWS2_32.cmake @@ -0,0 +1,75 @@ +############################################################################# +# +# ViSP, open source Visual Servoing Platform software. +# Copyright (C) 2005 - 2023 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 +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# See the file LICENSE.txt at the root directory of this source +# distribution for additional information about the GNU GPL. +# +# For using ViSP with software that can not be combined with the GNU +# GPL, please contact Inria about acquiring a ViSP Professional +# Edition License. +# +# See https://visp.inria.fr for more information. +# +# This software was developed at: +# Inria Rennes - Bretagne Atlantique +# Campus Universitaire de Beaulieu +# 35042 Rennes Cedex +# France +# +# If you have questions regarding the use of this file, please contact +# Inria at visp@inria.fr +# +# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +# +# Description: +# Try to find ws2_32 library. +# +# WS2_32_FOUND - true if ws2_32 library is detected +# WS2_32_LIBRARY - Library name +# +############################################################################# + +if(WIN32 AND NOT CYGWIN) + if(MINGW) + set(WS2_32_LIBNAME "ws2_32.a") + check_library_exists(${WS2_32_LIBNAME} getch "" HAVE_LIBWS2_32) # for inet_ntoa() and socket functionalities + if(HAVE_LIBWS2_32) + set(WS2_32_LIBRARY ${WS2_32_LIBNAME}) + set(WS2_32_FOUND TRUE) + else() + find_library(HAVE_LIBWS2_32 ${WS2_32_LIBNAME} + "$ENV{MINGW_DIR}/lib" + "$ENV{MINGW_DIR}/mingw/lib" + C:/mingw/mingw/lib) + if(HAVE_LIBWS2_32) + set(WS2_32_LIBRARY ${WS2_32_LIBNAME}) + set(WS2_32_FOUND TRUE) + else() + set(WS2_32_FOUND FALSE) + endif() + endif() + elseif(WINRT) + # Since check_library_exists() and find_library() does't work to detect ws2_32.lib we add the lib that is part of Windows SDK + set(WS2_32_LIBNAME "ws2_32.lib") + set(WS2_32_LIBRARY ${WS2_32_LIBNAME}) + set(WS2_32_FOUND TRUE) + else() # pure WIN32 + set(WS2_32_LIBNAME "ws2_32.lib") + check_library_exists(${WS2_32_LIBNAME} getch "" HAVE_LIBWS2_32) # for inet_ntoa() and socket functionalities + if(HAVE_LIBWS2_32) + set(WS2_32_LIBRARY ${WS2_32_LIBNAME}) + set(WS2_32_FOUND TRUE) + else() + set(WS2_32_FOUND FALSE) + endif() + endif() + mark_as_advanced(WS2_32_LIBNAME) + mark_as_advanced(HAVE_LIBWS2_32) +endif() diff --git a/cmake/FindXML2.cmake b/cmake/FindXML2.cmake index 7144a2d817..6734a2694f 100644 --- a/cmake/FindXML2.cmake +++ b/cmake/FindXML2.cmake @@ -1,7 +1,7 @@ ############################################################################# # # ViSP, open source Visual Servoing Platform software. -# Copyright (C) 2005 - 2019 by Inria. All rights reserved. +# Copyright (C) 2005 - 2023 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 @@ -14,7 +14,7 @@ # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://visp.inria.fr for more information. +# See https://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique @@ -30,16 +30,13 @@ # # Description: # Try to find XML library. -# Once run this will define: +# Once run this will define: # # XML2_FOUND # XML2_INCLUDE_DIRS # XML2_LIBRARIES # XML2_VERSION_STRING # -# Authors: -# Fabien Spindler -# ############################################################################# @@ -70,7 +67,7 @@ if(WIN32) "c:/libxml2/lib" ) endif() -else(WIN32) +else(WIN32) find_path(XML2_INCLUDE_DIR libxml/xmlmemory.h "$ENV{XML2_DIR}/include/libxml2" "$ENV{XML2_HOME}/include/libxml2" diff --git a/cmake/FindZBAR.cmake b/cmake/FindZBAR.cmake index b3a5a97a60..3ee22ce5c5 100644 --- a/cmake/FindZBAR.cmake +++ b/cmake/FindZBAR.cmake @@ -1,7 +1,7 @@ ############################################################################# # # ViSP, open source Visual Servoing Platform software. -# Copyright (C) 2005 - 2019 by Inria. All rights reserved. +# Copyright (C) 2005 - 2023 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 @@ -14,7 +14,7 @@ # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://visp.inria.fr for more information. +# See https://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique @@ -30,16 +30,13 @@ # # Description: # Try to find zbar library. -# Once run this will define: +# Once run this will define: # # ZBAR_FOUND # ZBAR_INCLUDE_DIRS # ZBAR_LIBRARIES # ZBAR_VERSION # -# Authors: -# Fabien Spindler -# ############################################################################# set(ZBAR_INC_SEARCH_PATH "") @@ -50,7 +47,7 @@ if(MSVC) list(APPEND ZBAR_INC_SEARCH_PATH "C:/ZBarWin64/include") list(APPEND ZBAR_INC_SEARCH_PATH "C:/workspace/ZBarWin64/include") list(APPEND ZBAR_INC_SEARCH_PATH "C:/zbar/ZBarWin64/include") - + if(CMAKE_CL_64) list(APPEND ZBAR_LIB_SEARCH_PATH $ENV{ZBAR_DIR}/x64) list(APPEND ZBAR_LIB_SEARCH_PATH "C:/ZBarWin64/x64") diff --git a/cmake/OgreTools.cmake b/cmake/OgreTools.cmake index 91d7cf607b..4813e5fca9 100644 --- a/cmake/OgreTools.cmake +++ b/cmake/OgreTools.cmake @@ -1,7 +1,7 @@ ############################################################################# # # ViSP, open source Visual Servoing Platform software. -# Copyright (C) 2005 - 2019 by Inria. All rights reserved. +# Copyright (C) 2005 - 2023 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 @@ -14,7 +14,7 @@ # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://visp.inria.fr for more information. +# See https://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique @@ -31,9 +31,6 @@ # Description: # ViSP overall configuration file. Some useful tools for Ogre3D. # -# Authors: -# Fabien Spindler -# ############################################################################# if(WIN32) diff --git a/cmake/PCLTools.cmake b/cmake/PCLTools.cmake index 9525d0a3f9..067620172b 100644 --- a/cmake/PCLTools.cmake +++ b/cmake/PCLTools.cmake @@ -1,7 +1,7 @@ ############################################################################# # # ViSP, open source Visual Servoing Platform software. -# Copyright (C) 2005 - 2021 by Inria. All rights reserved. +# Copyright (C) 2005 - 2023 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 @@ -14,7 +14,7 @@ # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://visp.inria.fr for more information. +# See https://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique @@ -31,9 +31,6 @@ # Description: # ViSP configuration file. # -# Authors: -# Fabien Spindler -# ############################################################################# # Find pcl libraries and dependencies @@ -223,7 +220,7 @@ macro(vp_find_pcl pcl_libraries pcl_deps_include_dirs pcl_deps_libraries) endforeach() # On win10 + msvc 15 2017 with pcl 1.9.1 opengl32.lib needed by vtkRenderingOpenGL-8.1-gd.lib is not found - # Here we explicitely add opengl + # Here we explicitly add opengl if(OPENGL_LIBRARIES) list(APPEND ${pcl_deps_libraries} ${OPENGL_LIBRARIES}) endif() @@ -257,6 +254,7 @@ macro(vp_find_pcl pcl_libraries pcl_deps_include_dirs pcl_deps_libraries) mark_as_advanced(ENSENSO_INCLUDE_DIR ENSENSO_LIBRARY) + mark_as_advanced(flann_DIR) mark_as_advanced(FLANN_INCLUDE_DIR) mark_as_advanced(FLANN_INCLUDE_DIRS) mark_as_advanced(FLANN_LIBRARY) @@ -286,6 +284,9 @@ macro(vp_find_pcl pcl_libraries pcl_deps_include_dirs pcl_deps_libraries) mark_as_advanced(QHULL_INCLUDE_DIRS) mark_as_advanced(QHULL_LIBRARY) mark_as_advanced(QHULL_LIBRARY_DEBUG) + mark_as_advanced(QHULL_LIBRARY_STATIC) # Requested for pcl 1.13.1 on windows + mark_as_advanced(QHULL_LIBRARY_DEBUG_STATIC) # Requested for pcl 1.13.1 on windows + mark_as_advanced(QHULL_LIBRARY_SHARED) # Requested for pcl 1.13.1 on windows mark_as_advanced(Qhull_DIR) # Requested on macOS with pcl 1.12.1 mark_as_advanced(Qt5Core_DIR Qt5Gui_DIR Qt5Network_DIR Qt5WebKit_DIR Qt5Widgets_DIR Qt5Sql_DIR) @@ -295,6 +296,17 @@ macro(vp_find_pcl pcl_libraries pcl_deps_include_dirs pcl_deps_libraries) mark_as_advanced(Qt5Quick_DIR) # Requested on macOS with pcl 1.12.1 mark_as_advanced(Qt5_DIR) # Requested on macOS with pcl 1.12.1 + # Requested on macOS with pcl 1.13.1 + mark_as_advanced(Qt6CoreTools_DIR Qt6Core_DIR Qt6BusTools_DIR Qt6GuiTools_DIR Qt6Gui_DIR Qt6OpenGLWidgets_DIR) + mark_as_advanced(Qt6OpenGL_DIR Qt6WidgetsTools_DIR Qt6Widgets_DIR) + mark_as_advanced(Qt6DBusTools_DIR Qt6DBus_DIR Qt6Network_DIR Qt6QmlCompilerPlusPrivate_DIR) + mark_as_advanced(Qt6QmlIntegration_DIR Qt6QmlModels_DIR Qt6QmlTools_DIR Qt6Qml_DIR Qt6Quick_DIR Qt6Sql_DIR) + mark_as_advanced(Qt6_DIR) + mark_as_advanced(QT_ADDITIONAL_HOST_PACKAGES_PREFIX_PATH) + mark_as_advanced(QT_ADDITIONAL_PACKAGES_PREFIX_PATH) + mark_as_advanced(MACDEPLOYQT_EXECUTABLE) + mark_as_advanced(WrapOpenGL_AGL) + mark_as_advanced(OPENNI2_INCLUDE_DIR) mark_as_advanced(OPENNI2_INCLUDE_DIRS) mark_as_advanced(OPENNI2_LIBRARY) @@ -303,16 +315,22 @@ macro(vp_find_pcl pcl_libraries pcl_deps_include_dirs pcl_deps_libraries) mark_as_advanced(OPENNI_INCLUDE_DIRS) mark_as_advanced(OPENNI_LIBRARY) + mark_as_advanced(PCAP_INCLUDE_DIR) # Requested on macOS with pcl 1.13.1 + mark_as_advanced(PCAP_LIBRARY) # Requested on macOS with pcl 1.13.1 + mark_as_advanced(USB_10_INCLUDE_DIR) mark_as_advanced(USB_10_LIBRARY) - mark_as_advanced(Boost_THREAD_LIBRARY_RELEASE) # Requested on Ubuntu 20.04 - mark_as_advanced(Boost_DATE_TIME_LIBRARY_RELEASE) # Requested on macOS with pcl 1.12.1 - mark_as_advanced(Boost_FILESYSTEM_LIBRARY_RELEASE) # Requested on macOS with pcl 1.12.1 - mark_as_advanced(Boost_INCLUDE_DIR) # Requested on macOS with pcl 1.12.1 - mark_as_advanced(Boost_IOSTREAMS_LIBRARY_RELEASE) # Requested on macOS with pcl 1.12.1 - mark_as_advanced(Boost_SERIALIZATION_LIBRARY_RELEASE) # Requested on macOS with pcl 1.12.1 - mark_as_advanced(Boost_SYSTEM_LIBRARY_RELEASE) # Requested on macOS with pcl 1.12.1 + mark_as_advanced(Boost_INCLUDE_DIR) # Requested on macOS with pcl 1.12.1 + set(configuration "RELEASE;DEBUG") # Requested for pcl 1.13.1 on windows + foreach(config ${configuration}) + mark_as_advanced(Boost_THREAD_LIBRARY_${config}) # Requested on Ubuntu 20.04 + mark_as_advanced(Boost_DATE_TIME_LIBRARY_${config}) # Requested on macOS with pcl 1.12.1 + mark_as_advanced(Boost_FILESYSTEM_LIBRARY_${config}) # Requested on macOS with pcl 1.12.1 + mark_as_advanced(Boost_IOSTREAMS_LIBRARY_${config}) # Requested on macOS with pcl 1.12.1 + mark_as_advanced(Boost_SERIALIZATION_LIBRARY_${config}) # Requested on macOS with pcl 1.12.1 + mark_as_advanced(Boost_SYSTEM_LIBRARY_${config}) # Requested on macOS with pcl 1.12.1 + endforeach() mark_as_advanced(libusb_INCLUDE_DIR) # Requested on macOS with pcl 1.12.1 mark_as_advanced(netCDF_DIR) # Requested on macOS with pcl 1.12.1 @@ -322,6 +340,11 @@ macro(vp_find_pcl pcl_libraries pcl_deps_include_dirs pcl_deps_libraries) mark_as_advanced(OPENGL_GLES3_INCLUDE_DIR) mark_as_advanced(VTK_MPI_NUMPROCS) + mark_as_advanced(VTK_DIR) # Requested on macOS with pcl 1.12.1 mark_as_advanced(TBB_DIR) + + mark_as_advanced(synchronization_LOCATION) # Requested for pcl 1.13.1 on windows + mark_as_advanced($<$ For use with "make install" # Part 3/3: ${BIN_DIR}/win-install/VISPConfig.cmake -> For use within binary installers/packages # -# Authors: -# Fabien Spindler -# ############################################################################# # Macro that returns the relative path to go from a child folder to the parent folder diff --git a/cmake/VISPGenerateConfigScript.cmake b/cmake/VISPGenerateConfigScript.cmake index d2af24ee42..45f33e7285 100644 --- a/cmake/VISPGenerateConfigScript.cmake +++ b/cmake/VISPGenerateConfigScript.cmake @@ -1,7 +1,7 @@ ############################################################################# # # ViSP, open source Visual Servoing Platform software. -# Copyright (C) 2005 - 2019 by Inria. All rights reserved. +# Copyright (C) 2005 - 2023 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 @@ -14,7 +14,7 @@ # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://visp.inria.fr for more information. +# See https://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique @@ -36,9 +36,6 @@ # - visp.pc in /install from visp.pc.in # When make install, this file is copied in /lib/pkgconfig # -# Authors: -# Fabien Spindler -# ############################################################################# if(MINGW OR IOS) @@ -253,7 +250,7 @@ set(TARGET_LOCATION_${item} \"${item}${VISP_VERSION_MAJOR}${VISP_VERSION_MINOR}$ # ============================================================================= else() # DEFINED CMAKE_HELPER_SCRIPT - cmake_minimum_required(VERSION 3.0) + cmake_minimum_required(VERSION 3.5) include("${CMAKE_HELPER_SCRIPT}") include("${VISP_SOURCE_DIR}/cmake/VISPUtils.cmake") diff --git a/cmake/VISPGenerateHeaders.cmake b/cmake/VISPGenerateHeaders.cmake index 0ac2cfe987..2ba4a9c42b 100644 --- a/cmake/VISPGenerateHeaders.cmake +++ b/cmake/VISPGenerateHeaders.cmake @@ -1,7 +1,7 @@ ############################################################################# # # ViSP, open source Visual Servoing Platform software. -# Copyright (C) 2005 - 2019 by Inria. All rights reserved. +# Copyright (C) 2005 - 2023 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 @@ -14,7 +14,7 @@ # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://visp.inria.fr for more information. +# See https://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique @@ -28,9 +28,6 @@ # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # -# Authors: -# Fabien Spindler -# ############################################################################# # ---------------------------------------------------------------------------- diff --git a/cmake/VISPModule.cmake b/cmake/VISPModule.cmake index cfb66cfbe2..eee1761ba1 100644 --- a/cmake/VISPModule.cmake +++ b/cmake/VISPModule.cmake @@ -1,7 +1,7 @@ ############################################################################# # # ViSP, open source Visual Servoing Platform software. -# Copyright (C) 2005 - 2019 by Inria. All rights reserved. +# Copyright (C) 2005 - 2023 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 @@ -14,7 +14,7 @@ # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://visp.inria.fr for more information. +# See https://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique @@ -28,9 +28,6 @@ # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # -# Authors: -# Fabien Spindler -# ############################################################################# # Local variables (set for each module): @@ -788,7 +785,7 @@ endmacro() # creates ViSP module in current folder # creates new target, configures standard dependencies, compilers flags, install rules # Usage: -# vp_create_module( LINK_PRIVATE ) +# vp_create_module() # vp_create_module() macro(vp_create_module) vp_debug_message("vp_create_module(" ${ARGN} ")") @@ -804,14 +801,14 @@ macro(_vp_create_module) vp_add_library(${the_module} ${VISP_MODULE_TYPE} ${VISP_MODULE_${the_module}_HEADERS} ${VISP_MODULE_${the_module}_SOURCES}) vp_target_link_libraries(${the_module} - LINK_PUBLIC + PUBLIC ${VISP_MODULE_${the_module}_DEPS_TO_LINK} ${VISP_MODULE_${the_module}_DEPS_EXT} ${VISP_MODULE_${the_module}_LINK_DEPS} - ${VISP_LINKER_LIBS} - LINK_PRIVATE + PRIVATE ${VISP_MODULE_${the_module}_PRIVATE_REQ_DEPS} - ${VISP_MODULE_${the_module}_PRIVATE_OPT_DEPS}) + ${VISP_MODULE_${the_module}_PRIVATE_OPT_DEPS} + ${VISP_LINKER_LIBS}) add_dependencies(visp_modules ${the_module}) if(ENABLE_SOLUTION_FOLDERS) @@ -1019,7 +1016,7 @@ macro(vp_add_tests) # From source compile the binary and add link rules vp_add_executable(${the_target} ${t}) vp_target_include_modules(${the_target} ${test_deps}) - vp_target_link_libraries(${the_target} ${test_deps} ${VISP_MODULE_${the_module}_DEPS} ${VISP_LINKER_LIBS}) + vp_target_link_libraries(${the_target} ${test_deps} ${VISP_MODULE_${the_module}_DEPS}) # should be removed ? ${VISP_LINKER_LIBS}) # ctest only: # - if required dataset available diff --git a/cmake/VISPUtils.cmake b/cmake/VISPUtils.cmake index bd416a9b78..3fa45576b3 100644 --- a/cmake/VISPUtils.cmake +++ b/cmake/VISPUtils.cmake @@ -1,7 +1,7 @@ ############################################################################# # # ViSP, open source Visual Servoing Platform software. -# Copyright (C) 2005 - 2019 by Inria. All rights reserved. +# Copyright (C) 2005 - 2023 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 @@ -14,7 +14,7 @@ # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://visp.inria.fr for more information. +# See https://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique @@ -28,9 +28,6 @@ # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # -# Authors: -# Fabien Spindler -# ############################################################################# if(NOT COMMAND find_host_program) @@ -282,14 +279,12 @@ set(${list_var}_DST_${__id} \"${${list_var}_DST_${__id}}\") endforeach() endmacro() - macro(vp_copyfiles_make_config_file filename_var list_var) vp_copyfiles_make_config_string(${list_var}_CONFIG ${list_var}) set(${filename_var} "${CMAKE_CURRENT_BINARY_DIR}/copyfiles-${list_var}.cmake") file(WRITE "${${filename_var}}" "${${list_var}_CONFIG}") endmacro() - macro(vp_copyfiles_add_forced_target target list_var comment_str) vp_copyfiles_make_config_file(CONFIG_FILE ${list_var}) vp_cmake_byproducts(__byproducts BYPRODUCTS "${VISP_DEPHELPER}/${target}") @@ -351,6 +346,15 @@ macro(vp_list_filterout lst regex) endforeach() endmacro() +# remove all matching elements from the list +macro(vp_list_filterout lst regex) + foreach(item ${${lst}}) + if(item MATCHES "${regex}") + list(REMOVE_ITEM ${lst} "${item}") + endif() + endforeach() +endmacro() + # stable & safe duplicates removal macro macro(vp_list_unique __lst) if(${__lst}) @@ -432,14 +436,14 @@ macro(vp_list_remove_separator __lst) endif() endmacro() -# remove cmake ; list separator +# replace cmake ; list separator macro(vp_list_replace_separator __lst __separator) if(${__lst}) list(GET ${__lst} 0 __lst_reformated) - list(LENGTH ${__lst} __lenght) - if(__lenght GREATER 1) - MATH(EXPR __lenght "${__lenght} - 1") - foreach(_i RANGE 1 ${__lenght}-1) + list(LENGTH ${__lst} __length) + if(__length GREATER 1) + MATH(EXPR __length "${__length} - 1") + foreach(_i RANGE 1 ${__length}-1) list(GET ${__lst} ${_i} element) set(__lst_reformated "${__lst_reformated}${__separator}${element}") endforeach() @@ -461,7 +465,6 @@ endmacro() # Example: # VP_OPTION(USE_VTK "VTK" "QUIET" "Include vtk support" "" ON) # VP_OPTION(USE_VTK "VTK;COMPONENTS;vtkCommonCore;vtkFiltersSources" "" "Include vtk support" "" ON) - macro(VP_OPTION variable package quiet description advanced value) set(__option TRUE) set(__value ${value}) @@ -925,12 +928,34 @@ macro(vp_check_compiler_flag LANG FLAG RESULT) else() set(__msg "") endif() + if(CMAKE_REQUIRED_LIBRARIES) + set(__link_libs LINK_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES}) + else() + set(__link_libs) + endif() + set(__cmake_flags "") + if(CMAKE_EXE_LINKER_FLAGS) # CMP0056 do this on new CMake + list(APPEND __cmake_flags "-DCMAKE_EXE_LINKER_FLAGS=${CMAKE_EXE_LINKER_FLAGS}") + endif() + + # CMP0067 do this on new CMake + if(DEFINED CMAKE_CXX_STANDARD) + list(APPEND __cmake_flags "-DCMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD}") + endif() + if(DEFINED CMAKE_CXX_STANDARD_REQUIRED) + list(APPEND __cmake_flags "-DCMAKE_CXX_STANDARD_REQUIRED=${CMAKE_CXX_STANDARD_REQUIRED}") + endif() + if(DEFINED CMAKE_CXX_EXTENSIONS) + list(APPEND __cmake_flags "-DCMAKE_CXX_EXTENSIONS=${CMAKE_CXX_EXTENSIONS}") + endif() + message(STATUS "Performing Test ${RESULT}${__msg}") try_compile(${RESULT} "${CMAKE_BINARY_DIR}" "${_fname}" - CMAKE_FLAGS "-DCMAKE_EXE_LINKER_FLAGS=${CMAKE_EXE_LINKER_FLAGS}" # CMP0056 do this on new CMake + CMAKE_FLAGS ${__cmake_flags} COMPILE_DEFINITIONS "${FLAG}" + ${__link_libs} OUTPUT_VARIABLE OUTPUT) if(${RESULT}) @@ -990,8 +1015,10 @@ macro(vp_check_flag_support lang flag varname base_options) endif() string(TOUPPER "${flag}" ${varname}) string(REGEX REPLACE "^(/|-)" "HAVE_${_lang}_" ${varname} "${${varname}}") - string(REGEX REPLACE " -|-|=| |\\." "_" ${varname} "${${varname}}") - vp_check_compiler_flag("${_lang}" "${base_options} ${flag}" ${${varname}} ${ARGN}) + string(REGEX REPLACE " -|-|=| |\\.|," "_" ${varname} "${${varname}}") + if(DEFINED CMAKE_${_lang}_COMPILER) + vp_check_compiler_flag("${_lang}" "${base_options} ${flag}" ${${varname}} ${ARGN}) + endif() endmacro() # turns off warnings @@ -1618,7 +1645,7 @@ macro(vp_get_all_libs _modules _extra_opt _extra_dbg _3rdparty) endif() endforeach() - foreach (dep ${deps} ${VISP_LINKER_LIBS}) + foreach (dep ${deps}) # Should be remove ? ${VISP_LINKER_LIBS}) if (NOT DEFINED VISP_MODULE_${dep}_LOCATION) if(dep MATCHES "^\\$]+)>$") set(dep_dbg "${CMAKE_MATCH_1}") @@ -1919,3 +1946,26 @@ macro(vp_system_information NUMBER_OF_LOGICAL_CORES NUMBER_OF_PHYSICAL_CORES TOT set(${HAS_FPU} ${__HAS_FPU}) set(${CPU_OPTIM} ${__CPU_OPTIM}) endmacro() + +# Replace regular expression in a var +macro(vp_replace_string var_in var_out regular_expression replacement_expression) + set(__var_out ${var_out}) + if(${var_in} MATCHES "${regular_expression}") + string(REGEX REPLACE "${regular_expression}" "${replacement_expression}" ${var_out} ${${var_in}}) + else() + set(${__var_out} ${${var_in}}) + endif() +endmacro() + +macro(vp_list_replace_string list_in list_out regular_expression replacement_expression) + set(__list_out ${var_out}) + foreach(item ${${list_in}}) + if(item MATCHES "${regular_expression}") + string(REGEX REPLACE "${regular_expression}" "${replacement_expression}" var_out ${item}) + else() + set(var_out ${item}) + endif() + list(APPEND __list_out ${var_out}) + endforeach() + set(${list_out} ${__list_out}) +endmacro() diff --git a/cmake/templates/VISPConfig.cmake.in b/cmake/templates/VISPConfig.cmake.in index a38ca0b952..9ea1308534 100644 --- a/cmake/templates/VISPConfig.cmake.in +++ b/cmake/templates/VISPConfig.cmake.in @@ -1,7 +1,7 @@ ############################################################################# # # ViSP, open source Visual Servoing Platform software. -# Copyright (C) 2005 - 2021 by Inria. All rights reserved. +# Copyright (C) 2005 - 2023 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 @@ -14,7 +14,7 @@ # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://visp.inria.fr for more information. +# See https://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique @@ -68,9 +68,6 @@ # # If the module is found then VISP__FOUND is set to TRUE. # -# Authors: -# Fabien Spindler -# ############################################################################# #if(VISP_FOUND) @@ -236,9 +233,7 @@ set(VISP_HAVE_OGRE "@VISP_HAVE_OGRE@") set(VISP_HAVE_OIS "@VISP_HAVE_OIS@") set(VISP_HAVE_OPENBLAS "@VISP_HAVE_OPENBLAS@") set(VISP_HAVE_OPENCV "@VISP_HAVE_OPENCV@") -set(VISP_HAVE_OPENCV_DNN "@VISP_HAVE_OPENCV_DNN@") set(VISP_HAVE_OPENCV_NONFREE "@VISP_HAVE_OPENCV_NONFREE@") -set(VISP_HAVE_OPENCV_OBJDETECT "@VISP_HAVE_OPENCV_OBJDETECT@") set(VISP_HAVE_OPENCV_VERSION "@VISP_HAVE_OPENCV_VERSION@") set(VISP_HAVE_OPENGL "@VISP_HAVE_OPENGL@") set(VISP_HAVE_OPENMP "@VISP_HAVE_OPENMP@") diff --git a/cmake/templates/VISPConfig.root-WIN32.cmake.in b/cmake/templates/VISPConfig.root-WIN32.cmake.in index 4442068236..b9ec2a42ea 100644 --- a/cmake/templates/VISPConfig.root-WIN32.cmake.in +++ b/cmake/templates/VISPConfig.root-WIN32.cmake.in @@ -1,7 +1,7 @@ ############################################################################# # # ViSP, open source Visual Servoing Platform software. -# Copyright (C) 2005 - 2021 by Inria. All rights reserved. +# Copyright (C) 2005 - 2023 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 @@ -14,7 +14,7 @@ # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://visp.inria.fr for more information. +# See https://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique @@ -64,11 +64,57 @@ # include(${VISP_USE_FILE}) # endif() # -# Authors: -# Fabien Spindler -# ############################################################################# +if(NOT DEFINED VISP_STATIC) + # look for global setting + if (NOT DEFINED BUILD_SHARED_LIBS OR BUILD_SHARED_LIBS) + set(VISP_STATIC OFF) + else() + set(VISP_STATIC ON) + endif() +endif() + +function(check_one_config RES) + set($ { RES } "" PARENT_SCOPE) + if (NOT VISP_RUNTIME OR NOT VISP_ARCH) + return() + endif() + set(candidates) + if (VISP_STATIC) + list(APPEND candidates "${VISP_ARCH}/${VISP_RUNTIME}/staticlib") + endif() + list(APPEND candidates "${VISP_ARCH}/${VISP_RUNTIME}/lib") + foreach(c $ { candidates }) + set(p "${VISP_CONFIG_PATH}/${c}") + if (EXISTS "${p}/VISPConfig.cmake") + set($ { RES } "${p}" PARENT_SCOPE) + return() + endif() + endforeach() +endfunction() + +get_filename_component(VISP_CONFIG_PATH "${CMAKE_CURRENT_LIST_FILE}" DIRECTORY) + +function(check_one_config RES) + set(${RES} "" PARENT_SCOPE) + if(NOT VISP_RUNTIME OR NOT VISP_ARCH) + return() + endif() + set(candidates) + if(VISP_STATIC) + list(APPEND candidates "${VISP_ARCH}/${VISP_RUNTIME}/staticlib") + endif() + list(APPEND candidates "${VISP_ARCH}/${VISP_RUNTIME}/lib") + foreach(c ${candidates}) + set(p "${VISP_CONFIG_PATH}/${c}") + if(EXISTS "${p}/VISPConfig.cmake") + set(${RES} "${p}" PARENT_SCOPE) + return() + endif() + endforeach() +endfunction() + # similar code exist in VISPDetectPlatform.cmake if(DEFINED VISP_ARCH AND DEFINED VISP_RUNTIME) # custom overridden values @@ -94,54 +140,58 @@ elseif(MSVC) set(VISP_RUNTIME vc14) elseif(MSVC_VERSION MATCHES "^191[0-9]$") set(VISP_RUNTIME vc15) + check_one_config(has_VS2017) + if(NOT has_VS2017) + set(VISP_RUNTIME vc14) # selecting previous compatible runtime version + endif() elseif(MSVC_VERSION MATCHES "^192[0-9]$") set(VISP_RUNTIME vc16) + check_one_config(has_VS2019) + if(NOT has_VS2019) + set(VISP_RUNTIME vc15) # selecting previous compatible runtime version + check_one_config(has_VS2017) + if(NOT has_VS2017) + set(VISP_RUNTIME vc14) # selecting previous compatible runtime version + endif() + endif() elseif(MSVC_VERSION MATCHES "^193[0-9]$") set(VISP_RUNTIME vc17) + check_one_config(has_VS2022) + if(NOT has_VS2022) + set(VISP_RUNTIME vc16) + check_one_config(has_VS2019) + if(NOT has_VS2019) + set(VISP_RUNTIME vc15) # selecting previous compatible runtime version + check_one_config(has_VS2017) + if(NOT has_VS2017) + set(VISP_RUNTIME vc14) # selecting previous compatible runtime version + endif() + endif() + endif() else() message(WARNING "ViSP does not recognize MSVC_VERSION \"${MSVC_VERSION}\". Cannot set VISP_RUNTIME") endif() elseif(MINGW) set(VISP_RUNTIME mingw) - execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpmachine - OUTPUT_VARIABLE VISP_GCC_TARGET_MACHINE - OUTPUT_STRIP_TRAILING_WHITESPACE) - if(VISP_GCC_TARGET_MACHINE MATCHES "64") - set(MINGW64 1) + if(CMAKE_SYSTEM_PROCESSOR MATCHES "amd64.*|x86_64.*|AMD64.*") set(VISP_ARCH x64) else() set(VISP_ARCH x86) endif() endif() -if(CMAKE_VERSION VERSION_GREATER 2.6.2) - unset(VISP_CONFIG_PATH CACHE) -endif() +check_one_config(VISP_LIB_PATH) if(NOT VISP_FIND_QUIETLY) message(STATUS "ViSP ARCH: ${VISP_ARCH}") message(STATUS "ViSP RUNTIME: ${VISP_RUNTIME}") -endif() - -get_filename_component(VISP_CONFIG_PATH "${CMAKE_CURRENT_LIST_FILE}" PATH CACHE) -if(VISP_RUNTIME AND VISP_ARCH) - if(NOT DEFINED VISP_STATIC AND EXISTS "${VISP_CONFIG_PATH}/${VISP_ARCH}/${VISP_RUNTIME}/lib/VISPConfig.cmake") - set(VISP_LIB_PATH "${VISP_CONFIG_PATH}/${VISP_ARCH}/${VISP_RUNTIME}/lib") - elseif(NOT DEFINED VISP_STATIC AND EXISTS "${VISP_CONFIG_PATH}/${VISP_ARCH}/${VISP_RUNTIME}/staticlib/VISPConfig.cmake") - set(VISP_LIB_PATH "${VISP_CONFIG_PATH}/${VISP_ARCH}/${VISP_RUNTIME}/staticlib") - elseif(VISP_STATIC AND EXISTS "${VISP_CONFIG_PATH}/${VISP_ARCH}/${VISP_RUNTIME}/staticlib/VISPConfig.cmake") - set(VISP_LIB_PATH "${VISP_CONFIG_PATH}/${VISP_ARCH}/${VISP_RUNTIME}/staticlib") - elseif(VISP_STATIC AND EXISTS "${VISP_CONFIG_PATH}/${VISP_ARCH}/${VISP_RUNTIME}/lib/VISPConfig.cmake") - set(VISP_LIB_PATH "${VISP_CONFIG_PATH}/${VISP_ARCH}/${VISP_RUNTIME}/lib") - endif() + message(STATUS "ViSP STATIC: ${VISP_STATIC}") endif() if(VISP_LIB_PATH AND EXISTS "${VISP_LIB_PATH}/VISPConfig.cmake") include("${VISP_LIB_PATH}/VISPConfig.cmake") - set(VISP_FOUND TRUE CACHE BOOL "" FORCE) - if(NOT VISP_FIND_QUIETLY) message(STATUS "Found VISP ${VISP_VERSION} in ${VISP_LIB_PATH}") if(NOT VISP_LIB_PATH MATCHES "/staticlib") @@ -157,5 +207,5 @@ else() You should manually point CMake variable VISP_DIR to your build of ViSP library." ) endif() - set(VISP_FOUND FALSE CACHE BOOL "" FORCE) + set(VISP_FOUND FALSE) endif() diff --git a/cmake/templates/VISPUse.cmake.in b/cmake/templates/VISPUse.cmake.in index 707e76d847..4fdb419d74 100644 --- a/cmake/templates/VISPUse.cmake.in +++ b/cmake/templates/VISPUse.cmake.in @@ -1,7 +1,7 @@ ############################################################################# # # ViSP, open source Visual Servoing Platform software. -# Copyright (C) 2005 - 2019 by Inria. All rights reserved. +# Copyright (C) 2005 - 2023 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 @@ -14,7 +14,7 @@ # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://visp.inria.fr for more information. +# See https://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique @@ -31,9 +31,6 @@ # Description: # cmake PackageConfig file. # -# Authors: -# Fabien Spindler -# ############################################################################# diff --git a/cmake/templates/cmake_uninstall.cmake.in b/cmake/templates/cmake_uninstall.cmake.in index d692124e78..8c06887fad 100644 --- a/cmake/templates/cmake_uninstall.cmake.in +++ b/cmake/templates/cmake_uninstall.cmake.in @@ -1,7 +1,7 @@ ############################################################################# # # ViSP, open source Visual Servoing Platform software. -# Copyright (C) 2005 - 2019 by Inria. All rights reserved. +# Copyright (C) 2005 - 2023 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 @@ -14,7 +14,7 @@ # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://visp.inria.fr for more information. +# See https://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique @@ -31,9 +31,6 @@ # Description: # Comes from http://www.cmake.org/Wiki/CMake_FAQ to create an uninstall target # -# Authors: -# Fabien Spindler -# ############################################################################# IF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") diff --git a/cmake/templates/visp-config.bat.in b/cmake/templates/visp-config.bat.in index 1ab4e2dbde..3ee7336458 100755 --- a/cmake/templates/visp-config.bat.in +++ b/cmake/templates/visp-config.bat.in @@ -1,7 +1,7 @@ @rem ############################################################################# @rem # @rem # ViSP, open source Visual Servoing Platform software. -@rem # Copyright (C) 2005 - 2019 by Inria. All rights reserved. +@rem # Copyright (C) 2005 - 2023 by Inria. All rights reserved. @rem # @rem # This software is free software; you can redistribute it and/or modify @rem # it under the terms of the GNU General Public License as published by @@ -14,7 +14,7 @@ @rem # GPL, please contact Inria about acquiring a ViSP Professional @rem # Edition License. @rem # -@rem # See http://visp.inria.fr for more information. +@rem # See https://visp.inria.fr for more information. @rem # @rem # This software was developed at: @rem # Inria Rennes - Bretagne Atlantique @@ -32,9 +32,6 @@ @rem # visp-config.bat script for Windows. @rem # Auto-generated from visp-config.bat.in by cmake. @rem # -@rem # Authors: -@rem # Fabien Spindler -@rem # @rem ############################################################################# @@ -103,7 +100,7 @@ for %%a in (%*) do ( if "%%a" == "--version" ( echo ViSP %VERSION% Visual Servoing Platform echo. - echo Copyright 2005 - 2019 Inria. All rights reserved. + echo Copyright 2005 - 2023 Inria. All rights reserved. goto END ) if "%%a" == "--dumpversion" ( @@ -115,7 +112,7 @@ for %%a in (%*) do ( :USAGE echo ViSP %VERSION% (Visual Servoing Platform) -echo Copyright (C) 2005 - 2019 Inria. All rights reserved. +echo Copyright (C) 2005 - 2023 Inria. All rights reserved. echo. echo Usage: %0 [--prefix] [--def] [--include] [--openmp] [--libpath] echo [--libs-debug] [--libs-optimized] [--version] [--dumpversion] [--help] diff --git a/cmake/templates/visp-config.in b/cmake/templates/visp-config.in index 5456ad56c5..a66f0c6d9e 100755 --- a/cmake/templates/visp-config.in +++ b/cmake/templates/visp-config.in @@ -3,7 +3,7 @@ ############################################################################# # # ViSP, open source Visual Servoing Platform software. -# Copyright (C) 2005 - 2019 by Inria. All rights reserved. +# Copyright (C) 2005 - 2023 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 @@ -16,7 +16,7 @@ # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://visp.inria.fr for more information. +# See https://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique @@ -34,9 +34,6 @@ # visp-config shell script. # Auto-generated from visp-config.in by cmake. # -# Authors: -# Fabien Spindler -# ############################################################################# @@ -59,7 +56,7 @@ usage() cat < @@ -164,15 +161,15 @@ // Defined if OpenCV xfeatures2d module available. Only since OpenCV >= 3.0.0 #cmakedefine VISP_HAVE_OPENCV_XFEATURES2D -// Defined if OpenCV dnn module available. -#cmakedefine VISP_HAVE_OPENCV_DNN - -// Defined if OpenCV objdetect module available. -#cmakedefine VISP_HAVE_OPENCV_OBJDETECT - // OpenCV version in hexadecimal (for example 2.1.0 gives 0x020100). #ifdef VISP_HAVE_OPENCV # define VISP_HAVE_OPENCV_VERSION ${VISP_HAVE_OPENCV_VERSION} +# include +#endif + +// For compat with previous releases +#if defined(HAVE_OPENCV_OBJDETECT) +#define VISP_HAVE_OPENCV_OBJDETECT #endif // Defined if gtk+-2.0 library available @@ -481,6 +478,9 @@ // Defined if we want to use openmp #cmakedefine VISP_HAVE_OPENMP +// Defined if nlohmann json parser is found +#cmakedefine VISP_HAVE_NLOHMANN_JSON + // Define c++ standard values also available in __cplusplus when gcc is used #define VISP_CXX_STANDARD_98 ${VISP_CXX_STANDARD_98} #define VISP_CXX_STANDARD_11 ${VISP_CXX_STANDARD_11} diff --git a/demo/CMakeLists.txt b/demo/CMakeLists.txt index 7201694e1d..ed09ecfc80 100644 --- a/demo/CMakeLists.txt +++ b/demo/CMakeLists.txt @@ -1,7 +1,7 @@ ############################################################################# # # ViSP, open source Visual Servoing Platform software. -# Copyright (C) 2005 - 2019 by Inria. All rights reserved. +# Copyright (C) 2005 - 2023 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 @@ -14,7 +14,7 @@ # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://visp.inria.fr for more information. +# See https://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique @@ -31,14 +31,11 @@ # Description: # ViSP overall configuration file. # -# Authors: -# Nicolas Melchior -# ############################################################################# -project(ViSP-demo) +cmake_minimum_required(VERSION 3.5) -cmake_minimum_required(VERSION 3.0) +project(ViSP-demo) find_package(VISP) diff --git a/demo/wireframe-simulator/CMakeLists.txt b/demo/wireframe-simulator/CMakeLists.txt index 5d6ce21611..1744567e5e 100644 --- a/demo/wireframe-simulator/CMakeLists.txt +++ b/demo/wireframe-simulator/CMakeLists.txt @@ -1,7 +1,7 @@ ############################################################################# # # ViSP, open source Visual Servoing Platform software. -# Copyright (C) 2005 - 2019 by Inria. All rights reserved. +# Copyright (C) 2005 - 2023 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 @@ -14,7 +14,7 @@ # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://visp.inria.fr for more information. +# See https://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique @@ -31,14 +31,11 @@ # Description: # ViSP overall configuration file. # -# Authors: -# Fabien Spindler -# ############################################################################# -project(demo-wireframe-simulator) +cmake_minimum_required(VERSION 3.5) -cmake_minimum_required(VERSION 3.0) +project(demo-wireframe-simulator) find_package(VISP REQUIRED visp_core visp_robot visp_vs visp_io visp_gui) diff --git a/demo/wireframe-simulator/servoSimu4Points.cpp b/demo/wireframe-simulator/servoSimu4Points.cpp index 9bceb688e7..bffda5e743 100644 --- a/demo/wireframe-simulator/servoSimu4Points.cpp +++ b/demo/wireframe-simulator/servoSimu4Points.cpp @@ -1,7 +1,7 @@ /**************************************************************************** * * ViSP, open source Visual Servoing Platform software. - * Copyright (C) 2005 - 2019 by Inria. All rights reserved. + * Copyright (C) 2005 - 2023 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 @@ -14,7 +14,7 @@ * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://visp.inria.fr for more information. + * See https://visp.inria.fr for more information. * * This software was developed at: * Inria Rennes - Bretagne Atlantique @@ -31,10 +31,7 @@ * Description: * Demonstration of the wireframe simulator with a simple visual servoing * - * Authors: - * Nicolas Melchior - * - *****************************************************************************/ +*****************************************************************************/ /*! \example servoSimu4Points.cpp @@ -175,15 +172,15 @@ int main(int argc, const char **argv) vpImage Iext1(480, 640, 255); vpImage Iext2(480, 640, 255); -#if defined VISP_HAVE_X11 +#if defined(VISP_HAVE_X11) vpDisplayX display[3]; -#elif defined VISP_HAVE_OPENCV +#elif defined(HAVE_OPENCV_HIGHGUI) vpDisplayOpenCV display[3]; -#elif defined VISP_HAVE_GDI +#elif defined(VISP_HAVE_GDI) vpDisplayGDI display[3]; -#elif defined VISP_HAVE_D3D9 +#elif defined(VISP_HAVE_D3D9) vpDisplayD3D display[3]; -#elif defined VISP_HAVE_GTK +#elif defined(VISP_HAVE_GTK) vpDisplayGTK display[3]; #endif @@ -484,7 +481,8 @@ int main(int argc, const char **argv) task.print(); return EXIT_SUCCESS; - } catch (const vpException &e) { + } + catch (const vpException &e) { std::cout << "Catch an exception: " << e << std::endl; return EXIT_FAILURE; } @@ -499,7 +497,7 @@ int main() int main() { std::cout << "You do not have X11, or GDI (Graphical Device Interface), or GTK functionalities to display images..." - << std::endl; + << std::endl; std::cout << "Tip if you are on a unix-like system:" << std::endl; std::cout << "- Install X11, configure again ViSP using cmake and build again this example" << std::endl; std::cout << "Tip if you are on a windows-like system:" << std::endl; diff --git a/demo/wireframe-simulator/servoSimuCylinder.cpp b/demo/wireframe-simulator/servoSimuCylinder.cpp index 21bedde033..3a8d589dd0 100644 --- a/demo/wireframe-simulator/servoSimuCylinder.cpp +++ b/demo/wireframe-simulator/servoSimuCylinder.cpp @@ -1,7 +1,7 @@ /**************************************************************************** * * ViSP, open source Visual Servoing Platform software. - * Copyright (C) 2005 - 2019 by Inria. All rights reserved. + * Copyright (C) 2005 - 2023 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 @@ -14,7 +14,7 @@ * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://visp.inria.fr for more information. + * See https://visp.inria.fr for more information. * * This software was developed at: * Inria Rennes - Bretagne Atlantique @@ -31,10 +31,7 @@ * Description: * Demonstration of the wireframe simulator with a simple visual servoing * - * Authors: - * Nicolas Melchior - * - *****************************************************************************/ +*****************************************************************************/ /*! \example servoSimuCylinder.cpp @@ -173,15 +170,15 @@ int main(int argc, const char **argv) vpImage Iint(480, 640, 255); vpImage Iext(480, 640, 255); -#if defined VISP_HAVE_X11 +#if defined(VISP_HAVE_X11) vpDisplayX display[2]; -#elif defined VISP_HAVE_OPENCV +#elif defined(HAVE_OPENCV_HIGHGUI) vpDisplayOpenCV display[2]; -#elif defined VISP_HAVE_GDI +#elif defined(VISP_HAVE_GDI) vpDisplayGDI display[2]; -#elif defined VISP_HAVE_D3D9 +#elif defined(VISP_HAVE_D3D9) vpDisplayD3D display[2]; -#elif defined VISP_HAVE_GTK +#elif defined(VISP_HAVE_GTK) vpDisplayGTK display[2]; #endif @@ -396,7 +393,7 @@ int main(int argc, const char **argv) // Update the simulator frames sim.set_fMo(wMo); // This line is not really requested since the object - // doesn't move + // doesn't move sim.setCameraPositionRelObj(cMo); if (opt_plot) { @@ -456,7 +453,8 @@ int main(int argc, const char **argv) task.print(); return EXIT_SUCCESS; - } catch (const vpException &e) { + } + catch (const vpException &e) { std::cout << "Catch an exception: " << e << std::endl; return EXIT_FAILURE; } @@ -471,7 +469,7 @@ int main() int main() { std::cout << "You do not have X11, or GDI (Graphical Device Interface), or GTK functionalities to display images..." - << std::endl; + << std::endl; std::cout << "Tip if you are on a unix-like system:" << std::endl; std::cout << "- Install X11, configure again ViSP using cmake and build again this example" << std::endl; std::cout << "Tip if you are on a windows-like system:" << std::endl; diff --git a/demo/wireframe-simulator/servoSimuSphere.cpp b/demo/wireframe-simulator/servoSimuSphere.cpp index 35280dd8ca..4bbee3396c 100644 --- a/demo/wireframe-simulator/servoSimuSphere.cpp +++ b/demo/wireframe-simulator/servoSimuSphere.cpp @@ -1,7 +1,7 @@ /**************************************************************************** * * ViSP, open source Visual Servoing Platform software. - * Copyright (C) 2005 - 2019 by Inria. All rights reserved. + * Copyright (C) 2005 - 2023 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 @@ -14,7 +14,7 @@ * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://visp.inria.fr for more information. + * See https://visp.inria.fr for more information. * * This software was developed at: * Inria Rennes - Bretagne Atlantique @@ -31,10 +31,7 @@ * Description: * Demonstration of the wireframe simulator with a simple visual servoing * - * Authors: - * Nicolas Melchior - * - *****************************************************************************/ +*****************************************************************************/ /*! \example servoSimuSphere.cpp @@ -177,7 +174,7 @@ void computeVisualFeatures(const vpSphere &sphere, vpGenericFeature &s) // if (gx != 0 || gy != 0) if (std::fabs(gx) > std::numeric_limits::epsilon() || std::fabs(gy) > std::numeric_limits::epsilon()) h2 = (vpMath::sqr(gx) + vpMath::sqr(gy)) / - (4 * n20 * vpMath::sqr(gy) + 4 * n02 * vpMath::sqr(gx) - 8 * n11 * gx * gy); + (4 * n20 * vpMath::sqr(gy) + 4 * n02 * vpMath::sqr(gx) - 8 * n11 * gx * gy); else h2 = 1 / (4 * n20); @@ -229,15 +226,15 @@ int main(int argc, const char **argv) vpImage Iext1(480, 640, 255); vpImage Iext2(480, 640, 255); -#if defined VISP_HAVE_X11 +#if defined(VISP_HAVE_X11) vpDisplayX display[3]; -#elif defined VISP_HAVE_OPENCV +#elif defined(HAVE_OPENCV_HIGHGUI) vpDisplayOpenCV display[3]; -#elif defined VISP_HAVE_GDI +#elif defined(VISP_HAVE_GDI) vpDisplayGDI display[3]; -#elif defined VISP_HAVE_D3D9 +#elif defined(VISP_HAVE_D3D9) vpDisplayD3D display[3]; -#elif defined VISP_HAVE_GTK +#elif defined(VISP_HAVE_GTK) vpDisplayGTK display[3]; #endif @@ -492,7 +489,8 @@ int main(int argc, const char **argv) task.print(); return EXIT_SUCCESS; - } catch (const vpException &e) { + } + catch (const vpException &e) { std::cout << "Catch an exception: " << e << std::endl; return EXIT_FAILURE; } @@ -507,7 +505,7 @@ int main() int main() { std::cout << "You do not have X11, or GDI (Graphical Device Interface), or GTK functionalities to display images..." - << std::endl; + << std::endl; std::cout << "Tip if you are on a unix-like system:" << std::endl; std::cout << "- Install X11, configure again ViSP using cmake and build again this example" << std::endl; std::cout << "Tip if you are on a windows-like system:" << std::endl; diff --git a/doc/biblio/references.bib b/doc/biblio/references.bib index b817824eef..ec1032cbe6 100644 --- a/doc/biblio/references.bib +++ b/doc/biblio/references.bib @@ -674,3 +674,9 @@ @article{Malvar2004HighqualityLI volume = {3}, pages = {iii-485} } +@inproceedings{Labbe2022Megapose, + title = {{{MegaPose}}: {{6D Pose Estimation}} of {{Novel Objects}} via {{Render}} \& {{Compare}}}, + booktitle = {CoRL}, + author = {Labb\'e, Yann and Manuelli, Lucas and Mousavian, Arsalan and Tyree, Stephen and Birchfield, Stan and Tremblay, Jonathan and Carpentier, Justin and Aubry, Mathieu and Fox, Dieter and Sivic, Josef}, + date = {2022} +} \ No newline at end of file diff --git a/doc/config-doxygen.in b/doc/config-doxygen.in index a572cd5499..b2e49cdc13 100644 --- a/doc/config-doxygen.in +++ b/doc/config-doxygen.in @@ -314,7 +314,7 @@ OPTIMIZE_OUTPUT_SLICE = NO # Note that for custom extensions you also need to set FILE_PATTERNS otherwise # the files are not read by doxygen. -EXTENSION_MAPPING = +EXTENSION_MAPPING = json=JavaScript # If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments # according to the Markdown format, which allows for more readable @@ -857,7 +857,8 @@ FILE_PATTERNS = *.h \ *.cpp \ *.doc \ *.dox \ - *.mm + *.mm \ + *.json # The RECURSIVE tag can be used to specify whether or not subdirectories should # be searched for input files as well. @@ -915,6 +916,8 @@ EXAMPLE_PATH = "@VISP_SOURCE_DIR@/example" \ "@VISP_SOURCE_DIR@/tutorial" \ "@VISP_SOURCE_DIR@/demo" \ "@VISP_SOURCE_DIR@/modules" \ + "@VISP_SOURCE_DIR@/script" \ + # If the value of the EXAMPLE_PATH tag contains directories, you can use the # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and @@ -2180,15 +2183,24 @@ PREDEFINED = @DOXYGEN_SHOULD_SKIP_THIS@ \ VISP_HAVE_LIBFREENECT_AND_DEPENDENCIES \ VISP_HAVE_LIBUSB_1 \ VISP_HAVE_MAVSDK \ + VISP_HAVE_NLOHMANN_JSON \ VISP_HAVE_OCCIPITAL_STRUCTURE \ VISP_HAVE_OGRE \ VISP_HAVE_OGRE_PLUGINS_PATH \ VISP_HAVE_OGRE_RESOURCES_PATH \ VISP_HAVE_OIS \ VISP_HAVE_OPENCV \ - VISP_HAVE_OPENCV_DNN \ VISP_HAVE_OPENCV_NONFREE \ VISP_HAVE_OPENCV_VERSION=0x030403 \ + HAVE_OPENCV_CALIB3D \ + HAVE_OPENCV_DNN \ + HAVE_OPENCV_FEATURES2D \ + HAVE_OPENCV_HIGHGUI \ + HAVE_OPENCV_IMGCODECS \ + HAVE_OPENCV_IMGPROC \ + HAVE_OPENCV_OBJDETECT \ + HAVE_OPENCV_VIDEO \ + HAVE_OPENCV_VIDEOIO \ VISP_HAVE_OPENGL \ VISP_HAVE_PARPORT \ VISP_HAVE_PCL \ diff --git a/doc/image/cpp/megapose_architecture.jpg b/doc/image/cpp/megapose_architecture.jpg new file mode 100644 index 0000000000..51ed91f93b Binary files /dev/null and b/doc/image/cpp/megapose_architecture.jpg differ diff --git a/doc/image/tutorial/gui/img-tutorial-pcl-viewer.png b/doc/image/tutorial/gui/img-tutorial-pcl-viewer.png new file mode 100644 index 0000000000..721af7c9c5 Binary files /dev/null and b/doc/image/tutorial/gui/img-tutorial-pcl-viewer.png differ diff --git a/doc/image/tutorial/image/img-monkey-canny.png b/doc/image/tutorial/image/img-monkey-canny.png index 9fef772d84..6fc979de9e 100644 Binary files a/doc/image/tutorial/image/img-monkey-canny.png and b/doc/image/tutorial/image/img-monkey-canny.png differ diff --git a/doc/image/tutorial/imgproc/img-tutorial-cht-center-votes.png b/doc/image/tutorial/imgproc/img-tutorial-cht-center-votes.png new file mode 100644 index 0000000000..273bdbc833 Binary files /dev/null and b/doc/image/tutorial/imgproc/img-tutorial-cht-center-votes.png differ diff --git a/doc/image/tutorial/imgproc/img-tutorial-cht-radius-votes.png b/doc/image/tutorial/imgproc/img-tutorial-cht-radius-votes.png new file mode 100644 index 0000000000..9bf16887df Binary files /dev/null and b/doc/image/tutorial/imgproc/img-tutorial-cht-radius-votes.png differ diff --git a/doc/image/tutorial/misc/blenderproc_rgb_example.png b/doc/image/tutorial/misc/blenderproc_rgb_example.png new file mode 100644 index 0000000000..4e37901b92 Binary files /dev/null and b/doc/image/tutorial/misc/blenderproc_rgb_example.png differ diff --git a/doc/image/tutorial/misc/blenderproc_viz.png b/doc/image/tutorial/misc/blenderproc_viz.png new file mode 100644 index 0000000000..b35f304bb0 Binary files /dev/null and b/doc/image/tutorial/misc/blenderproc_viz.png differ diff --git a/doc/image/tutorial/tracking/megapose/blender_import.png b/doc/image/tutorial/tracking/megapose/blender_import.png new file mode 100644 index 0000000000..b312530b4b Binary files /dev/null and b/doc/image/tutorial/tracking/megapose/blender_import.png differ diff --git a/doc/image/tutorial/tracking/megapose/deleting_wireframe.png b/doc/image/tutorial/tracking/megapose/deleting_wireframe.png new file mode 100644 index 0000000000..b147d56c37 Binary files /dev/null and b/doc/image/tutorial/tracking/megapose/deleting_wireframe.png differ diff --git a/doc/image/tutorial/tracking/megapose/megapose-bad-origin-model.png b/doc/image/tutorial/tracking/megapose/megapose-bad-origin-model.png new file mode 100644 index 0000000000..706c0d9bd9 Binary files /dev/null and b/doc/image/tutorial/tracking/megapose/megapose-bad-origin-model.png differ diff --git a/doc/image/tutorial/tracking/megapose/megapose-bake-color-attr.png b/doc/image/tutorial/tracking/megapose/megapose-bake-color-attr.png new file mode 100644 index 0000000000..c03b9e2d08 Binary files /dev/null and b/doc/image/tutorial/tracking/megapose/megapose-bake-color-attr.png differ diff --git a/doc/image/tutorial/tracking/megapose/megapose-color-attr.png b/doc/image/tutorial/tracking/megapose/megapose-color-attr.png new file mode 100644 index 0000000000..4c6931058b Binary files /dev/null and b/doc/image/tutorial/tracking/megapose/megapose-color-attr.png differ diff --git a/doc/image/tutorial/tracking/megapose/megapose-cycles.png b/doc/image/tutorial/tracking/megapose/megapose-cycles.png new file mode 100644 index 0000000000..2d0787b2c4 Binary files /dev/null and b/doc/image/tutorial/tracking/megapose/megapose-cycles.png differ diff --git a/doc/image/tutorial/tracking/megapose/megapose-good-origin-model.png b/doc/image/tutorial/tracking/megapose/megapose-good-origin-model.png new file mode 100644 index 0000000000..aaf8c1e378 Binary files /dev/null and b/doc/image/tutorial/tracking/megapose/megapose-good-origin-model.png differ diff --git a/doc/image/tutorial/tracking/megapose/megapose-measuring.png b/doc/image/tutorial/tracking/megapose/megapose-measuring.png new file mode 100644 index 0000000000..42e564d4e0 Binary files /dev/null and b/doc/image/tutorial/tracking/megapose/megapose-measuring.png differ diff --git a/doc/image/tutorial/tracking/megapose/megapose-obj-export.png b/doc/image/tutorial/tracking/megapose/megapose-obj-export.png new file mode 100644 index 0000000000..8e3af04ec4 Binary files /dev/null and b/doc/image/tutorial/tracking/megapose/megapose-obj-export.png differ diff --git a/doc/image/tutorial/tracking/megapose/megapose_pipeline.png b/doc/image/tutorial/tracking/megapose/megapose_pipeline.png new file mode 100644 index 0000000000..f6afb2e706 Binary files /dev/null and b/doc/image/tutorial/tracking/megapose/megapose_pipeline.png differ diff --git a/doc/image/tutorial/tracking/megapose/model_after_import.png b/doc/image/tutorial/tracking/megapose/model_after_import.png new file mode 100644 index 0000000000..8c35ff8745 Binary files /dev/null and b/doc/image/tutorial/tracking/megapose/model_after_import.png differ diff --git a/doc/image/tutorial/tracking/megapose/model_cleaned.png b/doc/image/tutorial/tracking/megapose/model_cleaned.png new file mode 100644 index 0000000000..7abf2d1887 Binary files /dev/null and b/doc/image/tutorial/tracking/megapose/model_cleaned.png differ diff --git a/doc/image/tutorial/tracking/megapose/ruler_tool.png b/doc/image/tutorial/tracking/megapose/ruler_tool.png new file mode 100644 index 0000000000..af452827a8 Binary files /dev/null and b/doc/image/tutorial/tracking/megapose/ruler_tool.png differ diff --git a/doc/image/tutorial/tracking/megapose/snapping.png b/doc/image/tutorial/tracking/megapose/snapping.png new file mode 100644 index 0000000000..9116e86f43 Binary files /dev/null and b/doc/image/tutorial/tracking/megapose/snapping.png differ diff --git a/doc/image/tutorial/tracking/megapose/viewport_mode.png b/doc/image/tutorial/tracking/megapose/viewport_mode.png new file mode 100644 index 0000000000..0eb5624767 Binary files /dev/null and b/doc/image/tutorial/tracking/megapose/viewport_mode.png differ diff --git a/doc/image/tutorial/tracking/megapose/wrong_dimensions.png b/doc/image/tutorial/tracking/megapose/wrong_dimensions.png new file mode 100644 index 0000000000..2c183ec70e Binary files /dev/null and b/doc/image/tutorial/tracking/megapose/wrong_dimensions.png differ diff --git a/doc/image/tutorial/visual-servo/ibvs-python-plots/cMo.jpg b/doc/image/tutorial/visual-servo/ibvs-python-plots/cMo.jpg new file mode 100644 index 0000000000..79932ddf6c Binary files /dev/null and b/doc/image/tutorial/visual-servo/ibvs-python-plots/cMo.jpg differ diff --git a/doc/image/tutorial/visual-servo/ibvs-python-plots/cMo_3d.jpg b/doc/image/tutorial/visual-servo/ibvs-python-plots/cMo_3d.jpg new file mode 100644 index 0000000000..eef32c65a4 Binary files /dev/null and b/doc/image/tutorial/visual-servo/ibvs-python-plots/cMo_3d.jpg differ diff --git a/doc/image/tutorial/visual-servo/ibvs-python-plots/error.jpg b/doc/image/tutorial/visual-servo/ibvs-python-plots/error.jpg new file mode 100644 index 0000000000..55d65a18cf Binary files /dev/null and b/doc/image/tutorial/visual-servo/ibvs-python-plots/error.jpg differ diff --git a/doc/image/tutorial/visual-servo/ibvs-python-plots/trajectories_2d.jpg b/doc/image/tutorial/visual-servo/ibvs-python-plots/trajectories_2d.jpg new file mode 100644 index 0000000000..6f6ed8eebc Binary files /dev/null and b/doc/image/tutorial/visual-servo/ibvs-python-plots/trajectories_2d.jpg differ diff --git a/doc/image/tutorial/visual-servo/ibvs-python-plots/velocity.jpg b/doc/image/tutorial/visual-servo/ibvs-python-plots/velocity.jpg new file mode 100644 index 0000000000..57d28a45cb Binary files /dev/null and b/doc/image/tutorial/visual-servo/ibvs-python-plots/velocity.jpg differ diff --git a/doc/image/tutorial/windows/img-cmake-win10-mingw-visp-config.jpg b/doc/image/tutorial/windows/img-cmake-win10-mingw-visp-config.jpg new file mode 100644 index 0000000000..b7bc1416f4 Binary files /dev/null and b/doc/image/tutorial/windows/img-cmake-win10-mingw-visp-config.jpg differ diff --git a/doc/image/tutorial/windows/img-cmake-win10-mingw-visp-config.png b/doc/image/tutorial/windows/img-cmake-win10-mingw-visp-config.png deleted file mode 100644 index ea8c678c09..0000000000 Binary files a/doc/image/tutorial/windows/img-cmake-win10-mingw-visp-config.png and /dev/null differ diff --git a/doc/image/tutorial/windows/img-cmake-win10-mingw-visp-generate.png b/doc/image/tutorial/windows/img-cmake-win10-mingw-visp-generate.png deleted file mode 100644 index 51700dbe1a..0000000000 Binary files a/doc/image/tutorial/windows/img-cmake-win10-mingw-visp-generate.png and /dev/null differ diff --git a/doc/image/tutorial/windows/img-cmake-win10-msvc17-visp-config.jpg b/doc/image/tutorial/windows/img-cmake-win10-msvc17-visp-config.jpg index ce6f9db7e2..c830feca1b 100644 Binary files a/doc/image/tutorial/windows/img-cmake-win10-msvc17-visp-config.jpg and b/doc/image/tutorial/windows/img-cmake-win10-msvc17-visp-config.jpg differ diff --git a/doc/image/tutorial/windows/img-cmake-win10-msvc17-visp-config2.jpg b/doc/image/tutorial/windows/img-cmake-win10-msvc17-visp-config2.jpg deleted file mode 100644 index c7871f80d6..0000000000 Binary files a/doc/image/tutorial/windows/img-cmake-win10-msvc17-visp-config2.jpg and /dev/null differ diff --git a/doc/image/tutorial/windows/img-cmake-win10-msvc17-visp-generate.jpg b/doc/image/tutorial/windows/img-cmake-win10-msvc17-visp-generate.jpg deleted file mode 100644 index 5b56cf8f4c..0000000000 Binary files a/doc/image/tutorial/windows/img-cmake-win10-msvc17-visp-generate.jpg and /dev/null differ diff --git a/doc/image/tutorial/windows/img-cmake-win11-msvc17-visp-config2.jpg b/doc/image/tutorial/windows/img-cmake-win11-msvc17-visp-config2.jpg deleted file mode 100644 index b6fe7aa240..0000000000 Binary files a/doc/image/tutorial/windows/img-cmake-win11-msvc17-visp-config2.jpg and /dev/null differ diff --git a/doc/image/tutorial/windows/img-cmake-win11-msvc17-visp-generate.jpg b/doc/image/tutorial/windows/img-cmake-win11-msvc17-visp-generate.jpg deleted file mode 100644 index 1a02c25e23..0000000000 Binary files a/doc/image/tutorial/windows/img-cmake-win11-msvc17-visp-generate.jpg and /dev/null differ diff --git a/doc/image/tutorial/windows/img-mingw-explorator.jpg b/doc/image/tutorial/windows/img-mingw-explorator.jpg new file mode 100644 index 0000000000..5ee748db24 Binary files /dev/null and b/doc/image/tutorial/windows/img-mingw-explorator.jpg differ diff --git a/doc/image/tutorial/windows/img-win11-extract-opencv.jpg b/doc/image/tutorial/windows/img-win-extract-opencv.jpg similarity index 100% rename from doc/image/tutorial/windows/img-win11-extract-opencv.jpg rename to doc/image/tutorial/windows/img-win-extract-opencv.jpg diff --git a/doc/image/tutorial/windows/img-win-visp-images-git.jpg b/doc/image/tutorial/windows/img-win-visp-images-git.jpg new file mode 100644 index 0000000000..abea07a0e2 Binary files /dev/null and b/doc/image/tutorial/windows/img-win-visp-images-git.jpg differ diff --git a/doc/image/tutorial/windows/img-win-visp-images-last-release.jpg b/doc/image/tutorial/windows/img-win-visp-images-last-release.jpg new file mode 100644 index 0000000000..c03062c4b9 Binary files /dev/null and b/doc/image/tutorial/windows/img-win-visp-images-last-release.jpg differ diff --git a/doc/image/tutorial/windows/img-win10-extract-opencv-3rdparty.jpg b/doc/image/tutorial/windows/img-win10-extract-opencv-3rdparty.jpg deleted file mode 100644 index 4a1221de4f..0000000000 Binary files a/doc/image/tutorial/windows/img-win10-extract-opencv-3rdparty.jpg and /dev/null differ diff --git a/doc/image/tutorial/windows/img-win10-extract-opencv.png b/doc/image/tutorial/windows/img-win10-extract-opencv.png deleted file mode 100644 index 73787a8a41..0000000000 Binary files a/doc/image/tutorial/windows/img-win10-extract-opencv.png and /dev/null differ diff --git a/doc/image/tutorial/windows/img-win10-mingw-visp-explorer-install.jpg b/doc/image/tutorial/windows/img-win10-mingw-visp-explorer-install.jpg new file mode 100644 index 0000000000..7018ac9ecf Binary files /dev/null and b/doc/image/tutorial/windows/img-win10-mingw-visp-explorer-install.jpg differ diff --git a/doc/image/tutorial/windows/img-win10-mingw-visp-explorer-install.png b/doc/image/tutorial/windows/img-win10-mingw-visp-explorer-install.png deleted file mode 100644 index 491cb9417a..0000000000 Binary files a/doc/image/tutorial/windows/img-win10-mingw-visp-explorer-install.png and /dev/null differ diff --git a/doc/image/tutorial/windows/img-win10-msvc17-visp-explorer-install.jpg b/doc/image/tutorial/windows/img-win10-msvc17-visp-explorer-install.jpg index ce92e02196..10be91c2b6 100644 Binary files a/doc/image/tutorial/windows/img-win10-msvc17-visp-explorer-install.jpg and b/doc/image/tutorial/windows/img-win10-msvc17-visp-explorer-install.jpg differ diff --git a/doc/image/tutorial/windows/img-win10-msvc17-visp-images-3.5.0.jpg b/doc/image/tutorial/windows/img-win10-msvc17-visp-images-3.5.0.jpg deleted file mode 100644 index b9c0e29c42..0000000000 Binary files a/doc/image/tutorial/windows/img-win10-msvc17-visp-images-3.5.0.jpg and /dev/null differ diff --git a/doc/image/tutorial/windows/img-win10-msvc17-visp-images.jpg b/doc/image/tutorial/windows/img-win10-msvc17-visp-images.jpg deleted file mode 100644 index 456e747f0d..0000000000 Binary files a/doc/image/tutorial/windows/img-win10-msvc17-visp-images.jpg and /dev/null differ diff --git a/doc/image/tutorial/windows/img-win10-visp-images-3.3.0.png b/doc/image/tutorial/windows/img-win10-visp-images-3.3.0.png deleted file mode 100644 index 27fcd4f5da..0000000000 Binary files a/doc/image/tutorial/windows/img-win10-visp-images-3.3.0.png and /dev/null differ diff --git a/doc/image/tutorial/windows/img-win10-visp-images-git.png b/doc/image/tutorial/windows/img-win10-visp-images-git.png deleted file mode 100644 index 5c72f6ea24..0000000000 Binary files a/doc/image/tutorial/windows/img-win10-visp-images-git.png and /dev/null differ diff --git a/doc/image/tutorial/windows/img-win10-visp-images.png b/doc/image/tutorial/windows/img-win10-visp-images.png deleted file mode 100644 index 0b1b1bc9e4..0000000000 Binary files a/doc/image/tutorial/windows/img-win10-visp-images.png and /dev/null differ diff --git a/doc/image/tutorial/windows/img-win11-msvc17-visp-images-3.5.0.jpg b/doc/image/tutorial/windows/img-win11-msvc17-visp-images-3.5.0.jpg deleted file mode 100644 index 51752d3cb0..0000000000 Binary files a/doc/image/tutorial/windows/img-win11-msvc17-visp-images-3.5.0.jpg and /dev/null differ diff --git a/doc/image/tutorial/windows/img-win11-msvc17-visp-images.jpg b/doc/image/tutorial/windows/img-win11-msvc17-visp-images.jpg deleted file mode 100644 index b7550f4459..0000000000 Binary files a/doc/image/tutorial/windows/img-win11-msvc17-visp-images.jpg and /dev/null differ diff --git a/doc/image/tutorial/windows/img-win11-visp-images-3.5.0.jpg b/doc/image/tutorial/windows/img-win11-visp-images-3.5.0.jpg deleted file mode 100644 index 53fb013bcc..0000000000 Binary files a/doc/image/tutorial/windows/img-win11-visp-images-3.5.0.jpg and /dev/null differ diff --git a/doc/mainpage.dox.in b/doc/mainpage.dox.in index 4d1b376430..5cecff59ad 100644 --- a/doc/mainpage.dox.in +++ b/doc/mainpage.dox.in @@ -624,6 +624,14 @@ in different ways. This will motivate us to continue the efforts. \defgroup module_klt klt: Kanade Lucas tracker module Kanade Lucas tracker module. */ +/******************************************* + * Module blob + *******************************************/ + /*! + \ingroup module_tracker + \defgroup module_dnn_tracker dnn_tracker: Deep learning tracker module + Deep learning tracker module. +*/ /******************************************* * Module vision *******************************************/ diff --git a/doc/tutorial/android/tutorial-create-android-sdk.dox b/doc/tutorial/android/tutorial-create-android-sdk.dox index 1d14bf2b8c..eb30d66ef7 100644 --- a/doc/tutorial/android/tutorial-create-android-sdk.dox +++ b/doc/tutorial/android/tutorial-create-android-sdk.dox @@ -93,7 +93,7 @@ ccache version 4.2 Android Studio, download and install Android Studio for Windows 64-bit. Once installed start Android Studio using default settings. This allows to download Android SDK. Now to install Android NDK, with Android Studio create a new Android project. - From this new project enter `"File > Settings... > Appearence & Behavior > System Settings > Android SDK"` menu. + From this new project enter `"File > Settings... > Appearence & Behavior > System Settings > Android SDK"` menu. Select the `"SDK Tools"` tab and check the boxes next to `LLDB`, `CMake`, and `NDK (Side by side)`. Once all the tools are downloaded, you can exit Android Studio. - Now install Python Interpreter without forgetting to add Python to environment variables. @@ -120,7 +120,7 @@ C:\>ninja --version C:\>ccache --version ccache version 3.7.2 \endcode - + \section android_sdk_ws Create a workspace Create a workspace in `$HOME/visp-ws` that will contain ViSP sources, build and dataset. @@ -133,7 +133,7 @@ $ mkdir -p $VISP_WS There are different ways to get ViSP source code: -- You can download the latest release as a zip or a tarball. Once downloaded, uncompress the file using either +- You can download the latest release as a zip or a tarball. Once downloaded, uncompress the file using either \code $ tar xvzf visp-x.y.z.tar.gz -C $VISP_WS \endcode @@ -142,7 +142,7 @@ or $ unzip visp-x.y.z.zip -d $VISP_WS \endcode -- You can also download a daily snapshot. Once downloaded, uncompress the file using +- You can also download a daily snapshot. Once downloaded, uncompress the file using \code $ tar xvzf visp-snapshot-yyyy-mm-dd.tar.gz -C $VISP_WS \endcode @@ -193,7 +193,7 @@ This will speed up the installation process. Once build ViSP Android SDK will be available in `$VISP_WS/visp-build-android-sdk/ViSP-android-sdk/sdk` folder. Its content should be similar to the following: \code -$ cd $VISP_WS/visp-build-android-sdk/ViSP-android-sdk/sdk +$ cd $VISP_WS/visp-build-android-sdk/ViSP-android-sdk/sdk $ find . -maxdepth 3 -type d ./native ./native/3rdparty diff --git a/doc/tutorial/bridge/matlab/tutorial-visp-matlab.dox b/doc/tutorial/bridge/matlab/tutorial-visp-matlab.dox index 37fa196d46..97fd1f4cf3 100644 --- a/doc/tutorial/bridge/matlab/tutorial-visp-matlab.dox +++ b/doc/tutorial/bridge/matlab/tutorial-visp-matlab.dox @@ -7,11 +7,11 @@ This tutorial shows how to invoke MATLAB functions from ViSP using MATLAB Engine. The MATLAB C/C++ engine library contains routines that allow you to call MATLAB from your own programs, using MATLAB as a computation engine. This can be used to extend ViSP functionality using MATLAB. -Standalone programs written using MATLAB engine communicates with MATLAB process using pipes on UNIX system and Component Object Model (COM) interface on a Microsoft Windows system. MATLAB provides an API to start and end MATLAB process, send and receive data, and send commands to be processed in MATLAB. +Standalone programs written using MATLAB engine communicates with MATLAB process using pipes on UNIX system and Component Object Model (COM) interface on a Microsoft Windows system. MATLAB provides an API to start and end MATLAB process, send and receive data, and send commands to be processed in MATLAB. Using the MATLAB engine requires an installed version of MATLAB; you cannot run the MATLAB engine on a machine that only has the MATLAB Runtime. Also, path to MATLAB runtime must be set in the PATH environment variable. For a 64bit machine running Windows, the path is `path\to\MATLAB\R20XXy\bin\win64`. -For this tutorial, we create a vpMatrix object containing a 3x3 matrix and pass it to MATLAB sum function to compute a column wise sum of the vpMatrix. +For this tutorial, we create a vpMatrix object containing a 3x3 matrix and pass it to MATLAB sum function to compute a column wise sum of the vpMatrix. Note that all the material (source code and image) described in this tutorial is part of ViSP source code and could be downloaded using the following command: @@ -24,9 +24,9 @@ $ svn export https://github.com/lagadic/visp.git/trunk/tutorial/matlab In order to build a source code that mix ViSP and MATLAB you should first create a `CMakeLists.txt` file that tries to find ViSP and MATLAB. In the following example we consider the case of the tutorial-matlab.cpp source file. \code -project(visp-matlab) +cmake_minimum_required(VERSION 3.5) -cmake_minimum_required(VERSION 3.0) +project(visp-matlab) find_package(VISP REQUIRED visp_core) include_directories(${VISP_INCLUDE_DIRS}) diff --git a/doc/tutorial/calibration/tutorial-calibration-extrinsic.dox b/doc/tutorial/calibration/tutorial-calibration-extrinsic.dox index 039a090072..2a46de09b3 100644 --- a/doc/tutorial/calibration/tutorial-calibration-extrinsic.dox +++ b/doc/tutorial/calibration/tutorial-calibration-extrinsic.dox @@ -67,7 +67,7 @@ To get the corresponding \f$^f{\bf M}_e\f$ poses, you need to use one of our rob \endcode To complete this step, you need also to get or calibrate your camera in order to obtain its intrinsic parameters. Camera intrinsic parameters need to be saved in an xml file. If you have an Intel RealSense device you can directly get the parameters using vpRealSense2::getCameraParameters() and then save the parameters in an xml file using vpXmlParserCamera::save(). An example is given in tutorial-franka-acquire-calib-data.cpp or in tutorial-universal-robots-acquire-calib-data.cpp -\note With vpRealSense2::getCameraParameters() you can only get the parameters without distorsion coefficients. If you want the parameters with distorsion, you need to achieve a calibration as described in \ref tutorial-calibration-intrinsic. +\note With vpRealSense2::getCameraParameters() you can only get the parameters without distortion coefficients. If you want the parameters with distortion, you need to achieve a calibration as described in \ref tutorial-calibration-intrinsic. As an example, in ViSP source code you will find a dataset corresponding to data acquired with a real robot: \verbatim diff --git a/doc/tutorial/calibration/tutorial-calibration-intrinsic.dox b/doc/tutorial/calibration/tutorial-calibration-intrinsic.dox index 08686b89c1..9edf540a8a 100644 --- a/doc/tutorial/calibration/tutorial-calibration-intrinsic.dox +++ b/doc/tutorial/calibration/tutorial-calibration-intrinsic.dox @@ -9,35 +9,35 @@ This tutorial focuses on pinhole camera calibration. The goal of the calibration If we denote \f$(u,v)\f$ the position of a pixel in the digitized image, this position is related to the corresponding -coordinates \f$(x,y)\f$ in the normalized space. +coordinates \f$(x,y)\f$ in the normalized space. In ViSP we consider two unit conversions: - From meters to pixels we consider the following formula: \f[ \begin{array}{l} - u = u_0 + x p_x (1+k_{ud} r^2) \\ + u = u_0 + x p_x (1+k_{ud} r^2) \\ v = v_0 + y p_y (1+k_{ud} r^2) - \end{array} + \end{array} \f] - with \f$ r^2 = x^2+y^2 \f$ + with \f$ r^2 = x^2+y^2 \f$ - From pixels to meters we consider the following formula: \f[ \begin{array}{l} x = (u-u_0)*(1+k_{du} r^2)/p_x \\ - y = (v-v_0)*(1+k_{du} r^2)/p_y - \end{array} + y = (v-v_0)*(1+k_{du} r^2)/p_y + \end{array} \f] with \f$ r^2=((u - u_0)/p_x)^2+((v-v_0)/p_y)^2 \f$ In this model we consider the parameters \f$(u_0,v_0,p_x,p_y, k_{ud}, k_{du})\f$ where: - \f$(u_0, v_0)\f$ are the coordinates of the principal point in pixel; - \f$(p_x, p_y)\f$ are the ratio between the focal length and the size of a pixel; -- \f$(k_{ud}, k_{du})\f$ are the parameters used to correct the distortion. \f$k_{ud}\f$ is the distortion parameter used to transform the coordinates from \e undistorted to \e distorted images, while \f$k_{du}\f$ is used to transform the coordinates from \e distorted to \e undistorted images. +- \f$(k_{ud}, k_{du})\f$ are the parameters used to correct the distortion. \f$k_{ud}\f$ is the distortion parameter used to transform the coordinates from \e undistorted to \e distorted images, while \f$k_{du}\f$ is used to transform the coordinates from \e distorted to \e undistorted images. \note It may be useful to make a tour in \ref tutorial-bridge-opencv that makes in relation the camera model used in ViSP with the one proposed by OpenCV. -\note Note also that the container dedicated to camera parameters is implemented in the vpCameraParameters class. It allows to consider two kind of models; with or without distortion. +\note Note also that the container dedicated to camera parameters is implemented in the vpCameraParameters class. It allows to consider two kind of models; with or without distortion. -The calibration process allows to estimate the values of these parameters. +The calibration process allows to estimate the values of these parameters. \section calibration_recommendation Recommendations @@ -66,7 +66,7 @@ How to improve calibration accuracy: To calibrate your camera you need to take snapshots of one of these two patterns with your camera. At least 5 good snapshots of the input pattern acquired at different positions are requested for good results. -To this end see \ref tutorial-grabber and use one of the binaries that could be found in `tutorial/grabber` folder to grab single shot images of the grid. +To this end see \ref tutorial-grabber and use one of the binaries that could be found in `tutorial/grabber` folder to grab single shot images of the grid. For example, with a webcam connected to a laptop running Linux (Ubuntu, Fedora...) use one of the following: \verbatim @@ -130,11 +130,11 @@ We will not describe in detail the source, but just mention that: - the image processing is performed using OpenCV; - the estimation of the parameters is done using a virtual visual servoing scheme; - the calibration tool takes as input a configuration file that allows to precise the kind of pattern used in the images (chessboard or circles grid), and the location of the images used as input. If \c libjpeg and \c libpng 3rd party libraries are installed and detected during ViSP configuration, you may consider .pgm, .ppm, .jpg, .png images. Default configuration files are provided in \c example/calibration folder; -- the resulting parameters are saved in \c camera.xml file. +- the resulting parameters are saved in \c camera.xml file. \subsection calibration_chessboard With a chessboard -In this section we consider the OpenCV chessboard pattern that has a size of 9 by 6. Each square of the chessboard is 0.025 meters large. A set of 13 images extracted from OpenCV dataset are provided `chessboard-01.jpg`, `chessboard-02.jpg`, ..., `chessboard-13.jpg`. Hereafter we give an example of one of these images. +In this section we consider the OpenCV chessboard pattern that has a size of 9 by 6. Each square of the chessboard is 0.025 meters large. A set of 13 images extracted from OpenCV dataset are provided `chessboard-01.jpg`, `chessboard-02.jpg`, ..., `chessboard-13.jpg`. Hereafter we give an example of one of these images. \image html img-chessboard-01.jpg Snapshot example of the 9 by 6 chessboard used to calibrate the camera. @@ -147,7 +147,7 @@ BoardSize_Height: 6 # The size of a square in meters Square_Size: 0.025 -# The type of pattern used for camera calibration. +# The type of pattern used for camera calibration. # One of: CHESSBOARD or CIRCLES_GRID Calibrate_Pattern: CHESSBOARD @@ -158,7 +158,7 @@ Input: chessboard-%02d.jpg Tempo: 1 \endverbatim -\note The images and the configuration file used in this tutorial are available in ViSP source code and copied in the same folder than the \c calibrate_camera binary. +\note The images and the configuration file used in this tutorial are available in ViSP source code and copied in the same folder than the \c calibrate_camera binary. To estimate the camera parameters, just enter in ViSP `\/examples/calibration` and run: \verbatim @@ -167,7 +167,7 @@ To estimate the camera parameters, just enter in ViSP `\/examples/c This command will produce the following output: \verbatim -$ ./calibrate-camera default-chessboard.cfg +$ ./calibrate-camera default-chessboard.cfg Settings from config file: default-chessboard.cfg grid width : 9 grid height: 6 @@ -176,10 +176,10 @@ pattern : CHESSBOARD input seq : chessboard-%02d.jpg tempo : 1 -Settings from command line options: +Settings from command line options: Ouput xml file : camera.xml Camera name : Camera -Initialize camera parameters with default values +Initialize camera parameters with default values Camera parameters used for initialization: Camera parameters for perspective projection without distortion: px = 600 py = 600 @@ -268,7 +268,7 @@ The resulting parameters are also saved in `./camera.xml` file. \subsection calibration_circle With a circles grid -In this section we consider the ViSP symmetric circles grid pattern that has a size of 6 by 6. Each circle center of gravity is 0.034 meters distant from it's horizontal or vertical neighbor. We took 5 images called \c circles-01.jpg, \c circles-02.jpg, ..., \c circles-05.jpg. Hereafter we give an example of such an image. +In this section we consider the ViSP symmetric circles grid pattern that has a size of 6 by 6. Each circle center of gravity is 0.034 meters distant from it's horizontal or vertical neighbor. We took 5 images called \c circles-01.jpg, \c circles-02.jpg, ..., \c circles-05.jpg. Hereafter we give an example of such an image. \image html img-circles-grid-02.jpg Snapshot example of the symmetric circles grid used to calibrate the camera. @@ -281,7 +281,7 @@ BoardSize_Height: 6 # The size of a square in meters Square_Size: 0.034 -# The type of pattern used for camera calibration. +# The type of pattern used for camera calibration. # One of: CHESSBOARD or CIRCLES_GRID Calibrate_Pattern: CIRCLES_GRID @@ -292,7 +292,7 @@ Input: circles-%02d.jpg Tempo: 1 \endverbatim -\note The images and the configuration file used in this tutorial are available in ViSP source code and copied in the same folder than the \c calibrate_camera binary. +\note The images and the configuration file used in this tutorial are available in ViSP source code and copied in the same folder than the \c calibrate_camera binary. To estimate the camera parameters, just enter in ViSP \c \/examples/calibration and run: \verbatim @@ -309,10 +309,10 @@ pattern : CIRCLES_GRID input seq : circles-%02d.jpg tempo : 1 -Settings from command line options: +Settings from command line options: Ouput xml file : camera.xml Camera name : Camera -Initialize camera parameters with default values +Initialize camera parameters with default values Camera parameters used for initialization: Camera parameters for perspective projection without distortion: px = 600 py = 600 @@ -383,7 +383,7 @@ A good calibration is obtained when the patterns cover most part of the image. Reprojection error could be seen in the next image. It shows the current reprojection error, the extracted points and the projected points using the estimated `cMo` camera pose and camera parameters: \image html img-calib-reprojection-error.jpg -On the console, the global reprojection error is also given for the model without distorsion parameters: +On the console, the global reprojection error is also given for the model without distortion parameters: \verbatim Calibration without distortion in progress on 13 images... Camera parameters for perspective projection without distortion: @@ -407,7 +407,7 @@ Image chessboard-13.jpg reprojection error: 1.254269691 Global reprojection error: 1.552697985 \endverbatim -and for the model with both distorsion parameters: +and for the model with both distortion parameters: \verbatim Calibration with distortion in progress on 13 images... Camera parameters for perspective projection with distortion: @@ -492,10 +492,10 @@ pattern : CHESSBOARD input seq : image%01d.png tempo : 1 -Settings from command line options: +Settings from command line options: Ouput xml file : camera.xml Camera name : Camera -Initialize camera parameters with default values +Initialize camera parameters with default values Camera parameters used for initialization: Camera parameters for perspective projection without distortion: px = 600 py = 600 @@ -506,7 +506,7 @@ frame: image1.png, unable to calibrate from single image, image rejected Process frame: image2.png, grid detection status: 1, image used as input data frame: image2.png, unable to calibrate from single image, image rejected Unable to calibrate. Image processing failed ! -\endverbatim +\endverbatim The work around is here to give an initial guess not so far from the solution so that it allows the algorithm to converge. @@ -548,7 +548,7 @@ pattern : CHESSBOARD input seq : image%01d.png tempo : 1 -Settings from command line options: +Settings from command line options: Init parameters: camera-init.xml Ouput xml file : camera.xml Camera name : Camera @@ -574,11 +574,11 @@ Global reprojection error: 0.7628504889 Camera parameters without distortion successfully saved in "camera.xml" \endverbatim -\section calibration_undistort Distorsion removal +\section calibration_undistort Distortion removal -Once the camera is calibrated, you can remove distortion in an image to generate an undistorted image. +Once the camera is calibrated, you can remove distortion in an image to generate an undistorted image. -\subsection calibration_undistort_single Undistort a single image +\subsection calibration_undistort_single Undistort a single image The following example available in tutorial-undistort.cpp shows how to do it. \include tutorial-undistort.cpp @@ -595,11 +595,11 @@ If vpXmlParserCamera is not available, we initialize the camera parameters "by h Finally, we create a new image `Iud` where distortion is removed. This image is saved in `chessboard-undistort.jpg`. -\snippet tutorial-undistort.cpp Create image without distorsion +\snippet tutorial-undistort.cpp Create image without distortion Results are shown in the next images: - left image is the input image `chessboard.jpg` -- right image is the resulting `chessboard-undistort.jpg` image where distorsion is removed thanks to the camera intrinsic parameters. Here you can see that chessboard lines are straight. +- right image is the resulting `chessboard-undistort.jpg` image where distortion is removed thanks to the camera intrinsic parameters. Here you can see that chessboard lines are straight. \image html img-chessboard-undistort.jpg @@ -615,7 +615,7 @@ The pseudo code is the following: vpImage Iundist; // Undistorted output image vpCameraParameters cam; bool init_done = false; - + while (! end) { acquire(I); if (! init_done) { diff --git a/doc/tutorial/cross-compilation/tutorial-install-crosscompiling-naoqi.dox b/doc/tutorial/cross-compilation/tutorial-install-crosscompiling-naoqi.dox index 8feb2b1a11..8abb4111c2 100644 --- a/doc/tutorial/cross-compilation/tutorial-install-crosscompiling-naoqi.dox +++ b/doc/tutorial/cross-compilation/tutorial-install-crosscompiling-naoqi.dox @@ -50,7 +50,7 @@ $ cd $HOME/soft $ git clone https://github.com/lagadic/visp.git \endverbatim -- Or you can download the latest release (should be at least 3.0.1) as a zip or a tarball. Once downloaded, uncompress the file using either +- Or you can download the latest release (should be at least 3.0.1) as a zip or a tarball. Once downloaded, uncompress the file using either \verbatim $ tar xvzf visp-x.y.z.tar.gz --directory $HOME/soft \endverbatim diff --git a/doc/tutorial/cross-compilation/tutorial-install-crosscompiling-raspberry.dox b/doc/tutorial/cross-compilation/tutorial-install-crosscompiling-raspberry.dox index a41c8cdd43..5d7485367e 100644 --- a/doc/tutorial/cross-compilation/tutorial-install-crosscompiling-raspberry.dox +++ b/doc/tutorial/cross-compilation/tutorial-install-crosscompiling-raspberry.dox @@ -115,7 +115,7 @@ $ tar xvzf visp-snapshot-yyyy-mm-dd.tar.gz $ git clone https://github.com/lagadic/visp.git \endverbatim -- Or you can download the latest release (should be at least 3.0.1) as a zip or a tarball. Once downloaded, uncompress the file using either +- Or you can download the latest release (should be at least 3.0.1) as a zip or a tarball. Once downloaded, uncompress the file using either \verbatim $ tar xvzf visp-x.y.z.tar.gz \endverbatim diff --git a/doc/tutorial/cross-compilation/tutorial-install-win10-msvc14-uwp.dox b/doc/tutorial/cross-compilation/tutorial-install-win10-msvc14-uwp.dox index be1916167b..978c1a3212 100644 --- a/doc/tutorial/cross-compilation/tutorial-install-win10-msvc14-uwp.dox +++ b/doc/tutorial/cross-compilation/tutorial-install-win10-msvc14-uwp.dox @@ -69,10 +69,7 @@ With CMake configure ViSP specifying options for cross compiling for `"Windows S C:\> cd %VISP_WS% C:\> mkdir visp-build-vc14-uwp-ws-10-x86 C:\> cd visp-build-vc14-uwp-ws-10-x86 -C:\> cmake.exe -G "Visual Studio 14 2015" -A "Win32" -DCMAKE_SYSTEM_NAME:String=WindowsStore \ - -DCMAKE_SYSTEM_VERSION:String="10.0" -DBUILD_DEMOS=OFF -DBUILD_EXAMPLES=OFF \ - -DBUILD_TESTS=OFF -DBUILD_TUTORIALS=OFF \ - -DCMAKE_INSTALL_PREFIX=%VISP_WS%\visp-build-vc14-uwp-ws-10-install ..\visp +C:\> cmake.exe -G "Visual Studio 14 2015" -A "Win32" -DCMAKE_SYSTEM_NAME="WindowsStore" -DCMAKE_SYSTEM_VERSION="10.0" -DBUILD_DEMOS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_TESTS=OFF -DBUILD_TUTORIALS=OFF -DCMAKE_INSTALL_PREFIX=%VISP_WS%\visp-build-vc14-uwp-ws-10-install ..\visp C:\> cmake --build . --config Release --target install \endverbatim @@ -86,10 +83,7 @@ The same process could be applied except that during cmake configuration you hav C:\> cd %VISP_WS% C:\> mkdir visp-build-vc14-uwp-ws-10-x64 C:\> cd visp-build-vc14-uwp-ws-10-x64 -C:\> cmake.exe -G "Visual Studio 14 2015" -A "x64" -DCMAKE_SYSTEM_NAME:String=WindowsStore \ - -DCMAKE_SYSTEM_VERSION:String="10.0" -DBUILD_DEMOS=OFF -DBUILD_EXAMPLES=OFF \ - -DBUILD_TESTS=OFF -DBUILD_TUTORIALS=OFF \ - -DCMAKE_INSTALL_PREFIX=%VISP_WS%\visp-build-vc14-uwp-ws-10-install ..\visp +C:\> cmake.exe -G "Visual Studio 14 2015" -A "x64" -DCMAKE_SYSTEM_NAME="WindowsStore" -DCMAKE_SYSTEM_VERSION="10.0" -DBUILD_DEMOS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_TESTS=OFF -DBUILD_TUTORIALS=OFF -DCMAKE_INSTALL_PREFIX=%VISP_WS%\visp-build-vc14-uwp-ws-10-install ..\visp C:\> cmake --build . --config Release --target install \endverbatim @@ -103,10 +97,7 @@ The same process could be applied except that during cmake configuration you hav C:\> cd %VISP_WS% C:\> mkdir visp-build-vc14-uwp-ws-10-arm C:\> cd visp-build-vc14-uwp-ws-10-arm -C:\> cmake.exe -G "Visual Studio 14 2015" -A "ARM" -DCMAKE_SYSTEM_NAME:String=WindowsStore \ - -DCMAKE_SYSTEM_VERSION:String="10.0" -DBUILD_DEMOS=OFF -DBUILD_EXAMPLES=OFF \ - -DBUILD_TESTS=OFF -DBUILD_TUTORIALS=OFF \ - -DCMAKE_INSTALL_PREFIX=%VISP_WS%\visp-build-vc15-uwp-ws-10-install ..\visp +C:\> cmake.exe -G "Visual Studio 14 2015" -A "ARM" -DCMAKE_SYSTEM_NAME="WindowsStore" -DCMAKE_SYSTEM_VERSION="10.0" -DBUILD_DEMOS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_TESTS=OFF -DBUILD_TUTORIALS=OFF -DCMAKE_INSTALL_PREFIX=%VISP_WS%\visp-build-vc15-uwp-ws-10-install ..\visp C:\> cmake --build . --config Release --target install \endverbatim @@ -122,10 +113,7 @@ With CMake configure ViSP specifying options for cross compiling for `"Windows S C:\> cd %VISP_WS% C:\> mkdir visp-build-vc14-uwp-ws-8.1-x86 C:\> cd visp-build-vc14-uwp-ws-8.1-x86 -C:\> cmake.exe -G "Visual Studio 14 2015" -A "Win32" -DCMAKE_SYSTEM_NAME:String=WindowsStore \ - -DCMAKE_SYSTEM_VERSION:String="8.1" -DBUILD_DEMOS=OFF -DBUILD_EXAMPLES=OFF \ - -DBUILD_TESTS=OFF -DBUILD_TUTORIALS=OFF \ - -DCMAKE_INSTALL_PREFIX=%VISP_WS%\visp-build-vc14-uwp-ws-8.1-install ..\visp +C:\> cmake.exe -G "Visual Studio 14 2015" -A "Win32" -DCMAKE_SYSTEM_NAME="WindowsStore" -DCMAKE_SYSTEM_VERSION="8.1" -DBUILD_DEMOS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_TESTS=OFF -DBUILD_TUTORIALS=OFF -DCMAKE_INSTALL_PREFIX=%VISP_WS%\visp-build-vc14-uwp-ws-8.1-install ..\visp C:\> cmake --build . --config Release --target install \endverbatim @@ -138,10 +126,7 @@ With CMake configure ViSP specifying options for cross compiling for `"Windows S C:\> cd %VISP_WS% C:\> mkdir visp-build-vc14-uwp-ws-8.1-x64 C:\> cd visp-build-vc14-uwp-ws-8.1-x64 -C:\> cmake.exe -G "Visual Studio 14 2015" -A "x64" -DCMAKE_SYSTEM_NAME:String=WindowsStore \ - -DCMAKE_SYSTEM_VERSION:String="8.1" -DBUILD_DEMOS=OFF -DBUILD_EXAMPLES=OFF \ - -DBUILD_TESTS=OFF -DBUILD_TUTORIALS=OFF \ - -DCMAKE_INSTALL_PREFIX=%VISP_WS%\visp-build-vc14-uwp-ws-8.1-install ..\visp +C:\> cmake.exe -G "Visual Studio 14 2015" -A "x64" -DCMAKE_SYSTEM_NAME="WindowsStore" -DCMAKE_SYSTEM_VERSION="8.1" -DBUILD_DEMOS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_TESTS=OFF -DBUILD_TUTORIALS=OFF -DCMAKE_INSTALL_PREFIX=%VISP_WS%\visp-build-vc14-uwp-ws-8.1-install ..\visp C:\> cmake --build . --config Release --target install \endverbatim @@ -154,10 +139,7 @@ With CMake configure ViSP specifying options for cross compiling for `"Windows S C:\> cd %VISP_WS% C:\> mkdir visp-build-vc14-uwp-ws-8.1-arm C:\> cd visp-build-vc14-uwp-ws-8.1-arm -C:\> cmake.exe -G "Visual Studio 14 2015" -A "ARM" -DCMAKE_SYSTEM_NAME:String=WindowsStore \ - -DCMAKE_SYSTEM_VERSION:String="8.1" -DBUILD_DEMOS=OFF -DBUILD_EXAMPLES=OFF \ - -DBUILD_TESTS=OFF -DBUILD_TUTORIALS=OFF \ - -DCMAKE_INSTALL_PREFIX=%VISP_WS%\visp-build-vc14-uwp-ws-8.1-install ..\visp +C:\> cmake.exe -G "Visual Studio 14 2015" -A "ARM" -DCMAKE_SYSTEM_NAME="WindowsStore" -DCMAKE_SYSTEM_VERSION="8.1" -DBUILD_DEMOS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_TESTS=OFF -DBUILD_TUTORIALS=OFF -DCMAKE_INSTALL_PREFIX=%VISP_WS%\visp-build-vc14-uwp-ws-8.1-install ..\visp C:\> cmake --build . --config Release --target install \endverbatim @@ -172,10 +154,7 @@ With CMake configure ViSP specifying options for cross compiling for `"Windows P C:\> cd %VISP_WS% C:\> mkdir visp-build-vc14-uwp-wp-8.1-x86 C:\> cd visp-build-vc14-uwp-wp-8.1-x86 -C:\> cmake.exe -G "Visual Studio 14 2015" -A "Win32" -DCMAKE_SYSTEM_NAME:String=WindowsPhone \ - -DCMAKE_SYSTEM_VERSION:String="8.1" -DBUILD_DEMOS=OFF -DBUILD_EXAMPLES=OFF \ - -DBUILD_TESTS=OFF -DBUILD_TUTORIALS=OFF \ - -DCMAKE_INSTALL_PREFIX=%VISP_WS%\visp-build-vc14-uwp-wp-8.1-install ..\visp +C:\> cmake.exe -G "Visual Studio 14 2015" -A "Win32" -DCMAKE_SYSTEM_NAME="WindowsPhone" -DCMAKE_SYSTEM_VERSION="8.1" -DBUILD_DEMOS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_TESTS=OFF -DBUILD_TUTORIALS=OFF -DCMAKE_INSTALL_PREFIX=%VISP_WS%\visp-build-vc14-uwp-wp-8.1-install ..\visp C:\> cmake --build . --config Release --target install \endverbatim @@ -188,10 +167,7 @@ With CMake configure ViSP specifying options for cross compiling for `"Windows P C:\> cd %VISP_WS% C:\> mkdir visp-build-vc14-uwp-wp-8.1-x64 C:\> cd visp-build-vc14-uwp-wp-8.1-x64 -C:\> cmake.exe -G "Visual Studio 14 2015" -A "x64" -DCMAKE_SYSTEM_NAME:String=WindowsPhone \ - -DCMAKE_SYSTEM_VERSION:String="8.1" -DBUILD_DEMOS=OFF -DBUILD_EXAMPLES=OFF \ - -DBUILD_TESTS=OFF -DBUILD_TUTORIALS=OFF \ - -DCMAKE_INSTALL_PREFIX=%VISP_WS%\visp-build-vc14-uwp-wp-8.1-install ..\visp +C:\> cmake.exe -G "Visual Studio 14 2015" -A "x64" -DCMAKE_SYSTEM_NAME="WindowsPhone" -DCMAKE_SYSTEM_VERSION="8.1" -DBUILD_DEMOS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_TESTS=OFF -DBUILD_TUTORIALS=OFF -DCMAKE_INSTALL_PREFIX=%VISP_WS%\visp-build-vc14-uwp-wp-8.1-install ..\visp C:\> cmake --build . --config Release --target install \endverbatim @@ -204,10 +180,7 @@ With CMake configure ViSP specifying options for cross compiling for `"Windows P C:\> cd %VISP_WS% C:\> mkdir visp-build-vc14-uwp-wp-8.1-arm C:\> cd visp-build-vc14-uwp-wp-8.1-arm -C:\> cmake.exe -G "Visual Studio 14 2015" -A "ARM" -DCMAKE_SYSTEM_NAME:String=WindowsPhone \ - -DCMAKE_SYSTEM_VERSION:String="8.1" -DBUILD_DEMOS=OFF -DBUILD_EXAMPLES=OFF \ - -DBUILD_TESTS=OFF -DBUILD_TUTORIALS=OFF \ - -DCMAKE_INSTALL_PREFIX=%VISP_WS%\visp-build-vc14-uwp-wp-8.1-install ..\visp +C:\> cmake.exe -G "Visual Studio 14 2015" -A "ARM" -DCMAKE_SYSTEM_NAME="WindowsPhone" -DCMAKE_SYSTEM_VERSION="8.1" -DBUILD_DEMOS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_TESTS=OFF -DBUILD_TUTORIALS=OFF -DCMAKE_INSTALL_PREFIX=%VISP_WS%\visp-build-vc14-uwp-wp-8.1-install ..\visp C:\> cmake --build . --config Release --target install \endverbatim diff --git a/doc/tutorial/cross-compilation/tutorial-install-win10-msvc15-uwp.dox b/doc/tutorial/cross-compilation/tutorial-install-win10-msvc15-uwp.dox index 71f9f881bf..d5abbc06a1 100644 --- a/doc/tutorial/cross-compilation/tutorial-install-win10-msvc15-uwp.dox +++ b/doc/tutorial/cross-compilation/tutorial-install-win10-msvc15-uwp.dox @@ -77,10 +77,7 @@ With CMake configure ViSP specifying options for cross compiling for `"Windows S C:\> cd %VISP_WS% C:\> mkdir visp-build-vc15-uwp-ws-10-x86 C:\> cd visp-build-vc15-uwp-ws-10-x86 -C:\> cmake.exe -G "Visual Studio 15 2017" -A "Win32" -DCMAKE_SYSTEM_NAME:String=WindowsStore \ - -DCMAKE_SYSTEM_VERSION:String="10.0" -DBUILD_DEMOS=OFF -DBUILD_EXAMPLES=OFF \ - -DBUILD_TESTS=OFF -DBUILD_TUTORIALS=OFF \ - -DCMAKE_INSTALL_PREFIX=%VISP_WS%\visp-build-vc15-uwp-ws-10-install ..\visp +C:\> cmake.exe -G "Visual Studio 15 2017" -A "Win32" -DCMAKE_SYSTEM_NAME="WindowsStore" -DCMAKE_SYSTEM_VERSION="10.0" -DBUILD_DEMOS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_TESTS=OFF -DBUILD_TUTORIALS=OFF -DCMAKE_INSTALL_PREFIX=%VISP_WS%\visp-build-vc15-uwp-ws-10-install ..\visp C:\> cmake --build . --config Release --target install \endverbatim @@ -99,10 +96,7 @@ The same process could be applied except that during cmake configuration you hav C:\> cd %VISP_WS% C:\> mkdir visp-build-vc15-uwp-ws-10-x64 C:\> cd visp-build-vc15-uwp-ws-10-x64 -C:\> cmake.exe -G "Visual Studio 15 2017" -A "x64" -DCMAKE_SYSTEM_NAME:String=WindowsStore \ - -DCMAKE_SYSTEM_VERSION:String="10.0" -DBUILD_DEMOS=OFF -DBUILD_EXAMPLES=OFF \ - -DBUILD_TESTS=OFF -DBUILD_TUTORIALS=OFF \ - -DCMAKE_INSTALL_PREFIX=%VISP_WS%\visp-build-vc15-uwp-ws-10-install ..\visp +C:\> cmake.exe -G "Visual Studio 15 2017" -A "x64" -DCMAKE_SYSTEM_NAME="WindowsStore" -DCMAKE_SYSTEM_VERSION="10.0" -DBUILD_DEMOS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_TESTS=OFF -DBUILD_TUTORIALS=OFF -DCMAKE_INSTALL_PREFIX=%VISP_WS%\visp-build-vc15-uwp-ws-10-install ..\visp C:\> cmake --build . --config Release --target install \endverbatim @@ -116,10 +110,7 @@ The same process could be applied except that during cmake configuration you hav C:\> cd %VISP_WS% C:\> mkdir visp-build-vc15-uwp-ws-10-arm C:\> cd visp-build-vc15-uwp-ws-10-arm -C:\> cmake.exe -G "Visual Studio 15 2017" -A "ARM" -DCMAKE_SYSTEM_NAME:String=WindowsStore \ - -DCMAKE_SYSTEM_VERSION:String="10.0" -DBUILD_DEMOS=OFF -DBUILD_EXAMPLES=OFF \ - -DBUILD_TESTS=OFF -DBUILD_TUTORIALS=OFF \ - -DCMAKE_INSTALL_PREFIX=%VISP_WS%\visp-build-vc15-uwp-ws-10-install ..\visp +C:\> cmake.exe -G "Visual Studio 15 2017" -A "ARM" -DCMAKE_SYSTEM_NAME="WindowsStore" -DCMAKE_SYSTEM_VERSION="10.0" -DBUILD_DEMOS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_TESTS=OFF -DBUILD_TUTORIALS=OFF -DCMAKE_INSTALL_PREFIX=%VISP_WS%\visp-build-vc15-uwp-ws-10-install ..\visp C:\> cmake --build . --config Release --target install \endverbatim diff --git a/doc/tutorial/cross-compilation/tutorial-install-win10-msvc16-uwp.dox b/doc/tutorial/cross-compilation/tutorial-install-win10-msvc16-uwp.dox index 091471322c..5c57cb06fa 100644 --- a/doc/tutorial/cross-compilation/tutorial-install-win10-msvc16-uwp.dox +++ b/doc/tutorial/cross-compilation/tutorial-install-win10-msvc16-uwp.dox @@ -76,7 +76,7 @@ With CMake configure ViSP specifying options for cross compiling for `"Windows S \verbatim C:\> mkdir %VISP_WS%\visp-build-vc16-uwp-ws-10-x86 C:\> cd %VISP_WS%\visp-build-vc16-uwp-ws-10-x86 -C:\> cmake.exe -G "Visual Studio 16 2019" -A "Win32" -DCMAKE_SYSTEM_NAME:String=WindowsStore -DCMAKE_SYSTEM_VERSION:String="10.0" -DBUILD_DEMOS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_TESTS=OFF -DBUILD_TUTORIALS=OFF -DCMAKE_INSTALL_PREFIX=%VISP_WS%\visp-build-vc16-uwp-ws-10-install ..\visp +C:\> cmake.exe -G "Visual Studio 16 2019" -A "Win32" -DCMAKE_SYSTEM_NAME="WindowsStore" -DCMAKE_SYSTEM_VERSION="10.0" -DBUILD_DEMOS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_TESTS=OFF -DBUILD_TUTORIALS=OFF -DCMAKE_INSTALL_PREFIX=%VISP_WS%\visp-build-vc16-uwp-ws-10-install ..\visp C:\> cmake --build . --config Release --target install \endverbatim @@ -94,10 +94,7 @@ The same process could be applied except that during cmake configuration you hav \verbatim C:\> mkdir %VISP_WS%\visp-build-vc16-uwp-ws-10-x64 C:\> cd %VISP_WS%\visp-build-vc16-uwp-ws-10-x64 -C:\> cmake.exe -G "Visual Studio 16 2019" -A "x64" -DCMAKE_SYSTEM_NAME:String=WindowsStore \ - -DCMAKE_SYSTEM_VERSION:String="10.0" -DBUILD_DEMOS=OFF -DBUILD_EXAMPLES=OFF \ - -DBUILD_TESTS=OFF -DBUILD_TUTORIALS=OFF \ - -DCMAKE_INSTALL_PREFIX=%VISP_WS%\visp-build-vc16-uwp-ws-10-install ..\visp +C:\> cmake.exe -G "Visual Studio 16 2019" -A "x64" -DCMAKE_SYSTEM_NAME="WindowsStore" -DCMAKE_SYSTEM_VERSION="10.0" -DBUILD_DEMOS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_TESTS=OFF -DBUILD_TUTORIALS=OFF -DCMAKE_INSTALL_PREFIX=%VISP_WS%\visp-build-vc16-uwp-ws-10-install ..\visp C:\> cmake --build . --config Release --target install \endverbatim @@ -110,10 +107,7 @@ The same process could be applied except that during cmake configuration you hav \verbatim C:\> mkdir %VISP_WS%\visp-build-vc16-uwp-ws-10-arm C:\> cd %VISP_WS%\visp-build-vc16-uwp-ws-10-arm -C:\> cmake.exe -G "Visual Studio 16 2019" -A "ARM" -DCMAKE_SYSTEM_NAME:String=WindowsStore \ - -DCMAKE_SYSTEM_VERSION:String="10.0" -DBUILD_DEMOS=OFF -DBUILD_EXAMPLES=OFF \ - -DBUILD_TESTS=OFF -DBUILD_TUTORIALS=OFF \ - -DCMAKE_INSTALL_PREFIX=%VISP_WS%\visp-build-vc16-uwp-ws-10-install ..\visp +C:\> cmake.exe -G "Visual Studio 16 2019" -A "ARM" -DCMAKE_SYSTEM_NAME="WindowsStore" -DCMAKE_SYSTEM_VERSION="10.0" -DBUILD_DEMOS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_TESTS=OFF -DBUILD_TUTORIALS=OFF -DCMAKE_INSTALL_PREFIX=%VISP_WS%\visp-build-vc16-uwp-ws-10-install ..\visp C:\> cmake --build . --config Release --target install \endverbatim diff --git a/doc/tutorial/cross-compilation/tutorial-install-win10-msvc17-uwp.dox b/doc/tutorial/cross-compilation/tutorial-install-win10-msvc17-uwp.dox index 8764a80666..94e2958cb0 100644 --- a/doc/tutorial/cross-compilation/tutorial-install-win10-msvc17-uwp.dox +++ b/doc/tutorial/cross-compilation/tutorial-install-win10-msvc17-uwp.dox @@ -13,7 +13,7 @@ This tutorial has been tested on Windows 10 (64 bit), with CMake 3.22.1 and Visu \subsection install_msvc17_uwp_msvc Visual Studio -Visual Studio Community 2022 could be downloaded from https://www.visualstudio.com/downloads/. During a fresh installation enable "Universal Windows App Development Tools". Without this workload, you won't be able to create your universal apps. +Visual Studio Community 2022 could be downloaded from https://www.visualstudio.com/downloads/. During a fresh installation enable "Universal Windows App Development Tools". Without this workload, you won't be able to create your universal apps. If you already have Visual Studio Community 2022, you can check if "Universal Windows App Development" workload is activated following instructions given here that we resume: @@ -29,7 +29,7 @@ After Visual Studio installation, you need to mkdir %VISP_WS%\visp-build-vc17-uwp-ws-10-x86 C:\> cd %VISP_WS%\visp-build-vc17-uwp-ws-10-x86 -C:\> cmake.exe -G "Visual Studio 17 2022" -A "Win32" -DCMAKE_SYSTEM_NAME:String=WindowsStore -DCMAKE_SYSTEM_VERSION:String="10.0" -DBUILD_DEMOS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_TESTS=OFF -DBUILD_TUTORIALS=OFF -DCMAKE_INSTALL_PREFIX=%VISP_WS%\visp-build-vc17-uwp-ws-10-install ..\visp +C:\> cmake.exe -G "Visual Studio 17 2022" -A "Win32" -DCMAKE_SYSTEM_NAME="WindowsStore" -DCMAKE_SYSTEM_VERSION="10.0" -DBUILD_DEMOS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_TESTS=OFF -DBUILD_TUTORIALS=OFF -DCMAKE_INSTALL_PREFIX=%VISP_WS%\visp-build-vc17-uwp-ws-10-install ..\visp C:\> cmake --build . --config Release --target install \endverbatim @@ -96,10 +96,7 @@ The same process could be applied except that during cmake configuration you hav \verbatim C:\> mkdir %VISP_WS%\visp-build-vc17-uwp-ws-10-x64 C:\> cd %VISP_WS%\visp-build-vc17-uwp-ws-10-x64 -C:\> cmake.exe -G "Visual Studio 17 2022" -A "x64" -DCMAKE_SYSTEM_NAME:String=WindowsStore \ - -DCMAKE_SYSTEM_VERSION:String="10.0" -DBUILD_DEMOS=OFF -DBUILD_EXAMPLES=OFF \ - -DBUILD_TESTS=OFF -DBUILD_TUTORIALS=OFF \ - -DCMAKE_INSTALL_PREFIX=%VISP_WS%\visp-build-vc17-uwp-ws-10-install ..\visp +C:\> cmake.exe -G "Visual Studio 17 2022" -A "x64" -DCMAKE_SYSTEM_NAME="WindowsStore" -DCMAKE_SYSTEM_VERSION="10.0" -DBUILD_DEMOS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_TESTS=OFF -DBUILD_TUTORIALS=OFF -DCMAKE_INSTALL_PREFIX=%VISP_WS%\visp-build-vc17-uwp-ws-10-install ..\visp C:\> cmake --build . --config Release --target install \endverbatim @@ -112,10 +109,7 @@ The same process could be applied except that during cmake configuration you hav \verbatim C:\> mkdir %VISP_WS%\visp-build-vc17-uwp-ws-10-arm C:\> cd %VISP_WS%\visp-build-vc17-uwp-ws-10-arm -C:\> cmake.exe -G "Visual Studio 17 2022" -A "ARM" -DCMAKE_SYSTEM_NAME:String=WindowsStore \ - -DCMAKE_SYSTEM_VERSION:String="10.0" -DBUILD_DEMOS=OFF -DBUILD_EXAMPLES=OFF \ - -DBUILD_TESTS=OFF -DBUILD_TUTORIALS=OFF \ - -DCMAKE_INSTALL_PREFIX=%VISP_WS%\visp-build-vc17-uwp-ws-10-install ..\visp +C:\> cmake.exe -G "Visual Studio 17 2022" -A "ARM" -DCMAKE_SYSTEM_NAME="WindowsStore" -DCMAKE_SYSTEM_VERSION="10.0" -DBUILD_DEMOS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_TESTS=OFF -DBUILD_TUTORIALS=OFF -DCMAKE_INSTALL_PREFIX=%VISP_WS%\visp-build-vc17-uwp-ws-10-install ..\visp C:\> cmake --build . --config Release --target install \endverbatim diff --git a/doc/tutorial/detection/tutorial-detection-dnn.dox b/doc/tutorial/detection/tutorial-detection-dnn.dox deleted file mode 100644 index 1e07b0d6af..0000000000 --- a/doc/tutorial/detection/tutorial-detection-dnn.dox +++ /dev/null @@ -1,82 +0,0 @@ -/** - -\page tutorial-detection-dnn Tutorial: Deep learning object detection -\tableofcontents - -\section dnn_intro Introduction - -This tutorial shows how to use vpDetectorDNN (DNN stands for Deep Neural Network) class to perform object detection with deep learning. This class is a small wrapper over the OpenCV DNN module. - -It provides convenient ways to retrieve detection bounding boxes, class ids and confidence values. For other tasks such as image classification or more elaborate functionality, you should use directly the OpenCV DNN API. - -In the next section you will find an example that shows how to perform face detection in a single image or in images acquired from a camera connected to your computer. - -Note that all the material (source code and network model) described in this tutorial is part of ViSP source code and could be downloaded using the following command: - -\code -$ svn export https://github.com/lagadic/visp.git/trunk/tutorial/detection/dnn -\endcode - -\section dnn_example Face detection - -The following example also available in tutorial-dnn-object-detection-live.cpp detects human face. - -\include tutorial-dnn-object-detection-live.cpp - -The default behavior is to detect human face, but you can input another model to detect the objects you want. To see which are the options, run: -\code -$ ./tutorial-dnn-object-detection-live --help -\endcode - -Default DNN model and config files perform human face detection. - -\snippet tutorial-dnn-object-detection-live.cpp OpenCV DNN face detector - -It is provided by OpenCV and has been trained with the following characteristics: - -
- -This is a brief description of training process which has been used to get res10_300x300_ssd_iter_140000.caffemodel. -The model was created with SSD framework using ResNet-10 like architecture as a backbone. Channels count in ResNet-10 convolution layers was significantly dropped (2x- or 4x- fewer channels). -The model was trained in Caffe framework on some huge and available online dataset. - -
- -More specifically, the model used (`opencv_face_detector_uint8.pb`) has been quantized (with the TensorFlow library) on 8-bit unsigned int to reduce the size of the training model (2.7 mo vs 10.7 mo for `res10_300x300_ssd_iter_140000.caffemodel`). - -To create the DNN object detector: - -\snippet tutorial-dnn-object-detection-live.cpp DNN params - -`model` is the network trained weights, `config` is the network topology description. - -`inputWidth` and `inputHeight` are the dimensions to resize the input image into the blob that is fed in entry of the network. - -`meanR`, `meanG` and `meanB` are the values used for mean subtraction. - -`scaleFactor` is used to normalize the data range. - -`swapRB` should be set to `true` when the model has been trained on RGB data. Since OpenCV used the BGR convention, R and B channel should be swapped. - -You can directly refer to the OpenCV model zoo for the parameters values. - -`confThresh` is the confidence threshold used to filter the detections after inference. - -`nmsThresh` is the Non-Maximum Threshold. It is used to filter multiple detections that can occur approximatively at the same locations. - -After setting the correct parameters, you can easily detect object in an image with - -\snippet tutorial-dnn-object-detection-live.cpp DNN object detection - -Class ids and detection confidence scores can be retrieved with - -\snippet tutorial-dnn-object-detection-live.cpp DNN class ids and confidences - -\section dnn_model_zoo Object detection model zoo - -You can find more models in the OpenCV model zoo. - -\section dnn_next Next tutorial - -You may continue following \ref tutorial-detection-tensorrt. -*/ diff --git a/doc/tutorial/detection/tutorial-matching-deprecated.dox b/doc/tutorial/detection/tutorial-matching-deprecated.dox deleted file mode 100644 index 99ddf0d73b..0000000000 --- a/doc/tutorial/detection/tutorial-matching-deprecated.dox +++ /dev/null @@ -1,63 +0,0 @@ -/** - -\page tutorial-matching-deprecated Tutorial: Keypoint matching (deprecated) -\tableofcontents - -\section intro_matching_deprecated Introduction - -\note This tutorial is deprecated if your OpenCV version is equal to 3.0.0 or more recent. If so you should rather follow \ref tutorial-matching. - -This tutorial focuses on SURF key points manipulation. You will learn how to detect SURF key points on a reference image considered here as the first image of an mpeg video. Then in the next images of the video, key points that match those detected in the reference image using SURF descriptor are displayed. - -\note We assume that you are familiar with video framegrabbing described in \ref tutorial-grabber and with the way to display an image in a window described in \ref tutorial-getting-started. - -\section surf_deprecated SURF key points detection and matching - -Let us consider the following source code also available in tutorial-matching-surf-deprecated.cpp. - -\include tutorial-matching-surf-deprecated.cpp - -Here after is the resulting video. The left image represents the reference image. The right images correspond to the successive images of the input video. All the green lines extremities represent the points that are matched. - -\htmlonly - -\endhtmlonly - -Now, let us explain the lines dedicated to the SURF keypoint usage. - -First we have to include the header of the vpKeyPointSurf class that is a wrapper over OpenCV classes. -\snippet tutorial-matching-surf-deprecated.cpp Include - -Note that this class is only available if ViSP was build with OpenCV non free module. This is ensured by the check of VISP_HAVE_OPENCV_NONFREE macro. -\snippet tutorial-matching-surf-deprecated.cpp Define - -Then we open the mpeg video stream and grab the first image of the video that is stored in \c I container. A Surf keypoint class is instantiated and keypoints are detected on the first image which is considered as the reference image: -\snippet tutorial-matching-surf-deprecated.cpp Construction - -The next lines are used to create image \c Idisp to render the matching results; left image for the reference image, right image for the current image that is processed: -\snippet tutorial-matching-surf-deprecated.cpp Create image - -Then a display using OpenCV is created and image \c Idisp is rendered: -\snippet tutorial-matching-surf-deprecated.cpp Init display - -We enter then in the \c while() loop where a new image is acquired from the video stream and inserted in the right part of image \c Idisp dedicated to rendering of the matching results. -\snippet tutorial-matching-surf-deprecated.cpp Acquisition - -We start the rendering by displaying the rendered image and by drawing a white vertical line to separate the reference image from the current one: -\snippet tutorial-matching-surf-deprecated.cpp Display - -Keypoint matches between the reference image and the current image \c I are detected using: -\snippet tutorial-matching-surf-deprecated.cpp Matching - -Then we parse all the matches to retrieve the coordinates of the points in the reference image (in \c iPref variable) and in the current image (in \c iPcur variable): -\snippet tutorial-matching-surf-deprecated.cpp Get matches - -Next we draw green lines between the matched points: -\snippet tutorial-matching-surf-deprecated.cpp Display matches - -At the end of the iteration, we flush all the previous display to the render window: -\snippet tutorial-matching-surf-deprecated.cpp Display flush - -You can now follow \ref tutorial-homography-deprecated to see how to exploit couple of matched points in order to estimate an homography that allows to track the position of an object. - -*/ diff --git a/doc/tutorial/detection_dnn/tutorial-detection-dnn.dox b/doc/tutorial/detection_dnn/tutorial-detection-dnn.dox new file mode 100644 index 0000000000..45978abd12 --- /dev/null +++ b/doc/tutorial/detection_dnn/tutorial-detection-dnn.dox @@ -0,0 +1,543 @@ +/** + +\page tutorial-detection-dnn Tutorial: Deep learning object detection +\tableofcontents + +\section dnn_intro Introduction + +This tutorial shows how to use the `vpDetectorDNNOpenCV` class (DNN stands for Deep Neural Network), which is a wrapper +over the OpenCV DNN module. +The `vpDetectorDNNOpenCV` class provides convenient ways to perform image classification and to retrieve detection bounding boxes, +class ids and confidence values of a single or of multiple classes. +For other tasks such as image segmentation or more complicated uses, you should use directly the +OpenCV DNN API. + +This class supports `Faster-RCNN`, `SSD-MobileNet`, `ResNet 10`, `Yolo v3`, `Yolo v4`, `Yolo v5`, `Yolo v7` and `Yolo v8` convolutional networks +that simultaneously predict object boundaries and prediction scores at each position. +If you want to use another type of network, you can define your own parsing method of the DNN detection results and give it to +the `vpDetectorDNNOpenCV` object. + +This class can be initialized from a JSON file if ViSP has been compiled with NLOHMANN JSON (see \ref soft_tool_json to see how to do it). +Examples of such JSON files can be found in the tutorial folder. + +In the next section you will find an example that shows how to perform face detection in a single image or in images acquired from +a camera connected to your computer. + +Note that all the material (source code and network model) described in this tutorial is part of ViSP source code and could be +downloaded using the following command: + +\code +$ svn export https://github.com/lagadic/visp.git/trunk/tutorial/detection/dnn +\endcode + +\section dnn_requirements Requirements + +To enable vpDetectorDNNOpenCV class usage, and thus use this tutorial, you need to have a version of ViSP build with OpenCV. +If you have a GPU, we recommend you to refer to the \ref build_opencv_with_cuda section. Otherwise, you can refer to the +\ref install_opencv_from_package section. + +\subsection build_opencv_with_cuda Build OpenCV with GPU acceleration + +OpenCV can be built with GPU acceleration thanks to the Cuda and CuDNN libraries. + +1. First you need to install the Cuda library following the [official documentation](https://docs.nvidia.com/cuda/#installation-guides). + +2. Then, you need to install the CuDNN library following the [official documentation](https://docs.nvidia.com/deeplearning/cudnn/install-guide/index.html). +Please ensure to install a CuDNN version that is compatible with your version of Cuda. + +3. Then, you need to determine the Compute capability of your GPU either from the [NVidia website](https://developer.nvidia.com/cuda-gpus) +or using the [nvidia-smi tool](https://developer.nvidia.com/nvidia-system-management-interface). On a Debian distribution, you would run: + ``` + $ export GPU_CAPABILITIES=$(nvidia-smi --query-gpu=compute_cap --format=csv,noheader) + ``` +4. Check if the package already installed on your computer. On a Debian distribution, you would run: + ``` + $ apt list --installed | grep -i opencv + ``` + + If this command does not return an empty line, please run (**if you are sure that it is not required by another software installed on your computer**): + ``` + $ sudo apt remove libopencv-dev + ``` + +5. Install OpenCV dependencies. On a Debian distribution, you would run: + ``` + ## libx11-dev is a recommended ViSP 3rd parties + # If you installed another version of CUDA, please install the version of CuDNN which is compatible with your version + $ sudo apt update + $ sudo apt install libgtk-3-dev \ + cmake \ + git \ + pip \ + cmake-curses-gui \ + locate \ + libx11-dev + ``` + +6. Get the sources. The \b vpDetectorDNNOpenCV has been tested with **OpenCV 4.7**. First, get the OpenCV_contrib sources, that contain the Cuda DNN module. +On a Debian distribution, you would run: + ``` + $ cd ${HOME}/visp_ws/3rdparty/ + $ git clone --branch 4.7.0 https://github.com/opencv/opencv_contrib + $ git clone --branch 4.7.0 https://github.com/opencv/opencv + ``` + +7. Compile OpenCV and install it from source. On a Debian distribution, you would run: + ``` + $ mkdir -p ${HOME}/visp_ws/3rdparty/opencv/build &&\ + cd ${HOME}/visp_ws/3rdparty/opencv/build + $ cmake .. \ + -DCMAKE_BUILD_TYPE=RELEASE \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_INSTALL_LIBDIR=lib \ + -DWITH_CUDA=ON \ + -DWITH_CUDNN=ON \ + -DOPENCV_DNN_CUDA=ON \ + -DENABLE_FAST_MATH=1 \ + -DCUDA_FAST_MATH=1 \ + -DCUDA_ARCH_BIN=${GPU_CAPABILITIES} \ + -DWITH_CUBLAS=1 \ + -DOPENCV_EXTRA_MODULES_PATH=${HOME}/visp_ws/3rdparty/opencv_contrib/modules \ + -DBUILD_PERF_TESTS=Off \ + -DBUILD_TESTS=Off \ + -DBUILD_EXAMPLES=Off \ + -DBUILD_opencv_apps=Off \ + -DBUILD_opencv_java_bindings_generator=Off \ + -DBUILD_opencv_js=Off + ``` + +8. Compile and install OpenCV. On a Debian distribution, you would run: + ``` + $ make -j$(nproc) + $ sudo make install + ``` + +9. When using the `vpDetectorDNNOpenCV` class, please first call the + methods `vpDetectorDNNOpenCV::setPreferableBackend()` and `vpDetectorDNNOpenCV::setPreferableTarget()` + before running the inference if you want to benefit from GPU acceleration: + ``` + vpDetectorDNNOpenCV::NetConfig my_config; + // Set my_config to match your needs + + vpDetectorDNNOpenCV::DNNResultsParsingType parsingType = USER_SPECIFIED; + // Either define your parsing method or change the parsing type for one that is supported + void (*dummyParsingMethod)(DetectionCandidates &, std::vector &, const NetConfig &) = + [](DetectionCandidates &, std::vector &, const NetConfig &) + { + std::cout << "Hello world" << std::endl; + }; + + vpDetectorDNNOpenCV network(my_config, dummyParsingMethod); + + // Here are the important calls to use GPU acceleration + network.setPreferableBackend(cv::dnn::DNN_BACKEND_CUDA); + network.setPreferableTarget(cv::dnn::DNN_TARGET_CUDA); + ``` +\subsection install_opencv_from_package Install OpenCV from package + +Please follow the instuctions described in the installation guidelines for \ref soft_vision_opencv . + +\section dnn_example Object detection example explained + +The following example also available in tutorial-dnn-object-detection-live.cpp allows object detection by making inference +on DNN models learned from the following networks: +- Faster-RCNN +- SSD MobileNet +- ResNet 10 +- Yolo v3 +- Yolo v4 +- Yolo v5 +- Yolo v7 +- Yolo v8 + +It uses video capture capability from OpenCV to capture images from a camera and detect objects using a DNN model learned using +one of the previous networks. + +\include tutorial-dnn-object-detection-live.cpp + +Default DNN model and config files perform human faces detection. + +\snippet tutorial-dnn-object-detection-live.cpp OpenCV DNN face detector + +This network is provided by OpenCV and has been trained +with the following characteristics: + +
+ +This is a brief description of training process which has been used to get res10_300x300_ssd_iter_140000.caffemodel. +The model was created with SSD framework using ResNet-10 like architecture as a backbone. Channels count in ResNet-10 convolution layers was +significantly dropped (2x- or 4x- fewer channels). The model was trained in Caffe framework on some huge and available online dataset. + +
+ +More specifically, the model used (`opencv_face_detector_uint8.pb`) has been quantized (with the TensorFlow library) on 8-bit unsigned int to +reduce the size of the training model (2.7 mo vs 10.7 mo for `res10_300x300_ssd_iter_140000.caffemodel`). + +The following lines permit to create the DNN object detector: + +\snippet tutorial-dnn-object-detection-live.cpp DNN params + +To construct `netConfig` object some configuration parameters of the DNN are required: +- `confThresh`, which is the confidence threshold used to filter the detections after inference +- `nmsThresh`, which is the Non-Maximum Threshold used to filter multiple detections that can occur approximatively at the same locations +- `labelFile`, which is the path towards the file containing the list of classes the DNN can detect +- `inputWidth` and `inputHeight`, which are the dimensions to resize the input image into the blob that is fed in entry of the network +- `filterThresh`, which is a double that, if greater than 0., indicates that the user wants to perform an additional filtering on the detection outputs based on the + size of these detections +- `meanR`, `meanG` and `meanB` are the values used for mean subtraction +- `scaleFactor` is used to normalize the data range +- `swapRB` should be set to `true` when the model has been trained on RGB data. Since OpenCV used the BGR convention, R and B channel should be swapped +- `dnn_type` is the type of parsing method to use to parse the DNN raw results. See vpDetectorDNNOpenCV::DNNResultsParsingType to determine + which parsing methods are available +- `model` is the network trained weights, `config` is the network topology description and `framework` is the weights framework. + +Alternatively, if ViSP has been compiled with the NLOHMANN JSON library, one can initialize the `vpDetectorDNNOpenCV` object using the following method: + +\snippet tutorial-dnn-object-detection-live.cpp DNN json + +You can directly refer to the OpenCV model zoo for the parameters values. + +After setting the correct parameters, if you want to get the data as a map, where the keys will be the class names (or ID if no label file was given), +you can easily detect object in an image with: + +\snippet tutorial-dnn-object-detection-live.cpp DNN object detection map mode + +Alternatively, you can get the results in a non-sorted vector with + +\snippet tutorial-dnn-object-detection-live.cpp DNN object detection vector mode + +Class ids and detection confidence scores can be retrieved for a map with: + +\snippet tutorial-dnn-object-detection-live.cpp DNN class ids and confidences map mode + +or for a non-sorted vector with: + +\snippet tutorial-dnn-object-detection-live.cpp DNN class ids and confidences vector mode + +\section dnn_usecase Use case + +\subsection dnn_usecase_general Generic usage + +The default behavior is to detect human faces, but you can input another model to detect the objects you want. To see which are the options, run: +``` +$ cd $VISP_WS/visp-build/tutorial/detection/dnn +$ ./tutorial-dnn-object-detection-live --help +``` + +\subsection dnn_usecase_face_detection Face detection + +The default behavior is to detect human faces using a model provided by OpenCV and learned over a ResNet 10 network. If you have a laptop, simply run: +``` +$ cd $VISP_WS/visp-build/tutorial/detection/dnn +$ ./tutorial-dnn-object-detection-live +``` + +The previous command is similar to the next one: +``` +$ CONFIG=opencv_face_detector.pbtxt \ + MODEL=opencv_face_detector_uint8.pb \ + LABELS=class.txt \ + TYPE=resnet-10 \ + FRAMEWORK=none \ + WIDTH=300; HEIGHT=300 +$ ./tutorial-dnn-object-detection-live --model $MODEL --labels $LABELS --config $CONFIG --type $TYPE \ + --framework $FRAMEWORK --width $WIDTH --height $HEIGHT --nmsThresh 0.5 --mean 0 0 0 \ + --confThresh 0.35 --filterThresh -0.25 --scale 1 +``` + +\subsection dnn_models_coco COCO dataset objects detection + +[COCO](https://cocodataset.org) is a large-scale object detection, segmentation, and captioning dataset. It contains over 330 000 images, each annotated with 80 object categories. +In the following sections, we show how to use the DNN models learned with the different networks, to detect objects among the list of 80 objects in the COCO dataset. + +\subsubsection dnn_supported_faster_rcnn Faster-RCNN + +You can find the config file (`config.pbtxt`) [here](https://github.com/opencv/opencv_extra/blob/master/testdata/dnn/faster_rcnn_inception_v2_coco_2018_01_28.pbtxt), +the weights (`frozen_inference_graph.pb`) [there](http://download.tensorflow.org/models/object_detection/faster_rcnn_inception_v2_coco_2018_01_28.tar.gz) +and the labels (`coco_classes.txt`) [here](https://github.com/lagadic/visp/blob/master/tutorial/detection/dnn/coco_classes.txt). + +To run the tutorial with the Faster-RCNN network, please run the following commands: +``` +$ cd $VISP_WS/visp-build/tutorial/detection/dnn +$ DNN_PATH=/path/to/my/dnn/folder \ + CONFIG=${DNN_PATH}/Faster-RCNN/cfg/config.pbtxt \ + MODEL=${DNN_PATH}/Faster-RCNN/weights/faster_rcnn_inception_v2_coco_2018_01_28/frozen_inference_graph.pb \ + LABELS=${DNN_PATH}/Faster-RCNN/cfg/coco_classes.txt \ + TYPE=faster-rcnn \ + FRAMEWORK=none \ + WIDTH=300; HEIGHT=300 +$ ./tutorial-dnn-object-detection-live --model $MODEL --labels $LABELS --config $CONFIG --type $TYPE \ + --framework $FRAMEWORK --width $WIDTH --height $HEIGHT --nmsThresh 0.5 --mean 0 0 0 \ + --confThresh 0.35 --filterThresh -0.25 --scale 1 +``` + +Alternatively, if you have installed the NLOHMANN JSON library and you are using the weights quoted above, +you can use the following command line: +``` +$ ./tutorial-dnn-object-detection-live --input-json ./default_faster-rcnn.json +``` + +If you want to train your own Faster-RCNN model, please refer to this [tutorial](https://debuggercafe.com/how-to-train-faster-rcnn-resnet50-fpn-v2-on-custom-dataset/). + +\subsubsection dnn_supported_mobilenet_ssd MobileNet SSD + +If you want to use `Mobilenet V1`, you can find the config file (`ssd_mobilenet_v1_coco_2017_11_17.pbtxt`) +[here](https://raw.githubusercontent.com/Qengineering/MobileNet_SSD_OpenCV_TensorFlow/master/ssd_mobilenet_v1_coco_2017_11_17.pbtxt), +the weights (`frozen_inference_graph.pb`) [there](http://download.tensorflow.org/models/object_detection/ssd_mobilenet_v1_coco_2017_11_17.tar.gz) +and the labels (`coco_classes.txt`) [here](https://github.com/lagadic/visp/blob/master/tutorial/detection/dnn/coco_classes.txt). + +The parameters to use with this network were found [there](https://github.com/opencv/opencv/blob/0052d46b8e33c7bfe0e1450e4bff28b88f455570/samples/dnn/models.yml#L68). + +To run the tutorial with the `Mobilenet V1` network, please run the following commands: +``` +$ DNN_PATH=/path/to/my/dnn/folder \ + CONFIG=${DNN_PATH}/MobileNet-SSD/cfg/ssd_mobilenet_v1_coco_2017_11_17.pbtxt \ + MODEL=${DNN_PATH}/MobileNet-SSD/weights/frozen_inference_graph.pb \ + LABELS=${DNN_PATH}/MobileNet-SSD/cfg/coco_classes.txt \ + TYPE=ssd-mobilenet \ + FRAMEWORK=none \ + WIDTH=300 HEIGHT=300 +$ ./tutorial-dnn-object-detection-live --model $MODEL --labels $LABELS --config $CONFIG --type $TYPE \ + --framework $FRAMEWORK --width $WIDTH --height $HEIGHT --nmsThresh 0.5 --mean 0 0 0 \ + --filterThresh -0.25 --scale 1 +``` + +Alternatively, if you have installed the NLOHMANN JSON library and you are using the weights quoted above, +you can use the following command line: +``` +$ ./tutorial-dnn-object-detection-live --input-json ./default_ssd-mobilenet_v1.json +``` + +If you would rather use the v3 of Mobilenet-SSD, please download the config file (`ssd_mobilenet_v3_large_coco_2020_01_14.pbtxt`) +[here](https://gist.github.com/dkurt/54a8e8b51beb3bd3f770b79e56927bd7), +the weights (`frozen_inference_graph.pb`) [there](http://download.tensorflow.org/models/object_detection/ssd_mobilenet_v3_large_coco_2020_01_14.tar.gz) +and the labels (`coco_classes.txt`) [here](https://github.com/lagadic/visp/blob/master/tutorial/detection/dnn/coco_classes.txt). + +Then, to run the tutorial with the `Mobilenet V3` network, please run the following commands: +``` +$ DNN_PATH=/path/to/my/dnn/folder \ + CONFIG=${DNN_PATH}/MobileNet-SSD/cfg/ssd_mobilenet_v3_large_coco_2020_01_14.pbtxt \ + MODEL=${DNN_PATH}/MobileNet-SSD/weights/frozen_inference_graph.pb \ + LABELS=${DNN_PATH}/MobileNet-SSD/cfg/coco_classes.txt \ + TYPE=ssd-mobilenet \ + FRAMEWORK=none \ + WIDTH=320 HEIGHT=320 +$ ./tutorial-dnn-object-detection-live --model $MODEL --labels $LABELS --config $CONFIG --type $TYPE \ + --framework $FRAMEWORK --width $WIDTH --height $HEIGHT --nmsThresh 0.5 --mean 0.0019 0.0019 0.0019 \ + --filterThresh -0.25 --scale 0.00389 +``` + +Alternatively, if you have installed the NLOHMANN JSON library and you are using the weights quoted above, +you can use the following command line: +``` +$ ./tutorial-dnn-object-detection-live --input-json ./default_ssd-mobilenet_v3.json +``` + +If you want to train your own MobileNet SSD model, please refer to this +[tutorial](https://www.forecr.io/blogs/ai-algorithms/how-to-train-ssd-mobilenet-model-for-object-detection-using-pytorch) +or the [Keras documentation](https://keras.io/api/applications/mobilenet/) for instance. + +\subsubsection dnn_supported_yolov3 Yolo v3 + +You can find the config file (`yolov3.cfg`) [here](https://github.com/AlexeyAB/darknet/blob/master/cfg/yolov3.cfg), +the weights (`yolov3.weights`) [there](https://pjreddie.com/media/files/yolov3.weights) +and the labels (`coco_classes.txt`) [here](https://github.com/lagadic/visp/blob/master/tutorial/detection/dnn/coco_classes.txt). + +To run the tutorial program `tutorial-dnn-object-detection-live.cpp`, use the following commands: +``` +$ DNN_PATH=/path/to/my/dnn/folder \ + CONFIG=${DNN_PATH}/yolov3/cfg/yolov3.cfg \ + MODEL=${DNN_PATH}/yolov3/weights/yolov3.weights \ + LABELS=${DNN_PATH}/yolov3/cfg/coco_classes.txt \ + TYPE=yolov3 \ + FRAMEWORK=darknet \ + WIDTH=416 HEIGHT=416 +$ ./tutorial-dnn-object-detection-live --model $MODEL --labels $LABELS --config $CONFIG --type $TYPE \ + --framework $FRAMEWORK --width $WIDTH --height $HEIGHT --nmsThresh 0.5 --mean 0 0 0 \ + --filterThresh -0.25 --scale 0.0039 +``` + +Alternatively, if you have installed the NLOHMANN JSON library and you are using the weights quoted above, +you can use the following command line: +``` +$ ./tutorial-dnn-object-detection-live --input-json ./default_yolov3.json +``` + +If you want to train your own YoloV3 model, please refer to the [official documentation](https://github.com/ultralytics/yolov3). + +\subsubsection dnn_supported_yolov4 Yolo v4 + +You can find the the config file (`yolov4-tiny.cfg`) [here](https://github.com/AlexeyAB/darknet/blob/master/cfg/yolov4-tiny.cfg), +the weights (`yolov4-tiny.weights`) [there](https://github.com/AlexeyAB/darknet/releases/download/yolov4/yolov4-tiny.weights) +and the labels (`coco_classes.txt`) [here](https://github.com/lagadic/visp/blob/master/tutorial/detection/dnn/coco_classes.txt). + +To run the tutorial program `tutorial-dnn-object-detection-live.cpp`, use the following commands: +``` +$ DNN_PATH=/path/to/my/dnn/folder \ + CONFIG=${DNN_PATH}/yolov4/cfg/yolov4-tiny.cfg \ + MODEL=${DNN_PATH}/yolov4/weights/yolov4-tiny.weights \ + LABELS=${DNN_PATH}/yolov4/cfg/coco_classes.txt \ + TYPE=yolov4 \ + FRAMEWORK=darknet \ + WIDTH=416 HEIGHT=416 +$ ./tutorial-dnn-object-detection-live --model $MODEL --labels $LABELS --config $CONFIG --type $TYPE \ + --framework $FRAMEWORK --width $WIDTH --height $HEIGHT --nmsThresh 0.5 --mean 0 0 0 \ + --filterThresh -0.25 --scale 0.0039 +``` + +Alternatively, if you have installed the NLOHMANN JSON library and you are using the weights quoted above, +you can use the following command line: +``` +$ ./tutorial-dnn-object-detection-live --input-json ./default_yolov4.json +``` + +If you want to train your own YoloV4 model, please refer to the [official documentation](https://github.com/AlexeyAB/darknet#how-to-train-to-detect-your-custom-objects). + +\subsubsection dnn_supported_yolov5 Yolo v5 + +You can find the weights (`yolov5n.onnx`) in ONNX format [here](https://github.com/doleron/yolov5-opencv-cpp-python/blob/main/config_files/yolov5n.onnx) +and the labels (`coco_classes.txt`) [here](https://github.com/lagadic/visp/blob/master/tutorial/detection/dnn/coco_classes.txt). + +\note You do not need a config file when using a network saved in ONNX format. + +To run the tutorial program `tutorial-dnn-object-detection-live.cpp`, use the following commands: +``` +$ DNN_PATH=/path/to/my/dnn/folder \ + CONFIG=none \ + MODEL=${DNN_PATH}/yolov5/weights/yolov5n.onnx \ + LABELS=${DNN_PATH}/yolov5/cfg/coco_classes.txt \ + TYPE=yolov5 \ + FRAMEWORK=onnx \ + WIDTH=640 HEIGHT=640 +$ ./tutorial-dnn-object-detection-live --model $MODEL --labels $LABELS --config $CONFIG --type $TYPE \ + --framework $FRAMEWORK --width $WIDTH --height $HEIGHT --nmsThresh 0.5 --mean 0 0 0 \ + --filterThresh -0.25 --scale 0.0039 +``` + +Alternatively, if you have installed the NLOHMANN JSON library and you are using the weights quoted above, +you can use the following command line: +``` +$ ./tutorial-dnn-object-detection-live --input-json ./default_yolov5.json +``` + +If you want to train your own YoloV5 model, please refer to the +[official documentation](https://docs.ultralytics.com/yolov5/tutorials/train_custom_data/#13-prepare-dataset-for-yolov5). + +\subsubsection dnn_supported_yolov7 Yolo v7 + +To be able to use `YoloV7` with the class `vpDetectorDNNOpenCV`, you must first download the weights (`yolov7-tiny.pt`) in the Pytorch format from +[here](https://github.com/WongKinYiu/yolov7/releases/download/v0.1/yolov7-tiny.pt). + +Then, convert it in ONNX format using the `export.py` script that you can find on the [YoloV7 repo](https://github.com/WongKinYiu/yolov7) with the following arguments: +``` +$ python3 export.py --weights ../weights/yolov7-tiny.pt --grid --simplify --topk-all 100 --iou-thres 0.65 --conf-thres 0.35 --img-size 640 640 --max-wh 640 +``` + +Finally, use the following commands to run the tutorial program: +``` +$ DNN_PATH=/path/to/my/dnn/folder \ + CONFIG=none \ + MODEL=${DNN_PATH}/yolov7/weights/yolov7-tiny.onnx \ + LABELS=${DNN_PATH}/yolov7/cfg/coco_classes.txt \ + TYPE=yolov7 \ + FRAMEWORK=onnx \ + WIDTH=640 HEIGHT=640 +$ ./tutorial-dnn-object-detection-live --model $MODEL --labels $LABELS --config $CONFIG --type $TYPE \ + --framework $FRAMEWORK --width $WIDTH --height $HEIGHT --nmsThresh 0.5 --mean 0 0 0 \ + --filterThresh -0.25 --scale 0.0039 +``` + +\note You do not need a config file when using a network saved in ONNX format. + +Alternatively, if you have installed the NLOHMANN JSON library and you are using the weights quoted above, +you can use the following command line: +``` +$ ./tutorial-dnn-object-detection-live --input-json ./default_yolov7.json +``` + +If you want to train your own YoloV7 model, please refer to the [official documentation](https://github.com/WongKinYiu/yolov7#transfer-learning). +If your dataset is rather small (only hundreds of pictures), you may want to consider to base your training on +`yolov7-tiny` network, as it tends to get better results. + +\subsubsection dnn_supported_yolov8 Yolo v8 + +You can find the weights (`yolov8s.onnx`) in ONNX format +[here](https://github.com/JustasBart/yolov8_CPP_Inference_OpenCV_ONNX/blob/minimalistic/source/models/yolov8s.onnx) +and the labels (`coco_classes.txt`) [here](https://github.com/lagadic/visp/blob/master/tutorial/detection/dnn/coco_classes.txt). + +Please use the following commands to run the tutorial program: +``` +$ DNN_PATH=/path/to/my/dnn/folder \ + CONFIG=none \ + MODEL=${DNN_PATH}/yolov8/weights/yolov8s.onnx \ + LABELS=${DNN_PATH}/yolov8/cfg/coco_classes.txt \ + TYPE=yolov8 \ + FRAMEWORK=onnx \ + WIDTH=640 HEIGHT=480 +$ ./tutorial-dnn-object-detection-live --model $MODEL --labels $LABELS --config $CONFIG --type $TYPE \ + --framework $FRAMEWORK --width $WIDTH --height $HEIGHT --nmsThresh 0.5 --mean 0 0 0 \ + --filterThresh -0.25 --scale 0.0039 +``` + +Alternatively, if you have installed the NLOHMANN JSON library and you are using the weights quoted above, +you can use the following command line: +``` +$ ./tutorial-dnn-object-detection-live --input-json ./default_yolov8.json +``` + +\note You do not need a config file when using a network saved in ONNX format. + +If you want to train your own YoloV8 model, please refer to the [official documentation](https://docs.ultralytics.com/modes/train/). + +\section dnn_model_other Other dnn models +\subsection dnn_model_other_zoo OpenCV model zoo + +You can find more models in the [OpenCV model zoo repository](https://github.com/opencv/opencv/tree/master/samples/dnn). + +\section dnn_troubleshootings Troubleshootings + +When using the `vpDetectorDNNOpenCV` class, you may face the following errors: + +\subsection dnn_error_size Error in the DNN input size + +
+[ERROR:0@1.338] global net_impl.cpp:1161 getLayerShapesRecursively OPENCV/DNN: [Reshape]:(onnx_node!Reshape_219): getMemoryShapes() throws exception. inputs=1 outputs=1/1 blobs=0 +[ERROR:0@1.338] global net_impl.cpp:1167 getLayerShapesRecursively input[0] = [ 1 64 8400 ] +[ERROR:0@1.338] global net_impl.cpp:1171 getLayerShapesRecursively output[0] = [ ] +[ERROR:0@1.338] global net_impl.cpp:1177 getLayerShapesRecursively Exception message: OpenCV(4.7.0) ${HOME}/visp_ws/3rdparty/opencv/modules/dnn/src/layers/reshape_layer.cpp:109: error: (-215:Assertion failed) total(srcShape, srcRange.start, srcRange.end) == maskTotal in function 'computeShapeByReshapeMask' + +terminate called after throwing an instance of 'cv::Exception' +what(): OpenCV(4.7.0) ${HOME}/visp_ws/3rdparty/opencv/modules/dnn/src/layers/reshape_layer.cpp:109: error: (-215:Assertion failed) total(srcShape, srcRange.start, srcRange.end) == maskTotal in function 'computeShapeByReshapeMask' +
+ +This error may occur if you mistook the input size of the DNN (i.e. if you are asking to resize the input images to a size +that does not match the one expected by the DNN). + +\subsection dnn_error_unimplemented YoloV3: transpose weights is not functionNotImplementedError + +``` +terminate called after throwing an instance of 'cv::Exception' +what(): OpenCV(4.7.0) error: (-213:The function/feature is not implemented) Transpose the weights (except for convolutional) is not +implemented in function 'ReadDarknetFromWeightsStream' +``` + +Following the proposition found [here](https://github.com/opencv/opencv/issues/15502#issuecomment-531755462) to download once +again the weights from [here](https://pjreddie.com/media/files/yolov3.weights) permitted to solve this error. + +\subsection dnn_error_nonmaxsuppr YoloV7: can't create NonMaxSuppression layer + +When using a YoloV7 model exported in `onnx` format, one can face the following error: +``` +[ERROR:0@0.335] global onnx_importer.cpp:1054 handleNode DNN/ONNX: ERROR during processing node with 5 inputs and 1 outputs: [NonMaxSuppression]onnx_node!/end2end/NonMaxSuppression) from domain='ai.onnx' +terminate called after throwing an instance of 'cv::Exception' +what(): OpenCV(4.7.0) opencv/modules/dnn/src/onnx/onnx_importer.cpp:1073: error: (-2:Unspecified error) in function 'handleNode' +Node [NonMaxSuppression@ai.onnx]onnx_node!/end2end/NonMaxSuppression) parse error: OpenCV(4.7.0) opencv/modules/dnn/src/net_impl.hpp:108: error: (-2:Unspecified error) Can't create layer "onnx_node!/end2end/NonMaxSuppression" of type "NonMaxSuppression" in function 'getLayerInstance' +Aborted (core dumped) +``` + +You may have been missing the onnxsim library or forgotten to remove the `--end2end` option during the export of the network. + +\section dnn_next Next tutorial + +You may continue following \ref tutorial-detection-tensorrt. +*/ diff --git a/doc/tutorial/detection/tutorial-detection-tensorrt.dox b/doc/tutorial/detection_dnn/tutorial-detection-tensorrt.dox similarity index 100% rename from doc/tutorial/detection/tutorial-detection-tensorrt.dox rename to doc/tutorial/detection_dnn/tutorial-detection-tensorrt.dox diff --git a/doc/tutorial/developper/tutorial-add-new-dependency.dox b/doc/tutorial/developper/tutorial-add-new-dependency.dox index c57a03234c..58fba970db 100644 --- a/doc/tutorial/developper/tutorial-add-new-dependency.dox +++ b/doc/tutorial/developper/tutorial-add-new-dependency.dox @@ -18,7 +18,7 @@ Let us consider the case where we want to implement a new class with name `vpDum |- lib --- libdummy_sdk.so \endcode -To illustrate this tutorial, let us consider that `` is equal to `/home/user/visp_ws/3rdparty/dummy-sdk` folder. +To illustrate this tutorial, let us consider that `` is equal to `/home/user/visp-ws/3rdparty/dummy-sdk` folder. In order that ViSP remains cross-platform, here we should consider that this dummy SDK is used only if `VISP_HAVE_DUMMY_SDK` macro is defined. We suppose here that this macro is automatically defined (or not) in `visp3/core/vpConfig.h` file that is located in ViSP build tree, more precisely in `$VISP_WS/visp-build/include` folder. @@ -104,7 +104,7 @@ status(" Use Dummy SDK:" USE_DUMMYSDK THEN "yes" ELSE "no") - At this point before continuing, test if your SDK is detected. First set `DUMMYSDK_HOME` environment variable and run cmake over ViSP source code. On unix-like OS, this could be achieved running: \code $ cd $VISP_WS/visp-build -$ export DUMMYSDK_HOME=/home/user/visp_ws/3rdparty/dummy-sdk +$ export DUMMYSDK_HOME=/home/user/visp-ws/3rdparty/dummy-sdk $ ccmake ../visp \endcode Here you should see appearing a new line like the following that shows that your `DummySDK` package is found by CMake: @@ -113,8 +113,8 @@ Here you should see appearing a new line like the following that shows that your \endcode Entering advanced mode by pressing `[t]` key, you should be also able to see the following lines that indicate the full path to `DummySDK` headers folder and library: \code - DUMMYSDK_INCLUDE_DIR /home/user/visp_ws/3rdparty/dummy-sdk/include/dummy_sdk_header.h - DUMMYSDK_LIBRARY /home/user/visp_ws/3rdparty/dummy-sdk/lib/libdummy_sdk.so + DUMMYSDK_INCLUDE_DIR /home/user/visp-ws/3rdparty/dummy-sdk/include/dummy_sdk_header.h + DUMMYSDK_LIBRARY /home/user/visp-ws/3rdparty/dummy-sdk/lib/libdummy_sdk.so \endcode \subsection add_new_dep_modif_macro Add VISP_HAVE 3rd-party macro @@ -144,7 +144,7 @@ PREDEFINED = @DOXYGEN_SHOULD_SKIP_THIS@ \ - At this point, you can test if `VISP_HAVE_DUMMY_SDK` macro is correctly set after CMake configuration in `$VISP_WS/visp-build/include/visp3/core/vpConfig.h`. To this end, under linux-like OS run simply: \code $ cd $VISP_WS/visp-build -$ export DUMMYSDK_HOME=/home/user/visp_ws/3rdparty/dummy-sdk +$ export DUMMYSDK_HOME=/home/user/visp-ws/3rdparty/dummy-sdk $ cmake ../visp \endcode Here you should see that `DummySDK` is well detected: @@ -305,7 +305,7 @@ $ more CMakeLists.txt \code project(example-dummy) -cmake_minimum_required(VERSION 3.0) +cmake_minimum_required(VERSION 3.5) find_package(VISP REQUIRED visp_core visp_robot) @@ -409,9 +409,9 @@ $ cd $VISP_WS/my-project $ more CMakeLists.txt \endcode \code -project(example-dummy) +cmake_minimum_required(VERSION 3.5) -cmake_minimum_required(VERSION 3.0) +project(example-dummy) find_package(VISP REQUIRED visp_core visp_robot) diff --git a/doc/tutorial/image/tutorial-basic-drawings.dox b/doc/tutorial/image/tutorial-basic-drawings.dox index 3877094ee6..fb50b0a0c0 100644 --- a/doc/tutorial/image/tutorial-basic-drawings.dox +++ b/doc/tutorial/image/tutorial-basic-drawings.dox @@ -4,7 +4,7 @@ \section basic_drawings_intro Introduction -In this tutorial you will learn how to modify the content of an image adding basic drawings without the need of an image display window. This functionality could be useful if none of the following 3rd parties are available: X11, GDI, OpenCV, GTK, Direct3D. +In this tutorial you will learn how to modify the content of an image adding basic drawings without the need of an image display window. This functionality could be useful if none of the following 3rd parties are available: X11, GDI, OpenCV, GTK, Direct3D. \section basic_drawings_draw Modify an image with basic drawings @@ -18,9 +18,9 @@ $ ./testImageDraw it will create `canvas_color.png` and `canvas_gray.png` images that give a good overview. - Content of `canvas_color.png` image that shows basic drawings inserted in a color image implemented as a `vpImage` is the following: -\image html img-tutorial-drawings-color.png +\image html img-tutorial-drawings-color.png - Content of `canvas_gray.png` image that shows basic drawings inserted in a gray level image implemented as a `vpImage` is the following: -\image html img-tutorial-drawings-gray.png +\image html img-tutorial-drawings-gray.png \subsection basic_drawings_point Draw a point in an image diff --git a/doc/tutorial/image/tutorial-image-display-overlay.dox b/doc/tutorial/image/tutorial-image-display-overlay.dox index 860e75569f..73e4231727 100644 --- a/doc/tutorial/image/tutorial-image-display-overlay.dox +++ b/doc/tutorial/image/tutorial-image-display-overlay.dox @@ -14,9 +14,9 @@ $ svn export https://github.com/lagadic/visp.git/trunk/tutorial/image \section display_overlay_default Load and display an image -ViSP gui module provides Graphical User Interfaces capabilities. To this end you may use several optional third-party libraries which are: X11, GDI, OpenCV, GTK, Direct3D. In the next example, we will use the first 3rd party that is available from the previous list. +ViSP gui module provides Graphical User Interfaces capabilities. To this end you may use several optional third-party libraries which are: X11, GDI, OpenCV, GTK, Direct3D. In the next example, we will use the first 3rd party that is available from the previous list. -The following example also available in tutorial-viewer.cpp shows how to read and display an image. +The following example also available in tutorial-viewer.cpp shows how to read and display an image. \include tutorial-viewer.cpp @@ -32,7 +32,7 @@ It will open a window containing `monkey.png` image: Here is the detailed explanation of the source, line by line : \snippet tutorial-viewer.cpp Include display -Include all the headers for image viewers. The two first one are for Windows systems. They require that Direct 3D or the \e Graphical \e Device \e Interface (\e GDI) coming with the installation of Visual Studio are available. The third one needs GTK that is cross-platform. The fourth is for unix-like systems and requires that \e libX11 is available. The last one is also cross-platform and requires that OpenCV is available. +Include all the headers for image viewers. The two first one are for Windows systems. They require that Direct 3D or the \e Graphical \e Device \e Interface (\e GDI) coming with the installation of Visual Studio are available. The third one needs GTK that is cross-platform. The fourth is for unix-like systems and requires that \e libX11 is available. The last one is also cross-platform and requires that OpenCV is available. \snippet tutorial-viewer.cpp Include io Include the header that allows to read/write PGM, PPM, PNG and JPEG images from the disk using vpImageIo class. @@ -44,10 +44,10 @@ Create an instance of a color image where each pixel is coded in RGBa. The image \c I is initialized by reading an image file from the disk. If the image format is not supported we throw an exception. \snippet tutorial-viewer.cpp vpDisplay construction -Create an instance of an image display window for image \c I. The first viewer that is available is used. Here we create the link between the image \c I and the display \c d. Note that an image can only have one display. +Create an instance of an image display window for image \c I. The first viewer that is available is used. Here we create the link between the image \c I and the display \c d. Note that an image can only have one display. \snippet tutorial-viewer.cpp vpDisplay set title -The title of the display is then set to \c "My image". +The title of the display is then set to \c "My image". \snippet tutorial-viewer.cpp vpDisplay display First we display the content of the image \c I, then we flush the display to render the image. diff --git a/doc/tutorial/image/tutorial-image-display.dox b/doc/tutorial/image/tutorial-image-display.dox index dd30ea1925..ff4770efbd 100644 --- a/doc/tutorial/image/tutorial-image-display.dox +++ b/doc/tutorial/image/tutorial-image-display.dox @@ -17,16 +17,16 @@ $ svn export https://github.com/lagadic/visp.git/trunk/tutorial/image \section image_display_default Create and display an image in a window -ViSP gui module provides Graphical User Interfaces capabilities that allows to display a vpImage in a window. To this end you may use several optional third-party libraries which are: X11, GDI, OpenCV, GTK, Direct3D. We recommend to use X11 on unix-like systems thanks to vpDisplayX class and GDI on Windows thanks to vpDisplayGDI. If none of these classes are available, you may use vpDisplayOpenCV instead. +ViSP gui module provides Graphical User Interfaces capabilities that allows to display a vpImage in a window. To this end you may use several optional third-party libraries which are: X11, GDI, OpenCV, GTK, Direct3D. We recommend to use X11 on unix-like systems thanks to vpDisplayX class and GDI on Windows thanks to vpDisplayGDI. If none of these classes are available, you may use vpDisplayOpenCV instead. -The following example also available in tutorial-image-display.cpp shows how to create a gray level 3840x2160 image with all the pixels set to 128, and display a red circle with 200 pixel radius in the middle of the image. +The following example also available in tutorial-image-display.cpp shows how to create a gray level 3840x2160 image with all the pixels set to 128, and display a red circle with 200 pixel radius in the middle of the image. \include tutorial-image-display.cpp Depending on your screen resolution you may just see a part of the image, and certainly not the full red circle. Next image shows an example of this behavior when screen resolution is less than image size: \image html img-tutorial-display.png -\note A vpImage can only be associated to one display window. In the previous example, image `I` is associated to display `d`. Depending on your platform, object `d` is either a vpDisplayX or a vpDisplayGDI. +\note A vpImage can only be associated to one display window. In the previous example, image `I` is associated to display `d`. Depending on your platform, object `d` is either a vpDisplayX or a vpDisplayGDI. \section image_display_scaled Display an image that is larger than the screen resolution diff --git a/doc/tutorial/image/tutorial-image-filtering.dox b/doc/tutorial/image/tutorial-image-filtering.dox index 2652b26e42..6db477e912 100644 --- a/doc/tutorial/image/tutorial-image-filtering.dox +++ b/doc/tutorial/image/tutorial-image-filtering.dox @@ -19,25 +19,25 @@ Let us consider the following source code that comes from tutorial-image-filter. \include tutorial-image-filter.cpp -Once build, you should have \c tutorial-image-filter binary. It shows how to apply different filters on an input image. Here we will consider monkey.pgm as input image. +Once build, you should have \c tutorial-image-filter binary. It shows how to apply different filters on an input image. Here we will consider monkey.pgm as input image. \image html img-monkey-gray.png To see the resulting filtered images, just run: -\code +\code ./tutorial-image-filter monkey.pgm -\endcode +\endcode The following sections give a line by line explanation of the source code dedicated to image filtering capabilities. - + \section blur Gaussian blur -Monkey input image is read from disk and is stored in \c I which is a gray level image declared as +Monkey input image is read from disk and is stored in \c I which is a gray level image declared as \snippet tutorial-image-filter.cpp vpImage construction -To apply a Gaussian blur to this image we first have to declare a resulting floating-point image \c F. Then the blurred image could be obtained using the default Gaussian filter: +To apply a Gaussian blur to this image we first have to declare a resulting floating-point image \c F. Then the blurred image could be obtained using the default Gaussian filter: \snippet tutorial-image-filter.cpp Gaussian blur @@ -47,9 +47,9 @@ The resulting image is the following: It is also possible to specify the Gaussian filter kernel size and the Gaussian standard deviation (sigma) using: -\code +\code vpImageFilter::gaussianBlur(I, F, 7, 2); // Kernel size: 7, sigma: 2 -\endcode +\endcode We thus obtain the following image: @@ -71,40 +71,38 @@ The resulting floating-point images \c dIx, \c dIy are the following: \section canny Canny edge detector -Canny edge detector function is only available if ViSP was build with OpenCV 2.1 or higher. +Canny edge detector function relies on OpenCV if ViSP was build with OpenCV 2.1 or higher. Otherwise, +it relies on the ViSP implementation in vpCannyEdgeDetector class. After the declaration of a new image container \c C, Canny edge detector is applied using: \snippet tutorial-image-filter.cpp Canny Where: -- 5: is the low threshold -- 15: is the high threshold set in the program as three times the lower threshold (following Canny’s recommendation) +- 5: is the size of the Gaussian kernel used to blur the image before applying the Canny edge detector. +- -1.: is the upper threshold set in the program. Setting it to a negative value asks ViSP to compute automatically the lower and upper thresholds. Otherwise, +the lower threshold is set to be equal to one third of the upper threshold, following Canny’s recommendation. - 3: is the size of the Sobel kernel used internally. The resulting image \c C is the following: - + \image html img-monkey-canny.png -\section convolution Convolution +\section convolution Convolution To apply a convolution to an image, we first have to define a kernel. For example, let us consider the 3x3 Sobel kernel defined in \c K. - \f[ - {\bf K} = \begin{tabular}{|c|c|c|} - \hline - 1 & 0 & -1 \\ - \hline - 2 & 0 & -2 \\ - \hline - 1 & 0 & -1 \\ - \hline - \end{tabular} - \f] +\f[ +{\bf K} = \left[ \begin{matrix} +1 & 0 & -1 \\ +2 & 0 & -2 \\ +1 & 0 & -1 \\ +\end{matrix} \right] +\f] \snippet tutorial-image-filter.cpp Convolution kernel -After the declaration of a new floating-point image \c Gx, the convolution is obtained using: +After the declaration of a new floating-point image \c Gx, the convolution is obtained using: \snippet tutorial-image-filter.cpp Convolution The content of the filtered image \c Gx is the following. diff --git a/doc/tutorial/imgproc/tutorial-imgproc-cht.dox b/doc/tutorial/imgproc/tutorial-imgproc-cht.dox new file mode 100644 index 0000000000..08a200332c --- /dev/null +++ b/doc/tutorial/imgproc/tutorial-imgproc-cht.dox @@ -0,0 +1,152 @@ +/** + +\page tutorial-imgproc-cht Tutorial: Gradient-based Circle Hough Transform +\tableofcontents + +\section imgproc_cht_intro Introduction + +The Circle Hough Transform (*CHT*) is an image processing algorithm that permits to +detect circles in an image. We refer the interested reader to the +[Wikipedia page](https://en.wikipedia.org/wiki/Circle_Hough_Transform) to have a better +understanding on the principles of the algorithm. + +The ViSP implementation relies on the Gradient-based implementation of the +algorithm. + +During the step where the algorithm votes for center candidates, we use the gradient information +in order to reduce the dimensionality of the search space. Instead of voting in circular pattern, +we vote along a straight line that follows the gradient. + +\image html img-tutorial-cht-center-votes.png + +Then, during the step where the algorithm votes for radius candidates for each center candidate, +we check the colinearity between the gradient at a considered point and the line which links the +point towards the center candidate. If they are "enough" colinear, we increment the corresponding +radius bin vote by 1. The "enough" characteristic is controlled by the circle perfectness +parameter. + +\image html img-tutorial-cht-radius-votes.png + +\section imgproc_cht_requirements Requirements + +With the current implementation, the `vpCircleHoughTransform` requires ViSP to be compiled with OpenCV. +If you do not know how to do it, please refer to the installation guidelines of \ref soft_vision_opencv. + +\section imgproc_cht_howto How to use the tutorial + +It is possible to configure the `vpCircleHoughTransform` class using a JSON file. +To do so, you need to install [JSON for modern C++](https://visp-doc.inria.fr/doxygen/visp-daily/supported-third-parties.html#soft_tool_json) +and compile ViSP with it. + +You can also configure the `vpCircleHoughTransform` class using command line arguments. +To know what are the different command line arguments the software accept, please run: +``` +$ cd tutorial/imgproc/hough-transform +$ ./tutorial-circle-hough --help +``` + +\subsection imgproc_cht_howto_synthetic How to use synthetic images + + +To run the software on the synthetic images using a JSON configuration file, +please run: +``` +$ TARGET=full # or TARGET=half # or TARGET=quarter +$ ./tutorial-circle-hough --input ${TARGET}_disks --config config/detector_${TARGET}.json +``` + +To run the software on the synthetic images using the default parameters, +please run: +``` +$ TARGET=full # or TARGET=half # or TARGET=quarter +$ ./tutorial-circle-hough --input ${TARGET}_disks +``` + +\subsection imgproc_cht_howto_images How to use actual images + +To run the software on an actual image like `coins2.jpg` provided with the tutorial and using a JSON configuration file, please run: +``` +$ ./tutorial-circle-hough --input coins2.jpg --config config/detector_img.json +``` + +\note The configuration file `config/detector_img.json` has been tuned to detect circles in the image `coins2.jpg`. +If the detections seem a bit off, you might need to change the parameters in `config/detector_img.json`. + +To run the software on an actual image using command line arguments instead, please run: +``` +$ ./tutorial-circle-hough --input /path/to/my/image --gaussian-kernel 5 --gaussian-sigma 1 --canny-thresh -1. --dilatation-repet 1 --center-thresh 200 --radius-bin 2 --radius-thresh 2 --radius-limits 80 90 --merging-thresh 15 2 --circle-perfectness 0.9 +``` + +If the detections seem a bit off, you might need to change the parameters + +\subsection imgproc_cht_howto_video How to use a video + +You can use the software to run circle detection on a video saved as a +sequence of images that are named `${BASENAME}%d.png`. +For instance with `${BASENAME}` = `video_`, you can have the following list +of images: `video_0001.png`, `video_0002.png` and so on. + +To run the software using a JSON configuration file, please run: +``` +$ ./tutorial-circle-hough --input /path/to/video/${BASENAME}%d.png --config config/detector_img.json +``` + +To run the software using the command arguments, please run: +``` +./tutorial-circle-hough --input /path/to/video/${BASENAME}%d.png --gaussian-kernel 5 --gaussian-sigma 1 --canny-thresh -1. --dilatation-repet 1 --center-thresh 200 --radius-bin 2 --radius-thresh 2 --radius-limits 80 90 --merging-thresh 15 2 --circle-perfectness 0.9 +``` + +\section imgproc_cht_explanations Detailed explanations about the tutorial + +An enumeration permits to choose between the different types of synthetic images +or using actual images or videos: + +\snippet tutorial-circle-hough.cpp Enum input + +You can choose the type you want using the command line arguments. To know how to do it, +please run: +``` +$ ./tutorial-circle-hough --help +``` + +If you decide to use a video as input, the relevant piece of code that permits to +perform circle detection on the successive images of the video is the following: +\snippet tutorial-circle-hough.cpp Manage video + +If you decide to use a single image as input, the relevant piece of code that permits to +perform circle detection on the image is the following: +\snippet tutorial-circle-hough.cpp Manage single image + +If you decide to use a synthetic image as input, the relevant piece of code that +launches the detection on the synthetic image is the following: +\snippet tutorial-circle-hough.cpp Manage synthetic image + +The function that draws the synthetic image is the following: +\snippet tutorial-circle-hough.cpp Draw synthetic + +It relies on the following function to draw the disks: +\snippet tutorial-circle-hough.cpp Draw disks + +If you did not use a JSON file to configure the `vpCircleHoughTransform` detector, +the following structure defines the parameters of the algorithm based on the +command line arguments: +\snippet tutorial-circle-hough.cpp Algo params + +The initialization of the algorithm is performed in the following piece of code. +If a JSON configuration file is given as input configuration, it will be preferred +to the command line arguments: +\snippet tutorial-circle-hough.cpp Algo init + +To run the circle detection, you must call the following method: +\snippet tutorial-circle-hough.cpp Run detection + +You could have also used the following method to get only the `num_best` best +detections: +\code +int num_best; // Set it to the number of circles you want to keep +std::vector detections = detector.detect(I, num_best); +\endcode + +Then, you can iterate on the vector of detections using a synthax similar to the following: +\snippet tutorial-circle-hough.cpp Iterate detections +*/ diff --git a/doc/tutorial/imgproc/tutorial-imgproc-count-coins.dox b/doc/tutorial/imgproc/tutorial-imgproc-count-coins.dox index c29d637392..123dd01bdb 100644 --- a/doc/tutorial/imgproc/tutorial-imgproc-count-coins.dox +++ b/doc/tutorial/imgproc/tutorial-imgproc-count-coins.dox @@ -37,7 +37,7 @@ $ ./tutorial-count-coins To run the demo code for the sample image 2: \code -$ ./tutorial-count-coins --input coins2.pgm --white_foreground +$ ./tutorial-count-coins --input coins2.jpg --white_foreground \endcode The functions we will use needs the following includes: diff --git a/doc/tutorial/ios/tutorial-image-ios.dox b/doc/tutorial/ios/tutorial-image-ios.dox index 67d3672d3f..30b4df2f8e 100644 --- a/doc/tutorial/ios/tutorial-image-ios.dox +++ b/doc/tutorial/ios/tutorial-image-ios.dox @@ -7,9 +7,9 @@ This tutorial supposes that you have followed the \ref tutorial-getting-started- \section image_ios_intro Introduction -In this tutorial you will learn how to do simple image processing on iOS devices with ViSP. This application loads a color image (monkey.png) and allows the user to visualize either this image in grey level, either the image gradients, or either canny edges on iOS simulator or devices. +In this tutorial you will learn how to do simple image processing on iOS devices with ViSP. This application loads a color image (monkey.png) and allows the user to visualize either this image in grey level, either the image gradients, or either canny edges on iOS simulator or devices. -In ViSP images are carried out using vpImage class. However in iOS, image rendering has to be done using UIImage class that is part of the Core Graphics framework available in iOS. In this tutorial we provide the functions that allow to convert a vpImage to an UIImage and \e vice \e versa. +In ViSP images are carried out using vpImage class. However in iOS, image rendering has to be done using UIImage class that is part of the Core Graphics framework available in iOS. In this tutorial we provide the functions that allow to convert a vpImage to an UIImage and \e vice \e versa. Note that all the material (source code and image) used in this tutorial is part of ViSP source code and could be downloaded using the following command: @@ -49,25 +49,25 @@ Now you should be able to build and run your application. The Xcode project `StartedImageProc` contains `ImageConversion.h` and `ImageConversion.mm` files that implement the functions to convert UIImage to ViSP vpImage and vice versa. \subsection image_ios_convert_uiimage_vpimage_color UIImage to color vpImage -The following function implemented in \c ImageConversion.mm show how to convert an `UIImage` into a `vpImage` instanciated as a color image. +The following function implemented in \c ImageConversion.mm show how to convert an `UIImage` into a `vpImage` instantiated as a color image. \snippet tutorial/ios/StartedImageProc/StartedImageProc/ImageConversion.mm vpImageColorFromUIImage -\subsection image_ios_convert_uiimage_vpimage_gray UIImage to gray vpImage +\subsection image_ios_convert_uiimage_vpimage_gray UIImage to gray vpImage -The following function implemented in `ImageConversion.mm` show how to convert an `UIImage` into a `vpImage` instanciated as a grey level image. +The following function implemented in `ImageConversion.mm` show how to convert an `UIImage` into a `vpImage` instantiated as a grey level image. \snippet tutorial/ios/StartedImageProc/StartedImageProc/ImageConversion.mm vpImageGrayFromUIImage \subsection image_ios_convert_vpimage_color_uiimage Color vpImage to UIImage -The following function implemented in `ImageConversion.mm` show how to convert a gray level `vpImage` into an UIImage. +The following function implemented in `ImageConversion.mm` show how to convert a gray level `vpImage` into an UIImage. \snippet tutorial/ios/StartedImageProc/StartedImageProc/ImageConversion.mm UIImageFromVpImageColor \subsection image_ios_convert_vpimage_gray_uiimage Gray vpImage to UIImage -The following function implemented in `ImageConversion.mm` show how to convert a color `vpImage` into an `UIImage`. +The following function implemented in `ImageConversion.mm` show how to convert a color `vpImage` into an `UIImage`. \snippet tutorial/ios/StartedImageProc/StartedImageProc/ImageConversion.mm UIImageFromVpImageGray @@ -79,7 +79,7 @@ The following function implemented in `ImageConversion.mm` show how to convert a - Once build, if you run `StartedImageProc` application on your device, you should be able to see the following screen shots. - Pressing `"load image"` button gives the following result: -\image html img-started-imgproc-ios-output-color.jpg +\image html img-started-imgproc-ios-output-color.jpg - Pressing `"convert to gray"` button gives the following result: \image html img-started-imgproc-ios-output-gray.jpg - Pressing `"compute gradient"` button gives the following result: diff --git a/doc/tutorial/ios/tutorial-install-iOS.dox b/doc/tutorial/ios/tutorial-install-iOS.dox index b09792748e..13f0cbdf16 100644 --- a/doc/tutorial/ios/tutorial-install-iOS.dox +++ b/doc/tutorial/ios/tutorial-install-iOS.dox @@ -55,12 +55,12 @@ $ cd $HOME/framework $ git clone https://github.com/lagadic/visp.git \endverbatim -- You can also download a daily snapshot. Once downloaded, uncompress the file using +- You can also download a daily snapshot. Once downloaded, uncompress the file using \verbatim $ tar xvzf visp-snapshot-yyyy-mm-dd.tar.gz -C $HOME/framework \endverbatim -- Or you can download the latest release as a zip or a tarball. Once downloaded, uncompress the file using either +- Or you can download the latest release as a zip or a tarball. Once downloaded, uncompress the file using either \verbatim $ tar xvzf visp-x.y.z.tar.gz -C $HOME/framework \endverbatim @@ -89,6 +89,12 @@ $ ls $HOME/framework/ios build opencv2.framework visp3.framework \endverbatim +- There is also the possibility to build ViSP framework specifying the deployment target and the arch +\verbatim +$ cd $HOME/framework +$ python3 visp/platforms/ios/build_framework.py ios --iphoneos_deployment_target 11.0 --iphoneos_archs arm64 --build_only_specified_archs True +\endverbatim + \note ViSP framework is build with capabilities that enables the usage of the following 3rd parties: XML, OpenCV, pthread, apriltag, lapack. \section install_iOS_know_issue Known issues diff --git a/doc/tutorial/java/tutorial-install-java.dox b/doc/tutorial/java/tutorial-install-java.dox index 9392f67fd1..23e29d1583 100644 --- a/doc/tutorial/java/tutorial-install-java.dox +++ b/doc/tutorial/java/tutorial-install-java.dox @@ -139,7 +139,7 @@ $ brew install cmake ant python3 There are different ways to get ViSP source code: -- You can download the latest release as a zip or a tarball. Once downloaded, uncompress the file using either +- You can download the latest release as a zip or a tarball. Once downloaded, uncompress the file using either \verbatim $ tar xvzf visp-x.y.z.tar.gz -C $VISP_WS \endverbatim @@ -148,7 +148,7 @@ or $ unzip visp-x.y.z.zip -d $VISP_WS \endverbatim -- You can also download a daily snapshot. Once downloaded, uncompress the file using +- You can also download a daily snapshot. Once downloaded, uncompress the file using \verbatim $ tar xvzf visp-snapshot-yyyy-mm-dd.tar.gz -C $VISP_WS \endverbatim diff --git a/doc/tutorial/java/tutorial-java-started.dox b/doc/tutorial/java/tutorial-java-started.dox index 88c36fb513..6e9f154045 100644 --- a/doc/tutorial/java/tutorial-java-started.dox +++ b/doc/tutorial/java/tutorial-java-started.dox @@ -81,7 +81,7 @@ To fix this issue, as explained in \ref tutorial-install-java install JDK 11 and As shown in the next image, if you experience the following exception after entering `"Run > Run"` menu: \verbatim -Exception in thread "main" java.lang.UnsatisfiedLinkError: no visp_java321 in java.library.path: [/home/fspindle/visp_ws/visp-build/lib] +Exception in thread "main" java.lang.UnsatisfiedLinkError: no visp_java321 in java.library.path: [/home/fspindle/visp-ws/visp-build/lib] \endverbatim \image html img-tutorial-java-issue-visp-version.jpg diff --git a/doc/tutorial/linear-algebra/logs/perfMatrixMultiplication/mkl-benchmark.txt b/doc/tutorial/linear-algebra/logs/perfMatrixMultiplication/mkl-benchmark.txt index f87031a759..ad14018cf4 100644 --- a/doc/tutorial/linear-algebra/logs/perfMatrixMultiplication/mkl-benchmark.txt +++ b/doc/tutorial/linear-algebra/logs/perfMatrixMultiplication/mkl-benchmark.txt @@ -8,507 +8,506 @@ Run with -? for options ------------------------------------------------------------------------------- Benchmark matrix-matrix multiplication ------------------------------------------------------------------------------- -/home/fspindle/visp_ws/visp-fspindle/modules/core/test/math/perfMatrixMultiplication.cpp:217 +/home/fspindle/visp-ws/visp-fspindle/modules/core/test/math/perfMatrixMultiplication.cpp:217 ............................................................................... benchmark name samples iterations estimated mean low mean high mean std dev low std dev high std dev ------------------------------------------------------------------------------- -(3x3)x(3x3) - Naive code 100 223 2.0516 ms - 89 ns 88 ns 89 ns - 1 ns 0 ns 3 ns - -(3x3)x(3x3) - ViSP 100 103 2.06 ms - 202 ns 200 ns 210 ns - 17 ns 1 ns 40 ns - -(6x6)x(6x6) - Naive code 100 95 2.052 ms - 217 ns 216 ns 219 ns - 5 ns 3 ns 9 ns - -(6x6)x(6x6) - ViSP 100 114 2.0406 ms - 179 ns 178 ns 185 ns - 10 ns 0 ns 24 ns - -(8x8)x(8x8) - Naive code 100 54 2.079 ms - 388 ns 387 ns 390 ns - 6 ns 0 ns 14 ns - -(8x8)x(8x8) - ViSP 100 84 2.0664 ms - 245 ns 244 ns 253 ns - 16 ns 0 ns 38 ns - -(10x10)x(10x10) - Naive code 100 28 2.0496 ms - 673 ns 672 ns 678 ns - 10 ns 0 ns 26 ns - -(10x10)x(10x10) - ViSP 100 50 2.045 ms - 385 ns 356 ns 426 ns - 174 ns 135 ns 239 ns - -(20x20)x(20x20) - Naive code 100 4 2.4388 ms - 5.698 us 5.516 us 6.146 us - 1.362 us 498 ns 2.484 us - -(20x20)x(20x20) - ViSP 100 26 2.0774 ms - 994 ns 950 ns 1.057 us - 269 ns 209 ns 355 ns - -(6x200)x(200x6) - Naive code 100 3 2.2197 ms - 7.398 us 7.266 us 7.735 us - 975 ns 239 ns 1.757 us - -(6x200)x(200x6) - ViSP 100 32 2.0992 ms - 615 ns 592 ns 669 ns - 171 ns 86 ns 304 ns - -(200x6)x(6x200) - Naive code 100 1 17.175 ms - 165.571 us 160.191 us 173.5 us - 32.984 us 24.704 us 44.521 us - -(200x6)x(6x200) - ViSP 100 1 2.8158 ms - 29.848 us 28.934 us 31.884 us - 6.576 us 3.754 us 12.739 us - -(207x119)x(119x207) - Naive code 100 1 503.475 ms - 5.26692 ms 5.21554 ms 5.33146 ms - 293.196 us 245.95 us 386.767 us - -(207x119)x(119x207) - ViSP 100 1 24.0501 ms - 241.335 us 232.314 us 253.677 us - 53.573 us 41.88 us 67.573 us - -(83x201)x(201x83) - Naive code 100 1 135.879 ms - 1.36202 ms 1.35929 ms 1.36931 ms - 21.007 us 9.253 us 44.017 us - -(83x201)x(201x83) - ViSP 100 1 8.335 ms - 70.298 us 67.956 us 74.124 us - 14.996 us 10.355 us 21.024 us - -(600x400)x(400x600) - Naive code 100 1 15.4613 s - 171.254 ms 166 ms 178.327 ms - 31.0091 ms 24.7589 ms 39.2442 ms - -(600x400)x(400x600) - ViSP 100 1 647.363 ms - 6.38457 ms 6.34948 ms 6.41008 ms - 151.093 us 109.895 us 216.753 us - -(400x600)x(600x400) - Naive code 100 1 10.185 s - 102.595 ms 102.154 ms 103.28 ms - 2.76177 ms 1.93992 ms 3.67911 ms - -(400x600)x(600x400) - ViSP 100 1 424.223 ms - 4.21401 ms 4.18659 ms 4.23194 ms - 111.623 us 77.423 us 160.784 us - +(3x3)x(3x3) - Naive code 100 223 2.0516 ms + 89 ns 88 ns 89 ns + 1 ns 0 ns 3 ns + +(3x3)x(3x3) - ViSP 100 103 2.06 ms + 202 ns 200 ns 210 ns + 17 ns 1 ns 40 ns + +(6x6)x(6x6) - Naive code 100 95 2.052 ms + 217 ns 216 ns 219 ns + 5 ns 3 ns 9 ns + +(6x6)x(6x6) - ViSP 100 114 2.0406 ms + 179 ns 178 ns 185 ns + 10 ns 0 ns 24 ns + +(8x8)x(8x8) - Naive code 100 54 2.079 ms + 388 ns 387 ns 390 ns + 6 ns 0 ns 14 ns + +(8x8)x(8x8) - ViSP 100 84 2.0664 ms + 245 ns 244 ns 253 ns + 16 ns 0 ns 38 ns + +(10x10)x(10x10) - Naive code 100 28 2.0496 ms + 673 ns 672 ns 678 ns + 10 ns 0 ns 26 ns + +(10x10)x(10x10) - ViSP 100 50 2.045 ms + 385 ns 356 ns 426 ns + 174 ns 135 ns 239 ns + +(20x20)x(20x20) - Naive code 100 4 2.4388 ms + 5.698 us 5.516 us 6.146 us + 1.362 us 498 ns 2.484 us + +(20x20)x(20x20) - ViSP 100 26 2.0774 ms + 994 ns 950 ns 1.057 us + 269 ns 209 ns 355 ns + +(6x200)x(200x6) - Naive code 100 3 2.2197 ms + 7.398 us 7.266 us 7.735 us + 975 ns 239 ns 1.757 us + +(6x200)x(200x6) - ViSP 100 32 2.0992 ms + 615 ns 592 ns 669 ns + 171 ns 86 ns 304 ns + +(200x6)x(6x200) - Naive code 100 1 17.175 ms + 165.571 us 160.191 us 173.5 us + 32.984 us 24.704 us 44.521 us + +(200x6)x(6x200) - ViSP 100 1 2.8158 ms + 29.848 us 28.934 us 31.884 us + 6.576 us 3.754 us 12.739 us + +(207x119)x(119x207) - Naive code 100 1 503.475 ms + 5.26692 ms 5.21554 ms 5.33146 ms + 293.196 us 245.95 us 386.767 us + +(207x119)x(119x207) - ViSP 100 1 24.0501 ms + 241.335 us 232.314 us 253.677 us + 53.573 us 41.88 us 67.573 us + +(83x201)x(201x83) - Naive code 100 1 135.879 ms + 1.36202 ms 1.35929 ms 1.36931 ms + 21.007 us 9.253 us 44.017 us + +(83x201)x(201x83) - ViSP 100 1 8.335 ms + 70.298 us 67.956 us 74.124 us + 14.996 us 10.355 us 21.024 us + +(600x400)x(400x600) - Naive code 100 1 15.4613 s + 171.254 ms 166 ms 178.327 ms + 31.0091 ms 24.7589 ms 39.2442 ms + +(600x400)x(400x600) - ViSP 100 1 647.363 ms + 6.38457 ms 6.34948 ms 6.41008 ms + 151.093 us 109.895 us 216.753 us + +(400x600)x(600x400) - Naive code 100 1 10.185 s + 102.595 ms 102.154 ms 103.28 ms + 2.76177 ms 1.93992 ms 3.67911 ms + +(400x600)x(600x400) - ViSP 100 1 424.223 ms + 4.21401 ms 4.18659 ms 4.23194 ms + 111.623 us 77.423 us 160.784 us + ------------------------------------------------------------------------------- Benchmark matrix-rotation matrix multiplication ------------------------------------------------------------------------------- -/home/fspindle/visp_ws/visp-fspindle/modules/core/test/math/perfMatrixMultiplication.cpp:294 +/home/fspindle/visp-ws/visp-fspindle/modules/core/test/math/perfMatrixMultiplication.cpp:294 ............................................................................... benchmark name samples iterations estimated mean low mean high mean std dev low std dev high std dev ------------------------------------------------------------------------------- -(3x3)x(3x3) - Naive code 100 162 2.0412 ms - 118 ns 118 ns 119 ns - 2 ns 0 ns 5 ns - -(3x3)x(3x3) - ViSP 100 221 2.0332 ms - 86 ns 85 ns 87 ns - 2 ns 0 ns 4 ns - +(3x3)x(3x3) - Naive code 100 162 2.0412 ms + 118 ns 118 ns 119 ns + 2 ns 0 ns 5 ns + +(3x3)x(3x3) - ViSP 100 221 2.0332 ms + 86 ns 85 ns 87 ns + 2 ns 0 ns 4 ns + ------------------------------------------------------------------------------- Benchmark matrix-homogeneous matrix multiplication ------------------------------------------------------------------------------- -/home/fspindle/visp_ws/visp-fspindle/modules/core/test/math/perfMatrixMultiplication.cpp:379 +/home/fspindle/visp-ws/visp-fspindle/modules/core/test/math/perfMatrixMultiplication.cpp:379 ............................................................................... benchmark name samples iterations estimated mean low mean high mean std dev low std dev high std dev ------------------------------------------------------------------------------- -(4x4)x(4x4) - Naive code 100 135 2.052 ms - 146 ns 146 ns 148 ns - 3 ns 0 ns 8 ns - -(4x4)x(4x4) - ViSP 100 174 2.0358 ms - 112 ns 112 ns 113 ns - 2 ns 0 ns 5 ns - +(4x4)x(4x4) - Naive code 100 135 2.052 ms + 146 ns 146 ns 148 ns + 3 ns 0 ns 8 ns + +(4x4)x(4x4) - ViSP 100 174 2.0358 ms + 112 ns 112 ns 113 ns + 2 ns 0 ns 5 ns + ------------------------------------------------------------------------------- Benchmark matrix-vector multiplication ------------------------------------------------------------------------------- -/home/fspindle/visp_ws/visp-fspindle/modules/core/test/math/perfMatrixMultiplication.cpp:467 +/home/fspindle/visp-ws/visp-fspindle/modules/core/test/math/perfMatrixMultiplication.cpp:467 ............................................................................... benchmark name samples iterations estimated mean low mean high mean std dev low std dev high std dev ------------------------------------------------------------------------------- -(3x3)x(3x1) - Naive code 100 273 2.0475 ms - 73 ns 71 ns 76 ns - 10 ns 1 ns 19 ns - -(3x3)x(3x1) - ViSP 100 169 2.0449 ms - 139 ns 129 ns 153 ns - 61 ns 45 ns 79 ns - -(6x6)x(6x1) - Naive code 100 213 2.0448 ms - 91 ns 91 ns 91 ns - 1 ns 0 ns 3 ns - -(6x6)x(6x1) - ViSP 100 158 2.0382 ms - 123 ns 123 ns 126 ns - 5 ns 1 ns 11 ns - -(8x8)x(8x1) - Naive code 100 179 2.0406 ms - 107 ns 107 ns 108 ns - 1 ns 0 ns 4 ns - -(8x8)x(8x1) - ViSP 100 157 2.041 ms - 124 ns 124 ns 126 ns - 4 ns 0 ns 7 ns - -(10x10)x(10x1) - Naive code 100 132 2.046 ms - 133 ns 133 ns 135 ns - 2 ns 0 ns 5 ns - -(10x10)x(10x1) - ViSP 100 136 2.04 ms - 137 ns 136 ns 141 ns - 10 ns 0 ns 25 ns - -(20x20)x(20x1) - Naive code 100 59 2.0473 ms - 311 ns 310 ns 313 ns - 4 ns 0 ns 11 ns - -(20x20)x(20x1) - ViSP 100 106 2.0564 ms - 180 ns 178 ns 185 ns - 12 ns 0 ns 29 ns - -(6x200)x(200x1) - Naive code 100 23 2.1183 ms - 794 ns 793 ns 795 ns - 3 ns 0 ns 7 ns - -(6x200)x(200x1) - ViSP 100 93 2.0646 ms - 201 ns 199 ns 211 ns - 20 ns 2 ns 47 ns - -(200x6)x(6x1) - Naive code 100 16 2.0624 ms - 1.164 us 1.161 us 1.176 us - 25 ns 1 ns 59 ns - -(200x6)x(6x1) - ViSP 100 25 2.1075 ms - 781 ns 773 ns 822 ns - 81 ns 0 ns 193 ns - -(207x119)x(119x1) - Naive code 100 2 3.609 ms - 16.763 us 16.421 us 17.584 us - 2.573 us 1.043 us 4.592 us - -(207x119)x(119x1) - ViSP 100 6 2.2386 ms - 3.653 us 3.578 us 3.834 us - 571 ns 275 ns 983 ns - -(83x201)x(201x1) - Naive code 100 2 2.2302 ms - 10.029 us 9.913 us 10.605 us - 1.149 us 8 ns 2.742 us - -(83x201)x(201x1) - ViSP 100 10 2.199 ms - 2.092 us 2.069 us 2.195 us - 211 ns 26 ns 500 ns - -(600x400)x(400x1) - Naive code 100 1 22.7039 ms - 215.771 us 213.856 us 220.459 us - 14.681 us 7.299 us 25.746 us - -(600x400)x(400x1) - ViSP 100 1 3.4367 ms - 34.26 us 33.546 us 35.702 us - 4.943 us 2.727 us 7.98 us - -(400x600)x(600x1) - Naive code 100 1 18.0648 ms - 169.05 us 166.772 us 174.014 us - 16.283 us 8.605 us 28.822 us - -(400x600)x(600x1) - ViSP 100 1 3.3765 ms - 32.3 us 31.727 us 33.925 us - 4.274 us 644 ns 8.951 us - +(3x3)x(3x1) - Naive code 100 273 2.0475 ms + 73 ns 71 ns 76 ns + 10 ns 1 ns 19 ns + +(3x3)x(3x1) - ViSP 100 169 2.0449 ms + 139 ns 129 ns 153 ns + 61 ns 45 ns 79 ns + +(6x6)x(6x1) - Naive code 100 213 2.0448 ms + 91 ns 91 ns 91 ns + 1 ns 0 ns 3 ns + +(6x6)x(6x1) - ViSP 100 158 2.0382 ms + 123 ns 123 ns 126 ns + 5 ns 1 ns 11 ns + +(8x8)x(8x1) - Naive code 100 179 2.0406 ms + 107 ns 107 ns 108 ns + 1 ns 0 ns 4 ns + +(8x8)x(8x1) - ViSP 100 157 2.041 ms + 124 ns 124 ns 126 ns + 4 ns 0 ns 7 ns + +(10x10)x(10x1) - Naive code 100 132 2.046 ms + 133 ns 133 ns 135 ns + 2 ns 0 ns 5 ns + +(10x10)x(10x1) - ViSP 100 136 2.04 ms + 137 ns 136 ns 141 ns + 10 ns 0 ns 25 ns + +(20x20)x(20x1) - Naive code 100 59 2.0473 ms + 311 ns 310 ns 313 ns + 4 ns 0 ns 11 ns + +(20x20)x(20x1) - ViSP 100 106 2.0564 ms + 180 ns 178 ns 185 ns + 12 ns 0 ns 29 ns + +(6x200)x(200x1) - Naive code 100 23 2.1183 ms + 794 ns 793 ns 795 ns + 3 ns 0 ns 7 ns + +(6x200)x(200x1) - ViSP 100 93 2.0646 ms + 201 ns 199 ns 211 ns + 20 ns 2 ns 47 ns + +(200x6)x(6x1) - Naive code 100 16 2.0624 ms + 1.164 us 1.161 us 1.176 us + 25 ns 1 ns 59 ns + +(200x6)x(6x1) - ViSP 100 25 2.1075 ms + 781 ns 773 ns 822 ns + 81 ns 0 ns 193 ns + +(207x119)x(119x1) - Naive code 100 2 3.609 ms + 16.763 us 16.421 us 17.584 us + 2.573 us 1.043 us 4.592 us + +(207x119)x(119x1) - ViSP 100 6 2.2386 ms + 3.653 us 3.578 us 3.834 us + 571 ns 275 ns 983 ns + +(83x201)x(201x1) - Naive code 100 2 2.2302 ms + 10.029 us 9.913 us 10.605 us + 1.149 us 8 ns 2.742 us + +(83x201)x(201x1) - ViSP 100 10 2.199 ms + 2.092 us 2.069 us 2.195 us + 211 ns 26 ns 500 ns + +(600x400)x(400x1) - Naive code 100 1 22.7039 ms + 215.771 us 213.856 us 220.459 us + 14.681 us 7.299 us 25.746 us + +(600x400)x(400x1) - ViSP 100 1 3.4367 ms + 34.26 us 33.546 us 35.702 us + 4.943 us 2.727 us 7.98 us + +(400x600)x(600x1) - Naive code 100 1 18.0648 ms + 169.05 us 166.772 us 174.014 us + 16.283 us 8.605 us 28.822 us + +(400x600)x(600x1) - ViSP 100 1 3.3765 ms + 32.3 us 31.727 us 33.925 us + 4.274 us 644 ns 8.951 us + ------------------------------------------------------------------------------- Benchmark AtA ------------------------------------------------------------------------------- -/home/fspindle/visp_ws/visp-fspindle/modules/core/test/math/perfMatrixMultiplication.cpp:548 +/home/fspindle/visp-ws/visp-fspindle/modules/core/test/math/perfMatrixMultiplication.cpp:548 ............................................................................... benchmark name samples iterations estimated mean low mean high mean std dev low std dev high std dev ------------------------------------------------------------------------------- -(3x3) - Naive code 100 219 2.0367 ms - 81 ns 81 ns 82 ns - 1 ns 0 ns 2 ns - -(3x3) - ViSP 100 87 2.0445 ms - 196 ns 194 ns 202 ns - 13 ns 0 ns 32 ns - -(6x6) - Naive code 100 111 2.0535 ms - 166 ns 165 ns 167 ns - 3 ns 0 ns 7 ns - -(6x6) - ViSP 100 85 2.0485 ms - 223 ns 220 ns 233 ns - 21 ns 0 ns 50 ns - -(8x8) - Naive code 100 67 2.0435 ms - 279 ns 279 ns 282 ns - 5 ns 1 ns 12 ns - -(8x8) - ViSP 100 77 2.0482 ms - 252 ns 245 ns 266 ns - 47 ns 26 ns 77 ns - -(10x10) - Naive code 100 40 2.056 ms - 464 ns 463 ns 467 ns - 7 ns 0 ns 17 ns - -(10x10) - ViSP 100 63 2.0538 ms - 300 ns 298 ns 311 ns - 22 ns 2 ns 53 ns - -(20x20) - Naive code 100 7 2.3093 ms - 3.044 us 3.041 us 3.059 us - 30 ns 3 ns 71 ns - -(20x20) - ViSP 100 23 2.0999 ms - 815 ns 806 ns 859 ns - 87 ns 2 ns 208 ns - -(6x200) - Naive code 100 1 10.4797 ms - 97.175 us 96.383 us 98.895 us - 5.682 us 2.742 us 9.619 us - -(6x200) - ViSP 100 1 2.6835 ms - 25.388 us 24.922 us 27.178 us - 4.216 us 750 ns 9.909 us - -(200x6) - Naive code 100 5 2.0935 ms - 4.184 us 4.177 us 4.201 us - 47 ns 4 ns 86 ns - -(200x6) - ViSP 100 27 2.0871 ms - 690 ns 672 ns 733 ns - 140 ns 69 ns 229 ns - -(207x119) - Naive code 100 1 144.588 ms - 1.45281 ms 1.44668 ms 1.46487 ms - 42.491 us 24.651 us 67.98 us - -(207x119) - ViSP 100 1 14.9142 ms - 131.627 us 130.423 us 134.817 us - 8.986 us 2.199 us 16.924 us - -(83x201) - Naive code 100 1 152.614 ms - 1.49636 ms 1.49332 ms 1.50178 ms - 20.07 us 12.992 us 29.432 us - -(83x201) - ViSP 100 1 16.69 ms - 144.707 us 143.3 us 147.362 us - 9.528 us 5.805 us 16.117 us - -(600x400) - Naive code 100 1 5.72741 s - 57.3315 ms 57.1886 ms 57.538 ms - 870.225 us 658.677 us 1.14161 ms - -(600x400) - ViSP 100 1 435.461 ms - 4.30212 ms 4.27026 ms 4.31975 ms - 117.438 us 75.304 us 184.055 us - -(400x600) - Naive code 100 1 7.82654 s - 78.6463 ms 78.4704 ms 78.8933 ms - 1.05031 ms 816.214 us 1.43298 ms - -(400x600) - ViSP 100 1 660.716 ms - 6.53438 ms 6.49527 ms 6.57244 ms - 195.587 us 120.116 us 296.007 us - +(3x3) - Naive code 100 219 2.0367 ms + 81 ns 81 ns 82 ns + 1 ns 0 ns 2 ns + +(3x3) - ViSP 100 87 2.0445 ms + 196 ns 194 ns 202 ns + 13 ns 0 ns 32 ns + +(6x6) - Naive code 100 111 2.0535 ms + 166 ns 165 ns 167 ns + 3 ns 0 ns 7 ns + +(6x6) - ViSP 100 85 2.0485 ms + 223 ns 220 ns 233 ns + 21 ns 0 ns 50 ns + +(8x8) - Naive code 100 67 2.0435 ms + 279 ns 279 ns 282 ns + 5 ns 1 ns 12 ns + +(8x8) - ViSP 100 77 2.0482 ms + 252 ns 245 ns 266 ns + 47 ns 26 ns 77 ns + +(10x10) - Naive code 100 40 2.056 ms + 464 ns 463 ns 467 ns + 7 ns 0 ns 17 ns + +(10x10) - ViSP 100 63 2.0538 ms + 300 ns 298 ns 311 ns + 22 ns 2 ns 53 ns + +(20x20) - Naive code 100 7 2.3093 ms + 3.044 us 3.041 us 3.059 us + 30 ns 3 ns 71 ns + +(20x20) - ViSP 100 23 2.0999 ms + 815 ns 806 ns 859 ns + 87 ns 2 ns 208 ns + +(6x200) - Naive code 100 1 10.4797 ms + 97.175 us 96.383 us 98.895 us + 5.682 us 2.742 us 9.619 us + +(6x200) - ViSP 100 1 2.6835 ms + 25.388 us 24.922 us 27.178 us + 4.216 us 750 ns 9.909 us + +(200x6) - Naive code 100 5 2.0935 ms + 4.184 us 4.177 us 4.201 us + 47 ns 4 ns 86 ns + +(200x6) - ViSP 100 27 2.0871 ms + 690 ns 672 ns 733 ns + 140 ns 69 ns 229 ns + +(207x119) - Naive code 100 1 144.588 ms + 1.45281 ms 1.44668 ms 1.46487 ms + 42.491 us 24.651 us 67.98 us + +(207x119) - ViSP 100 1 14.9142 ms + 131.627 us 130.423 us 134.817 us + 8.986 us 2.199 us 16.924 us + +(83x201) - Naive code 100 1 152.614 ms + 1.49636 ms 1.49332 ms 1.50178 ms + 20.07 us 12.992 us 29.432 us + +(83x201) - ViSP 100 1 16.69 ms + 144.707 us 143.3 us 147.362 us + 9.528 us 5.805 us 16.117 us + +(600x400) - Naive code 100 1 5.72741 s + 57.3315 ms 57.1886 ms 57.538 ms + 870.225 us 658.677 us 1.14161 ms + +(600x400) - ViSP 100 1 435.461 ms + 4.30212 ms 4.27026 ms 4.31975 ms + 117.438 us 75.304 us 184.055 us + +(400x600) - Naive code 100 1 7.82654 s + 78.6463 ms 78.4704 ms 78.8933 ms + 1.05031 ms 816.214 us 1.43298 ms + +(400x600) - ViSP 100 1 660.716 ms + 6.53438 ms 6.49527 ms 6.57244 ms + 195.587 us 120.116 us 296.007 us + ------------------------------------------------------------------------------- Benchmark AAt ------------------------------------------------------------------------------- -/home/fspindle/visp_ws/visp-fspindle/modules/core/test/math/perfMatrixMultiplication.cpp:619 +/home/fspindle/visp-ws/visp-fspindle/modules/core/test/math/perfMatrixMultiplication.cpp:619 ............................................................................... benchmark name samples iterations estimated mean low mean high mean std dev low std dev high std dev ------------------------------------------------------------------------------- -(3x3) - Naive code 100 217 2.0398 ms - 83 ns 83 ns 84 ns - 2 ns 0 ns 4 ns - -(3x3) - ViSP 100 91 2.0566 ms - 211 ns 205 ns 223 ns - 38 ns 17 ns 68 ns - -(6x6) - Naive code 100 110 2.046 ms - 193 ns 182 ns 211 ns - 72 ns 51 ns 102 ns - -(6x6) - ViSP 100 79 2.054 ms - 267 ns 260 ns 281 ns - 45 ns 25 ns 75 ns - -(8x8) - Naive code 100 63 2.0412 ms - 337 ns 319 ns 366 ns - 113 ns 78 ns 165 ns - -(8x8) - ViSP 100 67 2.0636 ms - 279 ns 268 ns 302 ns - 77 ns 46 ns 143 ns - -(10x10) - Naive code 100 41 2.0828 ms - 459 ns 454 ns 479 ns - 48 ns 16 ns 109 ns - -(10x10) - ViSP 100 46 2.0838 ms - 363 ns 339 ns 410 ns - 163 ns 96 ns 264 ns - -(20x20) - Naive code 100 7 2.2001 ms - 4.88 us 4.665 us 5.071 us - 1.032 us 914 ns 1.14 us - -(20x20) - ViSP 100 22 2.1208 ms - 875 ns 845 ns 951 ns - 240 ns 116 ns 404 ns - -(6x200) - Naive code 100 5 2.1265 ms - 4.142 us 4.042 us 4.384 us - 758 ns 371 ns 1.295 us - -(6x200) - ViSP 100 20 2.08 ms - 947 ns 913 ns 1.026 us - 259 ns 120 ns 434 ns - -(200x6) - Naive code 100 1 9.9795 ms - 100.619 us 96.876 us 105.807 us - 22.349 us 17.575 us 29.378 us - -(200x6) - ViSP 100 1 2.872 ms - 26.514 us 25.036 us 32.238 us - 12.726 us 3.037 us 29.115 us - +(3x3) - Naive code 100 217 2.0398 ms + 83 ns 83 ns 84 ns + 2 ns 0 ns 4 ns + +(3x3) - ViSP 100 91 2.0566 ms + 211 ns 205 ns 223 ns + 38 ns 17 ns 68 ns + +(6x6) - Naive code 100 110 2.046 ms + 193 ns 182 ns 211 ns + 72 ns 51 ns 102 ns + +(6x6) - ViSP 100 79 2.054 ms + 267 ns 260 ns 281 ns + 45 ns 25 ns 75 ns + +(8x8) - Naive code 100 63 2.0412 ms + 337 ns 319 ns 366 ns + 113 ns 78 ns 165 ns + +(8x8) - ViSP 100 67 2.0636 ms + 279 ns 268 ns 302 ns + 77 ns 46 ns 143 ns + +(10x10) - Naive code 100 41 2.0828 ms + 459 ns 454 ns 479 ns + 48 ns 16 ns 109 ns + +(10x10) - ViSP 100 46 2.0838 ms + 363 ns 339 ns 410 ns + 163 ns 96 ns 264 ns + +(20x20) - Naive code 100 7 2.2001 ms + 4.88 us 4.665 us 5.071 us + 1.032 us 914 ns 1.14 us + +(20x20) - ViSP 100 22 2.1208 ms + 875 ns 845 ns 951 ns + 240 ns 116 ns 404 ns + +(6x200) - Naive code 100 5 2.1265 ms + 4.142 us 4.042 us 4.384 us + 758 ns 371 ns 1.295 us + +(6x200) - ViSP 100 20 2.08 ms + 947 ns 913 ns 1.026 us + 259 ns 120 ns 434 ns + +(200x6) - Naive code 100 1 9.9795 ms + 100.619 us 96.876 us 105.807 us + 22.349 us 17.575 us 29.378 us + +(200x6) - ViSP 100 1 2.872 ms + 26.514 us 25.036 us 32.238 us + 12.726 us 3.037 us 29.115 us + ------------------------------------------------------------------------------- Benchmark matrix-velocity twist multiplication ------------------------------------------------------------------------------- -/home/fspindle/visp_ws/visp-fspindle/modules/core/test/math/perfMatrixMultiplication.cpp:690 +/home/fspindle/visp-ws/visp-fspindle/modules/core/test/math/perfMatrixMultiplication.cpp:690 ............................................................................... benchmark name samples iterations estimated mean low mean high mean std dev low std dev high std dev ------------------------------------------------------------------------------- -(6x6)x(6x6) - Naive code 100 70 2.065 ms - 262 ns 257 ns 275 ns - 35 ns 6 ns 64 ns - -(6x6)x(6x6) - ViSP 100 106 2.0458 ms - 172 ns 169 ns 179 ns - 16 ns 0 ns 37 ns - -(20x6)x(6x6) - Naive code 100 29 2.0851 ms - 729 ns 696 ns 774 ns - 196 ns 151 ns 248 ns - -(20x6)x(6x6) - ViSP 100 60 2.058 ms - 328 ns 313 ns 358 ns - 103 ns 61 ns 160 ns - -(207x6)x(6x6) - Naive code 100 4 2.3788 ms - 5.941 us 5.705 us 6.301 us - 1.462 us 1.09 us 2.053 us - -(207x6)x(6x6) - ViSP 100 9 2.1888 ms - 2.209 us 2.158 us 2.343 us - 381 ns 117 ns 744 ns - -(600x6)x(6x6) - Naive code 100 2 3.3366 ms - 14.785 us 14.589 us 15.278 us - 1.464 us 516 ns 2.755 us - -(600x6)x(6x6) - ViSP 100 4 2.6204 ms - 6.292 us 6.222 us 6.489 us - 552 ns 179 ns 1.162 us - -(1201x6)x(6x6) - Naive code 100 1 3.1746 ms - 28.902 us 28.787 us 29.142 us - 815 ns 485 ns 1.563 us - -(1201x6)x(6x6) - ViSP 100 2 2.491 ms - 12.312 us 11.953 us 13.049 us - 2.508 us 1.43 us 4.146 us - +(6x6)x(6x6) - Naive code 100 70 2.065 ms + 262 ns 257 ns 275 ns + 35 ns 6 ns 64 ns + +(6x6)x(6x6) - ViSP 100 106 2.0458 ms + 172 ns 169 ns 179 ns + 16 ns 0 ns 37 ns + +(20x6)x(6x6) - Naive code 100 29 2.0851 ms + 729 ns 696 ns 774 ns + 196 ns 151 ns 248 ns + +(20x6)x(6x6) - ViSP 100 60 2.058 ms + 328 ns 313 ns 358 ns + 103 ns 61 ns 160 ns + +(207x6)x(6x6) - Naive code 100 4 2.3788 ms + 5.941 us 5.705 us 6.301 us + 1.462 us 1.09 us 2.053 us + +(207x6)x(6x6) - ViSP 100 9 2.1888 ms + 2.209 us 2.158 us 2.343 us + 381 ns 117 ns 744 ns + +(600x6)x(6x6) - Naive code 100 2 3.3366 ms + 14.785 us 14.589 us 15.278 us + 1.464 us 516 ns 2.755 us + +(600x6)x(6x6) - ViSP 100 4 2.6204 ms + 6.292 us 6.222 us 6.489 us + 552 ns 179 ns 1.162 us + +(1201x6)x(6x6) - Naive code 100 1 3.1746 ms + 28.902 us 28.787 us 29.142 us + 815 ns 485 ns 1.563 us + +(1201x6)x(6x6) - ViSP 100 2 2.491 ms + 12.312 us 11.953 us 13.049 us + 2.508 us 1.43 us 4.146 us + ------------------------------------------------------------------------------- Benchmark matrix-force twist multiplication ------------------------------------------------------------------------------- -/home/fspindle/visp_ws/visp-fspindle/modules/core/test/math/perfMatrixMultiplication.cpp:775 +/home/fspindle/visp-ws/visp-fspindle/modules/core/test/math/perfMatrixMultiplication.cpp:775 ............................................................................... benchmark name samples iterations estimated mean low mean high mean std dev low std dev high std dev ------------------------------------------------------------------------------- -(6x6)x(6x6) - Naive code 100 74 2.0646 ms - 253 ns 253 ns 256 ns - 6 ns 1 ns 15 ns - -(6x6)x(6x6) - ViSP 100 114 2.0406 ms - 166 ns 166 ns 168 ns - 4 ns 0 ns 11 ns - -(20x6)x(6x6) - Naive code 100 32 2.0608 ms - 624 ns 621 ns 631 ns - 20 ns 5 ns 36 ns - -(20x6)x(6x6) - ViSP 100 66 2.0592 ms - 292 ns 290 ns 298 ns - 13 ns 2 ns 31 ns - -(207x6)x(6x6) - Naive code 100 4 2.3 ms - 5.46 us 5.28 us 5.871 us - 1.32 us 729 ns 2.362 us - -(207x6)x(6x6) - ViSP 100 10 2.263 ms - 2.145 us 2.14 us 2.164 us - 40 ns 2 ns 95 ns - -(600x6)x(6x6) - Naive code 100 2 3.23 ms - 14.517 us 14.484 us 14.633 us - 266 ns 24 ns 602 ns - -(600x6)x(6x6) - ViSP 100 4 2.5576 ms - 5.914 us 5.881 us 6.063 us - 299 ns 7 ns 706 ns - -(1201x6)x(6x6) - Naive code 100 1 3.1943 ms - 30.849 us 29.807 us 32.58 us - 6.719 us 4.79 us 9.907 us - -(1201x6)x(6x6) - ViSP 100 2 2.477 ms - 11.978 us 11.768 us 12.505 us - 1.594 us 629 ns 2.894 us - +(6x6)x(6x6) - Naive code 100 74 2.0646 ms + 253 ns 253 ns 256 ns + 6 ns 1 ns 15 ns + +(6x6)x(6x6) - ViSP 100 114 2.0406 ms + 166 ns 166 ns 168 ns + 4 ns 0 ns 11 ns + +(20x6)x(6x6) - Naive code 100 32 2.0608 ms + 624 ns 621 ns 631 ns + 20 ns 5 ns 36 ns + +(20x6)x(6x6) - ViSP 100 66 2.0592 ms + 292 ns 290 ns 298 ns + 13 ns 2 ns 31 ns + +(207x6)x(6x6) - Naive code 100 4 2.3 ms + 5.46 us 5.28 us 5.871 us + 1.32 us 729 ns 2.362 us + +(207x6)x(6x6) - ViSP 100 10 2.263 ms + 2.145 us 2.14 us 2.164 us + 40 ns 2 ns 95 ns + +(600x6)x(6x6) - Naive code 100 2 3.23 ms + 14.517 us 14.484 us 14.633 us + 266 ns 24 ns 602 ns + +(600x6)x(6x6) - ViSP 100 4 2.5576 ms + 5.914 us 5.881 us 6.063 us + 299 ns 7 ns 706 ns + +(1201x6)x(6x6) - Naive code 100 1 3.1943 ms + 30.849 us 29.807 us 32.58 us + 6.719 us 4.79 us 9.907 us + +(1201x6)x(6x6) - ViSP 100 2 2.477 ms + 11.978 us 11.768 us 12.505 us + 1.594 us 629 ns 2.894 us + =============================================================================== All tests passed (60 assertions in 8 test cases) - diff --git a/doc/tutorial/misc/tutorial-json.dox b/doc/tutorial/misc/tutorial-json.dox new file mode 100644 index 0000000000..f909d78856 --- /dev/null +++ b/doc/tutorial/misc/tutorial-json.dox @@ -0,0 +1,260 @@ +/** + \page tutorial-json Tutorial: Using JSON serialization to save your data and read program arguments + \tableofcontents + +\section tuto-json-intro Introduction + +Since ViSP 3.6.0, a 3rd party library was introduced to allow the seamless use of JSON (JavaScript Object Notation) in ViSP. +The library that is used is JSON for modern C++. +To install it on your system, look at \ref soft_tool_json installation instructions for your system. + +The main use case for using JSON in your programs is to save your experimental results. The main advantage of using JSON is +that it is widely supported by default in other languages. + +Thanks to this 3rd party, JSON serialization was introduced for vpCameraParameters, vpArray2D, vpColVector, vpPoseVector, +vpHomogeneousMatrix, vpMe and vpMbGenericTracker. + +In this tutorial, we will use JSON to: + - Read program arguments from a configuration file. This makes it easier to run your program many times and makes storing + different configurations easier + - Save the data generated by running a visual servoing loop + - Generate plots in Python + +\subsection tuto-json-overview JSON overview + +First of all, it is necessary to understand the structure of JSON documents to better use them. +For a detailed description, you may be interested in the Mozilla Developer Network documentation. + +Much of this section is a repeat of the library's documentation, available here. + +To use JSON in your code you should first include the relevant header: +\code{.cpp} +#include +using json = nlohmann::json; // For convenience +\endcode + +This introduces a new type named `json` which supports many types out of the box: +\code{.cpp} +json j = { + {"bool", false}, + {"double", 3.14156}, + {"string", "Hello World!"}, + {"aVector", {1.0, 2.0, 3.0}} +}; +std::cout << j.dump(4) << std::endl; +\endcode +This snippet will print +\verbatim +{ + "aVector": [1.0, 2.0, 3.0], + "bool": false, + "double": 3.14156, + "string": "Hello World!" +} +\endverbatim + +\subsection tuto-json-custom-conversion Defining a JSON conversion for your types + +The library also allows to define explicit conversion between a custom type and JSON. This can be achieved by defining the two following functions: +\code +void from_json(const json& j, YourType& t); +void to_json(json& j, const YourType& t); +\endcode +These functions must be defined in the same scope namespace as YourType and must be accessible everywhere YourType is used. It is thus common to define it in the header where YourType is defined. +\code +#include + +class YourType { +public: + YourType(double x): x(x) {} + +private: + double x; + friend from_json(const json& j, YourType& t); // Declare friends if you wish to access private members + friend void to_json(json& j, const YourType& t); +}; + +inline void from_json(const json& j, YourType& t) +{ + t.x = j.at("x"); +} + +inline void to_json(json& j, const YourType& t) +{ + j["x"] = t.x; +} +\endcode + +Once this conversion is defined you can convert to and from json with: +\code{.cpp} +YourType t(5.0); +json j = t; // j == {"x": 5.0}, calls to_json +YourType t2 = j; // t2.x == 5.0, calls from_json +j = {YourType(1.0), YourType(2.0)}; // j == [{"x": 1.0}, {"x": 2.0}] + // JSON conversion for std vector is already known and call + // to_json for each of the elements of the vector +\endcode + +To better understand the requirements and caveats when writing custom conversions, we encourage +you to read the documentation on arbitrary type conversion. + +\section tuto-json-ibvs Example: Using JSON for a visual servoing experiment + +This example will demonstrate some basic usage of JSON to save the data generated by running an IBVS and exporting it to python to plot some figures. +This example is a modification tutorial-ibvs-4pts.cpp and the full code is available at tutorial-ibvs-4pts-json.cpp. + +This program can be run with: +\verbatim +$ cd $VISP_WS/visp-build/tutorial/visual-servo/ibvs +$ ./tutorial-ibvs-4pts-json --settings ibvs_settings.json --output results.json +\endverbatim + +\subsection tuto-json-ibvs-arguments Using JSON for program arguments + +We first start by defining the program arguments: + +\snippet tutorial-ibvs-4pts-json.cpp Arguments + +This struct contains the control law gain, the desired and starting pose, as well as the visual error threshold and robot sampling time. +Finally it contains a value of type `vpInteractionMatrixTypeSubset` which is defined as +\snippet tutorial-ibvs-4pts-json.cpp Enum + +This value will be converted to a vpServo::vpServoIteractionMatrixType when defining the control law, +by calling `Arguments::getInteractionMatrixType()`. + +Now that our arguments are defined we must now know to parse JSON to get them. We start by defining how to +serialize our enumeration `vpInteractionMatrixTypeSubset`: +\snippet tutorial-ibvs-4pts-json.cpp Enum conversion +Note that if the value is not in `CURRENT`, `DESIRED` or `MEAN`, then the parsing result will default to the value `vpInteractionMatrixTypeSubset::UNKNOWN`. + +Next we define how to parse the full list of arguments: +\snippet tutorial-ibvs-4pts-json.cpp Arguments conversion +Where the method `from_json()` is used to parse JSON and, inversely, `to_json()` is used to convert the arguments to JSON, which we will use afterwards. + +The syntax +\code +x = j.value("key", x); +\endcode +is used to fill in optional values from the JSON document. If the key is not found then `x` will be left unchanged +This syntax can also be used to set a default value, e.g.: +\code +a.lambda = j.value("lambda", 0.5); +\endcode + +In the `from_json()` method, we ensure that all the arguments are correctly set: + - Lambda should be > 0 + - Sampling time should be > 0 + - Error threshold should be > 0 + - The type of interaction matrix should be correct + +With this conversion defined, we can read the program settings from a file (`ibvs_settings.json`), containing +\include ibvs_settings.json + +Note that while the `Arguments` class represents the desired and starting poses as vpHomogeneousMatrix elements, they are defined in the JSON as vpPoseVector representations. ViSP will automatically convert one representation to the other when parsing JSON. + +To read from the `ibvs_settings.json` file, we will define the following method: + +\snippet tutorial-ibvs-4pts-json.cpp JSON input conversion + +Which we will call in the `main()`, to finally obtain our program arguments: +\snippet tutorial-ibvs-4pts-json.cpp Main parsing + +We can now start servoing and acquiring data, that will be saved to another JSON file. + +\subsection tuto-json-ibvs-saving Collecting and saving visual servoing data + +To save the data to a JSON file, we first define what we'll save +\snippet tutorial-ibvs-4pts-json.cpp Result structure + +This includes: + - The arguments used to launch the program + - The desired visual features + - For each iteration + - The visual features + - The camera pose + - The squared norm of the visual error + - The velocity + - The interaction matrix + +Before starting the servoing loop we create a `results` object: +\snippet tutorial-ibvs-4pts-json.cpp Results creation +We then start the visual servoing loop: +\snippet tutorial-ibvs-4pts-json.cpp VS loop +where at each iteration, we update our `results` object with +\snippet tutorial-ibvs-4pts-json.cpp Results update + +Finally, to save the results to a file, we define a function to write to a file +\snippet tutorial-ibvs-4pts-json.cpp write json to file +and call it at the end of the program +\snippet tutorial-ibvs-4pts-json.cpp Save call + +Our data is now saved in a JSON file, and we can reuse it in other programs, as we demonstrate further below. + +\subsection tuto-json-ibvs-python Reusing the data in Python to generate plots + +We will now reparse the JSON file saved in \ref tuto-json-ibvs-saving section to generate high quality plots +in Python with Matplotlib. The script, `plot-ibvs-control-law.py` can be found in the script folder of the ViSP +git repository. It has been tested with Python 3.7.9, matplotlib 3.3.2 and numpy 1.17.3. + +If not already done, to use the script install the following: + +- Install the latest [Python3](https://www.python.org/downloads/) release +- Check if `pip3` and `python3` are correctly installed +\verbatim +$ python3 --version +$ pip3 --version +\endverbatim +- Upgrade your pip to avoid errors during installation. +\verbatim +$ pip3 install --upgrade pip +\endverbatim +- Enter the following command to install Numpy using `pip3` +\verbatim +$ pip3 install numpy +\endverbatim +- Enter the following command to install Matplotlib using `pip3` +\verbatim +$ pip3 install matplotlib +\endverbatim + +The script gives `plot-ibvs-control-law.py` a reference on how to plot with JSON data coming from ViSP. You may wish to modify +and extend it to fit your use case or control law. + +To run the script, replace the json path that contains the data to plot and where you wish to save the +plots in the following command: +\verbatim +$ cd VISP_WS/visp/script +$ python3 plot-ibvs-control-law.py --data $VISP_WS/visp-build/tutorial/visual-servo/ibvs/results.json \ + --plot_folder ./plots +\endverbatim + +The script should produce similar output: +\verbatim +Generating error norm plot... +Generating velocity plot... +Generating 2D and 3D trajectory plots... +Generating features plot... +Plots were saved to $VISP_WS/visp/script/plots +\endverbatim + +You can then view the generated plots in the folder where you saved them (in our case in `./plots/` +corresponding to `$VISP_WS/visp/script/plots` folder). +\verbatim +$ ls $VISP_WS/visp/script/plots +cMo.pdf error.pdf velocity.pdf +cMo_3d.pdf trajectories_2d.pdf +\endverbatim + +You should obtain plots similar to those below, but with a higher quality (generated in pdf): + +\image html image/tutorial/visual-servo/ibvs-python-plots/cMo.jpg +\image html image/tutorial/visual-servo/ibvs-python-plots/cMo_3d.jpg +\image html image/tutorial/visual-servo/ibvs-python-plots/velocity.jpg +\image html image/tutorial/visual-servo/ibvs-python-plots/error.jpg +\image html image/tutorial/visual-servo/ibvs-python-plots/trajectories_2d.jpg + +\section tuto-json-next Next tutorial + +You are now ready to see how to continue with \ref tutorial-mb-generic-json. + +*/ diff --git a/doc/tutorial/misc/tutorial-pcl-viewer.dox b/doc/tutorial/misc/tutorial-pcl-viewer.dox new file mode 100644 index 0000000000..d378f77d40 --- /dev/null +++ b/doc/tutorial/misc/tutorial-pcl-viewer.dox @@ -0,0 +1,182 @@ +/** + +\page tutorial-pcl-viewer Tutorial: Threaded PCL viewer +\tableofcontents + +\section pcl_viewer_intro Introduction + +This tutorial shows how to use the `vpPclViewer` class. + +In the next section you will find an example that shows how to display two point clouds, with one having attached +confidence weights, either in blocking-mode or threaded-mode display. + +The program first generate a polynomial surface, whose coordinates are expressed in the object frame. +Then, a second surface is generated. It corresponds to the first surface, moved in another coordinates frame. +Some noise is added to this second surface, to simulate sensor innacuracy. Then, M-estimation based +on Tukey M-estimator is performed using the `vpRobust` class in order not to display the noisy points +in the viewer. Finally, the point clouds are displayed using the `vpPclViewer`. + +\section pcl_viewer_requirements Requirements + +To enable `vpPclViewer` class usage, and thus use this tutorial, you need to have a version of ViSP build with PCL. To see how to install PCL library, +please refer to the \ref soft_tool_pcl section. + +\section pcl_viewer_howtorun How to run the tutorial + +To see the different options of the tutorial, please run the following commands: +``` +cd $VISP_WS/visp-build/tutorial/gui/pcl-visualizer/ +$ ./tutorial-pcl-visualizer -h +``` + +To run the tutorial in a blocking mode, i.e. the display pauses the program, +please run the following command: +``` +$ ./tutorial-pcl-visualizer --display-mode blocking +``` + +You should see a new windows that shows something similar to. It shows +our two point clouds. + +\image html img-tutorial-pcl-viewer.png + +To stop the program, please click in the viewer window and press the `q` key. + +It is also possible to run the viewer in a separate thread. To do so, please run +the following command: +``` +$ ./tutorial-pcl-visualizer --display-mode threaded +``` +Here again to stop the program, please click in the console and press the `q` key. + +\section pcl_viewer_example Point clouds visualization example explained + +For this tutorial, we use the main program tutorial-pcl-viewer.cpp. + +It uses the following class, which generates 3D coordinates and relies on the `vpPclViewer` to visualize data. + +\include ClassUsingPclViewer.h + +\subsection pcl_viewer_main Main code explained + +Let us first have a look at the main program. + +First, we include the class that uses the vpPclViewer object to display different point clouds: + +\snippet tutorial-pcl-viewer.cpp Class include + +Then, we define a C++ enum in order to permit to the user to chose between the blocking-mode display, the threaded-mode +display or running both of them consecutively. + +\snippet tutorial-pcl-viewer.cpp Enum for mode choice + +Then, we define the default value of the program arguments. + +\snippet tutorial-pcl-viewer.cpp Default arguments values + +The following program arguments are available: + +\snippet tutorial-pcl-viewer.cpp Arguments of the program + +Let us look with more details into these arguments: + +- `noise` represents the intensity of noise along the Z-axis, expressed in the object frame, has to be added to the original surface. +- `order` represents the order of the polynomial surface the user wants to use running the demo. +- `x-lim` and `y-lim` represents reciproquely the X-axis and Y-axis minimum and maximum values of the polynomial surface, expressed in the object frame. +- `reso` represents the number of points along the X-axis and Y-axis, expressed in the object frame, are used to generate the first surface. +- `display-mode` represents which mode of display the user wants to use: blocking-mode only, threaded-mode only or both modes successively. + +Then, we parse the program arguments that permit to the user to change part of the behavior +of the program. + +\snippet tutorial-pcl-viewer.cpp Arguments parser + +Then, the blocking-mode example is run if the user chose to run it or both modes. + +\snippet tutorial-pcl-viewer.cpp Running blocking mode + +Finally, the threaded-mode example is run if the user chose to run it or both modes. + +\snippet tutorial-pcl-viewer.cpp Running threaded mode + +\subsection pcl_viewer_class Code of the example class explained + +\subsubsection pcl_viewer_class_generation Generation of the polynomial surfaces used in this example + +For this example, we decided to modelize a polynomial 3D surface. The Z coordinate +is computed from the X and Y coordinates thanks to the following method. + +\snippet ClassUsingPclViewer.cpp Z coordinates computation + +The constructor initializes the minimum and maximum X and Y coordinates of the polynomial +surface, along with the number of points in each direction it contains. It also constructs +the vpPclViewer object, naming the window that will open. + +\snippet ClassUsingPclViewer.cpp Constructor + +The following method generate two polynomial surface. If the user asked to, noise will be added +to the displaced surface. The confidence weights are estimated thanks to Tukey M-estimator +from the difference between the noise-free position of the point and the actual one. In an actual +situation, it could for instance correspond to the distance between a model of an object surface and the observed +points thanks to a depth sensor. + +\snippet ClassUsingPclViewer.cpp Surface generator + +\subsubsection pcl_viewer_class_usage How to use the vpPclViewer class to display the point clouds + +To use the vpPclViewer class, you must first add the surfaces you want to display. +You can do it by adding a surface for which you do not particularly care of the color and thus +decide to use a generated one : + +\snippet ClassUsingPclViewer.cpp Adding point clouds color not chosen + +You could also choose the color to use in order to have an uniformly colored surface: + +\snippet ClassUsingPclViewer.cpp Adding point clouds color chosen + +In this second example, confidence weights are also attached to each points to the surface. +It permits to display only the points for which the weight is greater than the ignorance threshold. + +Finally, you can display in a blocking fashion the different surfaces added to the viewer: + +\snippet ClassUsingPclViewer.cpp Displaying point clouds blocking mode + +Alternatively, you can start a non-blocking display thread in order to continuously update +the surfaces. + +\snippet ClassUsingPclViewer.cpp Starting display thread + +To update the surfaces over time, please use the following lines of codes: + +\snippet ClassUsingPclViewer.cpp Updating point clouds used by display thread + +\section pcl_viewer_known_issues Known issues + +\subsection pcl_viewer_issues_MacOs Known issue on MacOS + +On MacOS, you can face the following error: +\code +tutorial-pcl-viewer *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'NSWindow drag regions should only be invalidated on the Main Thread!' +libc++abi: terminating due to uncaught exception of type NSException +\endcode +This problem seems to be due to VTK library that does not like to be run in a non-main thread on MacOS. +You can use the vpPclViewer class in blocking mode using the method vpPclViewer::display. See the +[PCL issue](https://github.com/PointCloudLibrary/pcl/issues/253#issuecomment-29716100) for more details. + +\subsection pcl_viewer_issues_ubuntu Known issue on Ubuntu 22.04 + +On Ubuntu 22.04, you can face the following error: +\code +Thread 2 "tutorial-pcl-vi" received signal SIGSEGV, Segmentation fault. +0x00007ffff7304b10 in _XEventsQueued () from /lib/x86_64-linux-gnu/libX11.so.6 +0x00007ffff7304b10 in _XEventsQueued () at /lib/x86_64-linux-gnu/libX11.so.6 +0x00007ffff72f11a1 in XPending () at /lib/x86_64-linux-gnu/libX11.so.6 +0x00007fffecf65b8f in vtkXRenderWindowInteractor::StartEventLoop() () at /lib/x86_64-linux-gnu/libvtkRenderingUI-9.1.so.1 +0x00007ffff6ee3f8c in pcl::visualization::PCLVisualizer::spinOnce(int, bool) () at /lib/x86_64-linux-gnu/libpcl_visualization.so.1.12 +0x00007ffff7fa5c49 in vpPclVisualizer::loopThread() (this=0x7fffffffd720) at /usr/include/c++/11/bits/shared_ptr_base.h:1295 +\endcode +This is a [known compatibility issue](https://github.com/PointCloudLibrary/pcl/issues/5237) between PCL library and VTK library. + +The vpPclViewer can be used in blocking mode, or you may try to install PCL from source and then recompile +ViSP. +*/ diff --git a/doc/tutorial/misc/tutorial-synthetic-blenderproc.dox b/doc/tutorial/misc/tutorial-synthetic-blenderproc.dox new file mode 100644 index 0000000000..46e7b2ca49 --- /dev/null +++ b/doc/tutorial/misc/tutorial-synthetic-blenderproc.dox @@ -0,0 +1,783 @@ +/** + +\page tutorial-synthetic-blenderproc Tutorial: Generating synthetic data for deep learning with Blenderproc +\tableofcontents + +\section dnn_synthetic_intro Introduction + +In this tutorial, we will show how to generate synthetic data that can be used to train a neural network, thanks to blenderproc. + +Most of the (manual) work when training a neural network resides in acquiring and labelling data. This process can be slow, tedious and error prone. +A solution to avoid this step is to use synthetic data, generated by a simulator/computer program. This approach comes with multiple advantages: +- Data acquisition is fast +- It is easy to acquire accurate ground truth labels +- Variations in the training data can be easily added + +There are however, some drawbacks: +- More knowledge of the scene is required: in the case of detection, we require a 3D model of the object, which is not the case for true images +- A difference between simulated and real data can be apparent and negatively impact network performance (this is called the Sim2Real gap) + +The latter point is heavily dependent on the quality of the generated images and the more realistic the images, the better the expected results. + +Blender, using ray tracing, can generate realistic images. To perform data generation, Blenderproc has been developed and is an extremely useful and flexible tool to generate realistic scenes from Python code. + +Along with RGB images, Blenderproc can generate different labels or inputs: +- Depth map +- Normals +- Semantic segmentation +- Instance segmentation +- Bounding box +- Optical flow (not provided in our generation script) + +In this tutorial, we will install blenderproc and use it to generate simple but varied scenes containing objects of interest. +We provide a simple, object-centric generation script that should suffice in many cases. +However, since Blenderproc is easy to use, with many examples included in the documentation, readapting this script to your needs should be easy. + +\section dnn_synthetic_install Requirements + +First, you should start by installing blenderproc. First, start by creating a new conda environment to avoid potential conflicts with other Python packages. +\code{.sh} +$ conda create --name blenderproc python=3.10 pip +$ conda activate blenderproc +$ pip install blenderproc +\endcode +\note Our generation script has been tested with blenderproc 2.5.0 (with Blender 3.3 under the hood) and python 3.10. + +You can then run the Blenderproc sample example with: +\code{.sh} +(blenderproc) $ blenderproc quickstart +\endcode +This may take some time, as Blenderproc downloads its own version of Blender and sets up its own environment. This setup will only be performed once. + +Once Blenderproc is done, you can check its output with: +\code{.sh} +(blenderproc) $ blenderproc vis hdf5 output/0.hdf5 +\endcode + + +Blenderproc stores its output in HDF5 file format. Each HDF5 **may** contain the RGB image, along with depth, normals, and other modalities. + +For the simulator to provide useful data, we should obtain a set of realistic textures (thus helping close the Sim2Real gap). +Thankfully, Blenderproc provides a helpful script to download a dataset of materials from cc0textures.com, containing more than 1500 high resolution materials. +To download the materials, run +\code{.sh} +(blenderproc) $ blenderproc download cc_textures path/to/folder/where/to/save/materials +\endcode +\warning Because the materials are in high definition, downloading the full dataset may take a large amount of disk space (30+ GB). If this is too much for you, you can safely delete some of the materials or stop the script after it has acquired enough materials. While using a small number of materials can be useful when performing quick tests, using the full set should be preferred as variety helps when transferring your deep learning model to real world data. + + +\section dnn_synthetic_script Running the object-centric generation script + +We will now run the generation script. +The script places a random set of objects in a simple cubic room, with added distractors. Materials of the walls and distractors are randomized. + +This script and an example configuration file can be found in the `script/dataset_generator` folder of your ViSP source directory. + + +The basic algorithm is: +\verbatim +For each scene: + Choose N target objects from the provided models + Add noise to the N objects (material properties, size, geometry) + Generate a scene: + - compute s = length of the larget diagonal of the axis-aligned bounding box of the largest object + - set room_size = s * random_scale_factor + - Create the ground, walls and ceiling of the room (with size room_size) and select a random material for each of them + - Add random distractors, sampled from spheres, cubes, cylinders and monkey heads (Suzanne) + For each distractor: + - Sample a random position and orientation in the room + - Select a random material from cc0 + - Add noise to PBR + - Potentially add displacement + - Potentially set distractor as emissive (emitting light) + - Add random lights, either point lights or spots + For each light: + - Sample a random intensity and position + - Sample a random color + - If the light is a spot, orient it so that it focuses on a target object + If simulating physics: + - Simulate physics for a fixed time and set final object poses + Remove objects that left the room (Physics collisions) + Sample camera poses: + For each sample to generate: + Do while camera pose is not correct: + - Select a target object + - Select a point of interest in the bounding box of the object + - Sample a random camera location in a clamped ball around the object + - Camera position is set to have a minimum/maximum distance to the point of interest that is dependent on the object size + - Set camera orientation to look at the point of interest, with a random rotation around the optical axis + - Camera pose is correct if target object is visible and camera does not clip through an object or a wall + - Call blender rendering + - Save data in HDF5 format + - If required, compute occlusion-aware bounding boxes + - If required, save object pose in camera frame +\endverbatim +Many randomization parameters can be modified to alter the rendering, as explained in \ref dnn_input_configuration. + + + +With this simple approach, we can obtain images such as: +\image html misc/blenderproc_rgb_example.png + + +\subsection dnn_input_objects 3D model format +To use this data generation tool, you should first provide the 3D models. +You can provide multiple models, which will be sampled randomly during generation. + +The models should be contained in a folder as such: +\verbatim +- models + - objectA + - model.obj + - model.mtl + - texture.png + - objectB + - another_model.obj + - another_model.mtl +\endverbatim + +When setting up the configuration file in \ref dnn_input_configuration, "models_path" should point to the root folder, models. +Each subfolder should contain a single object, in `.obj` format (with potential materials and textures). Each object will be considered as having its own class, the class name being the name of the subfolder (e.g., objectA or objectB). +The class indices start with 1, and are sorted alphabetically depending on the name of the class (e.g., objectA = 1, objectB = 2). + +\subsection dnn_input_configuration Generation configuration +Configuring the dataset generation is done through a JSON file. An example configuration file can be seen below: +\include example_config.json + +The general parameters are: + + + + + + + + + + + + + + + + + + + + + + +
NameType, possible valuesDescription
numpy_seedIntSeed for numpy's random functions. Allows for reproducible results.
blenderproc_seedStringSeed for Blenderproc. Allows for reproducible results.
models_pathStringPath to the folder containing the models. See \ref dnn_input_objects
cc_textures_pathStringPath to the folder containing the CC0 materials.
+ +You can also control some of the rendering parameters. This will impact the rendering time and the quality of the generated RGB images. +These parameters are located in the "rendering" field. + + + + + + + + + + + + +
NameType, possible valuesDescription
max_num_samplesInt > 0Number of rays per pixels. A lower number results in noisier images (especially in scenes with large variations).
denoiserOne of [null, "INTEL", "OPTIX"]Which denoiser to use after performing ray tracing. null indicates that no denoiser is used. "OPTIX" requires a compatible Nvidia GPU. + Using a denoiser allows to obtain a clean image, with a low number of rays per pixels.
+ +You can also modify the camera's intrinsic parameters. The camera uses an undistorted perspective projection model. For more information on camera parameters, see vpCameraParameters. +These parameters are found in the "camera" field of the configuration. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameType, possible valuesDescription
pxFloatSee vpCameraParameters
pyFloatSee vpCameraParameters
v0FloatSee vpCameraParameters
u0FloatSee vpCameraParameters
hIntHeight of the generated images.
wIntWidth of the generated images.
randomize_params_percentFloat, [0, 100) + Controls the randomization of the camera parameters \f$p_x, p_y, u_0, v_0\f$. If randomize_params_percent > 0, then, each time a scene is created the intrinsics are perturbed around the given values. + For example, if this parameters is equal to 0.10 and \f$p_x = 500\f$, then the used \f$p_x\f$ when generating images will be in the range [450, 550]. +
+ + +To customize the scene, you can change the parameters in the "scene" field: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameType, possible valuesDescription
room_size_multiplier_minFloat > 1.0, < room_size_multiplier_max + Minimum room size as a factor of the biggest sampled target object. The room is cubic. + The size of the biggest object is the length of the largest diagonal of its axis-aligned bounding box. This tends to overestimate the size of the object. + If the size of the biggest object is 0.5m, room_size_multiplier_max = 2 and room_size_multiplier_max = 4, then the room's size will be randomly sampled to be between 1m and 2m. +
room_size_multiplier_maxFloat > room_size_multiplier_min + Minimum room size as a factor of the biggest sampled target object. The room is cubic. + The size of the biggest object is the length of the largest diagonal of its axis-aligned bounding box. This tends to overestimate the size of the object. + If the size of the biggest object is 0.5m, room_size_multiplier_max = 2 and room_size_multiplier_max = 4, then the room's size will be randomly sampled to be between 1m and 2m. +
simulate_physicsBooleanWhether to simulate physics. If false, then objects will be floating across the room. If true, then objects will fall to the ground.
max_num_texturesInt > 0Max number of textures per blenderproc run. If scenes_per_run is 1, max_num_textures = 50 and the number of distractors is more than 50, then the 50 textures will be used across all distractors (and walls). In this case, new materials will be sampled for each scene.
distractorsDictionarySee below
lightsDictionarySee below
objectsDictionarySee below
+ +Distractors are small, simple objects that are added along with the target objects to create some variations and occlusions. You can also load custom objects as distractors. +To modify their properties, you can change the "distractors" field of the scene + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameType, possible valuesDescription
min_countInt >= 0, < max_count + Minimum number of distractors to place in the room. +
max_countInt > min_count + Maximum number of distractors to place in the room. +
custom_distractorsstring, or null + If not null, path to a folder containing custom distractor objects, in .obj or .ply format. +
custom_distractor_probafloat, >= 0.0, <= 1.0 + If custom_distractors is not null, probability that a distractor is sampled from the user specified distractors. +
min_size_rel_sceneFloat > 0.0 + Minimum size of the distractors, relative to the room size. + If the room size is 0.5m and min_size_rel_scene = 0.1, then the minimum size of distractor will be 0.05m. + Scale is applied independently on each axis. +
max_size_rel_sceneFloat < 1.0, > min_size_rel_scene + maximum size of the distractors, relative to the room size. + If the room size is 0.5m and max_size_rel_scene = 0.2, then the maximum size of distractor will be 0.1m. + Scale is applied independently on each axis. +
displacement_max_amountFloat >= 0.0 + Amount of displacement to apply to distractors. + Displacement subdivides the mesh and displaces each of the distractor's vertices according to a random noise pattern. + This option greatly slows down rendering: set it to 0 if needed. +
pbr_noiseFloat >= 0.0 + Amount of noise to add to the material properties of the distractors. + These properties include the specularity, the "metallicness" and the roughness of the material, according to Blender's principled BSDF. +
emissive_probFloat >= 0.0 , <= 1.0 + Probability that a distractor becomes a light source: its surface emits light. Set to more than 0 to add more light variations and shadows. +
emissive_min_strengthFloat >= 0.0, < emissive_max_strength + Minimum emission strength for a distractor that emits lights. In Watts/m². +
emissive_max_strengthFloat > emissive_min_strength + Maxmimum emission strength for a distractor that emits lights. In Watts/m². +
+ +To change the lighting behaviour, see the options below: + + + + + + + + + + + + + + + + + + + + + + +
NameType, possible valuesDescription
min_countInt >= 0, < max_count + Minimum number of lights in the scene. +
max_countInt > min_count + Maximum number of lights in the scene +
min_intensityFloat > 0.0, < max_intensity + Minimum intensity of a light. In Watts. +
max_intensityFloat > min_intensity + Maximum intensity of a light. In Watts. +
+ +To change the sampling behaviour of target objects, see the properties below: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameType, possible valuesDescription
min_countInt >= 0, < max_count + Minimum number of target objects in the scene. +
max_countInt > min_count + Maximum number of target objects in the scene. +
multiple_occurencesBoolean + Whether a single object can appear multiple times in the same scene (sampling with replacement). +
scale_noiseFloat >= 0.0 + Object size noise. if scale_noise > 0.0, the object is scaled uniformly on all axes (it does not appear stretched) +
displacement_max_amountFloat >= 0.0 + Amount of displacement to apply to target objects. + Displacement subdivides the mesh and displaces each of the distractor's vertices according to a random noise pattern. + This option greatly slows down rendering: set it to 0 if needed. + Note that this is in absolute units: and does not vary depending on the size of the object. +
pbr_noiseFloat >= 0.0 + Amount of noise to add to the material properties of the target objects. + These properties include the specularity, the "metallicness" and the roughness of the material, according to Blender's principled BSDF. +
cam_min_dist_relFloat >= 0.0, < cam_max_dist_rel + Minimum distance of the camera to the point of interest of the object when sampling camera poses. This is expressed in terms of the size of the target object. + If the target object has a size of 0.5m and cam_min_dist_rel = 1.5, then the closest possible camera will be at 0.75m away from the point of interest. +
cam_max_dist_relFloat >= cam_min_dist_rel + Maximum distance of the camera to the point of interest of the object when sampling camera poses. This is expressed in terms of the size of the target object. + If the target object has a size of 0.5m and cam_max_dist_rel = 2.0, then the farthest possible camera will be 1m away from the point of interest. +
+ +Finally, we can customize the dataset that we will generate from the given scenes. +This includes the number of scenes, images, and what information to save. + +All the data will be stored in HDF5 format, which can then be unpacked later. + +To customize the dataset, modify the options in the "dataset" field: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameType, possible valuesDescription
save_pathStringPath to the folder that will contain the final dataset. This folder will contain one folder per scene, and each sample of a scene will be its own HDF5 file.
scenes_per_runInt > 0 + Number of scenes to generate per blenderproc run. Between blenderproc runs, Blender is restarted in order to avoid memory issues. +
num_scenesInt > 0 + Total number of scenes to generate. Generating many scenes will add more diversity to the dataset as object placement, materials and lighting are randomized once per scene. +
images_per_sceneInt > 0 + Number of images to generate per scene. The total number of samples in the dataset will be num_scenes * (images_per_scene + empty_images_per_scene). +
empty_images_per_sceneInt >= 0, <= images_per_scene + Number of images without target objects to generate per scene. The camera poses for these images are sampled from the poses used to generate images with target objects. Thus, the only difference will be that the objects are not present, the rest of the scene is left untouched. +
poseBoolean + Whether to save the pose of target objects that are visible in the camera. The pose of the objects are expressed in the camera frame as an homogeneous matrix \f$^{c}\mathbf{T}_{o}\f$ +
depthBoolean + Whether to save the depth buffer associated to the RGB image. Same size as the RGB image. +
normalsBoolean + Whether to save the normal map associated to the RGB image. Same size as the RGB image. + The normals are 3D unit vectors, expressed in the camera frame. +
segmentationBoolean + Whether to save the segmentation maps (by class and by instance). + Segmentation by class only contains the target objects (class >= 1). + Segmentation by instance includes every visible object. +
detectionBoolean + Whether to save the bounding box detections. In this case, bounding boxes are not computed from the segmentation map (also possible with Blenderproc), but rather in way such that occlusion does not influence the final bounding box. + The detections can be filtered with the parameters in "detection_params". +
detection_params:min_size_size_pxInt >= 0 + Minimum side length of a detection for it to be considered as valid. Used to filter really far or small objects, for which detection would be hard. +
detection_params:min_visibilityFloat [0.0, 1.0] + Percentage of the object that must be visible for a detection to be considered as valid. The visibility score is computed as such: + First, the vertices of the mesh that are behind the camera are filtered. Then, the vertices that are outside of the camera's field of view are filtered. Then, we randomly sample "detection_params:points_sampling_occlusion" points to test whether the object is occluded (test done through ray casting). + If too many points are filtered, then the object is considered as not visible and detection is invalid. +
+ + +\section dnn_run_script Running the script to generate data + +Once you have configured the generation to your liking, navigate to the `script/dataset_generator` located in your ViSP source directory. + +You can then run the `generate_dataset.py` script as such +\code{.sh} +(blenderproc) user@machine:~/visp/script/dataset_generator $ python generate_dataset.py --config path/to/config.json +\endcode + +If all is well setup, then the dataset generation should start and run. + + +\warning If during generation, you encounter a message about invalid camera placement, try to make room_size_multiplier_min and room_size_multiplier_max larger, so that more space is available for object placement. + +To give an idea of generation time, generating 1000 images (with a resolution of 640 x 480) and detections of a single object, with a few added distractors, takes around 30mins on a Quadro RTX 6000. + +Once generation is finished, you are ready to leverage the data to train your neural network. + +\section dnn_output Using and parsing the generation output + +The dataset generated by Blender is located in the "dataset:save_path" path that you specified in your JSON configuration file. + +The dataset has the following structure +\verbatim +- dataset + - 0 + - 0.hdf5 + - 1.hdf5 + - ... + - 1 + - 0.hdf5 + - 1.hdf5 + - ... + - ... + - classes.txt +\endverbatim + +There is one subfolder per scene, and each HDF5 file is a single sample that may contain RGB, depth, normals, etc. + +You can visualise the generated images (RGB, depth, normals, segmentation maps) by running +\code{.sh} +(blenderproc) $ blenderproc vis hdf5 path/to/your/output/0/*.hdf5 +\endcode + +You will then see something that looks like this, depending on the outputs that you chose in the configuration file: +\image html blenderproc_viz.png + +where you can replace the "0" in the path with another number, which corresponds to the generated scene index. +You can also specify the path to a single HDF5 file to view one sample at a time. + +\subsection dnn_output_yolov7 Using detections to finetune a YoloV7 + +To help, we provide a script that reformats a blenderproc dataset to the format expected by YoloV7. +This script can be run like this: +\code{.sh} +(blenderproc) $ python export_for_yolov7.py --input path/to/dataset --output path/to/yolodataset --train-split 0.8 +\endcode + +here "--input" indicates the path to the location of the blenderproc dataset, while "--output" points to the folder where the dataset in the format that YoloV7 expects will be saved. "--train-split" is an argument that indicates how much of the dataset is kept for training. A value of 0.8 indicates that 80% of the dataset is used for training, while 20% is used for validation. The split is performed randomly across all scenes (a scene may be visible in both train and validation sets). + +Once the script has run, the folder "path/to/yolodataset" should be created and contain the dataset as expected by YoloV7. +This folder contains a "dataset.yml" file, which will be used when training a YoloV7. It contains: +the following: + +``` +names: +- esa +nc: 1 +train: /local/sfelton/yolov7_esa_dataset/images/train +val: /local/sfelton/yolov7_esa_dataset/images/val +``` +where nc is the number of class, "names" are the class names, and "train" and "val" are the paths to the dataset splits. + +To start training a YoloV7, you should download the repository and install the required dependencies. Again, we will create a conda environment. You can also use a docker container, as explained in the documentation. We also download the pretrained yolo model, that we will finetune on our own dataset. +``` +~ $ git clone https://github.com/WongKinYiu/yolov7.git +~ $ cd yolov7 +~/yolov7 $ conda create --name yolov7 pip +~/yolov7 $ conda activate yolov7 +(yolov7) ~/yolov7 $ pip install -r requirements.txt +(yolov7) ~/yolov7 $ wget https://github.com/WongKinYiu/yolov7/releases/download/v0.1/yolov7-tiny.pt +``` + +To fine-tune a YoloV7, we should create two new files: the network configuration and the hyperparameters. We will reuse the ones provided for the tiny model. +``` +CFG=cfg/training/yolov7-tiny-custom.yaml +cp cfg/training/yolov7-tiny.yaml $CFG + +HYP=data/hyp.scratch.custom.yaml +cp data/hyp.scratch.tiny.yaml $HYP +``` +Next open the new cfg file, and modify the number of classes (set "nc" from 80 to the number classes you have in your dataset) + +You can also modify the hyperparameters file to add more augmentation during training. + +To fine-tune the YoloV7-tiny on our data, run +``` +YOLO_DATASET=/path/to/dataset +IMG_SIZE=640 +YOLO_NAME=blenderproc-tiny +python train.py --workers 8 --device 0 --batch-size 64 --data "${YOLO_DATASET}/dataset.yaml" --img $IMG_SIZE $IMG_SIZE --cfg $CFG --weights yolov7-tiny.pt --name $YOLO_NAME --hyp $HYP +``` + +Note that if your run fine-tuning multiple times, then a number will be appended to the name that you have given to your model. + +If you run out of memory during training, change the batch size to a lower value. + +Here is an overview of the generated images and the resulting detections for a simple model (cube) and a NeRF-reconstructed one: +\htmlonly +

+ + +

+\endhtmlonly + + + + +\subsection dnn_output_custom_parsing Parsing HDF5 with a custom script + +In Python, an HDF5 file can be read like a dictionary. + +With the following script, you can inspect the content of an HDF5 file: +\code{.py} +from pathlib import Path +import numpy as np +import h5py +import json + +if __name__ == '__main__': + dataset_path = Path('output') + for scene_folder in dataset_path.iterdir(): + if not scene_folder.is_dir(): + continue + print(f'Reading scene {scene_folder.name}') + for sample in scene_folder.iterdir(): + if not sample.name.endswith('.hdf5'): + continue + print(f'\tReading sample {sample.name}') + with h5py.File(sample) as f: + # Image data + keys = ['colors', 'depth', 'normals', 'class_segmaps', 'instance_segmaps'] + for key in keys: + if key in f: + data = np.array(f[key]) + print(f'\t\t{key}: shape = {data.shape}, type = {data.dtype}') + # Json objects + if 'instance_attribute_maps' in f: + print('\t\tMapping between instance and class:') + text = np.array(f['instance_attribute_maps']).tobytes() + json_rep = json.loads(text) + print(json_rep) + print() + + if 'object_data' in f: + text = np.array(f['object_data']).tobytes() + json_rep = json.loads(text) + + for object_idx, object_data in enumerate(json_rep): + print(f'\t\tObject {object_idx} data: ') + for obj_k in object_data.keys(): + print(f'\t\t\t{obj_k} = {object_data[obj_k]}') + print() +\endcode + +Running on a custom dataset with all outputs enabled (see \ref dnn_input_configuration) we obtain the following output: +\verbatim +... +Reading scene 4 + Reading sample 0.hdf5 + colors: shape = (480, 640, 3), type = uint8 + depth: shape = (480, 640), type = float32 + normals: shape = (480, 640, 3), type = float32 + class_segmaps: shape = (480, 640), type = uint8 + instance_segmaps: shape = (480, 640), type = uint8 + Mapping between instance and class: + [{'idx': 5, 'category_id': 2}, {'idx': 7, 'category_id': 3}, {'idx': 10, 'category_id': 0}, {'idx': 11, 'category_id': 0}, + {'idx': 14, 'category_id': 0}, {'idx': 18, 'category_id': 0}, {'idx': 22, 'category_id': 0}, {'idx': 32, 'category_id': 0}, + {'idx': 37, 'category_id': 0}] + + Object 0 data: + class = 2 + name = cube.001 + cTo = [[-0.9067991971969604, -0.12124679982662201, 0.40374961495399475, 0.06561152129493264], + [-0.399792343378067, 0.5511342883110046, -0.7324047088623047, 0.31461843930247957], + [-0.1337185800075531, -0.8255603313446045, -0.548241913318634, 0.01648345626311576], + [0.0, 0.0, 0.0, 1.0]] + bounding_box = [138.9861569133729, 254.62236838239235, 100.20349472431002, 107.79005297420909] + + Object 1 data: + class = 3 + name = dragon.002 + cTo = [[-0.9067991971969604, -0.12124679982662201, 0.40374961495399475, 0.06561152129493264], + [-0.399792343378067, 0.5511342883110046, -0.7324047088623047, 0.31461843930247957], + [-0.1337185800075531, -0.8255603313446045, -0.548241913318634, 0.01648345626311576], + [0.0, 0.0, 0.0, 1.0]] + bounding_box = [314.54058632091767, 202.86607727119753, 70.64506150004479, 90.54480823214647] +... +\endverbatim + +- Both depth and normals are represented as floating points, conserving accuracy. +- The object data is represented as a JSON document. Which you can directly save or reparse to save only the information of interest. +- Object poses are expressed in the camera frame and are represented as homogeneous matrix. +- Bounding boxes coordinates are in pixels, and the values are [x_min, y_min, width, height] + +You can modify this script to export the dataset to another format, as it was done in \ref dnn_output_yolov7. + +\section dnn_synthetic_next Next steps + +If you use this generator to train a detection network, you can combine it with Megapose to perform 6D pose estimation and tracking. See \ref tutorial-tracking-megapose. + +*/ diff --git a/doc/tutorial/started/tutorial-getting-started.dox b/doc/tutorial/started/tutorial-getting-started.dox index 5256ffca8e..a91ea3f6d0 100644 --- a/doc/tutorial/started/tutorial-getting-started.dox +++ b/doc/tutorial/started/tutorial-getting-started.dox @@ -217,9 +217,9 @@ Now you have to create a `CMakeLists.txt` file that gives the instructions on ho Open your editor and copy/paste the following lines in `VISP_WS/started/CMakeLists.txt` file. \code -project(tutorial-image) +cmake_minimum_required(VERSION 3.5) -cmake_minimum_required(VERSION 3.0) +project(tutorial-image) find_package(VISP REQUIRED) @@ -237,9 +237,9 @@ The `find_package()` CMake command searches for a `VISPConfig.cmake` file that w Note that the previous `CMakeLists.txt` file can also be: \code -project(tutorial-image) +cmake_minimum_required(VERSION 3.5) -cmake_minimum_required(VERSION 3.0) +project(tutorial-image) find_package(VISP REQUIRED) if(VISP_FOUND) diff --git a/doc/tutorial/supported-third-parties/supported-third-parties.dox b/doc/tutorial/supported-third-parties/supported-third-parties.dox index 6745ef6ff6..eb05985efb 100644 --- a/doc/tutorial/supported-third-parties/supported-third-parties.dox +++ b/doc/tutorial/supported-third-parties/supported-third-parties.dox @@ -317,4 +317,83 @@ a wrapper over [Vicon Datastream SDK](https://www.vicon.com/software/datastream- - MacOS \ref install_brew_3rdparty_vicon installation instructions - Windows 10 \ref install_win10_msvc17_3rdparty_vicon installation instructions +\section soft_tool Toolbox + +These are the optional 3rd-parties supported by ViSP that can bring helpful tools. + +\subsection soft_tool_json JSON for modern C++ + +Since ViSP 3.6.0 we introduced JSON serialization capabilities that may be helpful +to load and save parameters from a YAML file. + +To this end, JSON for modern C++ is supported by ViSP +and can be used to load and save JSON representations of ViSP objects. + +Thus installing this 3rd-party allows serialization of vpMbGenericTracker, vpCameraParameters, +vpPoseVector, vpHomogeneousMatrix, and vpPolygon3D objects to load/save internal data or settings +from/to JSON files. + +- Ubuntu or debian installation +\verbatim +$ sudo apt-get install nlohmann-json3-dev +\endverbatim + +- Fedora installation +\verbatim +$ sudo dnf install nlohmann-json-devel +\endverbatim + +- CentOS installation +\verbatim +$ sudo yum install json-devel +\endverbatim + +- MacOS installation +\verbatim +$ brew install nlohmann-json +\endverbatim + +- Windows installation + + To install JSON on windows, follow \ref install_win11_msvc17_3rdparty_json installation instructions. + +- Installation from source + + If the package is not available for your distribution, you can install JSON from source: +\verbatim +$ cd $VISP_WS/3rdparty +$ git clone https://github.com/nlohmann/json.git +$ cd json && mkdir build && cd build +$ cmake .. +$ make -j$(nproc) && sudo make install +\endverbatim + +\subsection soft_tool_pcl Point Cloud Library (PCL) + +[Point Cloud Library](https://pointclouds.org/) can optionnally be installed to extend vpRealSense2 capabilities +to acquire a point cloud. It could be also used to consider a point cloud as depth feature in the generic +model-based tracker when using vpMbGenericTracker class. If you don't have an Intel Realsense Depth camera +(SR300 or D400 series) or if you are not interested in model-based tracking using depth as feature, installing +PCL is not recommended. + +- Ubuntu or debian installation +\verbatim +$ sudo apt-get install libpcl-dev +\endverbatim + +- Fedora installation +\verbatim +$ sudo dnf install pcl-devel +\endverbatim + +- MacOS installation +\verbatim +$ brew install pcl +\endverbatim + On MacOS, if ViSP is not able to detect PCL, follow instructions described in + \ref install_brew_issues_pcl_1_12_1 known issue. + +- Windows installation + + To install PCL on windows, follow \ref install_win10_msvc17_3rdparty_pcl installation instructions. */ diff --git a/doc/tutorial/tracking/tutorial-tracking-keypoint.dox b/doc/tutorial/tracking/tutorial-tracking-keypoint.dox index d1d79553cd..8b8dc838cf 100644 --- a/doc/tutorial/tracking/tutorial-tracking-keypoint.dox +++ b/doc/tutorial/tracking/tutorial-tracking-keypoint.dox @@ -39,11 +39,8 @@ Here is the line by line explanation of the source : \snippet tutorial-klt-tracker.cpp Include -We include here the headers that define the corresponding classes. vpImageConvert class will be used to convert ViSP images implemented in vpImage class into OpenCV IplImage or cv::Mat structures used as an entry by the KLT tracker. Then we include the header of vpKltOpencv class which is the wrapper over OpenCV KLT tracker implementation. - -\note -- If OpenCV version is less that 2.8.0, vpKltOpencv class takes as input an IplImage. -- If OpenCV version is 2.8.0 or ;ore recent, vpKltOpencv class takes as input a cv::Mat image. +We include here the headers that define the corresponding classes. vpImageConvert class will be used to convert ViSP images implemented in vpImage class into OpenCV +cv::Mat structures used as an entry by the KLT tracker. Then we include the header of vpKltOpencv class which is the wrapper over OpenCV KLT tracker implementation. We need also to include a device to display the images. We retain vpDisplayOpenCV that works on Unix and Windows since OpenCV is mandatory by the tracker. Finally we include vpVideoReader header that will be used to read an mpeg input stream. @@ -93,10 +90,6 @@ We are waiting for a mouse click event on image \c I to end the program. \snippet tutorial-klt-tracker.cpp Wait click -With the following line, we release the memory allocated for the OpenCV IplImage \c cvI before ending the program. This has to be done only if OpenCV version is less than 2.8.0. - -\snippet tutorial-klt-tracker.cpp Release IplImage - \section tracking_keypoint_klt_init KLT tracker with re-initialisation Once initialized, the number of tracked features decreases over the time. Depending on a criteria, it may sense to detect and track new features online. A possible criteria is for example to compare the number of currently tracked features to the initial number of detected features. If less than a given percentage of features are tracked, you can start a new detection. diff --git a/doc/tutorial/tracking/tutorial-tracking-mb-deprected.dox b/doc/tutorial/tracking/tutorial-tracking-mb-deprected.dox index 4c0b35a2ac..087ac77a88 100644 --- a/doc/tutorial/tracking/tutorial-tracking-mb-deprected.dox +++ b/doc/tutorial/tracking/tutorial-tracking-mb-deprected.dox @@ -8,7 +8,7 @@ \warning This tutorial can be considered obsolete since ViSP 3.1.0 version as we have introduced a generic tracker (vpMbGenericTracker) that can replace the vpMbEdgeTracker, vpMbKltTracker and vpMbEdgeKltTracker classes that are used in this tutorial. Thus we recommend rather to follow \ref tutorial-tracking-mb-generic. -ViSP allows simultaneously the tracking of a markerless object using the knowledge of its CAD model while providing its 3D localization (i.e., the object pose expressed in the camera frame) when a calibrated camera is used \cite Comport06b. Considered objects should be modeled by lines, circles or cylinders. The CAD model of the object could be defined in vrml format (except for circles), or in cao format. +ViSP allows simultaneously the tracking of a markerless object using the knowledge of its CAD model while providing its 3D localization (i.e., the object pose expressed in the camera frame) when a calibrated camera is used \cite Comport06b. Considered objects should be modeled by lines, circles or cylinders. The CAD model of the object could be defined in vrml format (except for circles), or in cao format. To follow this tutorial depending on your interest you should be sure that ViSP was build with the following third-parties: - \c OpenCV: Useful if you want to investigate the KLT keypoint tracker implemented in vpMbKltTracker or its hybrid version vpMbEdgeKltTracker. We recommend to install \c OpenCV. This 3rd party may be also useful to consider input videos (mpeg, png, jpeg...). @@ -142,22 +142,22 @@ tracker->loadModel(objectname + ".wrl"); Once the model of the object to track is loaded, with the next line the display in the image window of additional drawings in overlay such as the moving edges positions, is then enabled by: \snippet tutorial-mb-tracker.cpp Set display -Now we have to initialize the tracker. With the next line we choose to use a user interaction. +Now we have to initialize the tracker. With the next line we choose to use a user interaction. \snippet tutorial-mb-tracker.cpp Init The user has to click in the image on four vertices with their 3D coordinates defined in the \c "teabox.init" file. The following image shows where the user has to click. -\image html img-teabox-click.jpg Image \c "teabox.ppm" used to help the user to initialize the tracker. +\image html img-teabox-click.jpg Image \c "teabox.ppm" used to help the user to initialize the tracker. Matched 2D and 3D coordinates are then used to compute an initial pose used to initialize the tracker. Note also that the third optional argument "true" is used here to enable the display of an image that may help the user for the initialization. The name of this image is the same as the \c "*.init" file except the extension that sould be \c ".ppm". In our case it will be \c "teabox.ppm". -The content of \c teabox.init file that defines 3D coordinates of some points of the model used during user intialization is provided hereafter. Note that all the characters after character '#' are considered as comments. +The content of \c teabox.init file that defines 3D coordinates of some points of the model used during user intialization is provided hereafter. Note that all the characters after character '#' are considered as comments. \includelineno tracking/model-based/generic/model/teabox/teabox.init We give now the signification of each line of this file: - line 1: Number of 3D points that are defined in this file. At least 4 points are required. Four is the minimal number of points requested to compute a pose. -- line 2: Each point is defined by its 3D coordinates. Here we define the first point with coordinates (0,0,0). In the previous figure it corresponds to vertex 0 of the tea box. This point is also the origin of the frame in which all the points are defined. +- line 2: Each point is defined by its 3D coordinates. Here we define the first point with coordinates (0,0,0). In the previous figure it corresponds to vertex 0 of the tea box. This point is also the origin of the frame in which all the points are defined. - line 3: 3D coordinates of vertex 3. - line 4: 3D coordinates of vertex 2. - line 5: 3D coordinates of vertex 5. @@ -200,8 +200,8 @@ We make the choice to describe the faces of the box from the 3D points that corr - line 5: 3D point with coordinate (0,0,-0.08) corresponding to vertex 1. - line 6 to 11: The other 3D points corresponding to vertices 2 to 7 respectively. - line 13: Number of 3D lines defined from two 3D points. It is possible to introduce 3D lines and then use these lines to define faces from these 3D lines. This is particularly useful to define faces from non-closed polygons. For instance, it can be used to specify the tracking of only 3 edges of a rectangle. Notice also that a 3D line that doesn't belong to a face is always visible and consequently always tracked. -- line 15: Number of faces defined from 3D lines. In our teabox example we decide to define all the faces from 3D points, that is why this value is set to 0. -- line 17: The number of faces defined by a set of 3D points. Here our teabox has 6 faces. Thus, next 6 lines describe each face from the 3D points defined previously line 4 to 11. Notice here that all the faces defined from 3D points corresponds to closed polygons. +- line 15: Number of faces defined from 3D lines. In our teabox example we decide to define all the faces from 3D points, that is why this value is set to 0. +- line 17: The number of faces defined by a set of 3D points. Here our teabox has 6 faces. Thus, next 6 lines describe each face from the 3D points defined previously line 4 to 11. Notice here that all the faces defined from 3D points corresponds to closed polygons. - line 18: First face defined by 4 3D points, respectively vertices 0,1,2,3. The orientation of the face is counter clockwise by going from vertex 0 to vertex 1, then 2 and 3. This fixes the orientation of the normal of the face going outside the object. - line 19: Second face also defined by 4 points, respectively vertices 1,6,5,2 to have a counter clockwise orientation. - line 20 to 23: The four other faces of the box. @@ -218,14 +218,14 @@ This file describes the model of the tea box corresponding to the next image: \image html img-teabox-cao-triangle.jpg Index of the vertices used to model the tea box in cao format with triangles. -Until line 15, the content of this file is similar to the one described in +Until line 15, the content of this file is similar to the one described in \ref mbdep_teabox_cao. Line 17 we specify that the model contains 12 faces. Each face is then described as a triangle. -\note Since some lines of the model (for example the one between points 0 and 2, or 7 and 3...) don't correspond to teabox edges, this CAD model is not suited for moving-edges and hybrid trackers. +\note Since some lines of the model (for example the one between points 0 and 2, or 7 and 3...) don't correspond to teabox edges, this CAD model is not suited for moving-edges and hybrid trackers. \subsection mbdep_teabox_vrml teabox.wrl example -The content of the \c teabox.wrl file used in tutorial-mb-tracker-full.cpp and tutorial-mb-edge-tracker.cpp when \c teabox.cao is missing is given hereafter. This content is to make into relation with \c teabox.cao described in \ref mbdep_teabox_cao. As for the cao format, \c teabox.wrl describes first the vertices of the box, then the edges that corresponds to the faces. +The content of the \c teabox.wrl file used in tutorial-mb-tracker-full.cpp and tutorial-mb-edge-tracker.cpp when \c teabox.cao is missing is given hereafter. This content is to make into relation with \c teabox.cao described in \ref mbdep_teabox_cao. As for the cao format, \c teabox.wrl describes first the vertices of the box, then the edges that corresponds to the faces. \includelineno tracking/model-based/generic/model/teabox/teabox.wrl @@ -259,7 +259,8 @@ The content of the XML file teabox.xml that is considered by default is the foll 8 - 10000 + 1 + 20 0.5 0.5 @@ -268,24 +269,24 @@ The content of the XML file teabox.xml that is considered by default is the foll - 5 - 300 - 5 - 0.015 - 8 + 5 + 300 + 5 + 0.015 + 8 0.01 - 3 - 3 + 3 + 3 - 325.66776 - 243.69727 - 839.21470 - 839.44555 + 325.66776 + 243.69727 + 839.21470 + 839.44555 - 70 - 80 + 70 + 80 0.1 100 1 @@ -314,7 +315,8 @@ These settings could be tuned either from XML using \ tag as: 8 - 10000 + 1 + 20 0.5 0.5 @@ -332,7 +334,7 @@ of from source code using vpMbEdgeTracker::setMovingEdge() method: Either from xml or from the previous source code you can set: - mask_size: defines the size of the convolution mask used to detect an edge. - nb_mask: number of mask applied to determine the object contour. The number of mask determines the precision of the normal of the edge for every sample. If precision is 2deg, then there are 360/2 = 180 masks. -- range_tracking: range on both sides of the reference pixel along the normal of the contour used to track a moving-edge. If the displacement of the tracked object in two successive images is large, you have to increase this parameter. +- range_tracking: range on both sides of the reference pixel along the normal of the contour used to track a moving-edge. If the displacement of the tracked object in two successive images is large, you have to increase this parameter. - edge_threshold: likelihood threshold used to determined if the moving edge is valid or not. - mu1: minimum image contrast allowed to detect a contour. - mu2: maximum image contrast allowed to detect a contour. @@ -342,21 +344,21 @@ Either from xml or from the previous source code you can set: \subsection mbdep_settings_klt Keypoints settings -Keypoint settings affect tracking of keypoints on visible faces using KLT. +Keypoint settings affect tracking of keypoints on visible faces using KLT. These settings could be tuned either from XML using \ tag as: \code ... - 5 - 300 - 5 - 0.015 - 8 + 5 + 300 + 5 + 0.015 + 8 0.01 - 3 - 3 + 3 + 3 ... @@ -369,7 +371,7 @@ With the previous parameters you can set: - mask_border: erosion number of the mask used on each face. - max_features: maximum number of keypoint features to track in the image. - window_size: window size used to refine the corner locations. -- quality: parameter characterizing the minimal accepted quality of image corners. Corners with quality measure less than this parameter are rejected. This means that if you want to have more keypoints on a face, you have to reduce this parameter. +- quality: parameter characterizing the minimal accepted quality of image corners. Corners with quality measure less than this parameter are rejected. This means that if you want to have more keypoints on a face, you have to reduce this parameter. - min_distance: minimal Euclidean distance between detected corners during keypoint detection stage used to initialize keypoint location. - harris: free parameter of the Harris detector. - size_block: size of the averaging block used to track the keypoint features. @@ -378,17 +380,17 @@ With the previous parameters you can set: \note Most important parameters are \e min_distance and \e quality. \subsection mbdep_settings_cam Camera settings -Camera settings correspond to the intrinsic camera parameters without distorsion. If images are acquired by a camera that has a large field of view that introduce distorsion, images need to be undistorded before processed by the tracker. The camera parameters are then the one obtained on undistorded images. +Camera settings correspond to the intrinsic camera parameters without distortion. If images are acquired by a camera that has a large field of view that introduce distortion, images need to be undistorded before processed by the tracker. The camera parameters are then the one obtained on undistorded images. Camera settings could be set from XML using \ tag as: \code ... - 325.66776 - 243.69727 - 839.21470 - 839.44555 + 325.66776 + 243.69727 + 839.21470 + 839.44555 ... @@ -402,10 +404,10 @@ As described in vpCameraParameters class, these parameters correspond to \f$(p_x \subsection mbdep_settings_visibility Visibility settings -An important setting concerns the visibility test that is used to determine if a face is visible or not. Note that moving-edges and keypoints are only tracked on visible faces. Three different visibility tests are implemented; with or without Ogre ray tracing and with or without scanline rendering. The default test is the one without Ogre and scanline. The functions vpMbTracker::setOgreVisibilityTest() and vpMbTracker::setScanLineVisibilityTest() allow to select which test to use. +An important setting concerns the visibility test that is used to determine if a face is visible or not. Note that moving-edges and keypoints are only tracked on visible faces. Three different visibility tests are implemented; with or without Ogre ray tracing and with or without scanline rendering. The default test is the one without Ogre and scanline. The functions vpMbTracker::setOgreVisibilityTest() and vpMbTracker::setScanLineVisibilityTest() allow to select which test to use. \subsubsection mbdep_settings_visibility_default Default visibility based on normals -Let us now highlight how the default visibility test works. As illustrated in the following figure, the angle \f$ \alpha \f$ between the normal of the face and the line going from the camera to the center of gravity of the face is used to determine if the face is visible. +Let us now highlight how the default visibility test works. As illustrated in the following figure, the angle \f$ \alpha \f$ between the normal of the face and the line going from the camera to the center of gravity of the face is used to determine if the face is visible. \image html img-tracker-mb-visibility.jpg Principle of the visibility test used to determine if a face is visible. @@ -414,8 +416,8 @@ When no advanced visibility test is enable (we recall that this is the default b ... - 70 - 80 + 70 + 80 \endcode or in the code: @@ -423,7 +425,7 @@ or in the code: Here the face is considered as appearing if \f$ \alpha \leq 70\f$ degrees, and disappearing if \f$ \alpha > 80\f$ degrees. -\note When these two angle parameters are not set, their default values set to 89 degrees are used. +\note When these two angle parameters are not set, their default values set to 89 degrees are used. \subsubsection mbdep_settings_visibility_ogre Advanced visibility via Ogre3D @@ -462,9 +464,9 @@ Even if this approach requires a bit more computing power, it is a pix \subsection mbdep_settings_clipping Clipping settings -Additionally to the visibility test described above, it is also possible to use clipping. Firstly, the algorithm removes the faces that are not visibles, according to the visibility test used, then it will also remove the faces or parts of the faces that are out of the clipping planes. As illustrated in the following figure, different clipping planes can be enabled. +Additionally to the visibility test described above, it is also possible to use clipping. Firstly, the algorithm removes the faces that are not visibles, according to the visibility test used, then it will also remove the faces or parts of the faces that are out of the clipping planes. As illustrated in the following figure, different clipping planes can be enabled. -\image html img-fov.png Camera field of view and clipping planes. +\image html img-fov.png Camera field of view and clipping planes. Let us consider two plane categories: the ones belonging to the field of view or FOV (Left, Right, Up and Down), and the Near and Far clipping planes. The FOV planes can be enabled by: @@ -473,9 +475,9 @@ Let us consider two plane categories: the ones belonging to the field of view or which is equivalent to: \code - tracker->setClipping(vpMbtPolygon::LEFT_CLIPPING + tracker->setClipping(vpMbtPolygon::LEFT_CLIPPING | vpMbtPolygon::RIGHT_CLIPPING - | vpMbtPolygon::UP_CLIPPING + | vpMbtPolygon::UP_CLIPPING | vpMbtPolygon::DOWN_CLIPPING); \endcode @@ -510,18 +512,18 @@ It is also possible to enable them in the XML file. This is done with the follow Here for simplicity, the user just has the possibility to either activate all the FOV clipping planes or none of them (fov_clipping requires a boolean). -\note When clipping parameters are not set in the XML file, nor in the code, clipping is not used. Usually clipping is not helpful when the oject to track is simple. +\note When clipping parameters are not set in the XML file, nor in the code, clipping is not used. Usually clipping is not helpful when the oject to track is simple. \section mbdep_advanced Advanced \subsection mbdep_advanced_model How to manipulate the model The following code shows how to access to the CAD model -- to check if a face is visible, +- to check if a face is visible, - to get the name of the face (only with models in \c .cao format for the moment) - to check if the level of detail is enable/disable (only with models in \c .cao format for the moment) - to access to the coordinates of the 3D points used to model a face -- from the pose \e cMo estimated by the tracker to compute the coordinates of the 3D points in the image +- from the pose \e cMo estimated by the tracker to compute the coordinates of the 3D points in the image \code vpMbHiddenFaces &faces = tracker.getFaces(); @@ -531,9 +533,9 @@ The following code shows how to access to the CAD model std::cout << "face " << i << " with index: " << poly[i]->getIndex() << (poly[i]->getName().empty() ? "" : (" with name: " + poly[i]->getName())) << " is " << (poly[i]->isVisible() ? "visible" : "not visible") - << " and has " << poly[i]->getNbPoint() << " points" + << " and has " << poly[i]->getNbPoint() << " points" << " and LOD is " << (poly[i]->useLod ? "enabled" : "disabled") << std::endl; - + for (unsigned int j=0; jgetNbPoint(); j++) { vpPoint P = poly[i]->getPoint(j); P.project(cMo); @@ -550,7 +552,7 @@ The following code shows how to access to the CAD model \subsection mbdep_advanced_lod Level of detail (LOD) -The level of detail (LOD) consists in introducing additional constraints to the visibility check to determine if the features of a face have to be tracked or not. Two parameters are used +The level of detail (LOD) consists in introducing additional constraints to the visibility check to determine if the features of a face have to be tracked or not. Two parameters are used - the line length (in pixel) - the area of the face (in pixel²), that could be closed or not (you can define an open face by adding all the segments without the last one which closes the face) @@ -803,7 +805,7 @@ The natural order would be to load first the configuration file and after the CA To exploit the name of a face in the code, see sections about \ref mbdep_advanced_lod and \ref mbdep_advanced_exclude. -When using a wrml file, names are associated with shapes. In the example below (the model of a teabox), as only one shape is defined, all its faces will have the same name: "teabox_name". +When using a wrml file, names are associated with shapes. In the example below (the model of a teabox), as only one shape is defined, all its faces will have the same name: "teabox_name". \note If you want to set different names for different faces, you have to define them in different shapes. @@ -819,7 +821,7 @@ DEF teabox_name Shape { geometry DEF cube IndexedFaceSet { -coord Coordinate { +coord Coordinate { point [ 0 0 0 , 0 0 -0.08, @@ -854,7 +856,7 @@ If you want to enable (default behavior) or disable the edge tracking on specifi vpMbEdgeTracker::setUseEdgeTracking("name of the face", boolean); \endcode -If the boolean is set to False, the tracking of the edges of the faces that have the given name will be disable. If it is set to True (default behavior), it will be enable. +If the boolean is set to False, the tracking of the edges of the faces that have the given name will be disable. If it is set to True (default behavior), it will be enable. As for the edge tracking, the same functionnality is also available when using keypoints via: @@ -926,7 +928,7 @@ This issue is similar to \ref mbdep_known_issues_example_with_ogre. It may occur tracker.setOgreShowConfigDialog(true); \endcode - build the modified tutorial -- run the binary. Now the binary should open the Ogre configuration window where you have to select an Ogre renderer that is working on your computer. +- run the binary. Now the binary should open the Ogre configuration window where you have to select an Ogre renderer that is working on your computer. \image html img-win8.1-msvc-mbtracker-ogre-opengl.jpg - Press then OK to continue and start the tracking of the object. diff --git a/doc/tutorial/tracking/tutorial-tracking-mb-generic-json.dox b/doc/tutorial/tracking/tutorial-tracking-mb-generic-json.dox new file mode 100644 index 0000000000..1c132a25db --- /dev/null +++ b/doc/tutorial/tracking/tutorial-tracking-mb-generic-json.dox @@ -0,0 +1,277 @@ +/** + +\page tutorial-mb-generic-json Tutorial: Loading a model-based generic tracker from JSON +\tableofcontents + +\section tutorial-mb-generic-json-intro Introduction + +Since ViSP 3.6.0, a 3rd party library was introduced to allow the seamless use of JSON (JavaScript Object Notation) in ViSP. +The library that is used is JSON for modern C++. +To install it on your system, look at \ref soft_tool_json installation instructions for your system. + +With the inclusion of JSON for modern C++ 3rd party +library into ViSP, it is now possible to store and load a variety of ViSP datatypes in JSON format. + +A case that is of particular interest is the configuration of the generic Model-Based Tracker. As this tracker is complex, providing an easy to use configuration file is essential. +Loading the configuration for each camera is already possible with XML (already used in \ref tutorial-tracking-mb-generic-rgbd). +This however, does not load the full state of the tracker but rather the configuration of each camera and combining everything is left to the user. + +With JSON serialization, a single file stores the full configuration of the generic tracker, containing the configuration of each camera, their associated name as well as their transformation with respect to the reference camera. +Moreover, the path to the 3D model can be given in the JSON file and the model will be directly loaded. + +\section tutorial-mb-generic-json-structure JSON file structure +Let us first examine the structure of a JSON file used to load a vpMbGenericTracker, given below: +\include realsense-color-and-depth.json + +Many settings are optional: if a setting is not present in the .json file, then the value already set in the tracker is kept. +This means that the .json can contain a partial configuration, while the rest of the configuration is done in the code. +Beware however, that previously defined cameras that are not in the .json file are removed. + +As this file is fairly dense, let us examine each part separetely so that you may tweak it for your use case. + +\subsection json-global-tracker-settings Global tracker settings + +Let us first examine the global settings (located at the root of the JSON structure). Some settings are optional such as: + +\code{.json} + //... + "model": "../models/cube/cube.cao", + "display": { + "features": true, + "projectionError": true + }, + "visibilityTest": { + "ogre": false, + "scanline": true + } +\endcode + +If they are defined globally, they will take precedence over the values defined per tracker. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
KeyTypeDescriptionOptional
versionStringVersion of the JSON parsing for the MBT trackerNo
referenceCameraNameStringThe name of the reference camera, see vpMbGenericTracker::getReferenceCameraName()No
trackersDictionaryThe set of camera trackers. Each element of the dictionary associates a camera name to a tracker, that is parsed with vpMbGenericTracker::from_json()No
modelStringThe path to a .cao model file, describing the object to track. See vpMbGenericTracker::loadModel()Yes
display:featuresbooleanShow features when calling vpMbGenericTracker::display()Yes
display:projectionErrorbooleanWhether to display the projection error when calling vpMbGenericTracker::display()Yes
visibilityTest:scanlinebooleanWhether to use scanline for visibility testing. see vpMbGenericTracker::setScanLineVisibilityTest()Yes
visibilityTest:ogrebooleanWhether to use ogre for visibility testing. OGRE must be installed, otherwise ignored. See vpMbGenericTracker::setOgreVisibilityTest()Yes
+ +\subsection json-per-tracker-settings Individual camera tracker settings + +Each camera has a name (the key in the "trackers" dictionary, e.g., "Color", "Depth") and is associated to a combination of tracker. + +First, consider, the tracker for the key "Color": +\snippet realsense-color-and-depth.json.example Color + +This JSON object contains multiple components which we'll go through one by one. + +First each camera-specific tracker definition must contain its type. Here, it is defined as: +\snippet realsense-color-and-depth.json.example Features +stating that this tracker uses both edge (see the vpMe class) and KLT (see vpKltOpencv) features. other possible values are "depthDense" and "depthNormal" for depth-related features. + +The next important definition is: +\snippet realsense-color-and-depth.json.example Transformation +Describing the transformation between this camera and the reference camera. It can also be given as a vpPoseVector JSON representation. +If the current camera is the reference, then "camTref" may be ommitted or set as the identity transformation. + +Next, we must define the camera intrinsics (see vpCameraParameters): +\snippet realsense-color-and-depth.json.example Camera +This JSON object follows the convention defined in vpCameraParameters::from_json(). + +Other common settings include: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
KeyTypeDescriptionReferenceOptional
angleAppearfloatAngle at which a face is considered as appearing, defined in degrees.vpMbTracker::setAngleAppear()Yes
angleDisappearfloatAngle at which a face is considered as disappearing, defined in degrees.vpMbTracker::setAngleDisappear()Yes
clipping (optional)
flagsList of vpPolygon3D::vpPolygon3DClippingTypeThe clipping flags used for this tracker. a list that can combine different values in: + ["none", "all", "fov", "left", "right", "top", "down", "near", "far"] + vpPolygon3D, vpMbTracker::setClipping()Yes
nearfloatNear plane clipping distance.vpMbTracker::setNearClippingDistance()Yes
farfloatFar plane clipping distance. vpMbTracker::setFarClippingDistance()Yes
lod (optional)
useLodbooleanWhether to use level of detail.vpMbTracker::setLod()Yes
minLineLengthThresholdGeneralfloatMinimum line length to be considered as visible in LOD.vpMbTracker::setMinLineLengthThresh()Yes
minPolygonAreaThresholdGeneralfloatMinimum polygon area to be considered as visible in LOD. vpMbTracker::setMinPolygonAreaThresh()Yes
display (optional)
See \ref json-global-tracker-settings
visibilityTest (optional)
See \ref json-global-tracker-settings
+ +\subsection json-feature-settings Tracker Feature settings + +Each type of tracked feature can be customized in the JSON file. + +

Edge

+Edge feature parameters are defined by the conversion vpMe::from_json(). +All parameters are optional: if not filled in the JSON file, then the value that is already set will be used. + +Example configuration (all parameters): +\snippet realsense-color-and-depth.json.example Edge + +

KLT

+Each parameter of the KLT tracker (see vpKltOpencv) is optional: if not present it will be set to a fixed default value. + +The default configuration is: +\snippet realsense-color-and-depth.json.example KLT +

Depth normals

+The configuration for the depth normal features is the following +\snippet realsense-color-and-depth.json.example DepthNormal + +the "featureEstimationMethod" must be one of "robust", "robustSVD" or "pcl". The latter requires PCL to be installed +following \ref soft_tool_pcl installation instructions. + +See vpMbDepthNormalTracker for more details. + +

Dense depth

+The configuration for the dense depth features only contain the sampling step, as shown below: +\snippet realsense-color-and-depth.json.example DepthDense + +\section json-settings-usage Example: Initializing a tracker from a JSON file + +Let's now look at an example of how to use JSON to track an object. + +This example is similar to tutorial-mb-generic-tracker-rgbd-realsense.cpp, where an XML configuration file is used to configure camera per camera. +Instead, here, we will use a JSON file to fully configure the tracker. + +The full code can be found in tutorial-mb-generic-tracker-rgbd-realsense-json-settings.cpp + +To run the example: +\code{.sh} +// If no CAD model is defined in the JSON file +$ cd $VISP_WS/visp-build/tutorial/tracking/model-based/generic-rgbd +$ ./tutorial-mb-generic-tracker-rgbd-realsense-json-settings \ + --config model/cube/realsense-color-and-depth.json \ + --model model/cube/cube.cao + +// If CAD model is defined in JSON +$ ./tutorial-mb-generic-tracker-rgbd-realsense-json-settings \ + --config model/cube/realsense-color-and-depth.json +\endcode + +The main difference between tutorial-mb-generic-tracker-rgbd-realsense.cpp and +tutorial-mb-generic-tracker-rgbd-realsense-json-settings.cpp is that in the latter we specify which features +to use in the JSON config file. + +First, we initialize the camera (here, a vpRealsense2 camera) and query the camera intrinsics, +as well as declare the vpImage we will use to store the data feed and display it: +\snippet tutorial-mb-generic-tracker-rgbd-realsense-json-settings.cpp Init + +To load the json configuration, we simply call: +\snippet tutorial-mb-generic-tracker-rgbd-realsense-json-settings.cpp Loading + +We then query what features are used by the tracker and update its input accordingly +\snippet tutorial-mb-generic-tracker-rgbd-realsense-json-settings.cpp Init maps + +To finish with the configuration, we load the 3D CAD model if none was defined in the JSON file. +If none is given by the user, then an exception is thrown. +\snippet tutorial-mb-generic-tracker-rgbd-realsense-json-settings.cpp Load 3D model + +To ensure the best performance, we might still prefer to use the camera intrinsics and transformation +between color and depth cameras provided by the Realsense SDK. +\snippet tutorial-mb-generic-tracker-rgbd-realsense-json-settings.cpp Update params + +We then initialize tracking by click: +\snippet tutorial-mb-generic-tracker-rgbd-realsense-json-settings.cpp Init tracking + +Finally, we can start tracking: +\snippet tutorial-mb-generic-tracker-rgbd-realsense-json-settings.cpp Tracking + +\section json-settings-next Next tutorial + +If you want to introduce JSON usage in your code, you can continue with \ref tutorial-json. + +*/ diff --git a/doc/tutorial/tracking/tutorial-tracking-mb-generic-rgbd.dox b/doc/tutorial/tracking/tutorial-tracking-mb-generic-rgbd.dox index 6f07cc9644..6b94bfb822 100644 --- a/doc/tutorial/tracking/tutorial-tracking-mb-generic-rgbd.dox +++ b/doc/tutorial/tracking/tutorial-tracking-mb-generic-rgbd.dox @@ -134,7 +134,7 @@ pointcloud[0] = coordinate; pcl::PointCloud::Ptr pointcloud; \endcode -If you have only a depth map, a 2D array where each element (u, v) is the distance Z in meter between the depth sensor frame to the object, you will need to compute the 3D coordinates using the depth sensor intrinsic parameters. We recall that u relates to the array columns, while v relates to the array rows. +If you have only a depth map, a 2D array where each element (u, v) is the distance Z in meter between the depth sensor frame to the object, you will need to compute the 3D coordinates using the depth sensor intrinsic parameters. We recall that u relates to the array columns, while v relates to the array rows. For instance, without taking into account the distortion (see also vpPixelMeterConversion::convertPoint), the conversion is (u and v are the pixel coordinates, u0, v0, px, py are the intrinsic parameters): \f[ @@ -166,7 +166,7 @@ To deal with multiple cameras, in the virtual visual servoing control law we con the reference camera velocity. Thus, we have to know the transformation matrix between each camera and the reference camera. -For example, if the reference camera is "Camera1" (\f$ c_1 \f$), we need the following information: +For example, if the reference camera is "Camera1" (\f$ c_1 \f$), we need the following information: \f$ _{}^{c_2}\textrm{M}_{c_1}, _{}^{c_3}\textrm{M}_{c_1}, \cdots, _{}^{c_n}\textrm{M}_{c_1} \f$. \subsection mb_rgbd_choose_features Declare a model-based tracker of the desired feature type @@ -221,8 +221,8 @@ The following table sums up how to call the different methods based on the camer Get the pose: tracker.getPose(cMo) tracker.getPose(c1Mo, c2Mo) tracker.getPose(mapOfPoses) tracker.getPose(cMo) will return the pose for the reference camera in the stereo/multiple cameras configurations. Display the model: tracker.display(I, cMo, cam, ...) tracker.display(I1, I2, c1Mo, c2Mo, cam1, cam2, ...) tracker.display(mapOfImg, mapOfPoses, mapOfCam, ...) - -\note As the trackers are stored in an alphabetic order internally, you have to match the method parameters with the correct + +\note As the trackers are stored in an alphabetic order internally, you have to match the method parameters with the correct tracker position in the map in the stereo cameras case. \section mb_rgbd_example Dataset use case @@ -253,13 +253,13 @@ The previous source code shows how to use the vpMbGenericTracker class using dep - load the transformation matrix (`depth_M_color.txt`) between the depth sensor and the color camera - load the `cube.init` file used to initialize the tracker by a user interaction that consists in clicking on 4 cube corners - load a 3D model for the color and for the depth camera. In our case they are the same (`cube.cao`) -- start a while loop to process all the images from the sequence of data +- start a while loop to process all the images from the sequence of data - track on the current images (color and depth) - get the current pose and display the model in the image Please refer to the tutorial \ref tutorial-tracking-mb-generic in order to have explanations about the configuration parameters (\ref mb_generic_settings) and how to model an object in a ViSP compatible format (\ref mb_generic_advanced_cao). -To use vpMbGenericTracker we include first the corresponding header: +To use vpMbGenericTracker we include first the corresponding header: \snippet tutorial-mb-generic-tracker-rgbd.cpp Include @@ -291,7 +291,7 @@ We can also use the following setting that enables the display of the features u \snippet tutorial-mb-generic-tracker-rgbd.cpp Set display features -We then set the map of transformations between our two sensors indicating that the color sensor frame is the reference frame. `depth_M_color` matrix is read from the input file `depth_M_color.txt`. +We then set the map of transformations between our two sensors indicating that the color sensor frame is the reference frame. `depth_M_color` matrix is read from the input file `depth_M_color.txt`. \snippet tutorial-mb-generic-tracker-rgbd.cpp Map transformations @@ -559,9 +559,10 @@ $ ./tutorial-mb-generic-tracker-rgbd-structure-core --model_color model/lego-squ \section mb_rgbd_next Next tutorial -If you have an Intel Realsense device, you are now ready to experiment the generic model-based tracker on a cube that has an AprilTag on one face following \ref tutorial-tracking-mb-generic-apriltag-live. - - -You can also follow \ref tutorial-tracking-mb-CAO-editor. +- In this tutorial, tracker settings were loaded from an XML file. To learn how to use rather a JSON configuration file, + you can follow \ref tutorial-mb-generic-json. +- If you have an Intel Realsense device, you are also ready to experiment the generic model-based tracker + on a cube that has an AprilTag on one face following \ref tutorial-tracking-mb-generic-apriltag-live. +- You can also follow \ref tutorial-tracking-mb-CAO-editor. */ diff --git a/doc/tutorial/tracking/tutorial-tracking-mb-generic.dox b/doc/tutorial/tracking/tutorial-tracking-mb-generic.dox index d64ffff3cc..4a77c78178 100644 --- a/doc/tutorial/tracking/tutorial-tracking-mb-generic.dox +++ b/doc/tutorial/tracking/tutorial-tracking-mb-generic.dox @@ -5,13 +5,24 @@ \section mb_generic_intro Introduction -ViSP allows simultaneously the tracking of a markerless object using the knowledge of its CAD model while providing its 3D localization (i.e., the object pose expressed in the camera frame) when a calibrated camera is used \cite Comport06b, \cite Trinh18a. Considered objects should be modeled by lines, circles or cylinders. The CAD model of the object could be defined in vrml format (except for circles), or in cao format (a home-made format). +ViSP allows simultaneously the tracking of a markerless object using the knowledge of its CAD model while providing its 3D +localization (i.e., the object pose expressed in the camera frame) when a calibrated camera is used \cite Comport06b, \cite Trinh18a. +Considered objects should be modeled by lines, circles or cylinders. The CAD model of the object could be defined in vrml format +(except for circles), or in cao format (a home-made format). -This tutorial focuses on vpMbGenericTracker class that was introduced in ViSP 3.1.0. This class brings a generic way to consider different kind of visual features used as measures by the model-based tracker and allows also to consider either a single camera or multiple cameras observing the object to track. This class replaces advantageously the usage of the following classes vpMbEdgeTracker, vpMbKltTracker or the one mixing edges and keypoints vpMbEdgeKltTracker that will continue to exist in ViSP but that we don't recommend to use, since switching from one class to an other may be laborious. If for one reason or another you still want to use these classes, we invite you to follow \ref tutorial-tracking-mb-deprecated. +This tutorial focuses on vpMbGenericTracker class that was introduced in ViSP 3.1.0. This class brings a generic way to consider +different kind of visual features used as measures by the model-based tracker and allows also to consider either a single camera +or multiple cameras observing the object to track. This class replaces advantageously the usage of the following classes +vpMbEdgeTracker, vpMbKltTracker or the one mixing edges and keypoints vpMbEdgeKltTracker that will continue to exist in ViSP but +that we don't recommend to use, since switching from one class to an other may be laborious. If for one reason or another you +still want to use these classes, we invite you to follow \ref tutorial-tracking-mb-deprecated. -In this tutorial, we will show how to use vpMbGenericTracker class in order to track an object from images acquires by a monocular color camera using either moving edges, either keypoints, or either a combination of them using an hybrid scheme. To illustrate this tutorial we will consider that the object to track is a tea box. +In this tutorial, we will show how to use vpMbGenericTracker class in order to track an object from images acquires by a monocular +color camera using either moving edges, either keypoints, or either a combination of them using an hybrid scheme. To illustrate +this tutorial we will consider that the object to track is a tea box. -Note that all the material (source code, input video, CAD model or XML settings files) described in this tutorial is part of ViSP source code and could be downloaded using the following command: +Note that all the material (source code, input video, CAD model or XML settings files) described in this tutorial is part of ViSP +source code and could be downloaded using the following command: \code $ svn export https://github.com/lagadic/visp.git/trunk/tutorial/tracking/model-based/generic @@ -19,20 +30,28 @@ $ svn export https://github.com/lagadic/visp.git/trunk/tutorial/tracking/model-b \subsection mb_generic_intro_features_overview Features overview -Considering the use case of a monocular color camera, the tracker implemented in vpMbGenericTracker class allows to consider a combination of the following visual features: -- moving edges: image points tracked along the visible edges defined in the CAD model (line, face, cylinder and circle primitives) \cite Comport06b. This feature is appropriate to track texture-less objects (with visible edges) -- keypoints: they are tracked on the visible object faces using KLT tracker (face and cylinder primitives) \cite Pressigout:2007. This feature is suitable for textured objects +Considering the use case of a monocular color camera, the tracker implemented in vpMbGenericTracker class allows to consider a +combination of the following visual features: +- moving edges: image points tracked along the visible edges defined in the CAD model (line, face, cylinder and circle primitives) + \cite Comport06b. This feature is appropriate to track texture-less objects (with visible edges) +- keypoints: they are tracked on the visible object faces using KLT tracker (face and cylinder primitives) \cite Pressigout:2007. + This feature is suitable for textured objects -The moving-edges and KLT features require a RGB camera but note that these features operate on grayscale image. +The moving-edges and KLT features require a RGB camera but note that these features operate on grayscale image. -Note also that combining the visual features (moving edges + keypoints) can be a good way to improve the tracking robustness. +Note also that combining the visual features (moving edges + keypoints) can be a good way to improve the tracking robustness. \subsection mb_generic_intro_3rd_parties Considered third-parties -Depending on your use case the following optional third-parties may be used by the tracker. Make sure ViSP was build with the appropriate 3rd parties: -- \c OpenCV: Essential if you want to use the keypoints as visual features that are detected and tracked thanks to the KLT tracker. This 3rd party may be also useful to consider input videos (mpeg, png, jpeg...). -- \c Ogre \c 3D: This 3rd party is optional and could be difficult to install on OSX and Windows. To begin with the tracker we don't recommend to install it. \c Ogre \c 3D allows to enable \ref mb_generic_settings_visibility_ogre. -- \c Coin \c 3D: This 3rd party is also optional and difficult to install. That's why we don't recommend to install \c Coin \c 3D to begin with the tracker. \c Coin \c 3D allows only to consider \ref mb_generic_advanced_wrml instead of the home-made \ref mb_generic_advanced_cao. +Depending on your use case the following optional third-parties may be used by the tracker. Make sure ViSP was build with the +appropriate 3rd parties: +- \c OpenCV: Essential if you want to use the keypoints as visual features that are detected and tracked thanks to the KLT tracker. + This 3rd party may be also useful to consider input videos (mpeg, png, jpeg...). +- \c Ogre \c 3D: This 3rd party is optional and could be difficult to install on OSX and Windows. To begin with the tracker we don't + recommend to install it. \c Ogre \c 3D allows to enable \ref mb_generic_settings_visibility_ogre. +- \c Coin \c 3D: This 3rd party is also optional and difficult to install. That's why we don't recommend to install \c Coin \c 3D + to begin with the tracker. \c Coin \c 3D allows only to consider \ref mb_generic_advanced_wrml instead of the home-made + \ref mb_generic_advanced_cao. \subsection mb_generic_input Input images data @@ -56,28 +75,38 @@ Since ViSP 3.2.1, it is also possible to consider color images as input with the vpImage I; \endcode -\note If you consider color images as intput, the time requested by the tracker to process one image will increase since there is a conversion from the color to a gray level image used in the tracker low level layers. +\note If you consider color images as intput, the time requested by the tracker to process one image will increase since there is a +conversion from the color to a gray level image used in the tracker low level layers. \section mb_generic_started Getting started -To start with the generic markerless model-based tracker we recommend to understand the tutorial-mb-generic-tracker.cpp source code that is given and explained below. +To start with the generic markerless model-based tracker we recommend to understand the tutorial-mb-generic-tracker.cpp source code +that is given and explained below. \subsection mb_generic_started_input Example input/output data The tutorial-mb-generic-tracker.cpp example uses the following data as input: - a video file; `teabox.mpg` is the default video. -- a cad model that describes the object to track. In our case the file `teabox.cao` is the default one. See \ref mb_generic_model section to learn how the teabox is modeled and section \ref mb_generic_advanced_cao to learn how to model an other object. -- a file with extension `*.init` that contains the 3D coordinates of some points used to compute an initial pose which serves to initialize the tracker. The user has than to click in the image on the corresponding 2D points. The default file is named `teabox.init`. The content of this file is detailed in \ref mb_generic_init_user section. -- an optional image with extension `*.ppm` that may help the user to remember the location of the corresponding 3D points specified in `*.init` file. To know more about this file see \ref mb_generic_init_user section. - -As an output the tracker provides the pose \f$^c {\bf M}_o \f$ corresponding to a 4 by 4 matrix that corresponds to the geometric transformation between the frame attached to the object (in our case the tea box) and the frame attached to the camera. The pose is return as a vpHomogeneousMatrix container. +- a cad model that describes the object to track. In our case the file `teabox.cao` is the default one. See \ref mb_generic_model + section to learn how the teabox is modeled and section \ref mb_generic_advanced_cao to learn how to model an other object. +- a file with extension `*.init` that contains the 3D coordinates of some points used to compute an initial pose which serves to + initialize the tracker. The user has than to click in the image on the corresponding 2D points. The default file is named + `teabox.init`. The content of this file is detailed in \ref mb_generic_init_user section. +- an optional image with extension `*.ppm` that may help the user to remember the location of the corresponding 3D points specified + in `*.init` file. To know more about this file see \ref mb_generic_init_user section. + +As an output the tracker provides the pose \f$^c {\bf M}_o \f$ corresponding to a 4 by 4 matrix that corresponds to the geometric +transformation between the frame attached to the object (in our case the tea box) and the frame attached to the camera. The pose +is return as a vpHomogeneousMatrix container. \subsection mb_generic_started_src Example source code -The following example that comes from tutorial-mb-generic-tracker.cpp allows to track a tea box modeled in cao format using either moving edges of keypoints as visual features. +The following example that comes from tutorial-mb-generic-tracker.cpp allows to track a tea box modeled in cao format using either moving +edges of keypoints as visual features. \include tutorial-mb-generic-tracker.cpp -\note An extension of the previous getting started example is proposed in tutorial-mb-generic-tracker-full.cpp where advanced functionality such as reading tracker settings from an XML file or visibility computation are implemented. +\note An extension of the previous getting started example is proposed in tutorial-mb-generic-tracker-full.cpp where advanced functionality +such as reading tracker settings from an XML file or visibility computation are implemented. \subsection mb_generic_started_exe Running the example @@ -86,7 +115,8 @@ Once build, to see the options that are available in the previous source code, j $ ./tutorial-mb-generic-tracker --help Usage: ./tutorial-mb-generic-tracker [--video