Skip to content

Commit

Permalink
Merge branch 'master' into module_rbt
Browse files Browse the repository at this point in the history
  • Loading branch information
fspindle committed Dec 5, 2024
2 parents f7c0ce8 + 40ff3a5 commit a7de02e
Show file tree
Hide file tree
Showing 206 changed files with 2,145 additions and 1,572 deletions.
8 changes: 4 additions & 4 deletions 3rdparty/clipper/clipper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4329,10 +4329,10 @@ double DistanceFromLineSqrd(
const IntPoint& pt, const IntPoint& ln1, const IntPoint& ln2)
{
//The equation of a line in general form (Ax + By + C = 0)
//given 2 points (x¹,y¹) & (x²,y²) is ...
//( - )x + ( - )y + ( - y¹)x¹ - ( - x¹)y¹ = 0
//A = ( - ); B = ( - ); C = ( - y¹)x¹ - ( - x¹)y¹
//perpendicular distance of point (x³,y³) = (Ax³ + By³ + C)/Sqrt(A² + B²)
//given 2 points (x1,y1) & (x1,y1) is ...
//(y1 - y1)x + (x1 - x1)y + (y1 - y1)x1 - (x1 - x1)y1 = 0
//A = (y1 - y1); B = (x2 - x1); C = (y2 - y1)x1 - (x2 - x1)y1
//perpendicular distance of point (x3,y3) = (Ax3 + By3 + C)/Sqrt(A*A + B*B)
//see http://en.wikipedia.org/wiki/Perpendicular_distance
double A = double(ln1.Y - ln2.Y);
double B = double(ln2.X - ln1.X);
Expand Down
3 changes: 2 additions & 1 deletion 3rdparty/simdlib/Simd/SimdBaseImageLoadPng.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1148,4 +1148,5 @@ namespace Simd
}
}
}
}
}

3 changes: 2 additions & 1 deletion 3rdparty/simdlib/Simd/SimdBaseImageSaveJpeg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -601,4 +601,5 @@ namespace Simd
return NULL;
}
}
}
}

3 changes: 2 additions & 1 deletion 3rdparty/simdlib/Simd/SimdBaseImageSavePng.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -376,4 +376,5 @@ namespace Simd
WriteCrc32(_stream, 0);
}
}
}
}

20 changes: 10 additions & 10 deletions 3rdparty/simdlib/Simd/SimdLib.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ typedef unsigned __int64 uint64_t;
typedef enum
{
SimdFalse = 0, /*!< False value. */
SimdTrue = 1, /*!< True value. */
SimdTrue = 1 /*!< True value. */
} SimdBool;

/*! @ingroup c_types
Expand All @@ -91,7 +91,7 @@ typedef enum
/*! equal to: a < b */
SimdCompareLesser,
/*! equal to: a <= b */
SimdCompareLesserOrEqual,
SimdCompareLesserOrEqual
} SimdCompareType;

/*! @ingroup c_types
Expand All @@ -111,7 +111,7 @@ typedef enum
SimdCpuInfoAvx512bw, /*!< Availability of AVX-512BW (x86). */
SimdCpuInfoVmx, /*!< Availability of VMX or Altivec (PowerPC). */
SimdCpuInfoVsx, /*!< Availability of VSX (PowerPC). */
SimdCpuInfoNeon, /*!< Availability of NEON (ARM). */
SimdCpuInfoNeon /*!< Availability of NEON (ARM). */
} SimdCpuInfoType;

/*! @ingroup c_types
Expand All @@ -132,7 +132,7 @@ typedef enum
/*! A PNG (Portable Network Graphics) image file format. */
SimdImageFilePng,
/*! A JPEG (Joint Photographic Experts Group) image file format. */
SimdImageFileJpeg,
SimdImageFileJpeg
} SimdImageFileType;

