-
Notifications
You must be signed in to change notification settings - Fork 286
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Documenting realsense usage, Numpy indexing
- Loading branch information
Showing
6 changed files
with
159 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
.. _Custom binding: | ||
|
||
|
||
Adding a custom function binding | ||
================================= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
.. _Python API guide: | ||
|
||
General ViSP + Python help | ||
Python specific features and help | ||
==================== | ||
|
||
.. toctree:: | ||
:glob: | ||
:maxdepth: 2 | ||
|
||
conversions.rst | ||
python_specific_fns.rst |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
Python specific functions | ||
============================== | ||
|
||
To either make code more pythonic or help improve performance, some functions and helpers have been defined. | ||
|
||
To add other custom functionalities :ref:`Custom binding` | ||
|
||
NumPy-like indexing | ||
--------------------- | ||
|
||
In Python ViSP data types now support numpy-like indexing, and methods like slicing and iterating on values | ||
|
||
To read values, rows and columns of a Matrix, you can use: | ||
|
||
.. testcode:: | ||
|
||
from visp.core import Matrix | ||
|
||
m = Matrix(2, 3, 1.0) | ||
print(m[0, 0]) | ||
print(m[0]) # First row | ||
print(m[:, 0]) # First column | ||
|
||
|
||
.. testoutput:: | ||
|
||
1.0 | ||
[1. 1. 1.] | ||
[1. 1.] | ||
|
||
|
||
|
||
|
||
Core module | ||
---------------------- | ||
|
||
* :py:class:`~visp.core.PixelMeterConversion` and :py:class:`~visp.core.MeterPixelConversion` | ||
both have a vectorised implementation of :code:`convertPoint`, called :code:`convertPoints`, accepting NumPy arrays | ||
* :py:class:`~visp.mbt.MbGenericTracker` as a reworked version of :py:meth:`visp.mbt.MbGenericTracker.track`, taking as inputs | ||
maps of color images and of numpy representations (of shape H x W x 3) of the point clouds. |