Skip to content

Commit

Permalink
fix some doc warnings, icon, and doctest
Browse files Browse the repository at this point in the history
  • Loading branch information
SamFlt committed Dec 6, 2023
1 parent 0cf45b6 commit 823e01d
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 36 deletions.
2 changes: 1 addition & 1 deletion modules/core/include/visp3/core/vpArray2D.h
Original file line number Diff line number Diff line change
Expand Up @@ -823,7 +823,7 @@ template <class Type> class vpArray2D
\code
vpArray2D<double> 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
Expand Down
2 changes: 1 addition & 1 deletion modules/gui/include/visp3/gui/vpPlot.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
* }
*
* return 0;
$ #endif
* #endif
* }
* \endcode
*/
Expand Down
2 changes: 2 additions & 0 deletions modules/python/doc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand All @@ -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}"
Expand Down
Binary file added modules/python/doc/_static/visp_icon_white.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions modules/python/doc/conf.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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/
Expand Down
20 changes: 9 additions & 11 deletions modules/python/doc/conversions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://numpy.org/>`_.
For most scientific computing libraries, the standard data representation is based on `NumPy <https://numpy.org/>`_.
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



Expand Down
24 changes: 12 additions & 12 deletions modules/tracker/mbt/src/vpMbGenericTracker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -1918,13 +1918,13 @@ void vpMbGenericTracker::initClick(const vpImage<unsigned char> &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.
Expand Down Expand Up @@ -1988,13 +1988,13 @@ void vpMbGenericTracker::initClick(const vpImage<vpRGBa> &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.
Expand Down Expand Up @@ -2093,13 +2093,13 @@ void vpMbGenericTracker::initClick(const std::map<std::string, const vpImage<uns
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.
Expand Down Expand Up @@ -2213,7 +2213,7 @@ void vpMbGenericTracker::initFaceFromLines(vpMbtPolygon & /*polygon*/)
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 # \
Expand All @@ -2224,7 +2224,7 @@ void vpMbGenericTracker::initFaceFromLines(vpMbtPolygon & /*polygon*/)
100 200 # \
... # | 2D coordinates in pixel in the image
50 10 # /
\endcode
\endverbatim
\param I1 : Input grayscale image for the first camera.
\param I2 : Input grayscale image for the second camera.
Expand Down Expand Up @@ -2274,7 +2274,7 @@ void vpMbGenericTracker::initFromPoints(const vpImage<unsigned char> &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 # \
Expand All @@ -2285,7 +2285,7 @@ void vpMbGenericTracker::initFromPoints(const vpImage<unsigned char> &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.
Expand Down
16 changes: 8 additions & 8 deletions modules/tracker/mbt/src/vpMbTracker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -570,13 +570,13 @@ void vpMbTracker::initClick(const vpImage<unsigned char> *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
Expand Down Expand Up @@ -607,13 +607,13 @@ void vpMbTracker::initClick(const vpImage<unsigned char> &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
Expand Down Expand Up @@ -965,7 +965,7 @@ void vpMbTracker::initFromPoints(const vpImage<unsigned char> *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 # \
Expand All @@ -977,7 +977,7 @@ void vpMbTracker::initFromPoints(const vpImage<unsigned char> *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.
Expand All @@ -994,7 +994,7 @@ void vpMbTracker::initFromPoints(const vpImage<unsigned char> &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 # \
Expand All @@ -1006,7 +1006,7 @@ void vpMbTracker::initFromPoints(const vpImage<unsigned char> &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.
Expand Down

0 comments on commit 823e01d

Please sign in to comment.