/*! @ingroup c_types
Expand All @@ -158,7 +158,7 @@ typedef enum
/*! Subtracts unsigned 8-bit integer b from unsigned 8-bit integer a (for every channel of every point of the images). */
SimdOperationBinary8uSubtraction,
/*! Adds unsigned 8-bit integer b from unsigned 8-bit integer a (for every channel of every point of the images). */
SimdOperationBinary8uAddition,
SimdOperationBinary8uAddition
} SimdOperationBinary8uType;

/*! @ingroup c_types
Expand Down Expand Up @@ -189,7 +189,7 @@ typedef enum
/*! A 24-bit (3 8-bit channels) RGB (Red, Green, Blue) pixel format. */
SimdPixelFormatRgb24,
/*! A 32-bit (4 8-bit channels) RGBA (Red, Green, Blue, Alpha) pixel format. */
SimdPixelFormatRgba32,
SimdPixelFormatRgba32
} SimdPixelFormatType;

/*! @ingroup c_types
Expand All @@ -200,7 +200,7 @@ enum SimdReduceType
SimdReduce2x2, /*!< Using of function ::SimdReduceGray2x2 for image reducing. */
SimdReduce3x3, /*!< Using of function ::SimdReduceGray3x3 for image reducing. */
SimdReduce4x4, /*!< Using of function ::SimdReduceGray4x4 for image reducing. */
SimdReduce5x5, /*!< Using of function ::SimdReduceGray5x5 for image reducing. */
SimdReduce5x5 /*!< Using of function ::SimdReduceGray5x5 for image reducing. */
};

/*! @ingroup resizing
Expand All @@ -213,7 +213,7 @@ typedef enum
/*! 16-bit integer channel type. */
SimdResizeChannelShort,
/*! 32-bit float channel type. */
SimdResizeChannelFloat,
SimdResizeChannelFloat
} SimdResizeChannelType;

/*! @ingroup resizing
Expand All @@ -236,7 +236,7 @@ typedef enum
/*! Area method. */
SimdResizeMethodArea,
/*! Area method for previously reduced in 2 times image. */
SimdResizeMethodAreaFast,
SimdResizeMethodAreaFast
} SimdResizeMethodType;

/*! @ingroup yuv_conversion
Expand All @@ -248,7 +248,7 @@ typedef enum
SimdYuvBt601, /*!< Corresponds to BT.601 standard. Uses Kr=0.299, Kb=0.114. Restricts Y to range [16..235], U and V to [16..240]. */
SimdYuvBt709, /*!< Corresponds to BT.709 standard. Uses Kr=0.2126, Kb=0.0722. Restricts Y to range [16..235], U and V to [16..240]. */
SimdYuvBt2020, /*!< Corresponds to BT.2020 standard. Uses Kr=0.2627, Kb=0.0593. Restricts Y to range [16..235], U and V to [16..240]. */
SimdYuvTrect871, /*!< Corresponds to T-REC-T.871 standard. Uses Kr=0.299, Kb=0.114. Y, U and V use full range [0..255]. */
SimdYuvTrect871 /*!< Corresponds to T-REC-T.871 standard. Uses Kr=0.299, Kb=0.114. Y, U and V use full range [0..255]. */
} SimdYuvType;

// ViSP custom SIMD code
Expand Down
4 changes: 2 additions & 2 deletions 3rdparty/simdlib/Simd/SimdMath.h
Original file line number Diff line number Diff line change
Expand Up @@ -953,7 +953,7 @@ namespace Simd
vst1q_f32(_a, a);
float r[4] = { 1.0f / _a[0], 1.0f / _a[1], 1.0f / _a[2], 1.0f / _a[3] };
return vld1q_f32(r);
};
}

template<> SIMD_INLINE float32x4_t Reciprocal<0>(const float32x4_t & a)
{
Expand Down Expand Up @@ -985,7 +985,7 @@ namespace Simd
vst1q_f32(_b, b);
float c[4] = { _a[0] / _b[0], _a[1] / _b[1], _a[2] / _b[2], _a[3] / _b[3] };
return vld1q_f32(c);
};
}

