diff --git a/modules/core/include/visp3/core/vpArray2D.h b/modules/core/include/visp3/core/vpArray2D.h index 98192e58d3..0d15edd28d 100644 --- a/modules/core/include/visp3/core/vpArray2D.h +++ b/modules/core/include/visp3/core/vpArray2D.h @@ -823,7 +823,7 @@ template class vpArray2D \code vpArray2D M(3,4); vpArray2D::saveYAML("matrix.yml", M, "example: a YAML-formatted header"); - vpArray2D::saveYAML("matrixIndent.yml", M, "example:\n - a YAML-formatted + vpArray2D::saveYAML("matrixIndent.yml", M, "example:\n - a YAML-formatted \ header\n - with inner indentation"); \endcode Content of matrix.yml: \code example: a YAML-formatted header diff --git a/modules/gui/include/visp3/gui/vpPlot.h b/modules/gui/include/visp3/gui/vpPlot.h index ffd1dbb128..2943e37869 100644 --- a/modules/gui/include/visp3/gui/vpPlot.h +++ b/modules/gui/include/visp3/gui/vpPlot.h @@ -101,7 +101,7 @@ * } * * return 0; - $ #endif + * #endif * } * \endcode */ diff --git a/modules/python/doc/CMakeLists.txt b/modules/python/doc/CMakeLists.txt index ddb5eeafbd..617632448a 100644 --- a/modules/python/doc/CMakeLists.txt +++ b/modules/python/doc/CMakeLists.txt @@ -52,6 +52,7 @@ configure_file( "${BINARY_BUILD_DIR}/conf.py" @ONLY) + foreach(module ${python_bound_modules}) # start string with 2 spaces since its included in autosummary string(REPLACE "visp_" " visp." python_module_name ${module}) @@ -66,6 +67,7 @@ configure_file( add_custom_target(visp_python_bindings_doc COMMAND ${PYTHON3_EXECUTABLE} -m pip install -r "${CMAKE_CURRENT_SOURCE_DIR}/requirements.txt" + COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMAKE_CURRENT_SOURCE_DIR}/_static" "${BINARY_BUILD_DIR}/_static" COMMAND sphinx-build -b html -c "${BINARY_BUILD_DIR}" diff --git a/modules/python/doc/_static/visp_icon_white.png b/modules/python/doc/_static/visp_icon_white.png new file mode 100644 index 0000000000..2611203027 Binary files /dev/null and b/modules/python/doc/_static/visp_icon_white.png differ diff --git a/modules/python/doc/conf.py.in b/modules/python/doc/conf.py.in index 9094ea25c6..89a67434ee 100644 --- a/modules/python/doc/conf.py.in +++ b/modules/python/doc/conf.py.in @@ -285,8 +285,8 @@ latex_elements = { #'figure_align': 'htbp', } -html_logo = 'visp_icon.png' -html_favicon = 'visp_icon.png' +html_logo = '_static/visp_icon_white.png' +html_favicon = '_static/visp_icon.png' # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, @@ -397,7 +397,7 @@ autodoc_excludes = [ '__weakref__', '__doc__', '__module__', '__dict__', '__dir__', '__delattr__', '__format__', '__init_subclass__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', -'__sizeof__', '__str__', '__subclasshook__', '__getattribute__' +'__sizeof__', '__str__', '__subclasshook__', '__getattribute__', '__entries', ] def autodoc_skip_member(app, what, name, obj, skip, options): # Ref: https://stackoverflow.com/a/21449475/ diff --git a/modules/python/doc/conversions.rst b/modules/python/doc/conversions.rst index 82829afc3f..33e393707a 100644 --- a/modules/python/doc/conversions.rst +++ b/modules/python/doc/conversions.rst @@ -19,26 +19,24 @@ ViSP provides multiple types to manipulate mathematical objects, such as: While these representations should allow you to work with all the ViSP functions, they are a foreign concept to all the other Python libraries. -For most scientific computing libraries, the standard data representation is based on`NumPy `_. +For most scientific computing libraries, the standard data representation is based on `NumPy `_. Since most libraries will accept and manipulate these arrays, ViSP provides conversion functions. To reinterpret a supported ViSP object as a Numpy array, use either: -.. testcode:: +.. doctest:: - from visp.core import ColVector - import numpy as np + >>> from visp.core import ColVector + >>> import numpy as np - list_representation = [i for i in range(3)] - vec = ColVector(list_representation) # Initialize a 3 vector from a list - np_vec = vec.numpy() # A 1D numpy array of size 3 + >>> list_representation = [i for i in range(3)] + >>> vec = ColVector(list_representation) # Initialize a 3 vector from a list + >>> np_vec = vec.numpy() # A 1D numpy array of size 3 - print(np.all(np_vec == list_representation)) + >>> np.all(np_vec == list_representation) + True -.. testoutput:: - - True diff --git a/modules/tracker/mbt/src/vpMbGenericTracker.cpp b/modules/tracker/mbt/src/vpMbGenericTracker.cpp index c4004b7c04..f15d2e2b03 100644 --- a/modules/tracker/mbt/src/vpMbGenericTracker.cpp +++ b/modules/tracker/mbt/src/vpMbGenericTracker.cpp @@ -1848,13 +1848,13 @@ void vpMbGenericTracker::initCircle(const vpPoint & /*p1*/, const vpPoint & /*p2 The structure of this file is the following: - \code + \verbatim # 3D point coordinates 4 # Number of points in the file (minimum is four) 0.01 0.01 0.01 # \ ... # | 3D coordinates in the object frame (X, Y, Z) 0.01 -0.01 -0.01 # / - \endcode + \endverbatim \param I1 : Input grayscale image for the first camera. \param I2 : Input grayscale image for the second camera. @@ -1918,13 +1918,13 @@ void vpMbGenericTracker::initClick(const vpImage &I1, const vpIma The structure of this file is the following: - \code + \verbatim # 3D point coordinates 4 # Number of points in the file (minimum is four) 0.01 0.01 0.01 # \ ... # | 3D coordinates in the object frame (X, Y, Z) 0.01 -0.01 -0.01 # / - \endcode + \endverbatim \param I_color1 : Input color image for the first camera. \param I_color2 : Input color image for the second camera. @@ -1988,13 +1988,13 @@ void vpMbGenericTracker::initClick(const vpImage &I_color1, const vpImag The structure of this file is the following: - \code + \verbatim # 3D point coordinates 4 # Number of points in the file (minimum is four) 0.01 0.01 0.01 # \ ... # | 3D coordinates in the object frame (X, Y, Z) 0.01 -0.01 -0.01 # / - \endcode + \endverbatim The cameras that have not an init file will be automatically initialized but the camera transformation matrices have to be set before. @@ -2093,13 +2093,13 @@ void vpMbGenericTracker::initClick(const std::map &I1, const with X, Y and Z values. 2D point coordinates are expressied in pixel coordinates, with first the line and then the column of the pixel in the image. The structure of this file is the following. - \code + \verbatim # 3D point coordinates 4 # Number of 3D points in the file (minimum is four) 0.01 0.01 0.01 # \ @@ -2285,7 +2285,7 @@ void vpMbGenericTracker::initFromPoints(const vpImage &I1, const 100 200 # \ ... # | 2D coordinates in pixel in the image 50 10 # / - \endcode + \endverbatim \param I_color1 : Input color image for the first camera. \param I_color2 : Input color image for the second camera. diff --git a/modules/tracker/mbt/src/vpMbTracker.cpp b/modules/tracker/mbt/src/vpMbTracker.cpp index 45a27cd8f4..aef55b010c 100644 --- a/modules/tracker/mbt/src/vpMbTracker.cpp +++ b/modules/tracker/mbt/src/vpMbTracker.cpp @@ -570,13 +570,13 @@ void vpMbTracker::initClick(const vpImage *const I, const vpImage The structure of this file is the following: - \code + \verbatim # 3D point coordinates 4 # Number of points in the file (minimum is four) 0.01 0.01 0.01 # \ ... # | 3D coordinates in the object frame (X, Y, Z) 0.01 -0.01 -0.01 # / - \endcode + \endverbatim \param I : Input grayscale image where the user has to click. \param initFile : File containing the coordinates of at least 4 3D points @@ -607,13 +607,13 @@ void vpMbTracker::initClick(const vpImage &I, const std::string & The structure of this file is the following: - \code + \verbatim # 3D point coordinates 4 # Number of points in the file (minimum is four) 0.01 0.01 0.01 # \ ... # | 3D coordinates in the object frame (X, Y, Z) 0.01 -0.01 -0.01 # / - \endcode + \endverbatim \param I_color : Input color image where the user has to click. \param initFile : File containing the coordinates of at least 4 3D points @@ -965,7 +965,7 @@ void vpMbTracker::initFromPoints(const vpImage *const I, const vp with X, Y and Z values. 2D point coordinates are expressied in pixel coordinates, with first the line and then the column of the pixel in the image. The structure of this file is the following. - \code + \verbatim # 3D point coordinates 4 # Number of 3D points in the file (minimum is four) 0.01 0.01 0.01 # \ @@ -977,7 +977,7 @@ void vpMbTracker::initFromPoints(const vpImage *const I, const vp 100 200 # \ ... # | 2D coordinates in pixel in the image 50 10 # / - \endcode + \endverbatim \param I : Input grayscale image \param initFile : Path to the file containing all the points. @@ -994,7 +994,7 @@ void vpMbTracker::initFromPoints(const vpImage &I, const std::str with X, Y and Z values. 2D point coordinates are expressied in pixel coordinates, with first the line and then the column of the pixel in the image. The structure of this file is the following. - \code + \verbatim # 3D point coordinates 4 # Number of 3D points in the file (minimum is four) 0.01 0.01 0.01 # \ @@ -1006,7 +1006,7 @@ void vpMbTracker::initFromPoints(const vpImage &I, const std::str 100 200 # \ ... # | 2D coordinates in pixel in the image 50 10 # / - \endcode + \endverbatim \param I_color : Input color image \param initFile : Path to the file containing all the points.