template <int iter> SIMD_INLINE float32x4_t ReciprocalSqrt(const float32x4_t & a);

Expand Down
2 changes: 1 addition & 1 deletion 3rdparty/stb_image/stb_image_write.h
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,7 @@ static int stbi_write_hdr_core(stbi__write_context *s, int x, int y, int comp, f
#ifdef __STDC_LIB_EXT1__
len = sprintf_s(buffer, sizeof(buffer), "EXPOSURE= 1.0000000000000\n\n-Y %d +X %d\n", y, x);
#else
len = sprintf(buffer, "EXPOSURE= 1.0000000000000\n\n-Y %d +X %d\n", y, x);
len = snprintf(buffer, sizeof(buffer), "EXPOSURE= 1.0000000000000\n\n-Y %d +X %d\n", y, x);
#endif
s->func(s->context, buffer, len);

Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -78,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.5) # needs to be before project() for policy CMP0025
cmake_minimum_required(VERSION 3.10) # 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)
Expand Down
2 changes: 1 addition & 1 deletion apps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#
#############################################################################

cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.10)

project(ViSP-apps)

Expand Down
2 changes: 1 addition & 1 deletion apps/calibration/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
project(apps-calibration)

cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.10)

find_package(VISP REQUIRED visp_vision visp_io OPTIONAL_COMPONENTS visp_gui visp_robot visp_sensor)

Expand Down
2 changes: 1 addition & 1 deletion cmake/VISPGenerateConfigScript.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ set(TARGET_LOCATION_${item} \"${item}${VISP_VERSION_MAJOR}${VISP_VERSION_MINOR}$
# =============================================================================
else() # DEFINED CMAKE_HELPER_SCRIPT

cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.10)
include("${CMAKE_HELPER_SCRIPT}")
include("${VISP_SOURCE_DIR}/cmake/VISPUtils.cmake")

Expand Down
2 changes: 1 addition & 1 deletion demo/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#
#############################################################################

cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.10)

project(ViSP-demo)

Expand Down
2 changes: 1 addition & 1 deletion demo/wireframe-simulator/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#
#############################################################################

cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.10)

project(demo-wireframe-simulator)

Expand Down
2 changes: 1 addition & 1 deletion doc/tutorial/bridge/matlab/tutorial-visp-matlab.dox
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ In order to build a source code that mix ViSP and MATLAB you should first create
find ViSP and MATLAB. In the following example we consider the case of the tutorial-matlab.cpp source file.

\code
cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.10)

project(visp-matlab)

Expand Down
13 changes: 7 additions & 6 deletions doc/tutorial/detection_dnn/tutorial-detection-dnn.dox
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ 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
<a href="https://docs.opencv.org/master/d6/d0f/group__dnn.html">OpenCV DNN API</a>.

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.
This class supports `Faster-RCNN`, `SSD-MobileNet`, `ResNet 10`, `Yolo v3`, `Yolo v4`, `Yolo v5`, `Yolo v7`,
`Yolo v8` and `Yolo v11` 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.

Expand Down Expand Up @@ -74,13 +74,13 @@ $ sudo apt install libgtk-3-dev \
libx11-dev
\endcode

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.
6. Get the sources. The \b vpDetectorDNNOpenCV has been tested with **OpenCV 4.7** and **OpenCV 4.10**. First,
get the OpenCV_contrib sources, that contain the Cuda DNN module.
On a Debian distribution, you would run:
\code{.sh}
$ 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
$ git clone --branch 4.10.0 https://github.com/opencv/opencv_contrib
$ git clone --branch 4.10.0 https://github.com/opencv/opencv
\endcode

7. Compile OpenCV and install it from source. On a Debian distribution, you would run:
Expand Down Expand Up @@ -149,6 +149,7 @@ on DNN models learned from the following networks:
- Yolo v5
- Yolo v7
- Yolo v8
- Yolo v11

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.
Expand Down
4 changes: 2 additions & 2 deletions doc/tutorial/developper/tutorial-add-new-dependency.dox
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ $ more CMakeLists.txt
\code
project(example-dummy)

cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.10)

find_package(VISP REQUIRED visp_core visp_robot)

Expand Down Expand Up @@ -409,7 +409,7 @@ $ cd $VISP_WS/my-project
$ more CMakeLists.txt
\endcode
\code
cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.10)

project(example-dummy)

Expand Down
86 changes: 79 additions & 7 deletions doc/tutorial/python/tutorial-install-python-bindings.dox
Original file line number Diff line number Diff line change
Expand Up @@ -115,19 +115,19 @@ We strongly recommend using Conda to build ViSP Python bindings. Below are instr

- **A. On macOS**:

(visp-conda-ws) $ conda install cmake xorg-libx11 xorg-libxfixes libxml2 libdc1394 >=2.2.6 librealsense libopencv eigen libjpeg-turbo libpng libopenblas llvm-openmp pybind11
(visp-conda-ws) $ conda install cmake cxx-compiler make pkg-config xorg-libx11 xorg-libxfixes libxml2 libdc1394 librealsense libopencv eigen libjpeg-turbo libpng libopenblas llvm-openmp pybind11

- **B. On Ubuntu or other linux-like**:

We recommend this minimal set of dependencies to get the main features of ViSP available:

(visp-conda-ws) $ conda install cmake xorg-libx11 xorg-libxfixes libxml2 libdc1394 >=2.2.6 librealsense libgomp libopencv eigen libjpeg-turbo libpng mkl-devel pybind11
(visp-conda-ws) $ conda install cmake cxx-compiler make pkg-config xorg-libx11 xorg-libxfixes libxml2 libdc1394 librealsense libgomp libopencv eigen libjpeg-turbo libpng mkl-devel pybind11

- **C. On Windows**:

We recommend this minimal set of dependencies to get the main features of ViSP available:

(visp-conda-ws) C:\Users\User> conda install cmake llvm-openmp openmp libopencv eigen libjpeg-turbo libpng mkl-devel pybind11
(visp-conda-ws) C:\Users\User> conda install cmake cxx-compiler llvm-openmp openmp libopencv eigen libjpeg-turbo libpng mkl-devel pybind11

\note In the previous installation commands you can also specify the Python version if desired adding
for example `python=3.10` to the previous command lines.
Expand Down Expand Up @@ -551,17 +551,89 @@ to uninstall Miniforge:
and
# <<< conda initialize <<<

\section py_bindings_known_errors Known build errors
\section py_bindings_known_errors Known issues

When compiling or modifying the bindings, you may encounter errors.
When configuring with CMake, compiling or modifying the bindings, you may encounter errors.

Here is a non-exhaustive list of errors.
Here is a non-exhaustive list of warnings and errors.

If you encounter a compilation error, make sure to first try rebuilding after cleaning the CMake cache.
Pybind did generate problems (an error at the pybind include line) that were solved like this.

\subsection py_bindings_known_errors_buil When building ViSP
\subsection py_bindings_known_warnings When configuring ViSP
\subsubsection py_bindings_known_warnings_safe-rpath CMake Warning: Cannot generate a safe runtime search path

When building Python bindings using Conda as described in section \ref py_bindings_build_conda, you may encounter
the following CMake warning:
\code{.sh}
CMake Warning at cmake/VISPUtils.cmake:813 (add_library):
Cannot generate a safe runtime search path for target visp_ar because files
in some directories may conflict with libraries in implicit directories:

runtime library [libm.so.6] in $HOME/miniforge3/envs/visp-conda-ws/x86_64-conda-linux-gnu/sysroot/usr/lib may be hidden by files in:
/usr/lib/x86_64-linux-gnu
runtime library [libxml2.so.2] in $HOME/miniforge3/envs/visp-conda-ws/lib may be hidden by files in:
/usr/lib/x86_64-linux-gnu
runtime library [libz.so.1] in $HOME/miniforge3/envs/visp-conda-ws/lib may be hidden by files in:
/usr/lib/x86_64-linux-gnu
runtime library [libgomp.so.1] in $HOME/miniforge3/envs/visp-conda-ws/lib may be hidden by files in:
/usr/lib/x86_64-linux-gnu

Some of these libraries may not be found correctly.
Call Stack (most recent call first):
cmake/VISPModule.cmake:806 (vp_add_library)
cmake/VISPModule.cmake:798 (_vp_create_module)
modules/ar/CMakeLists.txt:193 (vp_create_module)
\endcode

It means that the project requests linking with the shared libraries (`libxml2.so`, `libz.so` and
`libgomp.so`), which are contained in two directories `$HOME/miniforge3/envs/visp-conda-ws/lib` and `/usr/lib/x86_64-linux-gnu`.
The same occurs for `libm.so` that is present in
`$HOME/miniforge3/envs/visp-conda-ws/x86_64-conda-linux-gnu/sysroot/usr/lib` and in `/usr/lib/x86_64-linux-gnu`.

CMake first searches for the 3rd parties in the Conda environment, and if they are not found, it extends
the search path to try to find them in the system path as `/usr/`. As a result, CMake cannot guarantee that, when you run
the executable, the loader will find the proper library.

If you don't fix these warnings, the behavior of the project could be affected.

The way to proceed is to analyse the `ViSP-third-party.txt` file which summarises the third parties found and
identify those you haven't installed in the Conda environment with `conda install <3rdparty>`.
An other solution is to call `cmake` with `--debug-find` command line option that will explicitly show the search
path for the 3rd parties:
\code{.sh}
(visp-conda-ws) $ cmake ../visp -DCMAKE_PREFIX_PATH=$CONDA_PREFIX -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX --debug-find
\endcode

In our case, we produced the CMake warning mentioned before by installing Panda3D and Ogre as system libraries.

The solution is to deactivate the use of these two third parties as long as they are not needed, or simply to check
that by not using them the CMake warnings disappear. After cleaning the `visp-build` folder you may run:
\code{.sh}
(visp-conda-ws) $ cmake ../visp -DCMAKE_PREFIX_PATH=$CONDA_PREFIX -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -DUSE_OGRE=OFF -DUSE_PANDA3D=OFF
\endcode

Once confirmed that the warnings were due to the disabled 3rd parties, if they exist you can try installing them in
the conda environment.

For example:
- for Panda3d:
\code{.sh}
$ conda create --name visp-conda-ws python=3.12
$ conda activate visp-conda-ws
(visp-conda-ws) $ conda install panda3d
\endcode
- for Ogre
\code{.sh}
(visp-conda-ws) $ conda install ogre
\endcode
- before running CMake and helping CMake to find Panda3d headers
\code{.sh}
(visp-conda-ws) $ export Panda3D_DIR=$CONDA_PREFIX/share/panda3d
(visp-conda-ws) $ cmake ../visp -DCMAKE_PREFIX_PATH=$CONDA_PREFIX -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX
\endcode

\subsection py_bindings_known_errors_build When building ViSP
\subsubsection py_bindings_known_errors_build_x11 Cannot build vpDisplayX.cpp

The following error may occur on macOS during a build
Expand Down
1 change: 1 addition & 0 deletions doc/tutorial/rendering/tutorial-panda3d.dox
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ vpPanda3DBaseRenderer, which implements basic functions for a panda renderer.

- Hereafter you will find the instructions to build and install Panda3D from source on Ubuntu 22.04
\code{.sh}
$ sudo apt install python3-pip
$ mkdir -p $VISP_WS/3rdparty/panda3d
$ cd $VISP_WS/3rdparty/panda3d
$ git clone https://github.com/panda3d/panda3d
Expand Down
Loading

0 comments on commit a7de02e

Please sign in to comment.