From b16e9bb42f00f84af9d38b9f940097b3dbd716da Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Wed, 16 Aug 2023 14:24:41 +0200 Subject: [PATCH 001/169] Starting work on python module: iterating on submodules, parsing but no output --- modules/python/.gitignore | 4 + modules/python/__init__.py | 0 modules/python/config/core.json | 3 + modules/python/config/vs.json | 3 + modules/python/generator/__init__.py | 0 modules/python/generator/generator.py | 121 ++++++++++++++++++++++++++ modules/python/pyproject.toml | 28 ++++++ modules/python/setup.py | 76 ++++++++++++++++ 8 files changed, 235 insertions(+) create mode 100644 modules/python/.gitignore create mode 100644 modules/python/__init__.py create mode 100644 modules/python/config/core.json create mode 100644 modules/python/config/vs.json create mode 100644 modules/python/generator/__init__.py create mode 100644 modules/python/generator/generator.py create mode 100644 modules/python/pyproject.toml create mode 100644 modules/python/setup.py diff --git a/modules/python/.gitignore b/modules/python/.gitignore new file mode 100644 index 0000000000..b3b7e54472 --- /dev/null +++ b/modules/python/.gitignore @@ -0,0 +1,4 @@ +*.egg-info +src/generated +src/main.cpp +build \ No newline at end of file diff --git a/modules/python/__init__.py b/modules/python/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/modules/python/config/core.json b/modules/python/config/core.json new file mode 100644 index 0000000000..9a0f88ce20 --- /dev/null +++ b/modules/python/config/core.json @@ -0,0 +1,3 @@ +{ + "ignored_headers": ["vpGEMM.h"] +} \ No newline at end of file diff --git a/modules/python/config/vs.json b/modules/python/config/vs.json new file mode 100644 index 0000000000..a9c3a625e2 --- /dev/null +++ b/modules/python/config/vs.json @@ -0,0 +1,3 @@ +{ + "ignored_headers": [] +} \ No newline at end of file diff --git a/modules/python/generator/__init__.py b/modules/python/generator/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/modules/python/generator/generator.py b/modules/python/generator/generator.py new file mode 100644 index 0000000000..987156c4d7 --- /dev/null +++ b/modules/python/generator/generator.py @@ -0,0 +1,121 @@ +from typing import List, Tuple +from cxxheaderparser.parserstate import ClassBlockState +import pcpp +import cxxheaderparser +from cxxheaderparser.visitor import CxxVisitor +from cxxheaderparser.parser import CxxParser +from pathlib import Path +import json +class Visitor(CxxVisitor): + def __init__(self): + self.result = '' + def on_class_start(self, state: ClassBlockState) -> None: + print(state.class_decl.typename) + +class Submodule(): + def __init__(self, name: str, include_path: Path, submodule_file_path: Path): + self.name = name + self.include_path = include_path + self.submodule_file_path = submodule_file_path + self.config_path = Path('config') / (name + '.json') + with open(self.config_path, 'r') as config_file: + self.config = json.load(config_file) + + assert self.include_path.exists(), f'Submodule path {self.include_path} not found' + + def generate(self) -> None: + + for include_file in self.include_path.iterdir(): + if not include_file.name.endswith('.h') and not include_file.name.endswith('.hpp'): + continue + if include_file.name in self.config['ignored_headers']: + continue + header = HeaderFile(include_file, self) + body = f'py::module_ submodule = m.def_submodule("{self.name}");' + format_str = f''' +#include +namespace py = pybind11; +void {self.generation_function_name()}(py::module_ &m) {{ + {body} +}} +''' + with open(self.submodule_file_path, 'w') as submodule_file: + submodule_file.write(format_str) + + def generation_function_name(self) -> str: + return f'init_submodule_{self.name}' + + + +def get_submodules(include_path: Path, generate_path: Path) -> List[Submodule]: + return [ + Submodule('core', include_path / 'core', generate_path / 'core.cpp'), + Submodule('vs', include_path / 'vs', generate_path / 'vs.cpp') + + ] + +class HeaderFile(): + def __init__(self, path: Path, submodule: Submodule): + self.path = path + self.submodule = submodule + content = self.run_preprocessor() + self.generate_binding_code(content) + def run_preprocessor(self): + tmp_file_path = self.submodule.submodule_file_path.parent / "tmp" / self.path.name + argv = [ + '', + '-D', 'VISP_EXPORT=""', + '-D', 'visp_deprecated=""', + '-I', '/usr/local/include', + '--passthru-includes', "^((?!vpConfig.h).)*$", + '-o', f'{tmp_file_path}', + str(self.path.absolute()) + ] + pcpp.CmdPreprocessor(argv) + preprocessed_header_content = None + with open(tmp_file_path, 'r') as header_file: + preprocessed_header_content = '\n'.join(header_file.readlines()) + return preprocessed_header_content + def generate_binding_code(self, content: str) -> str: + visitor = Visitor() + parser = CxxParser(None, content, visitor) + parser.parse() + + + + +def generate_module(generate_path: Path) -> None: + main_path = generate_path / 'main.cpp' + include_path = Path('/usr/local/include/visp3') + submodules: List[Submodule] = get_submodules(include_path, generate_path / 'generated') + for submodule in submodules: + submodule.generate() + + with open(main_path, 'w') as main_file: + submodule_fn_declarations = [] + submodule_fn_calls = [] + for submodule in submodules: + name = submodule.generation_function_name() + submodule_fn_declarations.append(f'void {name}(py::module_&);') + submodule_fn_calls.append(f'{name}(m);') + + submodule_fn_declarations = '\n'.join(submodule_fn_declarations) + submodule_fn_calls = '\n'.join(submodule_fn_calls) + + format_str = f''' +#include +namespace py = pybind11; +{submodule_fn_declarations} + +PYBIND11_MODULE(visp, m) +{{ + m.doc() = "ViSP Python binding"; + + {submodule_fn_calls} +}} +''' + main_file.write(format_str) + +if __name__ == '__main__': + import sys + generate_module(Path('src')) \ No newline at end of file diff --git a/modules/python/pyproject.toml b/modules/python/pyproject.toml new file mode 100644 index 0000000000..d0c181748e --- /dev/null +++ b/modules/python/pyproject.toml @@ -0,0 +1,28 @@ +[build-system] +requires = [ + "setuptools>=42", + "pybind11>=2.10.0", + "pcpp", + "cxxheaderparser@git+https://github.com/robotpy/cxxheaderparser#egg=master" +] +build-backend = "setuptools.build_meta" + +[tool.cibuildwheel] +test-command = "python {project}/tests/test.py" + +[tool.ruff] +extend-select = [ + "B", # flake8-bugbear + "I", # isort + "PGH", # pygrep-hooks + "RUF", # Ruff-specific + "UP", # pyupgrade +] +extend-ignore = [ + "E501", # Line too long +] +target-version = "py39" +dependencies = [ + "pcpp", + "cxxheaderparser@git+https://github.com/robotpy/cxxheaderparser#egg=master" +] \ No newline at end of file diff --git a/modules/python/setup.py b/modules/python/setup.py new file mode 100644 index 0000000000..b575ec6d44 --- /dev/null +++ b/modules/python/setup.py @@ -0,0 +1,76 @@ +# Available at setup time due to pyproject.toml +from pybind11.setup_helpers import Pybind11Extension, build_ext +from distutils.cmd import Command +from setuptools import setup +from setuptools.command.install import install +from distutils.command import build as build_module +from pathlib import Path +import sys +import subprocess +from glob import glob +__version__ = "0.0.1" + +class build(build_module.build): + def run(self): + import os + print('Generating binding code...') + output = subprocess.run('python generator/generator.py', env=os.environ, shell=True, capture_output=True, check=True) + print(output.stdout) + build_module.build.run(self) +# The main interface is through Pybind11Extension. +# * You can add cxx_std=11/14/17, and then build_ext can be removed. +# * You can set include_pybind11=false to add the include directory yourself, +# say from a submodule. +# +# Note: +# Sort input source files if you glob sources to ensure bit-for-bit +# reproducible builds (https://github.com/pybind/python_example/pull/53) +# class GenerateBindings(Command): +# description = 'generate Pybind11 binding' +# user_options = [] +# def initialize_options(self): +# """Use this to set option defaults before parsing.""" +# pass + +# def finalize_options(self): +# """Code to validate/modify command-line/config input goes here.""" +# pass +# def run(self): +# import os +# print('Generating binding code...') +# output = subprocess.run('python generator/generator.py', env=os.environ, shell=True, capture_output=True, check=True) +# print(output.stdout) + +# class InstallCommand(install): +# user_options = install.user_options +# def run(self): +# self.run_command('generate_bindings') +# install.run(self) +# #self.run_command('delete_fixed_json') + +ext_modules = [ + Pybind11Extension("visp", + ["src/main.cpp", *sorted(glob("src/generated/*.cpp")), *sorted(glob("src/src/*.cpp"))], + # Example: passing in the version to the compiled code + define_macros = [('VERSION_INFO', __version__)], + ), +] +setup( + name="visp", + version=__version__, + author="Samuel Felton", + author_email="samuel.felton@irisa.fr", + url="https://github.com/lagadic/visp", + description="Python wrapper for the Visual Servoing Platform (ViSP) framework", + long_description="", + ext_modules=ext_modules, + extras_require={"test": "pytest"}, + setup_requires=[ + "pcpp", + "cxxheaderparser@git+https://github.com/robotpy/cxxheaderparser#egg=master" + ], + cmdclass={"build_ext": build_ext, + 'build': build}, + zip_safe=False, + python_requires=">=3.9", +) \ No newline at end of file From a5f2eb268d13c13a196c39144e23e56c819bfe93 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Fri, 18 Aug 2023 12:57:03 +0200 Subject: [PATCH 002/169] more work: class defs, trying to use cmake --- modules/python/CMakeLists.txt | 7 +++ modules/python/common.cmake | 17 ++++++++ modules/python/generator/generator.py | 63 ++++++++++++++++++++++++--- 3 files changed, 82 insertions(+), 5 deletions(-) create mode 100644 modules/python/CMakeLists.txt create mode 100644 modules/python/common.cmake diff --git a/modules/python/CMakeLists.txt b/modules/python/CMakeLists.txt new file mode 100644 index 0000000000..3f61626672 --- /dev/null +++ b/modules/python/CMakeLists.txt @@ -0,0 +1,7 @@ +vp_add_module(python visp_core OPTIONAL visp_sensor visp_vs) +include(${CMAKE_CURRENT_SOURCE_DIR}/common.cmake) +get_property(dirs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES) +foreach(dir ${dirs}) + message(STATUS "dir='${dir}'") +endforeach() +vp_create_module() diff --git a/modules/python/common.cmake b/modules/python/common.cmake new file mode 100644 index 0000000000..8214f43add --- /dev/null +++ b/modules/python/common.cmake @@ -0,0 +1,17 @@ +if(ANDROID) + vp_update(VISP_JAVA_LIB_NAME_SUFFIX "${VISP_VERSION_MAJOR}") + vp_update(JAVA_INSTALL_ROOT "sdk/java") +else() + vp_update(VISP_JAVA_LIB_NAME_SUFFIX "${VISP_VERSION_MAJOR}${VISP_VERSION_MINOR}${VISP_VERSION_PATCH}") +endif() + +# set the list of modules to wrap. +# To add Java Wrapper for a module, find and change the line given below in /CMakeLists.txt: +# vp_add_module( ....) --> vp_add_module( .... WRAP java) +set(VISP_JAVA_MODULES) +foreach(m ${VISP_MODULES_BUILD}) + if (";${VISP_MODULE_${m}_WRAPPERS};" MATCHES ";java;" AND HAVE_${m}) + list(APPEND VISP_JAVA_MODULES ${m}) + #message(STATUS "\t${m}") + endif() +endforeach() diff --git a/modules/python/generator/generator.py b/modules/python/generator/generator.py index 987156c4d7..d7c3c63dfa 100644 --- a/modules/python/generator/generator.py +++ b/modules/python/generator/generator.py @@ -1,16 +1,52 @@ -from typing import List, Tuple -from cxxheaderparser.parserstate import ClassBlockState +from typing import List, Optional, Set, Tuple +from cxxheaderparser.parserstate import ClassBlockState, State import pcpp import cxxheaderparser from cxxheaderparser.visitor import CxxVisitor from cxxheaderparser.parser import CxxParser from pathlib import Path import json + +def filter_includes(include_names: Set[str]) -> List[str]: + result = [] + for include_name in include_names: + if include_name.startswith('"') and include_name.endswith('"'): + continue + forbidden_strs = ['opencv2', 'Eigen', 'libxml', 'winsock'] + forbidden_found = False + for forbidden_str in forbidden_strs: + if forbidden_str in include_name: + forbidden_found = True + break + if forbidden_found: + continue + + result.append(include_name) + return result + class Visitor(CxxVisitor): def __init__(self): self.result = '' + self.includes = [] + self.current_class: Optional[ClassBlockState] = None + def on_class_start(self, state: ClassBlockState) -> None: print(state.class_decl.typename) + self.current_class = state + + if self.current_class.class_decl.template is None: + name_cpp = '::'.join([seg.name for seg in self.current_class.class_decl.typename.segments]) + name_python = name_cpp.replace('vp', '') + self.result += f'py::class_ {name_python} = py::class_<{name_cpp}>(sub, "{name_python}");' + + def on_include(self, state: State, filename: str) -> None: + self.includes.append(filename) + + + def on_class_end(self, state: ClassBlockState) -> None: + self.current_class = None + + class Submodule(): def __init__(self, name: str, include_path: Path, submodule_file_path: Path): @@ -24,17 +60,28 @@ def __init__(self, name: str, include_path: Path, submodule_file_path: Path): assert self.include_path.exists(), f'Submodule path {self.include_path} not found' def generate(self) -> None: - + header_code = [] + includes = [] for include_file in self.include_path.iterdir(): if not include_file.name.endswith('.h') and not include_file.name.endswith('.hpp'): continue if include_file.name in self.config['ignored_headers']: continue header = HeaderFile(include_file, self) - body = f'py::module_ submodule = m.def_submodule("{self.name}");' + header_code.append(header.binding_code) + includes.extend(header.includes) + includes_set = filter_includes(set(includes)) + + body = f'py::module_ submodule = m.def_submodule("{self.name}");\n' + '\n'.join(header_code) + includes_strs = [f'#include {include}' for include in includes_set] + includes_str = '\n'.join(includes_strs) format_str = f''' #include +{includes_str} + namespace py = pybind11; + + void {self.generation_function_name()}(py::module_ &m) {{ {body} }} @@ -59,7 +106,10 @@ def __init__(self, path: Path, submodule: Submodule): self.path = path self.submodule = submodule content = self.run_preprocessor() + self.includes = None + self.binding_code = None self.generate_binding_code(content) + def run_preprocessor(self): tmp_file_path = self.submodule.submodule_file_path.parent / "tmp" / self.path.name argv = [ @@ -76,10 +126,13 @@ def run_preprocessor(self): with open(tmp_file_path, 'r') as header_file: preprocessed_header_content = '\n'.join(header_file.readlines()) return preprocessed_header_content - def generate_binding_code(self, content: str) -> str: + def generate_binding_code(self, content: str) -> None: visitor = Visitor() parser = CxxParser(None, content, visitor) parser.parse() + self.binding_code = visitor.result + self.includes = visitor.includes + From 0fb8e7c2f2400e172ff9b8d5445cd0d47bc2f0b1 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Mon, 21 Aug 2023 12:56:48 +0200 Subject: [PATCH 003/169] generating inits wip --- modules/python/CMakeLists.txt | 17 ++- modules/python/generator/generator.py | 110 ++++++++++++--- modules/python/setup.py | 190 ++++++++++++++++++-------- 3 files changed, 236 insertions(+), 81 deletions(-) diff --git a/modules/python/CMakeLists.txt b/modules/python/CMakeLists.txt index 3f61626672..8756d93ebc 100644 --- a/modules/python/CMakeLists.txt +++ b/modules/python/CMakeLists.txt @@ -1,7 +1,10 @@ -vp_add_module(python visp_core OPTIONAL visp_sensor visp_vs) -include(${CMAKE_CURRENT_SOURCE_DIR}/common.cmake) -get_property(dirs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES) -foreach(dir ${dirs}) - message(STATUS "dir='${dir}'") -endforeach() -vp_create_module() +cmake_minimum_required (VERSION 3.5) +project(visp) + +find_package(pybind11 REQUIRED) +find_package(VISP REQUIRED) +include_directories(${VISP_INCLUDE_DIRS}) +message(${VISP_INCLUDE_DIRS}) +file(GLOB generated_cpp src/generated/*.cpp) +pybind11_add_module(visp src/main.cpp ${generated_cpp}) +target_link_libraries(visp PRIVATE ${VISP_LIBRARIES}) diff --git a/modules/python/generator/generator.py b/modules/python/generator/generator.py index d7c3c63dfa..b59662e23b 100644 --- a/modules/python/generator/generator.py +++ b/modules/python/generator/generator.py @@ -3,16 +3,20 @@ import pcpp import cxxheaderparser from cxxheaderparser.visitor import CxxVisitor -from cxxheaderparser.parser import CxxParser +from cxxheaderparser import types +from cxxheaderparser.simple import parse_string, ParsedData from pathlib import Path import json +def get_type(param: types.DecoratedType, owner_specs: List[str]) -> str: + pass + def filter_includes(include_names: Set[str]) -> List[str]: result = [] for include_name in include_names: if include_name.startswith('"') and include_name.endswith('"'): continue - forbidden_strs = ['opencv2', 'Eigen', 'libxml', 'winsock'] + forbidden_strs = ['winsock', ''] forbidden_found = False for forbidden_str in forbidden_strs: if forbidden_str in include_name: @@ -24,6 +28,7 @@ def filter_includes(include_names: Set[str]) -> List[str]: result.append(include_name) return result + class Visitor(CxxVisitor): def __init__(self): self.result = '' @@ -32,21 +37,24 @@ def __init__(self): def on_class_start(self, state: ClassBlockState) -> None: print(state.class_decl.typename) + if self.current_class is not None: + pass self.current_class = state - + if self.current_class.class_decl.template is None: name_cpp = '::'.join([seg.name for seg in self.current_class.class_decl.typename.segments]) name_python = name_cpp.replace('vp', '') - self.result += f'py::class_ {name_python} = py::class_<{name_cpp}>(sub, "{name_python}");' + # if name_cpp == 'vpColVector': + self.result += f'py::class_ py{name_python} = py::class_<{name_cpp}>(submodule, "{name_python}");' - def on_include(self, state: State, filename: str) -> None: - self.includes.append(filename) + # def on_include(self, state: State, filename: str) -> None: + #self.includes.append(filename) def on_class_end(self, state: ClassBlockState) -> None: self.current_class = None - - + + class Submodule(): def __init__(self, name: str, include_path: Path, submodule_file_path: Path): @@ -71,12 +79,15 @@ def generate(self) -> None: header_code.append(header.binding_code) includes.extend(header.includes) includes_set = filter_includes(set(includes)) - + body = f'py::module_ submodule = m.def_submodule("{self.name}");\n' + '\n'.join(header_code) includes_strs = [f'#include {include}' for include in includes_set] includes_str = '\n'.join(includes_strs) format_str = f''' #include +#include +#include +#include {includes_str} namespace py = pybind11; @@ -97,7 +108,7 @@ def generation_function_name(self) -> str: def get_submodules(include_path: Path, generate_path: Path) -> List[Submodule]: return [ Submodule('core', include_path / 'core', generate_path / 'core.cpp'), - Submodule('vs', include_path / 'vs', generate_path / 'vs.cpp') + # Submodule('vs', include_path / 'vs', generate_path / 'vs.cpp') ] @@ -106,7 +117,7 @@ def __init__(self, path: Path, submodule: Submodule): self.path = path self.submodule = submodule content = self.run_preprocessor() - self.includes = None + self.includes = [f''] self.binding_code = None self.generate_binding_code(content) @@ -114,10 +125,13 @@ def run_preprocessor(self): tmp_file_path = self.submodule.submodule_file_path.parent / "tmp" / self.path.name argv = [ '', - '-D', 'VISP_EXPORT=""', + # '-N', 'VISP_EXPORT', '-D', 'visp_deprecated=""', '-I', '/usr/local/include', '--passthru-includes', "^((?!vpConfig.h).)*$", + '--passthru-unfound-includes', + '--passthru-comments', + '--line-directive', '', '-o', f'{tmp_file_path}', str(self.path.absolute()) ] @@ -127,11 +141,73 @@ def run_preprocessor(self): preprocessed_header_content = '\n'.join(header_file.readlines()) return preprocessed_header_content def generate_binding_code(self, content: str) -> None: - visitor = Visitor() - parser = CxxParser(None, content, visitor) - parser.parse() - self.binding_code = visitor.result - self.includes = visitor.includes + parsed_data = parse_string(content) + self.binding_code = self.parse_data(parsed_data) + + + def parse_data(self, data: ParsedData): + result = '' + + print(f'Parsing namespace "{data.namespace.name}"') + for cls in data.namespace.classes: + print(f'Parsing class "{cls.class_decl.typename}"') + if cls.class_decl.template is not None: + print('Skipping because class is templated') + continue + name_cpp = '::'.join([seg.name for seg in cls.class_decl.typename.segments]) + name_python = name_cpp.replace('vp', '') + python_ident = f'py{name_python}' + # if name_cpp == 'vpColVector': + cls_result = f'\tpy::class_ {python_ident} = py::class_<{name_cpp}>(submodule, "{name_python}");' + methods_str = '' + skip_class = False + for method in cls.methods: + if method.pure_virtual: + skip_class = True + break + if skip_class: + continue + + for method in cls.methods: + if method.access is not None and method.access != 'public': + continue + if method.constructor: + params_strs = [] + skip_constructor = False + for param in method.parameters: + + if isinstance(param.type, types.Type): + print(param.type.typename) + params_strs.append('::'.join([seg.name for seg in param.type.typename.segments])) + elif isinstance(param.type, types.Reference): + param_str = '' + print(param) + print(param.type.ref_to.typename.segments[0].specialization) + if param.type.ref_to.const: + param_str += 'const ' + param_str += '::'.join([seg.name for seg in param.type.ref_to.typename.segments]) + + param_str += '&' + params_strs.append(param_str) + else: + skip_constructor = True + break + if not skip_constructor: + argument_types = ', '.join(params_strs) + print(argument_types) + ctor_str = f''' + {python_ident}.def(py::init<{argument_types}>()); + ''' + methods_str += ctor_str + else: + pass + result += cls_result + result += methods_str + + + + return result + diff --git a/modules/python/setup.py b/modules/python/setup.py index b575ec6d44..95a4bb534d 100644 --- a/modules/python/setup.py +++ b/modules/python/setup.py @@ -1,76 +1,152 @@ -# Available at setup time due to pyproject.toml -from pybind11.setup_helpers import Pybind11Extension, build_ext -from distutils.cmd import Command -from setuptools import setup -from setuptools.command.install import install +import os +import re +import subprocess +import sys +from pathlib import Path + +from setuptools import Extension, setup +from setuptools.command.build_ext import build_ext from distutils.command import build as build_module from pathlib import Path -import sys -import subprocess -from glob import glob -__version__ = "0.0.1" + +# Convert distutils Windows platform specifiers to CMake -A arguments +PLAT_TO_CMAKE = { + "win32": "Win32", + "win-amd64": "x64", + "win-arm32": "ARM", + "win-arm64": "ARM64", +} class build(build_module.build): def run(self): import os print('Generating binding code...') output = subprocess.run('python generator/generator.py', env=os.environ, shell=True, capture_output=True, check=True) - print(output.stdout) build_module.build.run(self) -# The main interface is through Pybind11Extension. -# * You can add cxx_std=11/14/17, and then build_ext can be removed. -# * You can set include_pybind11=false to add the include directory yourself, -# say from a submodule. -# -# Note: -# Sort input source files if you glob sources to ensure bit-for-bit -# reproducible builds (https://github.com/pybind/python_example/pull/53) -# class GenerateBindings(Command): -# description = 'generate Pybind11 binding' -# user_options = [] -# def initialize_options(self): -# """Use this to set option defaults before parsing.""" -# pass - -# def finalize_options(self): -# """Code to validate/modify command-line/config input goes here.""" -# pass -# def run(self): -# import os -# print('Generating binding code...') -# output = subprocess.run('python generator/generator.py', env=os.environ, shell=True, capture_output=True, check=True) -# print(output.stdout) - -# class InstallCommand(install): -# user_options = install.user_options -# def run(self): -# self.run_command('generate_bindings') -# install.run(self) -# #self.run_command('delete_fixed_json') - -ext_modules = [ - Pybind11Extension("visp", - ["src/main.cpp", *sorted(glob("src/generated/*.cpp")), *sorted(glob("src/src/*.cpp"))], - # Example: passing in the version to the compiled code - define_macros = [('VERSION_INFO', __version__)], - ), -] +# A CMakeExtension needs a sourcedir instead of a file list. +# The name must be the _single_ output extension from the CMake build. +# If you need multiple extensions, see scikit-build. +class CMakeExtension(Extension): + def __init__(self, name: str, sourcedir: str = "") -> None: + super().__init__(name, sources=[]) + self.sourcedir = os.fspath(Path(sourcedir).resolve()) + + +class CMakeBuild(build_ext): + def build_extension(self, ext: CMakeExtension) -> None: + print('RUNNING CMAKE\n' * 10) + # Must be in this form due to bug in .resolve() only fixed in Python 3.10+ + ext_fullpath = Path.cwd() / self.get_ext_fullpath(ext.name) + extdir = ext_fullpath.parent.resolve() + + # Using this requires trailing slash for auto-detection & inclusion of + # auxiliary "native" libs + + debug = int(os.environ.get("DEBUG", 0)) if self.debug is None else self.debug + cfg = "Debug" if debug else "Release" + + # CMake lets you override the generator - we need to check this. + # Can be set with Conda-Build, for example. + cmake_generator = os.environ.get("CMAKE_GENERATOR", "") + + # Set Python_EXECUTABLE instead if you use PYBIND11_FINDPYTHON + # EXAMPLE_VERSION_INFO shows you how to pass a value into the C++ code + # from Python. + cmake_args = [ + f"-DCMAKE_LIBRARY_OUTPUT_DIRECTORY={extdir}{os.sep}", + f"-DPYTHON_EXECUTABLE={sys.executable}", + f"-DCMAKE_BUILD_TYPE={cfg}", # not used on MSVC, but no harm + ] + build_args = [] + # Adding CMake arguments set as environment variable + # (needed e.g. to build for ARM OSx on conda-forge) + if "CMAKE_ARGS" in os.environ: + cmake_args += [item for item in os.environ["CMAKE_ARGS"].split(" ") if item] + + # In this example, we pass in the version to C++. You might not need to. + cmake_args += [f"-DVISP_PYTHON_VERSION_INFO={self.distribution.get_version()}"] + + if self.compiler.compiler_type != "msvc": + # Using Ninja-build since it a) is available as a wheel and b) + # multithreads automatically. MSVC would require all variables be + # exported for Ninja to pick it up, which is a little tricky to do. + # Users can override the generator with CMAKE_GENERATOR in CMake + # 3.15+. + if not cmake_generator or cmake_generator == "Ninja": + try: + import ninja + + ninja_executable_path = Path(ninja.BIN_DIR) / "ninja" + cmake_args += [ + "-GNinja", + f"-DCMAKE_MAKE_PROGRAM:FILEPATH={ninja_executable_path}", + ] + except ImportError: + pass + + else: + # Single config generators are handled "normally" + single_config = any(x in cmake_generator for x in {"NMake", "Ninja"}) + + # CMake allows an arch-in-generator style for backward compatibility + contains_arch = any(x in cmake_generator for x in {"ARM", "Win64"}) + + # Specify the arch if using MSVC generator, but only if it doesn't + # contain a backward-compatibility arch spec already in the + # generator name. + if not single_config and not contains_arch: + cmake_args += ["-A", PLAT_TO_CMAKE[self.plat_name]] + + # Multi-config generators have a different way to specify configs + if not single_config: + cmake_args += [ + f"-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_{cfg.upper()}={extdir}" + ] + build_args += ["--config", cfg] + + if sys.platform.startswith("darwin"): + # Cross-compile support for macOS - respect ARCHFLAGS if set + archs = re.findall(r"-arch (\S+)", os.environ.get("ARCHFLAGS", "")) + if archs: + cmake_args += ["-DCMAKE_OSX_ARCHITECTURES={}".format(";".join(archs))] + + # Set CMAKE_BUILD_PARALLEL_LEVEL to control the parallel build level + # across all generators. + if "CMAKE_BUILD_PARALLEL_LEVEL" not in os.environ: + # self.parallel is a Python 3 only way to set parallel jobs by hand + # using -j in the build_ext call, not supported by pip or PyPA-build. + if hasattr(self, "parallel") and self.parallel: + # CMake 3.12+ only. + build_args += [f"-j{self.parallel}"] + + build_temp = Path(self.build_temp) / ext.name + if not build_temp.exists(): + build_temp.mkdir(parents=True) + + subprocess.run( + ["cmake", ext.sourcedir, *cmake_args], cwd=build_temp, check=True + ) + subprocess.run( + ["cmake", "--build", ".", *build_args], cwd=build_temp, check=True + ) + + +# The information here can also be placed in setup.cfg - better separation of +# logic and declaration, and simpler if you include description/version in a file. setup( name="visp", - version=__version__, + version="0.0.1", author="Samuel Felton", author_email="samuel.felton@irisa.fr", - url="https://github.com/lagadic/visp", - description="Python wrapper for the Visual Servoing Platform (ViSP) framework", + description="Python wrapper for the Visual Servoing Platform", long_description="", - ext_modules=ext_modules, - extras_require={"test": "pytest"}, setup_requires=[ "pcpp", "cxxheaderparser@git+https://github.com/robotpy/cxxheaderparser#egg=master" ], - cmdclass={"build_ext": build_ext, - 'build': build}, + ext_modules=[CMakeExtension("visp_python")], + cmdclass={"build_ext": CMakeBuild, 'build': build}, zip_safe=False, - python_requires=">=3.9", -) \ No newline at end of file + extras_require={"test": ["pytest>=6.0"]}, + python_requires=">=3.7", +) From ac70d68eee7fbff634d5c10ee5b12014b2685d15 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Tue, 22 Aug 2023 13:53:40 +0200 Subject: [PATCH 004/169] Better type expression, creating header environment for name resolution --- modules/python/generator/generator.py | 113 +++++++++++++++++++++----- 1 file changed, 92 insertions(+), 21 deletions(-) diff --git a/modules/python/generator/generator.py b/modules/python/generator/generator.py index b59662e23b..dc859a9a03 100644 --- a/modules/python/generator/generator.py +++ b/modules/python/generator/generator.py @@ -1,15 +1,47 @@ -from typing import List, Optional, Set, Tuple +from typing import List, Optional, Set, Tuple, Dict, Union from cxxheaderparser.parserstate import ClassBlockState, State import pcpp import cxxheaderparser from cxxheaderparser.visitor import CxxVisitor from cxxheaderparser import types -from cxxheaderparser.simple import parse_string, ParsedData +from cxxheaderparser.simple import parse_string, ParsedData, NamespaceScope, ClassScope from pathlib import Path import json -def get_type(param: types.DecoratedType, owner_specs: List[str]) -> str: - pass + +def get_type(param: Union[types.FunctionType, types.DecoratedType, types.Value], owner_specs: Dict[str, str]) -> Optional[str]: + def segment_repr(segment: types.PQNameSegment) -> str: + spec_str = '' + if isinstance(segment, types.FundamentalSpecifier): + return segment.name + if segment.name in owner_specs: + segment.name = owner_specs[segment.name] + + if segment.specialization is not None: + template_strs = [] + for arg in segment.specialization.args: + template_strs.append(get_type(arg.arg, owner_specs)) + + spec_str = f'<{",".join(template_strs)}>' + + return segment.name + spec_str + if isinstance(param, types.Value): + return ''.join([token.value for token in param.tokens]) + if isinstance(param, types.FunctionType): + return 'FUNCTION' + if isinstance(param, types.Type): + repr_str = '::'.join(list(map(segment_repr, param.typename.segments))) + if param.const: + repr_str = 'const ' + repr_str + return repr_str + elif isinstance(param, types.Reference): + repr_str = get_type(param.ref_to, owner_specs) + if repr_str is not None: + return repr_str + '&' + else: + return None + else: + return None def filter_includes(include_names: Set[str]) -> List[str]: result = [] @@ -111,6 +143,42 @@ def get_submodules(include_path: Path, generate_path: Path) -> List[Submodule]: # Submodule('vs', include_path / 'vs', generate_path / 'vs.cpp') ] +class HeaderEnvironment(): + def __init__(self, data: ParsedData): + self.mapping = self.build_mapping(data.namespace) + def build_mapping(self, data: Union[NamespaceScope, ClassScope], mapping={}, scope: str = ''): + if isinstance(data, NamespaceScope): + for alias in data.using_alias: + mapping[alias.alias] = get_type(alias.type) + for enum in data.enums: + print(enum) + enum_name = '::'.join([seg.name for seg in enum.base.segments]) + mapping[enum_name] = scope + enum_name + for cls in data.classes: + cls_name = '::'.join([seg.name for seg in cls.class_decl.typename.segments]) + mapping[cls_name] = scope + cls_name + mapping.update(self.build_mapping(cls, mapping=mapping, scope=f'{scope}{cls_name}::')) + for namespace in data.namespaces: + mapping.update(self.build_mapping(data.namespaces[namespace], mapping=mapping, scope=f'{scope}{namespace}::')) + + elif isinstance(data, ClassScope): + for alias in data.using_alias: + mapping[alias.alias] = get_type(alias.type) + for typedef in data.typedefs: + mapping[typedef.name] = scope + typedef.name + for enum in data.enums: + print(enum) + + enum_name = '::'.join([seg.name for seg in enum.typename.segments if not isinstance(seg, types.AnonymousName)]) + if enum_name == 'vpFontFamily': + print('AAAAAAAAA' * 1000) + mapping[enum_name] = scope + enum_name + for cls in data.classes: + cls_name = '::'.join([seg.name for seg in cls.class_decl.typename.segments]) + mapping[cls_name] = scope + cls_name + mapping.update(self.build_mapping(cls, mapping=mapping, scope=f'{scope}{cls_name}::')) + + return mapping class HeaderFile(): def __init__(self, path: Path, submodule: Submodule): @@ -121,7 +189,7 @@ def __init__(self, path: Path, submodule: Submodule): self.binding_code = None self.generate_binding_code(content) - def run_preprocessor(self): + def run_preprocessor(self): # TODO: run without generating a new file tmp_file_path = self.submodule.submodule_file_path.parent / "tmp" / self.path.name argv = [ '', @@ -140,6 +208,7 @@ def run_preprocessor(self): with open(tmp_file_path, 'r') as header_file: preprocessed_header_content = '\n'.join(header_file.readlines()) return preprocessed_header_content + def generate_binding_code(self, content: str) -> None: parsed_data = parse_string(content) self.binding_code = self.parse_data(parsed_data) @@ -147,7 +216,11 @@ def generate_binding_code(self, content: str) -> None: def parse_data(self, data: ParsedData): result = '' - + header_env = HeaderEnvironment(data) + if 'vpFont' in self.path.name: + print(header_env.mapping) + import time + # time.sleep(1000) print(f'Parsing namespace "{data.namespace.name}"') for cls in data.namespace.classes: print(f'Parsing class "{cls.class_decl.typename}"') @@ -175,23 +248,21 @@ def parse_data(self, data: ParsedData): params_strs = [] skip_constructor = False for param in method.parameters: - - if isinstance(param.type, types.Type): - print(param.type.typename) - params_strs.append('::'.join([seg.name for seg in param.type.typename.segments])) - elif isinstance(param.type, types.Reference): - param_str = '' - print(param) - print(param.type.ref_to.typename.segments[0].specialization) - if param.type.ref_to.const: - param_str += 'const ' - param_str += '::'.join([seg.name for seg in param.type.ref_to.typename.segments]) - - param_str += '&' - params_strs.append(param_str) - else: + param_str = get_type(param.type, {}) + if 'vpFont' in self.path.name: + print(param_str) + if param_str in header_env.mapping: # TODO: replace param str with raw type: no const or ref + param_str = header_env.mapping[param_str] + if 'vpFont' in self.path.name: + print(param_str) + time.sleep(1) + print(param_str) + if param_str is None: + print('Skipping constructor', method) skip_constructor = True break + else: + params_strs.append(param_str) if not skip_constructor: argument_types = ', '.join(params_strs) print(argument_types) From f3be3842f6fa9b30537b033d85323e7b9581d66e Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Tue, 22 Aug 2023 17:35:26 +0200 Subject: [PATCH 005/169] fix name resolution, string representation of classes, start working on inheritance --- modules/python/CMakeLists.txt | 1 + modules/python/generator/generator.py | 86 ++++++++++++++++++--------- modules/python/pyproject.toml | 1 - modules/python/setup.py | 2 +- 4 files changed, 61 insertions(+), 29 deletions(-) diff --git a/modules/python/CMakeLists.txt b/modules/python/CMakeLists.txt index 8756d93ebc..870940a5a1 100644 --- a/modules/python/CMakeLists.txt +++ b/modules/python/CMakeLists.txt @@ -5,6 +5,7 @@ find_package(pybind11 REQUIRED) find_package(VISP REQUIRED) include_directories(${VISP_INCLUDE_DIRS}) message(${VISP_INCLUDE_DIRS}) +message(${pybind11_VERSION}) file(GLOB generated_cpp src/generated/*.cpp) pybind11_add_module(visp src/main.cpp ${generated_cpp}) target_link_libraries(visp PRIVATE ${VISP_LIBRARIES}) diff --git a/modules/python/generator/generator.py b/modules/python/generator/generator.py index dc859a9a03..df33394db8 100644 --- a/modules/python/generator/generator.py +++ b/modules/python/generator/generator.py @@ -8,8 +8,10 @@ from pathlib import Path import json - -def get_type(param: Union[types.FunctionType, types.DecoratedType, types.Value], owner_specs: Dict[str, str]) -> Optional[str]: +def get_typename(typename: types.PQName, owner_specs, header_env_mapping) -> str: + '''Resolve the string representation of a raw type, resolving template specializations and using complete typenames + (aliases, shortened name when in same namescope). + ''' def segment_repr(segment: types.PQNameSegment) -> str: spec_str = '' if isinstance(segment, types.FundamentalSpecifier): @@ -20,22 +22,30 @@ def segment_repr(segment: types.PQNameSegment) -> str: if segment.specialization is not None: template_strs = [] for arg in segment.specialization.args: - template_strs.append(get_type(arg.arg, owner_specs)) + template_strs.append(get_type(arg.arg, owner_specs, header_env_mapping)) spec_str = f'<{",".join(template_strs)}>' return segment.name + spec_str + return '::'.join(list(map(segment_repr, typename.segments))) + +def get_type(param: Union[types.FunctionType, types.DecoratedType, types.Value], owner_specs: Dict[str, str], header_env_mapping: Dict[str, str]) -> Optional[str]: + if isinstance(param, types.Value): return ''.join([token.value for token in param.tokens]) if isinstance(param, types.FunctionType): return 'FUNCTION' if isinstance(param, types.Type): - repr_str = '::'.join(list(map(segment_repr, param.typename.segments))) + repr_str = get_typename(param.typename, owner_specs, header_env_mapping) + split = repr_str.split('<') + if split[0] in header_env_mapping: + split[0] = header_env_mapping[split[0]] + repr_str = '<'.join(split) if param.const: repr_str = 'const ' + repr_str return repr_str elif isinstance(param, types.Reference): - repr_str = get_type(param.ref_to, owner_specs) + repr_str = get_type(param.ref_to, owner_specs, header_env_mapping) if repr_str is not None: return repr_str + '&' else: @@ -149,7 +159,7 @@ def __init__(self, data: ParsedData): def build_mapping(self, data: Union[NamespaceScope, ClassScope], mapping={}, scope: str = ''): if isinstance(data, NamespaceScope): for alias in data.using_alias: - mapping[alias.alias] = get_type(alias.type) + mapping[alias.alias] = get_type(alias.type, {}, mapping) for enum in data.enums: print(enum) enum_name = '::'.join([seg.name for seg in enum.base.segments]) @@ -163,7 +173,7 @@ def build_mapping(self, data: Union[NamespaceScope, ClassScope], mapping={}, sco elif isinstance(data, ClassScope): for alias in data.using_alias: - mapping[alias.alias] = get_type(alias.type) + mapping[alias.alias] = get_type(alias.type, {}, mapping) for typedef in data.typedefs: mapping[typedef.name] = scope + typedef.name for enum in data.enums: @@ -207,9 +217,11 @@ def run_preprocessor(self): # TODO: run without generating a new file preprocessed_header_content = None with open(tmp_file_path, 'r') as header_file: preprocessed_header_content = '\n'.join(header_file.readlines()) + preprocessed_header_content = preprocessed_header_content.replace('#include<', '#include <') return preprocessed_header_content def generate_binding_code(self, content: str) -> None: + print('Before parsing cpp structure for file: ', self.path) parsed_data = parse_string(content) self.binding_code = self.parse_data(parsed_data) @@ -230,16 +242,46 @@ def parse_data(self, data: ParsedData): name_cpp = '::'.join([seg.name for seg in cls.class_decl.typename.segments]) name_python = name_cpp.replace('vp', '') python_ident = f'py{name_python}' + + base_classes_str='' + for base_class in cls.class_decl.bases: + if base_class.access == 'public': + base_classes_str += ', ' + get_typename(base_class.typename, {}, header_env.mapping) # if name_cpp == 'vpColVector': - cls_result = f'\tpy::class_ {python_ident} = py::class_<{name_cpp}>(submodule, "{name_python}");' + cls_result = f'\tpy::class_ {python_ident} = py::class_<{name_cpp}{base_classes_str}>(submodule, "{name_python}");' methods_str = '' skip_class = False + # Skip classes that have pure virtual methods since they cannot be instantiated for method in cls.methods: if method.pure_virtual: skip_class = True break - if skip_class: - continue + # if skip_class: + # continue + + # Add to string representation + to_string_str = '' + for friend in cls.friends: + if friend.fn is not None: + is_ostream_operator = True + fn = friend.fn + if fn.return_type is None: + is_ostream_operator = False + else: + return_str = get_type(fn.return_type, {}, {}) + if return_str != 'std::ostream&': + is_ostream_operator = False + if not is_ostream_operator: + continue + if is_ostream_operator: + to_string_str = f''' + {python_ident}.def("__repr__", []({name_cpp} &a) {{ + std::stringstream s; + s << a; + return s.str(); + }});''' + + for method in cls.methods: if method.access is not None and method.access != 'public': @@ -248,14 +290,11 @@ def parse_data(self, data: ParsedData): params_strs = [] skip_constructor = False for param in method.parameters: - param_str = get_type(param.type, {}) - if 'vpFont' in self.path.name: - print(param_str) + param_str = get_type(param.type, {}, header_env.mapping) + if param_str in header_env.mapping: # TODO: replace param str with raw type: no const or ref param_str = header_env.mapping[param_str] - if 'vpFont' in self.path.name: - print(param_str) - time.sleep(1) + print(param_str) if param_str is None: print('Skipping constructor', method) @@ -267,23 +306,16 @@ def parse_data(self, data: ParsedData): argument_types = ', '.join(params_strs) print(argument_types) ctor_str = f''' - {python_ident}.def(py::init<{argument_types}>()); - ''' + {python_ident}.def(py::init<{argument_types}>());''' methods_str += ctor_str else: pass result += cls_result - result += methods_str - - - + if not skip_class: + result += methods_str + result += to_string_str return result - - - - - def generate_module(generate_path: Path) -> None: main_path = generate_path / 'main.cpp' include_path = Path('/usr/local/include/visp3') diff --git a/modules/python/pyproject.toml b/modules/python/pyproject.toml index d0c181748e..a017b22de5 100644 --- a/modules/python/pyproject.toml +++ b/modules/python/pyproject.toml @@ -1,7 +1,6 @@ [build-system] requires = [ "setuptools>=42", - "pybind11>=2.10.0", "pcpp", "cxxheaderparser@git+https://github.com/robotpy/cxxheaderparser#egg=master" ] diff --git a/modules/python/setup.py b/modules/python/setup.py index 95a4bb534d..1276c40b41 100644 --- a/modules/python/setup.py +++ b/modules/python/setup.py @@ -21,7 +21,7 @@ class build(build_module.build): def run(self): import os print('Generating binding code...') - output = subprocess.run('python generator/generator.py', env=os.environ, shell=True, capture_output=True, check=True) + #output = subprocess.run('python generator/generator.py', env=os.environ, shell=True, capture_output=True, check=True) build_module.build.run(self) # A CMakeExtension needs a sourcedir instead of a file list. # The name must be the _single_ output extension from the CMake build. From f78b2b577d9e247b9648daa3d78d8a43edd5620d Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Wed, 23 Aug 2023 13:26:09 +0200 Subject: [PATCH 006/169] header sorting, start work on template specialization --- modules/python/config/core.json | 12 ++++++- modules/python/generator/generator.py | 52 +++++++++++++++++++++++++-- 2 files changed, 60 insertions(+), 4 deletions(-) diff --git a/modules/python/config/core.json b/modules/python/config/core.json index 9a0f88ce20..8ccf2ea116 100644 --- a/modules/python/config/core.json +++ b/modules/python/config/core.json @@ -1,3 +1,13 @@ { - "ignored_headers": ["vpGEMM.h"] + "ignored_headers": ["vpGEMM.h"], + "classes": { + "vpArray2D": { + "specializations": [ + { + "python_name": "ArrayDouble2D", + "arguments": ["double"] + } + ] + } + } } \ No newline at end of file diff --git a/modules/python/generator/generator.py b/modules/python/generator/generator.py index df33394db8..12b2a76833 100644 --- a/modules/python/generator/generator.py +++ b/modules/python/generator/generator.py @@ -8,6 +8,39 @@ from pathlib import Path import json +def sort_headers(headers: List['HeaderFile']) -> List['HeaderFile']: + def add_level(result: List['HeaderFile'], remainder: List['HeaderFile'], dependencies: Set[str]): + if len(remainder) == 0: + return + print(dependencies) + print('Result = ', [r.path.name for r in result]) + + print([r.path.name for r in remainder]) + + include_in_result_fn = None + if len(result) == 0: + include_in_result_fn = lambda h: len(h.depends) == 0 + else: + include_in_result_fn = lambda h: any(map(lambda x: x in dependencies, h.depends)) + new_remainder = [] + new_dependencies = [] + for header_file in remainder: + has_dependency = include_in_result_fn(header_file) + print(header_file.path.name) + print(header_file.contains, header_file.depends) + if has_dependency: + new_dependencies.extend(header_file.contains) + result.append(header_file) + else: + new_remainder.append(header_file) + print(new_dependencies) + add_level(result, new_remainder, set(new_dependencies)) + result = [] + add_level(result, headers, set()) + return result + + + def get_typename(typename: types.PQName, owner_specs, header_env_mapping) -> str: '''Resolve the string representation of a raw type, resolving template specializations and using complete typenames (aliases, shortened name when in same namescope). @@ -110,14 +143,20 @@ def __init__(self, name: str, include_path: Path, submodule_file_path: Path): assert self.include_path.exists(), f'Submodule path {self.include_path} not found' def generate(self) -> None: - header_code = [] - includes = [] + headers = [] for include_file in self.include_path.iterdir(): if not include_file.name.endswith('.h') and not include_file.name.endswith('.hpp'): continue if include_file.name in self.config['ignored_headers']: continue header = HeaderFile(include_file, self) + headers.append(header) + # Sort by dependency level so that generation is in correct order + headers = sort_headers(headers) + + header_code = [] + includes = [] + for header in headers: header_code.append(header.binding_code) includes.extend(header.includes) includes_set = filter_includes(set(includes)) @@ -197,6 +236,8 @@ def __init__(self, path: Path, submodule: Submodule): content = self.run_preprocessor() self.includes = [f''] self.binding_code = None + self.contains = [] + self.depends = [] self.generate_binding_code(content) def run_preprocessor(self): # TODO: run without generating a new file @@ -236,10 +277,12 @@ def parse_data(self, data: ParsedData): print(f'Parsing namespace "{data.namespace.name}"') for cls in data.namespace.classes: print(f'Parsing class "{cls.class_decl.typename}"') + name_cpp = '::'.join([seg.name for seg in cls.class_decl.typename.segments]) + self.contains.append(name_cpp) if cls.class_decl.template is not None: print('Skipping because class is templated') continue - name_cpp = '::'.join([seg.name for seg in cls.class_decl.typename.segments]) + name_python = name_cpp.replace('vp', '') python_ident = f'py{name_python}' @@ -247,6 +290,9 @@ def parse_data(self, data: ParsedData): for base_class in cls.class_decl.bases: if base_class.access == 'public': base_classes_str += ', ' + get_typename(base_class.typename, {}, header_env.mapping) + base_class_str_no_template = '::'.join([segment.name for segment in base_class.typename.segments]) + if base_class_str_no_template.startswith('vp'): + self.depends.append(base_class_str_no_template) # if name_cpp == 'vpColVector': cls_result = f'\tpy::class_ {python_ident} = py::class_<{name_cpp}{base_classes_str}>(submodule, "{name_python}");' methods_str = '' From cd53854fdaf8fa23cb54d231897ce228ac84185a Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Wed, 23 Aug 2023 17:46:39 +0200 Subject: [PATCH 007/169] Refactoring code, working on specialization --- modules/python/config/core.json | 3 + modules/python/generator/generator.py | 353 +------------------------- modules/python/generator/header.py | 246 ++++++++++++++++++ modules/python/generator/submodule.py | 93 +++++++ modules/python/generator/utils.py | 54 ++++ 5 files changed, 398 insertions(+), 351 deletions(-) create mode 100644 modules/python/generator/header.py create mode 100644 modules/python/generator/submodule.py create mode 100644 modules/python/generator/utils.py diff --git a/modules/python/config/core.json b/modules/python/config/core.json index 8ccf2ea116..557249eedb 100644 --- a/modules/python/config/core.json +++ b/modules/python/config/core.json @@ -1,5 +1,8 @@ { "ignored_headers": ["vpGEMM.h"], + "ignored_classes": ["vpException", "vpImageException", "vpTrackingException", + "vpFrameGrabberException", "vpIoException", + "vpDisplayException", "vpMatrixException"], "classes": { "vpArray2D": { "specializations": [ diff --git a/modules/python/generator/generator.py b/modules/python/generator/generator.py index 12b2a76833..e1072ad179 100644 --- a/modules/python/generator/generator.py +++ b/modules/python/generator/generator.py @@ -8,359 +8,10 @@ from pathlib import Path import json -def sort_headers(headers: List['HeaderFile']) -> List['HeaderFile']: - def add_level(result: List['HeaderFile'], remainder: List['HeaderFile'], dependencies: Set[str]): - if len(remainder) == 0: - return - print(dependencies) - print('Result = ', [r.path.name for r in result]) +from header import * +from submodule import * - print([r.path.name for r in remainder]) - include_in_result_fn = None - if len(result) == 0: - include_in_result_fn = lambda h: len(h.depends) == 0 - else: - include_in_result_fn = lambda h: any(map(lambda x: x in dependencies, h.depends)) - new_remainder = [] - new_dependencies = [] - for header_file in remainder: - has_dependency = include_in_result_fn(header_file) - print(header_file.path.name) - print(header_file.contains, header_file.depends) - if has_dependency: - new_dependencies.extend(header_file.contains) - result.append(header_file) - else: - new_remainder.append(header_file) - print(new_dependencies) - add_level(result, new_remainder, set(new_dependencies)) - result = [] - add_level(result, headers, set()) - return result - - - -def get_typename(typename: types.PQName, owner_specs, header_env_mapping) -> str: - '''Resolve the string representation of a raw type, resolving template specializations and using complete typenames - (aliases, shortened name when in same namescope). - ''' - def segment_repr(segment: types.PQNameSegment) -> str: - spec_str = '' - if isinstance(segment, types.FundamentalSpecifier): - return segment.name - if segment.name in owner_specs: - segment.name = owner_specs[segment.name] - - if segment.specialization is not None: - template_strs = [] - for arg in segment.specialization.args: - template_strs.append(get_type(arg.arg, owner_specs, header_env_mapping)) - - spec_str = f'<{",".join(template_strs)}>' - - return segment.name + spec_str - return '::'.join(list(map(segment_repr, typename.segments))) - -def get_type(param: Union[types.FunctionType, types.DecoratedType, types.Value], owner_specs: Dict[str, str], header_env_mapping: Dict[str, str]) -> Optional[str]: - - if isinstance(param, types.Value): - return ''.join([token.value for token in param.tokens]) - if isinstance(param, types.FunctionType): - return 'FUNCTION' - if isinstance(param, types.Type): - repr_str = get_typename(param.typename, owner_specs, header_env_mapping) - split = repr_str.split('<') - if split[0] in header_env_mapping: - split[0] = header_env_mapping[split[0]] - repr_str = '<'.join(split) - if param.const: - repr_str = 'const ' + repr_str - return repr_str - elif isinstance(param, types.Reference): - repr_str = get_type(param.ref_to, owner_specs, header_env_mapping) - if repr_str is not None: - return repr_str + '&' - else: - return None - else: - return None - -def filter_includes(include_names: Set[str]) -> List[str]: - result = [] - for include_name in include_names: - if include_name.startswith('"') and include_name.endswith('"'): - continue - forbidden_strs = ['winsock', ''] - forbidden_found = False - for forbidden_str in forbidden_strs: - if forbidden_str in include_name: - forbidden_found = True - break - if forbidden_found: - continue - - result.append(include_name) - return result - - -class Visitor(CxxVisitor): - def __init__(self): - self.result = '' - self.includes = [] - self.current_class: Optional[ClassBlockState] = None - - def on_class_start(self, state: ClassBlockState) -> None: - print(state.class_decl.typename) - if self.current_class is not None: - pass - self.current_class = state - - if self.current_class.class_decl.template is None: - name_cpp = '::'.join([seg.name for seg in self.current_class.class_decl.typename.segments]) - name_python = name_cpp.replace('vp', '') - # if name_cpp == 'vpColVector': - self.result += f'py::class_ py{name_python} = py::class_<{name_cpp}>(submodule, "{name_python}");' - - # def on_include(self, state: State, filename: str) -> None: - #self.includes.append(filename) - - - def on_class_end(self, state: ClassBlockState) -> None: - self.current_class = None - - - -class Submodule(): - def __init__(self, name: str, include_path: Path, submodule_file_path: Path): - self.name = name - self.include_path = include_path - self.submodule_file_path = submodule_file_path - self.config_path = Path('config') / (name + '.json') - with open(self.config_path, 'r') as config_file: - self.config = json.load(config_file) - - assert self.include_path.exists(), f'Submodule path {self.include_path} not found' - - def generate(self) -> None: - headers = [] - for include_file in self.include_path.iterdir(): - if not include_file.name.endswith('.h') and not include_file.name.endswith('.hpp'): - continue - if include_file.name in self.config['ignored_headers']: - continue - header = HeaderFile(include_file, self) - headers.append(header) - # Sort by dependency level so that generation is in correct order - headers = sort_headers(headers) - - header_code = [] - includes = [] - for header in headers: - header_code.append(header.binding_code) - includes.extend(header.includes) - includes_set = filter_includes(set(includes)) - - body = f'py::module_ submodule = m.def_submodule("{self.name}");\n' + '\n'.join(header_code) - includes_strs = [f'#include {include}' for include in includes_set] - includes_str = '\n'.join(includes_strs) - format_str = f''' -#include -#include -#include -#include -{includes_str} - -namespace py = pybind11; - - -void {self.generation_function_name()}(py::module_ &m) {{ - {body} -}} -''' - with open(self.submodule_file_path, 'w') as submodule_file: - submodule_file.write(format_str) - - def generation_function_name(self) -> str: - return f'init_submodule_{self.name}' - - - -def get_submodules(include_path: Path, generate_path: Path) -> List[Submodule]: - return [ - Submodule('core', include_path / 'core', generate_path / 'core.cpp'), - # Submodule('vs', include_path / 'vs', generate_path / 'vs.cpp') - - ] -class HeaderEnvironment(): - def __init__(self, data: ParsedData): - self.mapping = self.build_mapping(data.namespace) - def build_mapping(self, data: Union[NamespaceScope, ClassScope], mapping={}, scope: str = ''): - if isinstance(data, NamespaceScope): - for alias in data.using_alias: - mapping[alias.alias] = get_type(alias.type, {}, mapping) - for enum in data.enums: - print(enum) - enum_name = '::'.join([seg.name for seg in enum.base.segments]) - mapping[enum_name] = scope + enum_name - for cls in data.classes: - cls_name = '::'.join([seg.name for seg in cls.class_decl.typename.segments]) - mapping[cls_name] = scope + cls_name - mapping.update(self.build_mapping(cls, mapping=mapping, scope=f'{scope}{cls_name}::')) - for namespace in data.namespaces: - mapping.update(self.build_mapping(data.namespaces[namespace], mapping=mapping, scope=f'{scope}{namespace}::')) - - elif isinstance(data, ClassScope): - for alias in data.using_alias: - mapping[alias.alias] = get_type(alias.type, {}, mapping) - for typedef in data.typedefs: - mapping[typedef.name] = scope + typedef.name - for enum in data.enums: - print(enum) - - enum_name = '::'.join([seg.name for seg in enum.typename.segments if not isinstance(seg, types.AnonymousName)]) - if enum_name == 'vpFontFamily': - print('AAAAAAAAA' * 1000) - mapping[enum_name] = scope + enum_name - for cls in data.classes: - cls_name = '::'.join([seg.name for seg in cls.class_decl.typename.segments]) - mapping[cls_name] = scope + cls_name - mapping.update(self.build_mapping(cls, mapping=mapping, scope=f'{scope}{cls_name}::')) - - return mapping - -class HeaderFile(): - def __init__(self, path: Path, submodule: Submodule): - self.path = path - self.submodule = submodule - content = self.run_preprocessor() - self.includes = [f''] - self.binding_code = None - self.contains = [] - self.depends = [] - self.generate_binding_code(content) - - def run_preprocessor(self): # TODO: run without generating a new file - tmp_file_path = self.submodule.submodule_file_path.parent / "tmp" / self.path.name - argv = [ - '', - # '-N', 'VISP_EXPORT', - '-D', 'visp_deprecated=""', - '-I', '/usr/local/include', - '--passthru-includes', "^((?!vpConfig.h).)*$", - '--passthru-unfound-includes', - '--passthru-comments', - '--line-directive', '', - '-o', f'{tmp_file_path}', - str(self.path.absolute()) - ] - pcpp.CmdPreprocessor(argv) - preprocessed_header_content = None - with open(tmp_file_path, 'r') as header_file: - preprocessed_header_content = '\n'.join(header_file.readlines()) - preprocessed_header_content = preprocessed_header_content.replace('#include<', '#include <') - return preprocessed_header_content - - def generate_binding_code(self, content: str) -> None: - print('Before parsing cpp structure for file: ', self.path) - parsed_data = parse_string(content) - self.binding_code = self.parse_data(parsed_data) - - - def parse_data(self, data: ParsedData): - result = '' - header_env = HeaderEnvironment(data) - if 'vpFont' in self.path.name: - print(header_env.mapping) - import time - # time.sleep(1000) - print(f'Parsing namespace "{data.namespace.name}"') - for cls in data.namespace.classes: - print(f'Parsing class "{cls.class_decl.typename}"') - name_cpp = '::'.join([seg.name for seg in cls.class_decl.typename.segments]) - self.contains.append(name_cpp) - if cls.class_decl.template is not None: - print('Skipping because class is templated') - continue - - name_python = name_cpp.replace('vp', '') - python_ident = f'py{name_python}' - - base_classes_str='' - for base_class in cls.class_decl.bases: - if base_class.access == 'public': - base_classes_str += ', ' + get_typename(base_class.typename, {}, header_env.mapping) - base_class_str_no_template = '::'.join([segment.name for segment in base_class.typename.segments]) - if base_class_str_no_template.startswith('vp'): - self.depends.append(base_class_str_no_template) - # if name_cpp == 'vpColVector': - cls_result = f'\tpy::class_ {python_ident} = py::class_<{name_cpp}{base_classes_str}>(submodule, "{name_python}");' - methods_str = '' - skip_class = False - # Skip classes that have pure virtual methods since they cannot be instantiated - for method in cls.methods: - if method.pure_virtual: - skip_class = True - break - # if skip_class: - # continue - - # Add to string representation - to_string_str = '' - for friend in cls.friends: - if friend.fn is not None: - is_ostream_operator = True - fn = friend.fn - if fn.return_type is None: - is_ostream_operator = False - else: - return_str = get_type(fn.return_type, {}, {}) - if return_str != 'std::ostream&': - is_ostream_operator = False - if not is_ostream_operator: - continue - if is_ostream_operator: - to_string_str = f''' - {python_ident}.def("__repr__", []({name_cpp} &a) {{ - std::stringstream s; - s << a; - return s.str(); - }});''' - - - - for method in cls.methods: - if method.access is not None and method.access != 'public': - continue - if method.constructor: - params_strs = [] - skip_constructor = False - for param in method.parameters: - param_str = get_type(param.type, {}, header_env.mapping) - - if param_str in header_env.mapping: # TODO: replace param str with raw type: no const or ref - param_str = header_env.mapping[param_str] - - print(param_str) - if param_str is None: - print('Skipping constructor', method) - skip_constructor = True - break - else: - params_strs.append(param_str) - if not skip_constructor: - argument_types = ', '.join(params_strs) - print(argument_types) - ctor_str = f''' - {python_ident}.def(py::init<{argument_types}>());''' - methods_str += ctor_str - else: - pass - result += cls_result - if not skip_class: - result += methods_str - result += to_string_str - return result def generate_module(generate_path: Path) -> None: main_path = generate_path / 'main.cpp' diff --git a/modules/python/generator/header.py b/modules/python/generator/header.py new file mode 100644 index 0000000000..0e091ef53d --- /dev/null +++ b/modules/python/generator/header.py @@ -0,0 +1,246 @@ +from typing import List, Optional, Set, Tuple, Dict, Union +from cxxheaderparser.parserstate import ClassBlockState, State +import pcpp +import cxxheaderparser +from cxxheaderparser.visitor import CxxVisitor +from cxxheaderparser import types +from cxxheaderparser.simple import parse_string, ParsedData, NamespaceScope, ClassScope +from pathlib import Path +import json +from utils import * + +def filter_includes(include_names: Set[str]) -> List[str]: + result = [] + for include_name in include_names: + if include_name.startswith('"') and include_name.endswith('"'): + continue + forbidden_strs = ['winsock', ''] + forbidden_found = False + for forbidden_str in forbidden_strs: + if forbidden_str in include_name: + forbidden_found = True + break + if forbidden_found: + continue + + result.append(include_name) + return result + +def sort_headers(headers: List['HeaderFile']) -> List['HeaderFile']: + def add_level(result: List['HeaderFile'], remainder: List['HeaderFile'], dependencies: Set[str]): + if len(remainder) == 0: + return + + include_in_result_fn = None + if len(result) == 0: + include_in_result_fn = lambda h: len(h.depends) == 0 + else: + include_in_result_fn = lambda h: any(map(lambda x: x in dependencies, h.depends)) + new_remainder = [] + new_dependencies = [] + for header_file in remainder: + has_dependency = include_in_result_fn(header_file) + if has_dependency: + new_dependencies.extend(header_file.contains) + result.append(header_file) + else: + new_remainder.append(header_file) + add_level(result, new_remainder, set(new_dependencies)) + result = [] + add_level(result, headers, set()) + return result + + + +class HeaderEnvironment(): + def __init__(self, data: ParsedData): + self.mapping = self.build_mapping(data.namespace) + def build_mapping(self, data: Union[NamespaceScope, ClassScope], mapping={}, scope: str = ''): + if isinstance(data, NamespaceScope): + for alias in data.using_alias: + mapping[alias.alias] = get_type(alias.type, {}, mapping) + for enum in data.enums: + print(enum) + enum_name = '::'.join([seg.name for seg in enum.base.segments]) + mapping[enum_name] = scope + enum_name + for cls in data.classes: + cls_name = '::'.join([seg.name for seg in cls.class_decl.typename.segments]) + mapping[cls_name] = scope + cls_name + mapping.update(self.build_mapping(cls, mapping=mapping, scope=f'{scope}{cls_name}::')) + for namespace in data.namespaces: + mapping.update(self.build_mapping(data.namespaces[namespace], mapping=mapping, scope=f'{scope}{namespace}::')) + + elif isinstance(data, ClassScope): + for alias in data.using_alias: + mapping[alias.alias] = get_type(alias.type, {}, mapping) + for typedef in data.typedefs: + mapping[typedef.name] = scope + typedef.name + for enum in data.enums: + enum_name = '::'.join([seg.name for seg in enum.typename.segments if not isinstance(seg, types.AnonymousName)]) + mapping[enum_name] = scope + enum_name + for cls in data.classes: + cls_name = '::'.join([seg.name for seg in cls.class_decl.typename.segments]) + mapping[cls_name] = scope + cls_name + mapping.update(self.build_mapping(cls, mapping=mapping, scope=f'{scope}{cls_name}::')) + + return mapping + +class HeaderFile(): + def __init__(self, path: Path, submodule: 'Submodule'): + self.path = path + self.submodule = submodule + content = self.run_preprocessor() + self.includes = [f''] + self.binding_code = None + self.contains = [] + self.depends = [] + self.generate_binding_code(content) + + def run_preprocessor(self): # TODO: run without generating a new file + tmp_file_path = self.submodule.submodule_file_path.parent / "tmp" / self.path.name + argv = [ + '', + # '-N', 'VISP_EXPORT', + '-D', 'visp_deprecated=""', + '-I', '/usr/local/include', + '--passthru-includes', "^((?!vpConfig.h).)*$", + '--passthru-unfound-includes', + '--passthru-comments', + '--line-directive', '', + '-o', f'{tmp_file_path}', + str(self.path.absolute()) + ] + pcpp.CmdPreprocessor(argv) + preprocessed_header_content = None + with open(tmp_file_path, 'r') as header_file: + preprocessed_header_content = '\n'.join(header_file.readlines()) + preprocessed_header_content = preprocessed_header_content.replace('#include<', '#include <') + return preprocessed_header_content + + def generate_binding_code(self, content: str) -> None: + print('Before parsing cpp structure for file: ', self.path) + parsed_data = parse_string(content) + self.binding_code = self.parse_data(parsed_data) + + + def parse_data(self, data: ParsedData): + result = '' + header_env = HeaderEnvironment(data) + for cls in data.namespace.classes: + result += self.generate_class(cls, header_env) + return result + + def generate_class(self, cls: ClassScope, header_env: HeaderEnvironment) -> str: + result = '' + + def generate_class_with_potiental_specialization(name_python: str, owner_specs: Dict[str, str]) -> str: + spec_result = '' + python_ident = f'py{name_python}' + + name_cpp = get_typename(cls.class_decl.typename, owner_specs, header_env.mapping) + + base_classes_str = '' + for base_class in cls.class_decl.bases: + if base_class.access == 'public': + base_classes_str += ', ' + get_typename(base_class.typename, owner_specs, header_env.mapping) + + # if name_cpp == 'vpColVector': + cls_result = f'\tpy::class_ {python_ident} = py::class_<{name_cpp}{base_classes_str}>(submodule, "{name_python}");' + methods_str = '' + skip_class = False + # Skip classes that have pure virtual methods since they cannot be instantiated + for method in cls.methods: + if method.pure_virtual: + skip_class = True + break + # if skip_class: + # continue + + # Add to string representation + to_string_str = '' + for friend in cls.friends: + if friend.fn is not None: + is_ostream_operator = True + fn = friend.fn + if fn.return_type is None: + is_ostream_operator = False + else: + return_str = get_type(fn.return_type, {}, {}) + if return_str != 'std::ostream&': + is_ostream_operator = False + if not is_ostream_operator: + continue + if is_ostream_operator: + to_string_str = f''' + {python_ident}.def("__repr__", []({name_cpp} &a) {{ + std::stringstream s; + s << a; + return s.str(); + }});''' + + for method in cls.methods: + if method.access is not None and method.access != 'public': + continue + if method.constructor: + params_strs = [] + skip_constructor = False + for param in method.parameters: + param_str = get_type(param.type, owner_specs, header_env.mapping) + + if param_str in header_env.mapping: + param_str = header_env.mapping[param_str] + + if param_str is None: + print('Skipping constructor', method) + skip_constructor = True + break + else: + params_strs.append(param_str) + if not skip_constructor: + argument_types = ', '.join(params_strs) + ctor_str = f''' + {python_ident}.def(py::init<{argument_types}>());''' + methods_str += ctor_str + else: + pass + spec_result += cls_result + if not skip_class: + spec_result += methods_str + spec_result += to_string_str + return spec_result + + print(f'Parsing class "{cls.class_decl.typename}"') + name_cpp_no_template = '::'.join([seg.name for seg in cls.class_decl.typename.segments]) + + if self.submodule.class_should_be_ignored(name_cpp_no_template): + return '' + + # Add base classes as requirements + self.contains.append(name_cpp_no_template) + for base_class in cls.class_decl.bases: + if base_class.access == 'public': + base_class_str_no_template = '::'.join([segment.name for segment in base_class.typename.segments]) + if base_class_str_no_template.startswith('vp'): + self.depends.append(base_class_str_no_template) + + if cls.class_decl.template is None: + name_python = name_cpp_no_template.replace('vp', '') + return generate_class_with_potiental_specialization(name_python, {}) + else: + cls_config = self.submodule.get_class_config(name_cpp_no_template) + if cls_config is None or 'specializations' not in cls_config: + print(f'Could not find template specialization for class {name_cpp_no_template}: skipping!') + return '' + else: + specialization_strs = [] + specs = cls_config['specializations'] + template_names = [t.name for t in cls.class_decl.template.params] + for spec in specs: + print('AAAAA' * 100) + python_name = spec['python_name'] + args = spec['arguments'] + assert len(template_names) == len(args), f'Specializing {name_cpp_no_template}: Template arguments are {template_names} but found specialization {args} which has the wrong number of arguments' + spec_dict = {k[0]: k[1] for k in zip(template_names, args)} + specialization_strs.append(generate_class_with_potiental_specialization(python_name, spec_dict)) + print(specialization_strs[-1]) + return '\n'.join(specialization_strs) diff --git a/modules/python/generator/submodule.py b/modules/python/generator/submodule.py new file mode 100644 index 0000000000..009a26984a --- /dev/null +++ b/modules/python/generator/submodule.py @@ -0,0 +1,93 @@ +from typing import List, Optional, Set, Tuple, Dict, Union +from cxxheaderparser.parserstate import ClassBlockState, State +import pcpp +import cxxheaderparser +from cxxheaderparser.visitor import CxxVisitor +from cxxheaderparser import types +from cxxheaderparser.simple import parse_string, ParsedData, NamespaceScope, ClassScope +from pathlib import Path +import json + +from header import HeaderFile, sort_headers, filter_includes + + +class Submodule(): + def __init__(self, name: str, include_path: Path, submodule_file_path: Path): + self.name = name + self.include_path = include_path + self.submodule_file_path = submodule_file_path + self.config_path = Path('config') / (name + '.json') + with open(self.config_path, 'r') as config_file: + self.config = json.load(config_file) + + assert self.include_path.exists(), f'Submodule path {self.include_path} not found' + + + def generate(self) -> None: + headers = [] + for include_file in self.include_path.iterdir(): + if not include_file.name.endswith('.h') and not include_file.name.endswith('.hpp'): + continue + if self.header_should_be_ignored(include_file.name): + continue + header = HeaderFile(include_file, self) + headers.append(header) + # Sort by dependency level so that generation is in correct order + headers = sort_headers(headers) + + header_code = [] + includes = [] + for header in headers: + header_code.append(header.binding_code) + includes.extend(header.includes) + includes_set = filter_includes(set(includes)) + + body = f'py::module_ submodule = m.def_submodule("{self.name}");\n' + '\n'.join(header_code) + includes_strs = [f'#include {include}' for include in includes_set] + includes_str = '\n'.join(includes_strs) + format_str = f''' +#include +#include +#include +#include +{includes_str} + +namespace py = pybind11; + + +void {self.generation_function_name()}(py::module_ &m) {{ + {body} +}} +''' + with open(self.submodule_file_path, 'w') as submodule_file: + submodule_file.write(format_str) + + def generation_function_name(self) -> str: + return f'init_submodule_{self.name}' + + def class_should_be_ignored(self, class_name: str) -> bool: + if self.config['ignored_classes'] is None: + return False + return class_name in self.config['ignored_classes'] + def header_should_be_ignored(self, header_name: str) -> bool: + if self.config['ignored_headers'] is None: + return False + return header_name in self.config['ignored_headers'] + + def get_class_config(self, class_name: str) -> Optional[Dict]: + if 'classes' not in self.config: + return None + if class_name not in self.config['classes']: + return None + return self.config['classes'][class_name] + + + + + +def get_submodules(include_path: Path, generate_path: Path) -> List[Submodule]: + return [ + Submodule('core', include_path / 'core', generate_path / 'core.cpp'), + # Submodule('vs', include_path / 'vs', generate_path / 'vs.cpp') + + ] \ No newline at end of file diff --git a/modules/python/generator/utils.py b/modules/python/generator/utils.py new file mode 100644 index 0000000000..0a7fe9f9e4 --- /dev/null +++ b/modules/python/generator/utils.py @@ -0,0 +1,54 @@ +from typing import List, Optional, Set, Tuple, Dict, Union +from cxxheaderparser.parserstate import ClassBlockState, State +import pcpp +import cxxheaderparser +from cxxheaderparser.visitor import CxxVisitor +from cxxheaderparser import types +from cxxheaderparser.simple import parse_string, ParsedData, NamespaceScope, ClassScope +from pathlib import Path +import json + +def get_typename(typename: types.PQName, owner_specs, header_env_mapping) -> str: + '''Resolve the string representation of a raw type, resolving template specializations and using complete typenames + (aliases, shortened name when in same namescope). + ''' + def segment_repr(segment: types.PQNameSegment) -> str: + spec_str = '' + if isinstance(segment, types.FundamentalSpecifier): + return segment.name + if segment.name in owner_specs: + segment.name = owner_specs[segment.name] + + if segment.specialization is not None: + template_strs = [] + for arg in segment.specialization.args: + template_strs.append(get_type(arg.arg, owner_specs, header_env_mapping)) + + spec_str = f'<{",".join(template_strs)}>' + + return segment.name + spec_str + return '::'.join(list(map(segment_repr, typename.segments))) + +def get_type(param: Union[types.FunctionType, types.DecoratedType, types.Value], owner_specs: Dict[str, str], header_env_mapping: Dict[str, str]) -> Optional[str]: + + if isinstance(param, types.Value): + return ''.join([token.value for token in param.tokens]) + if isinstance(param, types.FunctionType): + return 'FUNCTION' + if isinstance(param, types.Type): + repr_str = get_typename(param.typename, owner_specs, header_env_mapping) + split = repr_str.split('<') + if split[0] in header_env_mapping: + split[0] = header_env_mapping[split[0]] + repr_str = '<'.join(split) + if param.const: + repr_str = 'const ' + repr_str + return repr_str + elif isinstance(param, types.Reference): + repr_str = get_type(param.ref_to, owner_specs, header_env_mapping) + if repr_str is not None: + return repr_str + '&' + else: + return None + else: + return None \ No newline at end of file From 72c6fa363468c8be54cdd46eeb7bcdd27c3abaf5 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Thu, 24 Aug 2023 13:03:20 +0200 Subject: [PATCH 008/169] first working version --- modules/python/config/visual_features.json | 3 +++ modules/python/generator/header.py | 6 ++++++ modules/python/generator/submodule.py | 7 ++++--- 3 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 modules/python/config/visual_features.json diff --git a/modules/python/config/visual_features.json b/modules/python/config/visual_features.json new file mode 100644 index 0000000000..0e0dcd235c --- /dev/null +++ b/modules/python/config/visual_features.json @@ -0,0 +1,3 @@ +{ + +} \ No newline at end of file diff --git a/modules/python/generator/header.py b/modules/python/generator/header.py index 0e091ef53d..8dff953c72 100644 --- a/modules/python/generator/header.py +++ b/modules/python/generator/header.py @@ -138,6 +138,12 @@ def generate_class_with_potiental_specialization(name_python: str, owner_specs: python_ident = f'py{name_python}' name_cpp = get_typename(cls.class_decl.typename, owner_specs, header_env.mapping) + if cls.class_decl.template is not None: + template_strs = [] + for template in cls.class_decl.template.params: + template_strs.append(owner_specs[template.name]) + template_str = f'<{", ".join(template_strs)}>' + name_cpp += template_str base_classes_str = '' for base_class in cls.class_decl.bases: diff --git a/modules/python/generator/submodule.py b/modules/python/generator/submodule.py index 009a26984a..248e4f8e3b 100644 --- a/modules/python/generator/submodule.py +++ b/modules/python/generator/submodule.py @@ -66,11 +66,11 @@ def generation_function_name(self) -> str: return f'init_submodule_{self.name}' def class_should_be_ignored(self, class_name: str) -> bool: - if self.config['ignored_classes'] is None: + if 'ignored_classes' not in self.config: return False return class_name in self.config['ignored_classes'] def header_should_be_ignored(self, header_name: str) -> bool: - if self.config['ignored_headers'] is None: + if 'ignored_headers' not in self.config: return False return header_name in self.config['ignored_headers'] @@ -88,6 +88,7 @@ def get_class_config(self, class_name: str) -> Optional[Dict]: def get_submodules(include_path: Path, generate_path: Path) -> List[Submodule]: return [ Submodule('core', include_path / 'core', generate_path / 'core.cpp'), - # Submodule('vs', include_path / 'vs', generate_path / 'vs.cpp') + # Submodule('visual_features', include_path / 'visual_features', generate_path / 'visual_features.cpp'), + Submodule('vs', include_path / 'vs', generate_path / 'vs.cpp') ] \ No newline at end of file From d011f8198b2f0be604282c8f86fcd0f10dcd0dbd Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Thu, 24 Aug 2023 17:54:51 +0200 Subject: [PATCH 009/169] generating functions wip, some linker issues related to hardcoded paths? --- modules/python/CMakeLists.txt | 4 +- modules/python/generator/header.py | 64 +++++++++++++++++++-------- modules/python/generator/submodule.py | 2 +- 3 files changed, 49 insertions(+), 21 deletions(-) diff --git a/modules/python/CMakeLists.txt b/modules/python/CMakeLists.txt index 870940a5a1..5f75638580 100644 --- a/modules/python/CMakeLists.txt +++ b/modules/python/CMakeLists.txt @@ -4,7 +4,9 @@ project(visp) find_package(pybind11 REQUIRED) find_package(VISP REQUIRED) include_directories(${VISP_INCLUDE_DIRS}) -message(${VISP_INCLUDE_DIRS}) +string(REPLACE ";" "\n" str "${VISP_INCLUDE_DIRS}") +message(STATUS ${str}) +message(${VISP_VERSION}) message(${pybind11_VERSION}) file(GLOB generated_cpp src/generated/*.cpp) pybind11_add_module(visp src/main.cpp ${generated_cpp}) diff --git a/modules/python/generator/header.py b/modules/python/generator/header.py index 8dff953c72..d6bc2aa6b6 100644 --- a/modules/python/generator/header.py +++ b/modules/python/generator/header.py @@ -187,27 +187,53 @@ def generate_class_with_potiental_specialization(name_python: str, owner_specs: for method in cls.methods: if method.access is not None and method.access != 'public': continue + params_strs = [] + skip_method = False + for param in method.parameters: + param_str = get_type(param.type, owner_specs, header_env.mapping) + + if param_str in header_env.mapping: # Convert to fully qualified names + param_str = header_env.mapping[param_str] + + if param_str is None: + print('Skipping constructor', method) + skip_method = True + break + else: + params_strs.append(param_str) + argument_types_str = ', '.join(params_strs) + if skip_method: + print(f'Skipping method because of args return type') + continue if method.constructor: - params_strs = [] - skip_constructor = False - for param in method.parameters: - param_str = get_type(param.type, owner_specs, header_env.mapping) - - if param_str in header_env.mapping: - param_str = header_env.mapping[param_str] - - if param_str is None: - print('Skipping constructor', method) - skip_constructor = True - break - else: - params_strs.append(param_str) - if not skip_constructor: - argument_types = ', '.join(params_strs) - ctor_str = f''' - {python_ident}.def(py::init<{argument_types}>());''' - methods_str += ctor_str + ctor_str = f''' + {python_ident}.def(py::init<{argument_types_str}>());''' + methods_str += ctor_str else: + method_name = '::'.join([segment.name for segment in method.name.segments]) + if method.destructor or method_name.startswith('operator'): + continue + def_type = 'def' # Def for object methods + pointer_to_type = f'({name_cpp}::*)' + if method.template is not None: + print(f'Skipping method {name_cpp}::{method_name} because it is templated') + continue + if method.static: + continue + def_type = 'def_static' + pointer_to_type = '(*)' + if method.inline: + continue + return_type = get_type(method.return_type, owner_specs, header_env.mapping) + if return_type is None: + print(f'Skipping method {name_cpp}::{method_name} because of unhandled return type') + continue + maybe_const = '' + if method.const: + maybe_const = 'const' + cast_str = f'{return_type} {pointer_to_type}({argument_types_str}) {maybe_const}' + method_str = f'{python_ident}.{def_type}("{method_name}", static_cast<{cast_str}>(&{name_cpp}::{method_name}));\n' + methods_str += method_str pass spec_result += cls_result if not skip_class: diff --git a/modules/python/generator/submodule.py b/modules/python/generator/submodule.py index 248e4f8e3b..1d9200f1b2 100644 --- a/modules/python/generator/submodule.py +++ b/modules/python/generator/submodule.py @@ -89,6 +89,6 @@ def get_submodules(include_path: Path, generate_path: Path) -> List[Submodule]: return [ Submodule('core', include_path / 'core', generate_path / 'core.cpp'), # Submodule('visual_features', include_path / 'visual_features', generate_path / 'visual_features.cpp'), - Submodule('vs', include_path / 'vs', generate_path / 'vs.cpp') + # Submodule('vs', include_path / 'vs', generate_path / 'vs.cpp') ] \ No newline at end of file From 7ba6cbad317c07e447b412d2759fcad7057ca54f Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Fri, 25 Aug 2023 13:38:13 +0200 Subject: [PATCH 010/169] Fix linking error due to undefined symbols in ViSP --- .../include/visp3/core/vpHomogeneousMatrix.h | 1 + modules/core/include/visp3/core/vpMatrix.h | 20 +- .../core/include/visp3/core/vpPoseVector.h | 1 + modules/core/src/math/matrix/vpColVector.cpp | 23 +- modules/core/src/math/matrix/vpMatrix.cpp | 221 +++++++++++------- modules/python/CMakeLists.txt | 7 +- modules/python/generator/header.py | 17 +- modules/python/generator/submodule.py | 2 +- modules/python/setup.py | 3 +- modules/python/test.py | 1 + 10 files changed, 182 insertions(+), 114 deletions(-) create mode 100644 modules/python/test.py diff --git a/modules/core/include/visp3/core/vpHomogeneousMatrix.h b/modules/core/include/visp3/core/vpHomogeneousMatrix.h index acbc3f8fc8..2d290a04f8 100644 --- a/modules/core/include/visp3/core/vpHomogeneousMatrix.h +++ b/modules/core/include/visp3/core/vpHomogeneousMatrix.h @@ -306,6 +306,7 @@ class VISP_EXPORT vpHomogeneousMatrix : public vpArray2D // Conversion helper function to avoid circular dependencies and MSVC errors that are not exported in the DLL void parse_json(const nlohmann::json &j); void convert_to_json(nlohmann::json &j) const; +public: #endif diff --git a/modules/core/include/visp3/core/vpMatrix.h b/modules/core/include/visp3/core/vpMatrix.h index 6f4944d061..bb29788554 100644 --- a/modules/core/include/visp3/core/vpMatrix.h +++ b/modules/core/include/visp3/core/vpMatrix.h @@ -157,7 +157,8 @@ class VISP_EXPORT vpMatrix : public vpArray2D Method used to compute the determinant of a square matrix. \sa det() */ - typedef enum { + typedef enum + { LU_DECOMPOSITION /*!< LU decomposition method. */ } vpDetMethod; @@ -166,7 +167,7 @@ class VISP_EXPORT vpMatrix : public vpArray2D Basic constructor of a matrix of double. Number of columns and rows are zero. */ - vpMatrix() : vpArray2D(0, 0) {} + vpMatrix() : vpArray2D(0, 0) { } /*! Constructor that initialize a matrix of double with 0. @@ -174,7 +175,7 @@ class VISP_EXPORT vpMatrix : public vpArray2D \param r : Matrix number of rows. \param c : Matrix number of columns. */ - vpMatrix(unsigned int r, unsigned int c) : vpArray2D(r, c) {} + vpMatrix(unsigned int r, unsigned int c) : vpArray2D(r, c) { } /*! Constructor that initialize a matrix of double with \e val. @@ -183,7 +184,7 @@ class VISP_EXPORT vpMatrix : public vpArray2D \param c : Matrix number of columns. \param val : Each element of the matrix is set to \e val. */ - vpMatrix(unsigned int r, unsigned int c, double val) : vpArray2D(r, c, val) {} + vpMatrix(unsigned int r, unsigned int c, double val) : vpArray2D(r, c, val) { } vpMatrix(const vpMatrix &M, unsigned int r, unsigned int c, unsigned int nrows, unsigned int ncols); /*! @@ -198,9 +199,9 @@ vpRotationMatrix R; vpMatrix M(R); \endcode */ - vpMatrix(const vpArray2D &A) : vpArray2D(A) {} + vpMatrix(const vpArray2D &A) : vpArray2D(A) { } - vpMatrix(const vpMatrix &A) : vpArray2D(A) {} + vpMatrix(const vpMatrix &A) : vpArray2D(A) { } #if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11) vpMatrix(vpMatrix &&A); @@ -210,7 +211,7 @@ vpMatrix M(R); #endif //! Destructor (Memory de-allocation) - virtual ~vpMatrix() {} + virtual ~vpMatrix() { } /*! Removes all elements from the matrix (which are destroyed), @@ -582,7 +583,6 @@ vpMatrix M(R); //------------------------------------------------- /** @name Norms */ //@{ - double euclideanNorm() const; double frobeniusNorm() const; double inducedL2Norm() const; double infinityNorm() const; @@ -993,6 +993,8 @@ vpMatrix M(R); //@} #if defined(VISP_BUILD_DEPRECATED_FUNCTIONS) + double euclideanNorm() const; + /*! @name Deprecated functions */ @@ -1001,7 +1003,7 @@ vpMatrix M(R); \deprecated Only provided for compatibilty with ViSP previous releases. This function does nothing. */ - vp_deprecated void init() {} + vp_deprecated void init() { } /*! \deprecated You should rather use stack(const vpMatrix &A) diff --git a/modules/core/include/visp3/core/vpPoseVector.h b/modules/core/include/visp3/core/vpPoseVector.h index db66e64b30..e0b79d2f16 100644 --- a/modules/core/include/visp3/core/vpPoseVector.h +++ b/modules/core/include/visp3/core/vpPoseVector.h @@ -306,6 +306,7 @@ class VISP_EXPORT vpPoseVector : public vpArray2D // Conversion helper function to avoid circular dependencies and MSVC errors that are not exported in the DLL void parse_json(const nlohmann::json &j); void convert_to_json(nlohmann::json &j) const; +public: #endif #if defined(VISP_BUILD_DEPRECATED_FUNCTIONS) diff --git a/modules/core/src/math/matrix/vpColVector.cpp b/modules/core/src/math/matrix/vpColVector.cpp index e937f3eddc..f6f03daa66 100644 --- a/modules/core/src/math/matrix/vpColVector.cpp +++ b/modules/core/src/math/matrix/vpColVector.cpp @@ -1359,6 +1359,15 @@ void vpColVector::insert(unsigned int i, const vpColVector &v) memcpy(data + i, v.data, sizeof(double) * v.rowNum); } } +void vpColVector::insert(const vpColVector &v, unsigned int i) +{ + if (i + v.size() > this->size()) + throw(vpException(vpException::dimensionError, "Unable to insert a column vector")); + + if (data != NULL && v.data != NULL && v.rowNum > 0) { + memcpy(data + i, v.data, sizeof(double) * v.rowNum); + } +} /*! @@ -1413,7 +1422,8 @@ int vpColVector::print(std::ostream &s, unsigned int length, char const *intro) if (p == std::string::npos) { maxBefore = vpMath::maximum(maxBefore, thislen); // maxAfter remains the same - } else { + } + else { maxBefore = vpMath::maximum(maxBefore, p); maxAfter = vpMath::maximum(maxAfter, thislen - p - 1); } @@ -1446,7 +1456,8 @@ int vpColVector::print(std::ostream &s, unsigned int length, char const *intro) if (p != std::string::npos) { s.width((std::streamsize)maxAfter); s << values[i].substr(p, maxAfter).c_str(); - } else { + } + else { assert(maxAfter > 1); s.width((std::streamsize)maxAfter); s << ".0"; @@ -1584,10 +1595,11 @@ std::ostream &vpColVector::cppPrint(std::ostream &os, const std::string &matrixN if (!octet) { os << matrixName << "[" << i << "] = " << (*this)[i] << "; " << std::endl; - } else { + } + else { for (unsigned int k = 0; k < sizeof(double); ++k) { os << "((unsigned char*)&(" << matrixName << "[" << i << "]) )[" << k << "] = 0x" << std::hex - << (unsigned int)((unsigned char *)&((*this)[i]))[k] << "; " << std::endl; + << (unsigned int)((unsigned char *)&((*this)[i]))[k] << "; " << std::endl; } } } @@ -1711,7 +1723,8 @@ std::ostream &vpColVector::matlabPrint(std::ostream &os) const os << (*this)[i] << ", "; if (this->getRows() != i + 1) { os << ";" << std::endl; - } else { + } + else { os << "]" << std::endl; } } diff --git a/modules/core/src/math/matrix/vpMatrix.cpp b/modules/core/src/math/matrix/vpMatrix.cpp index e2672de885..25979fb4ac 100644 --- a/modules/core/src/math/matrix/vpMatrix.cpp +++ b/modules/core/src/math/matrix/vpMatrix.cpp @@ -238,7 +238,7 @@ std::cout << "M:\n" << M << std::endl; 4 5.5 6 \endcode */ -vpMatrix::vpMatrix(const std::initializer_list &list) : vpArray2D(list) {} +vpMatrix::vpMatrix(const std::initializer_list &list) : vpArray2D(list) { } /*! Construct a matrix from a list of double values. @@ -266,8 +266,7 @@ std::cout << "M:\n" << M << std::endl; */ vpMatrix::vpMatrix(unsigned int nrows, unsigned int ncols, const std::initializer_list &list) : vpArray2D(nrows, ncols, list) -{ -} +{ } /*! Construct a matrix from a list of double values. @@ -291,7 +290,7 @@ std::cout << "M:\n" << M << std::endl; 4 5.5 6 \endcode */ -vpMatrix::vpMatrix(const std::initializer_list > &lists) : vpArray2D(lists) {} +vpMatrix::vpMatrix(const std::initializer_list > &lists) : vpArray2D(lists) { } #endif @@ -488,7 +487,8 @@ void vpMatrix::transpose(vpMatrix &At) const At[j][i] = (*this)[i][j]; } } - } else { + } + else { SimdMatTranspose(data, rowNum, colNum, At.data); } } @@ -539,7 +539,8 @@ void vpMatrix::AAt(vpMatrix &B) const vpMatrix::blas_dgemm(transa, transb, rowNum, rowNum, colNum, alpha, data, colNum, data, colNum, beta, B.data, rowNum); #endif - } else { + } + else { // compute A*A^T for (unsigned int i = 0; i < rowNum; i++) { for (unsigned int j = i; j < rowNum; j++) { @@ -591,7 +592,8 @@ void vpMatrix::AtA(vpMatrix &B) const vpMatrix::blas_dgemm(transa, transb, colNum, colNum, rowNum, alpha, data, colNum, data, colNum, beta, B.data, colNum); #endif - } else { + } + else { for (unsigned int i = 0; i < colNum; i++) { double *Bi = B[i]; for (unsigned int j = 0; j < i; j++) { @@ -973,7 +975,8 @@ void vpMatrix::multMatrixVector(const vpMatrix &A, const vpColVector &v, vpColVe vpMatrix::blas_dgemv(trans, A.colNum, A.rowNum, alpha, A.data, A.colNum, v.data, incr, beta, w.data, incr); #endif - } else { + } + else { w = 0.0; for (unsigned int j = 0; j < A.colNum; j++) { double vj = v[j]; // optimization em 5/12/2006 @@ -1022,7 +1025,8 @@ void vpMatrix::mult2Matrices(const vpMatrix &A, const vpMatrix &B, vpMatrix &C) vpMatrix::blas_dgemm(trans, trans, B.colNum, A.rowNum, A.colNum, alpha, B.data, B.colNum, A.data, A.colNum, beta, C.data, B.colNum); #endif - } else { + } + else { // 5/12/06 some "very" simple optimization to avoid indexation const unsigned int BcolNum = B.colNum; const unsigned int BrowNum = B.rowNum; @@ -1117,7 +1121,8 @@ void vpMatrix::mult2Matrices(const vpMatrix &A, const vpMatrix &B, vpHomogeneous vpMatrix::blas_dgemm(trans, trans, B.colNum, A.rowNum, A.colNum, alpha, B.data, B.colNum, A.data, A.colNum, beta, C.data, B.colNum); #endif - } else { + } + else { // 5/12/06 some "very" simple optimization to avoid indexation const unsigned int BcolNum = B.colNum; const unsigned int BrowNum = B.rowNum; @@ -1255,7 +1260,8 @@ vpMatrix vpMatrix::operator*(const vpVelocityTwistMatrix &V) const vpMatrix::blas_dgemm(trans, trans, V.colNum, rowNum, colNum, alpha, V.data, V.colNum, data, colNum, beta, M.data, M.colNum); #endif - } else { + } + else { SimdMatMulTwist(data, rowNum, V.data, M.data); } @@ -1294,7 +1300,8 @@ vpMatrix vpMatrix::operator*(const vpForceTwistMatrix &V) const vpMatrix::blas_dgemm(trans, trans, V.getCols(), rowNum, colNum, alpha, V.data, V.getCols(), data, colNum, beta, M.data, M.colNum); #endif - } else { + } + else { SimdMatMulTwist(data, rowNum, V.data, M.data); } @@ -2099,7 +2106,7 @@ unsigned int vpMatrix::pseudoInverse(vpMatrix &Ap, double svThreshold) const (void)Ap; (void)svThreshold; throw(vpException(vpException::fatalError, "Cannot compute pseudo-inverse. " - "Install Lapack, Eigen3 or OpenCV 3rd party")); + "Install Lapack, Eigen3 or OpenCV 3rd party")); #endif } @@ -2175,7 +2182,7 @@ int vpMatrix::pseudoInverse(vpMatrix &Ap, int rank_in) const (void)Ap; (void)svThreshold; throw(vpException(vpException::fatalError, "Cannot compute pseudo-inverse. " - "Install Lapack, Eigen3 or OpenCV 3rd party")); + "Install Lapack, Eigen3 or OpenCV 3rd party")); #endif } @@ -2240,7 +2247,7 @@ vpMatrix vpMatrix::pseudoInverse(double svThreshold) const #else (void)svThreshold; throw(vpException(vpException::fatalError, "Cannot compute pseudo-inverse. " - "Install Lapack, Eigen3 or OpenCV 3rd party")); + "Install Lapack, Eigen3 or OpenCV 3rd party")); #endif } @@ -2305,7 +2312,7 @@ vpMatrix vpMatrix::pseudoInverse(int rank_in) const #else (void)svThreshold; throw(vpException(vpException::fatalError, "Cannot compute pseudo-inverse. " - "Install Lapack, Eigen3 or OpenCV 3rd party")); + "Install Lapack, Eigen3 or OpenCV 3rd party")); #endif } @@ -2361,7 +2368,8 @@ vpMatrix vpMatrix::pseudoInverseLapack(double svThreshold) const if (nrows < ncols) { U.resize(ncols, ncols, true); sv.resize(nrows, false); - } else { + } + else { U.resize(nrows, ncols, false); sv.resize(ncols, false); } @@ -2428,7 +2436,8 @@ unsigned int vpMatrix::pseudoInverseLapack(vpMatrix &Ap, double svThreshold) con if (nrows < ncols) { U.resize(ncols, ncols, true); sv.resize(nrows, false); - } else { + } + else { U.resize(nrows, ncols, false); sv.resize(ncols, false); } @@ -2501,7 +2510,8 @@ unsigned int vpMatrix::pseudoInverseLapack(vpMatrix &Ap, vpColVector &sv, double if (nrows < ncols) { U.resize(ncols, ncols, true); sv.resize(nrows, false); - } else { + } + else { U.resize(nrows, ncols, false); sv.resize(ncols, false); } @@ -2636,7 +2646,8 @@ unsigned int vpMatrix::pseudoInverseLapack(vpMatrix &Ap, vpColVector &sv, double if (nrows < ncols) { U.resize(ncols, ncols, true); sv.resize(nrows, false); - } else { + } + else { U.resize(nrows, ncols, false); sv.resize(ncols, false); } @@ -2704,7 +2715,8 @@ vpMatrix vpMatrix::pseudoInverseLapack(int rank_in) const if (nrows < ncols) { U.resize(ncols, ncols, true); sv.resize(nrows, false); - } else { + } + else { U.resize(nrows, ncols, false); sv.resize(ncols, false); } @@ -2778,7 +2790,8 @@ int vpMatrix::pseudoInverseLapack(vpMatrix &Ap, int rank_in) const if (nrows < ncols) { U.resize(ncols, ncols, true); sv.resize(nrows, false); - } else { + } + else { U.resize(nrows, ncols, false); sv.resize(ncols, false); } @@ -2859,7 +2872,8 @@ int vpMatrix::pseudoInverseLapack(vpMatrix &Ap, vpColVector &sv, int rank_in) co if (nrows < ncols) { U.resize(ncols, ncols, true); sv.resize(nrows, false); - } else { + } + else { U.resize(nrows, ncols, false); sv.resize(ncols, false); } @@ -3000,7 +3014,8 @@ int vpMatrix::pseudoInverseLapack(vpMatrix &Ap, vpColVector &sv, int rank_in, vp if (nrows < ncols) { U.resize(ncols, ncols, true); sv.resize(nrows, false); - } else { + } + else { U.resize(nrows, ncols, false); sv.resize(ncols, false); } @@ -3069,7 +3084,8 @@ vpMatrix vpMatrix::pseudoInverseEigen3(double svThreshold) const if (nrows < ncols) { U.resize(ncols, ncols, true); sv.resize(nrows, false); - } else { + } + else { U.resize(nrows, ncols, false); sv.resize(ncols, false); } @@ -3136,7 +3152,8 @@ unsigned int vpMatrix::pseudoInverseEigen3(vpMatrix &Ap, double svThreshold) con if (nrows < ncols) { U.resize(ncols, ncols, true); sv.resize(nrows, false); - } else { + } + else { U.resize(nrows, ncols, false); sv.resize(ncols, false); } @@ -3209,7 +3226,8 @@ unsigned int vpMatrix::pseudoInverseEigen3(vpMatrix &Ap, vpColVector &sv, double if (nrows < ncols) { U.resize(ncols, ncols, true); sv.resize(nrows, false); - } else { + } + else { U.resize(nrows, ncols, false); sv.resize(ncols, false); } @@ -3344,7 +3362,8 @@ unsigned int vpMatrix::pseudoInverseEigen3(vpMatrix &Ap, vpColVector &sv, double if (nrows < ncols) { U.resize(ncols, ncols, true); sv.resize(nrows, false); - } else { + } + else { U.resize(nrows, ncols, false); sv.resize(ncols, false); } @@ -3412,7 +3431,8 @@ vpMatrix vpMatrix::pseudoInverseEigen3(int rank_in) const if (nrows < ncols) { U.resize(ncols, ncols, true); sv.resize(nrows, false); - } else { + } + else { U.resize(nrows, ncols, false); sv.resize(ncols, false); } @@ -3486,7 +3506,8 @@ int vpMatrix::pseudoInverseEigen3(vpMatrix &Ap, int rank_in) const if (nrows < ncols) { U.resize(ncols, ncols, true); sv.resize(nrows, false); - } else { + } + else { U.resize(nrows, ncols, false); sv.resize(ncols, false); } @@ -3567,7 +3588,8 @@ int vpMatrix::pseudoInverseEigen3(vpMatrix &Ap, vpColVector &sv, int rank_in) co if (nrows < ncols) { U.resize(ncols, ncols, true); sv.resize(nrows, false); - } else { + } + else { U.resize(nrows, ncols, false); sv.resize(ncols, false); } @@ -3708,7 +3730,8 @@ int vpMatrix::pseudoInverseEigen3(vpMatrix &Ap, vpColVector &sv, int rank_in, vp if (nrows < ncols) { U.resize(ncols, ncols, true); sv.resize(nrows, false); - } else { + } + else { U.resize(nrows, ncols, false); sv.resize(ncols, false); } @@ -3777,7 +3800,8 @@ vpMatrix vpMatrix::pseudoInverseOpenCV(double svThreshold) const if (nrows < ncols) { U.resize(ncols, ncols, true); sv.resize(nrows, false); - } else { + } + else { U.resize(nrows, ncols, false); sv.resize(ncols, false); } @@ -3844,7 +3868,8 @@ unsigned int vpMatrix::pseudoInverseOpenCV(vpMatrix &Ap, double svThreshold) con if (nrows < ncols) { U.resize(ncols, ncols, true); sv.resize(nrows, false); - } else { + } + else { U.resize(nrows, ncols, false); sv.resize(ncols, false); } @@ -3917,7 +3942,8 @@ unsigned int vpMatrix::pseudoInverseOpenCV(vpMatrix &Ap, vpColVector &sv, double if (nrows < ncols) { U.resize(ncols, ncols, true); sv.resize(nrows, false); - } else { + } + else { U.resize(nrows, ncols, false); sv.resize(ncols, false); } @@ -4052,7 +4078,8 @@ unsigned int vpMatrix::pseudoInverseOpenCV(vpMatrix &Ap, vpColVector &sv, double if (nrows < ncols) { U.resize(ncols, ncols, true); sv.resize(nrows, false); - } else { + } + else { U.resize(nrows, ncols, false); sv.resize(ncols, false); } @@ -4120,7 +4147,8 @@ vpMatrix vpMatrix::pseudoInverseOpenCV(int rank_in) const if (nrows < ncols) { U.resize(ncols, ncols, true); sv.resize(nrows, false); - } else { + } + else { U.resize(nrows, ncols, false); sv.resize(ncols, false); } @@ -4194,7 +4222,8 @@ int vpMatrix::pseudoInverseOpenCV(vpMatrix &Ap, int rank_in) const if (nrows < ncols) { U.resize(ncols, ncols, true); sv.resize(nrows, false); - } else { + } + else { U.resize(nrows, ncols, false); sv.resize(ncols, false); } @@ -4275,7 +4304,8 @@ int vpMatrix::pseudoInverseOpenCV(vpMatrix &Ap, vpColVector &sv, int rank_in) co if (nrows < ncols) { U.resize(ncols, ncols, true); sv.resize(nrows, false); - } else { + } + else { U.resize(nrows, ncols, false); sv.resize(ncols, false); } @@ -4416,7 +4446,8 @@ int vpMatrix::pseudoInverseOpenCV(vpMatrix &Ap, vpColVector &sv, int rank_in, vp if (nrows < ncols) { U.resize(ncols, ncols, true); sv.resize(nrows, false); - } else { + } + else { U.resize(nrows, ncols, false); sv.resize(ncols, false); } @@ -4510,7 +4541,7 @@ unsigned int vpMatrix::pseudoInverse(vpMatrix &Ap, vpColVector &sv, double svThr (void)sv; (void)svThreshold; throw(vpException(vpException::fatalError, "Cannot compute pseudo-inverse. " - "Install Lapack, Eigen3 or OpenCV 3rd party")); + "Install Lapack, Eigen3 or OpenCV 3rd party")); #endif } @@ -4593,7 +4624,7 @@ int vpMatrix::pseudoInverse(vpMatrix &Ap, vpColVector &sv, int rank_in) const (void)sv; (void)svThreshold; throw(vpException(vpException::fatalError, "Cannot compute pseudo-inverse. " - "Install Lapack, Eigen3 or OpenCV 3rd party")); + "Install Lapack, Eigen3 or OpenCV 3rd party")); #endif } /*! @@ -4912,7 +4943,7 @@ unsigned int vpMatrix::pseudoInverse(vpMatrix &Ap, vpColVector &sv, double svThr (void)imAt; (void)kerAt; throw(vpException(vpException::fatalError, "Cannot compute pseudo-inverse. " - "Install Lapack, Eigen3 or OpenCV 3rd party")); + "Install Lapack, Eigen3 or OpenCV 3rd party")); #endif } @@ -4999,7 +5030,7 @@ int main() int rank_out = A.pseudoInverse(A_p, sv, rank_in, imA, imAt, kerAt); if (rank_out != rank_in) { std::cout << "There is a possibility that the pseudo-inverse in wrong." << std::endl; - std::cout << "Are you sure that the matrix rank is " << rank_in << std::endl; +std::cout << "Are you sure that the matrix rank is " << rank_in << std::endl; } A_p.print(std::cout, 10, "A^+ (pseudo-inverse): "); @@ -5018,42 +5049,42 @@ int main() // Reconstruct matrix A from ImA, ImAt, KerAt vpMatrix S(rank, A.getCols()); - for(unsigned int i = 0; i< rank_in; i++) + for (unsigned int i = 0; i< rank_in; i++) S[i][i] = sv[i]; vpMatrix Vt(A.getCols(), A.getCols()); Vt.insert(imAt.t(), 0, 0); Vt.insert(kerAt, rank, 0); (imA * S * Vt).print(std::cout, 10, "Im(A) * S * [Im(A^T) | Ker(A)]^T:"); } - \endcode +\endcode - Once build, the previous example produces the following output: - \code -A: [2,3]= - 2 3 5 - -4 2 3 -A^+ (pseudo-inverse): [3,2]= - 0.117899 -0.190782 - 0.065380 0.039657 - 0.113612 0.052518 +Once build, the previous example produces the following output : +\code +A : [2, 3] = +2 3 5 +-4 2 3 +A^+(pseudo-inverse) : [3, 2] = +0.117899 -0.190782 +0.065380 0.039657 +0.113612 0.052518 Rank in : 2 -Rank out: 2 -Singular values: 6.874359351 4.443330227 -Im(A): [2,2]= - 0.81458 -0.58003 - 0.58003 0.81458 -Im(A^T): [3,2]= - -0.100515 -0.994397 - 0.524244 -0.024967 - 0.845615 -0.102722 -Ker(A): [3,1]= - -0.032738 - -0.851202 - 0.523816 -Im(A) * S * [Im(A^T) | Ker(A)]^T:[2,3]= - 2 3 5 - -4 2 3 - \endcode +Rank out : 2 +Singular values : 6.874359351 4.443330227 +Im(A) : [2, 2] = +0.81458 -0.58003 +0.58003 0.81458 +Im(A^T) : [3, 2] = +-0.100515 -0.994397 +0.524244 -0.024967 +0.845615 -0.102722 +Ker(A) : [3, 1] = +-0.032738 +-0.851202 +0.523816 +Im(A) * S *[Im(A^T) | Ker(A)]^T : [2, 3] = +2 3 5 +-4 2 3 +\endcode */ int vpMatrix::pseudoInverse(vpMatrix &Ap, vpColVector &sv, int rank_in, vpMatrix &imA, vpMatrix &imAt, vpMatrix &kerAt) const @@ -5072,7 +5103,7 @@ int vpMatrix::pseudoInverse(vpMatrix &Ap, vpColVector &sv, int rank_in, vpMatrix (void)imAt; (void)kerAt; throw(vpException(vpException::fatalError, "Cannot compute pseudo-inverse. " - "Install Lapack, Eigen3 or OpenCV 3rd party")); + "Install Lapack, Eigen3 or OpenCV 3rd party")); #endif } @@ -5607,7 +5638,8 @@ int vpMatrix::print(std::ostream &s, unsigned int length, const std::string &int if (p == std::string::npos) { maxBefore = vpMath::maximum(maxBefore, thislen); // maxAfter remains the same - } else { + } + else { maxBefore = vpMath::maximum(maxBefore, p); maxAfter = vpMath::maximum(maxAfter, thislen - p); } @@ -5637,7 +5669,8 @@ int vpMatrix::print(std::ostream &s, unsigned int length, const std::string &int if (p != std::string::npos) { s.width((std::streamsize)maxAfter); s << values[i * n + j].substr(p, maxAfter).c_str(); - } else { + } + else { s.width((std::streamsize)maxAfter); s << ".0"; } @@ -5698,7 +5731,8 @@ std::ostream &vpMatrix::matlabPrint(std::ostream &os) const } if (this->getRows() != i + 1) { os << ";" << std::endl; - } else { + } + else { os << "]" << std::endl; } } @@ -5831,10 +5865,11 @@ std::ostream &vpMatrix::cppPrint(std::ostream &os, const std::string &matrixName for (unsigned int j = 0; j < this->getCols(); ++j) { if (!octet) { os << matrixName << "[" << i << "][" << j << "] = " << (*this)[i][j] << "; " << std::endl; - } else { + } + else { for (unsigned int k = 0; k < sizeof(double); ++k) { os << "((unsigned char*)&(" << matrixName << "[" << i << "][" << j << "]) )[" << k << "] = 0x" << std::hex - << (unsigned int)((unsigned char *)&((*this)[i][j]))[k] << "; " << std::endl; + << (unsigned int)((unsigned char *)&((*this)[i][j]))[k] << "; " << std::endl; } } } @@ -5851,7 +5886,8 @@ void vpMatrix::stack(const vpMatrix &A) { if (rowNum == 0) { *this = A; - } else if (A.getRows() > 0) { + } + else if (A.getRows() > 0) { if (colNum != A.getCols()) { throw(vpException(vpException::dimensionError, "Cannot stack (%dx%d) matrix with (%dx%d) matrix", rowNum, colNum, A.getRows(), A.getCols())); @@ -5882,7 +5918,8 @@ void vpMatrix::stack(const vpRowVector &r) { if (rowNum == 0) { *this = r; - } else { + } + else { if (colNum != r.getCols()) { throw(vpException(vpException::dimensionError, "Cannot stack (%dx%d) matrix with (1x%d) row vector", rowNum, colNum, r.getCols())); @@ -5922,7 +5959,8 @@ void vpMatrix::stack(const vpColVector &c) { if (colNum == 0) { *this = c; - } else { + } + else { if (rowNum != c.getRows()) { throw(vpException(vpException::dimensionError, "Cannot stack (%dx%d) matrix with (%dx1) column vector", rowNum, colNum, c.getRows())); @@ -5961,12 +5999,14 @@ void vpMatrix::insert(const vpMatrix &A, unsigned int r, unsigned int c) if ((r + A.getRows()) <= rowNum && (c + A.getCols()) <= colNum) { if (A.colNum == colNum && data != NULL && A.data != NULL && A.data != data) { memcpy(data + r * colNum, A.data, sizeof(double) * A.size()); - } else if (data != NULL && A.data != NULL && A.data != data) { + } + else if (data != NULL && A.data != NULL && A.data != data) { for (unsigned int i = r; i < (r + A.getRows()); i++) { memcpy(data + i * colNum + c, A.data + (i - r) * A.colNum, sizeof(double) * A.colNum); } } - } else { + } + else { throw vpException(vpException::dimensionError, "Cannot insert (%dx%d) matrix in (%dx%d) matrix at position (%d,%d)", A.getRows(), A.getCols(), rowNum, colNum, r, c); } @@ -6074,7 +6114,7 @@ vpColVector vpMatrix::eigenValues() const #else { throw(vpException(vpException::functionNotImplementedError, "Eigen values computation is not implemented. " - "You should install Lapack 3rd party")); + "You should install Lapack 3rd party")); } #endif return evalue; @@ -6205,7 +6245,7 @@ void vpMatrix::eigenValues(vpColVector &evalue, vpMatrix &evector) const #else { throw(vpException(vpException::functionNotImplementedError, "Eigen values computation is not implemented. " - "You should install Lapack 3rd party")); + "You should install Lapack 3rd party")); } #endif } @@ -6463,7 +6503,8 @@ vpMatrix vpMatrix::expm() const if (colNum != rowNum) { throw(vpException(vpException::dimensionError, "Cannot compute the exponential of a non square (%dx%d) matrix", rowNum, colNum)); - } else { + } + else { #ifdef VISP_HAVE_GSL size_t size_ = rowNum * colNum; double *b = new double[size_]; @@ -6635,7 +6676,8 @@ double vpMatrix::cond(double svThreshold) const if (std::fabs(minsv) > std::numeric_limits::epsilon()) { return maxsv / minsv; - } else { + } + else { return std::numeric_limits::infinity(); } } @@ -6710,7 +6752,8 @@ double vpMatrix::inducedL2Norm() const } } return max; - } else { + } + else { return 0.; } } @@ -6770,7 +6813,7 @@ double vpMatrix::sumSquare() const \sa frobeniusNorm(), infinityNorm(), inducedL2Norm() */ -vp_deprecated double vpMatrix::euclideanNorm() const { return frobeniusNorm(); } +double vpMatrix::euclideanNorm() const { return frobeniusNorm(); } vpMatrix vpMatrix::stackMatrices(const vpColVector &A, const vpColVector &B) { diff --git a/modules/python/CMakeLists.txt b/modules/python/CMakeLists.txt index 5f75638580..850e4e5428 100644 --- a/modules/python/CMakeLists.txt +++ b/modules/python/CMakeLists.txt @@ -1,11 +1,14 @@ -cmake_minimum_required (VERSION 3.5) +cmake_minimum_required (VERSION 3.22) project(visp) find_package(pybind11 REQUIRED) -find_package(VISP REQUIRED) +find_package(VISP 3.5.1 REQUIRED) include_directories(${VISP_INCLUDE_DIRS}) +message(${VISP_DIR}) string(REPLACE ";" "\n" str "${VISP_INCLUDE_DIRS}") message(STATUS ${str}) +string(REPLACE ";" "\n" str "${VISP_LIBRARIES}") +message(STATUS ${str}) message(${VISP_VERSION}) message(${pybind11_VERSION}) file(GLOB generated_cpp src/generated/*.cpp) diff --git a/modules/python/generator/header.py b/modules/python/generator/header.py index d6bc2aa6b6..d828b8b4bc 100644 --- a/modules/python/generator/header.py +++ b/modules/python/generator/header.py @@ -4,7 +4,7 @@ import cxxheaderparser from cxxheaderparser.visitor import CxxVisitor from cxxheaderparser import types -from cxxheaderparser.simple import parse_string, ParsedData, NamespaceScope, ClassScope +from cxxheaderparser.simple import parse_string, ParsedData, NamespaceScope, ClassScope, parse_file from pathlib import Path import json from utils import * @@ -98,12 +98,15 @@ def __init__(self, path: Path, submodule: 'Submodule'): def run_preprocessor(self): # TODO: run without generating a new file tmp_file_path = self.submodule.submodule_file_path.parent / "tmp" / self.path.name + print('Preprocessing', self.path) argv = [ '', - # '-N', 'VISP_EXPORT', - '-D', 'visp_deprecated=""', - '-I', '/usr/local/include', - '--passthru-includes', "^((?!vpConfig.h).)*$", + '-D', 'vp_deprecated=', + '-D', 'VISP_EXPORT=', + '-I', '/home/sfelton/visp_build/include', + '-I', '/usr/include', + '-N', 'VISP_BUILD_DEPRECATED_FUNCTIONS', + '--passthru-includes', "^((?!vpConfig.h|!json.hpp).)*$", '--passthru-unfound-includes', '--passthru-comments', '--line-directive', '', @@ -120,6 +123,8 @@ def run_preprocessor(self): # TODO: run without generating a new file def generate_binding_code(self, content: str) -> None: print('Before parsing cpp structure for file: ', self.path) parsed_data = parse_string(content) + # tmp_file_path = self.submodule.submodule_file_path.parent / "tmp" / self.path.name + # parsed_data = parse_file(str(tmp_file_path)) self.binding_code = self.parse_data(parsed_data) @@ -219,7 +224,7 @@ def generate_class_with_potiental_specialization(name_python: str, owner_specs: print(f'Skipping method {name_cpp}::{method_name} because it is templated') continue if method.static: - continue + #continue def_type = 'def_static' pointer_to_type = '(*)' if method.inline: diff --git a/modules/python/generator/submodule.py b/modules/python/generator/submodule.py index 1d9200f1b2..44af5eb3a9 100644 --- a/modules/python/generator/submodule.py +++ b/modules/python/generator/submodule.py @@ -87,7 +87,7 @@ def get_class_config(self, class_name: str) -> Optional[Dict]: def get_submodules(include_path: Path, generate_path: Path) -> List[Submodule]: return [ - Submodule('core', include_path / 'core', generate_path / 'core.cpp'), + Submodule('core', Path('/home/sfelton/visp-sfelton/modules/core/include/visp3/core'), generate_path / 'core.cpp'), # Submodule('visual_features', include_path / 'visual_features', generate_path / 'visual_features.cpp'), # Submodule('vs', include_path / 'vs', generate_path / 'vs.cpp') diff --git a/modules/python/setup.py b/modules/python/setup.py index 1276c40b41..ce17fe5ae1 100644 --- a/modules/python/setup.py +++ b/modules/python/setup.py @@ -34,15 +34,14 @@ def __init__(self, name: str, sourcedir: str = "") -> None: class CMakeBuild(build_ext): def build_extension(self, ext: CMakeExtension) -> None: - print('RUNNING CMAKE\n' * 10) # Must be in this form due to bug in .resolve() only fixed in Python 3.10+ ext_fullpath = Path.cwd() / self.get_ext_fullpath(ext.name) extdir = ext_fullpath.parent.resolve() # Using this requires trailing slash for auto-detection & inclusion of # auxiliary "native" libs - debug = int(os.environ.get("DEBUG", 0)) if self.debug is None else self.debug + print('DEBUG', debug) cfg = "Debug" if debug else "Release" # CMake lets you override the generator - we need to check this. diff --git a/modules/python/test.py b/modules/python/test.py new file mode 100644 index 0000000000..9207d3b458 --- /dev/null +++ b/modules/python/test.py @@ -0,0 +1 @@ +import visp.core \ No newline at end of file From 96424a664e190333c86947a0052d2e1f8cb45fbf Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Fri, 25 Aug 2023 17:21:23 +0200 Subject: [PATCH 011/169] Start function configuration --- modules/python/CMakeLists.txt | 2 +- modules/python/config/core.json | 10 +++++++++ modules/python/generator/header.py | 30 +++++++++++---------------- modules/python/generator/submodule.py | 2 +- modules/python/generator/utils.py | 17 ++++++++++++++- 5 files changed, 40 insertions(+), 21 deletions(-) diff --git a/modules/python/CMakeLists.txt b/modules/python/CMakeLists.txt index 850e4e5428..575e84735f 100644 --- a/modules/python/CMakeLists.txt +++ b/modules/python/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.22) +cmake_minimum_required (VERSION 3.5) project(visp) find_package(pybind11 REQUIRED) diff --git a/modules/python/config/core.json b/modules/python/config/core.json index 557249eedb..f06f325b86 100644 --- a/modules/python/config/core.json +++ b/modules/python/config/core.json @@ -11,6 +11,16 @@ "arguments": ["double"] } ] + }, + "vpPolygon": { + "methods": + [ + { + "static": true, + "signature": "bool isInside(const std::vector&, const double&, const double&, const PointInPolygonMethod&)", + "custom_name": "isInsideFromPoints" + } + ] } } } \ No newline at end of file diff --git a/modules/python/generator/header.py b/modules/python/generator/header.py index d828b8b4bc..621652985e 100644 --- a/modules/python/generator/header.py +++ b/modules/python/generator/header.py @@ -9,6 +9,8 @@ import json from utils import * + + def filter_includes(include_names: Set[str]) -> List[str]: result = [] for include_name in include_names: @@ -103,8 +105,8 @@ def run_preprocessor(self): # TODO: run without generating a new file '', '-D', 'vp_deprecated=', '-D', 'VISP_EXPORT=', - '-I', '/home/sfelton/visp_build/include', - '-I', '/usr/include', + '-I', '/home/sfelton/software/visp_build/include', + '-I', '/usr/local/include', '-N', 'VISP_BUILD_DEPRECATED_FUNCTIONS', '--passthru-includes', "^((?!vpConfig.h|!json.hpp).)*$", '--passthru-unfound-includes', @@ -193,23 +195,15 @@ def generate_class_with_potiental_specialization(name_python: str, owner_specs: if method.access is not None and method.access != 'public': continue params_strs = [] - skip_method = False - for param in method.parameters: - param_str = get_type(param.type, owner_specs, header_env.mapping) - - if param_str in header_env.mapping: # Convert to fully qualified names - param_str = header_env.mapping[param_str] + params_strs = [get_type(param.type, owner_specs, header_env.mapping) for param in method.parameters] + if any(map(lambda param_str: param_str is None, params_strs)): + print(f'Skipping method {name_cpp}{method.name} because of argument type') + continue + method_signature_internal = get_method_signature(method.name, get_type(method.return_type, owner_specs, header_env.mapping) or "", params_strs) - if param_str is None: - print('Skipping constructor', method) - skip_method = True - break - else: - params_strs.append(param_str) argument_types_str = ', '.join(params_strs) - if skip_method: - print(f'Skipping method because of args return type') - continue + + if method.constructor: ctor_str = f''' {python_ident}.def(py::init<{argument_types_str}>());''' @@ -231,7 +225,7 @@ def generate_class_with_potiental_specialization(name_python: str, owner_specs: continue return_type = get_type(method.return_type, owner_specs, header_env.mapping) if return_type is None: - print(f'Skipping method {name_cpp}::{method_name} because of unhandled return type') + print(f'Skipping method {name_cpp}::{method_name} because of unhandled return type {method.return_type}') continue maybe_const = '' if method.const: diff --git a/modules/python/generator/submodule.py b/modules/python/generator/submodule.py index 44af5eb3a9..4b5ac8cb02 100644 --- a/modules/python/generator/submodule.py +++ b/modules/python/generator/submodule.py @@ -87,7 +87,7 @@ def get_class_config(self, class_name: str) -> Optional[Dict]: def get_submodules(include_path: Path, generate_path: Path) -> List[Submodule]: return [ - Submodule('core', Path('/home/sfelton/visp-sfelton/modules/core/include/visp3/core'), generate_path / 'core.cpp'), + Submodule('core', Path('/home/sfelton/software/visp-sfelton/modules/core/include/visp3/core'), generate_path / 'core.cpp'), # Submodule('visual_features', include_path / 'visual_features', generate_path / 'visual_features.cpp'), # Submodule('vs', include_path / 'vs', generate_path / 'vs.cpp') diff --git a/modules/python/generator/utils.py b/modules/python/generator/utils.py index 0a7fe9f9e4..b7d76df03a 100644 --- a/modules/python/generator/utils.py +++ b/modules/python/generator/utils.py @@ -51,4 +51,19 @@ def get_type(param: Union[types.FunctionType, types.DecoratedType, types.Value], else: return None else: - return None \ No newline at end of file + return None + +def get_method_signature(name: str, return_type: str, params: List[str]) -> str: + print(return_type, name) + return f'{return_type} {name}({", ".join(params)})' + +def method_matches_config(method: types.Method, config: Dict, owner_specs, header_mapping) -> bool: + params_strs = [] + if config['static'] != method.static: + return False + params_strs = [get_type(param.type, owner_specs, header_mapping) or '' for param in method.parameters] + signature = get_method_signature(method.name, get_type(method.return_type, owner_specs, header_mapping) or '', params_strs) + if signature.replace(' ', '') != config['signature']: + return False + + return True \ No newline at end of file From 1313bf5672222d1a2d0102280d54e7570dbc04ac Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Mon, 28 Aug 2023 01:26:36 +0200 Subject: [PATCH 012/169] fixed static overloads generating erros --- modules/python/common.cmake | 17 --- modules/python/config/core.json | 156 +++++++++++++++++++++++++- modules/python/generator/header.py | 61 +++++----- modules/python/generator/submodule.py | 25 ++++- modules/python/generator/utils.py | 18 ++- modules/python/setup.py | 2 +- modules/python/test.py | 5 +- 7 files changed, 232 insertions(+), 52 deletions(-) diff --git a/modules/python/common.cmake b/modules/python/common.cmake index 8214f43add..e69de29bb2 100644 --- a/modules/python/common.cmake +++ b/modules/python/common.cmake @@ -1,17 +0,0 @@ -if(ANDROID) - vp_update(VISP_JAVA_LIB_NAME_SUFFIX "${VISP_VERSION_MAJOR}") - vp_update(JAVA_INSTALL_ROOT "sdk/java") -else() - vp_update(VISP_JAVA_LIB_NAME_SUFFIX "${VISP_VERSION_MAJOR}${VISP_VERSION_MINOR}${VISP_VERSION_PATCH}") -endif() - -# set the list of modules to wrap. -# To add Java Wrapper for a module, find and change the line given below in /CMakeLists.txt: -# vp_add_module( ....) --> vp_add_module( .... WRAP java) -set(VISP_JAVA_MODULES) -foreach(m ${VISP_MODULES_BUILD}) - if (";${VISP_MODULE_${m}_WRAPPERS};" MATCHES ";java;" AND HAVE_${m}) - list(APPEND VISP_JAVA_MODULES ${m}) - #message(STATUS "\t${m}") - endif() -endforeach() diff --git a/modules/python/config/core.json b/modules/python/config/core.json index f06f325b86..a45af53950 100644 --- a/modules/python/config/core.json +++ b/modules/python/config/core.json @@ -10,6 +10,119 @@ "python_name": "ArrayDouble2D", "arguments": ["double"] } + ], + "methods": + [ + { + "static": true, + "signature": "void insert(const vpArray2D &, const vpArray2D &, vpArray2D &, unsigned int, unsigned int)", + "custom_name": "insertStatic" + } + ] + }, + "vpTranslationVector": { + "methods": + [ + { + "static": true, + "signature": "vpMatrix skew(const vpTranslationVector &)", + "custom_name": "skewOf" + }, + { + "static": true, + "signature": "void skew(const vpTranslationVector &, vpMatrix&)", + "custom_name": "skewOf" + } + ] + }, + "vpColVector": { + "methods": [ + { + "static": true, + "signature": "vpColVector stack(const vpColVector &, const vpColVector &)", + "custom_name": "stackVectors" + }, + { + "static": true, + "signature": "void stack(const vpColVector &, const vpColVector &, vpColVector &)", + "custom_name": "stackVectors" + } + ] + }, + "vpRowVector": { + "methods": [ + { + "static": true, + "signature": "vpRowVector stack(const vpRowVector &, const vpRowVector &)", + "custom_name": "stackVectors" + }, + { + "static": true, + "signature": "void stack(const vpRowVector &, const vpRowVector &, vpRowVector &)", + "custom_name": "stackVectors" + } + ] + }, + "vpMatrix": { + "methods": + [ + + { + + "static": true, + "signature": "vpMatrix insert(const vpMatrix &, const vpMatrix &, unsigned int , unsigned int)", + "custom_name": "insertMatrixInMatrix" + }, + { + + "static": true, + "signature": "void insert(const vpMatrix &, const vpMatrix &, vpMatrix &, unsigned int , unsigned int)", + "custom_name": "insertMatrixInMatrix" + }, + { + + "static": true, + "signature": "void kron(const vpMatrix &, const vpMatrix &, vpMatrix &)", + "custom_name": "kronStatic" + }, + { + + "static": true, + "signature": "vpMatrix kron(const vpMatrix &, const vpMatrix &)", + "custom_name": "kronStatic" + }, + { + + "signature": "vpMatrix stack(const vpMatrix &, const vpMatrix &)", + "static": true, + "custom_name": "stackMatrices" + }, + { + "static": true, + "signature": "vpMatrix stack(const vpMatrix &, const vpRowVector &)", + "custom_name": "stackRow" + }, + { + + "signature": "vpMatrix stack(const vpMatrix &, const vpColVector &)", + "static": true, + "custom_name": "stackColumn" + }, + { + "signature": "void stack(const vpMatrix &, const vpMatrix &, vpMatrix &)", + "static": true, + "custom_name": "stackMatrices" + }, + { + "signature": "void stack(const vpMatrix &, const vpRowVector &, vpMatrix &)", + "static": true, + "custom_name": "stackRow" + }, + { + "signature": "void stack(const vpMatrix &, const vpColVector &, vpMatrix &)", + "static": true, + "custom_name": "stackColumn" + } ] }, "vpPolygon": { @@ -17,10 +130,51 @@ [ { "static": true, - "signature": "bool isInside(const std::vector&, const double&, const double&, const PointInPolygonMethod&)", + "signature": "bool isInside(const std::vector&, const double&, const double&, const vpPolygon::PointInPolygonMethod&)", "custom_name": "isInsideFromPoints" } ] + }, + "vpBSpline": { + "methods": + [ + { + "static": true, + "signature": "unsigned int findSpan(double, unsigned int, std::vector &)", + "custom_name": "findSpanFromSpline" + }, + { + "static": true, + "signature": "vpImagePoint computeCurvePoint(double, unsigned int, unsigned int, std::vector &, std::vector&)", + "custom_name": "computeCurvePointFromSpline" + } + ] + }, + "vpQuadProg": { + "methods": + [ + { + "static": true, + "signature": "bool solveQPe(const vpMatrix &, const vpColVector &, vpMatrix, vpColVector, vpColVector &, const double &)", + "custom_name": "solveQPeStatic" + } + ] + }, + "vpDisplay": { + "methods": + [ + { + "static": true, + "signature": "unsigned int getDownScalingFactor(const vpImage &)", + "custom_name": "getImageDownScalingFactor" + }, + { + "static": true, + "signature": "unsigned int getDownScalingFactor(const vpImage &)", + "custom_name": "getImageDownScalingFactor" + } + ] } } + } \ No newline at end of file diff --git a/modules/python/generator/header.py b/modules/python/generator/header.py index 621652985e..1f6dfd0d19 100644 --- a/modules/python/generator/header.py +++ b/modules/python/generator/header.py @@ -8,7 +8,7 @@ from pathlib import Path import json from utils import * - +from dataclasses import dataclass def filter_includes(include_names: Set[str]) -> List[str]: @@ -100,13 +100,14 @@ def __init__(self, path: Path, submodule: 'Submodule'): def run_preprocessor(self): # TODO: run without generating a new file tmp_file_path = self.submodule.submodule_file_path.parent / "tmp" / self.path.name - print('Preprocessing', self.path) + argv = [ '', '-D', 'vp_deprecated=', '-D', 'VISP_EXPORT=', - '-I', '/home/sfelton/software/visp_build/include', + '-I', '/home/sfelton/visp_build/include', '-I', '/usr/local/include', + '-I', '/usr/include', '-N', 'VISP_BUILD_DEPRECATED_FUNCTIONS', '--passthru-includes', "^((?!vpConfig.h|!json.hpp).)*$", '--passthru-unfound-includes', @@ -123,10 +124,7 @@ def run_preprocessor(self): # TODO: run without generating a new file return preprocessed_header_content def generate_binding_code(self, content: str) -> None: - print('Before parsing cpp structure for file: ', self.path) parsed_data = parse_string(content) - # tmp_file_path = self.submodule.submodule_file_path.parent / "tmp" / self.path.name - # parsed_data = parse_file(str(tmp_file_path)) self.binding_code = self.parse_data(parsed_data) @@ -160,14 +158,13 @@ def generate_class_with_potiental_specialization(name_python: str, owner_specs: # if name_cpp == 'vpColVector': cls_result = f'\tpy::class_ {python_ident} = py::class_<{name_cpp}{base_classes_str}>(submodule, "{name_python}");' methods_str = '' - skip_class = False + contains_pure_virtual_methods = False # Skip classes that have pure virtual methods since they cannot be instantiated for method in cls.methods: if method.pure_virtual: - skip_class = True + contains_pure_virtual_methods = True break - # if skip_class: - # continue + # Add to string representation to_string_str = '' @@ -191,38 +188,44 @@ def generate_class_with_potiental_specialization(name_python: str, owner_specs: return s.str(); }});''' + + generated_methods = [] for method in cls.methods: if method.access is not None and method.access != 'public': continue + if method.pure_virtual: + continue params_strs = [] params_strs = [get_type(param.type, owner_specs, header_env.mapping) for param in method.parameters] if any(map(lambda param_str: param_str is None, params_strs)): - print(f'Skipping method {name_cpp}{method.name} because of argument type') + print(f'Skipping method {name_cpp}{get_name(method.name)} because of argument type') continue method_signature_internal = get_method_signature(method.name, get_type(method.return_type, owner_specs, header_env.mapping) or "", params_strs) argument_types_str = ', '.join(params_strs) - - - if method.constructor: + method_config = self.submodule.get_method_config(name_cpp_no_template, method, owner_specs, header_env.mapping) + py_arg_str = ', '.join([f'py::arg("{param.name}")' for param in method.parameters]) + if len(py_arg_str) > 0: + py_arg_str = ', ' + py_arg_str + if method_config['custom_name'] is not None: + print(method_config) + if method.constructor and not contains_pure_virtual_methods: ctor_str = f''' {python_ident}.def(py::init<{argument_types_str}>());''' methods_str += ctor_str else: - method_name = '::'.join([segment.name for segment in method.name.segments]) + method_name = get_name(method.name) + py_method_name = method_config.get('custom_name') or method_name if method.destructor or method_name.startswith('operator'): continue def_type = 'def' # Def for object methods pointer_to_type = f'({name_cpp}::*)' - if method.template is not None: + if method.template is not None and method_config.get('specializations') is None: print(f'Skipping method {name_cpp}::{method_name} because it is templated') continue if method.static: - #continue def_type = 'def_static' pointer_to_type = '(*)' - if method.inline: - continue return_type = get_type(method.return_type, owner_specs, header_env.mapping) if return_type is None: print(f'Skipping method {name_cpp}::{method_name} because of unhandled return type {method.return_type}') @@ -231,13 +234,20 @@ def generate_class_with_potiental_specialization(name_python: str, owner_specs: if method.const: maybe_const = 'const' cast_str = f'{return_type} {pointer_to_type}({argument_types_str}) {maybe_const}' - method_str = f'{python_ident}.{def_type}("{method_name}", static_cast<{cast_str}>(&{name_cpp}::{method_name}));\n' + method_str = f'{python_ident}.{def_type}("{py_method_name}", static_cast<{cast_str}>(&{name_cpp}::{method_name}){py_arg_str});\n' methods_str += method_str - pass + generated_methods.append((py_method_name, method)) + + + error_generating_overloads = get_static_and_instance_overloads(generated_methods) + for error_overload in error_generating_overloads: + print(f'Overload {error_overload} defined for instance and class, this will generate a pybind error') + if len(error_generating_overloads) > 0: + raise RuntimeError + spec_result += cls_result - if not skip_class: - spec_result += methods_str - spec_result += to_string_str + spec_result += methods_str + spec_result += to_string_str return spec_result print(f'Parsing class "{cls.class_decl.typename}"') @@ -267,11 +277,10 @@ def generate_class_with_potiental_specialization(name_python: str, owner_specs: specs = cls_config['specializations'] template_names = [t.name for t in cls.class_decl.template.params] for spec in specs: - print('AAAAA' * 100) python_name = spec['python_name'] args = spec['arguments'] assert len(template_names) == len(args), f'Specializing {name_cpp_no_template}: Template arguments are {template_names} but found specialization {args} which has the wrong number of arguments' spec_dict = {k[0]: k[1] for k in zip(template_names, args)} specialization_strs.append(generate_class_with_potiental_specialization(python_name, spec_dict)) - print(specialization_strs[-1]) + return '\n'.join(specialization_strs) diff --git a/modules/python/generator/submodule.py b/modules/python/generator/submodule.py index 4b5ac8cb02..6334c8ab3b 100644 --- a/modules/python/generator/submodule.py +++ b/modules/python/generator/submodule.py @@ -9,7 +9,7 @@ import json from header import HeaderFile, sort_headers, filter_includes - +from utils import * class Submodule(): def __init__(self, name: str, include_path: Path, submodule_file_path: Path): @@ -81,13 +81,34 @@ def get_class_config(self, class_name: str) -> Optional[Dict]: return None return self.config['classes'][class_name] + def get_method_config(self, class_name: Optional[str], method, owner_specs, header_mapping) -> Dict: + res = { + 'ignore': False, + 'custom_name': None, + 'custom_code': None + } + functions_container = None + keys = ['classes', class_name, 'methods'] if class_name is not None else ['functions'] + tmp = self.config + for k in keys: + if k not in tmp: + return res + tmp = tmp[k] + functions_container = tmp + # print(functions_container) + for function_config in functions_container: + if method_matches_config(method, function_config, owner_specs, header_mapping): + return function_config + + #import sys; sys.exit() + return res def get_submodules(include_path: Path, generate_path: Path) -> List[Submodule]: return [ - Submodule('core', Path('/home/sfelton/software/visp-sfelton/modules/core/include/visp3/core'), generate_path / 'core.cpp'), + Submodule('core', Path('/home/sfelton/visp-sfelton/modules/core/include/visp3/core'), generate_path / 'core.cpp'), # Submodule('visual_features', include_path / 'visual_features', generate_path / 'visual_features.cpp'), # Submodule('vs', include_path / 'vs', generate_path / 'vs.cpp') diff --git a/modules/python/generator/utils.py b/modules/python/generator/utils.py index b7d76df03a..de1790249b 100644 --- a/modules/python/generator/utils.py +++ b/modules/python/generator/utils.py @@ -7,6 +7,8 @@ from cxxheaderparser.simple import parse_string, ParsedData, NamespaceScope, ClassScope from pathlib import Path import json +def get_name(name: types.PQName) -> str: + return '::'.join([segment.name for segment in name.segments]) def get_typename(typename: types.PQName, owner_specs, header_env_mapping) -> str: '''Resolve the string representation of a raw type, resolving template specializations and using complete typenames @@ -54,7 +56,6 @@ def get_type(param: Union[types.FunctionType, types.DecoratedType, types.Value], return None def get_method_signature(name: str, return_type: str, params: List[str]) -> str: - print(return_type, name) return f'{return_type} {name}({", ".join(params)})' def method_matches_config(method: types.Method, config: Dict, owner_specs, header_mapping) -> bool: @@ -62,8 +63,17 @@ def method_matches_config(method: types.Method, config: Dict, owner_specs, heade if config['static'] != method.static: return False params_strs = [get_type(param.type, owner_specs, header_mapping) or '' for param in method.parameters] - signature = get_method_signature(method.name, get_type(method.return_type, owner_specs, header_mapping) or '', params_strs) - if signature.replace(' ', '') != config['signature']: + signature = get_method_signature(get_name(method.name), get_type(method.return_type, owner_specs, header_mapping) or '', params_strs) + config_signature = config['signature'] + for template in owner_specs: + config_signature = config_signature.replace(f'<{template}>', f'<{owner_specs[template]}>') + + if signature.replace(' ', '') != config_signature.replace(' ', ''): return False - return True \ No newline at end of file + return True + +def get_static_and_instance_overloads(methods: List[Tuple[str, types.Method]]) -> Set[str]: + instance_methods = set([method[0] for method in methods if not method[1].static]) + static_methods = set([method[0] for method in methods if method[1].static]) + return instance_methods.intersection(static_methods) diff --git a/modules/python/setup.py b/modules/python/setup.py index ce17fe5ae1..79537ba8ff 100644 --- a/modules/python/setup.py +++ b/modules/python/setup.py @@ -134,7 +134,7 @@ def build_extension(self, ext: CMakeExtension) -> None: # logic and declaration, and simpler if you include description/version in a file. setup( name="visp", - version="0.0.1", + version="0.0.2", author="Samuel Felton", author_email="samuel.felton@irisa.fr", description="Python wrapper for the Visual Servoing Platform", diff --git a/modules/python/test.py b/modules/python/test.py index 9207d3b458..c8b9e2163d 100644 --- a/modules/python/test.py +++ b/modules/python/test.py @@ -1 +1,4 @@ -import visp.core \ No newline at end of file +import visp.core + +if __name__ == '__main__': + T = visp.core.HomogeneousMatrix() \ No newline at end of file From e82a97727ae57963c70315945ec81814fa0ecee7 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Mon, 28 Aug 2023 18:12:48 +0200 Subject: [PATCH 013/169] working on stubs --- modules/python/.gitignore | 3 ++- modules/python/common.cmake | 0 modules/python/generator/header.py | 2 +- modules/python/generator/submodule.py | 2 +- modules/python/setup.py | 2 ++ modules/python/test.py | 30 +++++++++++++++++++++++++-- 6 files changed, 34 insertions(+), 5 deletions(-) delete mode 100644 modules/python/common.cmake diff --git a/modules/python/.gitignore b/modules/python/.gitignore index b3b7e54472..b64b687e4a 100644 --- a/modules/python/.gitignore +++ b/modules/python/.gitignore @@ -1,4 +1,5 @@ *.egg-info src/generated src/main.cpp -build \ No newline at end of file +build +stubs \ No newline at end of file diff --git a/modules/python/common.cmake b/modules/python/common.cmake deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/modules/python/generator/header.py b/modules/python/generator/header.py index 1f6dfd0d19..eb3f258936 100644 --- a/modules/python/generator/header.py +++ b/modules/python/generator/header.py @@ -105,7 +105,7 @@ def run_preprocessor(self): # TODO: run without generating a new file '', '-D', 'vp_deprecated=', '-D', 'VISP_EXPORT=', - '-I', '/home/sfelton/visp_build/include', + '-I', '/home/sfelton/software/visp_build/include', '-I', '/usr/local/include', '-I', '/usr/include', '-N', 'VISP_BUILD_DEPRECATED_FUNCTIONS', diff --git a/modules/python/generator/submodule.py b/modules/python/generator/submodule.py index 6334c8ab3b..28d5557054 100644 --- a/modules/python/generator/submodule.py +++ b/modules/python/generator/submodule.py @@ -108,7 +108,7 @@ def get_method_config(self, class_name: Optional[str], method, owner_specs, head def get_submodules(include_path: Path, generate_path: Path) -> List[Submodule]: return [ - Submodule('core', Path('/home/sfelton/visp-sfelton/modules/core/include/visp3/core'), generate_path / 'core.cpp'), + Submodule('core', Path('/home/sfelton/software/visp-sfelton/modules/core/include/visp3/core'), generate_path / 'core.cpp'), # Submodule('visual_features', include_path / 'visual_features', generate_path / 'visual_features.cpp'), # Submodule('vs', include_path / 'vs', generate_path / 'vs.cpp') diff --git a/modules/python/setup.py b/modules/python/setup.py index 79537ba8ff..11cac75908 100644 --- a/modules/python/setup.py +++ b/modules/python/setup.py @@ -146,6 +146,8 @@ def build_extension(self, ext: CMakeExtension) -> None: ext_modules=[CMakeExtension("visp_python")], cmdclass={"build_ext": CMakeBuild, 'build': build}, zip_safe=False, + package_data={"visp-stubs": ["visp"]}, + packages=['visp-stubs'], extras_require={"test": ["pytest>=6.0"]}, python_requires=">=3.7", ) diff --git a/modules/python/test.py b/modules/python/test.py index c8b9e2163d..e80ee22858 100644 --- a/modules/python/test.py +++ b/modules/python/test.py @@ -1,4 +1,30 @@ -import visp.core +import visp +from visp.core import TranslationVector, ThetaUVector, Matrix +from visp.core import HomogeneousMatrix, ExponentialMap, UniRand, CameraParameters +from visp.core import ColVector if __name__ == '__main__': - T = visp.core.HomogeneousMatrix() \ No newline at end of file + T = HomogeneousMatrix(TranslationVector(1, 0, 1), ThetaUVector(0.0, 0.0, 0.0)) + print(T) + print(f'Homogeneous matrix inverse \n{T.inverse()}') + v = ExponentialMap.inverse(M=T, delta_t=1.0) + print(f'Velocity = {v}') + TT = ExponentialMap.direct(v) + print(f'Original T = \n{T},\nExponentialMap inverse-direct: \n{TT}') + + v = ColVector([i ** 2 for i in range(5)]) + print(f'Vector of size {v.size()} with squared indices is equal to \n{v}') + vt = v.transpose() + print(f'Transpose of col vector is a row vector: {isinstance(vt, visp.core.RowVector)}') + random_gen = UniRand() + + mat = Matrix(5, 5, random_gen.uniform(0.0, 1.0)) + print(f'Matrix = \n{mat}') + print(f'Condition = {mat.cond(1e-5)}') + + print(f'diagonal = \n{mat.getDiag()}') + print(f'Submatrix = \n{mat.extract(0, 0, 2, 2)}') + + cam = CameraParameters(600, 600, 240, 320) + print(cam) + print(cam.get_K()) From fc9271e8d79c684155e82afc06b42d6bfea7a415 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Tue, 29 Aug 2023 17:06:24 +0200 Subject: [PATCH 014/169] working on enums, fix generation order for documentation --- modules/python/generator/header.py | 30 +++++++++++++++++++++++---- modules/python/generator/submodule.py | 11 +++++++--- modules/python/setup.py | 4 ++-- 3 files changed, 36 insertions(+), 9 deletions(-) diff --git a/modules/python/generator/header.py b/modules/python/generator/header.py index eb3f258936..3dbc03b189 100644 --- a/modules/python/generator/header.py +++ b/modules/python/generator/header.py @@ -94,20 +94,21 @@ def __init__(self, path: Path, submodule: 'Submodule'): content = self.run_preprocessor() self.includes = [f''] self.binding_code = None + self.class_decls = [] self.contains = [] self.depends = [] self.generate_binding_code(content) def run_preprocessor(self): # TODO: run without generating a new file tmp_file_path = self.submodule.submodule_file_path.parent / "tmp" / self.path.name - + print(f'preprocessing {self.path}') argv = [ '', '-D', 'vp_deprecated=', '-D', 'VISP_EXPORT=', '-I', '/home/sfelton/software/visp_build/include', '-I', '/usr/local/include', - '-I', '/usr/include', + #'-I', '/usr/include', '-N', 'VISP_BUILD_DEPRECATED_FUNCTIONS', '--passthru-includes', "^((?!vpConfig.h|!json.hpp).)*$", '--passthru-unfound-includes', @@ -133,6 +134,11 @@ def parse_data(self, data: ParsedData): header_env = HeaderEnvironment(data) for cls in data.namespace.classes: result += self.generate_class(cls, header_env) + for enum in data.namespace.enums: + print('=====') + print(enum) + print('=====') + return result def generate_class(self, cls: ClassScope, header_env: HeaderEnvironment) -> str: @@ -157,6 +163,7 @@ def generate_class_with_potiental_specialization(name_python: str, owner_specs: # if name_cpp == 'vpColVector': cls_result = f'\tpy::class_ {python_ident} = py::class_<{name_cpp}{base_classes_str}>(submodule, "{name_python}");' + self.class_decls.append(cls_result) methods_str = '' contains_pure_virtual_methods = False # Skip classes that have pure virtual methods since they cannot be instantiated @@ -211,7 +218,7 @@ def generate_class_with_potiental_specialization(name_python: str, owner_specs: print(method_config) if method.constructor and not contains_pure_virtual_methods: ctor_str = f''' - {python_ident}.def(py::init<{argument_types_str}>());''' + {python_ident}.def(py::init<{argument_types_str}>(){py_arg_str});''' methods_str += ctor_str else: method_name = get_name(method.name) @@ -239,13 +246,28 @@ def generate_class_with_potiental_specialization(name_python: str, owner_specs: generated_methods.append((py_method_name, method)) + for enum in cls.enums: + + print('============') + print(get_type(enum.typename, owner_specs, header_env.mapping)) + print(enum.values) + print('=============') + for typedef in cls.typedefs: + print('typedef============') + print(typedef) + print(get_type(typedef.type, owner_specs, header_env.mapping)) + print(typedef.name) + print('=============') + + + error_generating_overloads = get_static_and_instance_overloads(generated_methods) for error_overload in error_generating_overloads: print(f'Overload {error_overload} defined for instance and class, this will generate a pybind error') if len(error_generating_overloads) > 0: raise RuntimeError - spec_result += cls_result + #spec_result += cls_result spec_result += methods_str spec_result += to_string_str return spec_result diff --git a/modules/python/generator/submodule.py b/modules/python/generator/submodule.py index 28d5557054..9a7d1d225a 100644 --- a/modules/python/generator/submodule.py +++ b/modules/python/generator/submodule.py @@ -36,13 +36,16 @@ def generate(self) -> None: headers = sort_headers(headers) header_code = [] + declarations = [] includes = [] for header in headers: header_code.append(header.binding_code) + declarations.extend(header.class_decls) includes.extend(header.includes) includes_set = filter_includes(set(includes)) - - body = f'py::module_ submodule = m.def_submodule("{self.name}");\n' + '\n'.join(header_code) + submodule_declaration = f'py::module_ submodule = m.def_submodule("{self.name}");\n' + bindings = '\n'.join(header_code) + declarations = '\n'.join(declarations) includes_strs = [f'#include {include}' for include in includes_set] includes_str = '\n'.join(includes_strs) format_str = f''' @@ -56,7 +59,9 @@ def generate(self) -> None: void {self.generation_function_name()}(py::module_ &m) {{ - {body} +{submodule_declaration} +{declarations} +{bindings} }} ''' with open(self.submodule_file_path, 'w') as submodule_file: diff --git a/modules/python/setup.py b/modules/python/setup.py index 11cac75908..de6c5400ec 100644 --- a/modules/python/setup.py +++ b/modules/python/setup.py @@ -146,8 +146,8 @@ def build_extension(self, ext: CMakeExtension) -> None: ext_modules=[CMakeExtension("visp_python")], cmdclass={"build_ext": CMakeBuild, 'build': build}, zip_safe=False, - package_data={"visp-stubs": ["visp"]}, - packages=['visp-stubs'], + # package_data={"visp-stubs": ["visp"]}, + # packages=['visp-stubs'], extras_require={"test": ["pytest>=6.0"]}, python_requires=">=3.7", ) From 38784c2977ce21cafa9a2b4012b2165f0e9713b3 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Wed, 30 Aug 2023 13:15:02 +0200 Subject: [PATCH 015/169] refactoring methods, start work on operators --- modules/python/generator/header.py | 15 ++++++++------- modules/python/generator/methods.py | 20 ++++++++++++++++++++ modules/python/generator/submodule.py | 2 +- 3 files changed, 29 insertions(+), 8 deletions(-) create mode 100644 modules/python/generator/methods.py diff --git a/modules/python/generator/header.py b/modules/python/generator/header.py index 3dbc03b189..c2d50218ed 100644 --- a/modules/python/generator/header.py +++ b/modules/python/generator/header.py @@ -106,7 +106,7 @@ def run_preprocessor(self): # TODO: run without generating a new file '', '-D', 'vp_deprecated=', '-D', 'VISP_EXPORT=', - '-I', '/home/sfelton/software/visp_build/include', + '-I', '/home/sfelton/visp_build/include', '-I', '/usr/local/include', #'-I', '/usr/include', '-N', 'VISP_BUILD_DEPRECATED_FUNCTIONS', @@ -132,6 +132,7 @@ def generate_binding_code(self, content: str) -> None: def parse_data(self, data: ParsedData): result = '' header_env = HeaderEnvironment(data) + print(data.namespace.doxygen) for cls in data.namespace.classes: result += self.generate_class(cls, header_env) for enum in data.namespace.enums: @@ -143,7 +144,7 @@ def parse_data(self, data: ParsedData): def generate_class(self, cls: ClassScope, header_env: HeaderEnvironment) -> str: result = '' - + print('Doxygen', cls.class_decl.doxygen) def generate_class_with_potiental_specialization(name_python: str, owner_specs: Dict[str, str]) -> str: spec_result = '' python_ident = f'py{name_python}' @@ -214,8 +215,7 @@ def generate_class_with_potiental_specialization(name_python: str, owner_specs: py_arg_str = ', '.join([f'py::arg("{param.name}")' for param in method.parameters]) if len(py_arg_str) > 0: py_arg_str = ', ' + py_arg_str - if method_config['custom_name'] is not None: - print(method_config) + if method.constructor and not contains_pure_virtual_methods: ctor_str = f''' {python_ident}.def(py::init<{argument_types_str}>(){py_arg_str});''' @@ -223,8 +223,10 @@ def generate_class_with_potiental_specialization(name_python: str, owner_specs: else: method_name = get_name(method.name) py_method_name = method_config.get('custom_name') or method_name - if method.destructor or method_name.startswith('operator'): + if method.destructor: continue + if method_name.startswith('operator'): + print(f'Found operator {method_name}') def_type = 'def' # Def for object methods pointer_to_type = f'({name_cpp}::*)' if method.template is not None and method_config.get('specializations') is None: @@ -247,7 +249,6 @@ def generate_class_with_potiental_specialization(name_python: str, owner_specs: for enum in cls.enums: - print('============') print(get_type(enum.typename, owner_specs, header_env.mapping)) print(enum.values) @@ -255,7 +256,7 @@ def generate_class_with_potiental_specialization(name_python: str, owner_specs: for typedef in cls.typedefs: print('typedef============') print(typedef) - print(get_type(typedef.type, owner_specs, header_env.mapping)) + # print(get_type(typedef.type, owner_specs, header_env.mapping)) print(typedef.name) print('=============') diff --git a/modules/python/generator/methods.py b/modules/python/generator/methods.py new file mode 100644 index 0000000000..bde18ce99c --- /dev/null +++ b/modules/python/generator/methods.py @@ -0,0 +1,20 @@ +from typing import List, Optional, Set, Tuple, Dict, Union +from cxxheaderparser.parserstate import ClassBlockState, State +import pcpp +import cxxheaderparser +from cxxheaderparser.visitor import CxxVisitor +from cxxheaderparser import types +from cxxheaderparser.simple import parse_string, ParsedData, NamespaceScope, ClassScope, parse_file +from pathlib import Path +import json +from utils import * +from dataclasses import dataclass + +def define_method(py_name: str, method: str, additional_args: List[str]) -> str: + pass + +def method_reference() -> str: + pass + +def get_operators(methods: List[types.Method]) -> Tuple[List[types.Method], Tuple[List[types.Method]]]: + pass diff --git a/modules/python/generator/submodule.py b/modules/python/generator/submodule.py index 9a7d1d225a..7e6f72bda9 100644 --- a/modules/python/generator/submodule.py +++ b/modules/python/generator/submodule.py @@ -113,7 +113,7 @@ def get_method_config(self, class_name: Optional[str], method, owner_specs, head def get_submodules(include_path: Path, generate_path: Path) -> List[Submodule]: return [ - Submodule('core', Path('/home/sfelton/software/visp-sfelton/modules/core/include/visp3/core'), generate_path / 'core.cpp'), + Submodule('core', Path('/home/sfelton/visp-sfelton/modules/core/include/visp3/core'), generate_path / 'core.cpp'), # Submodule('visual_features', include_path / 'visual_features', generate_path / 'visual_features.cpp'), # Submodule('vs', include_path / 'vs', generate_path / 'vs.cpp') From b5261d05145b1bf40a419a33f0c5218a7b0f2328 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Wed, 30 Aug 2023 16:56:49 +0200 Subject: [PATCH 016/169] Major refactoring on method binding generation --- modules/python/generator/header.py | 122 ++++++++++---------------- modules/python/generator/methods.py | 109 +++++++++++++++++++++-- modules/python/generator/submodule.py | 2 +- 3 files changed, 153 insertions(+), 80 deletions(-) diff --git a/modules/python/generator/header.py b/modules/python/generator/header.py index c2d50218ed..74bf17d187 100644 --- a/modules/python/generator/header.py +++ b/modules/python/generator/header.py @@ -7,8 +7,9 @@ from cxxheaderparser.simple import parse_string, ParsedData, NamespaceScope, ClassScope, parse_file from pathlib import Path import json -from utils import * from dataclasses import dataclass +from utils import * +from methods import * def filter_includes(include_names: Set[str]) -> List[str]: @@ -106,7 +107,7 @@ def run_preprocessor(self): # TODO: run without generating a new file '', '-D', 'vp_deprecated=', '-D', 'VISP_EXPORT=', - '-I', '/home/sfelton/visp_build/include', + '-I', '/home/sfelton/software/visp_build/include', '-I', '/usr/local/include', #'-I', '/usr/include', '-N', 'VISP_BUILD_DEPRECATED_FUNCTIONS', @@ -165,7 +166,7 @@ def generate_class_with_potiental_specialization(name_python: str, owner_specs: # if name_cpp == 'vpColVector': cls_result = f'\tpy::class_ {python_ident} = py::class_<{name_cpp}{base_classes_str}>(submodule, "{name_python}");' self.class_decls.append(cls_result) - methods_str = '' + contains_pure_virtual_methods = False # Skip classes that have pure virtual methods since they cannot be instantiated for method in cls.methods: @@ -174,78 +175,52 @@ def generate_class_with_potiental_specialization(name_python: str, owner_specs: break - # Add to string representation - to_string_str = '' - for friend in cls.friends: - if friend.fn is not None: - is_ostream_operator = True - fn = friend.fn - if fn.return_type is None: - is_ostream_operator = False - else: - return_str = get_type(fn.return_type, {}, {}) - if return_str != 'std::ostream&': - is_ostream_operator = False - if not is_ostream_operator: - continue - if is_ostream_operator: - to_string_str = f''' - {python_ident}.def("__repr__", []({name_cpp} &a) {{ - std::stringstream s; - s << a; - return s.str(); - }});''' - generated_methods = [] - for method in cls.methods: - if method.access is not None and method.access != 'public': - continue - if method.pure_virtual: - continue - params_strs = [] + method_strs = [] + bindable_methods_and_config, filtered_strs = get_bindable_methods_with_config(self.submodule, cls.methods, + name_cpp_no_template, owner_specs, header_env.mapping) + print('\n'.join(filtered_strs)) + + constructors, non_constructors = split_methods_with_config(bindable_methods_and_config, lambda m: m.constructor) + + cpp_operator_names = cpp_operator_list() + operators, basic_methods = split_methods_with_config(non_constructors, lambda m: get_name(m.name) in cpp_operator_names) + + # Constructors definitions + if not contains_pure_virtual_methods: + for method, method_config in constructors: + params_strs = [get_type(param.type, owner_specs, header_env.mapping) for param in method.parameters] + py_arg_strs = [f'py::arg("{param.name}")' for param in method.parameters] + ctor_str = f'''{python_ident}.{define_constructor(params_strs, py_arg_strs)};''' + method_strs.append(ctor_str) + + #Operator definitions + for method, method_config in operators: + pass + + # Define classical methods + for method, method_config in basic_methods: + params_strs = [get_type(param.type, owner_specs, header_env.mapping) for param in method.parameters] - if any(map(lambda param_str: param_str is None, params_strs)): - print(f'Skipping method {name_cpp}{get_name(method.name)} because of argument type') - continue - method_signature_internal = get_method_signature(method.name, get_type(method.return_type, owner_specs, header_env.mapping) or "", params_strs) - - argument_types_str = ', '.join(params_strs) - method_config = self.submodule.get_method_config(name_cpp_no_template, method, owner_specs, header_env.mapping) - py_arg_str = ', '.join([f'py::arg("{param.name}")' for param in method.parameters]) - if len(py_arg_str) > 0: - py_arg_str = ', ' + py_arg_str - - if method.constructor and not contains_pure_virtual_methods: - ctor_str = f''' - {python_ident}.def(py::init<{argument_types_str}>(){py_arg_str});''' - methods_str += ctor_str - else: - method_name = get_name(method.name) - py_method_name = method_config.get('custom_name') or method_name - if method.destructor: - continue - if method_name.startswith('operator'): - print(f'Found operator {method_name}') - def_type = 'def' # Def for object methods - pointer_to_type = f'({name_cpp}::*)' - if method.template is not None and method_config.get('specializations') is None: - print(f'Skipping method {name_cpp}::{method_name} because it is templated') - continue - if method.static: - def_type = 'def_static' - pointer_to_type = '(*)' - return_type = get_type(method.return_type, owner_specs, header_env.mapping) - if return_type is None: - print(f'Skipping method {name_cpp}::{method_name} because of unhandled return type {method.return_type}') - continue - maybe_const = '' - if method.const: - maybe_const = 'const' - cast_str = f'{return_type} {pointer_to_type}({argument_types_str}) {maybe_const}' - method_str = f'{python_ident}.{def_type}("{py_method_name}", static_cast<{cast_str}>(&{name_cpp}::{method_name}){py_arg_str});\n' - methods_str += method_str - generated_methods.append((py_method_name, method)) + py_arg_strs = [f'py::arg("{param.name}")' for param in method.parameters] + + method_name = get_name(method.name) + py_method_name = method_config.get('custom_name') or method_name + + return_type = get_type(method.return_type, owner_specs, header_env.mapping) + method_ref_str = ref_to_class_method(method, name_cpp, method_name, return_type, params_strs) + method_str = define_method(py_method_name, method_ref_str, py_arg_strs, method.static) + method_str = f'{python_ident}.{method_str};' + method_strs.append(method_str) + generated_methods.append((py_method_name, method)) + + + # Add to string representation + to_string_str = find_and_define_repr_str(cls, name_cpp, python_ident) + if len(to_string_str) > 0: + method_strs.append(to_string_str) + for enum in cls.enums: @@ -269,8 +244,7 @@ def generate_class_with_potiental_specialization(name_python: str, owner_specs: raise RuntimeError #spec_result += cls_result - spec_result += methods_str - spec_result += to_string_str + spec_result += '\n'.join(method_strs) return spec_result print(f'Parsing class "{cls.class_decl.typename}"') diff --git a/modules/python/generator/methods.py b/modules/python/generator/methods.py index bde18ce99c..810756ee26 100644 --- a/modules/python/generator/methods.py +++ b/modules/python/generator/methods.py @@ -1,4 +1,4 @@ -from typing import List, Optional, Set, Tuple, Dict, Union +from typing import Callable, List, Optional, Set, Tuple, Dict, Union from cxxheaderparser.parserstate import ClassBlockState, State import pcpp import cxxheaderparser @@ -10,11 +10,110 @@ from utils import * from dataclasses import dataclass -def define_method(py_name: str, method: str, additional_args: List[str]) -> str: - pass +def cpp_operator_list(): + symbols = [ + '-', '+', '*', '/', + '++', '--', '%', + '==', '=', '!=', + '>', '>=', '<', '<=', '<=>', + '>>', '<<', '^', + '~', '&', '|', + '&&', '||', '!', + '=', '+=', '-=', '*=', '/=', + '%=', '&=', '|=', '^=', + '<<=', '>>=', + '[]', '->', '->*', + '()', ',' + ] + return [f'operator{s}' for s in symbols] + ['operator'] + + + +def find_and_define_repr_str(cls: ClassScope, cls_name: str, python_ident: str) -> str: + for friend in cls.friends: + if friend.fn is not None: + is_ostream_operator = True + fn = friend.fn + if fn.return_type is None: + is_ostream_operator = False + else: + return_str = get_type(fn.return_type, {}, {}) + if return_str != 'std::ostream&': + is_ostream_operator = False + if not is_ostream_operator: + continue + if is_ostream_operator: + return f''' +{python_ident}.def("__repr__", []({cls_name} &a) {{ + std::stringstream s; + s << a; + return s.str(); +}});''' + return '' + +def ref_to_class_method(method: types.Method, cls_name: str, method_name: str, return_type: str, params: List[str]) -> str: + maybe_const = '' + if method.const: + maybe_const = 'const' + pointer_to_type = f'({cls_name}::*)' if not method.static else '(*)' + cast_str = f'{return_type} {pointer_to_type}({", ".join(params)}) {maybe_const}' + return f'static_cast<{cast_str}>(&{cls_name}::{method_name})' + +def define_method(py_name: str, method: str, additional_args: List[str], static: bool) -> str: + def_type = 'def' if not static else 'def_static' + additional_args_str = ', '.join(additional_args) + if len(additional_args) > 0: + additional_args_str = ', ' + additional_args_str + return f'{def_type}("{py_name}", {method}{additional_args_str})' + +def define_constructor(params: List[str], additional_args: List[str]) -> str: + additional_args_str = ', '.join(additional_args) + if len(additional_args) > 0: + additional_args_str = ', ' + additional_args_str + + return f'def(py::init<{", ".join(params)}>(){additional_args_str})' + +def get_bindable_methods_with_config(submodule: 'Submodule', methods: List[types.Method], cls_name: str, specializations, mapping) -> List[Tuple[types.Method, Dict]]: + bindable_methods = [] + rejection_strs = [] + filtering_predicates_and_motives = [ + (lambda m, _: m.pure_virtual, 'Method is pure virtual'), + (lambda m, _: m.access is None or m.access != 'public', 'Method visibility is not public'), + (lambda m, _: m.destructor, 'Method is destructor'), + (lambda m, conf: m.template is not None and conf.get('specializations') is None, 'Method is templated but no template is provided'), + (lambda m, _: any(get_type(param.type, specializations, mapping) is None for param in m.parameters), 'Method has an unsupported argument type'), + (lambda m, _: not m.constructor and get_type(m.return_type, specializations, mapping) is None, 'Method has an unsupported return type') + ] + for method in methods: + method_config = submodule.get_method_config(cls_name, method, specializations, mapping) + method_can_be_bound = True + for predicate, motive in filtering_predicates_and_motives: + if predicate(method, method_config): + return_str = '' if method.return_type is None else (get_type(method.return_type, specializations, mapping) or '') + method_name = '::'.join(seg.name for seg in method.name.segments) + param_strs = [get_type(param.type, specializations, mapping) or '' for param in method.parameters] + rejection_strs.append(f'{cls_name} {get_method_signature(method_name, return_str, param_strs)} was filtered! Reason: {motive}') + method_can_be_bound = False + break + if method_can_be_bound: + bindable_methods.append((method, method_config)) + + return bindable_methods, rejection_strs + + + +def split_methods_with_config(methods: List[Tuple[types.Method, Dict]], predicate: Callable[[types.Method], bool]) -> Tuple[List[Tuple[types.Method, Dict]], List[Tuple[types.Method, Dict]]]: + matching = [] + non_matching = [] + for method, method_config in methods: + if predicate(method): + matching.append((method, method_config)) + else: + non_matching.append((method, method_config)) + return matching, non_matching + + -def method_reference() -> str: - pass def get_operators(methods: List[types.Method]) -> Tuple[List[types.Method], Tuple[List[types.Method]]]: pass diff --git a/modules/python/generator/submodule.py b/modules/python/generator/submodule.py index 7e6f72bda9..9a7d1d225a 100644 --- a/modules/python/generator/submodule.py +++ b/modules/python/generator/submodule.py @@ -113,7 +113,7 @@ def get_method_config(self, class_name: Optional[str], method, owner_specs, head def get_submodules(include_path: Path, generate_path: Path) -> List[Submodule]: return [ - Submodule('core', Path('/home/sfelton/visp-sfelton/modules/core/include/visp3/core'), generate_path / 'core.cpp'), + Submodule('core', Path('/home/sfelton/software/visp-sfelton/modules/core/include/visp3/core'), generate_path / 'core.cpp'), # Submodule('visual_features', include_path / 'visual_features', generate_path / 'visual_features.cpp'), # Submodule('vs', include_path / 'vs', generate_path / 'vs.cpp') From e573263af440c3039d9c4a68b9a7a49b6304cc63 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Wed, 30 Aug 2023 17:43:02 +0200 Subject: [PATCH 017/169] generating basic operators --- modules/python/generator/header.py | 37 +++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/modules/python/generator/header.py b/modules/python/generator/header.py index 74bf17d187..ab41d0bcab 100644 --- a/modules/python/generator/header.py +++ b/modules/python/generator/header.py @@ -197,7 +197,42 @@ def generate_class_with_potiental_specialization(name_python: str, owner_specs: #Operator definitions for method, method_config in operators: - pass + method_name = get_name(method.name) + params_strs = [get_type(param.type, owner_specs, header_env.mapping) for param in method.parameters] + if len(params_strs) > 1: + print(f'Found operator {name_cpp}{method_name} with more than one parameter, skipping') + continue + elif len(params_strs) < 1: + print(f'Found unary operator {name_cpp}::{method_name}, skipping') + continue + binary_operators = [ + ('==', 'eq'), + ('!=', 'ne'), + ('<', 'lt'), + ('>', 'gt'), + ('<=', 'le'), + ('>=', 'ge'), + ('+', 'add'), + ('-', 'sub'), + ('*', 'mul'), + ('/', 'truediv'), + ('%', 'mod'), + # ('<<', 'lshift'), + # ('>>', 'rshift'), + ('&', 'and'), + ('|', 'or'), + ('^', 'xor'), + ] + binary_op_tuple = None + for tuple in binary_operators: + if method_name == f'operator{tuple[0]}': + operator_str = f''' +{python_ident}.def("__{tuple[1]}__", [](const {name_cpp}& self, {params_strs[0]} o) {{ + return (self {tuple[0]} o); +}}, py::is_operator());''' + method_strs.append(operator_str) + break + # Define classical methods for method, method_config in basic_methods: From 7fcd6e8f1f8d5b82d967f55c051c39ba453a25c5 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Thu, 31 Aug 2023 13:24:45 +0200 Subject: [PATCH 018/169] generate a very basic documentation for the python api --- modules/python/.gitignore | 3 +- modules/python/docs/Makefile | 216 ++++++++++++++++++++++++ modules/python/docs/conf.py | 300 ++++++++++++++++++++++++++++++++++ modules/python/docs/index.rst | 9 + modules/python/docs/visp.rst | 6 + 5 files changed, 533 insertions(+), 1 deletion(-) create mode 100644 modules/python/docs/Makefile create mode 100644 modules/python/docs/conf.py create mode 100644 modules/python/docs/index.rst create mode 100644 modules/python/docs/visp.rst diff --git a/modules/python/.gitignore b/modules/python/.gitignore index b64b687e4a..b154e6e1ce 100644 --- a/modules/python/.gitignore +++ b/modules/python/.gitignore @@ -2,4 +2,5 @@ src/generated src/main.cpp build -stubs \ No newline at end of file +stubs +docs/_build \ No newline at end of file diff --git a/modules/python/docs/Makefile b/modules/python/docs/Makefile new file mode 100644 index 0000000000..4c1a0febdf --- /dev/null +++ b/modules/python/docs/Makefile @@ -0,0 +1,216 @@ +# Makefile for Sphinx documentation +# + +# You can set these variables from the command line. +SPHINXOPTS = +SPHINXBUILD = sphinx-build +PAPER = +BUILDDIR = _build + +# User-friendly check for sphinx-build +ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1) +$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/) +endif + +# Internal variables. +PAPEROPT_a4 = -D latex_paper_size=a4 +PAPEROPT_letter = -D latex_paper_size=letter +ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . +# the i18n builder cannot share the environment and doctrees with the others +I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . + +.PHONY: help +help: + @echo "Please use \`make ' where is one of" + @echo " html to make standalone HTML files" + @echo " dirhtml to make HTML files named index.html in directories" + @echo " singlehtml to make a single large HTML file" + @echo " pickle to make pickle files" + @echo " json to make JSON files" + @echo " htmlhelp to make HTML files and a HTML help project" + @echo " qthelp to make HTML files and a qthelp project" + @echo " applehelp to make an Apple Help Book" + @echo " devhelp to make HTML files and a Devhelp project" + @echo " epub to make an epub" + @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" + @echo " latexpdf to make LaTeX files and run them through pdflatex" + @echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx" + @echo " text to make text files" + @echo " man to make manual pages" + @echo " texinfo to make Texinfo files" + @echo " info to make Texinfo files and run them through makeinfo" + @echo " gettext to make PO message catalogs" + @echo " changes to make an overview of all changed/added/deprecated items" + @echo " xml to make Docutils-native XML files" + @echo " pseudoxml to make pseudoxml-XML files for display purposes" + @echo " linkcheck to check all external links for integrity" + @echo " doctest to run all doctests embedded in the documentation (if enabled)" + @echo " coverage to run coverage check of the documentation (if enabled)" + +.PHONY: clean +clean: + rm -rf $(BUILDDIR)/* + +.PHONY: html +html: + $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html + @echo + @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." + +.PHONY: dirhtml +dirhtml: + $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml + @echo + @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." + +.PHONY: singlehtml +singlehtml: + $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml + @echo + @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." + +.PHONY: pickle +pickle: + $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle + @echo + @echo "Build finished; now you can process the pickle files." + +.PHONY: json +json: + $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json + @echo + @echo "Build finished; now you can process the JSON files." + +.PHONY: htmlhelp +htmlhelp: + $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp + @echo + @echo "Build finished; now you can run HTML Help Workshop with the" \ + ".hhp project file in $(BUILDDIR)/htmlhelp." + +.PHONY: qthelp +qthelp: + $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp + @echo + @echo "Build finished; now you can run "qcollectiongenerator" with the" \ + ".qhcp project file in $(BUILDDIR)/qthelp, like this:" + @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/python_example.qhcp" + @echo "To view the help file:" + @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/python_example.qhc" + +.PHONY: applehelp +applehelp: + $(SPHINXBUILD) -b applehelp $(ALLSPHINXOPTS) $(BUILDDIR)/applehelp + @echo + @echo "Build finished. The help book is in $(BUILDDIR)/applehelp." + @echo "N.B. You won't be able to view it unless you put it in" \ + "~/Library/Documentation/Help or install it in your application" \ + "bundle." + +.PHONY: devhelp +devhelp: + $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp + @echo + @echo "Build finished." + @echo "To view the help file:" + @echo "# mkdir -p $$HOME/.local/share/devhelp/python_example" + @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/python_example" + @echo "# devhelp" + +.PHONY: epub +epub: + $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub + @echo + @echo "Build finished. The epub file is in $(BUILDDIR)/epub." + +.PHONY: latex +latex: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo + @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." + @echo "Run \`make' in that directory to run these through (pdf)latex" \ + "(use \`make latexpdf' here to do that automatically)." + +.PHONY: latexpdf +latexpdf: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo "Running LaTeX files through pdflatex..." + $(MAKE) -C $(BUILDDIR)/latex all-pdf + @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." + +.PHONY: latexpdfja +latexpdfja: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo "Running LaTeX files through platex and dvipdfmx..." + $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja + @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." + +.PHONY: text +text: + $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text + @echo + @echo "Build finished. The text files are in $(BUILDDIR)/text." + +.PHONY: man +man: + $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man + @echo + @echo "Build finished. The manual pages are in $(BUILDDIR)/man." + +.PHONY: texinfo +texinfo: + $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo + @echo + @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." + @echo "Run \`make' in that directory to run these through makeinfo" \ + "(use \`make info' here to do that automatically)." + +.PHONY: info +info: + $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo + @echo "Running Texinfo files through makeinfo..." + make -C $(BUILDDIR)/texinfo info + @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." + +.PHONY: gettext +gettext: + $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale + @echo + @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." + +.PHONY: changes +changes: + $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes + @echo + @echo "The overview file is in $(BUILDDIR)/changes." + +.PHONY: linkcheck +linkcheck: + $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck + @echo + @echo "Link check complete; look for any errors in the above output " \ + "or in $(BUILDDIR)/linkcheck/output.txt." + +.PHONY: doctest +doctest: + $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest + @echo "Testing of doctests in the sources finished, look at the " \ + "results in $(BUILDDIR)/doctest/output.txt." + +.PHONY: coverage +coverage: + $(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(BUILDDIR)/coverage + @echo "Testing of coverage in the sources finished, look at the " \ + "results in $(BUILDDIR)/coverage/python.txt." + +.PHONY: xml +xml: + $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml + @echo + @echo "Build finished. The XML files are in $(BUILDDIR)/xml." + +.PHONY: pseudoxml +pseudoxml: + $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml + @echo + @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml." diff --git a/modules/python/docs/conf.py b/modules/python/docs/conf.py new file mode 100644 index 0000000000..0e2f5fe7a5 --- /dev/null +++ b/modules/python/docs/conf.py @@ -0,0 +1,300 @@ +# +# python_example documentation build configuration file, created by +# sphinx-quickstart on Fri Feb 26 00:29:33 2016. +# +# This file is execfile()d with the current directory set to its +# containing dir. +# +# Note that not all possible configuration values are present in this +# autogenerated file. +# +# All configuration values have a default; values that are commented out +# serve to show the default. + + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +import sys +import os +sys.path.insert(0, os.path.abspath('../build')) + +# -- General configuration ------------------------------------------------ + +# If your documentation needs a minimal Sphinx version, state it here. +# needs_sphinx = '1.0' + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = [ + "sphinx.ext.autodoc", + "sphinx.ext.intersphinx", + "sphinx.ext.autosummary", + "sphinx.ext.napoleon", +] + +autosummary_generate = True + +# Add any paths that contain templates here, relative to this directory. +templates_path = ["_templates"] + +# The suffix(es) of source filenames. +# You can specify multiple suffix as a list of string: +# source_suffix = ['.rst', '.md'] +source_suffix = ".rst" + +# The encoding of source files. +# source_encoding = 'utf-8-sig' + +# The master toctree document. +master_doc = "index" + +# General information about the project. +project = "visp" +copyright = "2023, Inria" +author = "Samuel Felton" + +# The version info for the project you're documenting, acts as replacement for +# |version| and |release|, also used in various other places throughout the +# built documents. +# +# The short X.Y version. +version = "0.0.1" +# The full version, including alpha/beta/rc tags. +release = "0.0.1" + +# The language for content autogenerated by Sphinx. Refer to documentation +# for a list of supported languages. +# +# This is also used if you do content translation via gettext catalogs. +# Usually you set "language" from the command line for these cases. +language = None + +# There are two options for replacing |today|: either, you set today to some +# non-false value, then it is used: +# today = '' +# Else, today_fmt is used as the format for a strftime call. +# today_fmt = '%B %d, %Y' + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +exclude_patterns = ["_build"] + +# The reST default role (used for this markup: `text`) to use for all +# documents. +# default_role = None + +# If true, '()' will be appended to :func: etc. cross-reference text. +# add_function_parentheses = True + +# If true, the current module name will be prepended to all description +# unit titles (such as .. function::). +# add_module_names = True + +# If true, sectionauthor and moduleauthor directives will be shown in the +# output. They are ignored by default. +# show_authors = False + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = "sphinx" + +# A list of ignored prefixes for module index sorting. +# modindex_common_prefix = [] + +# If true, keep warnings as "system message" paragraphs in the built documents. +# keep_warnings = False + +# If true, `todo` and `todoList` produce output, else they produce nothing. +todo_include_todos = False + + +# -- Options for HTML output ---------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +html_theme = 'sphinx_rtd_theme' + +# Theme options are theme-specific and customize the look and feel of a theme +# further. For a list of options available for each theme, see the +# documentation. +# html_theme_options = {} + +# Add any paths that contain custom themes here, relative to this directory. +# html_theme_path = [] + +# The name for this set of Sphinx documents. If None, it defaults to +# " v documentation". +# html_title = None + +# A shorter title for the navigation bar. Default is the same as html_title. +# html_short_title = None + +# The name of an image file (relative to this directory) to place at the top +# of the sidebar. +# html_logo = None + +# The name of an image file (within the static path) to use as favicon of the +# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 +# pixels large. +# html_favicon = None + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ["_static"] + +# Add any extra paths that contain custom files (such as robots.txt or +# .htaccess) here, relative to this directory. These files are copied +# directly to the root of the documentation. +# html_extra_path = [] + +# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, +# using the given strftime format. +# html_last_updated_fmt = '%b %d, %Y' + +# If true, SmartyPants will be used to convert quotes and dashes to +# typographically correct entities. +# html_use_smartypants = True + +# Custom sidebar templates, maps document names to template names. +# html_sidebars = {} + +# Additional templates that should be rendered to pages, maps page names to +# template names. +# html_additional_pages = {} + +# If false, no module index is generated. +# html_domain_indices = True + +# If false, no index is generated. +# html_use_index = True + +# If true, the index is split into individual pages for each letter. +# html_split_index = False + +# If true, links to the reST sources are added to the pages. +# html_show_sourcelink = True + +# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. +# html_show_sphinx = True + +# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. +# html_show_copyright = True + +# If true, an OpenSearch description file will be output, and all pages will +# contain a tag referring to it. The value of this option must be the +# base URL from which the finished HTML is served. +# html_use_opensearch = '' + +# This is the file name suffix for HTML files (e.g. ".xhtml"). +# html_file_suffix = None + +# Language to be used for generating the HTML full-text search index. +# Sphinx supports the following languages: +# 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja' +# 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr' +# html_search_language = 'en' + +# A dictionary with options for the search language support, empty by default. +# Now only 'ja' uses this config value +# html_search_options = {'type': 'default'} + +# The name of a javascript file (relative to the configuration directory) that +# implements a search results scorer. If empty, the default will be used. +# html_search_scorer = 'scorer.js' + +# Output file base name for HTML help builder. +htmlhelp_basename = "vispdoc" + +# -- Options for LaTeX output --------------------------------------------- + +latex_elements = { + # The paper size ('letterpaper' or 'a4paper'). + #'papersize': 'letterpaper', + # The font size ('10pt', '11pt' or '12pt'). + #'pointsize': '10pt', + # Additional stuff for the LaTeX preamble. + #'preamble': '', + # Latex figure (float) alignment + #'figure_align': 'htbp', +} + +# Grouping the document tree into LaTeX files. List of tuples +# (source start file, target name, title, +# author, documentclass [howto, manual, or own class]). +latex_documents = [ + ( + master_doc, + "visp.tex", + "visp Documentation", + "Samuel Felton", + "manual", + ), +] + +# The name of an image file (relative to this directory) to place at the top of +# the title page. +# latex_logo = None + +# For "manual" documents, if this is true, then toplevel headings are parts, +# not chapters. +# latex_use_parts = False + +# If true, show page references after internal links. +# latex_show_pagerefs = False + +# If true, show URL addresses after external links. +# latex_show_urls = False + +# Documents to append as an appendix to all manuals. +# latex_appendices = [] + +# If false, no module index is generated. +# latex_domain_indices = True + + +# -- Options for manual page output --------------------------------------- + +# One entry per manual page. List of tuples +# (source start file, name, description, authors, manual section). +man_pages = [ + (master_doc, "visp", "ViSP Documentation", [author], 1) +] + +# If true, show URL addresses after external links. +# man_show_urls = False + + +# -- Options for Texinfo output ------------------------------------------- + +# Grouping the document tree into Texinfo files. List of tuples +# (source start file, target name, title, author, +# dir menu entry, description, category) +texinfo_documents = [ + ( + master_doc, + "visp", + "ViSP Documentation", + author, + "visp", + "Python binding for ViSP", + "Miscellaneous", + ), +] + +# Documents to append as an appendix to all manuals. +# texinfo_appendices = [] + +# If false, no module index is generated. +# texinfo_domain_indices = True + +# How to display URL addresses: 'footnote', 'no', or 'inline'. +# texinfo_show_urls = 'footnote' + +# If true, do not generate a @detailmenu in the "Top" node's menu. +# texinfo_no_detailmenu = False + + +# Example configuration for intersphinx: refer to the Python standard library. +intersphinx_mapping = {"https://docs.python.org/": None} diff --git a/modules/python/docs/index.rst b/modules/python/docs/index.rst new file mode 100644 index 0000000000..a5a17d9277 --- /dev/null +++ b/modules/python/docs/index.rst @@ -0,0 +1,9 @@ +ViSP Python Documentation +============================ + +Contents: + +.. toctree:: + :maxdepth: 2 + + visp diff --git a/modules/python/docs/visp.rst b/modules/python/docs/visp.rst new file mode 100644 index 0000000000..94f3ef6bb6 --- /dev/null +++ b/modules/python/docs/visp.rst @@ -0,0 +1,6 @@ +ViSP +============= + +.. automodule:: visp.core + :members: + :undoc-members: From a309d4dc5e5c8b29740920389ff509bad5deb3cd Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Fri, 1 Sep 2023 16:31:39 +0200 Subject: [PATCH 019/169] working on enum --- modules/python/generator/enum.py | 21 +++++++++++++++++++++ modules/python/generator/header.py | 4 ---- 2 files changed, 21 insertions(+), 4 deletions(-) create mode 100644 modules/python/generator/enum.py diff --git a/modules/python/generator/enum.py b/modules/python/generator/enum.py new file mode 100644 index 0000000000..cd35229e1d --- /dev/null +++ b/modules/python/generator/enum.py @@ -0,0 +1,21 @@ +from typing import Callable, List, Optional, Set, Tuple, Dict, Union +from cxxheaderparser.parserstate import ClassBlockState, State +import pcpp +import cxxheaderparser +from cxxheaderparser.visitor import CxxVisitor +from cxxheaderparser import types +from cxxheaderparser.simple import parse_string, ParsedData, NamespaceScope, ClassScope, parse_file +from pathlib import Path +import json +from utils import * +from dataclasses import dataclass + +def enum_bindings(root_scope: NamespaceScope, mapping: Dict) -> List[Tuple[str, str]]: + def accumulate_data(scope: Union[NamespaceScope, ClassScope], data: Dict): + for cls in scope.classes: + accumulate_data(cls, data) + if isinstance(scope, NamespaceScope): + for namespace in scope.namespaces: + accumulate_data(namespace, data) + enum_data = {} # Need to go through an intermediate rep, as some enum are typedefed and others are not + for typedef in root_scope.typedefs: diff --git a/modules/python/generator/header.py b/modules/python/generator/header.py index ab41d0bcab..30a3db60d0 100644 --- a/modules/python/generator/header.py +++ b/modules/python/generator/header.py @@ -136,10 +136,6 @@ def parse_data(self, data: ParsedData): print(data.namespace.doxygen) for cls in data.namespace.classes: result += self.generate_class(cls, header_env) - for enum in data.namespace.enums: - print('=====') - print(enum) - print('=====') return result From c0b29791cdc5c8f4afd69945d339fdbe6d86777b Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Fri, 1 Sep 2023 17:46:34 +0200 Subject: [PATCH 020/169] enum work --- modules/python/generator/{enum.py => enum_binding.py} | 5 +++++ modules/python/generator/header.py | 2 ++ 2 files changed, 7 insertions(+) rename modules/python/generator/{enum.py => enum_binding.py} (91%) diff --git a/modules/python/generator/enum.py b/modules/python/generator/enum_binding.py similarity index 91% rename from modules/python/generator/enum.py rename to modules/python/generator/enum_binding.py index cd35229e1d..4a01d586f8 100644 --- a/modules/python/generator/enum.py +++ b/modules/python/generator/enum_binding.py @@ -17,5 +17,10 @@ def accumulate_data(scope: Union[NamespaceScope, ClassScope], data: Dict): if isinstance(scope, NamespaceScope): for namespace in scope.namespaces: accumulate_data(namespace, data) + for enum in scope.enums: + pass + enum_data = {} # Need to go through an intermediate rep, as some enum are typedefed and others are not for typedef in root_scope.typedefs: + print(typedef) + import sys; sys.exit() \ No newline at end of file diff --git a/modules/python/generator/header.py b/modules/python/generator/header.py index 30a3db60d0..78180228c0 100644 --- a/modules/python/generator/header.py +++ b/modules/python/generator/header.py @@ -134,6 +134,8 @@ def parse_data(self, data: ParsedData): result = '' header_env = HeaderEnvironment(data) print(data.namespace.doxygen) + from enum_binding import enum_bindings + enum_bindings(data.namespace, header_env.mapping) for cls in data.namespace.classes: result += self.generate_class(cls, header_env) From 504ca445a6c2b2f57babc2ef685588c133b3409d Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Mon, 4 Sep 2023 18:22:50 +0200 Subject: [PATCH 021/169] Enums almost working, require ignoring those in ignored classes and those that are private --- modules/python/generator/enum_binding.py | 143 +++++++++++++++++++++-- modules/python/generator/header.py | 21 +--- modules/python/generator/utils.py | 2 + 3 files changed, 137 insertions(+), 29 deletions(-) diff --git a/modules/python/generator/enum_binding.py b/modules/python/generator/enum_binding.py index 4a01d586f8..70e3db05d1 100644 --- a/modules/python/generator/enum_binding.py +++ b/modules/python/generator/enum_binding.py @@ -2,25 +2,144 @@ from cxxheaderparser.parserstate import ClassBlockState, State import pcpp import cxxheaderparser -from cxxheaderparser.visitor import CxxVisitor from cxxheaderparser import types -from cxxheaderparser.simple import parse_string, ParsedData, NamespaceScope, ClassScope, parse_file -from pathlib import Path -import json +from cxxheaderparser.simple import NamespaceScope, ClassScope from utils import * from dataclasses import dataclass +@dataclass +class EnumRepr: + id: Optional[int] + name: Optional[str] + values: Optional[List[types.Enumerator]] + + +def is_typedef_to_enum(typedef: types.Typedef): + ''' + Check whether a typedef refers to an enum + ''' + if not isinstance(typedef.type, types.Type): + return False + if not typedef.type.typename.classkey == 'enum': + return False + return True + + +def is_anonymous_name(typename: types.PQName) -> Tuple[bool, int]: + ''' + Check whether the name is anonymous. If it is, then the actual name is defined in a typedef. + ''' + for segment in typename.segments: + if isinstance(segment, types.AnonymousName): + return True, segment.id + return False, 0 + + +def get_owner_py_ident(owner_name: str, root_scope: NamespaceScope) -> Optional[str]: + ''' + Get the the owner's identifier (variable in generated code). + If the owner is not an exported symbol (exported symbols are classes, enums, structs) then None is returned + ''' + scope = get_cpp_identifier_scope(owner_name, root_scope) + + if isinstance(scope, NamespaceScope): + return None + + return f'py{get_name(scope.class_decl.typename).replace("vp", "")}' #TODO: fix for custom names + + + +def get_cpp_identifier_scope(fully_qualified_name: str, root_scope: Union[NamespaceScope, ClassScope]) -> Union[NamespaceScope, ClassScope]: + if fully_qualified_name == '': + return root_scope + segments = fully_qualified_name.split('::') + first_segment, remainder = segments[0], segments[1:] + for cls in root_scope.classes: + if get_name(cls.class_decl.typename) == first_segment: + return get_cpp_identifier_scope('::'.join(remainder), cls) + if isinstance(root_scope, NamespaceScope): + for ns in root_scope.namespaces: + if ns == first_segment: + return get_cpp_identifier_scope('::'.join(remainder), root_scope.namespaces[ns]) + return root_scope + + def enum_bindings(root_scope: NamespaceScope, mapping: Dict) -> List[Tuple[str, str]]: - def accumulate_data(scope: Union[NamespaceScope, ClassScope], data: Dict): + final_data: List[EnumRepr] = [] + temp_data: List[EnumRepr] = [] # Data that is incomplete for preprocessing + match_id = lambda repr, enum_id: repr.id is not None and repr.id == enum_id + match_name = lambda repr, full_name: repr.name is not None and full_name is not None and repr.name == full_name + enum_repr_is_ready = lambda repr: repr.name is not None and repr.values is not None + + def accumulate_data(scope: Union[NamespaceScope, ClassScope]): for cls in scope.classes: - accumulate_data(cls, data) + accumulate_data(cls) if isinstance(scope, NamespaceScope): for namespace in scope.namespaces: - accumulate_data(namespace, data) + accumulate_data(scope.namespaces[namespace]) for enum in scope.enums: - pass + anonymous_enum, enum_id = is_anonymous_name(enum.typename) + + full_name = get_typename(enum.typename, {}, mapping) if not anonymous_enum else None + if full_name == 'PointInPolygonMethod': + print('MAPPING in enum', mapping) + matches = lambda repr: match_id(repr, enum_id) or match_name(repr, full_name) + matching = list(filter(matches, temp_data)) + assert len(matching) <= 1, f"There cannot be more than one repr found. Matches = {matching}" + if len(matching) == 0: + temp_data.append(EnumRepr(enum_id, full_name, enum.values)) + else: + if full_name is not None: + matching[0].name = full_name + if enum.values is not None: + matching[0].values = enum.values + + for typedef in scope.typedefs: + if not is_typedef_to_enum(typedef): + continue + + anonymous_enum, enum_id = is_anonymous_name(typedef.type.typename) + full_name = mapping[typedef.name] + print('FULL NAME = ', full_name) + + matches = lambda repr: match_id(repr, enum_id) or match_name(repr, full_name) + matching = list(filter(matches, temp_data)) + assert len(matching) <= 1, f"There cannot be more than one repr found. Matches = {matching}" + if len(matching) == 0: + temp_data.append(EnumRepr(enum_id, full_name, None)) + else: + if full_name is not None: + matching[0].name = full_name + + ready_enums = list(filter(enum_repr_is_ready, temp_data)) + for repr in ready_enums: + final_data.append(repr) + temp_data.remove(repr) + + + + + accumulate_data(root_scope) + print(temp_data, final_data) + assert len(temp_data) == 0, f'Found an uncomplete definition, this should not happen: {temp_data}' + + result = [] + + for enum_repr in final_data: + py_name = enum_repr.name.split('::')[-1].replace('vp', '') + py_ident = f'py{py_name}' + owner_full_name = '::'.join(enum_repr.name.split('::')[:-1]) + owner_py_ident = get_owner_py_ident(owner_full_name, root_scope) or 'submodule' + has_owner = len(owner_full_name) > 0 + + declaration = f'py::enum_<{enum_repr.name}> {py_ident}({owner_py_ident}, "{py_name}", py::arithmetic());' + values = [] + for enumerator in enum_repr.values: + values.append(f'{py_ident}.value("{enumerator.name}", {enum_repr.name}::{enumerator.name});') + + values.append(f'{py_ident}.export_values();') + definition = '\n'.join(values) + result.append((declaration, definition)) + - enum_data = {} # Need to go through an intermediate rep, as some enum are typedefed and others are not - for typedef in root_scope.typedefs: - print(typedef) - import sys; sys.exit() \ No newline at end of file + return result \ No newline at end of file diff --git a/modules/python/generator/header.py b/modules/python/generator/header.py index 78180228c0..4cf19b28e5 100644 --- a/modules/python/generator/header.py +++ b/modules/python/generator/header.py @@ -135,10 +135,12 @@ def parse_data(self, data: ParsedData): header_env = HeaderEnvironment(data) print(data.namespace.doxygen) from enum_binding import enum_bindings - enum_bindings(data.namespace, header_env.mapping) for cls in data.namespace.classes: result += self.generate_class(cls, header_env) - + enum_decls_and_bindings = enum_bindings(data.namespace, header_env.mapping) + for declaration, binding in enum_decls_and_bindings: + self.class_decls.append(declaration) + result += binding return result def generate_class(self, cls: ClassScope, header_env: HeaderEnvironment) -> str: @@ -255,21 +257,6 @@ def generate_class_with_potiental_specialization(name_python: str, owner_specs: method_strs.append(to_string_str) - - for enum in cls.enums: - print('============') - print(get_type(enum.typename, owner_specs, header_env.mapping)) - print(enum.values) - print('=============') - for typedef in cls.typedefs: - print('typedef============') - print(typedef) - # print(get_type(typedef.type, owner_specs, header_env.mapping)) - print(typedef.name) - print('=============') - - - error_generating_overloads = get_static_and_instance_overloads(generated_methods) for error_overload in error_generating_overloads: print(f'Overload {error_overload} defined for instance and class, this will generate a pybind error') diff --git a/modules/python/generator/utils.py b/modules/python/generator/utils.py index de1790249b..7eb497194c 100644 --- a/modules/python/generator/utils.py +++ b/modules/python/generator/utils.py @@ -20,6 +20,8 @@ def segment_repr(segment: types.PQNameSegment) -> str: return segment.name if segment.name in owner_specs: segment.name = owner_specs[segment.name] + if segment.name in header_env_mapping: + segment.name = header_env_mapping[segment.name] if segment.specialization is not None: template_strs = [] From cf43060af7e01545a7eec66ae45c4e1da72a97d5 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Tue, 5 Sep 2023 01:51:38 +0200 Subject: [PATCH 022/169] Enum export is working! --- .../docs/_templates/custom-class-template.rst | 32 +++++++++ .../_templates/custom-module-template.rst | 66 +++++++++++++++++++ modules/python/docs/conf.py | 2 +- modules/python/docs/index.rst | 7 +- modules/python/docs/visp.rst | 6 -- modules/python/generator/enum_binding.py | 50 +++++++++----- modules/python/generator/header.py | 6 +- modules/python/generator/submodule.py | 3 +- 8 files changed, 140 insertions(+), 32 deletions(-) create mode 100644 modules/python/docs/_templates/custom-class-template.rst create mode 100644 modules/python/docs/_templates/custom-module-template.rst delete mode 100644 modules/python/docs/visp.rst diff --git a/modules/python/docs/_templates/custom-class-template.rst b/modules/python/docs/_templates/custom-class-template.rst new file mode 100644 index 0000000000..16ebb2f338 --- /dev/null +++ b/modules/python/docs/_templates/custom-class-template.rst @@ -0,0 +1,32 @@ +{{ fullname | escape | underline}} + +.. currentmodule:: {{ module }} + +.. autoclass:: {{ objname }} + :members: + :show-inheritance: + :inherited-members: + + {% block methods %} + .. automethod:: __init__ + + {% if methods %} + .. rubric:: {{ _('Methods') }} + + .. autosummary:: + {% for item in methods %} + ~{{ name }}.{{ item }} + {%- endfor %} + {% endif %} + {% endblock %} + + {% block attributes %} + {% if attributes %} + .. rubric:: {{ _('Attributes') }} + + .. autosummary:: + {% for item in attributes %} + ~{{ name }}.{{ item }} + {%- endfor %} + {% endif %} + {% endblock %} \ No newline at end of file diff --git a/modules/python/docs/_templates/custom-module-template.rst b/modules/python/docs/_templates/custom-module-template.rst new file mode 100644 index 0000000000..74078355f2 --- /dev/null +++ b/modules/python/docs/_templates/custom-module-template.rst @@ -0,0 +1,66 @@ +{{ fullname | escape | underline}} + +.. automodule:: {{ fullname }} + + {% block attributes %} + {% if attributes %} + .. rubric:: Module Attributes + + .. autosummary:: + :toctree: + {% for item in attributes %} + {{ item }} + {%- endfor %} + {% endif %} + {% endblock %} + + {% block functions %} + {% if functions %} + .. rubric:: {{ _('Functions') }} + + .. autosummary:: + :toctree: + {% for item in functions %} + {{ item }} + {%- endfor %} + {% endif %} + {% endblock %} + + {% block classes %} + {% if classes %} + .. rubric:: {{ _('Classes') }} + + .. autosummary:: + :toctree: + :template: custom-class-template.rst + {% for item in classes %} + {{ item }} + {%- endfor %} + {% endif %} + {% endblock %} + + {% block exceptions %} + {% if exceptions %} + .. rubric:: {{ _('Exceptions') }} + + .. autosummary:: + :toctree: + {% for item in exceptions %} + {{ item }} + {%- endfor %} + {% endif %} + {% endblock %} + +{% block modules %} +{% if modules %} +.. rubric:: Modules + +.. autosummary:: + :toctree: + :template: custom-module-template.rst + :recursive: +{% for item in modules %} + {{ item }} +{%- endfor %} +{% endif %} +{% endblock %} \ No newline at end of file diff --git a/modules/python/docs/conf.py b/modules/python/docs/conf.py index 0e2f5fe7a5..b6c1c004f5 100644 --- a/modules/python/docs/conf.py +++ b/modules/python/docs/conf.py @@ -79,7 +79,7 @@ # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. -exclude_patterns = ["_build"] +exclude_patterns = ["_build", "_templates"] # The reST default role (used for this markup: `text`) to use for all # documents. diff --git a/modules/python/docs/index.rst b/modules/python/docs/index.rst index a5a17d9277..38ce10010e 100644 --- a/modules/python/docs/index.rst +++ b/modules/python/docs/index.rst @@ -3,7 +3,8 @@ ViSP Python Documentation Contents: -.. toctree:: - :maxdepth: 2 +.. autosummary:: + :toctree: generated + :recursive: - visp + visp diff --git a/modules/python/docs/visp.rst b/modules/python/docs/visp.rst deleted file mode 100644 index 94f3ef6bb6..0000000000 --- a/modules/python/docs/visp.rst +++ /dev/null @@ -1,6 +0,0 @@ -ViSP -============= - -.. automodule:: visp.core - :members: - :undoc-members: diff --git a/modules/python/generator/enum_binding.py b/modules/python/generator/enum_binding.py index 70e3db05d1..32f607d83e 100644 --- a/modules/python/generator/enum_binding.py +++ b/modules/python/generator/enum_binding.py @@ -6,12 +6,13 @@ from cxxheaderparser.simple import NamespaceScope, ClassScope from utils import * from dataclasses import dataclass - +from submodule import Submodule @dataclass class EnumRepr: id: Optional[int] name: Optional[str] values: Optional[List[types.Enumerator]] + public_access: bool = True def is_typedef_to_enum(typedef: types.Typedef): @@ -64,73 +65,86 @@ def get_cpp_identifier_scope(fully_qualified_name: str, root_scope: Union[Namesp return root_scope -def enum_bindings(root_scope: NamespaceScope, mapping: Dict) -> List[Tuple[str, str]]: +def enum_bindings(root_scope: NamespaceScope, mapping: Dict, submodule: Submodule) -> List[Tuple[str, str]]: final_data: List[EnumRepr] = [] temp_data: List[EnumRepr] = [] # Data that is incomplete for preprocessing match_id = lambda repr, enum_id: repr.id is not None and repr.id == enum_id match_name = lambda repr, full_name: repr.name is not None and full_name is not None and repr.name == full_name - enum_repr_is_ready = lambda repr: repr.name is not None and repr.values is not None + enum_repr_is_ready = lambda repr: repr.name is not None and repr.values is not None and repr.public_access def accumulate_data(scope: Union[NamespaceScope, ClassScope]): + if isinstance(scope, ClassScope): + if scope.class_decl.access is not None and scope.class_decl.access != 'public': + return for cls in scope.classes: accumulate_data(cls) if isinstance(scope, NamespaceScope): for namespace in scope.namespaces: accumulate_data(scope.namespaces[namespace]) for enum in scope.enums: + public_access = True + if enum.access is None or enum.access != 'public': + public_access = False anonymous_enum, enum_id = is_anonymous_name(enum.typename) full_name = get_typename(enum.typename, {}, mapping) if not anonymous_enum else None - if full_name == 'PointInPolygonMethod': - print('MAPPING in enum', mapping) + matches = lambda repr: match_id(repr, enum_id) or match_name(repr, full_name) matching = list(filter(matches, temp_data)) assert len(matching) <= 1, f"There cannot be more than one repr found. Matches = {matching}" if len(matching) == 0: - temp_data.append(EnumRepr(enum_id, full_name, enum.values)) + temp_data.append(EnumRepr(enum_id, full_name, enum.values, public_access)) else: if full_name is not None: matching[0].name = full_name if enum.values is not None: matching[0].values = enum.values + matching[0].public_access = matching[0].public_access and public_access # If we found a private def somewhere, mark enum as private for typedef in scope.typedefs: if not is_typedef_to_enum(typedef): continue + public_access = True + if typedef.access is None or typedef.access != 'public': + public_access = False anonymous_enum, enum_id = is_anonymous_name(typedef.type.typename) full_name = mapping[typedef.name] - print('FULL NAME = ', full_name) matches = lambda repr: match_id(repr, enum_id) or match_name(repr, full_name) matching = list(filter(matches, temp_data)) assert len(matching) <= 1, f"There cannot be more than one repr found. Matches = {matching}" if len(matching) == 0: - temp_data.append(EnumRepr(enum_id, full_name, None)) + temp_data.append(EnumRepr(enum_id, full_name, None, public_access)) else: if full_name is not None: matching[0].name = full_name + matching[0].public_access = matching[0].public_access and public_access ready_enums = list(filter(enum_repr_is_ready, temp_data)) for repr in ready_enums: final_data.append(repr) temp_data.remove(repr) - - - accumulate_data(root_scope) - print(temp_data, final_data) - assert len(temp_data) == 0, f'Found an uncomplete definition, this should not happen: {temp_data}' - result = [] for enum_repr in final_data: - py_name = enum_repr.name.split('::')[-1].replace('vp', '') - py_ident = f'py{py_name}' - owner_full_name = '::'.join(enum_repr.name.split('::')[:-1]) + name_segments = enum_repr.name.split('::') + py_name = name_segments[-1].replace('vp', '') + parent_ignored = False + for segment in name_segments[:-1]: + full_segment_name = mapping.get(segment) + if full_segment_name is not None and submodule.class_should_be_ignored(full_segment_name): + parent_ignored = True + break + if parent_ignored: + print(f'Ignoring subenum {py_name}') + continue + + owner_full_name = '::'.join(name_segments[:-1]) owner_py_ident = get_owner_py_ident(owner_full_name, root_scope) or 'submodule' - has_owner = len(owner_full_name) > 0 + py_ident = f'py{owner_py_ident}{py_name}' declaration = f'py::enum_<{enum_repr.name}> {py_ident}({owner_py_ident}, "{py_name}", py::arithmetic());' values = [] diff --git a/modules/python/generator/header.py b/modules/python/generator/header.py index 4cf19b28e5..25d44776c3 100644 --- a/modules/python/generator/header.py +++ b/modules/python/generator/header.py @@ -107,9 +107,9 @@ def run_preprocessor(self): # TODO: run without generating a new file '', '-D', 'vp_deprecated=', '-D', 'VISP_EXPORT=', - '-I', '/home/sfelton/software/visp_build/include', + '-I', '/home/sfelton/visp_build/include', '-I', '/usr/local/include', - #'-I', '/usr/include', + '-I', '/usr/include', '-N', 'VISP_BUILD_DEPRECATED_FUNCTIONS', '--passthru-includes', "^((?!vpConfig.h|!json.hpp).)*$", '--passthru-unfound-includes', @@ -137,7 +137,7 @@ def parse_data(self, data: ParsedData): from enum_binding import enum_bindings for cls in data.namespace.classes: result += self.generate_class(cls, header_env) - enum_decls_and_bindings = enum_bindings(data.namespace, header_env.mapping) + enum_decls_and_bindings = enum_bindings(data.namespace, header_env.mapping, self.submodule) for declaration, binding in enum_decls_and_bindings: self.class_decls.append(declaration) result += binding diff --git a/modules/python/generator/submodule.py b/modules/python/generator/submodule.py index 9a7d1d225a..69f1e7b3fa 100644 --- a/modules/python/generator/submodule.py +++ b/modules/python/generator/submodule.py @@ -61,6 +61,7 @@ def generate(self) -> None: void {self.generation_function_name()}(py::module_ &m) {{ {submodule_declaration} {declarations} + {bindings} }} ''' @@ -113,7 +114,7 @@ def get_method_config(self, class_name: Optional[str], method, owner_specs, head def get_submodules(include_path: Path, generate_path: Path) -> List[Submodule]: return [ - Submodule('core', Path('/home/sfelton/software/visp-sfelton/modules/core/include/visp3/core'), generate_path / 'core.cpp'), + Submodule('core', Path('/home/sfelton/visp-sfelton/modules/core/include/visp3/core'), generate_path / 'core.cpp'), # Submodule('visual_features', include_path / 'visual_features', generate_path / 'visual_features.cpp'), # Submodule('vs', include_path / 'vs', generate_path / 'vs.cpp') From 312cf14743719b88c29ae4e5168ec28650fa8fde Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Tue, 5 Sep 2023 17:28:43 +0200 Subject: [PATCH 023/169] User defined bindings possible, ignore to string representation --- modules/python/config/core.json | 2 + modules/python/docs/index.rst | 8 ++-- modules/python/generator/enum_binding.py | 8 +++- modules/python/generator/header.py | 60 +++++++++++++++--------- modules/python/generator/submodule.py | 29 ++++++++++-- 5 files changed, 73 insertions(+), 34 deletions(-) diff --git a/modules/python/config/core.json b/modules/python/config/core.json index a45af53950..153b3becc7 100644 --- a/modules/python/config/core.json +++ b/modules/python/config/core.json @@ -5,6 +5,7 @@ "vpDisplayException", "vpMatrixException"], "classes": { "vpArray2D": { + "additional_bindings": "bindings_vpArray2D", "specializations": [ { "python_name": "ArrayDouble2D", @@ -64,6 +65,7 @@ ] }, "vpMatrix": { + "ignore_repr": true, "methods": [ diff --git a/modules/python/docs/index.rst b/modules/python/docs/index.rst index 38ce10010e..1c8ac3ac1b 100644 --- a/modules/python/docs/index.rst +++ b/modules/python/docs/index.rst @@ -3,8 +3,6 @@ ViSP Python Documentation Contents: -.. autosummary:: - :toctree: generated - :recursive: - - visp +.. automodule:: visp.core + :members: + :undoc-members: diff --git a/modules/python/generator/enum_binding.py b/modules/python/generator/enum_binding.py index 32f607d83e..555b111d9d 100644 --- a/modules/python/generator/enum_binding.py +++ b/modules/python/generator/enum_binding.py @@ -129,17 +129,23 @@ def accumulate_data(scope: Union[NamespaceScope, ClassScope]): accumulate_data(root_scope) result = [] + for repr in temp_data: + print(f'Enum {repr} was ignored, because it is either marked as private or it is incomplete (missing values or name)') + for enum_repr in final_data: name_segments = enum_repr.name.split('::') py_name = name_segments[-1].replace('vp', '') + # If an owner class is ignored, don't export this enum parent_ignored = False + ignored_parent_name = None for segment in name_segments[:-1]: full_segment_name = mapping.get(segment) if full_segment_name is not None and submodule.class_should_be_ignored(full_segment_name): parent_ignored = True + ignored_parent_name = full_segment_name break if parent_ignored: - print(f'Ignoring subenum {py_name}') + print(f'Ignoring enum {py_name} because {ignored_parent_name} is ignored') continue owner_full_name = '::'.join(name_segments[:-1]) diff --git a/modules/python/generator/header.py b/modules/python/generator/header.py index 25d44776c3..7f937f58ff 100644 --- a/modules/python/generator/header.py +++ b/modules/python/generator/header.py @@ -10,6 +10,7 @@ from dataclasses import dataclass from utils import * from methods import * +from collections import OrderedDict def filter_includes(include_names: Set[str]) -> List[str]: @@ -95,7 +96,7 @@ def __init__(self, path: Path, submodule: 'Submodule'): content = self.run_preprocessor() self.includes = [f''] self.binding_code = None - self.class_decls = [] + self.declarations = [] self.contains = [] self.depends = [] self.generate_binding_code(content) @@ -107,9 +108,9 @@ def run_preprocessor(self): # TODO: run without generating a new file '', '-D', 'vp_deprecated=', '-D', 'VISP_EXPORT=', - '-I', '/home/sfelton/visp_build/include', + '-I', '/home/sfelton/software/visp_build/include', '-I', '/usr/local/include', - '-I', '/usr/include', + # '-I', '/usr/include', '-N', 'VISP_BUILD_DEPRECATED_FUNCTIONS', '--passthru-includes', "^((?!vpConfig.h|!json.hpp).)*$", '--passthru-unfound-includes', @@ -133,20 +134,18 @@ def generate_binding_code(self, content: str) -> None: def parse_data(self, data: ParsedData): result = '' header_env = HeaderEnvironment(data) - print(data.namespace.doxygen) from enum_binding import enum_bindings for cls in data.namespace.classes: - result += self.generate_class(cls, header_env) + result += self.generate_class(cls, header_env) + '\n' enum_decls_and_bindings = enum_bindings(data.namespace, header_env.mapping, self.submodule) for declaration, binding in enum_decls_and_bindings: - self.class_decls.append(declaration) + self.declarations.append(declaration) result += binding return result def generate_class(self, cls: ClassScope, header_env: HeaderEnvironment) -> str: result = '' - print('Doxygen', cls.class_decl.doxygen) - def generate_class_with_potiental_specialization(name_python: str, owner_specs: Dict[str, str]) -> str: + def generate_class_with_potiental_specialization(name_python: str, owner_specs: OrderedDict[str, str], cls_config: Dict) -> str: spec_result = '' python_ident = f'py{name_python}' @@ -163,27 +162,26 @@ def generate_class_with_potiental_specialization(name_python: str, owner_specs: if base_class.access == 'public': base_classes_str += ', ' + get_typename(base_class.typename, owner_specs, header_env.mapping) - # if name_cpp == 'vpColVector': cls_result = f'\tpy::class_ {python_ident} = py::class_<{name_cpp}{base_classes_str}>(submodule, "{name_python}");' - self.class_decls.append(cls_result) + self.declarations.append(cls_result) - contains_pure_virtual_methods = False # Skip classes that have pure virtual methods since they cannot be instantiated + contains_pure_virtual_methods = False for method in cls.methods: if method.pure_virtual: contains_pure_virtual_methods = True break - - + # Find bindable methods generated_methods = [] method_strs = [] bindable_methods_and_config, filtered_strs = get_bindable_methods_with_config(self.submodule, cls.methods, name_cpp_no_template, owner_specs, header_env.mapping) print('\n'.join(filtered_strs)) - + # Split between constructors and other methods constructors, non_constructors = split_methods_with_config(bindable_methods_and_config, lambda m: m.constructor) + # Split between "normal" methods and operators, which require a specific definition cpp_operator_names = cpp_operator_list() operators, basic_methods = split_methods_with_config(non_constructors, lambda m: get_name(m.name) in cpp_operator_names) @@ -195,7 +193,7 @@ def generate_class_with_potiental_specialization(name_python: str, owner_specs: ctor_str = f'''{python_ident}.{define_constructor(params_strs, py_arg_strs)};''' method_strs.append(ctor_str) - #Operator definitions + # Operator definitions for method, method_config in operators: method_name = get_name(method.name) params_strs = [get_type(param.type, owner_specs, header_env.mapping) for param in method.parameters] @@ -252,9 +250,24 @@ def generate_class_with_potiental_specialization(name_python: str, owner_specs: # Add to string representation - to_string_str = find_and_define_repr_str(cls, name_cpp, python_ident) - if len(to_string_str) > 0: - method_strs.append(to_string_str) + print(name_python, cls_config) + if not cls_config['ignore_repr']: + to_string_str = find_and_define_repr_str(cls, name_cpp, python_ident) + if len(to_string_str) > 0: + method_strs.append(to_string_str) + + # Add call to user defined bindings function + # Binding function should be defined in the static part of the generator + # It should have the signature void fn(py::class_& cls); + # If it is for a templated class, it should also be templated in the same way (same order of parameters etc.) + if cls_config['additional_bindings'] is not None: + template_str = '' + if len(owner_specs.keys()) > 0: + template_types = owner_specs.values() + template_str = f'<{", ".join([template_type for template_type in template_types])}>' + + method_strs.append(f'{cls_config["additional_bindings"]}{template_str}({python_ident});') + error_generating_overloads = get_static_and_instance_overloads(generated_methods) @@ -281,12 +294,12 @@ def generate_class_with_potiental_specialization(name_python: str, owner_specs: if base_class_str_no_template.startswith('vp'): self.depends.append(base_class_str_no_template) + cls_config = self.submodule.get_class_config(name_cpp_no_template) if cls.class_decl.template is None: name_python = name_cpp_no_template.replace('vp', '') - return generate_class_with_potiental_specialization(name_python, {}) + return generate_class_with_potiental_specialization(name_python, {}, cls_config) else: - cls_config = self.submodule.get_class_config(name_cpp_no_template) - if cls_config is None or 'specializations' not in cls_config: + if cls_config is None or 'specializations' not in cls_config or len(cls_config['specializations']) == 0: print(f'Could not find template specialization for class {name_cpp_no_template}: skipping!') return '' else: @@ -297,7 +310,8 @@ def generate_class_with_potiental_specialization(name_python: str, owner_specs: python_name = spec['python_name'] args = spec['arguments'] assert len(template_names) == len(args), f'Specializing {name_cpp_no_template}: Template arguments are {template_names} but found specialization {args} which has the wrong number of arguments' - spec_dict = {k[0]: k[1] for k in zip(template_names, args)} - specialization_strs.append(generate_class_with_potiental_specialization(python_name, spec_dict)) + + spec_dict = OrderedDict(k for k in zip(template_names, args)) + specialization_strs.append(generate_class_with_potiental_specialization(python_name, spec_dict, cls_config)) return '\n'.join(specialization_strs) diff --git a/modules/python/generator/submodule.py b/modules/python/generator/submodule.py index 69f1e7b3fa..6f482dd901 100644 --- a/modules/python/generator/submodule.py +++ b/modules/python/generator/submodule.py @@ -40,7 +40,7 @@ def generate(self) -> None: includes = [] for header in headers: header_code.append(header.binding_code) - declarations.extend(header.class_decls) + declarations.extend(header.declarations) includes.extend(header.includes) includes_set = filter_includes(set(includes)) submodule_declaration = f'py::module_ submodule = m.def_submodule("{self.name}");\n' @@ -59,9 +59,20 @@ def generate(self) -> None: void {self.generation_function_name()}(py::module_ &m) {{ +/* +Submodule declaration +*/ {submodule_declaration} + +/* +Class and enums declarations +*/ {declarations} + +/* +Bindings for methods and enum values +*/ {bindings} }} ''' @@ -81,11 +92,19 @@ def header_should_be_ignored(self, header_name: str) -> bool: return header_name in self.config['ignored_headers'] def get_class_config(self, class_name: str) -> Optional[Dict]: + default_config = { + 'methods': [], + 'operators': [], + 'use_buffer_protocol': False, + 'additional_bindings': None, + 'ignore_repr': False + } if 'classes' not in self.config: - return None + return default_config if class_name not in self.config['classes']: - return None - return self.config['classes'][class_name] + return default_config + default_config.update(self.config['classes'][class_name]) + return default_config def get_method_config(self, class_name: Optional[str], method, owner_specs, header_mapping) -> Dict: res = { @@ -114,7 +133,7 @@ def get_method_config(self, class_name: Optional[str], method, owner_specs, head def get_submodules(include_path: Path, generate_path: Path) -> List[Submodule]: return [ - Submodule('core', Path('/home/sfelton/visp-sfelton/modules/core/include/visp3/core'), generate_path / 'core.cpp'), + Submodule('core', Path('/home/sfelton/software/visp-sfelton/modules/core/include/visp3/core'), generate_path / 'core.cpp'), # Submodule('visual_features', include_path / 'visual_features', generate_path / 'visual_features.cpp'), # Submodule('vs', include_path / 'vs', generate_path / 'vs.cpp') From 6075da42d4f53082199bcb981c8e38d7be8cb45d Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Thu, 7 Sep 2023 12:52:29 +0200 Subject: [PATCH 024/169] More operators, numpy support for vpArray2D and linking with user defined code through static headers --- modules/python/.gitignore | 7 ++- modules/python/CMakeLists.txt | 5 +- modules/python/__init__.py | 0 modules/python/config/core.json | 7 +++ modules/python/generator/header.py | 74 +++++++++++++-------------- modules/python/generator/methods.py | 34 +++++++++++- modules/python/generator/submodule.py | 5 +- modules/python/include/core.hpp | 61 ++++++++++++++++++++++ modules/python/setup.py | 31 +++++++---- modules/python/stubs/MANIFEST.in | 1 + modules/python/stubs/setup.py | 29 +++++++++++ modules/python/test/test_basic.py | 1 + 12 files changed, 202 insertions(+), 53 deletions(-) delete mode 100644 modules/python/__init__.py create mode 100644 modules/python/include/core.hpp create mode 100644 modules/python/stubs/MANIFEST.in create mode 100644 modules/python/stubs/setup.py create mode 100644 modules/python/test/test_basic.py diff --git a/modules/python/.gitignore b/modules/python/.gitignore index b154e6e1ce..a567a1bccd 100644 --- a/modules/python/.gitignore +++ b/modules/python/.gitignore @@ -2,5 +2,8 @@ src/generated src/main.cpp build -stubs -docs/_build \ No newline at end of file +stubs/visp +stubs/build +*.eggs +docs/_build +docs/_autosummary diff --git a/modules/python/CMakeLists.txt b/modules/python/CMakeLists.txt index 575e84735f..3fb572084a 100644 --- a/modules/python/CMakeLists.txt +++ b/modules/python/CMakeLists.txt @@ -4,6 +4,7 @@ project(visp) find_package(pybind11 REQUIRED) find_package(VISP 3.5.1 REQUIRED) include_directories(${VISP_INCLUDE_DIRS}) +include_directories(include) message(${VISP_DIR}) string(REPLACE ";" "\n" str "${VISP_INCLUDE_DIRS}") message(STATUS ${str}) @@ -12,5 +13,7 @@ message(STATUS ${str}) message(${VISP_VERSION}) message(${pybind11_VERSION}) file(GLOB generated_cpp src/generated/*.cpp) -pybind11_add_module(visp src/main.cpp ${generated_cpp}) +file(GLOB static_cpp src/static/*.cpp) + +pybind11_add_module(visp src/main.cpp ${generated_cpp} ${static_cpp}) target_link_libraries(visp PRIVATE ${VISP_LIBRARIES}) diff --git a/modules/python/__init__.py b/modules/python/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/modules/python/config/core.json b/modules/python/config/core.json index 153b3becc7..49d78c26ca 100644 --- a/modules/python/config/core.json +++ b/modules/python/config/core.json @@ -6,6 +6,7 @@ "classes": { "vpArray2D": { "additional_bindings": "bindings_vpArray2D", + "use_buffer_protocol": true, "specializations": [ { "python_name": "ArrayDouble2D", @@ -37,6 +38,8 @@ ] }, "vpColVector": { + "additional_bindings": "bindings_vpColVector", + "use_buffer_protocol": true, "methods": [ { "static": true, @@ -127,6 +130,10 @@ } ] }, + "vpRotationMatrix": { + "additional_bindings": "bindings_vpRotationMatrix", + "use_buffer_protocol": true + }, "vpPolygon": { "methods": [ diff --git a/modules/python/generator/header.py b/modules/python/generator/header.py index 7f937f58ff..0ddf2c95cd 100644 --- a/modules/python/generator/header.py +++ b/modules/python/generator/header.py @@ -108,9 +108,9 @@ def run_preprocessor(self): # TODO: run without generating a new file '', '-D', 'vp_deprecated=', '-D', 'VISP_EXPORT=', - '-I', '/home/sfelton/software/visp_build/include', + '-I', '/home/sfelton/visp_build/include', '-I', '/usr/local/include', - # '-I', '/usr/include', + '-I', '/usr/include', '-N', 'VISP_BUILD_DEPRECATED_FUNCTIONS', '--passthru-includes', "^((?!vpConfig.h|!json.hpp).)*$", '--passthru-unfound-includes', @@ -150,22 +150,26 @@ def generate_class_with_potiental_specialization(name_python: str, owner_specs: python_ident = f'py{name_python}' name_cpp = get_typename(cls.class_decl.typename, owner_specs, header_env.mapping) - if cls.class_decl.template is not None: + # Declaration + # Add template specializations to cpp class name. e.g., vpArray2D becomes vpArray2D if the template T is double + template_decl: Optional[types.TemplateDecl] = cls.class_decl.template + if template_decl is not None: template_strs = [] - for template in cls.class_decl.template.params: - template_strs.append(owner_specs[template.name]) + template_strs = map(lambda t: owner_specs[t.name], template_decl.params) template_str = f'<{", ".join(template_strs)}>' name_cpp += template_str - base_classes_str = '' - for base_class in cls.class_decl.bases: - if base_class.access == 'public': - base_classes_str += ', ' + get_typename(base_class.typename, owner_specs, header_env.mapping) + # Reference base classes when creating pybind class binding + base_class_strs = map(lambda base_class: get_typename(base_class.typename, owner_specs, header_env.mapping), + filter(lambda b: b.access == 'public', cls.class_decl.bases)) + class_template_str = ', '.join([name_cpp] + list(base_class_strs)) - cls_result = f'\tpy::class_ {python_ident} = py::class_<{name_cpp}{base_classes_str}>(submodule, "{name_python}");' - self.declarations.append(cls_result) + cls_argument_strs = ['submodule', f'"{name_python}"'] + (['py::buffer_protocol()'] if cls_config['use_buffer_protocol'] else []) - # Skip classes that have pure virtual methods since they cannot be instantiated + class_decl = f'\tpy::class_ {python_ident} = py::class_<{class_template_str}>({", ".join(cls_argument_strs)});' + self.declarations.append(class_decl) + + # Skip constructors for classes that have pure virtual methods since they cannot be instantiated contains_pure_virtual_methods = False for method in cls.methods: if method.pure_virtual: @@ -194,6 +198,8 @@ def generate_class_with_potiental_specialization(name_python: str, owner_specs: method_strs.append(ctor_str) # Operator definitions + binary_return_ops = supported_const_return_binary_op_map() + binary_in_place_ops = supported_in_place_binary_op_map() for method, method_config in operators: method_name = get_name(method.name) params_strs = [get_type(param.type, owner_specs, header_env.mapping) for param in method.parameters] @@ -203,35 +209,27 @@ def generate_class_with_potiental_specialization(name_python: str, owner_specs: elif len(params_strs) < 1: print(f'Found unary operator {name_cpp}::{method_name}, skipping') continue - binary_operators = [ - ('==', 'eq'), - ('!=', 'ne'), - ('<', 'lt'), - ('>', 'gt'), - ('<=', 'le'), - ('>=', 'ge'), - ('+', 'add'), - ('-', 'sub'), - ('*', 'mul'), - ('/', 'truediv'), - ('%', 'mod'), - # ('<<', 'lshift'), - # ('>>', 'rshift'), - ('&', 'and'), - ('|', 'or'), - ('^', 'xor'), - ] - binary_op_tuple = None - for tuple in binary_operators: - if method_name == f'operator{tuple[0]}': + for cpp_op, python_op_name in binary_return_ops.items(): + if method_name == f'operator{cpp_op}': + operator_str = f''' +{python_ident}.def("__{python_op_name}__", [](const {name_cpp}& self, {params_strs[0]} o) {{ + return (self {cpp_op} o); +}}, py::is_operator());''' + method_strs.append(operator_str) + break + for cpp_op, python_op_name in binary_in_place_ops.items(): + if method_name == f'operator{cpp_op}': operator_str = f''' -{python_ident}.def("__{tuple[1]}__", [](const {name_cpp}& self, {params_strs[0]} o) {{ - return (self {tuple[0]} o); +{python_ident}.def("__{python_op_name}__", []({name_cpp}& self, {params_strs[0]} o) {{ + self {cpp_op} o; + return self; }}, py::is_operator());''' method_strs.append(operator_str) break + + # Define classical methods for method, method_config in basic_methods: @@ -269,7 +267,7 @@ def generate_class_with_potiental_specialization(name_python: str, owner_specs: method_strs.append(f'{cls_config["additional_bindings"]}{template_str}({python_ident});') - + # Check for potential error generating definitions error_generating_overloads = get_static_and_instance_overloads(generated_methods) for error_overload in error_generating_overloads: print(f'Overload {error_overload} defined for instance and class, this will generate a pybind error') @@ -307,11 +305,11 @@ def generate_class_with_potiental_specialization(name_python: str, owner_specs: specs = cls_config['specializations'] template_names = [t.name for t in cls.class_decl.template.params] for spec in specs: - python_name = spec['python_name'] + name_python = spec['python_name'] args = spec['arguments'] assert len(template_names) == len(args), f'Specializing {name_cpp_no_template}: Template arguments are {template_names} but found specialization {args} which has the wrong number of arguments' spec_dict = OrderedDict(k for k in zip(template_names, args)) - specialization_strs.append(generate_class_with_potiental_specialization(python_name, spec_dict, cls_config)) + specialization_strs.append(generate_class_with_potiental_specialization(name_python, spec_dict, cls_config)) return '\n'.join(specialization_strs) diff --git a/modules/python/generator/methods.py b/modules/python/generator/methods.py index 810756ee26..455fc0fbf2 100644 --- a/modules/python/generator/methods.py +++ b/modules/python/generator/methods.py @@ -11,6 +11,10 @@ from dataclasses import dataclass def cpp_operator_list(): + ''' + List of cpp methods that are considered operators. + Not all of them have a direct mapping to Python + ''' symbols = [ '-', '+', '*', '/', '++', '--', '%', @@ -27,8 +31,34 @@ def cpp_operator_list(): ] return [f'operator{s}' for s in symbols] + ['operator'] - - +def supported_const_return_binary_op_map(): + ''' + Mapping between CPP operator symbols and their python equivalence, for binary operators that return a value and do not modify self. + a binary operator takes as argument self and an another parameter. + ''' + return { + '==': 'eq', + '!=': 'ne', + '<': 'lt', + '>': 'gt', + '<=': 'le', + '>=': 'ge', + '+': 'add', + '-': 'sub', + '*': 'mul', + '/': 'truediv', + '%': 'mod', + '&': 'and', + '|': 'or', + '^': 'xor', + } +def supported_in_place_binary_op_map(): + return { + '+=': 'iadd', + '*=': 'imul', + '-=': 'isub', + '/=': 'itruediv', + } def find_and_define_repr_str(cls: ClassScope, cls_name: str, python_ident: str) -> str: for friend in cls.friends: if friend.fn is not None: diff --git a/modules/python/generator/submodule.py b/modules/python/generator/submodule.py index 6f482dd901..469f88c5e2 100644 --- a/modules/python/generator/submodule.py +++ b/modules/python/generator/submodule.py @@ -53,6 +53,9 @@ def generate(self) -> None: #include #include #include + +#include "core.hpp" + {includes_str} namespace py = pybind11; @@ -133,7 +136,7 @@ def get_method_config(self, class_name: Optional[str], method, owner_specs, head def get_submodules(include_path: Path, generate_path: Path) -> List[Submodule]: return [ - Submodule('core', Path('/home/sfelton/software/visp-sfelton/modules/core/include/visp3/core'), generate_path / 'core.cpp'), + Submodule('core', Path('/home/sfelton/visp-sfelton/modules/core/include/visp3/core'), generate_path / 'core.cpp'), # Submodule('visual_features', include_path / 'visual_features', generate_path / 'visual_features.cpp'), # Submodule('vs', include_path / 'vs', generate_path / 'vs.cpp') diff --git a/modules/python/include/core.hpp b/modules/python/include/core.hpp new file mode 100644 index 0000000000..04f371e8c1 --- /dev/null +++ b/modules/python/include/core.hpp @@ -0,0 +1,61 @@ +#ifndef VISP_PYTHON_CORE_HPP +#define VISP_PYTHON_CORE_HPP +#include +#include +#include + +#include +#include + +namespace py = pybind11; + +template +void bindings_vpArray2D(py::class_> &pyArray2D) +{ + pyArray2D.def_buffer([](vpArray2D &array) -> py::buffer_info { + return py::buffer_info( + array.data, /* Pointer to buffer */ + sizeof(T), /* Size of one scalar */ + py::format_descriptor::format(), /* Python struct-style format descriptor */ + 2, /* Number of dimensions */ + py::detail::any_container({ array.getRows(), array.getCols() }), /* Buffer dimensions */ + py::detail::any_container({ sizeof(T) * array.getCols(), sizeof(T) }), /* Strides (in bytes) for each index */ + false /* Readonly? */ + ); + }); +} + + +void bindings_vpColVector(py::class_> &pyColVector) +{ + pyColVector.def_buffer([](vpColVector &array) -> py::buffer_info { + return py::buffer_info( + array.data, /* Pointer to buffer */ + sizeof(double), /* Size of one scalar */ + py::format_descriptor::format(), /* Python struct-style format descriptor */ + 1, /* Number of dimensions */ + py::detail::any_container({ array.getRows() }), /* Buffer dimensions */ + py::detail::any_container({ sizeof(double) }), /* Strides (in bytes) for each index */ + false /* Readonly? */ + ); + }); +} + + +void bindings_vpRotationMatrix(py::class_> &pyRotationMatrix) +{ + pyRotationMatrix.def_buffer([](vpRotationMatrix &array) -> py::buffer_info { + return py::buffer_info( + array.data, /* Pointer to buffer */ + sizeof(double), /* Size of one scalar */ + py::format_descriptor::format(), /* Python struct-style format descriptor */ + 2, /* Number of dimensions */ + py::detail::any_container({ array.getRows(), array.getCols() }), /* Buffer dimensions */ + py::detail::any_container({ 3 * sizeof(double), sizeof(double) }), /* Strides (in bytes) for each index */ + true /* Readonly? */ + ); + }); +} + + +#endif \ No newline at end of file diff --git a/modules/python/setup.py b/modules/python/setup.py index de6c5400ec..ea1c3a1c50 100644 --- a/modules/python/setup.py +++ b/modules/python/setup.py @@ -6,9 +6,13 @@ from setuptools import Extension, setup from setuptools.command.build_ext import build_ext +from setuptools.command.install import install from distutils.command import build as build_module from pathlib import Path +package_name = 'visp' +version = '0.0.3' +stubs_path = Path('stubs') # Convert distutils Windows platform specifiers to CMake -A arguments PLAT_TO_CMAKE = { "win32": "Win32", @@ -17,11 +21,19 @@ "win-arm64": "ARM64", } +def generate_stubs(): + subprocess.run('pip install ./stubs', env=os.environ, shell=True, capture_output=True, check=True) + +class CustomInstall(install): + def run(self): + install.run(self) + generate_stubs() + + class build(build_module.build): def run(self): import os - print('Generating binding code...') - #output = subprocess.run('python generator/generator.py', env=os.environ, shell=True, capture_output=True, check=True) + output = subprocess.run('python generator/generator.py', env=os.environ, shell=True, capture_output=True, check=True) build_module.build.run(self) # A CMakeExtension needs a sourcedir instead of a file list. # The name must be the _single_ output extension from the CMake build. @@ -133,21 +145,22 @@ def build_extension(self, ext: CMakeExtension) -> None: # The information here can also be placed in setup.cfg - better separation of # logic and declaration, and simpler if you include description/version in a file. setup( - name="visp", - version="0.0.2", + name=package_name, + version=version, author="Samuel Felton", author_email="samuel.felton@irisa.fr", description="Python wrapper for the Visual Servoing Platform", long_description="", setup_requires=[ "pcpp", - "cxxheaderparser@git+https://github.com/robotpy/cxxheaderparser#egg=master" + "cxxheaderparser@git+https://github.com/robotpy/cxxheaderparser#egg=master", + 'mypy' ], - ext_modules=[CMakeExtension("visp_python")], - cmdclass={"build_ext": CMakeBuild, 'build': build}, + ext_modules=[CMakeExtension("visp")], + cmdclass={"build_ext": CMakeBuild, 'build': build, 'install': CustomInstall}, zip_safe=False, - # package_data={"visp-stubs": ["visp"]}, - # packages=['visp-stubs'], + include_package_data=True, + # package_data={'visp': ["py.typed", *find_stubs(path=stubs_path)]}, extras_require={"test": ["pytest>=6.0"]}, python_requires=">=3.7", ) diff --git a/modules/python/stubs/MANIFEST.in b/modules/python/stubs/MANIFEST.in new file mode 100644 index 0000000000..ad83658a3d --- /dev/null +++ b/modules/python/stubs/MANIFEST.in @@ -0,0 +1 @@ +recursive-include . *.pyi \ No newline at end of file diff --git a/modules/python/stubs/setup.py b/modules/python/stubs/setup.py new file mode 100644 index 0000000000..0ef9fb8bf1 --- /dev/null +++ b/modules/python/stubs/setup.py @@ -0,0 +1,29 @@ +from pathlib import Path +from setuptools import setup +from setuptools.command.install import install + +import subprocess +import sys + + +class CustomInstall(install): + def run(self): + stubs_path = Path('.') + stubs_path.mkdir(exist_ok=True) + subprocess.run(['pybind11-stubgen', 'visp', '-o', '.', '--ignore-all-errors'], check=True) + install.run(self) + +setup( + name='visp_stubs', + version='0.0.3', + author="Samuel Felton", + author_email="samuel.felton@irisa.fr", + description="Python stubs for the ViSP wrapper", + zip_safe=False, + include_package_data=True, + # package_data={'visp_stubs': [*find_stubs(path=stubs_path)]}, + setup_requires=[ + "pybind11-stubgen", + ], + python_requires=">=3.7", +) \ No newline at end of file diff --git a/modules/python/test/test_basic.py b/modules/python/test/test_basic.py new file mode 100644 index 0000000000..35602a0a12 --- /dev/null +++ b/modules/python/test/test_basic.py @@ -0,0 +1 @@ +import visp From b4814f83f156b9af0185cbe1b471df643d231e3b Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Thu, 7 Sep 2023 17:43:35 +0200 Subject: [PATCH 025/169] Testing numpy implem, debugging stub generation --- modules/python/generator/header.py | 9 ++--- modules/python/generator/submodule.py | 2 +- modules/python/include/core.hpp | 50 ++++++++++++++++++++------- modules/python/setup.py | 7 ++-- modules/python/stubs/MANIFEST.in | 2 +- modules/python/stubs/setup.py | 18 ++++++---- modules/python/test/test_basic.py | 39 +++++++++++++++++++++ 7 files changed, 98 insertions(+), 29 deletions(-) diff --git a/modules/python/generator/header.py b/modules/python/generator/header.py index 0ddf2c95cd..c6b28bb433 100644 --- a/modules/python/generator/header.py +++ b/modules/python/generator/header.py @@ -108,9 +108,9 @@ def run_preprocessor(self): # TODO: run without generating a new file '', '-D', 'vp_deprecated=', '-D', 'VISP_EXPORT=', - '-I', '/home/sfelton/visp_build/include', + '-I', '/home/sfelton/software/visp_build/include', '-I', '/usr/local/include', - '-I', '/usr/include', + #'-I', '/usr/include', '-N', 'VISP_BUILD_DEPRECATED_FUNCTIONS', '--passthru-includes', "^((?!vpConfig.h|!json.hpp).)*$", '--passthru-unfound-includes', @@ -148,8 +148,8 @@ def generate_class(self, cls: ClassScope, header_env: HeaderEnvironment) -> str: def generate_class_with_potiental_specialization(name_python: str, owner_specs: OrderedDict[str, str], cls_config: Dict) -> str: spec_result = '' python_ident = f'py{name_python}' - name_cpp = get_typename(cls.class_decl.typename, owner_specs, header_env.mapping) + # Declaration # Add template specializations to cpp class name. e.g., vpArray2D becomes vpArray2D if the template T is double template_decl: Optional[types.TemplateDecl] = cls.class_decl.template @@ -169,6 +169,7 @@ def generate_class_with_potiental_specialization(name_python: str, owner_specs: class_decl = f'\tpy::class_ {python_ident} = py::class_<{class_template_str}>({", ".join(cls_argument_strs)});' self.declarations.append(class_decl) + # Definitions # Skip constructors for classes that have pure virtual methods since they cannot be instantiated contains_pure_virtual_methods = False for method in cls.methods: @@ -256,7 +257,7 @@ def generate_class_with_potiental_specialization(name_python: str, owner_specs: # Add call to user defined bindings function # Binding function should be defined in the static part of the generator - # It should have the signature void fn(py::class_& cls); + # It should have the signature void fn(py::class_& cls); # If it is for a templated class, it should also be templated in the same way (same order of parameters etc.) if cls_config['additional_bindings'] is not None: template_str = '' diff --git a/modules/python/generator/submodule.py b/modules/python/generator/submodule.py index 469f88c5e2..5aee6c112d 100644 --- a/modules/python/generator/submodule.py +++ b/modules/python/generator/submodule.py @@ -136,7 +136,7 @@ def get_method_config(self, class_name: Optional[str], method, owner_specs, head def get_submodules(include_path: Path, generate_path: Path) -> List[Submodule]: return [ - Submodule('core', Path('/home/sfelton/visp-sfelton/modules/core/include/visp3/core'), generate_path / 'core.cpp'), + Submodule('core', Path('/home/sfelton/software/visp-sfelton/modules/core/include/visp3/core'), generate_path / 'core.cpp'), # Submodule('visual_features', include_path / 'visual_features', generate_path / 'visual_features.cpp'), # Submodule('vs', include_path / 'vs', generate_path / 'vs.cpp') diff --git a/modules/python/include/core.hpp b/modules/python/include/core.hpp index 04f371e8c1..3072280f9c 100644 --- a/modules/python/include/core.hpp +++ b/modules/python/include/core.hpp @@ -9,20 +9,46 @@ namespace py = pybind11; +/* +Create a buffer info for a row major array +*/ +template +py::buffer_info make_array_buffer(T *data, std::array dims, bool readonly) +{ + std::array strides; + for (unsigned i = 0; i < N; i++) { + unsigned s = sizeof(T); + for (unsigned j = i + 1; j < N; ++j) { + s *= dims[j]; + } + strides[i] = s; + } + return py::buffer_info( + data, /* Pointer to data (nullptr -> ask NumPy to allocate!) */ + sizeof(T), /* Size of one item */ + py::format_descriptor::value, /* Buffer format */ + N, /* How many dimensions? */ + dims, /* Number of elements for each dimension */ + strides, /* Strides for each dimension */ + readonly + ); +} + template void bindings_vpArray2D(py::class_> &pyArray2D) { pyArray2D.def_buffer([](vpArray2D &array) -> py::buffer_info { - return py::buffer_info( - array.data, /* Pointer to buffer */ - sizeof(T), /* Size of one scalar */ - py::format_descriptor::format(), /* Python struct-style format descriptor */ - 2, /* Number of dimensions */ - py::detail::any_container({ array.getRows(), array.getCols() }), /* Buffer dimensions */ - py::detail::any_container({ sizeof(T) * array.getCols(), sizeof(T) }), /* Strides (in bytes) for each index */ - false /* Readonly? */ - ); - }); + return make_array_buffer(array.data, { array.getRows(), array.getCols() }, false); + // py::buffer_info( + // array.data, /* Pointer to buffer */ + // sizeof(T), /* Size of one scalar */ + // py::format_descriptor::format(), /* Python struct-style format descriptor */ + // 2, /* Number of dimensions */ + // py::detail::any_container({ array.getRows(), array.getCols() }), /* Buffer dimensions */ + // py::detail::any_container({ sizeof(T) * array.getCols(), sizeof(T) }), /* Strides (in bytes) for each index */ + // false /* Readonly? */ + // ); + }); } @@ -38,7 +64,7 @@ void bindings_vpColVector(py::class_> &pyColVecto py::detail::any_container({ sizeof(double) }), /* Strides (in bytes) for each index */ false /* Readonly? */ ); - }); + }); } @@ -54,7 +80,7 @@ void bindings_vpRotationMatrix(py::class_> & py::detail::any_container({ 3 * sizeof(double), sizeof(double) }), /* Strides (in bytes) for each index */ true /* Readonly? */ ); - }); + }); } diff --git a/modules/python/setup.py b/modules/python/setup.py index ea1c3a1c50..6070b0bddd 100644 --- a/modules/python/setup.py +++ b/modules/python/setup.py @@ -11,7 +11,7 @@ from pathlib import Path package_name = 'visp' -version = '0.0.3' +version = '0.0.4' stubs_path = Path('stubs') # Convert distutils Windows platform specifiers to CMake -A arguments PLAT_TO_CMAKE = { @@ -27,7 +27,7 @@ def generate_stubs(): class CustomInstall(install): def run(self): install.run(self) - generate_stubs() + #generate_stubs() class build(build_module.build): @@ -153,8 +153,7 @@ def build_extension(self, ext: CMakeExtension) -> None: long_description="", setup_requires=[ "pcpp", - "cxxheaderparser@git+https://github.com/robotpy/cxxheaderparser#egg=master", - 'mypy' + "cxxheaderparser@git+https://github.com/robotpy/cxxheaderparser#egg=master" ], ext_modules=[CMakeExtension("visp")], cmdclass={"build_ext": CMakeBuild, 'build': build, 'install': CustomInstall}, diff --git a/modules/python/stubs/MANIFEST.in b/modules/python/stubs/MANIFEST.in index ad83658a3d..f3feb24825 100644 --- a/modules/python/stubs/MANIFEST.in +++ b/modules/python/stubs/MANIFEST.in @@ -1 +1 @@ -recursive-include . *.pyi \ No newline at end of file +recursive-include visp *.pyi \ No newline at end of file diff --git a/modules/python/stubs/setup.py b/modules/python/stubs/setup.py index 0ef9fb8bf1..78a81f9cf0 100644 --- a/modules/python/stubs/setup.py +++ b/modules/python/stubs/setup.py @@ -6,24 +6,28 @@ import sys +def find_stubs(path: Path): + print([str(p.relative_to('.')) for p in path.rglob('*.pyi')]) + return [str(p.relative_to('.')) for p in path.rglob('*.pyi')] + class CustomInstall(install): def run(self): - stubs_path = Path('.') - stubs_path.mkdir(exist_ok=True) - subprocess.run(['pybind11-stubgen', 'visp', '-o', '.', '--ignore-all-errors'], check=True) + subprocess.run(['pybind11-stubgen', '-o', '.', '--ignore-all-errors', 'visp'], check=True) install.run(self) setup( - name='visp_stubs', - version='0.0.3', + name='visp-stubs', + version='0.0.4', author="Samuel Felton", author_email="samuel.felton@irisa.fr", description="Python stubs for the ViSP wrapper", zip_safe=False, include_package_data=True, - # package_data={'visp_stubs': [*find_stubs(path=stubs_path)]}, + # package_data={'visp-stubs': find_stubs(path=Path('.'))}, setup_requires=[ - "pybind11-stubgen", + "pybind11-stubgen>=2.1", + "visp" ], + cmdclass={'install': CustomInstall}, python_requires=">=3.7", ) \ No newline at end of file diff --git a/modules/python/test/test_basic.py b/modules/python/test/test_basic.py index 35602a0a12..dabafb0375 100644 --- a/modules/python/test/test_basic.py +++ b/modules/python/test/test_basic.py @@ -1 +1,40 @@ import visp +from visp.core import ArrayDouble2D, RotationMatrix, Matrix + +import numpy as np +import pytest + +def test_np_array_modifies_vp_array(): + # Test that numpy is a view of array and that writing to numpy array modifies vpArray + array = ArrayDouble2D(5, 5, 1.0) + assert array.getRows() == array.getCols() == 5 + array_np = np.array(array, copy=False) + assert array_np.shape == (5, 5) + assert np.all(array_np == 1.0) + array_np[0:2, 0:2] = 2 + assert array.getMinValue() == 1 and array.getMaxValue() == 2 + + + +def test_array_operations(): + array1 = ArrayDouble2D(2, 2, 1) + array2 = ArrayDouble2D(2, 2, 1) + assert array1 == array2 + +def test_matrix_operations(): + m1 = Matrix(4, 4, 2.0) + m2 = Matrix(4, 4, 1.0) + m3 = Matrix(4, 4, 3.0) + m4 = Matrix(4, 4, 6 * 4) + + assert m1 + m2 == m3 + assert m3 - m1 == m2 + assert m1 * m3 == m4 + assert m2 * 2 == m1 + +def test_rotation_representations_not_writable(): + # Test that some class have non writable numpy arrays + R = RotationMatrix() + R_np = np.array(R, copy=False) + with pytest.raises(ValueError): + R_np[0, 0] = 1 \ No newline at end of file From ca5c68c5c29dbe0dc460d37a1319b132412ca5bf Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Fri, 8 Sep 2023 17:14:26 +0200 Subject: [PATCH 026/169] more work on numpy conversion --- modules/python/config/core.json | 6 ++ modules/python/include/core.hpp | 122 +++++++++++++++++++++++------- modules/python/setup.py | 2 +- modules/python/test/test_basic.py | 29 +++++-- 4 files changed, 126 insertions(+), 33 deletions(-) diff --git a/modules/python/config/core.json b/modules/python/config/core.json index 49d78c26ca..aa152d4b49 100644 --- a/modules/python/config/core.json +++ b/modules/python/config/core.json @@ -54,6 +54,8 @@ ] }, "vpRowVector": { + "additional_bindings": "bindings_vpRowVector", + "use_buffer_protocol": true, "methods": [ { "static": true, @@ -134,6 +136,10 @@ "additional_bindings": "bindings_vpRotationMatrix", "use_buffer_protocol": true }, + "vpHomogeneousMatrix": { + "additional_bindings": "bindings_vpHomogeneousMatrix", + "use_buffer_protocol": true + }, "vpPolygon": { "methods": [ diff --git a/modules/python/include/core.hpp b/modules/python/include/core.hpp index 3072280f9c..93e90240ee 100644 --- a/modules/python/include/core.hpp +++ b/modules/python/include/core.hpp @@ -1,14 +1,22 @@ #ifndef VISP_PYTHON_CORE_HPP #define VISP_PYTHON_CORE_HPP +#include +#include + #include #include #include #include #include +#include + namespace py = pybind11; +template +using np_array_cf = py::array_t; + /* Create a buffer info for a row major array */ @@ -34,36 +42,97 @@ py::buffer_info make_array_buffer(T *data, std::array dims, bool re ); } +std::string shape_to_string(const std::vector &shape) +{ + std::stringstream ss; + ss << "("; + for (int i = 0; i < shape.size() - 1; ++i) { + ss << shape[i] << ","; + } + if (shape.size() > 0) { + ss << shape[shape.size() - 1]; + } + ss << ")"; + return ss.str(); +} + +template +void verify_array_shape_and_dims(np_array_cf np_array, unsigned dims, const char *class_name) +{ + py::buffer_info buffer = np_array.request(); + std::vector shape = buffer.shape; + if (shape.size() != dims) { + std::stringstream ss; + ss << "Tried to instanciate " << class_name + << " that expects a " << dims << "D array but got a numpy array of shape " + << shape_to_string(shape); + + throw std::runtime_error(ss.str()); + } +} +template +void verify_array_shape_and_dims(np_array_cf np_array, std::vector expected_dims, const char *class_name) +{ + verify_array_shape_and_dims(np_array, expected_dims.size()); + py::buffer_info buffer = np_array.request(); + std::vector shape = buffer.shape; + bool invalid_shape = false; + for (unsigned int i = 0; i < expected_dims.size(); ++i) { + if (shape[i] != expected_dims[i]) { + invalid_shape = true; + break; + } + } + if (invalid_shape) { + std::stringstream ss; + ss << "Tried to instanciate " << class_name + << " that expects an array of dimensions " << shape_to_string(expected_dims) + << " but got a numpy array of shape " << shape_to_string(shape); + + throw std::runtime_error(ss.str()); + } +} +template +void copy_data_from_np(np_array_cf src, Item *dest) +{ + py::buffer_info buffer = src.request(); + std::vector shape = buffer.shape; + unsigned int elements = 1; + for (ssize_t dim : shape) { + elements *= dim; + } + const Item *data = (Item *)buffer.ptr; + std::memcpy(dest, data, elements * sizeof(Item)); + +} + template void bindings_vpArray2D(py::class_> &pyArray2D) { pyArray2D.def_buffer([](vpArray2D &array) -> py::buffer_info { return make_array_buffer(array.data, { array.getRows(), array.getCols() }, false); - // py::buffer_info( - // array.data, /* Pointer to buffer */ - // sizeof(T), /* Size of one scalar */ - // py::format_descriptor::format(), /* Python struct-style format descriptor */ - // 2, /* Number of dimensions */ - // py::detail::any_container({ array.getRows(), array.getCols() }), /* Buffer dimensions */ - // py::detail::any_container({ sizeof(T) * array.getCols(), sizeof(T) }), /* Strides (in bytes) for each index */ - // false /* Readonly? */ - // ); }); + pyArray2D.def(py::init([](np_array_cf np_array) { + verify_array_shape_and_dims(np_array, 2, "ViSP 2D array"); + const std::vector shape = np_array.request().shape; + vpArray2D result(shape[0], shape[1]); + copy_data_from_np(np_array, result.data); + return result; + })); } void bindings_vpColVector(py::class_> &pyColVector) { pyColVector.def_buffer([](vpColVector &array) -> py::buffer_info { - return py::buffer_info( - array.data, /* Pointer to buffer */ - sizeof(double), /* Size of one scalar */ - py::format_descriptor::format(), /* Python struct-style format descriptor */ - 1, /* Number of dimensions */ - py::detail::any_container({ array.getRows() }), /* Buffer dimensions */ - py::detail::any_container({ sizeof(double) }), /* Strides (in bytes) for each index */ - false /* Readonly? */ - ); + return make_array_buffer(array.data, { array.getRows() }, false); + }); +} + +void bindings_vpRowVector(py::class_> &pyRowVector) +{ + pyRowVector.def_buffer([](vpRowVector &array) -> py::buffer_info { + return make_array_buffer(array.data, { array.getCols() }, false); }); } @@ -71,15 +140,14 @@ void bindings_vpColVector(py::class_> &pyColVecto void bindings_vpRotationMatrix(py::class_> &pyRotationMatrix) { pyRotationMatrix.def_buffer([](vpRotationMatrix &array) -> py::buffer_info { - return py::buffer_info( - array.data, /* Pointer to buffer */ - sizeof(double), /* Size of one scalar */ - py::format_descriptor::format(), /* Python struct-style format descriptor */ - 2, /* Number of dimensions */ - py::detail::any_container({ array.getRows(), array.getCols() }), /* Buffer dimensions */ - py::detail::any_container({ 3 * sizeof(double), sizeof(double) }), /* Strides (in bytes) for each index */ - true /* Readonly? */ - ); + return make_array_buffer(array.data, { array.getRows(), array.getCols() }, true); + }); +} + +void bindings_vpHomogeneousMatrix(py::class_> &pyHomogeneousMatrix) +{ + pyHomogeneousMatrix.def_buffer([](vpHomogeneousMatrix &array) -> py::buffer_info { + return make_array_buffer(array.data, { array.getRows(), array.getCols() }, true); }); } diff --git a/modules/python/setup.py b/modules/python/setup.py index 6070b0bddd..054526b7b8 100644 --- a/modules/python/setup.py +++ b/modules/python/setup.py @@ -33,7 +33,7 @@ def run(self): class build(build_module.build): def run(self): import os - output = subprocess.run('python generator/generator.py', env=os.environ, shell=True, capture_output=True, check=True) + #output = subprocess.run('python generator/generator.py', env=os.environ, shell=True, capture_output=True, check=True) build_module.build.run(self) # A CMakeExtension needs a sourcedir instead of a file list. # The name must be the _single_ output extension from the CMake build. diff --git a/modules/python/test/test_basic.py b/modules/python/test/test_basic.py index dabafb0375..557c1a5399 100644 --- a/modules/python/test/test_basic.py +++ b/modules/python/test/test_basic.py @@ -1,5 +1,5 @@ import visp -from visp.core import ArrayDouble2D, RotationMatrix, Matrix +from visp.core import ArrayDouble2D, RotationMatrix, Matrix, HomogeneousMatrix import numpy as np import pytest @@ -14,8 +14,6 @@ def test_np_array_modifies_vp_array(): array_np[0:2, 0:2] = 2 assert array.getMinValue() == 1 and array.getMaxValue() == 2 - - def test_array_operations(): array1 = ArrayDouble2D(2, 2, 1) array2 = ArrayDouble2D(2, 2, 1) @@ -33,8 +31,29 @@ def test_matrix_operations(): assert m2 * 2 == m1 def test_rotation_representations_not_writable(): - # Test that some class have non writable numpy arrays + # Test that some classes have non writable numpy arrays R = RotationMatrix() R_np = np.array(R, copy=False) with pytest.raises(ValueError): - R_np[0, 0] = 1 \ No newline at end of file + R_np[0, 0] = 1 + T = HomogeneousMatrix() + T_np = np.array(T, copy=False) + with pytest.raises(ValueError): + T_np[0, 0] = 1 + # q = visp.core.QuaternionVector() + # q_np = np.array(q, copy=False) + # with pytest.raises(ValueError): + # q_np[0] = 1 + +def test_numpy_constructor(): + n_invalid = np.array([1, 2, 3]) + with pytest.raises(RuntimeError): + a = ArrayDouble2D(n_invalid) + n_valid = np.array([[1, 2, 3], [4, 5, 6]]) + a = ArrayDouble2D(n_valid) + + + + +def test_rotation_repr_can_be_defined_by_hand(): + R = RotationMatrix() \ No newline at end of file From 422613f889fccc19c5ceced4330f1bb9a2a7c605 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Fri, 8 Sep 2023 18:10:20 +0200 Subject: [PATCH 027/169] reactivating generator in setup, add vpImage specializations --- modules/python/config/core.json | 34 +++++++++++++++++++++++++++++++++ modules/python/setup.py | 4 ++++ 2 files changed, 38 insertions(+) diff --git a/modules/python/config/core.json b/modules/python/config/core.json index 49d78c26ca..5897246449 100644 --- a/modules/python/config/core.json +++ b/modules/python/config/core.json @@ -22,6 +22,40 @@ } ] }, + "vpImage": { + "additional_bindings": "bindings_vpImage", + "use_buffer_protocol": true, + "specializations": [ + { + "python_name": "ImageGray", + "arguments": ["unsigned char"] + }, + { + "python_name": "ImageFloat", + "arguments": ["float"] + }, + { + "python_name": "ImageDouble", + "arguments": ["double"] + }, + { + "python_name": "ImageUInt16", + "arguments": ["uint16_t"] + } + { + "python_name": "ImageRGBA", + "arguments": ["vpRGBa"] + } + ], + "methods": + [ + { + "static": true, + "signature": "void insert(const vpArray2D &, const vpArray2D &, vpArray2D &, unsigned int, unsigned int)", + "custom_name": "insertStatic" + } + ] + }, "vpTranslationVector": { "methods": [ diff --git a/modules/python/setup.py b/modules/python/setup.py index 6070b0bddd..3edd725004 100644 --- a/modules/python/setup.py +++ b/modules/python/setup.py @@ -28,6 +28,7 @@ class CustomInstall(install): def run(self): install.run(self) #generate_stubs() + # subprocess.run('sphinx-build -b html docs docs/build/html', shell=True, check=True) class build(build_module.build): @@ -154,6 +155,9 @@ def build_extension(self, ext: CMakeExtension) -> None: setup_requires=[ "pcpp", "cxxheaderparser@git+https://github.com/robotpy/cxxheaderparser#egg=master" + # "sphinx", + # "sphinx-rtd-theme", + # "sphinx-autopackagesummary" ], ext_modules=[CMakeExtension("visp")], cmdclass={"build_ext": CMakeBuild, 'build': build, 'install': CustomInstall}, From 989dda9b89bd924be49903d91bfee774d57c17a6 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Mon, 11 Sep 2023 12:26:41 +0200 Subject: [PATCH 028/169] including vpImage, fixing some bugs related to templating --- modules/core/include/visp3/core/vpImage.h | 134 ++++++++++++---------- modules/python/config/core.json | 2 +- modules/python/generator/header.py | 18 ++- modules/python/generator/submodule.py | 2 +- modules/python/generator/utils.py | 10 +- modules/python/include/core.hpp | 24 +++- modules/python/setup.py | 2 +- 7 files changed, 118 insertions(+), 74 deletions(-) diff --git a/modules/core/include/visp3/core/vpImage.h b/modules/core/include/visp3/core/vpImage.h index 23bd4661cd..247fefc135 100644 --- a/modules/core/include/visp3/core/vpImage.h +++ b/modules/core/include/visp3/core/vpImage.h @@ -313,14 +313,14 @@ template class vpImage bitmap[i * width + j] = v; } - vpImage operator-(const vpImage &B); + vpImage operator-(const vpImage &B) const; //! Copy operator vpImage &operator=(vpImage other); vpImage &operator=(const Type &v); - bool operator==(const vpImage &I); - bool operator!=(const vpImage &I); + bool operator==(const vpImage &I) const; + bool operator!=(const vpImage &I) const; friend std::ostream &operator<< <>(std::ostream &s, const vpImage &I); friend std::ostream &operator<<(std::ostream &s, const vpImage &I); friend std::ostream &operator<<(std::ostream &s, const vpImage &I); @@ -328,7 +328,7 @@ template class vpImage friend std::ostream &operator<<(std::ostream &s, const vpImage &I); // Perform a look-up table transformation - void performLut(const Type (&lut)[256], unsigned int nbThreads = 1); + void performLut(const Type(&lut)[256], unsigned int nbThreads = 1); // Returns a new image that's a quarter size of the current image void quarterSizeImage(vpImage &res) const; @@ -338,8 +338,8 @@ template class vpImage // set the size of the image and initialize it. void resize(unsigned int h, unsigned int w, const Type &val); - void sub(const vpImage &B, vpImage &C); - void sub(const vpImage &A, const vpImage &B, vpImage &C); + void sub(const vpImage &B, vpImage &C) const; + void sub(const vpImage &A, const vpImage &B, vpImage &C) const; void subsample(unsigned int v_scale, unsigned int h_scale, vpImage &sampled) const; friend void swap<>(vpImage &first, vpImage &second); @@ -486,19 +486,19 @@ inline std::ostream &operator<<(std::ostream &s, const vpImage &I) #if defined(VISP_HAVE_PTHREAD) || (defined(_WIN32) && !defined(WINRT_8_0)) namespace { -struct ImageLut_Param_t { +struct ImageLut_Param_t +{ unsigned int m_start_index; unsigned int m_end_index; unsigned char m_lut[256]; unsigned char *m_bitmap; - ImageLut_Param_t() : m_start_index(0), m_end_index(0), m_lut(), m_bitmap(NULL) {} + ImageLut_Param_t() : m_start_index(0), m_end_index(0), m_lut(), m_bitmap(NULL) { } ImageLut_Param_t(unsigned int start_index, unsigned int end_index, unsigned char *bitmap) : m_start_index(start_index), m_end_index(end_index), m_lut(), m_bitmap(bitmap) - { - } + { } }; vpThread::Return performLutThread(vpThread::Args args) @@ -554,19 +554,19 @@ vpThread::Return performLutThread(vpThread::Args args) return 0; } -struct ImageLutRGBa_Param_t { +struct ImageLutRGBa_Param_t +{ unsigned int m_start_index; unsigned int m_end_index; vpRGBa m_lut[256]; unsigned char *m_bitmap; - ImageLutRGBa_Param_t() : m_start_index(0), m_end_index(0), m_lut(), m_bitmap(NULL) {} + ImageLutRGBa_Param_t() : m_start_index(0), m_end_index(0), m_lut(), m_bitmap(NULL) { } ImageLutRGBa_Param_t(unsigned int start_index, unsigned int end_index, unsigned char *bitmap) : m_start_index(start_index), m_end_index(end_index), m_lut(), m_bitmap(bitmap) - { - } + { } }; vpThread::Return performLutRGBaThread(vpThread::Args args) @@ -720,7 +720,8 @@ template void vpImage::init(Type *const array, unsigned int h // Copy the image data memcpy(static_cast(bitmap), static_cast(array), (size_t)(npixels * sizeof(Type))); - } else { + } + else { // Copy the address of the array in the bitmap bitmap = array; } @@ -771,8 +772,7 @@ vpImage::vpImage(Type *const array, unsigned int h, unsigned int w, bool c */ template vpImage::vpImage() : bitmap(NULL), display(NULL), npixels(0), width(0), height(0), row(NULL), hasOwnership(true) -{ -} +{ } /*! \brief resize the image : Image initialization @@ -870,7 +870,7 @@ vpImage::vpImage(const vpImage &I) template vpImage::vpImage(vpImage &&I) : bitmap(I.bitmap), display(I.display), npixels(I.npixels), width(I.width), height(I.height), row(I.row), - hasOwnership(I.hasOwnership) + hasOwnership(I.hasOwnership) { I.bitmap = NULL; I.display = NULL; @@ -921,7 +921,8 @@ template <> inline double vpImage::getMaxValue(bool onlyFiniteVal) const if (bitmap[i] > m && vpMath::isFinite(bitmap[i])) m = bitmap[i]; } - } else { + } + else { for (unsigned int i = 0; i < npixels; i++) { if (bitmap[i] > m) m = bitmap[i]; @@ -948,7 +949,8 @@ template <> inline float vpImage::getMaxValue(bool onlyFiniteVal) const if (bitmap[i] > m && vpMath::isFinite(bitmap[i])) m = bitmap[i]; } - } else { + } + else { for (unsigned int i = 0; i < npixels; i++) { if (bitmap[i] > m) m = bitmap[i]; @@ -1006,7 +1008,8 @@ template <> inline double vpImage::getMinValue(bool onlyFiniteVal) const for (unsigned int i = 0; i < npixels; i++) if (bitmap[i] < m && vpMath::isFinite(bitmap[i])) m = bitmap[i]; - } else { + } + else { for (unsigned int i = 0; i < npixels; i++) if (bitmap[i] < m) m = bitmap[i]; @@ -1031,7 +1034,8 @@ template <> inline float vpImage::getMinValue(bool onlyFiniteVal) const for (unsigned int i = 0; i < npixels; i++) if (bitmap[i] < m && vpMath::isFinite(bitmap[i])) m = bitmap[i]; - } else { + } + else { for (unsigned int i = 0; i < npixels; i++) if (bitmap[i] < m) m = bitmap[i]; @@ -1090,7 +1094,8 @@ template <> inline void vpImage::getMinMaxValue(double &min, double &max max = bitmap[i]; } } - } else { + } + else { for (unsigned int i = 0; i < npixels; i++) { if (bitmap[i] < min) min = bitmap[i]; @@ -1126,7 +1131,8 @@ template <> inline void vpImage::getMinMaxValue(float &min, float &max, b max = bitmap[i]; } } - } else { + } + else { for (unsigned int i = 0; i < npixels; i++) { if (bitmap[i] < min) min = bitmap[i]; @@ -1173,7 +1179,8 @@ template <> inline void vpImage::getMinMaxValue(vpRGBf &min, vpRGBf &max max.B = bitmap[i].B; } } - } else { + } + else { for (unsigned int i = 0; i < npixels; i++) { if (bitmap[i].R < min.R) min.R = bitmap[i].R; @@ -1219,7 +1226,7 @@ void vpImage::getMinMaxLoc(vpImagePoint *minLoc, vpImagePoint *maxLoc, Typ { if (npixels == 0) throw(vpException(vpException::fatalError, "Cannot get location of minimum/maximum " - "values of an empty image")); + "values of an empty image")); Type min = bitmap[0], max = bitmap[0]; vpImagePoint minLoc_, maxLoc_; @@ -1285,7 +1292,7 @@ template vpImage &vpImage::operator=(const Type &v) \return true if the images are the same, false otherwise. */ -template bool vpImage::operator==(const vpImage &I) +template bool vpImage::operator==(const vpImage &I) const { if (this->width != I.getWidth()) return false; @@ -1308,7 +1315,7 @@ template bool vpImage::operator==(const vpImage &I) \return true if the images are different, false if they are the same. */ -template bool vpImage::operator!=(const vpImage &I) { return !(*this == I); } +template bool vpImage::operator!=(const vpImage &I) const { return !(*this == I); } /*! Operation A - B (A is unchanged). @@ -1335,7 +1342,7 @@ int main() \sa sub(const vpImage &, const vpImage &, vpImage &) to avoid matrix allocation for each use. */ -template vpImage vpImage::operator-(const vpImage &B) +template vpImage vpImage::operator-(const vpImage &B) const { vpImage C; sub(*this, B, C); @@ -1631,9 +1638,9 @@ template Type vpImage::getValue(double i, double j) const unsigned int jround_1 = (std::min)(width - 1, jround + 1); double value = - (static_cast(row[iround][jround]) * rfrac + static_cast(row[iround_1][jround]) * rratio) * cfrac + - (static_cast(row[iround][jround_1]) * rfrac + static_cast(row[iround_1][jround_1]) * rratio) * - cratio; + (static_cast(row[iround][jround]) * rfrac + static_cast(row[iround_1][jround]) * rratio) * cfrac + + (static_cast(row[iround][jround_1]) * rfrac + static_cast(row[iround_1][jround_1]) * rratio) * + cratio; return static_cast(vpMath::round(value)); } @@ -1663,7 +1670,7 @@ template <> inline double vpImage::getValue(double i, double j) const unsigned int jround_1 = (std::min)(width - 1, jround + 1); return (row[iround][jround] * rfrac + row[iround_1][jround] * rratio) * cfrac + - (row[iround][jround_1] * rfrac + row[iround_1][jround_1] * rratio) * cratio; + (row[iround][jround_1] * rfrac + row[iround_1][jround_1] * rratio) * cratio; } /*! @@ -1704,12 +1711,15 @@ template <> inline unsigned char vpImage::getValue(double i, doub return static_cast((((up & 0x00FF) * rfrac + (down & 0x00FF) * rratio) * cfrac + ((up >> 8) * rfrac + (down >> 8) * rratio) * cratio) >> 32); - } else if (y_ + 1 < height) { + } + else if (y_ + 1 < height) { return static_cast(((row[y_][x_] * rfrac + row[y_ + 1][x_] * rratio)) >> 16); - } else if (x_ + 1 < width) { + } + else if (x_ + 1 < width) { uint16_t up = vpEndian::reinterpret_cast_uchar_to_uint16_LE(bitmap + y_ * width + x_); return static_cast(((up & 0x00FF) * cfrac + (up >> 8) * cratio) >> 16); - } else { + } + else { return row[y_][x_]; } #else @@ -1731,9 +1741,9 @@ template <> inline unsigned char vpImage::getValue(double i, doub unsigned int jround_1 = (std::min)(width - 1, jround + 1); double value = - (static_cast(row[iround][jround]) * rfrac + static_cast(row[iround_1][jround]) * rratio) * cfrac + - (static_cast(row[iround][jround_1]) * rfrac + static_cast(row[iround_1][jround_1]) * rratio) * - cratio; + (static_cast(row[iround][jround]) * rfrac + static_cast(row[iround_1][jround]) * rratio) * cfrac + + (static_cast(row[iround][jround_1]) * rfrac + static_cast(row[iround_1][jround_1]) * rratio) * + cratio; return static_cast(vpMath::round(value)); #endif } @@ -1763,20 +1773,20 @@ template <> inline vpRGBa vpImage::getValue(double i, double j) const unsigned int jround_1 = (std::min)(width - 1, jround + 1); double valueR = - (static_cast(row[iround][jround].R) * rfrac + static_cast(row[iround_1][jround].R) * rratio) * - cfrac + - (static_cast(row[iround][jround_1].R) * rfrac + static_cast(row[iround_1][jround_1].R) * rratio) * - cratio; + (static_cast(row[iround][jround].R) * rfrac + static_cast(row[iround_1][jround].R) * rratio) * + cfrac + + (static_cast(row[iround][jround_1].R) * rfrac + static_cast(row[iround_1][jround_1].R) * rratio) * + cratio; double valueG = - (static_cast(row[iround][jround].G) * rfrac + static_cast(row[iround_1][jround].G) * rratio) * - cfrac + - (static_cast(row[iround][jround_1].G) * rfrac + static_cast(row[iround_1][jround_1].G) * rratio) * - cratio; + (static_cast(row[iround][jround].G) * rfrac + static_cast(row[iround_1][jround].G) * rratio) * + cfrac + + (static_cast(row[iround][jround_1].G) * rfrac + static_cast(row[iround_1][jround_1].G) * rratio) * + cratio; double valueB = - (static_cast(row[iround][jround].B) * rfrac + static_cast(row[iround_1][jround].B) * rratio) * - cfrac + - (static_cast(row[iround][jround_1].B) * rfrac + static_cast(row[iround_1][jround_1].B) * rratio) * - cratio; + (static_cast(row[iround][jround].B) * rfrac + static_cast(row[iround_1][jround].B) * rratio) * + cfrac + + (static_cast(row[iround][jround_1].B) * rfrac + static_cast(row[iround_1][jround_1].B) * rratio) * + cratio; return vpRGBa(static_cast(vpMath::round(valueR)), static_cast(vpMath::round(valueG)), static_cast(vpMath::round(valueB))); @@ -1887,13 +1897,14 @@ int main() \sa operator-() */ -template void vpImage::sub(const vpImage &B, vpImage &C) +template void vpImage::sub(const vpImage &B, vpImage &C) const { try { if ((this->getHeight() != C.getHeight()) || (this->getWidth() != C.getWidth())) C.resize(this->getHeight(), this->getWidth()); - } catch (const vpException &me) { + } + catch (const vpException &me) { std::cout << me << std::endl; throw; } @@ -1918,13 +1929,14 @@ template void vpImage::sub(const vpImage &B, vpImage void vpImage::sub(const vpImage &A, const vpImage &B, vpImage &C) +template void vpImage::sub(const vpImage &A, const vpImage &B, vpImage &C) const { try { if ((A.getHeight() != C.getHeight()) || (A.getWidth() != C.getWidth())) C.resize(A.getHeight(), A.getWidth()); - } catch (const vpException &me) { + } + catch (const vpException &me) { std::cout << me << std::endl; throw; } @@ -1946,7 +1958,7 @@ template void vpImage::sub(const vpImage &A, const vpIm \sa vpImage::performLut(const vpRGBa (&lut)[256], unsigned int nbThreads) */ -template void vpImage::performLut(const Type (&)[256], unsigned int) +template void vpImage::performLut(const Type(&)[256], unsigned int) { std::cerr << "Not implemented !" << std::endl; } @@ -1961,7 +1973,7 @@ template void vpImage::performLut(const Type (&)[256], unsign intensity to his new value. \param nbThreads : Number of threads to use for the computation. */ -template <> inline void vpImage::performLut(const unsigned char (&lut)[256], unsigned int nbThreads) +template <> inline void vpImage::performLut(const unsigned char(&lut)[256], unsigned int nbThreads) { unsigned int size = getWidth() * getHeight(); unsigned char *ptrStart = (unsigned char *)bitmap; @@ -1984,7 +1996,8 @@ template <> inline void vpImage::performLut(const unsigned char ( *ptrCurrent = lut[*ptrCurrent]; ++ptrCurrent; } - } else { + } + else { #if defined(VISP_HAVE_PTHREAD) || (defined(_WIN32) && !defined(WINRT_8_0)) // Multi-threads @@ -2040,7 +2053,7 @@ template <> inline void vpImage::performLut(const unsigned char ( intensity to his new value. \param nbThreads : Number of threads to use for the computation. */ -template <> inline void vpImage::performLut(const vpRGBa (&lut)[256], unsigned int nbThreads) +template <> inline void vpImage::performLut(const vpRGBa(&lut)[256], unsigned int nbThreads) { unsigned int size = getWidth() * getHeight(); unsigned char *ptrStart = (unsigned char *)bitmap; @@ -2071,7 +2084,8 @@ template <> inline void vpImage::performLut(const vpRGBa (&lut)[256], un *ptrCurrent = lut[*ptrCurrent].A; ++ptrCurrent; } - } else { + } + else { #if defined(VISP_HAVE_PTHREAD) || (defined(_WIN32) && !defined(WINRT_8_0)) // Multi-threads std::vector threadpool; diff --git a/modules/python/config/core.json b/modules/python/config/core.json index 4a55f97936..1fb0647d65 100644 --- a/modules/python/config/core.json +++ b/modules/python/config/core.json @@ -41,7 +41,7 @@ { "python_name": "ImageUInt16", "arguments": ["uint16_t"] - } + }, { "python_name": "ImageRGBA", "arguments": ["vpRGBa"] diff --git a/modules/python/generator/header.py b/modules/python/generator/header.py index c6b28bb433..38817b73d9 100644 --- a/modules/python/generator/header.py +++ b/modules/python/generator/header.py @@ -108,9 +108,9 @@ def run_preprocessor(self): # TODO: run without generating a new file '', '-D', 'vp_deprecated=', '-D', 'VISP_EXPORT=', - '-I', '/home/sfelton/software/visp_build/include', + '-I', '/home/sfelton/visp_build/include', '-I', '/usr/local/include', - #'-I', '/usr/include', + '-I', '/usr/include', '-N', 'VISP_BUILD_DEPRECATED_FUNCTIONS', '--passthru-includes', "^((?!vpConfig.h|!json.hpp).)*$", '--passthru-unfound-includes', @@ -146,6 +146,7 @@ def parse_data(self, data: ParsedData): def generate_class(self, cls: ClassScope, header_env: HeaderEnvironment) -> str: result = '' def generate_class_with_potiental_specialization(name_python: str, owner_specs: OrderedDict[str, str], cls_config: Dict) -> str: + spec_result = '' python_ident = f'py{name_python}' name_cpp = get_typename(cls.class_decl.typename, owner_specs, header_env.mapping) @@ -201,9 +202,16 @@ def generate_class_with_potiental_specialization(name_python: str, owner_specs: # Operator definitions binary_return_ops = supported_const_return_binary_op_map() binary_in_place_ops = supported_in_place_binary_op_map() + for method, method_config in operators: + if name_cpp_no_template == 'vpImage': + print('\t\t', owner_specs) + print('\t\t', header_env.mapping) + method_name = get_name(method.name) + method_is_const = method.const params_strs = [get_type(param.type, owner_specs, header_env.mapping) for param in method.parameters] + print('\t\t', params_strs) if len(params_strs) > 1: print(f'Found operator {name_cpp}{method_name} with more than one parameter, skipping') continue @@ -213,7 +221,7 @@ def generate_class_with_potiental_specialization(name_python: str, owner_specs: for cpp_op, python_op_name in binary_return_ops.items(): if method_name == f'operator{cpp_op}': operator_str = f''' -{python_ident}.def("__{python_op_name}__", [](const {name_cpp}& self, {params_strs[0]} o) {{ +{python_ident}.def("__{python_op_name}__", []({"const" if method_is_const else ""} {name_cpp}& self, {params_strs[0]} o) {{ return (self {cpp_op} o); }}, py::is_operator());''' method_strs.append(operator_str) @@ -221,7 +229,7 @@ def generate_class_with_potiental_specialization(name_python: str, owner_specs: for cpp_op, python_op_name in binary_in_place_ops.items(): if method_name == f'operator{cpp_op}': operator_str = f''' -{python_ident}.def("__{python_op_name}__", []({name_cpp}& self, {params_strs[0]} o) {{ +{python_ident}.def("__{python_op_name}__", []({"const" if method_is_const else ""} {name_cpp}& self, {params_strs[0]} o) {{ self {cpp_op} o; return self; }}, py::is_operator());''' @@ -265,7 +273,7 @@ def generate_class_with_potiental_specialization(name_python: str, owner_specs: template_types = owner_specs.values() template_str = f'<{", ".join([template_type for template_type in template_types])}>' - method_strs.append(f'{cls_config["additional_bindings"]}{template_str}({python_ident});') + method_strs.append(f'{cls_config["additional_bindings"]}({python_ident});') # Check for potential error generating definitions diff --git a/modules/python/generator/submodule.py b/modules/python/generator/submodule.py index 5aee6c112d..469f88c5e2 100644 --- a/modules/python/generator/submodule.py +++ b/modules/python/generator/submodule.py @@ -136,7 +136,7 @@ def get_method_config(self, class_name: Optional[str], method, owner_specs, head def get_submodules(include_path: Path, generate_path: Path) -> List[Submodule]: return [ - Submodule('core', Path('/home/sfelton/software/visp-sfelton/modules/core/include/visp3/core'), generate_path / 'core.cpp'), + Submodule('core', Path('/home/sfelton/visp-sfelton/modules/core/include/visp3/core'), generate_path / 'core.cpp'), # Submodule('visual_features', include_path / 'visual_features', generate_path / 'visual_features.cpp'), # Submodule('vs', include_path / 'vs', generate_path / 'vs.cpp') diff --git a/modules/python/generator/utils.py b/modules/python/generator/utils.py index 7eb497194c..56a392fe3f 100644 --- a/modules/python/generator/utils.py +++ b/modules/python/generator/utils.py @@ -18,10 +18,11 @@ def segment_repr(segment: types.PQNameSegment) -> str: spec_str = '' if isinstance(segment, types.FundamentalSpecifier): return segment.name + segment_name = segment.name if segment.name in owner_specs: - segment.name = owner_specs[segment.name] + segment_name = owner_specs[segment.name] if segment.name in header_env_mapping: - segment.name = header_env_mapping[segment.name] + segment_name = header_env_mapping[segment.name] if segment.specialization is not None: template_strs = [] @@ -30,15 +31,14 @@ def segment_repr(segment: types.PQNameSegment) -> str: spec_str = f'<{",".join(template_strs)}>' - return segment.name + spec_str + return segment_name + spec_str return '::'.join(list(map(segment_repr, typename.segments))) def get_type(param: Union[types.FunctionType, types.DecoratedType, types.Value], owner_specs: Dict[str, str], header_env_mapping: Dict[str, str]) -> Optional[str]: if isinstance(param, types.Value): return ''.join([token.value for token in param.tokens]) - if isinstance(param, types.FunctionType): - return 'FUNCTION' + if isinstance(param, types.Type): repr_str = get_typename(param.typename, owner_specs, header_env_mapping) split = repr_str.split('<') diff --git a/modules/python/include/core.hpp b/modules/python/include/core.hpp index 93e90240ee..19238eded8 100644 --- a/modules/python/include/core.hpp +++ b/modules/python/include/core.hpp @@ -10,6 +10,8 @@ #include #include #include +#include + namespace py = pybind11; @@ -118,7 +120,7 @@ void bindings_vpArray2D(py::class_> &pyArray2D) vpArray2D result(shape[0], shape[1]); copy_data_from_np(np_array, result.data); return result; - })); + })); } @@ -151,5 +153,25 @@ void bindings_vpHomogeneousMatrix(py::class_ +// void bindings_vpImage(py::class_> &pyImage) = delete; + +template +typename std::enable_if::value, void>::type +bindings_vpImage(py::class_> &pyImage) +{ + pyImage.def_buffer([](vpImage &image) -> py::buffer_info { + return make_array_buffer(image.bitmap, { image.getHeight(), image.getWidth() }, false); + }); +} +template<> +void bindings_vpImage(py::class_> &pyImage) +{ } +template<> +void bindings_vpImage(py::class_> &pyImage) +{ } + + + #endif \ No newline at end of file diff --git a/modules/python/setup.py b/modules/python/setup.py index 0754bce801..3edd725004 100644 --- a/modules/python/setup.py +++ b/modules/python/setup.py @@ -34,7 +34,7 @@ def run(self): class build(build_module.build): def run(self): import os - #output = subprocess.run('python generator/generator.py', env=os.environ, shell=True, capture_output=True, check=True) + output = subprocess.run('python generator/generator.py', env=os.environ, shell=True, capture_output=True, check=True) build_module.build.run(self) # A CMakeExtension needs a sourcedir instead of a file list. # The name must be the _single_ output extension from the CMake build. From a606650eb738190a3a41a915640706904352b2a2 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Mon, 11 Sep 2023 18:00:36 +0200 Subject: [PATCH 029/169] fix for templating of vpImage binding --- modules/python/generator/header.py | 4 ++-- modules/python/generator/submodule.py | 2 +- modules/python/include/core.hpp | 11 +++++++---- modules/python/setup.py | 2 +- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/modules/python/generator/header.py b/modules/python/generator/header.py index 38817b73d9..213bc6e6b5 100644 --- a/modules/python/generator/header.py +++ b/modules/python/generator/header.py @@ -108,9 +108,9 @@ def run_preprocessor(self): # TODO: run without generating a new file '', '-D', 'vp_deprecated=', '-D', 'VISP_EXPORT=', - '-I', '/home/sfelton/visp_build/include', + '-I', '/home/sfelton/software/visp_build/include', '-I', '/usr/local/include', - '-I', '/usr/include', + #'-I', '/usr/include', '-N', 'VISP_BUILD_DEPRECATED_FUNCTIONS', '--passthru-includes', "^((?!vpConfig.h|!json.hpp).)*$", '--passthru-unfound-includes', diff --git a/modules/python/generator/submodule.py b/modules/python/generator/submodule.py index 469f88c5e2..5aee6c112d 100644 --- a/modules/python/generator/submodule.py +++ b/modules/python/generator/submodule.py @@ -136,7 +136,7 @@ def get_method_config(self, class_name: Optional[str], method, owner_specs, head def get_submodules(include_path: Path, generate_path: Path) -> List[Submodule]: return [ - Submodule('core', Path('/home/sfelton/visp-sfelton/modules/core/include/visp3/core'), generate_path / 'core.cpp'), + Submodule('core', Path('/home/sfelton/software/visp-sfelton/modules/core/include/visp3/core'), generate_path / 'core.cpp'), # Submodule('visual_features', include_path / 'visual_features', generate_path / 'visual_features.cpp'), # Submodule('vs', include_path / 'vs', generate_path / 'vs.cpp') diff --git a/modules/python/include/core.hpp b/modules/python/include/core.hpp index 19238eded8..955b2079a0 100644 --- a/modules/python/include/core.hpp +++ b/modules/python/include/core.hpp @@ -11,6 +11,7 @@ #include #include #include +#include @@ -164,11 +165,13 @@ bindings_vpImage(py::class_> &pyImage) return make_array_buffer(image.bitmap, { image.getHeight(), image.getWidth() }, false); }); } -template<> -void bindings_vpImage(py::class_> &pyImage) +template +typename std::enable_if::value, void>::type +bindings_vpImage(py::class_> &pyImage) { } -template<> -void bindings_vpImage(py::class_> &pyImage) +template +typename std::enable_if::value, void>::type +bindings_vpImage(py::class_> &pyImage) { } diff --git a/modules/python/setup.py b/modules/python/setup.py index 3edd725004..0754bce801 100644 --- a/modules/python/setup.py +++ b/modules/python/setup.py @@ -34,7 +34,7 @@ def run(self): class build(build_module.build): def run(self): import os - output = subprocess.run('python generator/generator.py', env=os.environ, shell=True, capture_output=True, check=True) + #output = subprocess.run('python generator/generator.py', env=os.environ, shell=True, capture_output=True, check=True) build_module.build.run(self) # A CMakeExtension needs a sourcedir instead of a file list. # The name must be the _single_ output extension from the CMake build. From d31fbc7146e42ab524a73d84f12bb06f979983ce Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Tue, 12 Sep 2023 03:32:42 +0200 Subject: [PATCH 030/169] Add vpRGBf operators in vpImage, indexing for vpArray2D --- modules/core/include/visp3/core/vpImage.h | 58 ++++++ modules/python/config/core.json | 4 + modules/python/generator/header.py | 4 +- modules/python/generator/submodule.py | 2 +- modules/python/include/core.hpp | 214 +++++++++++++++++++--- 5 files changed, 257 insertions(+), 25 deletions(-) diff --git a/modules/core/include/visp3/core/vpImage.h b/modules/core/include/visp3/core/vpImage.h index 247fefc135..1f9eebcffc 100644 --- a/modules/core/include/visp3/core/vpImage.h +++ b/modules/core/include/visp3/core/vpImage.h @@ -1792,6 +1792,49 @@ template <> inline vpRGBa vpImage::getValue(double i, double j) const static_cast(vpMath::round(valueB))); } +/*! + \relates vpImage + */ +template <> inline vpRGBf vpImage::getValue(double i, double j) const +{ + if (i < 0 || j < 0 || i + 1 > height || j + 1 > width) { + throw(vpException(vpImageException::notInTheImage, "Pixel outside of the image")); + } + if (height * width == 0) { + throw vpException(vpImageException::notInitializedError, "Empty image!"); + } + + unsigned int iround = static_cast(floor(i)); + unsigned int jround = static_cast(floor(j)); + + double rratio = i - static_cast(iround); + double cratio = j - static_cast(jround); + + double rfrac = 1.0 - rratio; + double cfrac = 1.0 - cratio; + + unsigned int iround_1 = (std::min)(height - 1, iround + 1); + unsigned int jround_1 = (std::min)(width - 1, jround + 1); + + double valueR = + (static_cast(row[iround][jround].R) * rfrac + static_cast(row[iround_1][jround].R) * rratio) * + cfrac + + (static_cast(row[iround][jround_1].R) * rfrac + static_cast(row[iround_1][jround_1].R) * rratio) * + cratio; + double valueG = + (static_cast(row[iround][jround].G) * rfrac + static_cast(row[iround_1][jround].G) * rratio) * + cfrac + + (static_cast(row[iround][jround_1].G) * rfrac + static_cast(row[iround_1][jround_1].G) * rratio) * + cratio; + double valueB = + (static_cast(row[iround][jround].B) * rfrac + static_cast(row[iround_1][jround].B) * rratio) * + cfrac + + (static_cast(row[iround][jround_1].B) * rfrac + static_cast(row[iround_1][jround_1].B) * rratio) * + cratio; + + return vpRGBf(static_cast(valueR), static_cast(valueG), static_cast(valueB)); +} + /*! Retrieves pixel value from an image containing values of type \e Type with sub-pixel accuracy. @@ -1868,6 +1911,21 @@ template <> inline double vpImage::getSum() const return res; } +/** + * \relates vpImage + */ +template <> inline double vpImage::getSum() const +{ + if ((height == 0) || (width == 0)) + return 0.0; + + double res = 0.0; + for (unsigned int i = 0; i < height * width; ++i) { + res += static_cast(bitmap[i].R) + static_cast(bitmap[i].G) + static_cast(bitmap[i].B); + } + return res; +} + /*! Operation C = *this - B. diff --git a/modules/python/config/core.json b/modules/python/config/core.json index 1fb0647d65..1eefe20922 100644 --- a/modules/python/config/core.json +++ b/modules/python/config/core.json @@ -45,6 +45,10 @@ { "python_name": "ImageRGBA", "arguments": ["vpRGBa"] + }, + { + "python_name": "ImageRGBf", + "arguments": ["vpRGBf"] } ], "methods": diff --git a/modules/python/generator/header.py b/modules/python/generator/header.py index 213bc6e6b5..38817b73d9 100644 --- a/modules/python/generator/header.py +++ b/modules/python/generator/header.py @@ -108,9 +108,9 @@ def run_preprocessor(self): # TODO: run without generating a new file '', '-D', 'vp_deprecated=', '-D', 'VISP_EXPORT=', - '-I', '/home/sfelton/software/visp_build/include', + '-I', '/home/sfelton/visp_build/include', '-I', '/usr/local/include', - #'-I', '/usr/include', + '-I', '/usr/include', '-N', 'VISP_BUILD_DEPRECATED_FUNCTIONS', '--passthru-includes', "^((?!vpConfig.h|!json.hpp).)*$", '--passthru-unfound-includes', diff --git a/modules/python/generator/submodule.py b/modules/python/generator/submodule.py index 5aee6c112d..469f88c5e2 100644 --- a/modules/python/generator/submodule.py +++ b/modules/python/generator/submodule.py @@ -136,7 +136,7 @@ def get_method_config(self, class_name: Optional[str], method, owner_specs, head def get_submodules(include_path: Path, generate_path: Path) -> List[Submodule]: return [ - Submodule('core', Path('/home/sfelton/software/visp-sfelton/modules/core/include/visp3/core'), generate_path / 'core.cpp'), + Submodule('core', Path('/home/sfelton/visp-sfelton/modules/core/include/visp3/core'), generate_path / 'core.cpp'), # Submodule('visual_features', include_path / 'visual_features', generate_path / 'visual_features.cpp'), # Submodule('vs', include_path / 'vs', generate_path / 'vs.cpp') diff --git a/modules/python/include/core.hpp b/modules/python/include/core.hpp index 955b2079a0..6228d8ef12 100644 --- a/modules/python/include/core.hpp +++ b/modules/python/include/core.hpp @@ -76,7 +76,7 @@ void verify_array_shape_and_dims(np_array_cf np_array, unsigned dims, cons template void verify_array_shape_and_dims(np_array_cf np_array, std::vector expected_dims, const char *class_name) { - verify_array_shape_and_dims(np_array, expected_dims.size()); + verify_array_shape_and_dims(np_array, expected_dims.size(), class_name); py::buffer_info buffer = np_array.request(); std::vector shape = buffer.shape; bool invalid_shape = false; @@ -109,54 +109,213 @@ void copy_data_from_np(np_array_cf src, Item *dest) } -template -void bindings_vpArray2D(py::class_> &pyArray2D) +/*Array2D and its children*/ + +/*Get buffer infos : used in def_buffer and the .numpy() function*/ +template std::function get_buffer_info() = delete; +template class Array, + typename std::enable_if, Array>::value, bool>::type = true> +std::function &)> get_buffer_info() { - pyArray2D.def_buffer([](vpArray2D &array) -> py::buffer_info { + return [](vpArray2D &array) -> py::buffer_info { return make_array_buffer(array.data, { array.getRows(), array.getCols() }, false); + }; +} + +template<> +std::function get_buffer_info() +{ + return [](vpColVector &array) -> py::buffer_info { + return make_array_buffer(array.data, { array.getRows() }, false); + }; +} +template<> +std::function get_buffer_info() +{ + return [](vpRowVector &array) -> py::buffer_info { + return make_array_buffer(array.data, { array.getCols() }, false); + }; +} +template<> +std::function get_buffer_info() +{ + return [](vpRotationMatrix &array) -> py::buffer_info { + return make_array_buffer(array.data, { array.getRows(), array.getCols() }, true); + }; +} +template<> +std::function get_buffer_info() +{ + return [](vpHomogeneousMatrix &array) -> py::buffer_info { + return make_array_buffer(array.data, { array.getRows(), array.getCols() }, true); + }; +} + +/*Array 2D indexing*/ +template +void define_get_item_2d_array(PyClass &pyClass, bool readonly) +{ + + pyClass.def("__getitem__", [](const Class &self, std::pair pair) -> Item { + int i = pair.first, j = pair.second; + const unsigned int rows = self.getRows(), cols = self.getCols(); + if (abs(i) > rows || abs(j) > cols) { + std::stringstream ss; + ss << "Invalid indexing into a 2D array: got indices " << shape_to_string({ i, j }) + << " but array has dimensions " << shape_to_string({ rows, cols }); + throw std::runtime_error(ss.str()); + } + if (i < 0) { + i = rows + i; + } + if (j < 0) { + j = cols + j; + } + return self[i][j]; + }); + pyClass.def("__getitem__", [readonly](const Class &self, int i) -> np_array_cf { + const unsigned int rows = self.getRows(); + if (abs(i) > rows) { + std::stringstream ss; + ss << "Invalid indexing into a 2D array: got row index " << shape_to_string({ i }) + << " but array has " << rows << " rows"; + throw std::runtime_error(ss.str()); + } + if (i < 0) { + i = rows + i; + } + return np_array_cf(make_array_buffer(self[i], { self.getCols() }, readonly)); + }); + pyClass.def("__getitem__", [readonly](const Class &self, int i) -> np_array_cf { + const unsigned int rows = self.getRows(); + if (abs(i) > rows) { + std::stringstream ss; + ss << "Invalid indexing into a 2D array: got row index " << shape_to_string({ i }) + << " but array has " << rows << " rows"; + throw std::runtime_error(ss.str()); + } + if (i < 0) { + i = rows + i; + } + return np_array_cf(make_array_buffer(self[i], { self.getCols() }, readonly), py::cast(self)); + }); + pyClass.def("__getitem__", [readonly](const Class &self, py::slice slice) { + auto as_array = np_array_cf(make_array_buffer(self.data, { self.getRows(), self.getCols() }, readonly), py::cast(self)); + return as_array[slice].template cast>(); + }); + pyClass.def("__getitem__", [readonly](const Class &self, py::tuple tuple) { + auto as_array = np_array_cf(make_array_buffer(self.data, { self.getRows(), self.getCols() }, readonly), py::cast(self)); + return as_array[tuple].template cast>(); }); - pyArray2D.def(py::init([](np_array_cf np_array) { + +} + + +template +void bindings_vpArray2D(py::class_> &pyArray2D) +{ + const auto buffer_fn = get_buffer_info(); + pyArray2D.def_buffer(buffer_fn); + pyArray2D.def("numpy", [buffer_fn](vpArray2D &self) -> np_array_cf { + return np_array_cf(buffer_fn(self), py::cast(self)); + }, R"doc(Numpy view of the underlying array data)doc"); + pyArray2D.def(py::init( + [](np_array_cf np_array) { verify_array_shape_and_dims(np_array, 2, "ViSP 2D array"); const std::vector shape = np_array.request().shape; vpArray2D result(shape[0], shape[1]); copy_data_from_np(np_array, result.data); return result; - })); + })); + define_get_item_2d_array>, vpArray2D, T>(pyArray2D, false); } void bindings_vpColVector(py::class_> &pyColVector) { - pyColVector.def_buffer([](vpColVector &array) -> py::buffer_info { - return make_array_buffer(array.data, { array.getRows() }, false); - }); + const auto buffer_fn = get_buffer_info(); + pyColVector.def_buffer(buffer_fn); + pyColVector.def("numpy", [buffer_fn](vpColVector &self) -> np_array_cf { + return np_array_cf(buffer_fn(self), py::cast(self)); + }, R"doc(Numpy view of the underlying array data)doc"); + pyColVector.def(py::init( + [](np_array_cf np_array) { + verify_array_shape_and_dims(np_array, 1, "ViSP column vector"); + const std::vector shape = np_array.request().shape; + vpColVector result(shape[0]); + copy_data_from_np(np_array, result.data); + return result; + }) + ); } void bindings_vpRowVector(py::class_> &pyRowVector) { - pyRowVector.def_buffer([](vpRowVector &array) -> py::buffer_info { - return make_array_buffer(array.data, { array.getCols() }, false); - }); + const auto buffer_fn = get_buffer_info(); + pyRowVector.def_buffer(buffer_fn); + pyRowVector.def("numpy", [buffer_fn](vpRowVector &self) -> np_array_cf { + return np_array_cf(buffer_fn(self), py::cast(self)); + }, R"doc(Numpy view of the underlying array data)doc"); + pyRowVector.def(py::init( + [](np_array_cf np_array) { + verify_array_shape_and_dims(np_array, 1, "ViSP row vector"); + const std::vector shape = np_array.request().shape; + vpRowVector result(shape[0]); + copy_data_from_np(np_array, result.data); + return result; + }) + ); } void bindings_vpRotationMatrix(py::class_> &pyRotationMatrix) { - pyRotationMatrix.def_buffer([](vpRotationMatrix &array) -> py::buffer_info { - return make_array_buffer(array.data, { array.getRows(), array.getCols() }, true); - }); + const auto buffer_fn = get_buffer_info(); + pyRotationMatrix.def_buffer(buffer_fn); + pyRotationMatrix.def("numpy", [buffer_fn](vpRotationMatrix &self) -> np_array_cf { + return np_array_cf(buffer_fn(self), py::cast(self)); + }, R"doc(Numpy view of the underlying array data. Cannot be written to.)doc"); + pyRotationMatrix.def(py::init( + [](np_array_cf np_array) { + verify_array_shape_and_dims(np_array, { 3, 3 }, "ViSP rotation matrix"); + const std::vector shape = np_array.request().shape; + vpRotationMatrix result; + copy_data_from_np(np_array, result.data); + if (!result.isARotationMatrix()) { + throw std::runtime_error("Input numpy array is not a valid rotation matrix"); + } + return result; + })); + define_get_item_2d_array>, vpRotationMatrix, double>(pyRotationMatrix, true); } void bindings_vpHomogeneousMatrix(py::class_> &pyHomogeneousMatrix) { - pyHomogeneousMatrix.def_buffer([](vpHomogeneousMatrix &array) -> py::buffer_info { - return make_array_buffer(array.data, { array.getRows(), array.getCols() }, true); - }); + const auto buffer_fn = get_buffer_info(); + pyHomogeneousMatrix.def_buffer(buffer_fn); + pyHomogeneousMatrix.def("numpy", [buffer_fn](vpHomogeneousMatrix &self) -> np_array_cf { + return np_array_cf(buffer_fn(self), py::cast(self)); + }, R"doc(Numpy view of the underlying array data. Cannot be written to.)doc"); + + pyHomogeneousMatrix.def(py::init( + [](np_array_cf np_array) { + verify_array_shape_and_dims(np_array, { 4, 4 }, "ViSP homogeneous matrix"); + const std::vector shape = np_array.request().shape; + vpHomogeneousMatrix result; + copy_data_from_np(np_array, result.data); + if (!result.isAnHomogeneousMatrix()) { + throw std::runtime_error("Input numpy array is not a valid homogeneous matrix"); + } + return result; + })); + define_get_item_2d_array>, vpHomogeneousMatrix, double>(pyHomogeneousMatrix, false); } -// template -// void bindings_vpImage(py::class_> &pyImage) = delete; +/* + vpImage +*/ template typename std::enable_if::value, void>::type bindings_vpImage(py::class_> &pyImage) @@ -168,11 +327,22 @@ bindings_vpImage(py::class_> &pyImage) template typename std::enable_if::value, void>::type bindings_vpImage(py::class_> &pyImage) -{ } +{ + static_assert(sizeof(T) == 4 * sizeof(unsigned char)); + pyImage.def_buffer([](vpImage &image) -> py::buffer_info { + return make_array_buffer(reinterpret_cast(image.bitmap), { image.getHeight(), image.getWidth(), 4 }, false); + }); + +} template typename std::enable_if::value, void>::type bindings_vpImage(py::class_> &pyImage) -{ } +{ + static_assert(sizeof(T) == 3 * sizeof(float)); + pyImage.def_buffer([](vpImage &image) -> py::buffer_info { + return make_array_buffer(reinterpret_cast(image.bitmap), { image.getHeight(), image.getWidth(), 3 }, false); + }); +} From 13449f8281c17f41c42295e7d384a82591a29956 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Tue, 12 Sep 2023 17:20:45 +0200 Subject: [PATCH 031/169] more testing and indexing in numpy, gonna start writing a basic example script --- modules/python/config/core.json | 2 + modules/python/generator/header.py | 9 +- modules/python/generator/submodule.py | 2 +- modules/python/include/core.hpp | 127 ++++++++++++-------------- modules/python/test/test_basic.py | 44 ++++++++- 5 files changed, 106 insertions(+), 78 deletions(-) diff --git a/modules/python/config/core.json b/modules/python/config/core.json index 1eefe20922..e85a9f0a3b 100644 --- a/modules/python/config/core.json +++ b/modules/python/config/core.json @@ -109,6 +109,8 @@ }, "vpMatrix": { "ignore_repr": true, + "additional_bindings": "bindings_vpMatrix", + "use_buffer_protocol": true, "methods": [ diff --git a/modules/python/generator/header.py b/modules/python/generator/header.py index 38817b73d9..0d1f4a50db 100644 --- a/modules/python/generator/header.py +++ b/modules/python/generator/header.py @@ -108,9 +108,9 @@ def run_preprocessor(self): # TODO: run without generating a new file '', '-D', 'vp_deprecated=', '-D', 'VISP_EXPORT=', - '-I', '/home/sfelton/visp_build/include', + '-I', '/home/sfelton/software/visp_build/include', '-I', '/usr/local/include', - '-I', '/usr/include', + #'-I', '/usr/include', '-N', 'VISP_BUILD_DEPRECATED_FUNCTIONS', '--passthru-includes', "^((?!vpConfig.h|!json.hpp).)*$", '--passthru-unfound-includes', @@ -204,14 +204,9 @@ def generate_class_with_potiental_specialization(name_python: str, owner_specs: binary_in_place_ops = supported_in_place_binary_op_map() for method, method_config in operators: - if name_cpp_no_template == 'vpImage': - print('\t\t', owner_specs) - print('\t\t', header_env.mapping) - method_name = get_name(method.name) method_is_const = method.const params_strs = [get_type(param.type, owner_specs, header_env.mapping) for param in method.parameters] - print('\t\t', params_strs) if len(params_strs) > 1: print(f'Found operator {name_cpp}{method_name} with more than one parameter, skipping') continue diff --git a/modules/python/generator/submodule.py b/modules/python/generator/submodule.py index 469f88c5e2..5aee6c112d 100644 --- a/modules/python/generator/submodule.py +++ b/modules/python/generator/submodule.py @@ -136,7 +136,7 @@ def get_method_config(self, class_name: Optional[str], method, owner_specs, head def get_submodules(include_path: Path, generate_path: Path) -> List[Submodule]: return [ - Submodule('core', Path('/home/sfelton/visp-sfelton/modules/core/include/visp3/core'), generate_path / 'core.cpp'), + Submodule('core', Path('/home/sfelton/software/visp-sfelton/modules/core/include/visp3/core'), generate_path / 'core.cpp'), # Submodule('visual_features', include_path / 'visual_features', generate_path / 'visual_features.cpp'), # Submodule('vs', include_path / 'vs', generate_path / 'vs.cpp') diff --git a/modules/python/include/core.hpp b/modules/python/include/core.hpp index 6228d8ef12..f7cdd50e47 100644 --- a/modules/python/include/core.hpp +++ b/modules/python/include/core.hpp @@ -112,44 +112,40 @@ void copy_data_from_np(np_array_cf src, Item *dest) /*Array2D and its children*/ /*Get buffer infos : used in def_buffer and the .numpy() function*/ -template std::function get_buffer_info() = delete; +template py::buffer_info get_buffer_info(T &) = delete; template class Array, typename std::enable_if, Array>::value, bool>::type = true> -std::function &)> get_buffer_info() +py::buffer_info get_buffer_info(Array &array) { - return [](vpArray2D &array) -> py::buffer_info { - return make_array_buffer(array.data, { array.getRows(), array.getCols() }, false); - }; + return make_array_buffer(array.data, { array.getRows(), array.getCols() }, false); } template<> -std::function get_buffer_info() +py::buffer_info get_buffer_info(vpMatrix &array) { - return [](vpColVector &array) -> py::buffer_info { - return make_array_buffer(array.data, { array.getRows() }, false); - }; + return make_array_buffer(array.data, { array.getRows(), array.getCols() }, false); +} + +template<> +py::buffer_info get_buffer_info(vpColVector &array) +{ + return make_array_buffer(array.data, { array.getRows() }, false); } template<> -std::function get_buffer_info() +py::buffer_info get_buffer_info(vpRowVector &array) { - return [](vpRowVector &array) -> py::buffer_info { - return make_array_buffer(array.data, { array.getCols() }, false); - }; + return make_array_buffer(array.data, { array.getCols() }, false); } template<> -std::function get_buffer_info() +py::buffer_info get_buffer_info(vpRotationMatrix &array) { - return [](vpRotationMatrix &array) -> py::buffer_info { - return make_array_buffer(array.data, { array.getRows(), array.getCols() }, true); - }; + return make_array_buffer(array.data, { array.getRows(), array.getCols() }, true); } template<> -std::function get_buffer_info() +py::buffer_info get_buffer_info(vpHomogeneousMatrix &array) { - return [](vpHomogeneousMatrix &array) -> py::buffer_info { - return make_array_buffer(array.data, { array.getRows(), array.getCols() }, true); - }; + return make_array_buffer(array.data, { array.getRows(), array.getCols() }, true); } /*Array 2D indexing*/ @@ -174,19 +170,6 @@ void define_get_item_2d_array(PyClass &pyClass, bool readonly) } return self[i][j]; }); - pyClass.def("__getitem__", [readonly](const Class &self, int i) -> np_array_cf { - const unsigned int rows = self.getRows(); - if (abs(i) > rows) { - std::stringstream ss; - ss << "Invalid indexing into a 2D array: got row index " << shape_to_string({ i }) - << " but array has " << rows << " rows"; - throw std::runtime_error(ss.str()); - } - if (i < 0) { - i = rows + i; - } - return np_array_cf(make_array_buffer(self[i], { self.getCols() }, readonly)); - }); pyClass.def("__getitem__", [readonly](const Class &self, int i) -> np_array_cf { const unsigned int rows = self.getRows(); if (abs(i) > rows) { @@ -215,13 +198,12 @@ void define_get_item_2d_array(PyClass &pyClass, bool readonly) template void bindings_vpArray2D(py::class_> &pyArray2D) { - const auto buffer_fn = get_buffer_info(); - pyArray2D.def_buffer(buffer_fn); - pyArray2D.def("numpy", [buffer_fn](vpArray2D &self) -> np_array_cf { - return np_array_cf(buffer_fn(self), py::cast(self)); + + pyArray2D.def_buffer(&get_buffer_info); + pyArray2D.def("numpy", [](vpArray2D &self) -> np_array_cf { + return np_array_cf(get_buffer_info(self), py::cast(self)); }, R"doc(Numpy view of the underlying array data)doc"); - pyArray2D.def(py::init( - [](np_array_cf np_array) { + pyArray2D.def(py::init([](np_array_cf np_array) { verify_array_shape_and_dims(np_array, 2, "ViSP 2D array"); const std::vector shape = np_array.request().shape; vpArray2D result(shape[0], shape[1]); @@ -231,53 +213,63 @@ void bindings_vpArray2D(py::class_> &pyArray2D) define_get_item_2d_array>, vpArray2D, T>(pyArray2D, false); } +void bindings_vpMatrix(py::class_> &pyMatrix) +{ + + pyMatrix.def_buffer(&get_buffer_info); + pyMatrix.def("numpy", [](vpMatrix &self) -> np_array_cf { + return np_array_cf(get_buffer_info(self), py::cast(self)); + }, R"doc(Numpy view of the underlying array data)doc"); + pyMatrix.def(py::init([](np_array_cf np_array) { + verify_array_shape_and_dims(np_array, 2, "ViSP Matrix"); + const std::vector shape = np_array.request().shape; + vpMatrix result(shape[0], shape[1]); + copy_data_from_np(np_array, result.data); + return result; + })); + define_get_item_2d_array>, vpMatrix, double>(pyMatrix, false); +} + void bindings_vpColVector(py::class_> &pyColVector) { - const auto buffer_fn = get_buffer_info(); - pyColVector.def_buffer(buffer_fn); - pyColVector.def("numpy", [buffer_fn](vpColVector &self) -> np_array_cf { - return np_array_cf(buffer_fn(self), py::cast(self)); + pyColVector.def_buffer(&get_buffer_info); + pyColVector.def("numpy", [](vpColVector &self) -> np_array_cf { + return np_array_cf(get_buffer_info(self), py::cast(self)); }, R"doc(Numpy view of the underlying array data)doc"); - pyColVector.def(py::init( - [](np_array_cf np_array) { + pyColVector.def(py::init([](np_array_cf np_array) { verify_array_shape_and_dims(np_array, 1, "ViSP column vector"); const std::vector shape = np_array.request().shape; vpColVector result(shape[0]); copy_data_from_np(np_array, result.data); return result; - }) - ); + })); } void bindings_vpRowVector(py::class_> &pyRowVector) { - const auto buffer_fn = get_buffer_info(); - pyRowVector.def_buffer(buffer_fn); - pyRowVector.def("numpy", [buffer_fn](vpRowVector &self) -> np_array_cf { - return np_array_cf(buffer_fn(self), py::cast(self)); + pyRowVector.def_buffer(&get_buffer_info); + pyRowVector.def("numpy", [](vpRowVector &self) -> np_array_cf { + return np_array_cf(get_buffer_info(self), py::cast(self)); }, R"doc(Numpy view of the underlying array data)doc"); - pyRowVector.def(py::init( - [](np_array_cf np_array) { + pyRowVector.def(py::init([](np_array_cf np_array) { verify_array_shape_and_dims(np_array, 1, "ViSP row vector"); const std::vector shape = np_array.request().shape; vpRowVector result(shape[0]); copy_data_from_np(np_array, result.data); return result; - }) - ); + })); } void bindings_vpRotationMatrix(py::class_> &pyRotationMatrix) { - const auto buffer_fn = get_buffer_info(); - pyRotationMatrix.def_buffer(buffer_fn); - pyRotationMatrix.def("numpy", [buffer_fn](vpRotationMatrix &self) -> np_array_cf { - return np_array_cf(buffer_fn(self), py::cast(self)); + + pyRotationMatrix.def_buffer(&get_buffer_info); + pyRotationMatrix.def("numpy", [](vpRotationMatrix &self) -> np_array_cf { + return np_array_cf(get_buffer_info(self), py::cast(self)); }, R"doc(Numpy view of the underlying array data. Cannot be written to.)doc"); - pyRotationMatrix.def(py::init( - [](np_array_cf np_array) { + pyRotationMatrix.def(py::init([](np_array_cf np_array) { verify_array_shape_and_dims(np_array, { 3, 3 }, "ViSP rotation matrix"); const std::vector shape = np_array.request().shape; vpRotationMatrix result; @@ -292,14 +284,13 @@ void bindings_vpRotationMatrix(py::class_> & void bindings_vpHomogeneousMatrix(py::class_> &pyHomogeneousMatrix) { - const auto buffer_fn = get_buffer_info(); - pyHomogeneousMatrix.def_buffer(buffer_fn); - pyHomogeneousMatrix.def("numpy", [buffer_fn](vpHomogeneousMatrix &self) -> np_array_cf { - return np_array_cf(buffer_fn(self), py::cast(self)); + + pyHomogeneousMatrix.def_buffer(get_buffer_info); + pyHomogeneousMatrix.def("numpy", [](vpHomogeneousMatrix &self) -> np_array_cf { + return np_array_cf(get_buffer_info(self), py::cast(self)); }, R"doc(Numpy view of the underlying array data. Cannot be written to.)doc"); - pyHomogeneousMatrix.def(py::init( - [](np_array_cf np_array) { + pyHomogeneousMatrix.def(py::init([](np_array_cf np_array) { verify_array_shape_and_dims(np_array, { 4, 4 }, "ViSP homogeneous matrix"); const std::vector shape = np_array.request().shape; vpHomogeneousMatrix result; diff --git a/modules/python/test/test_basic.py b/modules/python/test/test_basic.py index 557c1a5399..047953a290 100644 --- a/modules/python/test/test_basic.py +++ b/modules/python/test/test_basic.py @@ -1,5 +1,5 @@ import visp -from visp.core import ArrayDouble2D, RotationMatrix, Matrix, HomogeneousMatrix +from visp.core import ArrayDouble2D, RotationMatrix, Matrix, HomogeneousMatrix, PoseVector import numpy as np import pytest @@ -30,12 +30,18 @@ def test_matrix_operations(): assert m1 * m3 == m4 assert m2 * 2 == m1 -def test_rotation_representations_not_writable(): +def test_representations_not_writable(): # Test that some classes have non writable numpy arrays R = RotationMatrix() R_np = np.array(R, copy=False) with pytest.raises(ValueError): R_np[0, 0] = 1 + # with pytest.raises(ValueError): + # R.numpy()[:1] = 0 + with pytest.raises(ValueError): + row = R[0] + row[0] = 1 + T = HomogeneousMatrix() T_np = np.array(T, copy=False) with pytest.raises(ValueError): @@ -52,7 +58,41 @@ def test_numpy_constructor(): n_valid = np.array([[1, 2, 3], [4, 5, 6]]) a = ArrayDouble2D(n_valid) + assert np.all(np.equal(a.numpy(), n_valid)) + +def test_numpy_conversion_and_back(): + a = ArrayDouble2D(10, 10, 2.0) + a_np = a.numpy().copy() + a2 = ArrayDouble2D(a_np) + mat = Matrix(a_np) + + for i in range(a.getRows()): + for j in range(a.getCols()): + assert a[i, j] == a_np[i, j] + assert a[i, j] == a2[i, j] + assert mat[i, j] == a[i, j] + +def test_indexing_array2D(): + a_np = np.asarray([[i for _ in range(10)] for i in range(10)]) + a = ArrayDouble2D(a_np) + col = list(range(10)) + for i in range(a.getRows()): + assert np.all(a[i] == float(i)) + assert np.all(a[-i - 1] == float(a.getRows() - i - 1)) + assert np.all(a[:, i] == col) + assert np.all(a[:, -i - 1] == col) +def test_index_array2D_is_not_copy(): + a = ArrayDouble2D(5, 5, 1.0) + first_row_view = a[0] + first_row_view[0] = 0.0 + assert a[0, 0] == 0.0 + sub_matrix = a[1:3, 1:3] + sub_matrix[0, 0] = 0.0 + assert a[1, 1] == 0.0 + col = a[:, -1] + col[0] = 0.0 + assert a[0, -1] == 0.0 def test_rotation_repr_can_be_defined_by_hand(): From fe512b64acd460dcb30621575975d0b1bed7c62c Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Wed, 13 Sep 2023 02:49:21 +0200 Subject: [PATCH 032/169] Exporting vs, vision and visual feature modules, some issues but passes --- modules/python/config/core.json | 1 + modules/python/config/vision.json | 25 +++++++++++++++++ modules/python/config/visual_features.json | 2 +- modules/python/config/vs.json | 2 +- modules/python/docs/index.rst | 8 ++++++ modules/python/generator/header.py | 13 ++++++--- modules/python/generator/submodule.py | 31 +++++++++++++++++----- modules/python/include/core.hpp | 10 ++++--- modules/python/test/test_basic.py | 8 +++--- 9 files changed, 81 insertions(+), 19 deletions(-) create mode 100644 modules/python/config/vision.json diff --git a/modules/python/config/core.json b/modules/python/config/core.json index e85a9f0a3b..41e8874b93 100644 --- a/modules/python/config/core.json +++ b/modules/python/config/core.json @@ -3,6 +3,7 @@ "ignored_classes": ["vpException", "vpImageException", "vpTrackingException", "vpFrameGrabberException", "vpIoException", "vpDisplayException", "vpMatrixException"], + "user_defined_headers": ["core.hpp"], "classes": { "vpArray2D": { "additional_bindings": "bindings_vpArray2D", diff --git a/modules/python/config/vision.json b/modules/python/config/vision.json new file mode 100644 index 0000000000..80aaea98bc --- /dev/null +++ b/modules/python/config/vision.json @@ -0,0 +1,25 @@ +{ + "ignored_headers": ["vpPoseException.h", "vpCalibrationException.h", "vpPoseFeatures.h"], + "classes": { + "vpHomography" : { + "methods": + [ + { + "static": true, + "signature": "void computeDisplacement(const vpHomography &, const vpColVector &, vpRotationMatrix &, vpTranslationVector &, vpColVector &)", + "custom_name": "computeHomographyDisplacement" + }, + { + "static": true, + "signature": "void computeDisplacement(const vpHomography &, vpRotationMatrix &, vpTranslationVector &, vpColVector &)", + "custom_name": "computeHomographyDisplacement" + }, + { + "static": true, + "signature": "void computeDisplacement(const vpHomography &, double , double , std::list &, std::list &, std::list &)", + "custom_name": "computeHomographyDisplacement" + } + ] + } + } +} \ No newline at end of file diff --git a/modules/python/config/visual_features.json b/modules/python/config/visual_features.json index 0e0dcd235c..f9917c803f 100644 --- a/modules/python/config/visual_features.json +++ b/modules/python/config/visual_features.json @@ -1,3 +1,3 @@ { - + "ignored_headers": ["vpFeatureException.h"] } \ No newline at end of file diff --git a/modules/python/config/vs.json b/modules/python/config/vs.json index a9c3a625e2..b32bccd656 100644 --- a/modules/python/config/vs.json +++ b/modules/python/config/vs.json @@ -1,3 +1,3 @@ { - "ignored_headers": [] + "ignored_headers": ["vpServoException.h"] } \ No newline at end of file diff --git a/modules/python/docs/index.rst b/modules/python/docs/index.rst index 1c8ac3ac1b..713e80f5a6 100644 --- a/modules/python/docs/index.rst +++ b/modules/python/docs/index.rst @@ -6,3 +6,11 @@ Contents: .. automodule:: visp.core :members: :undoc-members: + +.. automodule:: visp.vs + :members: + :undoc-members: + +.. automodule:: visp.vision + :members: + :undoc-members: diff --git a/modules/python/generator/header.py b/modules/python/generator/header.py index 0d1f4a50db..39a952db55 100644 --- a/modules/python/generator/header.py +++ b/modules/python/generator/header.py @@ -36,7 +36,7 @@ def add_level(result: List['HeaderFile'], remainder: List['HeaderFile'], depende return include_in_result_fn = None - if len(result) == 0: + if len(result) == 0: # First iteration, query all headers that have no dependencies include_in_result_fn = lambda h: len(h.depends) == 0 else: include_in_result_fn = lambda h: any(map(lambda x: x in dependencies, h.depends)) @@ -49,7 +49,11 @@ def add_level(result: List['HeaderFile'], remainder: List['HeaderFile'], depende result.append(header_file) else: new_remainder.append(header_file) - add_level(result, new_remainder, set(new_dependencies)) + if new_remainder == remainder: + print('Warning: Could not completely solve dependencies, generating but might have some errors') + result.extend(remainder) + else: + add_level(result, new_remainder, set(new_dependencies)) result = [] add_level(result, headers, set()) return result @@ -108,9 +112,9 @@ def run_preprocessor(self): # TODO: run without generating a new file '', '-D', 'vp_deprecated=', '-D', 'VISP_EXPORT=', - '-I', '/home/sfelton/software/visp_build/include', + '-I', '/home/sfelton/visp_build/include', '-I', '/usr/local/include', - #'-I', '/usr/include', + '-I', '/usr/include', '-N', 'VISP_BUILD_DEPRECATED_FUNCTIONS', '--passthru-includes', "^((?!vpConfig.h|!json.hpp).)*$", '--passthru-unfound-includes', @@ -276,6 +280,7 @@ def generate_class_with_potiental_specialization(name_python: str, owner_specs: for error_overload in error_generating_overloads: print(f'Overload {error_overload} defined for instance and class, this will generate a pybind error') if len(error_generating_overloads) > 0: + print(generated_methods) raise RuntimeError #spec_result += cls_result diff --git a/modules/python/generator/submodule.py b/modules/python/generator/submodule.py index 5aee6c112d..ff28c4c483 100644 --- a/modules/python/generator/submodule.py +++ b/modules/python/generator/submodule.py @@ -34,6 +34,7 @@ def generate(self) -> None: headers.append(header) # Sort by dependency level so that generation is in correct order headers = sort_headers(headers) + print([h.path for h in headers]) header_code = [] declarations = [] @@ -48,13 +49,14 @@ def generate(self) -> None: declarations = '\n'.join(declarations) includes_strs = [f'#include {include}' for include in includes_set] includes_str = '\n'.join(includes_strs) + user_defined_headers = '\n'.join(self.get_user_defined_headers()) format_str = f''' #include #include #include #include -#include "core.hpp" +{user_defined_headers} {includes_str} @@ -94,6 +96,12 @@ def header_should_be_ignored(self, header_name: str) -> bool: return False return header_name in self.config['ignored_headers'] + def get_user_defined_headers(self) -> List[str]: + if 'user_defined_headers' in self.config: + header_names = self.config['user_defined_headers'] + return [f'#include "{header_name}"' for header_name in header_names] + return [] + def get_class_config(self, class_name: str) -> Optional[Dict]: default_config = { 'methods': [], @@ -135,9 +143,18 @@ def get_method_config(self, class_name: Optional[str], method, owner_specs, head def get_submodules(include_path: Path, generate_path: Path) -> List[Submodule]: - return [ - Submodule('core', Path('/home/sfelton/software/visp-sfelton/modules/core/include/visp3/core'), generate_path / 'core.cpp'), - # Submodule('visual_features', include_path / 'visual_features', generate_path / 'visual_features.cpp'), - # Submodule('vs', include_path / 'vs', generate_path / 'vs.cpp') - - ] \ No newline at end of file + modules = ['core', 'vision', 'visual_features', 'vs'] + result = [] + for module in modules: + result.append(Submodule(module, Path(f'/home/sfelton/visp-sfelton/modules/{module}/include/visp3/{module}'), generate_path / f'{module}.cpp')) + return result + # return [ + # Submodule('core', Path('/home/sfelton/visp-sfelton/modules/core/include/visp3/core'), generate_path / 'core.cpp'), + # Submodule('vision', Path('/home/sfelton/visp-sfelton/modules/vision/include/visp3/vision'), generate_path / 'vision.cpp'), + # Submodule('core', Path('/home/sfelton/visp-sfelton/modules/core/include/visp3/core'), generate_path / 'visual_features.cpp'), + # Submodule('vision', Path('/home/sfelton/visp-sfelton/modules/vision/include/visp3/vision'), generate_path / 'vs.cpp'), + + # # Submodule('visual_features', include_path / 'visual_features', generate_path / 'visual_features.cpp'), + # # Submodule('vs', include_path / 'vs', generate_path / 'vs.cpp') + + # ] \ No newline at end of file diff --git a/modules/python/include/core.hpp b/modules/python/include/core.hpp index f7cdd50e47..963031399d 100644 --- a/modules/python/include/core.hpp +++ b/modules/python/include/core.hpp @@ -185,11 +185,15 @@ void define_get_item_2d_array(PyClass &pyClass, bool readonly) }); pyClass.def("__getitem__", [readonly](const Class &self, py::slice slice) { auto as_array = np_array_cf(make_array_buffer(self.data, { self.getRows(), self.getCols() }, readonly), py::cast(self)); - return as_array[slice].template cast>(); + auto view = as_array[slice].template cast>(); + return py::array_t(view.request(!readonly), py::cast(self)); }); pyClass.def("__getitem__", [readonly](const Class &self, py::tuple tuple) { auto as_array = np_array_cf(make_array_buffer(self.data, { self.getRows(), self.getCols() }, readonly), py::cast(self)); - return as_array[tuple].template cast>(); + // py::detail::generic_item acc = as_array[tuple]; + auto view = as_array[tuple].template cast>(); + return py::array_t(view.request(!readonly), py::cast(self)); + }); } @@ -267,7 +271,7 @@ void bindings_vpRotationMatrix(py::class_> & pyRotationMatrix.def_buffer(&get_buffer_info); pyRotationMatrix.def("numpy", [](vpRotationMatrix &self) -> np_array_cf { - return np_array_cf(get_buffer_info(self), py::cast(self)); + return np_array_cf(get_buffer_info(self), py::cast(self)); }, R"doc(Numpy view of the underlying array data. Cannot be written to.)doc"); pyRotationMatrix.def(py::init([](np_array_cf np_array) { verify_array_shape_and_dims(np_array, { 3, 3 }, "ViSP rotation matrix"); diff --git a/modules/python/test/test_basic.py b/modules/python/test/test_basic.py index 047953a290..0528e34437 100644 --- a/modules/python/test/test_basic.py +++ b/modules/python/test/test_basic.py @@ -36,12 +36,14 @@ def test_representations_not_writable(): R_np = np.array(R, copy=False) with pytest.raises(ValueError): R_np[0, 0] = 1 - # with pytest.raises(ValueError): - # R.numpy()[:1] = 0 + with pytest.raises(ValueError): + R.numpy()[:1] = 0 with pytest.raises(ValueError): row = R[0] row[0] = 1 - + with pytest.raises(ValueError): + sub = R[:2, :2] + sub[0, :] = 1 T = HomogeneousMatrix() T_np = np.array(T, copy=False) with pytest.raises(ValueError): From 16d2107e098b6bd73644849d8ab4c3c5053116a8 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Wed, 13 Sep 2023 13:18:12 +0200 Subject: [PATCH 033/169] compile with sensor module --- modules/python/config/sensor.json | 3 +++ modules/python/generator/header.py | 2 +- modules/python/generator/submodule.py | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 modules/python/config/sensor.json diff --git a/modules/python/config/sensor.json b/modules/python/config/sensor.json new file mode 100644 index 0000000000..a9c3a625e2 --- /dev/null +++ b/modules/python/config/sensor.json @@ -0,0 +1,3 @@ +{ + "ignored_headers": [] +} \ No newline at end of file diff --git a/modules/python/generator/header.py b/modules/python/generator/header.py index 39a952db55..a62bf0acc1 100644 --- a/modules/python/generator/header.py +++ b/modules/python/generator/header.py @@ -87,7 +87,7 @@ def build_mapping(self, data: Union[NamespaceScope, ClassScope], mapping={}, sco enum_name = '::'.join([seg.name for seg in enum.typename.segments if not isinstance(seg, types.AnonymousName)]) mapping[enum_name] = scope + enum_name for cls in data.classes: - cls_name = '::'.join([seg.name for seg in cls.class_decl.typename.segments]) + cls_name = '::'.join([seg.name for seg in cls.class_decl.typename.segments if not isinstance(seg, types.AnonymousName)]) mapping[cls_name] = scope + cls_name mapping.update(self.build_mapping(cls, mapping=mapping, scope=f'{scope}{cls_name}::')) diff --git a/modules/python/generator/submodule.py b/modules/python/generator/submodule.py index ff28c4c483..a98a737e86 100644 --- a/modules/python/generator/submodule.py +++ b/modules/python/generator/submodule.py @@ -143,7 +143,7 @@ def get_method_config(self, class_name: Optional[str], method, owner_specs, head def get_submodules(include_path: Path, generate_path: Path) -> List[Submodule]: - modules = ['core', 'vision', 'visual_features', 'vs'] + modules = ['core', 'vision', 'visual_features', 'vs', 'sensor'] result = [] for module in modules: result.append(Submodule(module, Path(f'/home/sfelton/visp-sfelton/modules/{module}/include/visp3/{module}'), generate_path / f'{module}.cpp')) From dcb1a4211342458731a712ddbaa06676e3f8196d Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Wed, 13 Sep 2023 15:29:59 +0200 Subject: [PATCH 034/169] Fixing argument parsing and rejection method, fix vpServoData --- modules/python/generator/header.py | 19 +++++--- modules/python/generator/methods.py | 58 ++++++++++++++++------- modules/python/generator/submodule.py | 5 +- modules/python/generator/utils.py | 44 ++++++++++++++++- modules/vs/include/visp3/vs/vpServoData.h | 1 - modules/vs/src/vpServoData.cpp | 9 +--- 6 files changed, 102 insertions(+), 34 deletions(-) diff --git a/modules/python/generator/header.py b/modules/python/generator/header.py index a62bf0acc1..d693c90db2 100644 --- a/modules/python/generator/header.py +++ b/modules/python/generator/header.py @@ -112,9 +112,9 @@ def run_preprocessor(self): # TODO: run without generating a new file '', '-D', 'vp_deprecated=', '-D', 'VISP_EXPORT=', - '-I', '/home/sfelton/visp_build/include', + '-I', '/home/sfelton/software/visp_build/include', '-I', '/usr/local/include', - '-I', '/usr/include', + #'-I', '/usr/include', '-N', 'VISP_BUILD_DEPRECATED_FUNCTIONS', '--passthru-includes', "^((?!vpConfig.h|!json.hpp).)*$", '--passthru-unfound-includes', @@ -185,9 +185,17 @@ def generate_class_with_potiental_specialization(name_python: str, owner_specs: # Find bindable methods generated_methods = [] method_strs = [] - bindable_methods_and_config, filtered_strs = get_bindable_methods_with_config(self.submodule, cls.methods, + bindable_methods_and_config, rejected_methods = get_bindable_methods_with_config(self.submodule, cls.methods, name_cpp_no_template, owner_specs, header_env.mapping) - print('\n'.join(filtered_strs)) + # Display rejected methods + rejection_strs = [] + for rejected_method in rejected_methods: + if NotGeneratedReason.is_non_trivial_reason(rejected_method.rejection_reason): + rejection_strs.append(f'\t{rejected_method.signature} was rejected! Reason: {rejected_method.rejection_reason}') + if len(rejection_strs) > 0: + print(f'Rejected method in class: {name_cpp}') + print('\n'.join(rejection_strs)) + # Split between constructors and other methods constructors, non_constructors = split_methods_with_config(bindable_methods_and_config, lambda m: m.constructor) @@ -256,7 +264,6 @@ def generate_class_with_potiental_specialization(name_python: str, owner_specs: # Add to string representation - print(name_python, cls_config) if not cls_config['ignore_repr']: to_string_str = find_and_define_repr_str(cls, name_cpp, python_ident) if len(to_string_str) > 0: @@ -287,8 +294,8 @@ def generate_class_with_potiental_specialization(name_python: str, owner_specs: spec_result += '\n'.join(method_strs) return spec_result - print(f'Parsing class "{cls.class_decl.typename}"') name_cpp_no_template = '::'.join([seg.name for seg in cls.class_decl.typename.segments]) + print(f'Parsing class "{name_cpp_no_template}"') if self.submodule.class_should_be_ignored(name_cpp_no_template): return '' diff --git a/modules/python/generator/methods.py b/modules/python/generator/methods.py index 455fc0fbf2..c12607f2d3 100644 --- a/modules/python/generator/methods.py +++ b/modules/python/generator/methods.py @@ -1,4 +1,4 @@ -from typing import Callable, List, Optional, Set, Tuple, Dict, Union +from typing import Any, Callable, List, Optional, Set, Tuple, Dict, Union from cxxheaderparser.parserstate import ClassBlockState, State import pcpp import cxxheaderparser @@ -9,6 +9,7 @@ import json from utils import * from dataclasses import dataclass +from enum import Enum def cpp_operator_list(): ''' @@ -103,16 +104,45 @@ def define_constructor(params: List[str], additional_args: List[str]) -> str: return f'def(py::init<{", ".join(params)}>(){additional_args_str})' -def get_bindable_methods_with_config(submodule: 'Submodule', methods: List[types.Method], cls_name: str, specializations, mapping) -> List[Tuple[types.Method, Dict]]: + +class NotGeneratedReason(Enum): + UserIgnored = 'user_ignored', + Access = 'access', + Destructor = 'destructor', + ReturnType = 'return_type' + ArgumentType = 'argument_type' + PureVirtual = 'pure_virtual' + UnspecifiedTemplateSpecialization = 'missing_template' + + @staticmethod + def is_non_trivial_reason(reason: 'NotGeneratedReason') -> bool: + return reason in [NotGeneratedReason.ArgumentType, + NotGeneratedReason.ReturnType, + NotGeneratedReason.UnspecifiedTemplateSpecialization] + +@dataclass +class RejectedMethod: + cls_name: Optional[str] + method: types.Method + method_config: Dict[str, Any] + signature: str + rejection_reason: NotGeneratedReason + + + + +def get_bindable_methods_with_config(submodule: 'Submodule', methods: List[types.Method], cls_name: str, specializations, mapping) -> Tuple[List[Tuple[types.Method, Dict]], List[RejectedMethod]]: bindable_methods = [] - rejection_strs = [] + rejected_methods = [] + # Order of predicates is important: The first predicate that matches will be the one shown in the log, and they do not all have the same importance filtering_predicates_and_motives = [ - (lambda m, _: m.pure_virtual, 'Method is pure virtual'), - (lambda m, _: m.access is None or m.access != 'public', 'Method visibility is not public'), - (lambda m, _: m.destructor, 'Method is destructor'), - (lambda m, conf: m.template is not None and conf.get('specializations') is None, 'Method is templated but no template is provided'), - (lambda m, _: any(get_type(param.type, specializations, mapping) is None for param in m.parameters), 'Method has an unsupported argument type'), - (lambda m, _: not m.constructor and get_type(m.return_type, specializations, mapping) is None, 'Method has an unsupported return type') + (lambda _, conf: conf['ignore'], NotGeneratedReason.UserIgnored), + (lambda m, _: m.pure_virtual, NotGeneratedReason.PureVirtual), + (lambda m, _: m.access is None or m.access != 'public', NotGeneratedReason.Access), + (lambda m, _: m.destructor, NotGeneratedReason.Destructor), + (lambda m, conf: m.template is not None and conf.get('specializations') is None, NotGeneratedReason.UnspecifiedTemplateSpecialization), + (lambda m, _: any(get_type(param.type, specializations, mapping) is None for param in m.parameters), NotGeneratedReason.ArgumentType), + (lambda m, _: not m.constructor and get_type(m.return_type, specializations, mapping) is None, NotGeneratedReason.ReturnType) ] for method in methods: method_config = submodule.get_method_config(cls_name, method, specializations, mapping) @@ -122,13 +152,13 @@ def get_bindable_methods_with_config(submodule: 'Submodule', methods: List[types return_str = '' if method.return_type is None else (get_type(method.return_type, specializations, mapping) or '') method_name = '::'.join(seg.name for seg in method.name.segments) param_strs = [get_type(param.type, specializations, mapping) or '' for param in method.parameters] - rejection_strs.append(f'{cls_name} {get_method_signature(method_name, return_str, param_strs)} was filtered! Reason: {motive}') + rejected_methods.append(RejectedMethod(cls_name, method, method_config, get_method_signature(method_name, return_str, param_strs), motive)) method_can_be_bound = False break if method_can_be_bound: bindable_methods.append((method, method_config)) - return bindable_methods, rejection_strs + return bindable_methods, rejected_methods @@ -141,9 +171,3 @@ def split_methods_with_config(methods: List[Tuple[types.Method, Dict]], predicat else: non_matching.append((method, method_config)) return matching, non_matching - - - - -def get_operators(methods: List[types.Method]) -> Tuple[List[types.Method], Tuple[List[types.Method]]]: - pass diff --git a/modules/python/generator/submodule.py b/modules/python/generator/submodule.py index a98a737e86..a168eaf522 100644 --- a/modules/python/generator/submodule.py +++ b/modules/python/generator/submodule.py @@ -134,7 +134,8 @@ def get_method_config(self, class_name: Optional[str], method, owner_specs, head # print(functions_container) for function_config in functions_container: if method_matches_config(method, function_config, owner_specs, header_mapping): - return function_config + res.update(function_config) + return res #import sys; sys.exit() return res @@ -146,7 +147,7 @@ def get_submodules(include_path: Path, generate_path: Path) -> List[Submodule]: modules = ['core', 'vision', 'visual_features', 'vs', 'sensor'] result = [] for module in modules: - result.append(Submodule(module, Path(f'/home/sfelton/visp-sfelton/modules/{module}/include/visp3/{module}'), generate_path / f'{module}.cpp')) + result.append(Submodule(module, Path(f'/home/sfelton/software/visp-sfelton/modules/{module}/include/visp3/{module}'), generate_path / f'{module}.cpp')) return result # return [ # Submodule('core', Path('/home/sfelton/visp-sfelton/modules/core/include/visp3/core'), generate_path / 'core.cpp'), diff --git a/modules/python/generator/utils.py b/modules/python/generator/utils.py index 56a392fe3f..269a93f819 100644 --- a/modules/python/generator/utils.py +++ b/modules/python/generator/utils.py @@ -12,7 +12,7 @@ def get_name(name: types.PQName) -> str: def get_typename(typename: types.PQName, owner_specs, header_env_mapping) -> str: '''Resolve the string representation of a raw type, resolving template specializations and using complete typenames - (aliases, shortened name when in same namescope). + (aliases, shortened names when in same namescope). ''' def segment_repr(segment: types.PQNameSegment) -> str: spec_str = '' @@ -57,6 +57,48 @@ def get_type(param: Union[types.FunctionType, types.DecoratedType, types.Value], else: return None +def is_pointer_to_const_cstr(param: types.Pointer) -> bool: + ptr_to = param.ptr_to + if isinstance(ptr_to, types.Type): + if get_typename(ptr_to, {}, {}) == 'char' and ptr_to.const: + return True + + return False + +def is_unsupported_return_type(param: Union[types.FunctionType, types.DecoratedType]) -> bool: + ''' + Return whether the passed param is supported as a return type for automatic code generation. + Pointers, arrays, functions are not supported. + ''' + if isinstance(param, types.FunctionType): + return True + if isinstance(param, types.Array): + return True + if isinstance(param, types.Type): + return False + if isinstance(param, types.Reference): + return False + if isinstance(param, types.Pointer): + return not is_pointer_to_const_cstr(param) + +def is_unsupported_argument_type(param: Union[types.FunctionType, types.DecoratedType]) -> bool: + ''' + Return whether the passed param is supported for automatic code generation. + Pointers, arrays, functions are not supported. + ''' + if isinstance(param, types.FunctionType): + return True + if isinstance(param, types.Array): + return True + if isinstance(param, types.Type): + return False + if isinstance(param, types.Reference): + return False + if isinstance(param, types.Pointer): + return not is_pointer_to_const_cstr(param) + + + def get_method_signature(name: str, return_type: str, params: List[str]) -> str: return f'{return_type} {name}({", ".join(params)})' diff --git a/modules/vs/include/visp3/vs/vpServoData.h b/modules/vs/include/visp3/vs/vpServoData.h index adb27431d1..d6d4fd03b2 100644 --- a/modules/vs/include/visp3/vs/vpServoData.h +++ b/modules/vs/include/visp3/vs/vpServoData.h @@ -94,7 +94,6 @@ class VISP_EXPORT vpServoData void close(); void empty(); - void push(); void display(vpImage &I); }; diff --git a/modules/vs/src/vpServoData.cpp b/modules/vs/src/vpServoData.cpp index 313f22cff6..8d67f81a4f 100644 --- a/modules/vs/src/vpServoData.cpp +++ b/modules/vs/src/vpServoData.cpp @@ -64,7 +64,8 @@ void vpServoData::open(const std::string &directory) s = directory + "/sStar.dat"; sStarFile.open(s.c_str()); - } catch (...) { + } + catch (...) { vpERROR_TRACE("Error caught"); throw; } @@ -99,9 +100,3 @@ void vpServoData::close() sFile.close(); sStarFile.close(); } - -/* - * Local variables: - * c-basic-offset: 2 - * End: - */ From 8d5bc640e52e20a7f51cce409c72e42847867476 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Wed, 13 Sep 2023 16:57:14 +0200 Subject: [PATCH 035/169] fix more undefined symbols --- modules/python/config/sensor.json | 2 +- modules/python/generator/header.py | 1 - .../include/visp3/visual_features/vpFeatureEllipse.h | 5 ++--- .../include/visp3/visual_features/vpFeatureLuminance.h | 2 -- .../include/visp3/visual_features/vpFeaturePoint.h | 7 +++---- .../include/visp3/visual_features/vpFeaturePointPolar.h | 5 ----- .../src/visual-feature/vpFeatureEllipse.cpp | 5 ++++- modules/vs/include/visp3/vs/vpServoData.h | 2 -- 8 files changed, 10 insertions(+), 19 deletions(-) diff --git a/modules/python/config/sensor.json b/modules/python/config/sensor.json index a9c3a625e2..50632d6ccd 100644 --- a/modules/python/config/sensor.json +++ b/modules/python/config/sensor.json @@ -1,3 +1,3 @@ { - "ignored_headers": [] + "ignored_headers": ["vpRealSense2.h"] } \ No newline at end of file diff --git a/modules/python/generator/header.py b/modules/python/generator/header.py index d693c90db2..c9b9fe2660 100644 --- a/modules/python/generator/header.py +++ b/modules/python/generator/header.py @@ -68,7 +68,6 @@ def build_mapping(self, data: Union[NamespaceScope, ClassScope], mapping={}, sco for alias in data.using_alias: mapping[alias.alias] = get_type(alias.type, {}, mapping) for enum in data.enums: - print(enum) enum_name = '::'.join([seg.name for seg in enum.base.segments]) mapping[enum_name] = scope + enum_name for cls in data.classes: diff --git a/modules/visual_features/include/visp3/visual_features/vpFeatureEllipse.h b/modules/visual_features/include/visp3/visual_features/vpFeatureEllipse.h index 526791d19c..a6c0381932 100644 --- a/modules/visual_features/include/visp3/visual_features/vpFeatureEllipse.h +++ b/modules/visual_features/include/visp3/visual_features/vpFeatureEllipse.h @@ -67,7 +67,7 @@ class VISP_EXPORT vpFeatureEllipse : public vpBasicFeature //! Default constructor. vpFeatureEllipse(); //! Destructor. - virtual ~vpFeatureEllipse() {} + virtual ~vpFeatureEllipse() { } /*! \section Set coordinates @@ -89,8 +89,7 @@ class VISP_EXPORT vpFeatureEllipse : public vpBasicFeature //! compute the error between two visual features from a subset //! a the possible features vpColVector error(const vpBasicFeature &s_star, unsigned int select = FEATURE_ALL); - //! compute the error between a visual features and zero - vpColVector error(unsigned int select = FEATURE_ALL); + /*! * Returns the visual feature corresponding to the ellipse centroid coordinate along camera x-axis. diff --git a/modules/visual_features/include/visp3/visual_features/vpFeatureLuminance.h b/modules/visual_features/include/visp3/visual_features/vpFeatureLuminance.h index 8227d84b3f..0067c88104 100644 --- a/modules/visual_features/include/visp3/visual_features/vpFeatureLuminance.h +++ b/modules/visual_features/include/visp3/visual_features/vpFeatureLuminance.h @@ -108,8 +108,6 @@ class VISP_EXPORT vpFeatureLuminance : public vpBasicFeature vpColVector error(const vpBasicFeature &s_star, unsigned int select = FEATURE_ALL); void error(const vpBasicFeature &s_star, vpColVector &e); - //! Compute the error between a visual features and zero - vpColVector error(unsigned int select = FEATURE_ALL); double get_Z() const; diff --git a/modules/visual_features/include/visp3/visual_features/vpFeaturePoint.h b/modules/visual_features/include/visp3/visual_features/vpFeaturePoint.h index a394d35946..6d55e9faff 100644 --- a/modules/visual_features/include/visp3/visual_features/vpFeaturePoint.h +++ b/modules/visual_features/include/visp3/visual_features/vpFeaturePoint.h @@ -185,7 +185,7 @@ class VISP_EXPORT vpFeaturePoint : public vpBasicFeature public: vpFeaturePoint(); //! Destructor. - virtual ~vpFeaturePoint() {} + virtual ~vpFeaturePoint() { } void buildFrom(double x, double y, double Z); @@ -197,8 +197,6 @@ class VISP_EXPORT vpFeaturePoint : public vpBasicFeature vpFeaturePoint *duplicate() const; vpColVector error(const vpBasicFeature &s_star, unsigned int select = FEATURE_ALL); - //! Compute the error between a visual features and zero - vpColVector error(unsigned int select = FEATURE_ALL); double get_x() const; @@ -226,7 +224,8 @@ class VISP_EXPORT vpFeaturePoint : public vpBasicFeature /*! @name Deprecated functions */ - typedef enum { + typedef enum + { X = 1, // x coordinates Y = 2 // y coordinates } vpFeaturePointType; diff --git a/modules/visual_features/include/visp3/visual_features/vpFeaturePointPolar.h b/modules/visual_features/include/visp3/visual_features/vpFeaturePointPolar.h index 4ff9923431..b0c24894a7 100644 --- a/modules/visual_features/include/visp3/visual_features/vpFeaturePointPolar.h +++ b/modules/visual_features/include/visp3/visual_features/vpFeaturePointPolar.h @@ -310,11 +310,6 @@ class VISP_EXPORT vpFeaturePointPolar : public vpBasicFeature static unsigned int selectRho(); static unsigned int selectTheta(); - /*! - @name Deprecated functions - */ - //! compute the error between a visual features and zero - vpColVector error(unsigned int select = FEATURE_ALL); }; #endif diff --git a/modules/visual_features/src/visual-feature/vpFeatureEllipse.cpp b/modules/visual_features/src/visual-feature/vpFeatureEllipse.cpp index deae05cae2..fe758ff51b 100644 --- a/modules/visual_features/src/visual-feature/vpFeatureEllipse.cpp +++ b/modules/visual_features/src/visual-feature/vpFeatureEllipse.cpp @@ -79,6 +79,8 @@ void vpFeatureEllipse::init() } vpFeatureEllipse::vpFeatureEllipse() : A(0), B(0), C(0) { init(); } +vpFeatureEllipse::vpFeatureEllipse(double x, double y, double n20, double n11, double n02) { this->buildFrom(x, y, n20, n11, n02); } + //! compute the interaction matrix from a subset a the possible features vpMatrix vpFeatureEllipse::interaction(unsigned int select) @@ -250,7 +252,8 @@ vpColVector vpFeatureEllipse::error(const vpBasicFeature &s_star, unsigned int s e = vpColVector::stack(e, ey); } - } catch (...) { + } + catch (...) { throw; } diff --git a/modules/vs/include/visp3/vs/vpServoData.h b/modules/vs/include/visp3/vs/vpServoData.h index d6d4fd03b2..9d3ea63b95 100644 --- a/modules/vs/include/visp3/vs/vpServoData.h +++ b/modules/vs/include/visp3/vs/vpServoData.h @@ -93,8 +93,6 @@ class VISP_EXPORT vpServoData void open(const std::string &directory); void close(); - void empty(); - void display(vpImage &I); }; #endif From ef753c4280c7334bdaee9419b3c5513ff0cea912 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Thu, 14 Sep 2023 02:11:02 +0200 Subject: [PATCH 036/169] reproducing tps, function template specialization --- .../include/visp3/core/vpCannyEdgeDetection.h | 4 +- modules/python/config/core.json | 45 +++++ modules/python/config/io.json | 3 + modules/python/examples/repro_tp1.py | 134 ++++++++++++++ modules/python/examples/repro_tp2.py | 103 +++++++++++ modules/python/examples/repro_tp3.py | 164 ++++++++++++++++++ modules/python/generator/header.py | 34 ++-- modules/python/generator/methods.py | 2 +- modules/python/generator/submodule.py | 4 +- 9 files changed, 478 insertions(+), 15 deletions(-) create mode 100644 modules/python/config/io.json create mode 100644 modules/python/examples/repro_tp1.py create mode 100644 modules/python/examples/repro_tp2.py create mode 100644 modules/python/examples/repro_tp3.py diff --git a/modules/core/include/visp3/core/vpCannyEdgeDetection.h b/modules/core/include/visp3/core/vpCannyEdgeDetection.h index f2788b45db..8676c86fec 100644 --- a/modules/core/include/visp3/core/vpCannyEdgeDetection.h +++ b/modules/core/include/visp3/core/vpCannyEdgeDetection.h @@ -184,7 +184,7 @@ class VISP_EXPORT vpCannyEdgeDetection * \param j : The JSON object, resulting from the parsing of a JSON file. * \param detector : The detector that will be initialized from the JSON data. */ - inline friend void from_json(const json &j, vpCannyEdgeDetection &detector) + friend inline void from_json(const json &j, vpCannyEdgeDetection &detector) { detector.m_gaussianKernelSize = j.value("gaussianSize", detector.m_gaussianKernelSize); detector.m_gaussianStdev = j.value("gaussianStdev", detector.m_gaussianStdev); @@ -198,7 +198,7 @@ class VISP_EXPORT vpCannyEdgeDetection * \param j : A JSON parser object. * \param detector : The vpCannyEdgeDetection object that must be parsed into JSON format. */ - inline friend void to_json(json &j, const vpCannyEdgeDetection &detector) + friend inline void to_json(json &j, const vpCannyEdgeDetection &detector) { j = json { {"gaussianSize", detector.m_gaussianKernelSize}, diff --git a/modules/python/config/core.json b/modules/python/config/core.json index 41e8874b93..50c2613db5 100644 --- a/modules/python/config/core.json +++ b/modules/python/config/core.json @@ -216,6 +216,21 @@ } ] }, + "vpImageTools": { + "methods": + [ + { + "static": true, + "signature": "void warpImage(const vpImage&, const vpMatrix&, vpImage&, const vpImageTools::vpImageInterpolationType&, bool, bool)", + "specializations": + [ + ["unsigned char"], + ["vpRGBa"] + ] + } + ] + }, + "vpDisplay": { "methods": [ @@ -228,6 +243,36 @@ "static": true, "signature": "unsigned int getDownScalingFactor(const vpImage &)", "custom_name": "getImageDownScalingFactor" + }, + { + "static": true, + "signature": "void displayCircle(const vpImage &, const vpImageCircle &, const vpColor &, bool, unsigned int)", + "custom_name": "displayCircleStatic" + }, + { + "static": true, + "signature": "void displayCircle(const vpImage &, const vpImagePoint &, unsigned int, const vpColor &, bool, unsigned int)", + "custom_name": "displayCircleStatic" + }, + { + "static": true, + "signature": "void displayCircle(const vpImage &, int, int, unsigned int, const vpColor &, bool, unsigned int)", + "custom_name": "displayCircleStatic" + }, + { + "static": true, + "signature": "void displayCircle(const vpImage &, const vpImageCircle &, const vpColor &, bool, unsigned int)", + "custom_name": "displayCircleStatic" + }, + { + "static": true, + "signature": "void displayCircle(const vpImage &, const vpImagePoint &, unsigned int, const vpColor &, bool, unsigned int)", + "custom_name": "displayCircleStatic" + }, + { + "static": true, + "signature": "void displayCircle(const vpImage &, int, int, unsigned int, const vpColor &, bool, unsigned int)", + "custom_name": "displayCircleStatic" } ] } diff --git a/modules/python/config/io.json b/modules/python/config/io.json new file mode 100644 index 0000000000..e7576a7e17 --- /dev/null +++ b/modules/python/config/io.json @@ -0,0 +1,3 @@ +{ + "ignored_headers": ["vpParallelPortException.h"] +} \ No newline at end of file diff --git a/modules/python/examples/repro_tp1.py b/modules/python/examples/repro_tp1.py new file mode 100644 index 0000000000..03857a559a --- /dev/null +++ b/modules/python/examples/repro_tp1.py @@ -0,0 +1,134 @@ +# Copyright 2023 Eric Marchand, Eric.Marchand@irisa.fr +# Fabien Spindler, Fabien.Spindler@inria.fr +# Samuel Felton, Samuel.Felton@inria.fr + +import argparse +import numpy as np + +from matplotlib import pyplot as plt +from matplotlib import image +from pathlib import Path + +from visp.core import CameraParameters, HomogeneousMatrix, TranslationVector, ThetaUVector, ImagePoint +from visp.core import ImageGray +from visp.io import ImageIo + +if __name__ == '__main__': + parser = argparse.ArgumentParser(description='The script corresponding to TP 1.') + parser.add_argument('--use-case', type=int, default=1, dest='use_case', help='Use case value 1, 2 or 3') + parser.add_argument('--data', type=str, required=True, help='Path to data') + + + + args, unknown_args = parser.parse_known_args() + if unknown_args: + print("The following args are not recognized and will not be used: %s" % unknown_args) + + data_path = Path(args.data) + assert data_path.exists() + print("Use case %s" % args.use_case) + assert 0 < args.use_case < 4, 'use case should be between 1 and 3' + + # Position of the reference in the camera 2 frame + translation = TranslationVector(0, 0, 2) + thetau = ThetaUVector(0, 0, 0) + c2Tw = HomogeneousMatrix(translation, thetau) + print(f'c2Tw = \n{c2Tw}') + + print('-----------------') + c1_cases = [ + HomogeneousMatrix(TranslationVector(-0.1, 0, 2), ThetaUVector(0, 0, 0)), + HomogeneousMatrix(TranslationVector(0, 0, 1.8), ThetaUVector(0, 0, 0)), + HomogeneousMatrix(TranslationVector(0.1, 0, 1.9), ThetaUVector(*[np.radians(5) for _ in range(3)])) + ] + c1Tw = c1_cases[args.use_case - 1] + # Position of the reference in the camera 1 frame + print(f'c1Tw = \n{c1Tw}') + + print('-----------------') + cam = CameraParameters(800, 800, 200, 150) + K = cam.get_K() + + + print(f"cam = \n{cam}\nK =\n {K}") + print('-----------------') + x2 = np.array([ + [273, 166, 1], + [112, 84, 1], + [ 90, 196, 1], + [321, 123, 1], + [206, 7, 1] + ]) + plt.figure() + plt.ion() + + #image1 = image.imread(f"data/I1{args.use_case}.png") + image1, image2 = ImageGray(), ImageGray() + ImageIo.read(image1, str(data_path / f'tp1-I1{args.use_case}.png'), ImageIo.ImageIoBackendType.IO_DEFAULT_BACKEND) + ImageIo.read(image2, str(data_path / f'tp1-I2.png'), ImageIo.ImageIoBackendType.IO_DEFAULT_BACKEND) + + + plt1 = plt.subplot(2,1,1) + plt2 = plt.subplot(2,1,2) + + color = ['r','y','b','g','c','m','y','k'] + + # Get image size + img_rows = image1.getHeight() + img_cols = image1.getWidth() + print(f"Image size: {img_rows} x {img_cols}") + + # BEGIN TO COMPLETE + # Calculate the geometric location of a point x1 as a function of x2 + wTc2 = c2Tw.inverse() + c1Tc2: HomogeneousMatrix = c1Tw * wTc2 + print(f'c1Tc2 = \n {c1Tc2}') + + # Option 1: acces numpy + # c1tc2 = c1Tc2[:3,3:] + # c1Rc2 = c1Tc2[:3,:3] + + c1tc2 = c1Tc2.getTranslationVector() + c1Rc2 = c1Tc2.getRotationMatrix() + + Kinv = cam.get_K_inverse() + + A = c1tc2.skew() * c1Rc2 * Kinv + print("A=", A) + print("Kinv=", Kinv) + + Kinvtranspose = Kinv.transpose() + print("Kinv.t=", Kinvtranspose) + + # Compute fundamental matrix F + # On peut passer une matrice a une fonction numpy + F = np.matmul(Kinvtranspose, A) + print("F=", F) + # END TO COMPLETE + + for i in range(len(x2)): + plt2.plot(x2[i][0], x2[i][1], color[i]+'o') + + # BEGIN TO COMPLETE + # Calculate the geometric location of a point x1 as a function of x2 + De1 = np.matmul(F, x2[i]) + # END TO COMPLETE + + print(De1) + + # BEGIN TO COMPLETE + # Draw geometric location in image 1 + x = np.array([0, img_cols]) + y = np.array([-De1[2]/De1[1],(-De1[2]-img_cols*De1[0])/De1[1]]) + + print('x = ',x) + print('y = ',y) + + plt1.plot(x, y, color=color[i], linewidth=1) + # END TO COMPLETE + + plt1.imshow(image1, cmap='gray') + plt2.imshow(image2, cmap='gray') + + plt.waitforbuttonpress() + plt.show() diff --git a/modules/python/examples/repro_tp2.py b/modules/python/examples/repro_tp2.py new file mode 100644 index 0000000000..b8f4875933 --- /dev/null +++ b/modules/python/examples/repro_tp2.py @@ -0,0 +1,103 @@ +# Copyright 2023 Eric Marchand, Eric.Marchand@irisa.fr +# Fabien Spindler, Fabien.Spindler@inria.fr +# Samuel Felton, Samuel.Felton@inria.fr + +import argparse +import numpy as np + +from matplotlib import pyplot as plt +from matplotlib import image +from pathlib import Path + +from visp.core import CameraParameters, HomogeneousMatrix, TranslationVector, ThetaUVector, ImagePoint, Matrix +from visp.core import ImageGray, ImageTools +from visp.vision import Homography +from visp.io import ImageIo +if __name__ == '__main__': + parser = argparse.ArgumentParser(description='The script corresponding to TP 2.') + parser.add_argument('--data', type=str, required=True, help='Path to data') + args = parser.parse_args() + data_path = Path(args.data) + assert data_path.exists() + image1, image2 = ImageGray(), ImageGray() + ImageIo.read(image1, str(data_path / 'tp2-I1.jpg'), ImageIo.ImageIoBackendType.IO_DEFAULT_BACKEND) + ImageIo.read(image2, str(data_path / 'tp2-I2.jpg'), ImageIo.ImageIoBackendType.IO_DEFAULT_BACKEND) + + # Pretty print of numpy arrays + np.set_printoptions(precision=7, suppress=True) + + plt.figure(figsize=(15,15)) + plt.ion() + + plt1 = plt.subplot(2,2,1) + plt2 = plt.subplot(2,2,2) + plt3 = plt.subplot(2,2,4) + + plt1.imshow(image1, cmap='gray') + plt2.imshow(image2, cmap='gray') + + # Coordinates of the 5 points in image 1 + u1 = np.array([ 135.0517282, 464.3374805, 432.1843943, 49.75437317, 298.9792208]) + v1 = np.array([44.30715709, 185.9258178, 422.7760738, 339.1144011, 236.5545455]) + + # Coordinates of the 5 points in image 2 + u2 = np.array([ 122.9683498, 453.4691964, 521.5894161, 199.0225322, 336.3672109]) + v2 = np.array([ 126.6271928, 61.28444847, 278.4105839, 388.944206, 198.3472826 ]) + + color = ['r','y','b','g','c','m','y','k'] + + for i in range(len(u1)): + plt1.plot(u1[i], v1[i],color[i]+'o') + plt2.plot(u2[i], v2[i],color[i]+'o') + + plt1.text(u1[i]+10, v1[i]-10, i, color=color[i]) + plt2.text(u2[i]+10, v2[i]-10, i, color=color[i]) + + # Compute matrix c2Hc1 such as x2 = c2Hc1 * x1 + c2Hc1 = Homography() + Homography.DLT(u1, v1, u2, v2, c2Hc1, False) + + print("c2Hc1= \n", c2Hc1) + + residual = 0 + for i in range(len(u1)): + print('point ', i) + x1 = np.array([u1[i], v1[i], 1]) + # BEGIN TO COMPLETE + x2 = np.matmul(c2Hc1, x1) + x2 = x2/x2[2] + print("x2 = ", x2) + # END TO COMPLETE + + # BEGIN TO COMPLETE + error = np.linalg.norm(np.array([u2[i], v2[i], 1]) - x2) + print("Error for point ", i, ":", error) + # END TO COMPLETE + + residual += error*error + + plt2.plot(u2[i], v2[i],color[i+1]+'+') + plt2.add_artist(plt.Circle((u2[i], v2[i]), error*100, fill=False, color=color[i+1])) + + residual = np.sqrt(residual / len(u1)) + print("Mean residual: ", residual) + + h, w = image1.getRows(), image1.getCols() + + + hbl = (int)(1.5*h) + wbl = (int)(1.5*w) + blendedImage = ImageGray(height=hbl, width=wbl, value=0) + + ImageTools.warpImage(image1, Matrix(c2Hc1), blendedImage, ImageTools.ImageInterpolationType.INTERPOLATION_LINEAR, False, True) + + plt3.imshow(blendedImage, cmap='gray') + + plt.waitforbuttonpress() + plt.show() + + # Final homography matrix H21 should be + # c2Hc1= + # [[-0.0040643 -0.0031677 -0.0435478] + # [ 0.0034882 -0.0051718 -0.9989996] + # [ 0.000002 -0.0000017 -0.0061552]] diff --git a/modules/python/examples/repro_tp3.py b/modules/python/examples/repro_tp3.py new file mode 100644 index 0000000000..0401e55902 --- /dev/null +++ b/modules/python/examples/repro_tp3.py @@ -0,0 +1,164 @@ +# Copyright 2023 Eric Marchand, Eric.Marchand@irisa.fr +# Fabien Spindler, Fabien.Spindler@inria.fr +# Samuel Felton, Samuel.Felton@inria.fr + +import argparse +import numpy as np + +from matplotlib import pyplot as plt +from matplotlib import image +from pathlib import Path + +from visp.core import CameraParameters, HomogeneousMatrix, TranslationVector, ThetaUVector, ImagePoint, Matrix +from visp.core import ImageGray, ImageTools +from visp.vision import Homography +from visp.io import ImageIo + +if __name__ == '__main__': + parser = argparse.ArgumentParser(description='The script corresponding to TP 2.') + parser.add_argument('--data', type=str, required=True, help='Path to data') + args = parser.parse_args() + data_path = Path(args.data) + assert data_path.exists() + image1, image2 = ImageGray(), ImageGray() + ImageIo.read(image1, str(data_path / 'tp3-I1.jpg'), ImageIo.ImageIoBackendType.IO_DEFAULT_BACKEND) + ImageIo.read(image2, str(data_path / 'tp3-I2.jpg'), ImageIo.ImageIoBackendType.IO_DEFAULT_BACKEND) + # Pretty print of numpy arrays + np.set_printoptions(precision=7, suppress=True) + + plt.figure(figsize=(15,15)) + plt.ion() + + plt1 = plt.subplot(2, 2, 1) # Image 1 + plt2 = plt.subplot(2, 2, 2) # Image 2 + plt3 = plt.subplot(212) # Image 1 besides Image 2 + + plt1.imshow(image1, cmap='gray') + plt2.imshow(image2, cmap='gray') + + imageAppariement = np.hstack((image1, image2)) + plt3.imshow(imageAppariement, interpolation='bilinear', cmap='gray') + + # Matrix of coordinates of the points in image + # (u1,v1) are in image1 and (u2,v2) in image2 + point = np.array( + [ # u1, v1, u2, v2 + [117.5130997, 62.34123611, 202.841095, 36.29648209], + [84.06044006, 67.55551147, 169.5350189, 26.80556679], + [80.27194214, 111.0672302, 147.9641113, 64.5475769], + [342.6855164, 199.8661346, 63.4621048, 68.28819275], + [302.6676636, 226.6687317, 300.4017639, 263.6835022], + [101.5870972, 63.0242424, 187.8421478, 29.56011963], + [153.4119415, 91.05652618, 222.968277, 77.2434845], + [190.6780548, 110.7231598, 247.8312683, 110.4263763], + [302.8087463, 133.9337616, 339.9194641, 178.880661], + [162.7279968, 276.4970398, 152.7050171, 248.9367065], + [151.0850067, 36.12360764, 244.672287, 25.44586563], + [171.7740173, 53.67162704, 256.0083618, 49.99362183], + [116.7895355, 74.19098663, 196.8202972, 45.97808456], + [104.2023163, 83.85998535, 181.4200439, 50.26084518], + [84.71365356, 190.8507233, 300.4017639, 263.6835022], + [138.8526764, 273.5761719, 131.6974182, 236.8515778], + [167.2081451, 96.59983063, 233.1238556, 88.96112061], + ] + ) + + # Plot corresponding points + u1 = point[:,0] + v1 = point[:,1] + u2 = point[:,2] + v2 = point[:,3] + + # Get image size + img_rows = image1.getHeight() + img_cols = image1.getWidth() + print("Image size:", img_cols, "x", img_rows) + + # Total number of points + nbPoints = len(u1) + + # BEGIN TO COMPLETE + # Plot lines between matches + for i in range(nbPoints): + plt1.plot(u1[i], v1[i],'r+') + plt2.plot(u2[i], v2[i],'r+') + x = np.array([u1[i], u2[i] + img_cols]) + y = np.array([v1[i], v2[i]]) + plt3.plot(x, y, linewidth=1) + + plt1.text(u1[i]+3, v1[i]-3, i, color='red') + plt2.text(u2[i]+3, v2[i]-3, i, color='red') + plt3.text(u1[i]+3, v1[i]-3, i, color='red') + plt3.text(u2[i]+img_cols-3, v2[i]-3, i, color='red') + # END TO COMPLETE + + # Compute homography c2Hc1 such as x2 = c2Hc1 * x1 without RANSAC + c2Hc1 = Homography() + Homography.DLT(u1, v1, u2, v2, c2Hc1, False) + + print("c2Hc1= \n", c2Hc1) + + for i in range(nbPoints): + # BEGIN TO COMPLETE + # Compute the position of (u2',v2') function of (u1,v1) + print('point',i) + x1 = np.array([u1[i], v1[i], 1]) + x2 = np.matmul(c2Hc1,x1) + x2 = x2/x2[2] + print("x2 = ", x2) + + # Compute the error between (u2',v2') and (u2,v2) + error = np.linalg.norm(np.array([u2[i], v2[i], 1]) - x2) + print("error = ", error) + # END TO COMPLETE + + plt2.plot(u2[i], v2[i],'+') + plt2.add_artist(plt.Circle((u2[i], v2[i]), error, fill=False, color='g')) + + # Wait for a mouse click in the image + print("Use a mouse click to continue..") + plt.waitforbuttonpress() + + # Erase image 2 and circle drawings + plt2.cla() + plt2.imshow(image2, cmap='gray') + + # Threshold to detect outliers + seuilOutlier = 10 + + indexInliers = np.zeros(nbPoints) + inliers = [False for _ in range(len(u1))] + residual = 0.0 # TODO: this should be returned + assert Homography.ransac(u1, v1, u2, v2, c2Hc1, inliers, residual, 12, seuilOutlier, False) + print(inliers) # TODO: inliers isn't modified by the call to ransac + # Compute the homography with all inliers + u1r = u1[inliers] + v1r = v1[inliers] + u2r = u2[inliers] + v2r = v2[inliers] + + print('Inliers = ', u1r, v1r, u2r, v2r) + + + # Compute the error for all the points + for j in range(nbPoints): + # BEGIN TO COMPLETE + # Compute the position of (u2',v2') function of (u1,v1) + x1 = np.array([u1[j], v1[j], 1]) + x2 = np.matmul(c2Hc1,x1) + x2 = x2/x2[2] + + # Compute the error between (u2',v2') and (u2,v2) + error = np.linalg.norm(np.array([u2[j], v2[j], 1]) - x2) + print("error[",j,"] = ", error) + # END TO COMPLETE + + if error < seuilOutlier: + plt2.plot(x2[0], x2[1],'g+') + plt2.add_artist(plt.Circle((x2[0], x2[1]), error*10, fill=False, color='g')) + else: + plt2.plot(x2[0], x2[1],'r+') + plt2.add_artist(plt.Circle((x2[0], x2[1]), error, fill=False, color='r')) + + plt.waitforbuttonpress() + plt.show() diff --git a/modules/python/generator/header.py b/modules/python/generator/header.py index c9b9fe2660..e6cb32f49b 100644 --- a/modules/python/generator/header.py +++ b/modules/python/generator/header.py @@ -111,9 +111,9 @@ def run_preprocessor(self): # TODO: run without generating a new file '', '-D', 'vp_deprecated=', '-D', 'VISP_EXPORT=', - '-I', '/home/sfelton/software/visp_build/include', + '-I', '/home/sfelton/visp_build/include', '-I', '/usr/local/include', - #'-I', '/usr/include', + '-I', '/usr/include', '-N', 'VISP_BUILD_DEPRECATED_FUNCTIONS', '--passthru-includes', "^((?!vpConfig.h|!json.hpp).)*$", '--passthru-unfound-includes', @@ -243,24 +243,33 @@ def generate_class_with_potiental_specialization(name_python: str, owner_specs: break - - - # Define classical methods - for method, method_config in basic_methods: - - params_strs = [get_type(param.type, owner_specs, header_env.mapping) for param in method.parameters] + def define_classical_method(method, method_config, specs): + params_strs = [get_type(param.type, specs, header_env.mapping) for param in method.parameters] py_arg_strs = [f'py::arg("{param.name}")' for param in method.parameters] method_name = get_name(method.name) py_method_name = method_config.get('custom_name') or method_name - return_type = get_type(method.return_type, owner_specs, header_env.mapping) + return_type = get_type(method.return_type, specs, header_env.mapping) method_ref_str = ref_to_class_method(method, name_cpp, method_name, return_type, params_strs) method_str = define_method(py_method_name, method_ref_str, py_arg_strs, method.static) method_str = f'{python_ident}.{method_str};' method_strs.append(method_str) generated_methods.append((py_method_name, method)) + # Define classical methods + for method, method_config in basic_methods: + if method.template is not None and method_config.get('specializations') is not None: + method_template_names = [t.name for t in method.template.params] + specializations = method_config.get('specializations') + for method_spec in specializations: + new_specs = owner_specs.copy() + assert len(method_template_names) == len(method_spec) + method_spec_dict = OrderedDict(k for k in zip(method_template_names, method_spec)) + new_specs.update(method_spec_dict) + define_classical_method(method, method_config, new_specs) + else: + define_classical_method(method, method_config, owner_specs) # Add to string representation if not cls_config['ignore_repr']: @@ -285,8 +294,13 @@ def generate_class_with_potiental_specialization(name_python: str, owner_specs: error_generating_overloads = get_static_and_instance_overloads(generated_methods) for error_overload in error_generating_overloads: print(f'Overload {error_overload} defined for instance and class, this will generate a pybind error') + for method_str in method_strs: + if error_overload in method_str: + print(method_str) + print() if len(error_generating_overloads) > 0: - print(generated_methods) + + print(error_generating_overloads) raise RuntimeError #spec_result += cls_result diff --git a/modules/python/generator/methods.py b/modules/python/generator/methods.py index c12607f2d3..10f5e33f0c 100644 --- a/modules/python/generator/methods.py +++ b/modules/python/generator/methods.py @@ -140,7 +140,7 @@ def get_bindable_methods_with_config(submodule: 'Submodule', methods: List[types (lambda m, _: m.pure_virtual, NotGeneratedReason.PureVirtual), (lambda m, _: m.access is None or m.access != 'public', NotGeneratedReason.Access), (lambda m, _: m.destructor, NotGeneratedReason.Destructor), - (lambda m, conf: m.template is not None and conf.get('specializations') is None, NotGeneratedReason.UnspecifiedTemplateSpecialization), + (lambda m, conf: m.template is not None and (conf.get('specializations') is None or len(conf['specializations']) == 0), NotGeneratedReason.UnspecifiedTemplateSpecialization), (lambda m, _: any(get_type(param.type, specializations, mapping) is None for param in m.parameters), NotGeneratedReason.ArgumentType), (lambda m, _: not m.constructor and get_type(m.return_type, specializations, mapping) is None, NotGeneratedReason.ReturnType) ] diff --git a/modules/python/generator/submodule.py b/modules/python/generator/submodule.py index a168eaf522..a38e940fca 100644 --- a/modules/python/generator/submodule.py +++ b/modules/python/generator/submodule.py @@ -144,10 +144,10 @@ def get_method_config(self, class_name: Optional[str], method, owner_specs, head def get_submodules(include_path: Path, generate_path: Path) -> List[Submodule]: - modules = ['core', 'vision', 'visual_features', 'vs', 'sensor'] + modules = ['core', 'vision', 'visual_features', 'vs', 'sensor', 'io'] result = [] for module in modules: - result.append(Submodule(module, Path(f'/home/sfelton/software/visp-sfelton/modules/{module}/include/visp3/{module}'), generate_path / f'{module}.cpp')) + result.append(Submodule(module, Path(f'/home/sfelton/visp-sfelton/modules/{module}/include/visp3/{module}'), generate_path / f'{module}.cpp')) return result # return [ # Submodule('core', Path('/home/sfelton/visp-sfelton/modules/core/include/visp3/core'), generate_path / 'core.cpp'), From 1c9df73f9b3bfd0c14080ba504ab14a3efa8f1ca Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Thu, 14 Sep 2023 16:50:01 +0200 Subject: [PATCH 037/169] small modifications on tp repro and doc --- modules/python/docs/index.rst | 32 +++++++++ modules/python/docs/static/todos.rst | 13 ++++ modules/python/examples/repro_tp1.py | 2 - modules/python/examples/repro_tp2.py | 1 - modules/python/examples/repro_tp3.py | 94 ++++++++++++++++----------- modules/python/generator/header.py | 4 +- modules/python/generator/submodule.py | 15 +---- modules/python/{ => test}/test.py | 0 8 files changed, 105 insertions(+), 56 deletions(-) create mode 100644 modules/python/docs/static/todos.rst rename modules/python/{ => test}/test.py (100%) diff --git a/modules/python/docs/index.rst b/modules/python/docs/index.rst index 713e80f5a6..ee09e35df3 100644 --- a/modules/python/docs/index.rst +++ b/modules/python/docs/index.rst @@ -3,14 +3,46 @@ ViSP Python Documentation Contents: +Todos and known issues +============================ + +.. toctree:: + :glob: + + static/* + + +Core module +============== + .. automodule:: visp.core :members: :undoc-members: +Visual servoing module +======================= + .. automodule:: visp.vs :members: :undoc-members: +Vision module +======================= + .. automodule:: visp.vision :members: :undoc-members: + +Visual features +======================= + +.. automodule:: visp.visual_features + :members: + :undoc-members: + +Input/output module +==================== + +.. automodule:: visp.io + :members: + :undoc-members: diff --git a/modules/python/docs/static/todos.rst b/modules/python/docs/static/todos.rst new file mode 100644 index 0000000000..854c0b7d97 --- /dev/null +++ b/modules/python/docs/static/todos.rst @@ -0,0 +1,13 @@ +List of todos +====================== + +* There is an issue when indexing readonly arrays such as HomogeneousMatrix or RotationMatrix +* Immutable (in python) parameters that are passed by reference are not modified. This includes: + + * ints, floats, double + * std::string and char arrays + * To remedy this, they should be returned as new values by defining the fn as a lambda by changing + +* Std containers are not modified, same as immutable parameters +* How should we handle parameters coming from external APIs ? e.g. realsense2, PCL. Can we interact with other bindings such as of opencv's +* Reimplement a framegrabber tutorial in python, with matplotlib \ No newline at end of file diff --git a/modules/python/examples/repro_tp1.py b/modules/python/examples/repro_tp1.py index 03857a559a..0fd0a77988 100644 --- a/modules/python/examples/repro_tp1.py +++ b/modules/python/examples/repro_tp1.py @@ -18,8 +18,6 @@ parser.add_argument('--use-case', type=int, default=1, dest='use_case', help='Use case value 1, 2 or 3') parser.add_argument('--data', type=str, required=True, help='Path to data') - - args, unknown_args = parser.parse_known_args() if unknown_args: print("The following args are not recognized and will not be used: %s" % unknown_args) diff --git a/modules/python/examples/repro_tp2.py b/modules/python/examples/repro_tp2.py index b8f4875933..1f02a69671 100644 --- a/modules/python/examples/repro_tp2.py +++ b/modules/python/examples/repro_tp2.py @@ -84,7 +84,6 @@ h, w = image1.getRows(), image1.getCols() - hbl = (int)(1.5*h) wbl = (int)(1.5*w) blendedImage = ImageGray(height=hbl, width=wbl, value=0) diff --git a/modules/python/examples/repro_tp3.py b/modules/python/examples/repro_tp3.py index 0401e55902..d368585211 100644 --- a/modules/python/examples/repro_tp3.py +++ b/modules/python/examples/repro_tp3.py @@ -9,7 +9,7 @@ from matplotlib import image from pathlib import Path -from visp.core import CameraParameters, HomogeneousMatrix, TranslationVector, ThetaUVector, ImagePoint, Matrix +from visp.core import ColVector, ImagePoint, Matrix, Point from visp.core import ImageGray, ImageTools from visp.vision import Homography from visp.io import ImageIo @@ -36,6 +36,7 @@ plt1.imshow(image1, cmap='gray') plt2.imshow(image2, cmap='gray') + # Utilisation transparent d'image visp dans une fonction numpy! imageAppariement = np.hstack((image1, image2)) plt3.imshow(imageAppariement, interpolation='bilinear', cmap='gray') @@ -64,10 +65,23 @@ ) # Plot corresponding points - u1 = point[:,0] - v1 = point[:,1] - u2 = point[:,2] - v2 = point[:,3] + # u1 = point[:,0] + # v1 = point[:,1] + # u2 = point[:,2] + # v2 = point[:,3] + # ViSP Image point format + ip1 = [ + ImagePoint(vv1, uu1) for vv1, uu1 in zip(point[:, 1], point[:, 0]) + ] + ip2 = [ + ImagePoint(vv2, uu2) for vv2, uu2 in zip(point[:, 3], point[:, 2]) + ] + u1s, v1s = np.asarray([p1.get_u() for p1 in ip1]), np.asarray([p1.get_v() for p1 in ip1]) + u2s, v2s = np.asarray([p2.get_u() for p2 in ip2]), np.asarray([p2.get_v() for p2 in ip2]) + + + print(f'Points in image 1: {ip1}') + print(f'Points in image 2: {ip2}') # Get image size img_rows = image1.getHeight() @@ -75,47 +89,48 @@ print("Image size:", img_cols, "x", img_rows) # Total number of points - nbPoints = len(u1) + nbPoints = len(ip1) + plt1.plot(u1s, v1s, 'r+') + plt2.plot(u2s, v2s, 'r+') + + + + - # BEGIN TO COMPLETE # Plot lines between matches - for i in range(nbPoints): - plt1.plot(u1[i], v1[i],'r+') - plt2.plot(u2[i], v2[i],'r+') - x = np.array([u1[i], u2[i] + img_cols]) - y = np.array([v1[i], v2[i]]) + for i, (p1, p2) in enumerate(zip(ip1, ip2)): + u1, v1 = p1.get_u(), p1.get_v() + u2, v2 = p2.get_u(), p2.get_v() + x = np.array([u1, u2 + img_cols]) + y = np.array([v1, v2]) + x = np.array([u1, u2 + img_cols]) + y = np.array([v1, v2]) plt3.plot(x, y, linewidth=1) - plt1.text(u1[i]+3, v1[i]-3, i, color='red') - plt2.text(u2[i]+3, v2[i]-3, i, color='red') - plt3.text(u1[i]+3, v1[i]-3, i, color='red') - plt3.text(u2[i]+img_cols-3, v2[i]-3, i, color='red') - # END TO COMPLETE + plt1.text(u1+3, v1-3, i, color='red') + plt2.text(u2+3, v2-3, i, color='red') + plt3.text(u1+3, v1-3, i, color='red') + plt3.text(u2+img_cols-3, v2-3, i, color='red') # Compute homography c2Hc1 such as x2 = c2Hc1 * x1 without RANSAC c2Hc1 = Homography() - Homography.DLT(u1, v1, u2, v2, c2Hc1, False) + Homography.DLT(u1s, v1s, u2s, v2s, c2Hc1, False) print("c2Hc1= \n", c2Hc1) for i in range(nbPoints): - # BEGIN TO COMPLETE - # Compute the position of (u2',v2') function of (u1,v1) print('point',i) - x1 = np.array([u1[i], v1[i], 1]) - x2 = np.matmul(c2Hc1,x1) + x1 = ColVector(np.array([u1s[i], v1s[i], 1])) + x2 = c2Hc1 * x1 x2 = x2/x2[2] + print(type(x2)) print("x2 = ", x2) - - # Compute the error between (u2',v2') and (u2,v2) - error = np.linalg.norm(np.array([u2[i], v2[i], 1]) - x2) + error = (x2 - ColVector([u2s[i], v2s[i], 1])).frobeniusNorm() print("error = ", error) - # END TO COMPLETE - plt2.plot(u2[i], v2[i],'+') - plt2.add_artist(plt.Circle((u2[i], v2[i]), error, fill=False, color='g')) + plt2.plot(u2s[i], v2s[i],'+') + plt2.add_artist(plt.Circle((u2s[i], v2s[i]), error, fill=False, color='g')) - # Wait for a mouse click in the image print("Use a mouse click to continue..") plt.waitforbuttonpress() @@ -127,15 +142,20 @@ seuilOutlier = 10 indexInliers = np.zeros(nbPoints) - inliers = [False for _ in range(len(u1))] + inliers = [False for _ in range(len(u1s))] residual = 0.0 # TODO: this should be returned - assert Homography.ransac(u1, v1, u2, v2, c2Hc1, inliers, residual, 12, seuilOutlier, False) + assert Homography.ransac(u1s, v1s, u2s, v2s, c2Hc1, inliers, residual, 15, seuilOutlier, False) + # Ideally we have: + # succeeded, c2Hc1, inliers, residual = Homography.ransac(u1, v1, u2, v2, 12, seuilOutlier, False) + # Could automatically generate + # succeeded, c2Hc1, inliers, redisual = Homography.ransac(u1, v1, u2, v2, c2Hc1, inliers, residual, 12, seuilOutlier, False) + print(inliers) # TODO: inliers isn't modified by the call to ransac # Compute the homography with all inliers - u1r = u1[inliers] - v1r = v1[inliers] - u2r = u2[inliers] - v2r = v2[inliers] + u1r = u1s[inliers] + v1r = v1s[inliers] + u2r = u2s[inliers] + v2r = v2s[inliers] print('Inliers = ', u1r, v1r, u2r, v2r) @@ -144,12 +164,12 @@ for j in range(nbPoints): # BEGIN TO COMPLETE # Compute the position of (u2',v2') function of (u1,v1) - x1 = np.array([u1[j], v1[j], 1]) + x1 = np.array([u1s[j], v1s[j], 1]) x2 = np.matmul(c2Hc1,x1) x2 = x2/x2[2] # Compute the error between (u2',v2') and (u2,v2) - error = np.linalg.norm(np.array([u2[j], v2[j], 1]) - x2) + error = np.linalg.norm(np.array([u2s[j], v2s[j], 1]) - x2) print("error[",j,"] = ", error) # END TO COMPLETE diff --git a/modules/python/generator/header.py b/modules/python/generator/header.py index e6cb32f49b..b965213a8f 100644 --- a/modules/python/generator/header.py +++ b/modules/python/generator/header.py @@ -111,9 +111,9 @@ def run_preprocessor(self): # TODO: run without generating a new file '', '-D', 'vp_deprecated=', '-D', 'VISP_EXPORT=', - '-I', '/home/sfelton/visp_build/include', + '-I', '/home/sfelton/software/visp_build/include', '-I', '/usr/local/include', - '-I', '/usr/include', + #'-I', '/usr/include', '-N', 'VISP_BUILD_DEPRECATED_FUNCTIONS', '--passthru-includes', "^((?!vpConfig.h|!json.hpp).)*$", '--passthru-unfound-includes', diff --git a/modules/python/generator/submodule.py b/modules/python/generator/submodule.py index a38e940fca..94cde70ae3 100644 --- a/modules/python/generator/submodule.py +++ b/modules/python/generator/submodule.py @@ -140,22 +140,9 @@ def get_method_config(self, class_name: Optional[str], method, owner_specs, head #import sys; sys.exit() return res - - - def get_submodules(include_path: Path, generate_path: Path) -> List[Submodule]: modules = ['core', 'vision', 'visual_features', 'vs', 'sensor', 'io'] result = [] for module in modules: - result.append(Submodule(module, Path(f'/home/sfelton/visp-sfelton/modules/{module}/include/visp3/{module}'), generate_path / f'{module}.cpp')) + result.append(Submodule(module, Path(f'/home/sfelton/software/visp-sfelton/modules/{module}/include/visp3/{module}'), generate_path / f'{module}.cpp')) return result - # return [ - # Submodule('core', Path('/home/sfelton/visp-sfelton/modules/core/include/visp3/core'), generate_path / 'core.cpp'), - # Submodule('vision', Path('/home/sfelton/visp-sfelton/modules/vision/include/visp3/vision'), generate_path / 'vision.cpp'), - # Submodule('core', Path('/home/sfelton/visp-sfelton/modules/core/include/visp3/core'), generate_path / 'visual_features.cpp'), - # Submodule('vision', Path('/home/sfelton/visp-sfelton/modules/vision/include/visp3/vision'), generate_path / 'vs.cpp'), - - # # Submodule('visual_features', include_path / 'visual_features', generate_path / 'visual_features.cpp'), - # # Submodule('vs', include_path / 'vs', generate_path / 'vs.cpp') - - # ] \ No newline at end of file diff --git a/modules/python/test.py b/modules/python/test/test.py similarity index 100% rename from modules/python/test.py rename to modules/python/test/test.py From ae86b8de4aec7cae2d38c7a8f9b2ab1a250800f5 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Thu, 14 Sep 2023 18:00:53 +0200 Subject: [PATCH 038/169] trying to fix writability of numpy view --- modules/python/include/core.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/python/include/core.hpp b/modules/python/include/core.hpp index 963031399d..c05e094dc7 100644 --- a/modules/python/include/core.hpp +++ b/modules/python/include/core.hpp @@ -186,13 +186,13 @@ void define_get_item_2d_array(PyClass &pyClass, bool readonly) pyClass.def("__getitem__", [readonly](const Class &self, py::slice slice) { auto as_array = np_array_cf(make_array_buffer(self.data, { self.getRows(), self.getCols() }, readonly), py::cast(self)); auto view = as_array[slice].template cast>(); - return py::array_t(view.request(!readonly), py::cast(self)); + return py::array_t(view.request(!readonly), as_array); }); pyClass.def("__getitem__", [readonly](const Class &self, py::tuple tuple) { auto as_array = np_array_cf(make_array_buffer(self.data, { self.getRows(), self.getCols() }, readonly), py::cast(self)); // py::detail::generic_item acc = as_array[tuple]; auto view = as_array[tuple].template cast>(); - return py::array_t(view.request(!readonly), py::cast(self)); + return py::array_t(view.request(!readonly), as_array); }); From ac0f5d219c926513812e6a414e9e4a748c50b660 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Mon, 18 Sep 2023 12:52:37 +0200 Subject: [PATCH 039/169] Generate some documentation for the python wrapper --- doc/config-doxygen.in | 160 ++++++++++++------------- modules/python/.gitignore | 1 + modules/python/docs/Makefile | 2 +- modules/python/docs/conf.py | 21 +++- modules/python/docs/index.rst | 4 +- modules/python/generator/doc_parser.py | 131 ++++++++++++++++++++ modules/python/generator/header.py | 19 +-- modules/python/generator/submodule.py | 2 +- modules/python/setup.py | 4 +- 9 files changed, 249 insertions(+), 95 deletions(-) create mode 100644 modules/python/generator/doc_parser.py diff --git a/doc/config-doxygen.in b/doc/config-doxygen.in index b2e49cdc13..bc2ded03ab 100644 --- a/doc/config-doxygen.in +++ b/doc/config-doxygen.in @@ -1,158 +1,158 @@ # Doxyfile 1.8.17 # This file describes the settings to be used by the documentation system -# doxygen (www.doxygen.org) for a project. +# doxygen(www.doxygen.org) for a project. # -# All text after a double hash (##) is considered a comment and is placed in +# All text after a double hash(##) is considered a comment and is placed in # front of the TAG it is preceding. # -# All text after a single hash (#) is considered a comment and will be ignored. -# The format is: -# TAG = value [value, ...] +# All text after a single hash(#) is considered a comment and will be ignored. +# The format is : +# TAG = value[value, ...] # For lists, items can also be appended using: -# TAG += value [value, ...] -# Values that contain spaces should be placed between quotes (\" \"). +# TAG += value[value, ...] +# Values that contain spaces should be placed between quotes(\" \"). #--------------------------------------------------------------------------- # Project related configuration options #--------------------------------------------------------------------------- # This tag specifies the encoding used for all characters in the configuration -# file that follow. The default is UTF-8 which is also the encoding used for all -# text before the first occurrence of this tag. Doxygen uses libiconv (or the -# iconv built into libc) for the transcoding. See +# file that follow.The default is UTF-8 which is also the encoding used for all +# text before the first occurrence of this tag.Doxygen uses libiconv(or the + # iconv built into libc) for the transcoding.See # https://www.gnu.org/software/libiconv/ for the list of possible encodings. -# The default value is: UTF-8. +# The default value is : UTF-8. -DOXYFILE_ENCODING = UTF-8 +DOXYFILE_ENCODING = UTF-8 -# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by +# The PROJECT_NAME tag is a single word(or a sequence of words surrounded by # double-quotes, unless you are using Doxywizard) that should identify the -# project for which the documentation is generated. This name is used in the +# project for which the documentation is generated.This name is used in the # title of most generated pages and in a few other places. -# The default value is: My Project. +# The default value is : My Project. -PROJECT_NAME = "Visual Servoing Platform" +PROJECT_NAME = "Visual Servoing Platform" -# The PROJECT_NUMBER tag can be used to enter a project or revision number. This +# The PROJECT_NUMBER tag can be used to enter a project or revision number.This # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = "version @VISP_VERSION@" +PROJECT_NUMBER = "version @VISP_VERSION@" # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a -# quick idea about the purpose of the project. Keep the description short. +# quick idea about the purpose of the project.Keep the description short. -PROJECT_BRIEF = +PROJECT_BRIEF = # With the PROJECT_LOGO tag one can specify a logo or an icon that is included -# in the documentation. The maximum height of the logo should not exceed 55 -# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy +# in the documentation.The maximum height of the logo should not exceed 55 +# pixels and the maximum width should not exceed 200 pixels.Doxygen will copy # the logo to the output directory. -PROJECT_LOGO = "@VISP_SOURCE_DIR@/doc/image/logo/img-logo-visp.png" +PROJECT_LOGO = "@VISP_SOURCE_DIR@/doc/image/logo/img-logo-visp.png" -# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path -# into which the generated documentation will be written. If a relative path is -# entered, it will be relative to the location where doxygen was started. If +# The OUTPUT_DIRECTORY tag is used to specify the(relative or absolute) path +# into which the generated documentation will be written.If a relative path is +# entered, it will be relative to the location where doxygen was started.If # left blank the current directory will be used. -OUTPUT_DIRECTORY = doc +OUTPUT_DIRECTORY = doc # If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub- -# directories (in 2 levels) under the output directory of each output format and -# will distribute the generated files over these directories. Enabling this +# directories(in 2 levels) under the output directory of each output format and +# will distribute the generated files over these directories.Enabling this # option can be useful when feeding doxygen a huge amount of source files, where # putting all generated files in the same directory would otherwise causes # performance problems for the file system. -# The default value is: NO. +# The default value is : NO. -CREATE_SUBDIRS = NO +CREATE_SUBDIRS = NO # If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII -# characters to appear in the names of generated files. If set to NO, non-ASCII +# characters to appear in the names of generated files.If set to NO, non-ASCII # characters will be escaped, for example _xE3_x81_x84 will be used for Unicode # U+3044. -# The default value is: NO. +# The default value is : NO. -ALLOW_UNICODE_NAMES = NO +ALLOW_UNICODE_NAMES = NO # The OUTPUT_LANGUAGE tag is used to specify the language in which all -# documentation generated by doxygen is written. Doxygen will use this +# documentation generated by doxygen is written.Doxygen will use this # information to generate all constant output in the proper language. -# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese, -# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States), -# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian, -# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages), -# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian, -# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian, +# Possible values are : Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese, +# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English(United States), +# Esperanto, Farsi(Persian), Finnish, French, German, Greek, Hungarian, +# Indonesian, Italian, Japanese, Japanese-en(Japanese with English messages), +# Korean, Korean-en(Korean with English messages), Latvian, Lithuanian, +# Macedonian, Norwegian, Persian(Farsi), Polish, Portuguese, Romanian, Russian, # Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish, # Ukrainian and Vietnamese. -# The default value is: English. +# The default value is : English. -OUTPUT_LANGUAGE = English +OUTPUT_LANGUAGE = English # The OUTPUT_TEXT_DIRECTION tag is used to specify the direction in which all -# documentation generated by doxygen is written. Doxygen will use this +# documentation generated by doxygen is written.Doxygen will use this # information to generate all generated output in the proper direction. -# Possible values are: None, LTR, RTL and Context. -# The default value is: None. +# Possible values are : None, LTR, RTL and Context. +# The default value is : None. -OUTPUT_TEXT_DIRECTION = None +OUTPUT_TEXT_DIRECTION = None # If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member # descriptions after the members that are listed in the file and class -# documentation (similar to Javadoc). Set to NO to disable this. -# The default value is: YES. +# documentation(similar to Javadoc).Set to NO to disable this. +# The default value is : YES. -BRIEF_MEMBER_DESC = NO +BRIEF_MEMBER_DESC = NO # If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief # description of a member or function before the detailed description # # Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the # brief descriptions will be completely suppressed. -# The default value is: YES. +# The default value is : YES. -REPEAT_BRIEF = YES +REPEAT_BRIEF = YES # This tag implements a quasi-intelligent brief description abbreviator that is -# used to form the text in various listings. Each string in this list, if found +# used to form the text in various listings.Each string in this list, if found # as the leading text of the brief description, will be stripped from the text # and the result, after processing the whole list, is used as the annotated -# text. Otherwise, the brief description is used as-is. If left blank, the -# following values are used ($name is automatically replaced with the name of -# the entity):The $name class, The $name widget, The $name file, is, provides, +# text.Otherwise, the brief description is used as-is.If left blank, the +# following values are used($name is automatically replaced with the name of +# the entity) :The $name class, The $name widget, The $name file, is, provides, # specifies, contains, represents, a, an and the. -ABBREVIATE_BRIEF = +ABBREVIATE_BRIEF = # If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then # doxygen will generate a detailed section even if there is only a brief # description. -# The default value is: NO. +# The default value is : NO. -ALWAYS_DETAILED_SEC = YES +ALWAYS_DETAILED_SEC = YES # If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all # inherited members of a class in the documentation of that class as if those -# members were ordinary class members. Constructors, destructors and assignment +# members were ordinary class members.Constructors, destructors and assignment # operators of the base classes will not be shown. -# The default value is: NO. +# The default value is : NO. -INLINE_INHERITED_MEMB = YES +INLINE_INHERITED_MEMB = YES # If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path -# before files name in the file list and in the header files. If set to NO the +# before files name in the file list and in the header files.If set to NO the # shortest path that makes the file name unique will be used -# The default value is: YES. +# The default value is : YES. -FULL_PATH_NAMES = YES +FULL_PATH_NAMES = YES # The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. # Stripping is only done if one of the specified strings matches the left-hand -# part of the path. The tag can be used to show relative paths in the file list. +# part of the path.The tag can be used to show relative paths in the file list. # If left blank the directory from which doxygen is run is used as the path to # strip. # @@ -160,33 +160,33 @@ FULL_PATH_NAMES = YES # will be relative from the directory where doxygen is started. # This tag requires that the tag FULL_PATH_NAMES is set to YES. -STRIP_FROM_PATH = +STRIP_FROM_PATH = # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the # path mentioned in the documentation of a class, which tells the reader which -# header file to include in order to use a class. If left blank only the name of -# the header file containing the class definition is used. Otherwise one should +# header file to include in order to use a class.If left blank only the name of +# the header file containing the class definition is used.Otherwise one should # specify the list of include paths that are normally passed to the compiler # using the -I flag. -STRIP_FROM_INC_PATH = @DOXYGEN_STRIP_FROM_INC_PATH@ +STRIP_FROM_INC_PATH = @DOXYGEN_STRIP_FROM_INC_PATH@ -# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but -# less readable) file names. This can be useful is your file systems doesn't +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter(but +# less readable) file names.This can be useful is your file systems doesn't # support long names like on DOS, Mac, or CD-ROM. -# The default value is: NO. +# The default value is : NO. -SHORT_NAMES = NO +SHORT_NAMES = NO # If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the -# first line (until the first dot) of a Javadoc-style comment as the brief -# description. If set to NO, the Javadoc-style will behave just like regular Qt- -# style comments (thus requiring an explicit @brief command for a brief +# first line(until the first dot) of a Javadoc-style comment as the brief +# description.If set to NO, the Javadoc-style will behave just like regular Qt- +# style comments(thus requiring an explicit @brief command for a brief # description.) -# The default value is: NO. +# The default value is : NO. -JAVADOC_AUTOBRIEF = NO +JAVADOC_AUTOBRIEF = NO # If the JAVADOC_BANNER tag is set to YES then doxygen will interpret a line # such as @@ -1979,7 +1979,7 @@ MAN_LINKS = NO # captures the structure of the code including all documentation. # The default value is: NO. -GENERATE_XML = NO +GENERATE_XML = YES # The XML_OUTPUT tag is used to specify where the XML pages will be put. If a # relative path is entered the value of OUTPUT_DIRECTORY will be put in front of diff --git a/modules/python/.gitignore b/modules/python/.gitignore index a567a1bccd..3a1818b414 100644 --- a/modules/python/.gitignore +++ b/modules/python/.gitignore @@ -7,3 +7,4 @@ stubs/build *.eggs docs/_build docs/_autosummary +docs/generated diff --git a/modules/python/docs/Makefile b/modules/python/docs/Makefile index 4c1a0febdf..8195292574 100644 --- a/modules/python/docs/Makefile +++ b/modules/python/docs/Makefile @@ -53,7 +53,7 @@ clean: .PHONY: html html: - $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html + $(SPHINXBUILD) -v -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html @echo @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." diff --git a/modules/python/docs/conf.py b/modules/python/docs/conf.py index b6c1c004f5..b86dafd9c3 100644 --- a/modules/python/docs/conf.py +++ b/modules/python/docs/conf.py @@ -17,8 +17,12 @@ # documentation root, use os.path.abspath to make it absolute, like shown here. import sys import os +import visp sys.path.insert(0, os.path.abspath('../build')) - +import pkgutil +with open('res.txt', 'w') as f: + f.write(str(visp.__path__)) + f.write(str(list(pkgutil.iter_modules(visp.__path__)))) # -- General configuration ------------------------------------------------ # If your documentation needs a minimal Sphinx version, state it here. @@ -30,10 +34,16 @@ extensions = [ "sphinx.ext.autodoc", "sphinx.ext.intersphinx", - "sphinx.ext.autosummary", "sphinx.ext.napoleon", + "sphinx.ext.mathjax", + "sphinx.ext.autosummary", + "sphinx_immaterial", + "sphinx_immaterial.apidoc.python.apigen" ] +python_apigen_modules = { + "visp.core": "generated/core", +} autosummary_generate = True # Add any paths that contain templates here, relative to this directory. @@ -69,7 +79,7 @@ # # This is also used if you do content translation via gettext catalogs. # Usually you set "language" from the command line for these cases. -language = None +language = 'en' # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: @@ -113,12 +123,15 @@ # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. -html_theme = 'sphinx_rtd_theme' +html_theme = 'sphinx_immaterial' # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. # html_theme_options = {} +html_theme_options = { + "toc_title_is_page_title": True, +} # Add any paths that contain custom themes here, relative to this directory. # html_theme_path = [] diff --git a/modules/python/docs/index.rst b/modules/python/docs/index.rst index ee09e35df3..7455e2c6cc 100644 --- a/modules/python/docs/index.rst +++ b/modules/python/docs/index.rst @@ -6,11 +6,13 @@ Contents: Todos and known issues ============================ +.. currentmodule:: visp + .. toctree:: :glob: static/* - + generated/core* Core module ============== diff --git a/modules/python/generator/doc_parser.py b/modules/python/generator/doc_parser.py new file mode 100644 index 0000000000..3ef3172a19 --- /dev/null +++ b/modules/python/generator/doc_parser.py @@ -0,0 +1,131 @@ +import_failed = False +from enum import Enum +from pathlib import Path +from typing import Dict, List, Optional +import re +try: + import doxmlparser + from doxmlparser.compound import DoxCompoundKind, DoxygenType, compounddefType, descriptionType, docParaType, MixedContainer +except ImportError: + print('Cannot import xml parser') + import_failed = True + + +class DocumentationData(object): + documentation_xml_location: Optional[Path] = Path('/home/sfelton/visp_build/doc/xml') + +class DocumentationObjectKind(Enum): + Class = 'class' + Struct = 'struct' + +def to_cstring(s: str) -> str: + s = s.replace('\t', ' ') + return f'''R"doc( +{s} +)doc"''' + +def process_mixed_container(container: MixedContainer, level: int) -> str: + one_indent = ' ' * 2 + indent_str = one_indent * level + if isinstance(container.value, str): + return container.value.replace('\n', '\n' + indent_str).strip() + # text + if container.name == 'text': + return container.value.replace('\n', '\n' + indent_str).strip() + if container.name == 'bold': + return '**' + container.value.valueOf_ + '**' + if container.name == 'emphasis': + return '*' + container.value.valueOf_ + '*' + if container.name == 'formula': + v: str = container.value.valueOf_.strip() + if v.startswith(('\\[', '$$')): + pure_math = indent_str + one_indent + v[2:-2].replace('\n', '') + return ('\n' + indent_str) * 2 + '.. math::' + '\n' + pure_math + '\n' + '\n' + else: + pure_math = v[1:-1].replace('\n', indent_str + one_indent) + return ' :math:`' + pure_math.strip() + '` ' + + if container.name == 'ref': + return ' ' + container.value.valueOf_ + ' ' + if container.name == 'verbatim': + print(container.value.valueOf_) + import sys; sys.exit() + if container.name == 'simplesect': + process_fn = lambda item: process_paragraph(item, level + 1) + res = '\n' + item_content = '\n'.join(map(process_fn, container.value.para)) + item_content = re.sub('\n\n\n+', '\n\n', item_content) + if container.value.kind == 'note': + res += '\n' + indent_str + '.. note:: ' + item_content + '\n' + indent_str + elif container.value.kind == 'warning': + res += '\n' + indent_str + '.. warning:: ' + item_content + '\n' + indent_str + elif container.value.kind == 'see': + res += '\n' + indent_str + '.. note:: See' + item_content + '\n' + indent_str + + + + print('res = ', res) + return res + '\n' + if container.name == 'itemizedlist': + items: List[doxmlparser.docListItemType] = container.value.listitem + res = '\n' + process_fn = lambda item: process_paragraph(item, level + 1) + for item in items: + item_content = '\n'.join(map(process_fn, item.para)) + item_content = re.sub('\n\n\n+', '\n\n', item_content) + #item_content = item_content.replace('\n' + indent_str, '\n' + indent_str + ' ') + res += '\n' + indent_str + '* ' + item_content + '\n' + indent_str + print('res = ', res) + return res + '\n' + return f'' + + +def process_paragraph(para: docParaType, level: int) -> str: + res = '' + contents: List[MixedContainer] = para.content_ + for content_item in contents: + res += process_mixed_container(content_item, level) + return res + +def process_description(brief: Optional[descriptionType]) -> str: + if brief is None: + return '' + para: List[docParaType] = brief.para + return '\n\n'.join([process_paragraph(par, 0) for par in para]) + +class DocumentationHolder(object): + def __init__(self, name: str, kind: DocumentationObjectKind, env_mapping: Dict[str, str]): + self.object_name = name + self.kind = kind + self.env_mapping = env_mapping + + self.documentation_dict = {} + if not import_failed and DocumentationData.documentation_xml_location is not None: + assert self.kind == DocumentationObjectKind.Class + xml_path = DocumentationData.documentation_xml_location / f'class{name}.xml' + if not xml_path.exists(): + print(f'Could not find documentation file for name {name}, looking in {str(xml_path)}') + else: + self.documentation_dict = self.parse_xml(xml_path) + + def parse_xml(self, xml_path: Path) -> Dict: + result_dict = {} + xml_doc = doxmlparser.compound.parse(str(xml_path), True, False) + for compounddef in xml_doc.get_compounddef(): + compounddef: compounddefType = compounddef + if compounddef.kind == DoxCompoundKind.CLASS: + print(f'Found class {compounddef.get_compoundname()}') + result_dict[compounddef.get_compoundname()] = self.generate_class_description_string(compounddef) + print(xml_doc) + return result_dict + + def generate_class_description_string(self, compounddef: compounddefType) -> str: + brief = process_description(compounddef.get_briefdescription()) + detailed = process_description(compounddef.get_detaileddescription()) + print(brief, detailed) + return to_cstring(brief + '\n' + detailed) + + +if __name__ == '__main__': + name = 'vpBSpline' + print(DocumentationHolder(name, DocumentationObjectKind.Class, {}).documentation_dict[name]) \ No newline at end of file diff --git a/modules/python/generator/header.py b/modules/python/generator/header.py index b965213a8f..4e9bf53808 100644 --- a/modules/python/generator/header.py +++ b/modules/python/generator/header.py @@ -2,15 +2,16 @@ from cxxheaderparser.parserstate import ClassBlockState, State import pcpp import cxxheaderparser -from cxxheaderparser.visitor import CxxVisitor from cxxheaderparser import types -from cxxheaderparser.simple import parse_string, ParsedData, NamespaceScope, ClassScope, parse_file +from cxxheaderparser.simple import parse_string, ParsedData, NamespaceScope, ClassScope from pathlib import Path import json from dataclasses import dataclass +from collections import OrderedDict + from utils import * from methods import * -from collections import OrderedDict +from doc_parser import * def filter_includes(include_names: Set[str]) -> List[str]: @@ -111,9 +112,9 @@ def run_preprocessor(self): # TODO: run without generating a new file '', '-D', 'vp_deprecated=', '-D', 'VISP_EXPORT=', - '-I', '/home/sfelton/software/visp_build/include', + '-I', '/home/sfelton/visp_build/include', '-I', '/usr/local/include', - #'-I', '/usr/include', + '-I', '/usr/include', '-N', 'VISP_BUILD_DEPRECATED_FUNCTIONS', '--passthru-includes', "^((?!vpConfig.h|!json.hpp).)*$", '--passthru-unfound-includes', @@ -167,8 +168,10 @@ def generate_class_with_potiental_specialization(name_python: str, owner_specs: base_class_strs = map(lambda base_class: get_typename(base_class.typename, owner_specs, header_env.mapping), filter(lambda b: b.access == 'public', cls.class_decl.bases)) class_template_str = ', '.join([name_cpp] + list(base_class_strs)) - - cls_argument_strs = ['submodule', f'"{name_python}"'] + (['py::buffer_protocol()'] if cls_config['use_buffer_protocol'] else []) + doc_param = [] + if name_cpp_no_template in documentation_holder.documentation_dict: + doc_param = [documentation_holder.documentation_dict[name_cpp_no_template]] + cls_argument_strs = ['submodule', f'"{name_python}"'] + doc_param + (['py::buffer_protocol()'] if cls_config['use_buffer_protocol'] else []) class_decl = f'\tpy::class_ {python_ident} = py::class_<{class_template_str}>({", ".join(cls_argument_strs)});' self.declarations.append(class_decl) @@ -310,6 +313,8 @@ def define_classical_method(method, method_config, specs): name_cpp_no_template = '::'.join([seg.name for seg in cls.class_decl.typename.segments]) print(f'Parsing class "{name_cpp_no_template}"') + documentation_holder = DocumentationHolder(name_cpp_no_template, DocumentationObjectKind.Class, header_env.mapping) + if self.submodule.class_should_be_ignored(name_cpp_no_template): return '' diff --git a/modules/python/generator/submodule.py b/modules/python/generator/submodule.py index 94cde70ae3..174405481e 100644 --- a/modules/python/generator/submodule.py +++ b/modules/python/generator/submodule.py @@ -144,5 +144,5 @@ def get_submodules(include_path: Path, generate_path: Path) -> List[Submodule]: modules = ['core', 'vision', 'visual_features', 'vs', 'sensor', 'io'] result = [] for module in modules: - result.append(Submodule(module, Path(f'/home/sfelton/software/visp-sfelton/modules/{module}/include/visp3/{module}'), generate_path / f'{module}.cpp')) + result.append(Submodule(module, Path(f'/home/sfelton/visp-sfelton/modules/{module}/include/visp3/{module}'), generate_path / f'{module}.cpp')) return result diff --git a/modules/python/setup.py b/modules/python/setup.py index 0754bce801..d7ac5cf098 100644 --- a/modules/python/setup.py +++ b/modules/python/setup.py @@ -154,7 +154,9 @@ def build_extension(self, ext: CMakeExtension) -> None: long_description="", setup_requires=[ "pcpp", - "cxxheaderparser@git+https://github.com/robotpy/cxxheaderparser#egg=master" + "cxxheaderparser@git+https://github.com/robotpy/cxxheaderparser#egg=master", + "lxml", + "doxmlparser@git+https://github.com/doxygen/doxygen#subdirectory=addon/doxmlparser" # "sphinx", # "sphinx-rtd-theme", # "sphinx-autopackagesummary" From 069a673aba64be21776251c6221a62d68e9aa0f6 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Mon, 18 Sep 2023 17:53:08 +0200 Subject: [PATCH 040/169] change binding generation flow: first preprocess and fetch xml, then generate code. Multiprocessed preprocess --- modules/python/build.sh | 1 + modules/python/docs/conf.py | 8 +-- modules/python/docs/index.rst | 1 - modules/python/generator/doc_parser.py | 83 ++++++++++++++++---------- modules/python/generator/generator.py | 22 +++++++ modules/python/generator/header.py | 79 +++++++++++++++++------- modules/python/generator/submodule.py | 26 +++++--- modules/python/setup.py | 4 -- 8 files changed, 151 insertions(+), 73 deletions(-) create mode 100755 modules/python/build.sh diff --git a/modules/python/build.sh b/modules/python/build.sh new file mode 100755 index 0000000000..50ce42803a --- /dev/null +++ b/modules/python/build.sh @@ -0,0 +1 @@ +python generator/generator.py && pip install . && rm -r stubs/build && pip install ./stubs && cd docs && rm -r _build && make html && cd .. \ No newline at end of file diff --git a/modules/python/docs/conf.py b/modules/python/docs/conf.py index b86dafd9c3..065b3e80c8 100644 --- a/modules/python/docs/conf.py +++ b/modules/python/docs/conf.py @@ -19,10 +19,10 @@ import os import visp sys.path.insert(0, os.path.abspath('../build')) -import pkgutil -with open('res.txt', 'w') as f: - f.write(str(visp.__path__)) - f.write(str(list(pkgutil.iter_modules(visp.__path__)))) +# import pkgutil +# with open('res.txt', 'w') as f: +# f.write(str(visp.__path__)) +# f.write(str(list(pkgutil.iter_modules(visp.__path__)))) # -- General configuration ------------------------------------------------ # If your documentation needs a minimal Sphinx version, state it here. diff --git a/modules/python/docs/index.rst b/modules/python/docs/index.rst index 7455e2c6cc..9b08af7f0c 100644 --- a/modules/python/docs/index.rst +++ b/modules/python/docs/index.rst @@ -12,7 +12,6 @@ Todos and known issues :glob: static/* - generated/core* Core module ============== diff --git a/modules/python/generator/doc_parser.py b/modules/python/generator/doc_parser.py index 3ef3172a19..ed4870b22a 100644 --- a/modules/python/generator/doc_parser.py +++ b/modules/python/generator/doc_parser.py @@ -10,13 +10,35 @@ print('Cannot import xml parser') import_failed = True - -class DocumentationData(object): - documentation_xml_location: Optional[Path] = Path('/home/sfelton/visp_build/doc/xml') - class DocumentationObjectKind(Enum): + ''' + Kind of the object for which we seek the documentation + ''' Class = 'class' Struct = 'struct' + Method = 'method' + +class DocumentationData(object): + documentation_xml_location: Optional[Path] = Path('/home/sfelton/software/visp_build/doc/xml') + + @staticmethod + def get_xml_path_if_exists(name: str, kind: DocumentationObjectKind) -> Optional[Path]: + if import_failed: + return None + + xml_root = DocumentationData.documentation_xml_location + if xml_root is None or not xml_root.exists(): + return None + p = None + if kind == DocumentationObjectKind.Class: + p = xml_root / f'class{name}.xml' + else: + assert False, 'Seeking documentation for type other than class not handled for now' + + if not p.exists(): + return None + return p + def to_cstring(s: str) -> str: s = s.replace('\t', ' ') @@ -36,6 +58,7 @@ def process_mixed_container(container: MixedContainer, level: int) -> str: return '**' + container.value.valueOf_ + '**' if container.name == 'emphasis': return '*' + container.value.valueOf_ + '*' + if container.name == 'formula': v: str = container.value.valueOf_.strip() if v.startswith(('\\[', '$$')): @@ -45,27 +68,29 @@ def process_mixed_container(container: MixedContainer, level: int) -> str: pure_math = v[1:-1].replace('\n', indent_str + one_indent) return ' :math:`' + pure_math.strip() + '` ' - if container.name == 'ref': + if container.name == 'ref': # TODO: replace with Python refs if possible return ' ' + container.value.valueOf_ + ' ' + if container.name == 'verbatim': print(container.value.valueOf_) import sys; sys.exit() + if container.name == 'simplesect': process_fn = lambda item: process_paragraph(item, level + 1) res = '\n' item_content = '\n'.join(map(process_fn, container.value.para)) item_content = re.sub('\n\n\n+', '\n\n', item_content) - if container.value.kind == 'note': + kind = container.value.kind + if kind == 'note': res += '\n' + indent_str + '.. note:: ' + item_content + '\n' + indent_str - elif container.value.kind == 'warning': + elif kind == 'warning': res += '\n' + indent_str + '.. warning:: ' + item_content + '\n' + indent_str - elif container.value.kind == 'see': + elif kind == 'see': res += '\n' + indent_str + '.. note:: See' + item_content + '\n' + indent_str - - - - print('res = ', res) + else: + res += '\n' + f'' return res + '\n' + if container.name == 'itemizedlist': items: List[doxmlparser.docListItemType] = container.value.listitem res = '\n' @@ -75,8 +100,8 @@ def process_mixed_container(container: MixedContainer, level: int) -> str: item_content = re.sub('\n\n\n+', '\n\n', item_content) #item_content = item_content.replace('\n' + indent_str, '\n' + indent_str + ' ') res += '\n' + indent_str + '* ' + item_content + '\n' + indent_str - print('res = ', res) return res + '\n' + return f'' @@ -94,30 +119,24 @@ def process_description(brief: Optional[descriptionType]) -> str: return '\n\n'.join([process_paragraph(par, 0) for par in para]) class DocumentationHolder(object): - def __init__(self, name: str, kind: DocumentationObjectKind, env_mapping: Dict[str, str]): - self.object_name = name - self.kind = kind - self.env_mapping = env_mapping + def __init__(self, path: Optional[Path] = None): + self.xml_path = path - self.documentation_dict = {} if not import_failed and DocumentationData.documentation_xml_location is not None: - assert self.kind == DocumentationObjectKind.Class - xml_path = DocumentationData.documentation_xml_location / f'class{name}.xml' - if not xml_path.exists(): - print(f'Could not find documentation file for name {name}, looking in {str(xml_path)}') + if not self.xml_path.exists(): + print(f'Could not find documentation file for name {name} when looking in {str(path)}') else: - self.documentation_dict = self.parse_xml(xml_path) + self.xml_doc = doxmlparser.compound.parse(str(path), True, False) - def parse_xml(self, xml_path: Path) -> Dict: - result_dict = {} - xml_doc = doxmlparser.compound.parse(str(xml_path), True, False) - for compounddef in xml_doc.get_compounddef(): + def get_documentation_for_class(self, name: str) -> Optional[str]: + for compounddef in self.xml_doc.get_compounddef(): compounddef: compounddefType = compounddef - if compounddef.kind == DoxCompoundKind.CLASS: - print(f'Found class {compounddef.get_compoundname()}') - result_dict[compounddef.get_compoundname()] = self.generate_class_description_string(compounddef) - print(xml_doc) - return result_dict + if compounddef.kind == DoxCompoundKind.CLASS and compounddef.get_compoundname() == name: + return self.generate_class_description_string(compounddef) + return None + + def get_documentation_for_method(self): + pass def generate_class_description_string(self, compounddef: compounddefType) -> str: brief = process_description(compounddef.get_briefdescription()) diff --git a/modules/python/generator/generator.py b/modules/python/generator/generator.py index e1072ad179..8ec961f925 100644 --- a/modules/python/generator/generator.py +++ b/modules/python/generator/generator.py @@ -11,12 +11,34 @@ from header import * from submodule import * +from multiprocessing import Pool +def header_preprocess(header: HeaderFile): + header.preprocess() + return header def generate_module(generate_path: Path) -> None: main_path = generate_path / 'main.cpp' include_path = Path('/usr/local/include/visp3') submodules: List[Submodule] = get_submodules(include_path, generate_path / 'generated') + + all_headers: List[HeaderFile] = [] + for submodule in submodules: + all_headers.extend(submodule.headers) + from tqdm import tqdm + with Pool() as pool: + new_all_headers = [] + for result in pool.map(header_preprocess, all_headers): + print(result.header_repr) + new_all_headers.append(result) + + new_all_headers = sort_headers(new_all_headers) + for submodule in submodules: + submodule.set_headers_from_common_list(new_all_headers) + # for header in all_headers: + # header.preprocess() + + for submodule in submodules: submodule.generate() diff --git a/modules/python/generator/header.py b/modules/python/generator/header.py index 4e9bf53808..b41987478f 100644 --- a/modules/python/generator/header.py +++ b/modules/python/generator/header.py @@ -1,19 +1,19 @@ from typing import List, Optional, Set, Tuple, Dict, Union -from cxxheaderparser.parserstate import ClassBlockState, State -import pcpp -import cxxheaderparser -from cxxheaderparser import types -from cxxheaderparser.simple import parse_string, ParsedData, NamespaceScope, ClassScope from pathlib import Path -import json from dataclasses import dataclass from collections import OrderedDict +import pcpp +from cxxheaderparser.parserstate import ClassBlockState, State +from cxxheaderparser import types +from cxxheaderparser.simple import parse_string, ParsedData, NamespaceScope, ClassScope + from utils import * from methods import * from doc_parser import * + def filter_includes(include_names: Set[str]) -> List[str]: result = [] for include_name in include_names: @@ -97,24 +97,54 @@ class HeaderFile(): def __init__(self, path: Path, submodule: 'Submodule'): self.path = path self.submodule = submodule - content = self.run_preprocessor() self.includes = [f''] self.binding_code = None + self.header_repr = None self.declarations = [] self.contains = [] self.depends = [] - self.generate_binding_code(content) + self.documentation_holder_path: Path = None + self.documentation_holder = None + + def __getstate__(self): + return self.__dict__ + def __setstate__(self, d): + self.__dict__ = d + + def preprocess(self) -> None: + ''' + Preprocess the header to obtain the abstract representation of the cpp classes available. + Additionally get the path to the xml documentation file generated by doxygen + ''' + preprocessed_header_str = self.run_preprocessor() # Run preprocessor, get only code that can be compiled with current visp + self.header_repr: ParsedData = parse_string(preprocessed_header_str) # Get the cxxheaderparser representation of the header + + # Get dependencies of this header. This is important for the code generation order + for cls in self.header_repr.namespace.classes: + name_cpp_no_template = '::'.join([seg.name for seg in cls.class_decl.typename.segments]) + self.contains.append(name_cpp_no_template) + # Add parent classes as dependencies + for base_class in cls.class_decl.bases: + if base_class.access == 'public': + base_class_str_no_template = '::'.join([segment.name for segment in base_class.typename.segments]) + if base_class_str_no_template.startswith('vp'): + self.depends.append(base_class_str_no_template) + + # Get documentation if available, only one document supported for now + if self.documentation_holder_path is None: + self.documentation_holder_path = DocumentationData.get_xml_path_if_exists(name_cpp_no_template, DocumentationObjectKind.Class) + + def run_preprocessor(self): # TODO: run without generating a new file tmp_file_path = self.submodule.submodule_file_path.parent / "tmp" / self.path.name - print(f'preprocessing {self.path}') argv = [ '', '-D', 'vp_deprecated=', '-D', 'VISP_EXPORT=', - '-I', '/home/sfelton/visp_build/include', + '-I', '/home/sfelton/software/visp_build/include', '-I', '/usr/local/include', - '-I', '/usr/include', + #'-I', '/usr/include', '-N', 'VISP_BUILD_DEPRECATED_FUNCTIONS', '--passthru-includes', "^((?!vpConfig.h|!json.hpp).)*$", '--passthru-unfound-includes', @@ -130,18 +160,21 @@ def run_preprocessor(self): # TODO: run without generating a new file preprocessed_header_content = preprocessed_header_content.replace('#include<', '#include <') return preprocessed_header_content - def generate_binding_code(self, content: str) -> None: - parsed_data = parse_string(content) - self.binding_code = self.parse_data(parsed_data) + def generate_binding_code(self) -> None: + assert self.header_repr is not None, 'The header was not preprocessed before calling the generation step!' + if self.documentation_holder_path is not None: + self.documentation_holder = DocumentationHolder(self.documentation_holder_path) + self.binding_code = self.parse_data() - def parse_data(self, data: ParsedData): - result = '' - header_env = HeaderEnvironment(data) + def parse_data(self): from enum_binding import enum_bindings - for cls in data.namespace.classes: + result = '' + header_env = HeaderEnvironment(self.header_repr) + + for cls in self.header_repr.namespace.classes: result += self.generate_class(cls, header_env) + '\n' - enum_decls_and_bindings = enum_bindings(data.namespace, header_env.mapping, self.submodule) + enum_decls_and_bindings = enum_bindings(self.header_repr.namespace, header_env.mapping, self.submodule) for declaration, binding in enum_decls_and_bindings: self.declarations.append(declaration) result += binding @@ -169,8 +202,10 @@ def generate_class_with_potiental_specialization(name_python: str, owner_specs: filter(lambda b: b.access == 'public', cls.class_decl.bases)) class_template_str = ', '.join([name_cpp] + list(base_class_strs)) doc_param = [] - if name_cpp_no_template in documentation_holder.documentation_dict: - doc_param = [documentation_holder.documentation_dict[name_cpp_no_template]] + if self.documentation_holder is not None: + doc_str = self.documentation_holder.get_documentation_for_class(name_cpp_no_template) + if doc_str is not None: + doc_param = [doc_str] cls_argument_strs = ['submodule', f'"{name_python}"'] + doc_param + (['py::buffer_protocol()'] if cls_config['use_buffer_protocol'] else []) class_decl = f'\tpy::class_ {python_ident} = py::class_<{class_template_str}>({", ".join(cls_argument_strs)});' @@ -313,8 +348,6 @@ def define_classical_method(method, method_config, specs): name_cpp_no_template = '::'.join([seg.name for seg in cls.class_decl.typename.segments]) print(f'Parsing class "{name_cpp_no_template}"') - documentation_holder = DocumentationHolder(name_cpp_no_template, DocumentationObjectKind.Class, header_env.mapping) - if self.submodule.class_should_be_ignored(name_cpp_no_template): return '' diff --git a/modules/python/generator/submodule.py b/modules/python/generator/submodule.py index 174405481e..9236e71fe2 100644 --- a/modules/python/generator/submodule.py +++ b/modules/python/generator/submodule.py @@ -19,27 +19,35 @@ def __init__(self, name: str, include_path: Path, submodule_file_path: Path): self.config_path = Path('config') / (name + '.json') with open(self.config_path, 'r') as config_file: self.config = json.load(config_file) - + self.headers = self._get_headers() assert self.include_path.exists(), f'Submodule path {self.include_path} not found' - - def generate(self) -> None: + def _get_headers(self) -> List[HeaderFile]: headers = [] for include_file in self.include_path.iterdir(): if not include_file.name.endswith('.h') and not include_file.name.endswith('.hpp'): continue if self.header_should_be_ignored(include_file.name): continue - header = HeaderFile(include_file, self) - headers.append(header) + headers.append(HeaderFile(include_file, self)) + return headers + + def set_headers_from_common_list(self, all_headers: List[HeaderFile]) -> None: + new_headers = [] + for header in all_headers: + if header.submodule.name == self.name: + new_headers.append(header) + self.headers = new_headers + + def generate(self) -> None: + # Sort by dependency level so that generation is in correct order - headers = sort_headers(headers) - print([h.path for h in headers]) header_code = [] declarations = [] includes = [] - for header in headers: + for header in self.headers: + header.generate_binding_code() header_code.append(header.binding_code) declarations.extend(header.declarations) includes.extend(header.includes) @@ -144,5 +152,5 @@ def get_submodules(include_path: Path, generate_path: Path) -> List[Submodule]: modules = ['core', 'vision', 'visual_features', 'vs', 'sensor', 'io'] result = [] for module in modules: - result.append(Submodule(module, Path(f'/home/sfelton/visp-sfelton/modules/{module}/include/visp3/{module}'), generate_path / f'{module}.cpp')) + result.append(Submodule(module, Path(f'/home/sfelton/software/visp-sfelton/modules/{module}/include/visp3/{module}'), generate_path / f'{module}.cpp')) return result diff --git a/modules/python/setup.py b/modules/python/setup.py index d7ac5cf098..292f59299e 100644 --- a/modules/python/setup.py +++ b/modules/python/setup.py @@ -21,14 +21,10 @@ "win-arm64": "ARM64", } -def generate_stubs(): - subprocess.run('pip install ./stubs', env=os.environ, shell=True, capture_output=True, check=True) class CustomInstall(install): def run(self): install.run(self) - #generate_stubs() - # subprocess.run('sphinx-build -b html docs docs/build/html', shell=True, check=True) class build(build_module.build): From a401dce6c4492e561e9b8bae551dbe7b06a12928 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Tue, 19 Sep 2023 16:36:33 +0200 Subject: [PATCH 041/169] trying to parse method docs --- modules/python/generator/doc_parser.py | 32 +++++++++++++++++++------- modules/python/generator/generator.py | 5 ++-- modules/python/generator/header.py | 30 +++++++----------------- 3 files changed, 34 insertions(+), 33 deletions(-) diff --git a/modules/python/generator/doc_parser.py b/modules/python/generator/doc_parser.py index ed4870b22a..2e9e8688ea 100644 --- a/modules/python/generator/doc_parser.py +++ b/modules/python/generator/doc_parser.py @@ -1,4 +1,5 @@ import_failed = False +from dataclasses import dataclass from enum import Enum from pathlib import Path from typing import Dict, List, Optional @@ -45,6 +46,21 @@ def to_cstring(s: str) -> str: return f'''R"doc( {s} )doc"''' +@dataclass +class MethodDocSignature: + name: str + ret: str + params: List[str] + is_const: bool + +@dataclass +class MethodDocumentation(object): + documentation: str + +@dataclass +class ClassDocumentation(object): + class_doc: str + method_docs: Dict[MethodDocSignature, MethodDocumentation] def process_mixed_container(container: MixedContainer, level: int) -> str: one_indent = ' ' * 2 @@ -72,8 +88,7 @@ def process_mixed_container(container: MixedContainer, level: int) -> str: return ' ' + container.value.valueOf_ + ' ' if container.name == 'verbatim': - print(container.value.valueOf_) - import sys; sys.exit() + raise NotImplementedError() if container.name == 'simplesect': process_fn = lambda item: process_paragraph(item, level + 1) @@ -128,21 +143,22 @@ def __init__(self, path: Optional[Path] = None): else: self.xml_doc = doxmlparser.compound.parse(str(path), True, False) - def get_documentation_for_class(self, name: str) -> Optional[str]: + def get_documentation_for_class(self, name: str, cpp_ref_to_python: Dict[str, str], specs: Dict[str, str]) -> Optional[str]: for compounddef in self.xml_doc.get_compounddef(): compounddef: compounddefType = compounddef if compounddef.kind == DoxCompoundKind.CLASS and compounddef.get_compoundname() == name: - return self.generate_class_description_string(compounddef) + cls_str = self.generate_class_description_string(compounddef) + print(compounddef.get_listofallmembers()) + method_docs = self.get_method_docs(compounddef) + return ClassDocumentation(cls_str, method_docs) + return None - def get_documentation_for_method(self): - pass def generate_class_description_string(self, compounddef: compounddefType) -> str: brief = process_description(compounddef.get_briefdescription()) detailed = process_description(compounddef.get_detaileddescription()) - print(brief, detailed) - return to_cstring(brief + '\n' + detailed) + return to_cstring(brief + '\n\n' + detailed) if __name__ == '__main__': diff --git a/modules/python/generator/generator.py b/modules/python/generator/generator.py index 8ec961f925..da772f68fe 100644 --- a/modules/python/generator/generator.py +++ b/modules/python/generator/generator.py @@ -7,7 +7,7 @@ from cxxheaderparser.simple import parse_string, ParsedData, NamespaceScope, ClassScope from pathlib import Path import json - +from tqdm.contrib.concurrent import process_map from header import * from submodule import * @@ -28,8 +28,7 @@ def generate_module(generate_path: Path) -> None: from tqdm import tqdm with Pool() as pool: new_all_headers = [] - for result in pool.map(header_preprocess, all_headers): - print(result.header_repr) + for result in list(tqdm(pool.imap(header_preprocess, all_headers), total=len(all_headers), file=sys.stdout)): new_all_headers.append(result) new_all_headers = sort_headers(new_all_headers) diff --git a/modules/python/generator/header.py b/modules/python/generator/header.py index b41987478f..498cc279f1 100644 --- a/modules/python/generator/header.py +++ b/modules/python/generator/header.py @@ -59,8 +59,6 @@ def add_level(result: List['HeaderFile'], remainder: List['HeaderFile'], depende add_level(result, headers, set()) return result - - class HeaderEnvironment(): def __init__(self, data: ParsedData): self.mapping = self.build_mapping(data.namespace) @@ -123,6 +121,7 @@ def preprocess(self) -> None: for cls in self.header_repr.namespace.classes: name_cpp_no_template = '::'.join([seg.name for seg in cls.class_decl.typename.segments]) self.contains.append(name_cpp_no_template) + # Add parent classes as dependencies for base_class in cls.class_decl.bases: if base_class.access == 'public': @@ -146,7 +145,7 @@ def run_preprocessor(self): # TODO: run without generating a new file '-I', '/usr/local/include', #'-I', '/usr/include', '-N', 'VISP_BUILD_DEPRECATED_FUNCTIONS', - '--passthru-includes', "^((?!vpConfig.h|!json.hpp).)*$", + '--passthru-includes', "^((?!vpConfig.h).)*$", '--passthru-unfound-includes', '--passthru-comments', '--line-directive', '', @@ -181,13 +180,11 @@ def parse_data(self): return result def generate_class(self, cls: ClassScope, header_env: HeaderEnvironment) -> str: - result = '' def generate_class_with_potiental_specialization(name_python: str, owner_specs: OrderedDict[str, str], cls_config: Dict) -> str: - - spec_result = '' python_ident = f'py{name_python}' name_cpp = get_typename(cls.class_decl.typename, owner_specs, header_env.mapping) - + if self.documentation_holder is not None: + class_doc = self.documentation_holder.get_documentation_for_class(name_cpp_no_template, {}, owner_specs) # Declaration # Add template specializations to cpp class name. e.g., vpArray2D becomes vpArray2D if the template T is double template_decl: Optional[types.TemplateDecl] = cls.class_decl.template @@ -201,11 +198,8 @@ def generate_class_with_potiental_specialization(name_python: str, owner_specs: base_class_strs = map(lambda base_class: get_typename(base_class.typename, owner_specs, header_env.mapping), filter(lambda b: b.access == 'public', cls.class_decl.bases)) class_template_str = ', '.join([name_cpp] + list(base_class_strs)) - doc_param = [] - if self.documentation_holder is not None: - doc_str = self.documentation_holder.get_documentation_for_class(name_cpp_no_template) - if doc_str is not None: - doc_param = [doc_str] + doc_param = [] if class_doc is None else [class_doc.class_doc] + cls_argument_strs = ['submodule', f'"{name_python}"'] + doc_param + (['py::buffer_protocol()'] if cls_config['use_buffer_protocol'] else []) class_decl = f'\tpy::class_ {python_ident} = py::class_<{class_template_str}>({", ".join(cls_argument_strs)});' @@ -342,8 +336,8 @@ def define_classical_method(method, method_config, specs): raise RuntimeError #spec_result += cls_result - spec_result += '\n'.join(method_strs) - return spec_result + return '\n'.join(method_strs) + name_cpp_no_template = '::'.join([seg.name for seg in cls.class_decl.typename.segments]) print(f'Parsing class "{name_cpp_no_template}"') @@ -351,14 +345,6 @@ def define_classical_method(method, method_config, specs): if self.submodule.class_should_be_ignored(name_cpp_no_template): return '' - # Add base classes as requirements - self.contains.append(name_cpp_no_template) - for base_class in cls.class_decl.bases: - if base_class.access == 'public': - base_class_str_no_template = '::'.join([segment.name for segment in base_class.typename.segments]) - if base_class_str_no_template.startswith('vp'): - self.depends.append(base_class_str_no_template) - cls_config = self.submodule.get_class_config(name_cpp_no_template) if cls.class_decl.template is None: name_python = name_cpp_no_template.replace('vp', '') From 6598366cfad1db61417ef7393bad505c10a3c634 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Wed, 20 Sep 2023 00:42:42 +0200 Subject: [PATCH 042/169] some improvement in method doc generation --- modules/python/generator/doc_parser.py | 107 +++++++++++++++++++++---- modules/python/generator/generator.py | 7 +- modules/python/generator/header.py | 22 +++-- modules/python/generator/submodule.py | 2 +- modules/python/generator/utils.py | 3 + 5 files changed, 113 insertions(+), 28 deletions(-) diff --git a/modules/python/generator/doc_parser.py b/modules/python/generator/doc_parser.py index 2e9e8688ea..4b0d7b3788 100644 --- a/modules/python/generator/doc_parser.py +++ b/modules/python/generator/doc_parser.py @@ -2,7 +2,7 @@ from dataclasses import dataclass from enum import Enum from pathlib import Path -from typing import Dict, List, Optional +from typing import Dict, List, Optional, Tuple import re try: import doxmlparser @@ -20,7 +20,7 @@ class DocumentationObjectKind(Enum): Method = 'method' class DocumentationData(object): - documentation_xml_location: Optional[Path] = Path('/home/sfelton/software/visp_build/doc/xml') + documentation_xml_location: Optional[Path] = Path('/home/sfelton/visp_build/doc/xml') @staticmethod def get_xml_path_if_exists(name: str, kind: DocumentationObjectKind) -> Optional[Path]: @@ -52,6 +52,37 @@ class MethodDocSignature: ret: str params: List[str] is_const: bool + is_static: bool + + def post_process_type(self, t: str) -> str: + res = '' + if '::' not in t: + res = t + else: + # TODO: this kind of workaround works when you have no template + is_const = 'const' in t + is_rvalue = '&&' in t + is_ref = not is_rvalue and '&' in t + is_ptr = '*' in t + last_name = t.split('::')[-1] + res = 'const' if is_const else '' + res += last_name + res += '&&' if is_rvalue else '' + res += '&' if is_ref else '' + res += '*' if is_ptr else '' + return res.replace(' ', '') + + + def __init__(self, name, ret, params, is_const, is_static): + self.name = name.replace(' ', '') + self.ret = self.post_process_type(ret) + self.params = [self.post_process_type(param) for param in params] + self.is_const = is_const + self.is_static = is_static + + def __hash__(self) -> int: + s = f'{self.is_static} {self.ret} {self.name}({",".join(self.params)}) {self.is_const}' + return s.__hash__() @dataclass class MethodDocumentation(object): @@ -59,8 +90,12 @@ class MethodDocumentation(object): @dataclass class ClassDocumentation(object): - class_doc: str - method_docs: Dict[MethodDocSignature, MethodDocumentation] + documentation: str +@dataclass +class DocElements(object): + compounddefs: Dict[str, compounddefType] + methods: Dict[Tuple[str, MethodDocSignature], List[doxmlparser.memberdefType]] + def process_mixed_container(container: MixedContainer, level: int) -> str: one_indent = ' ' * 2 @@ -134,25 +169,62 @@ def process_description(brief: Optional[descriptionType]) -> str: return '\n\n'.join([process_paragraph(par, 0) for par in para]) class DocumentationHolder(object): - def __init__(self, path: Optional[Path] = None): + def __init__(self, path: Optional[Path], env_mapping: Dict[str, str]): self.xml_path = path - + self.elements = None if not import_failed and DocumentationData.documentation_xml_location is not None: if not self.xml_path.exists(): print(f'Could not find documentation file for name {name} when looking in {str(path)}') else: self.xml_doc = doxmlparser.compound.parse(str(path), True, False) + compounddefs_res = {} + methods_res = {} + for compounddef in self.xml_doc.get_compounddef(): + compounddef: compounddefType = compounddef + if compounddef.kind == DoxCompoundKind.CLASS: + compounddefs_res[compounddef.get_compoundname()] = compounddef + section_defs: List[doxmlparser.sectiondefType] = compounddef.sectiondef + for section_def in section_defs: + member_defs: List[doxmlparser.memberdefType] = section_def.memberdef + method_defs = [d for d in member_defs if d.kind == doxmlparser.compound.DoxMemberKind.FUNCTION and d.prot == 'public'] + for method_def in method_defs: + is_const = False if method_def.const == 'no' else True + is_static = False if method_def.static == 'no' else True + ret_type = ''.join(process_mixed_container(c, 0) for c in method_def.type_.content_) + if ret_type in env_mapping: + ret_type = env_mapping[ret_type] + param_types = [] + for param in method_def.get_param(): + t = ''.join(process_mixed_container(c, 0) for c in param.type_.content_) + if t in env_mapping: + t = env_mapping[t] + param_types.append(t) + signature = MethodDocSignature(method_def.name, ret_type, param_types, is_const, is_static) + methods_res[(compounddef.get_compoundname(), signature)] = method_def + self.elements = DocElements(compounddefs_res, methods_res) + + + + + + def get_documentation_for_class(self, name: str, cpp_ref_to_python: Dict[str, str], specs: Dict[str, str]) -> Optional[ClassDocumentation]: + compounddef = self.elements.compounddefs.get(name) + + if compounddef is None: + return None + cls_str = self.generate_class_description_string(compounddef) + return ClassDocumentation(cls_str) + - def get_documentation_for_class(self, name: str, cpp_ref_to_python: Dict[str, str], specs: Dict[str, str]) -> Optional[str]: - for compounddef in self.xml_doc.get_compounddef(): - compounddef: compounddefType = compounddef - if compounddef.kind == DoxCompoundKind.CLASS and compounddef.get_compoundname() == name: - cls_str = self.generate_class_description_string(compounddef) - print(compounddef.get_listofallmembers()) - method_docs = self.get_method_docs(compounddef) - return ClassDocumentation(cls_str, method_docs) + def get_documentation_for_method(self, cls_name: str, signature: MethodDocSignature, cpp_ref_to_python: Dict[str, str], specs: Dict[str, str]) -> Optional[MethodDocumentation]: + method_def = self.elements.methods.get((cls_name, signature)) + if method_def is None: + print(f'method {signature} not found') + print([k[1] for k in self.elements.methods.keys() if k[1].name == signature.name]) + return None + descr = self.generate_method_description_string(method_def) + return MethodDocumentation(descr) - return None def generate_class_description_string(self, compounddef: compounddefType) -> str: @@ -160,6 +232,11 @@ def generate_class_description_string(self, compounddef: compounddefType) -> str detailed = process_description(compounddef.get_detaileddescription()) return to_cstring(brief + '\n\n' + detailed) + def generate_method_description_string(self, method_def: doxmlparser.memberdefType) -> str: + brief = process_description(method_def.get_briefdescription()) + detailed = process_description(method_def.get_detaileddescription()) + return to_cstring(brief + '\n\n' + detailed) + if __name__ == '__main__': name = 'vpBSpline' diff --git a/modules/python/generator/generator.py b/modules/python/generator/generator.py index da772f68fe..fa34eb2b22 100644 --- a/modules/python/generator/generator.py +++ b/modules/python/generator/generator.py @@ -28,15 +28,12 @@ def generate_module(generate_path: Path) -> None: from tqdm import tqdm with Pool() as pool: new_all_headers = [] - for result in list(tqdm(pool.imap(header_preprocess, all_headers), total=len(all_headers), file=sys.stdout)): + for result in list(tqdm(pool.imap(header_preprocess, all_headers), total=len(all_headers), file=sys.stderr)): new_all_headers.append(result) new_all_headers = sort_headers(new_all_headers) for submodule in submodules: submodule.set_headers_from_common_list(new_all_headers) - # for header in all_headers: - # header.preprocess() - for submodule in submodules: submodule.generate() @@ -67,5 +64,5 @@ def generate_module(generate_path: Path) -> None: main_file.write(format_str) if __name__ == '__main__': - import sys + import sys generate_module(Path('src')) \ No newline at end of file diff --git a/modules/python/generator/header.py b/modules/python/generator/header.py index 498cc279f1..d92232b627 100644 --- a/modules/python/generator/header.py +++ b/modules/python/generator/header.py @@ -141,9 +141,9 @@ def run_preprocessor(self): # TODO: run without generating a new file '', '-D', 'vp_deprecated=', '-D', 'VISP_EXPORT=', - '-I', '/home/sfelton/software/visp_build/include', + '-I', '/home/sfelton/visp_build/include', '-I', '/usr/local/include', - #'-I', '/usr/include', + '-I', '/usr/include', '-N', 'VISP_BUILD_DEPRECATED_FUNCTIONS', '--passthru-includes', "^((?!vpConfig.h).)*$", '--passthru-unfound-includes', @@ -161,8 +161,7 @@ def run_preprocessor(self): # TODO: run without generating a new file def generate_binding_code(self) -> None: assert self.header_repr is not None, 'The header was not preprocessed before calling the generation step!' - if self.documentation_holder_path is not None: - self.documentation_holder = DocumentationHolder(self.documentation_holder_path) + self.binding_code = self.parse_data() @@ -170,7 +169,8 @@ def parse_data(self): from enum_binding import enum_bindings result = '' header_env = HeaderEnvironment(self.header_repr) - + if self.documentation_holder_path is not None: + self.documentation_holder = DocumentationHolder(self.documentation_holder_path, header_env.mapping) for cls in self.header_repr.namespace.classes: result += self.generate_class(cls, header_env) + '\n' enum_decls_and_bindings = enum_bindings(self.header_repr.namespace, header_env.mapping, self.submodule) @@ -198,7 +198,7 @@ def generate_class_with_potiental_specialization(name_python: str, owner_specs: base_class_strs = map(lambda base_class: get_typename(base_class.typename, owner_specs, header_env.mapping), filter(lambda b: b.access == 'public', cls.class_decl.bases)) class_template_str = ', '.join([name_cpp] + list(base_class_strs)) - doc_param = [] if class_doc is None else [class_doc.class_doc] + doc_param = [] if class_doc is None else [class_doc.documentation] cls_argument_strs = ['submodule', f'"{name_python}"'] + doc_param + (['py::buffer_protocol()'] if cls_config['use_buffer_protocol'] else []) @@ -275,7 +275,7 @@ def generate_class_with_potiental_specialization(name_python: str, owner_specs: break - def define_classical_method(method, method_config, specs): + def define_classical_method(method: types.Method, method_config, specs): params_strs = [get_type(param.type, specs, header_env.mapping) for param in method.parameters] py_arg_strs = [f'py::arg("{param.name}")' for param in method.parameters] @@ -283,6 +283,14 @@ def define_classical_method(method, method_config, specs): py_method_name = method_config.get('custom_name') or method_name return_type = get_type(method.return_type, specs, header_env.mapping) + if self.documentation_holder is not None: + method_doc_signature = MethodDocSignature(method_name, + get_type(method.return_type, {}, header_env.mapping), # Don't use specializations so that we can match with doc + [get_type(param.type, {}, header_env.mapping) for param in method.parameters], + method.const, method.static) + method_doc = self.documentation_holder.get_documentation_for_method(name_cpp_no_template, method_doc_signature, {}, specs) + py_arg_strs = py_arg_strs if method_doc is None else [method_doc.documentation] + py_arg_strs + method_ref_str = ref_to_class_method(method, name_cpp, method_name, return_type, params_strs) method_str = define_method(py_method_name, method_ref_str, py_arg_strs, method.static) method_str = f'{python_ident}.{method_str};' diff --git a/modules/python/generator/submodule.py b/modules/python/generator/submodule.py index 9236e71fe2..fd49085f6b 100644 --- a/modules/python/generator/submodule.py +++ b/modules/python/generator/submodule.py @@ -152,5 +152,5 @@ def get_submodules(include_path: Path, generate_path: Path) -> List[Submodule]: modules = ['core', 'vision', 'visual_features', 'vs', 'sensor', 'io'] result = [] for module in modules: - result.append(Submodule(module, Path(f'/home/sfelton/software/visp-sfelton/modules/{module}/include/visp3/{module}'), generate_path / f'{module}.cpp')) + result.append(Submodule(module, Path(f'/home/sfelton/visp-sfelton/modules/{module}/include/visp3/{module}'), generate_path / f'{module}.cpp')) return result diff --git a/modules/python/generator/utils.py b/modules/python/generator/utils.py index 269a93f819..e545ae70be 100644 --- a/modules/python/generator/utils.py +++ b/modules/python/generator/utils.py @@ -45,6 +45,9 @@ def get_type(param: Union[types.FunctionType, types.DecoratedType, types.Value], if split[0] in header_env_mapping: split[0] = header_env_mapping[split[0]] repr_str = '<'.join(split) + if repr_str == 'vpRobust::vpRobustEstimatorType': + print('aaaaaaaaaaaa') + print(param) if param.const: repr_str = 'const ' + repr_str return repr_str From 7c482894c227eb8c8fd4ffbc3bd9adc75e2b3de4 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Wed, 20 Sep 2023 00:59:32 +0200 Subject: [PATCH 043/169] small fix --- modules/python/generator/doc_parser.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/python/generator/doc_parser.py b/modules/python/generator/doc_parser.py index 4b0d7b3788..f750b248c6 100644 --- a/modules/python/generator/doc_parser.py +++ b/modules/python/generator/doc_parser.py @@ -76,7 +76,12 @@ def post_process_type(self, t: str) -> str: def __init__(self, name, ret, params, is_const, is_static): self.name = name.replace(' ', '') self.ret = self.post_process_type(ret) - self.params = [self.post_process_type(param) for param in params] + clean_params = [] + for param in params: + if param == 'void': + continue + clean_params.append(self.post_process_type(param)) + self.params = clean_params self.is_const = is_const self.is_static = is_static From 3dc81d456d3cb186dbf9b88e62c760d08141bd53 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Wed, 20 Sep 2023 12:35:32 +0200 Subject: [PATCH 044/169] better doc --- modules/python/docs/api.rst | 9 +++++ modules/python/docs/conf.py | 9 ++++- modules/python/docs/index.rst | 52 +++++++++++++------------- modules/python/generator/doc_parser.py | 2 +- modules/python/generator/header.py | 5 ++- modules/python/generator/submodule.py | 2 +- 6 files changed, 49 insertions(+), 30 deletions(-) create mode 100644 modules/python/docs/api.rst diff --git a/modules/python/docs/api.rst b/modules/python/docs/api.rst new file mode 100644 index 0000000000..28caa978d3 --- /dev/null +++ b/modules/python/docs/api.rst @@ -0,0 +1,9 @@ +API reference +============== + +.. toctree:: + :hidden: + :glob: + :maxdepth: 2 + + generated/core.rst \ No newline at end of file diff --git a/modules/python/docs/conf.py b/modules/python/docs/conf.py index 065b3e80c8..874b151c60 100644 --- a/modules/python/docs/conf.py +++ b/modules/python/docs/conf.py @@ -42,8 +42,15 @@ ] python_apigen_modules = { - "visp.core": "generated/core", + "visp.core": "generated/core.", + "visp.vs": "generated/vs.", } +python_apigen_default_groups = [ + (r".*:visp.core.*", "Core Public-members"), + (r"class:visp.core.*", "Core Classes"), + (r".*:visp.vs.*", "VS Public-members"), + (r"class:visp.vs.*", "VS Classes"), +] autosummary_generate = True # Add any paths that contain templates here, relative to this directory. diff --git a/modules/python/docs/index.rst b/modules/python/docs/index.rst index 9b08af7f0c..d558a723ab 100644 --- a/modules/python/docs/index.rst +++ b/modules/python/docs/index.rst @@ -12,38 +12,40 @@ Todos and known issues :glob: static/* + api.rst -Core module -============== -.. automodule:: visp.core - :members: - :undoc-members: +.. Core module +.. ============== -Visual servoing module -======================= +.. .. automodule:: visp.core +.. :members: +.. :undoc-members: -.. automodule:: visp.vs - :members: - :undoc-members: +.. Visual servoing module +.. ======================= -Vision module -======================= +.. .. automodule:: visp.vs +.. :members: +.. :undoc-members: -.. automodule:: visp.vision - :members: - :undoc-members: +.. Vision module +.. ======================= -Visual features -======================= +.. .. automodule:: visp.vision +.. :members: +.. :undoc-members: -.. automodule:: visp.visual_features - :members: - :undoc-members: +.. Visual features +.. ======================= -Input/output module -==================== +.. .. automodule:: visp.visual_features +.. :members: +.. :undoc-members: -.. automodule:: visp.io - :members: - :undoc-members: +.. Input/output module +.. ==================== + +.. .. automodule:: visp.io +.. :members: +.. :undoc-members: diff --git a/modules/python/generator/doc_parser.py b/modules/python/generator/doc_parser.py index f750b248c6..03462de37e 100644 --- a/modules/python/generator/doc_parser.py +++ b/modules/python/generator/doc_parser.py @@ -20,7 +20,7 @@ class DocumentationObjectKind(Enum): Method = 'method' class DocumentationData(object): - documentation_xml_location: Optional[Path] = Path('/home/sfelton/visp_build/doc/xml') + documentation_xml_location: Optional[Path] = Path('/home/sfelton/software/visp_build/doc/xml') @staticmethod def get_xml_path_if_exists(name: str, kind: DocumentationObjectKind) -> Optional[Path]: diff --git a/modules/python/generator/header.py b/modules/python/generator/header.py index d92232b627..413dbb07cd 100644 --- a/modules/python/generator/header.py +++ b/modules/python/generator/header.py @@ -141,9 +141,9 @@ def run_preprocessor(self): # TODO: run without generating a new file '', '-D', 'vp_deprecated=', '-D', 'VISP_EXPORT=', - '-I', '/home/sfelton/visp_build/include', + '-I', '/home/sfelton/software/visp_build/include', '-I', '/usr/local/include', - '-I', '/usr/include', + #'-I', '/usr/include', '-N', 'VISP_BUILD_DEPRECATED_FUNCTIONS', '--passthru-includes', "^((?!vpConfig.h).)*$", '--passthru-unfound-includes', @@ -183,6 +183,7 @@ def generate_class(self, cls: ClassScope, header_env: HeaderEnvironment) -> str: def generate_class_with_potiental_specialization(name_python: str, owner_specs: OrderedDict[str, str], cls_config: Dict) -> str: python_ident = f'py{name_python}' name_cpp = get_typename(cls.class_decl.typename, owner_specs, header_env.mapping) + class_doc = None if self.documentation_holder is not None: class_doc = self.documentation_holder.get_documentation_for_class(name_cpp_no_template, {}, owner_specs) # Declaration diff --git a/modules/python/generator/submodule.py b/modules/python/generator/submodule.py index fd49085f6b..9236e71fe2 100644 --- a/modules/python/generator/submodule.py +++ b/modules/python/generator/submodule.py @@ -152,5 +152,5 @@ def get_submodules(include_path: Path, generate_path: Path) -> List[Submodule]: modules = ['core', 'vision', 'visual_features', 'vs', 'sensor', 'io'] result = [] for module in modules: - result.append(Submodule(module, Path(f'/home/sfelton/visp-sfelton/modules/{module}/include/visp3/{module}'), generate_path / f'{module}.cpp')) + result.append(Submodule(module, Path(f'/home/sfelton/software/visp-sfelton/modules/{module}/include/visp3/{module}'), generate_path / f'{module}.cpp')) return result From 270fb3e19a1d45c038318d427670174b24aa5636 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Wed, 20 Sep 2023 12:46:53 +0200 Subject: [PATCH 045/169] separate api reference link --- modules/python/docs/api.rst | 2 +- modules/python/docs/conf.py | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/python/docs/api.rst b/modules/python/docs/api.rst index 28caa978d3..507e7675f5 100644 --- a/modules/python/docs/api.rst +++ b/modules/python/docs/api.rst @@ -6,4 +6,4 @@ API reference :glob: :maxdepth: 2 - generated/core.rst \ No newline at end of file + generated/core.* \ No newline at end of file diff --git a/modules/python/docs/conf.py b/modules/python/docs/conf.py index 874b151c60..febfd27e9e 100644 --- a/modules/python/docs/conf.py +++ b/modules/python/docs/conf.py @@ -51,6 +51,13 @@ (r".*:visp.vs.*", "VS Public-members"), (r"class:visp.vs.*", "VS Classes"), ] + +python_apigen_default_order = [ + (r".*:visp.core.*", -1), + (r"class:visp.core.*", -2), + (r".*:visp.vs.*", -1), + (r"class:visp.vs.*", -2), +] autosummary_generate = True # Add any paths that contain templates here, relative to this directory. From 5ddcf1ccacf22fc2857e5a69840b45134518ac3a Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Thu, 21 Sep 2023 18:25:31 +0200 Subject: [PATCH 046/169] Better parsing of method doc, program lisitngs in cpp --- modules/python/CMakeLists.txt | 2 +- .../docs/_templates/custom-class-template.rst | 8 ++- .../_templates/custom-module-template.rst | 8 +-- modules/python/docs/api2.rst | 10 +++ modules/python/docs/conf.py | 65 ++++++++++++------- modules/python/docs/index.rst | 2 + modules/python/generator/doc_parser.py | 62 +++++++++++++----- modules/python/generator/header.py | 9 ++- modules/python/generator/submodule.py | 2 +- 9 files changed, 115 insertions(+), 53 deletions(-) create mode 100644 modules/python/docs/api2.rst diff --git a/modules/python/CMakeLists.txt b/modules/python/CMakeLists.txt index 3fb572084a..308a1da30a 100644 --- a/modules/python/CMakeLists.txt +++ b/modules/python/CMakeLists.txt @@ -15,5 +15,5 @@ message(${pybind11_VERSION}) file(GLOB generated_cpp src/generated/*.cpp) file(GLOB static_cpp src/static/*.cpp) -pybind11_add_module(visp src/main.cpp ${generated_cpp} ${static_cpp}) +pybind11_add_module(visp src/main.cpp ${generated_cpp} ${static_cpp} THIN_LTO) target_link_libraries(visp PRIVATE ${VISP_LIBRARIES}) diff --git a/modules/python/docs/_templates/custom-class-template.rst b/modules/python/docs/_templates/custom-class-template.rst index 16ebb2f338..b45f0cfc96 100644 --- a/modules/python/docs/_templates/custom-class-template.rst +++ b/modules/python/docs/_templates/custom-class-template.rst @@ -1,4 +1,4 @@ -{{ fullname | escape | underline}} +{{ objname | escape | underline}} .. currentmodule:: {{ module }} @@ -6,16 +6,18 @@ :members: :show-inheritance: :inherited-members: + :special-members: __call__, __add__, __mul__ {% block methods %} - .. automethod:: __init__ - {% if methods %} .. rubric:: {{ _('Methods') }} .. autosummary:: + :nosignatures: {% for item in methods %} + {%- if not item.startswith('_') %} ~{{ name }}.{{ item }} + {%- endif -%} {%- endfor %} {% endif %} {% endblock %} diff --git a/modules/python/docs/_templates/custom-module-template.rst b/modules/python/docs/_templates/custom-module-template.rst index 74078355f2..6af2a258cf 100644 --- a/modules/python/docs/_templates/custom-module-template.rst +++ b/modules/python/docs/_templates/custom-module-template.rst @@ -1,10 +1,10 @@ -{{ fullname | escape | underline}} +{{ objname | escape | underline}} .. automodule:: {{ fullname }} {% block attributes %} {% if attributes %} - .. rubric:: Module Attributes + .. rubric:: Module attributes .. autosummary:: :toctree: @@ -20,6 +20,7 @@ .. autosummary:: :toctree: + :nosignatures: {% for item in functions %} {{ item }} {%- endfor %} @@ -33,6 +34,7 @@ .. autosummary:: :toctree: :template: custom-class-template.rst + :nosignatures: {% for item in classes %} {{ item }} {%- endfor %} @@ -53,8 +55,6 @@ {% block modules %} {% if modules %} -.. rubric:: Modules - .. autosummary:: :toctree: :template: custom-module-template.rst diff --git a/modules/python/docs/api2.rst b/modules/python/docs/api2.rst new file mode 100644 index 0000000000..c373a94b33 --- /dev/null +++ b/modules/python/docs/api2.rst @@ -0,0 +1,10 @@ +API reference +============== + + +.. autosummary:: + :toctree: _autosummary + :recursive: + :template: custom-module-template.rst + + visp.core diff --git a/modules/python/docs/conf.py b/modules/python/docs/conf.py index febfd27e9e..045bee4e4c 100644 --- a/modules/python/docs/conf.py +++ b/modules/python/docs/conf.py @@ -17,13 +17,8 @@ # documentation root, use os.path.abspath to make it absolute, like shown here. import sys import os -import visp + sys.path.insert(0, os.path.abspath('../build')) -# import pkgutil -# with open('res.txt', 'w') as f: -# f.write(str(visp.__path__)) -# f.write(str(list(pkgutil.iter_modules(visp.__path__)))) -# -- General configuration ------------------------------------------------ # If your documentation needs a minimal Sphinx version, state it here. # needs_sphinx = '1.0' @@ -38,28 +33,50 @@ "sphinx.ext.mathjax", "sphinx.ext.autosummary", "sphinx_immaterial", - "sphinx_immaterial.apidoc.python.apigen" -] - -python_apigen_modules = { - "visp.core": "generated/core.", - "visp.vs": "generated/vs.", -} -python_apigen_default_groups = [ - (r".*:visp.core.*", "Core Public-members"), - (r"class:visp.core.*", "Core Classes"), - (r".*:visp.vs.*", "VS Public-members"), - (r"class:visp.vs.*", "VS Classes"), + # "sphinx_immaterial.apidoc.python.apigen" ] -python_apigen_default_order = [ - (r".*:visp.core.*", -1), - (r"class:visp.core.*", -2), - (r".*:visp.vs.*", -1), - (r"class:visp.vs.*", -2), -] +# python_apigen_modules = { +# "visp.core": "generated/core.", +# "visp.vs": "generated/vs.", +# } +# python_apigen_default_groups = [ +# (r".*:visp.core.*", "Core Public-members"), +# (r"class:visp.core.*", "Core Classes"), +# (r".*:visp.vs.*", "VS Public-members"), +# (r"class:visp.vs.*", "VS Classes"), +# ] + +# python_apigen_default_order = [ +# (r".*:visp.core.*", -1), +# (r"class:visp.core.*", -2), +# (r".*:visp.vs.*", -1), +# (r"class:visp.vs.*", -2), +# ] autosummary_generate = True +autoclass_content = "both" # Add __init__ doc (ie. params) to class summaries +html_show_sourcelink = False # Remove 'view source code' from top of page (for html, not python) +autodoc_inherit_docstrings = True # If no docstring, inherit from base class +set_type_checking_flag = True # Enable 'expensive' imports for sphinx_autodoc_typehints +nbsphinx_allow_errors = True # Continue through Jupyter errors +#autodoc_typehints = "description" # Sphinx-native method. Not as good as sphinx_autodoc_typehints +add_module_names = False # Remove namespaces from class/method signatures + + +import visp +from types import ModuleType +module_names = [] +for k in visp.__dict__: + if isinstance(visp.__dict__[k], ModuleType): + module_names.append(k) + +all_modules = '\\ '.join(f'visp.{module_name}' for module_name in module_names) + +rst_prolog = f""" +.. |all_modules| replace:: visp.core +""" + # Add any paths that contain templates here, relative to this directory. templates_path = ["_templates"] diff --git a/modules/python/docs/index.rst b/modules/python/docs/index.rst index d558a723ab..8649d6ea71 100644 --- a/modules/python/docs/index.rst +++ b/modules/python/docs/index.rst @@ -13,6 +13,8 @@ Todos and known issues static/* api.rst + api2.rst + .. Core module diff --git a/modules/python/generator/doc_parser.py b/modules/python/generator/doc_parser.py index 03462de37e..ac17087432 100644 --- a/modules/python/generator/doc_parser.py +++ b/modules/python/generator/doc_parser.py @@ -4,6 +4,7 @@ from pathlib import Path from typing import Dict, List, Optional, Tuple import re +from cxxheaderparser.simple import parse_string try: import doxmlparser from doxmlparser.compound import DoxCompoundKind, DoxygenType, compounddefType, descriptionType, docParaType, MixedContainer @@ -11,6 +12,8 @@ print('Cannot import xml parser') import_failed = True +from utils import * + class DocumentationObjectKind(Enum): ''' Kind of the object for which we seek the documentation @@ -20,7 +23,7 @@ class DocumentationObjectKind(Enum): Method = 'method' class DocumentationData(object): - documentation_xml_location: Optional[Path] = Path('/home/sfelton/software/visp_build/doc/xml') + documentation_xml_location: Optional[Path] = Path('/home/sfelton/visp_build/doc/xml') @staticmethod def get_xml_path_if_exists(name: str, kind: DocumentationObjectKind) -> Optional[Path]: @@ -75,13 +78,8 @@ def post_process_type(self, t: str) -> str: def __init__(self, name, ret, params, is_const, is_static): self.name = name.replace(' ', '') - self.ret = self.post_process_type(ret) - clean_params = [] - for param in params: - if param == 'void': - continue - clean_params.append(self.post_process_type(param)) - self.params = clean_params + self.ret = ret.replace(' ', '') + self.params = [p.replace(' ', '') for p in params] self.is_const = is_const self.is_static = is_static @@ -111,9 +109,11 @@ def process_mixed_container(container: MixedContainer, level: int) -> str: if container.name == 'text': return container.value.replace('\n', '\n' + indent_str).strip() if container.name == 'bold': - return '**' + container.value.valueOf_ + '**' + return ' **' + container.value.valueOf_ + '** ' if container.name == 'emphasis': - return '*' + container.value.valueOf_ + '*' + return ' *' + container.value.valueOf_ + '* ' + if container.name == 'sp': + return ' ' if container.name == 'formula': v: str = container.value.valueOf_.strip() @@ -146,6 +146,25 @@ def process_mixed_container(container: MixedContainer, level: int) -> str: res += '\n' + f'' return res + '\n' + if container.name == 'programlisting': + program: doxmlparser.listingType = container.value + codelines: List[doxmlparser.codelineType] = program.codeline + res = '\n\n' + indent_str + '.. code-block:: cpp' + '\n\n' + indent_str + one_indent + lines = [] + for line in codelines: + cs = [] + for h in line.highlight: + c = ''.join([process_mixed_container(h, level) for h in h.content_]) + cs.append(c) + s = ''.join(cs) + lines.append(s) + + code = ('\n' + indent_str + one_indent).join(lines) + res += code + '\n\n' + return res + + + if container.name == 'itemizedlist': items: List[doxmlparser.docListItemType] = container.value.listitem res = '\n' @@ -187,7 +206,8 @@ def __init__(self, path: Optional[Path], env_mapping: Dict[str, str]): for compounddef in self.xml_doc.get_compounddef(): compounddef: compounddefType = compounddef if compounddef.kind == DoxCompoundKind.CLASS: - compounddefs_res[compounddef.get_compoundname()] = compounddef + cls_name = compounddef.get_compoundname() + compounddefs_res[cls_name] = compounddef section_defs: List[doxmlparser.sectiondefType] = compounddef.sectiondef for section_def in section_defs: member_defs: List[doxmlparser.memberdefType] = section_def.memberdef @@ -195,17 +215,23 @@ def __init__(self, path: Optional[Path], env_mapping: Dict[str, str]): for method_def in method_defs: is_const = False if method_def.const == 'no' else True is_static = False if method_def.static == 'no' else True - ret_type = ''.join(process_mixed_container(c, 0) for c in method_def.type_.content_) - if ret_type in env_mapping: - ret_type = env_mapping[ret_type] + ret_type = ''.join(process_mixed_container(c, 0) for c in method_def.type_.content_).replace('vp_deprecated', '').replace('VISP_EXPORT', '') param_types = [] for param in method_def.get_param(): t = ''.join(process_mixed_container(c, 0) for c in param.type_.content_) - if t in env_mapping: - t = env_mapping[t] + param_types.append(t) - signature = MethodDocSignature(method_def.name, ret_type, param_types, is_const, is_static) - methods_res[(compounddef.get_compoundname(), signature)] = method_def + if method_def.name == cls_name or ret_type != '': + signature_str = f'{ret_type} {cls_name}::{method_def.name}({",".join(param_types)}) {{}}' + method = parse_string(signature_str).namespace.method_impls[0] + method.static = is_static + method.const = is_const + + signature = MethodDocSignature(method_def.name, + get_type(method.return_type, {}, env_mapping) or '', # Don't use specializations so that we can match with doc + [get_type(param.type, {}, env_mapping) or '' for param in method.parameters], + method.const, method.static) + methods_res[(compounddef.get_compoundname(), signature)] = method_def self.elements = DocElements(compounddefs_res, methods_res) diff --git a/modules/python/generator/header.py b/modules/python/generator/header.py index 413dbb07cd..c010ecba42 100644 --- a/modules/python/generator/header.py +++ b/modules/python/generator/header.py @@ -141,9 +141,9 @@ def run_preprocessor(self): # TODO: run without generating a new file '', '-D', 'vp_deprecated=', '-D', 'VISP_EXPORT=', - '-I', '/home/sfelton/software/visp_build/include', + '-I', '/home/sfelton/visp_build/include', '-I', '/usr/local/include', - #'-I', '/usr/include', + '-I', '/usr/include', '-N', 'VISP_BUILD_DEPRECATED_FUNCTIONS', '--passthru-includes', "^((?!vpConfig.h).)*$", '--passthru-unfound-includes', @@ -171,6 +171,8 @@ def parse_data(self): header_env = HeaderEnvironment(self.header_repr) if self.documentation_holder_path is not None: self.documentation_holder = DocumentationHolder(self.documentation_holder_path, header_env.mapping) + else: + print(f'No documentation found for header {self.path}') for cls in self.header_repr.namespace.classes: result += self.generate_class(cls, header_env) + '\n' enum_decls_and_bindings = enum_bindings(self.header_repr.namespace, header_env.mapping, self.submodule) @@ -186,6 +188,8 @@ def generate_class_with_potiental_specialization(name_python: str, owner_specs: class_doc = None if self.documentation_holder is not None: class_doc = self.documentation_holder.get_documentation_for_class(name_cpp_no_template, {}, owner_specs) + else: + print(f'Documentation not found when looking up {name_cpp_no_template}') # Declaration # Add template specializations to cpp class name. e.g., vpArray2D becomes vpArray2D if the template T is double template_decl: Optional[types.TemplateDecl] = cls.class_decl.template @@ -290,6 +294,7 @@ def define_classical_method(method: types.Method, method_config, specs): [get_type(param.type, {}, header_env.mapping) for param in method.parameters], method.const, method.static) method_doc = self.documentation_holder.get_documentation_for_method(name_cpp_no_template, method_doc_signature, {}, specs) + print(f'Fetching documentation for {method_name}: {"Found" if method_doc is not None else "Not found"}') py_arg_strs = py_arg_strs if method_doc is None else [method_doc.documentation] + py_arg_strs method_ref_str = ref_to_class_method(method, name_cpp, method_name, return_type, params_strs) diff --git a/modules/python/generator/submodule.py b/modules/python/generator/submodule.py index 9236e71fe2..fd49085f6b 100644 --- a/modules/python/generator/submodule.py +++ b/modules/python/generator/submodule.py @@ -152,5 +152,5 @@ def get_submodules(include_path: Path, generate_path: Path) -> List[Submodule]: modules = ['core', 'vision', 'visual_features', 'vs', 'sensor', 'io'] result = [] for module in modules: - result.append(Submodule(module, Path(f'/home/sfelton/software/visp-sfelton/modules/{module}/include/visp3/{module}'), generate_path / f'{module}.cpp')) + result.append(Submodule(module, Path(f'/home/sfelton/visp-sfelton/modules/{module}/include/visp3/{module}'), generate_path / f'{module}.cpp')) return result From 163765cb809d082c4cdf9d71b14fa4195dfa0057 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Mon, 25 Sep 2023 17:32:57 +0200 Subject: [PATCH 047/169] can now correctly find way more documentation, better organization and started work on param doc for methods --- .../docs/_templates/custom-class-template.rst | 33 +++++++- modules/python/docs/api.rst | 15 ++-- modules/python/docs/api2.rst | 10 --- modules/python/docs/conf.py | 1 + modules/python/docs/index.rst | 1 - modules/python/generator/doc_parser.py | 80 ++++++++++--------- modules/python/generator/header.py | 4 +- modules/python/generator/submodule.py | 2 +- 8 files changed, 87 insertions(+), 59 deletions(-) delete mode 100644 modules/python/docs/api2.rst diff --git a/modules/python/docs/_templates/custom-class-template.rst b/modules/python/docs/_templates/custom-class-template.rst index b45f0cfc96..058299e716 100644 --- a/modules/python/docs/_templates/custom-class-template.rst +++ b/modules/python/docs/_templates/custom-class-template.rst @@ -5,8 +5,9 @@ .. autoclass:: {{ objname }} :members: :show-inheritance: - :inherited-members: - :special-members: __call__, __add__, __mul__ + :member-order: groupwise + :inherited-members: pybind11_object + :special-members: {% block methods %} {% if methods %} @@ -15,6 +16,20 @@ .. autosummary:: :nosignatures: {% for item in methods %} + {%- if not item.startswith('_') and item not in inherited_members %} + ~{{ name }}.{{ item }} + {%- endif -%} + {%- endfor %} + {% endif %} + {% endblock %} + + {% block inheritedmethods %} + {% if inherited_members %} + .. rubric:: {{ _('Inherited Methods') }} + + .. autosummary:: + :nosignatures: + {% for item in inherited_members %} {%- if not item.startswith('_') %} ~{{ name }}.{{ item }} {%- endif -%} @@ -22,6 +37,20 @@ {% endif %} {% endblock %} + {% block operators %} + {% if members %} + .. rubric:: {{ _('Operators') }} + + .. autosummary:: + :nosignatures: + {% for item in members %} + {%- if item.startswith('__') and item.endswith('__') and item not in ['__new__', '__repr__', '__hash__', '__init__', '__doc__', '__module__'] %} + ~{{ name }}.{{ item }} + {%- endif -%} + {%- endfor %} + {% endif %} + {% endblock %} + {% block attributes %} {% if attributes %} .. rubric:: {{ _('Attributes') }} diff --git a/modules/python/docs/api.rst b/modules/python/docs/api.rst index 507e7675f5..ad0bc9389a 100644 --- a/modules/python/docs/api.rst +++ b/modules/python/docs/api.rst @@ -1,9 +1,14 @@ API reference ============== -.. toctree:: - :hidden: - :glob: - :maxdepth: 2 - generated/core.* \ No newline at end of file +.. autosummary:: + :toctree: _autosummary + :recursive: + :template: custom-module-template.rst + + visp.core + visp.io + visp.vision + visp.visual_features + visp.vs diff --git a/modules/python/docs/api2.rst b/modules/python/docs/api2.rst deleted file mode 100644 index c373a94b33..0000000000 --- a/modules/python/docs/api2.rst +++ /dev/null @@ -1,10 +0,0 @@ -API reference -============== - - -.. autosummary:: - :toctree: _autosummary - :recursive: - :template: custom-module-template.rst - - visp.core diff --git a/modules/python/docs/conf.py b/modules/python/docs/conf.py index 045bee4e4c..085699549e 100644 --- a/modules/python/docs/conf.py +++ b/modules/python/docs/conf.py @@ -58,6 +58,7 @@ autoclass_content = "both" # Add __init__ doc (ie. params) to class summaries html_show_sourcelink = False # Remove 'view source code' from top of page (for html, not python) autodoc_inherit_docstrings = True # If no docstring, inherit from base class +autodoc_member_order = 'groupwise' set_type_checking_flag = True # Enable 'expensive' imports for sphinx_autodoc_typehints nbsphinx_allow_errors = True # Continue through Jupyter errors #autodoc_typehints = "description" # Sphinx-native method. Not as good as sphinx_autodoc_typehints diff --git a/modules/python/docs/index.rst b/modules/python/docs/index.rst index 8649d6ea71..afa5d6712e 100644 --- a/modules/python/docs/index.rst +++ b/modules/python/docs/index.rst @@ -13,7 +13,6 @@ Todos and known issues static/* api.rst - api2.rst diff --git a/modules/python/generator/doc_parser.py b/modules/python/generator/doc_parser.py index ac17087432..1f2d56173d 100644 --- a/modules/python/generator/doc_parser.py +++ b/modules/python/generator/doc_parser.py @@ -23,7 +23,7 @@ class DocumentationObjectKind(Enum): Method = 'method' class DocumentationData(object): - documentation_xml_location: Optional[Path] = Path('/home/sfelton/visp_build/doc/xml') + documentation_xml_location: Optional[Path] = Path('/home/sfelton/software/visp_build/doc/xml') @staticmethod def get_xml_path_if_exists(name: str, kind: DocumentationObjectKind) -> Optional[Path]: @@ -57,25 +57,6 @@ class MethodDocSignature: is_const: bool is_static: bool - def post_process_type(self, t: str) -> str: - res = '' - if '::' not in t: - res = t - else: - # TODO: this kind of workaround works when you have no template - is_const = 'const' in t - is_rvalue = '&&' in t - is_ref = not is_rvalue and '&' in t - is_ptr = '*' in t - last_name = t.split('::')[-1] - res = 'const' if is_const else '' - res += last_name - res += '&&' if is_rvalue else '' - res += '&' if is_ref else '' - res += '*' if is_ptr else '' - return res.replace(' ', '') - - def __init__(self, name, ret, params, is_const, is_static): self.name = name.replace(' ', '') self.ret = ret.replace(' ', '') @@ -138,7 +119,7 @@ def process_mixed_container(container: MixedContainer, level: int) -> str: kind = container.value.kind if kind == 'note': res += '\n' + indent_str + '.. note:: ' + item_content + '\n' + indent_str - elif kind == 'warning': + elif kind == 'warning' or kind == 'attention': res += '\n' + indent_str + '.. warning:: ' + item_content + '\n' + indent_str elif kind == 'see': res += '\n' + indent_str + '.. note:: See' + item_content + '\n' + indent_str @@ -163,7 +144,8 @@ def process_mixed_container(container: MixedContainer, level: int) -> str: res += code + '\n\n' return res - + # if container.name == 'parameterlist': + # return '' if container.name == 'itemizedlist': items: List[doxmlparser.docListItemType] = container.value.listitem @@ -231,21 +213,26 @@ def __init__(self, path: Optional[Path], env_mapping: Dict[str, str]): get_type(method.return_type, {}, env_mapping) or '', # Don't use specializations so that we can match with doc [get_type(param.type, {}, env_mapping) or '' for param in method.parameters], method.const, method.static) - methods_res[(compounddef.get_compoundname(), signature)] = method_def + key = (compounddef.get_compoundname(), signature) + if key in methods_res: + num_paras = len(method_def.detaileddescription.para) + len(method_def.briefdescription.para) + if num_paras > 0: # Doxygen adds some empty memberdefs in addition to the ones where the doc is defined... + methods_res[key] = method_def + else: + methods_res[key] = method_def self.elements = DocElements(compounddefs_res, methods_res) - - - - def get_documentation_for_class(self, name: str, cpp_ref_to_python: Dict[str, str], specs: Dict[str, str]) -> Optional[ClassDocumentation]: compounddef = self.elements.compounddefs.get(name) - if compounddef is None: return None - cls_str = self.generate_class_description_string(compounddef) + cls_str = to_cstring(self.generate_class_description_string(compounddef)) return ClassDocumentation(cls_str) + def generate_class_description_string(self, compounddef: compounddefType) -> str: + brief = process_description(compounddef.get_briefdescription()) + detailed = process_description(compounddef.get_detaileddescription()) + return brief + '\n\n' + detailed def get_documentation_for_method(self, cls_name: str, signature: MethodDocSignature, cpp_ref_to_python: Dict[str, str], specs: Dict[str, str]) -> Optional[MethodDocumentation]: method_def = self.elements.methods.get((cls_name, signature)) @@ -254,19 +241,36 @@ def get_documentation_for_method(self, cls_name: str, signature: MethodDocSignat print([k[1] for k in self.elements.methods.keys() if k[1].name == signature.name]) return None descr = self.generate_method_description_string(method_def) - return MethodDocumentation(descr) - - - - def generate_class_description_string(self, compounddef: compounddefType) -> str: - brief = process_description(compounddef.get_briefdescription()) - detailed = process_description(compounddef.get_detaileddescription()) - return to_cstring(brief + '\n\n' + detailed) + param_str = self.generate_method_params_string(method_def) + return_str = '' + res = to_cstring(descr + param_str + return_str) + return MethodDocumentation(res) def generate_method_description_string(self, method_def: doxmlparser.memberdefType) -> str: brief = process_description(method_def.get_briefdescription()) detailed = process_description(method_def.get_detaileddescription()) - return to_cstring(brief + '\n\n' + detailed) + return brief + '\n\n' + detailed + + def generate_method_params_string(self, method_def: doxmlparser.memberdefType) -> str: + parameter_list_full: List[doxmlparser.docParamListItem] = [] + paras: List[doxmlparser.docParaType] = method_def.detaileddescription.para + method_def.inbodydescription.para + method_def.briefdescription.para + print(method_def.get_name(), method_def.detaileddescription.content_) + for x in method_def.detaileddescription.content_: + print(x.value) + for paragraph in paras: + print(method_def.get_name(), 'content types') + print(method_def.get_name(), process_paragraph(paragraph, 0)) + if paragraph.parameterlist is not None: + parameter_lists: List[doxmlparser.docParamListType] = paragraph.parameterlist + print(method_def.get_name(), 'found a parameterlist') + assert isinstance(parameter_lists, list) + for param_list in parameter_lists: + parameter_list_full.extend(param_list.parameteritem) + + print(method_def.get_name(), parameter_list_full) + params_str = '' + return params_str + if __name__ == '__main__': diff --git a/modules/python/generator/header.py b/modules/python/generator/header.py index c010ecba42..ebe212b2ab 100644 --- a/modules/python/generator/header.py +++ b/modules/python/generator/header.py @@ -141,9 +141,9 @@ def run_preprocessor(self): # TODO: run without generating a new file '', '-D', 'vp_deprecated=', '-D', 'VISP_EXPORT=', - '-I', '/home/sfelton/visp_build/include', + '-I', '/home/sfelton/software/visp_build/include', '-I', '/usr/local/include', - '-I', '/usr/include', + #'-I', '/usr/include', '-N', 'VISP_BUILD_DEPRECATED_FUNCTIONS', '--passthru-includes', "^((?!vpConfig.h).)*$", '--passthru-unfound-includes', diff --git a/modules/python/generator/submodule.py b/modules/python/generator/submodule.py index fd49085f6b..9236e71fe2 100644 --- a/modules/python/generator/submodule.py +++ b/modules/python/generator/submodule.py @@ -152,5 +152,5 @@ def get_submodules(include_path: Path, generate_path: Path) -> List[Submodule]: modules = ['core', 'vision', 'visual_features', 'vs', 'sensor', 'io'] result = [] for module in modules: - result.append(Submodule(module, Path(f'/home/sfelton/visp-sfelton/modules/{module}/include/visp3/{module}'), generate_path / f'{module}.cpp')) + result.append(Submodule(module, Path(f'/home/sfelton/software/visp-sfelton/modules/{module}/include/visp3/{module}'), generate_path / f'{module}.cpp')) return result From 3c4699434ee9bacb6e6e8a998a3ed6a088f1810a Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Tue, 26 Sep 2023 02:39:00 +0200 Subject: [PATCH 048/169] json report generation, finally outputting parameters in function docstring --- modules/python/config/io.json | 3 +- modules/python/generator/doc_parser.py | 33 ++++++++++---------- modules/python/generator/gen_report.py | 43 ++++++++++++++++++++++++++ modules/python/generator/header.py | 17 ++++++++-- modules/python/generator/methods.py | 17 +++++----- modules/python/generator/submodule.py | 10 +++++- modules/python/generator/utils.py | 27 +++++++++++----- 7 files changed, 114 insertions(+), 36 deletions(-) create mode 100644 modules/python/generator/gen_report.py diff --git a/modules/python/config/io.json b/modules/python/config/io.json index e7576a7e17..83f86f3ab1 100644 --- a/modules/python/config/io.json +++ b/modules/python/config/io.json @@ -1,3 +1,4 @@ { - "ignored_headers": ["vpParallelPortException.h"] + "ignored_headers": ["vpParallelPortException.h"], + "ignored_classes": ["vpJsonArgumentParser", "vpParseArgv"] } \ No newline at end of file diff --git a/modules/python/generator/doc_parser.py b/modules/python/generator/doc_parser.py index 1f2d56173d..91ee581f0c 100644 --- a/modules/python/generator/doc_parser.py +++ b/modules/python/generator/doc_parser.py @@ -23,7 +23,7 @@ class DocumentationObjectKind(Enum): Method = 'method' class DocumentationData(object): - documentation_xml_location: Optional[Path] = Path('/home/sfelton/software/visp_build/doc/xml') + documentation_xml_location: Optional[Path] = Path('/home/sfelton/visp_build/doc/xml') @staticmethod def get_xml_path_if_exists(name: str, kind: DocumentationObjectKind) -> Optional[Path]: @@ -144,8 +144,8 @@ def process_mixed_container(container: MixedContainer, level: int) -> str: res += code + '\n\n' return res - # if container.name == 'parameterlist': - # return '' + if container.name == 'parameterlist': # Parameter list is ignored since we have custom parsing for it + return '' if container.name == 'itemizedlist': items: List[doxmlparser.docListItemType] = container.value.listitem @@ -180,7 +180,7 @@ def __init__(self, path: Optional[Path], env_mapping: Dict[str, str]): self.elements = None if not import_failed and DocumentationData.documentation_xml_location is not None: if not self.xml_path.exists(): - print(f'Could not find documentation file for name {name} when looking in {str(path)}') + print(f'Could not find documentation when looking in {str(path)}') else: self.xml_doc = doxmlparser.compound.parse(str(path), True, False) compounddefs_res = {} @@ -243,7 +243,7 @@ def get_documentation_for_method(self, cls_name: str, signature: MethodDocSignat descr = self.generate_method_description_string(method_def) param_str = self.generate_method_params_string(method_def) return_str = '' - res = to_cstring(descr + param_str + return_str) + res = to_cstring('\n\n'.join([descr, param_str, return_str])) return MethodDocumentation(res) def generate_method_description_string(self, method_def: doxmlparser.memberdefType) -> str: @@ -254,12 +254,7 @@ def generate_method_description_string(self, method_def: doxmlparser.memberdefTy def generate_method_params_string(self, method_def: doxmlparser.memberdefType) -> str: parameter_list_full: List[doxmlparser.docParamListItem] = [] paras: List[doxmlparser.docParaType] = method_def.detaileddescription.para + method_def.inbodydescription.para + method_def.briefdescription.para - print(method_def.get_name(), method_def.detaileddescription.content_) - for x in method_def.detaileddescription.content_: - print(x.value) for paragraph in paras: - print(method_def.get_name(), 'content types') - print(method_def.get_name(), process_paragraph(paragraph, 0)) if paragraph.parameterlist is not None: parameter_lists: List[doxmlparser.docParamListType] = paragraph.parameterlist print(method_def.get_name(), 'found a parameterlist') @@ -267,12 +262,16 @@ def generate_method_params_string(self, method_def: doxmlparser.memberdefType) - for param_list in parameter_lists: parameter_list_full.extend(param_list.parameteritem) - print(method_def.get_name(), parameter_list_full) - params_str = '' - return params_str - + params_dict = {} + for param_info in parameter_list_full: + from functools import reduce + name_list: List[doxmlparser.compound.docParamName] = reduce(lambda all, pnl: all + pnl.parametername, param_info.parameternamelist, []) + param_descr: doxmlparser.compound.descriptionType = param_info.parameterdescription + param_descr_str = ' '.join(map(lambda para: process_paragraph(para, 0), param_descr.para)).lstrip(': ') + for param_name in name_list: + params_dict[param_name.valueOf_] = param_descr_str + param_strs = [f':param {name}: {descr}' for name, descr in params_dict.items()] + print(method_def.get_name(), parameter_list_full) -if __name__ == '__main__': - name = 'vpBSpline' - print(DocumentationHolder(name, DocumentationObjectKind.Class, {}).documentation_dict[name]) \ No newline at end of file + return '\n'.join(param_strs) diff --git a/modules/python/generator/gen_report.py b/modules/python/generator/gen_report.py new file mode 100644 index 0000000000..af5df0bcaa --- /dev/null +++ b/modules/python/generator/gen_report.py @@ -0,0 +1,43 @@ +from typing import Callable, List, Optional, Set, Tuple, Dict, Union +from cxxheaderparser.parserstate import ClassBlockState, State +import pcpp +import cxxheaderparser +from cxxheaderparser import types +from cxxheaderparser.simple import NamespaceScope, ClassScope +from utils import * +from methods import NotGeneratedReason, RejectedMethod +class Report(object): + def __init__(self, submodule: 'Submodule'): + self.submodule_name = submodule.name + self.result = { + 'ignored_headers': [], + 'classes': {}, + 'methods': {} + } + + def add_ignored_header(self, path: Path) -> None: + self.result['ignored_headers'].append(str(path)) + + def add_non_generated_class(self, cls_name: str, config: Dict, reason: str) -> None: + self.result['classes'][cls_name] = { + 'reason': reason + } + + def add_non_generated_method(self, method: RejectedMethod) -> None: + if NotGeneratedReason.is_non_trivial_reason(method.rejection_reason): + proposed_help = { + 'static': method.method.static, + 'signature': method.signature, + 'ignored': True + } + report_dict = { + 'reason': method.rejection_reason.value, + 'fix': proposed_help + } + if method.cls_name is not None: + report_dict['class'] = method.cls_name + self.result['methods'][method.signature] = report_dict + def write(self, path: Path) -> None: + import pprint; pprint.pprint(self.result) + with open(path, 'w') as report_file: + json.dump(self.result, report_file, indent=2) diff --git a/modules/python/generator/header.py b/modules/python/generator/header.py index ebe212b2ab..d52a22cb4d 100644 --- a/modules/python/generator/header.py +++ b/modules/python/generator/header.py @@ -12,6 +12,10 @@ from methods import * from doc_parser import * +from typing import TYPE_CHECKING +if TYPE_CHECKING: + from submodule import Submodule + def filter_includes(include_names: Set[str]) -> List[str]: @@ -141,9 +145,9 @@ def run_preprocessor(self): # TODO: run without generating a new file '', '-D', 'vp_deprecated=', '-D', 'VISP_EXPORT=', - '-I', '/home/sfelton/software/visp_build/include', + '-I', '/home/sfelton/visp_build/include', '-I', '/usr/local/include', - #'-I', '/usr/include', + '-I', '/usr/include', '-N', 'VISP_BUILD_DEPRECATED_FUNCTIONS', '--passthru-includes', "^((?!vpConfig.h).)*$", '--passthru-unfound-includes', @@ -226,6 +230,7 @@ def generate_class_with_potiental_specialization(name_python: str, owner_specs: # Display rejected methods rejection_strs = [] for rejected_method in rejected_methods: + self.submodule.report.add_non_generated_method(rejected_method) if NotGeneratedReason.is_non_trivial_reason(rejected_method.rejection_reason): rejection_strs.append(f'\t{rejected_method.signature} was rejected! Reason: {rejected_method.rejection_reason}') if len(rejection_strs) > 0: @@ -244,6 +249,7 @@ def generate_class_with_potiental_specialization(name_python: str, owner_specs: for method, method_config in constructors: params_strs = [get_type(param.type, owner_specs, header_env.mapping) for param in method.parameters] py_arg_strs = [f'py::arg("{param.name}")' for param in method.parameters] + print(name_cpp, py_arg_strs, params_strs) ctor_str = f'''{python_ident}.{define_constructor(params_strs, py_arg_strs)};''' method_strs.append(ctor_str) @@ -255,8 +261,11 @@ def generate_class_with_potiental_specialization(name_python: str, owner_specs: method_name = get_name(method.name) method_is_const = method.const params_strs = [get_type(param.type, owner_specs, header_env.mapping) for param in method.parameters] + return_type_str = get_type(method.return_type, owner_specs, header_env.mapping) if len(params_strs) > 1: print(f'Found operator {name_cpp}{method_name} with more than one parameter, skipping') + rejection = RejectedMethod(name_cpp, method, method_config, get_method_signature(method_name, return_type_str, params_strs), NotGeneratedReason.NotHandled) + self.submodule.report.add_non_generated_method(rejection) continue elif len(params_strs) < 1: print(f'Found unary operator {name_cpp}::{method_name}, skipping') @@ -279,7 +288,6 @@ def generate_class_with_potiental_specialization(name_python: str, owner_specs: method_strs.append(operator_str) break - def define_classical_method(method: types.Method, method_config, specs): params_strs = [get_type(param.type, specs, header_env.mapping) for param in method.parameters] py_arg_strs = [f'py::arg("{param.name}")' for param in method.parameters] @@ -289,6 +297,7 @@ def define_classical_method(method: types.Method, method_config, specs): return_type = get_type(method.return_type, specs, header_env.mapping) if self.documentation_holder is not None: + print(method_name, params_strs) method_doc_signature = MethodDocSignature(method_name, get_type(method.return_type, {}, header_env.mapping), # Don't use specializations so that we can match with doc [get_type(param.type, {}, header_env.mapping) for param in method.parameters], @@ -357,6 +366,7 @@ def define_classical_method(method: types.Method, method_config, specs): print(f'Parsing class "{name_cpp_no_template}"') if self.submodule.class_should_be_ignored(name_cpp_no_template): + self.submodule.report.add_non_generated_class(name_cpp_no_template, {}, 'Skipped by user') return '' cls_config = self.submodule.get_class_config(name_cpp_no_template) @@ -366,6 +376,7 @@ def define_classical_method(method: types.Method, method_config, specs): else: if cls_config is None or 'specializations' not in cls_config or len(cls_config['specializations']) == 0: print(f'Could not find template specialization for class {name_cpp_no_template}: skipping!') + self.submodule.report.add_non_generated_class(name_cpp_no_template, cls_config, 'Skipped because there was no declared specializations') return '' else: specialization_strs = [] diff --git a/modules/python/generator/methods.py b/modules/python/generator/methods.py index 10f5e33f0c..7f9d826e89 100644 --- a/modules/python/generator/methods.py +++ b/modules/python/generator/methods.py @@ -11,6 +11,10 @@ from dataclasses import dataclass from enum import Enum +from typing import TYPE_CHECKING +if TYPE_CHECKING: + from submodule import Submodule + def cpp_operator_list(): ''' List of cpp methods that are considered operators. @@ -101,7 +105,7 @@ def define_constructor(params: List[str], additional_args: List[str]) -> str: additional_args_str = ', '.join(additional_args) if len(additional_args) > 0: additional_args_str = ', ' + additional_args_str - + print(params) return f'def(py::init<{", ".join(params)}>(){additional_args_str})' @@ -113,12 +117,14 @@ class NotGeneratedReason(Enum): ArgumentType = 'argument_type' PureVirtual = 'pure_virtual' UnspecifiedTemplateSpecialization = 'missing_template' + NotHandled = 'not_handled' @staticmethod def is_non_trivial_reason(reason: 'NotGeneratedReason') -> bool: return reason in [NotGeneratedReason.ArgumentType, NotGeneratedReason.ReturnType, - NotGeneratedReason.UnspecifiedTemplateSpecialization] + NotGeneratedReason.UnspecifiedTemplateSpecialization, + NotGeneratedReason.NotHandled] @dataclass class RejectedMethod: @@ -128,9 +134,6 @@ class RejectedMethod: signature: str rejection_reason: NotGeneratedReason - - - def get_bindable_methods_with_config(submodule: 'Submodule', methods: List[types.Method], cls_name: str, specializations, mapping) -> Tuple[List[Tuple[types.Method, Dict]], List[RejectedMethod]]: bindable_methods = [] rejected_methods = [] @@ -141,8 +144,8 @@ def get_bindable_methods_with_config(submodule: 'Submodule', methods: List[types (lambda m, _: m.access is None or m.access != 'public', NotGeneratedReason.Access), (lambda m, _: m.destructor, NotGeneratedReason.Destructor), (lambda m, conf: m.template is not None and (conf.get('specializations') is None or len(conf['specializations']) == 0), NotGeneratedReason.UnspecifiedTemplateSpecialization), - (lambda m, _: any(get_type(param.type, specializations, mapping) is None for param in m.parameters), NotGeneratedReason.ArgumentType), - (lambda m, _: not m.constructor and get_type(m.return_type, specializations, mapping) is None, NotGeneratedReason.ReturnType) + (lambda m, _: any(is_unsupported_argument_type(param.type) for param in m.parameters), NotGeneratedReason.ArgumentType), + (lambda m, _: not m.constructor and is_unsupported_return_type(m.return_type), NotGeneratedReason.ReturnType) ] for method in methods: method_config = submodule.get_method_config(cls_name, method, specializations, mapping) diff --git a/modules/python/generator/submodule.py b/modules/python/generator/submodule.py index 9236e71fe2..6863bf567b 100644 --- a/modules/python/generator/submodule.py +++ b/modules/python/generator/submodule.py @@ -10,6 +10,7 @@ from header import HeaderFile, sort_headers, filter_includes from utils import * +from gen_report import Report class Submodule(): def __init__(self, name: str, include_path: Path, submodule_file_path: Path): @@ -19,6 +20,7 @@ def __init__(self, name: str, include_path: Path, submodule_file_path: Path): self.config_path = Path('config') / (name + '.json') with open(self.config_path, 'r') as config_file: self.config = json.load(config_file) + self.report = Report(self) self.headers = self._get_headers() assert self.include_path.exists(), f'Submodule path {self.include_path} not found' @@ -28,15 +30,20 @@ def _get_headers(self) -> List[HeaderFile]: if not include_file.name.endswith('.h') and not include_file.name.endswith('.hpp'): continue if self.header_should_be_ignored(include_file.name): + self.report.add_ignored_header(include_file) continue headers.append(HeaderFile(include_file, self)) return headers def set_headers_from_common_list(self, all_headers: List[HeaderFile]) -> None: + ''' + Set the submodule's headers from a list containing headers from multiple modules + ''' new_headers = [] for header in all_headers: if header.submodule.name == self.name: new_headers.append(header) + header.submodule = self self.headers = new_headers def generate(self) -> None: @@ -91,6 +98,7 @@ def generate(self) -> None: ''' with open(self.submodule_file_path, 'w') as submodule_file: submodule_file.write(format_str) + self.report.write(Path(f'build/{self.name}_log.json')) def generation_function_name(self) -> str: return f'init_submodule_{self.name}' @@ -152,5 +160,5 @@ def get_submodules(include_path: Path, generate_path: Path) -> List[Submodule]: modules = ['core', 'vision', 'visual_features', 'vs', 'sensor', 'io'] result = [] for module in modules: - result.append(Submodule(module, Path(f'/home/sfelton/software/visp-sfelton/modules/{module}/include/visp3/{module}'), generate_path / f'{module}.cpp')) + result.append(Submodule(module, Path(f'/home/sfelton/visp-sfelton/modules/{module}/include/visp3/{module}'), generate_path / f'{module}.cpp')) return result diff --git a/modules/python/generator/utils.py b/modules/python/generator/utils.py index e545ae70be..5942c4004a 100644 --- a/modules/python/generator/utils.py +++ b/modules/python/generator/utils.py @@ -45,9 +45,6 @@ def get_type(param: Union[types.FunctionType, types.DecoratedType, types.Value], if split[0] in header_env_mapping: split[0] = header_env_mapping[split[0]] repr_str = '<'.join(split) - if repr_str == 'vpRobust::vpRobustEstimatorType': - print('aaaaaaaaaaaa') - print(param) if param.const: repr_str = 'const ' + repr_str return repr_str @@ -57,13 +54,25 @@ def get_type(param: Union[types.FunctionType, types.DecoratedType, types.Value], return repr_str + '&' else: return None + elif isinstance(param, types.MoveReference): + repr_str = get_type(param.moveref_to, owner_specs, header_env_mapping) + if repr_str is not None: + return repr_str + '&&' + else: + return None + elif isinstance(param, types.Pointer): + repr_str = get_type(param.ptr_to, owner_specs, header_env_mapping) + if repr_str is not None: + return repr_str + '*' + else: + return None else: return None def is_pointer_to_const_cstr(param: types.Pointer) -> bool: ptr_to = param.ptr_to if isinstance(ptr_to, types.Type): - if get_typename(ptr_to, {}, {}) == 'char' and ptr_to.const: + if get_typename(ptr_to.typename, {}, {}) == 'char' and ptr_to.const: return True return False @@ -80,9 +89,12 @@ def is_unsupported_return_type(param: Union[types.FunctionType, types.DecoratedT if isinstance(param, types.Type): return False if isinstance(param, types.Reference): + return is_unsupported_return_type(param.ref_to) + if isinstance(param, types.MoveReference): return False if isinstance(param, types.Pointer): return not is_pointer_to_const_cstr(param) + return True def is_unsupported_argument_type(param: Union[types.FunctionType, types.DecoratedType]) -> bool: ''' @@ -96,11 +108,12 @@ def is_unsupported_argument_type(param: Union[types.FunctionType, types.Decorate if isinstance(param, types.Type): return False if isinstance(param, types.Reference): - return False + return is_unsupported_argument_type(param.ref_to) + if isinstance(param, types.MoveReference): + return True if isinstance(param, types.Pointer): return not is_pointer_to_const_cstr(param) - - + return True def get_method_signature(name: str, return_type: str, params: List[str]) -> str: return f'{return_type} {name}({", ".join(params)})' From e3bdb9ae38e655b7ec7b00d52cccd16ba19820a7 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Tue, 26 Sep 2023 17:41:00 +0200 Subject: [PATCH 049/169] return type documentation, detect refs to python immutable types --- .../docs/_templates/custom-class-template.rst | 2 +- modules/python/docs/conf.py | 4 +- modules/python/generator/doc_parser.py | 34 +++++++---- modules/python/generator/gen_report.py | 1 - modules/python/generator/generator.py | 54 ++++++++++------- modules/python/generator/header.py | 19 +++--- modules/python/generator/methods.py | 1 - modules/python/generator/submodule.py | 4 +- modules/python/generator/utils.py | 59 ++++++++++++++++++- 9 files changed, 127 insertions(+), 51 deletions(-) diff --git a/modules/python/docs/_templates/custom-class-template.rst b/modules/python/docs/_templates/custom-class-template.rst index 058299e716..4b77aa1a18 100644 --- a/modules/python/docs/_templates/custom-class-template.rst +++ b/modules/python/docs/_templates/custom-class-template.rst @@ -44,7 +44,7 @@ .. autosummary:: :nosignatures: {% for item in members %} - {%- if item.startswith('__') and item.endswith('__') and item not in ['__new__', '__repr__', '__hash__', '__init__', '__doc__', '__module__'] %} + {%- if item.startswith('__') and item.endswith('__') and item not in ['__new__', '__repr__', '__hash__', '__init__', '__doc__', '__module__', '__reduce__', '__reduce_ex__', '__subclasshook__'] %} ~{{ name }}.{{ item }} {%- endif -%} {%- endfor %} diff --git a/modules/python/docs/conf.py b/modules/python/docs/conf.py index 085699549e..d35c94494e 100644 --- a/modules/python/docs/conf.py +++ b/modules/python/docs/conf.py @@ -58,10 +58,10 @@ autoclass_content = "both" # Add __init__ doc (ie. params) to class summaries html_show_sourcelink = False # Remove 'view source code' from top of page (for html, not python) autodoc_inherit_docstrings = True # If no docstring, inherit from base class -autodoc_member_order = 'groupwise' set_type_checking_flag = True # Enable 'expensive' imports for sphinx_autodoc_typehints nbsphinx_allow_errors = True # Continue through Jupyter errors -#autodoc_typehints = "description" # Sphinx-native method. Not as good as sphinx_autodoc_typehints + +autodoc_typehints = "both" # Sphinx-native method. Not as good as sphinx_autodoc_typehints add_module_names = False # Remove namespaces from class/method signatures diff --git a/modules/python/generator/doc_parser.py b/modules/python/generator/doc_parser.py index 91ee581f0c..795a39f1d1 100644 --- a/modules/python/generator/doc_parser.py +++ b/modules/python/generator/doc_parser.py @@ -23,7 +23,7 @@ class DocumentationObjectKind(Enum): Method = 'method' class DocumentationData(object): - documentation_xml_location: Optional[Path] = Path('/home/sfelton/visp_build/doc/xml') + documentation_xml_location: Optional[Path] = Path('/home/sfelton/software/visp_build/doc/xml') @staticmethod def get_xml_path_if_exists(name: str, kind: DocumentationObjectKind) -> Optional[Path]: @@ -123,6 +123,8 @@ def process_mixed_container(container: MixedContainer, level: int) -> str: res += '\n' + indent_str + '.. warning:: ' + item_content + '\n' + indent_str elif kind == 'see': res += '\n' + indent_str + '.. note:: See' + item_content + '\n' + indent_str + elif kind == 'return': # Don't do anything, we will parse them separately when we get method documentation + return '' else: res += '\n' + f'' return res + '\n' @@ -237,12 +239,17 @@ def generate_class_description_string(self, compounddef: compounddefType) -> str def get_documentation_for_method(self, cls_name: str, signature: MethodDocSignature, cpp_ref_to_python: Dict[str, str], specs: Dict[str, str]) -> Optional[MethodDocumentation]: method_def = self.elements.methods.get((cls_name, signature)) if method_def is None: - print(f'method {signature} not found') - print([k[1] for k in self.elements.methods.keys() if k[1].name == signature.name]) return None + descr = self.generate_method_description_string(method_def) - param_str = self.generate_method_params_string(method_def) - return_str = '' + + params_dict = self.get_method_params(method_def) + param_strs = [f':param {name}: {descr}' for name, descr in params_dict.items()] + param_str = '\n'.join(param_strs) + + cpp_return_str = self.get_method_return_str(method_def) + return_str = f':return: {cpp_return_str}' if len(cpp_return_str) > 0 else '' + res = to_cstring('\n\n'.join([descr, param_str, return_str])) return MethodDocumentation(res) @@ -251,13 +258,12 @@ def generate_method_description_string(self, method_def: doxmlparser.memberdefTy detailed = process_description(method_def.get_detaileddescription()) return brief + '\n\n' + detailed - def generate_method_params_string(self, method_def: doxmlparser.memberdefType) -> str: + def get_method_params(self, method_def: doxmlparser.memberdefType) -> Dict[str, str]: parameter_list_full: List[doxmlparser.docParamListItem] = [] paras: List[doxmlparser.docParaType] = method_def.detaileddescription.para + method_def.inbodydescription.para + method_def.briefdescription.para for paragraph in paras: if paragraph.parameterlist is not None: parameter_lists: List[doxmlparser.docParamListType] = paragraph.parameterlist - print(method_def.get_name(), 'found a parameterlist') assert isinstance(parameter_lists, list) for param_list in parameter_lists: parameter_list_full.extend(param_list.parameteritem) @@ -270,8 +276,14 @@ def generate_method_params_string(self, method_def: doxmlparser.memberdefType) - param_descr_str = ' '.join(map(lambda para: process_paragraph(para, 0), param_descr.para)).lstrip(': ') for param_name in name_list: params_dict[param_name.valueOf_] = param_descr_str + return params_dict - param_strs = [f':param {name}: {descr}' for name, descr in params_dict.items()] - print(method_def.get_name(), parameter_list_full) - - return '\n'.join(param_strs) + def get_method_return_str(self, method_def: doxmlparser.memberdefType) -> Dict[str, str]: + paras: List[doxmlparser.docParaType] = method_def.detaileddescription.para + method_def.inbodydescription.para + method_def.briefdescription.para + return_str = '' + for paragraph in paras: + sections: List[doxmlparser.docSimpleSectType] = paragraph.simplesect + for sect in sections: + if sect.kind == 'return': + return_str += ' '.join(map(lambda para: process_paragraph(para, 0), sect.para)) + return return_str diff --git a/modules/python/generator/gen_report.py b/modules/python/generator/gen_report.py index af5df0bcaa..a3edfcaa89 100644 --- a/modules/python/generator/gen_report.py +++ b/modules/python/generator/gen_report.py @@ -38,6 +38,5 @@ def add_non_generated_method(self, method: RejectedMethod) -> None: report_dict['class'] = method.cls_name self.result['methods'][method.signature] = report_dict def write(self, path: Path) -> None: - import pprint; pprint.pprint(self.result) with open(path, 'w') as report_file: json.dump(self.result, report_file, indent=2) diff --git a/modules/python/generator/generator.py b/modules/python/generator/generator.py index fa34eb2b22..08809103d7 100644 --- a/modules/python/generator/generator.py +++ b/modules/python/generator/generator.py @@ -1,13 +1,7 @@ +import sys from typing import List, Optional, Set, Tuple, Dict, Union -from cxxheaderparser.parserstate import ClassBlockState, State -import pcpp -import cxxheaderparser -from cxxheaderparser.visitor import CxxVisitor -from cxxheaderparser import types -from cxxheaderparser.simple import parse_string, ParsedData, NamespaceScope, ClassScope from pathlib import Path -import json -from tqdm.contrib.concurrent import process_map + from header import * from submodule import * @@ -16,28 +10,56 @@ def header_preprocess(header: HeaderFile): header.preprocess() return header +def main_str(submodule_fn_declarations, submodule_fn_calls): + ''' + Main binding generation content + :param submodule_fn_declarations: declaration of the functions that bind the submodules + :param submodule_fn_calls: Calls to the functions declared above + + ''' + return f''' +#include +namespace py = pybind11; +{submodule_fn_declarations} + +PYBIND11_MODULE(visp, m) +{{ + m.doc() = "ViSP Python binding"; + + {submodule_fn_calls} +}} +''' def generate_module(generate_path: Path) -> None: - main_path = generate_path / 'main.cpp' + include_path = Path('/usr/local/include/visp3') submodules: List[Submodule] = get_submodules(include_path, generate_path / 'generated') + # Step 1: Preprocess all headers all_headers: List[HeaderFile] = [] for submodule in submodules: all_headers.extend(submodule.headers) + + # Parallel processing of headers to speedup this step from tqdm import tqdm with Pool() as pool: new_all_headers = [] for result in list(tqdm(pool.imap(header_preprocess, all_headers), total=len(all_headers), file=sys.stderr)): new_all_headers.append(result) + # Sort headers according to the dependencies. This is done across all modules. + # TODO: sort module generation order. For now this works but it's fairly brittle new_all_headers = sort_headers(new_all_headers) for submodule in submodules: submodule.set_headers_from_common_list(new_all_headers) + # Step 2: generate the binding code for each submodule + # Each submodule write to its own file(s) its binding code for submodule in submodules: submodule.generate() + # Step 3: write to main.cpp the call to the submodule binding implementations. + main_path = generate_path / 'main.cpp' with open(main_path, 'w') as main_file: submodule_fn_declarations = [] submodule_fn_calls = [] @@ -49,20 +71,8 @@ def generate_module(generate_path: Path) -> None: submodule_fn_declarations = '\n'.join(submodule_fn_declarations) submodule_fn_calls = '\n'.join(submodule_fn_calls) - format_str = f''' -#include -namespace py = pybind11; -{submodule_fn_declarations} - -PYBIND11_MODULE(visp, m) -{{ - m.doc() = "ViSP Python binding"; - - {submodule_fn_calls} -}} -''' + format_str = main_str(submodule_fn_declarations, submodule_fn_calls) main_file.write(format_str) if __name__ == '__main__': - import sys generate_module(Path('src')) \ No newline at end of file diff --git a/modules/python/generator/header.py b/modules/python/generator/header.py index d52a22cb4d..ebbd5bd772 100644 --- a/modules/python/generator/header.py +++ b/modules/python/generator/header.py @@ -145,9 +145,9 @@ def run_preprocessor(self): # TODO: run without generating a new file '', '-D', 'vp_deprecated=', '-D', 'VISP_EXPORT=', - '-I', '/home/sfelton/visp_build/include', + '-I', '/home/sfelton/software/visp_build/include', '-I', '/usr/local/include', - '-I', '/usr/include', + #'-I', '/usr/include', '-N', 'VISP_BUILD_DEPRECATED_FUNCTIONS', '--passthru-includes', "^((?!vpConfig.h).)*$", '--passthru-unfound-includes', @@ -249,7 +249,6 @@ def generate_class_with_potiental_specialization(name_python: str, owner_specs: for method, method_config in constructors: params_strs = [get_type(param.type, owner_specs, header_env.mapping) for param in method.parameters] py_arg_strs = [f'py::arg("{param.name}")' for param in method.parameters] - print(name_cpp, py_arg_strs, params_strs) ctor_str = f'''{python_ident}.{define_constructor(params_strs, py_arg_strs)};''' method_strs.append(ctor_str) @@ -291,20 +290,23 @@ def generate_class_with_potiental_specialization(name_python: str, owner_specs: def define_classical_method(method: types.Method, method_config, specs): params_strs = [get_type(param.type, specs, header_env.mapping) for param in method.parameters] py_arg_strs = [f'py::arg("{param.name}")' for param in method.parameters] - method_name = get_name(method.name) py_method_name = method_config.get('custom_name') or method_name + contains_ref_to_immut = any(map(lambda param: is_non_const_ref_to_immutable_type(param.type), method.parameters)) + if contains_ref_to_immut: + print(f'REF TO IMMUT in method {method_name} parameters') return_type = get_type(method.return_type, specs, header_env.mapping) if self.documentation_holder is not None: - print(method_name, params_strs) method_doc_signature = MethodDocSignature(method_name, get_type(method.return_type, {}, header_env.mapping), # Don't use specializations so that we can match with doc [get_type(param.type, {}, header_env.mapping) for param in method.parameters], method.const, method.static) method_doc = self.documentation_holder.get_documentation_for_method(name_cpp_no_template, method_doc_signature, {}, specs) - print(f'Fetching documentation for {method_name}: {"Found" if method_doc is not None else "Not found"}') - py_arg_strs = py_arg_strs if method_doc is None else [method_doc.documentation] + py_arg_strs + if method_doc is None: + print(f'Could not find documentation for {name_cpp}::{method_name}!') + else: + py_arg_strs = [method_doc.documentation] + py_arg_strs method_ref_str = ref_to_class_method(method, name_cpp, method_name, return_type, params_strs) method_str = define_method(py_method_name, method_ref_str, py_arg_strs, method.static) @@ -345,7 +347,7 @@ def define_classical_method(method: types.Method, method_config, specs): method_strs.append(f'{cls_config["additional_bindings"]}({python_ident});') - # Check for potential error generating definitions + # Check for potential error-generating definitions error_generating_overloads = get_static_and_instance_overloads(generated_methods) for error_overload in error_generating_overloads: print(f'Overload {error_overload} defined for instance and class, this will generate a pybind error') @@ -354,7 +356,6 @@ def define_classical_method(method: types.Method, method_config, specs): print(method_str) print() if len(error_generating_overloads) > 0: - print(error_generating_overloads) raise RuntimeError diff --git a/modules/python/generator/methods.py b/modules/python/generator/methods.py index 7f9d826e89..004ee264a3 100644 --- a/modules/python/generator/methods.py +++ b/modules/python/generator/methods.py @@ -105,7 +105,6 @@ def define_constructor(params: List[str], additional_args: List[str]) -> str: additional_args_str = ', '.join(additional_args) if len(additional_args) > 0: additional_args_str = ', ' + additional_args_str - print(params) return f'def(py::init<{", ".join(params)}>(){additional_args_str})' diff --git a/modules/python/generator/submodule.py b/modules/python/generator/submodule.py index 6863bf567b..0bec5b8362 100644 --- a/modules/python/generator/submodule.py +++ b/modules/python/generator/submodule.py @@ -79,6 +79,7 @@ def generate(self) -> None: void {self.generation_function_name()}(py::module_ &m) {{ + /* Submodule declaration */ @@ -147,7 +148,6 @@ def get_method_config(self, class_name: Optional[str], method, owner_specs, head return res tmp = tmp[k] functions_container = tmp - # print(functions_container) for function_config in functions_container: if method_matches_config(method, function_config, owner_specs, header_mapping): res.update(function_config) @@ -160,5 +160,5 @@ def get_submodules(include_path: Path, generate_path: Path) -> List[Submodule]: modules = ['core', 'vision', 'visual_features', 'vs', 'sensor', 'io'] result = [] for module in modules: - result.append(Submodule(module, Path(f'/home/sfelton/visp-sfelton/modules/{module}/include/visp3/{module}'), generate_path / f'{module}.cpp')) + result.append(Submodule(module, Path(f'/home/sfelton/software/visp-sfelton/modules/{module}/include/visp3/{module}'), generate_path / f'{module}.cpp')) return result diff --git a/modules/python/generator/utils.py b/modules/python/generator/utils.py index 5942c4004a..a59f807c4c 100644 --- a/modules/python/generator/utils.py +++ b/modules/python/generator/utils.py @@ -8,11 +8,16 @@ from pathlib import Path import json def get_name(name: types.PQName) -> str: + ''' + Get the fully qualified name of a type. + Template specializations will not appear! + ''' return '::'.join([segment.name for segment in name.segments]) def get_typename(typename: types.PQName, owner_specs, header_env_mapping) -> str: '''Resolve the string representation of a raw type, resolving template specializations and using complete typenames (aliases, shortened names when in same namescope). + This does not include constness, whether it is a pointer or a ref etc. ''' def segment_repr(segment: types.PQNameSegment) -> str: spec_str = '' @@ -35,7 +40,9 @@ def segment_repr(segment: types.PQNameSegment) -> str: return '::'.join(list(map(segment_repr, typename.segments))) def get_type(param: Union[types.FunctionType, types.DecoratedType, types.Value], owner_specs: Dict[str, str], header_env_mapping: Dict[str, str]) -> Optional[str]: - + ''' + Get the type of a parameter. Compared to get_typename, this function resolves the parameter's constness, whether it is a ref, moveref or pointer. + ''' if isinstance(param, types.Value): return ''.join([token.value for token in param.tokens]) @@ -70,6 +77,9 @@ def get_type(param: Union[types.FunctionType, types.DecoratedType, types.Value], return None def is_pointer_to_const_cstr(param: types.Pointer) -> bool: + ''' + Whether the passed in pointer is of type const char* + ''' ptr_to = param.ptr_to if isinstance(ptr_to, types.Type): if get_typename(ptr_to.typename, {}, {}) == 'char' and ptr_to.const: @@ -77,9 +87,42 @@ def is_pointer_to_const_cstr(param: types.Pointer) -> bool: return False +IMMUTABLE_TYPES = [ + 'double', 'float', + 'int', 'int32_t', 'int16_t', 'int8_t', + 'unsigned int', 'uint8_t', 'uint16_t', 'uint32_t', 'uint64_t', + 'long', 'long long', 'unsigned long', + 'unsigned char', 'char', 'std::string' +] + +IMMUTABLE_CONTAINERS = [ + 'std::vector', 'std::list' +] + +def is_non_const_ref_to_immutable_type(param: types.DecoratedType) -> bool: + ''' + Returns true if the parameter is a mutable reference to an immutable type in Python. + In python immutable types are: ints, double, string (std::string or char*) + This also takes into account STL containers that are converted from Python containers: + - a Python list is converted to a std::vector. If it is passed by ref, the changes applied to the vector are not propagated to the Python list + - Same for maps + - See https://pybind11.readthedocs.io/en/stable/advanced/cast/stl.html + ''' + if not isinstance(param, types.Reference): + return False + if param.ref_to.const: + return False + param_name = get_typename(param.ref_to.typename, {}, {}) + if param_name in IMMUTABLE_TYPES: + return True + is_immut_container = any(map(lambda c: param_name.startswith(c), IMMUTABLE_CONTAINERS)) + return is_immut_container + + + def is_unsupported_return_type(param: Union[types.FunctionType, types.DecoratedType]) -> bool: ''' - Return whether the passed param is supported as a return type for automatic code generation. + Returns whether the passed param is supported as a return type for automatic code generation. Pointers, arrays, functions are not supported. ''' if isinstance(param, types.FunctionType): @@ -116,9 +159,17 @@ def is_unsupported_argument_type(param: Union[types.FunctionType, types.Decorate return True def get_method_signature(name: str, return_type: str, params: List[str]) -> str: + ''' + Get the method signature. This does not include method constness or staticness + ''' return f'{return_type} {name}({", ".join(params)})' def method_matches_config(method: types.Method, config: Dict, owner_specs, header_mapping) -> bool: + ''' + Returns whether a method matches a configuration dict. + Matching is performed on the method signature. + The config should come from those defined in the submodule and its json file + ''' params_strs = [] if config['static'] != method.static: return False @@ -134,6 +185,10 @@ def method_matches_config(method: types.Method, config: Dict, owner_specs, heade return True def get_static_and_instance_overloads(methods: List[Tuple[str, types.Method]]) -> Set[str]: + ''' + Return the set of method names that have static and non-static versions. + This is not allowed in PyBind, so this function can be used to raise an error if the resulting set is not empty + ''' instance_methods = set([method[0] for method in methods if not method[1].static]) static_methods = set([method[0] for method in methods if method[1].static]) return instance_methods.intersection(static_methods) From 8741c588bacb10cff24a7569d7d92c3c74a2628a Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Wed, 27 Sep 2023 00:34:49 +0200 Subject: [PATCH 050/169] revert include path --- modules/python/generator/header.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/python/generator/header.py b/modules/python/generator/header.py index ebbd5bd772..40c35c2d2a 100644 --- a/modules/python/generator/header.py +++ b/modules/python/generator/header.py @@ -147,7 +147,7 @@ def run_preprocessor(self): # TODO: run without generating a new file '-D', 'VISP_EXPORT=', '-I', '/home/sfelton/software/visp_build/include', '-I', '/usr/local/include', - #'-I', '/usr/include', + '-I', '/usr/include', '-N', 'VISP_BUILD_DEPRECATED_FUNCTIONS', '--passthru-includes', "^((?!vpConfig.h).)*$", '--passthru-unfound-includes', From 0c39a7960a5d054ce3d89a576cdbe94880dc0eca Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Wed, 27 Sep 2023 17:23:59 +0200 Subject: [PATCH 051/169] add correct but naive resolution of methods that have non const refs to immutable types in python --- modules/python/CMakeLists.txt | 34 +++++++++++------------ modules/python/examples/repro_tp3.py | 5 ++-- modules/python/generator/header.py | 41 +++++++++++++++++++++++----- modules/python/generator/methods.py | 7 +++++ modules/python/generator/utils.py | 1 - 5 files changed, 61 insertions(+), 27 deletions(-) diff --git a/modules/python/CMakeLists.txt b/modules/python/CMakeLists.txt index a5c19a7e39..034b70fe9a 100644 --- a/modules/python/CMakeLists.txt +++ b/modules/python/CMakeLists.txt @@ -1,19 +1,19 @@ -# cmake_minimum_required (VERSION 3.5) -# project(visp) +cmake_minimum_required (VERSION 3.5) +project(visp) -# find_package(pybind11 REQUIRED) -# find_package(VISP 3.5.1 REQUIRED) -# include_directories(${VISP_INCLUDE_DIRS}) -# include_directories(include) -# message(${VISP_DIR}) -# string(REPLACE ";" "\n" str "${VISP_INCLUDE_DIRS}") -# message(STATUS ${str}) -# string(REPLACE ";" "\n" str "${VISP_LIBRARIES}") -# message(STATUS ${str}) -# message(${VISP_VERSION}) -# message(${pybind11_VERSION}) -# file(GLOB generated_cpp src/generated/*.cpp) -# file(GLOB static_cpp src/static/*.cpp) +find_package(pybind11 REQUIRED) +find_package(VISP REQUIRED) +include_directories(${VISP_INCLUDE_DIRS}) +include_directories(include) +message(${VISP_DIR}) +string(REPLACE ";" "\n" str "${VISP_INCLUDE_DIRS}") +message(STATUS ${str}) +string(REPLACE ";" "\n" str "${VISP_LIBRARIES}") +message(STATUS ${str}) +message(${VISP_VERSION}) +message(${pybind11_VERSION}) +file(GLOB generated_cpp src/generated/*.cpp) +file(GLOB static_cpp src/static/*.cpp) -# pybind11_add_module(visp src/main.cpp ${generated_cpp} ${static_cpp} THIN_LTO) -# target_link_libraries(visp PRIVATE ${VISP_LIBRARIES}) +pybind11_add_module(visp src/main.cpp ${generated_cpp} ${static_cpp} THIN_LTO) +target_link_libraries(visp PRIVATE ${VISP_LIBRARIES}) diff --git a/modules/python/examples/repro_tp3.py b/modules/python/examples/repro_tp3.py index d368585211..1e59aaddd2 100644 --- a/modules/python/examples/repro_tp3.py +++ b/modules/python/examples/repro_tp3.py @@ -144,13 +144,14 @@ indexInliers = np.zeros(nbPoints) inliers = [False for _ in range(len(u1s))] residual = 0.0 # TODO: this should be returned - assert Homography.ransac(u1s, v1s, u2s, v2s, c2Hc1, inliers, residual, 15, seuilOutlier, False) + succeeded, inliers, residual = Homography.ransac(u1s, v1s, u2s, v2s, c2Hc1, [], 0.0, 15, seuilOutlier, False) # Ideally we have: # succeeded, c2Hc1, inliers, residual = Homography.ransac(u1, v1, u2, v2, 12, seuilOutlier, False) # Could automatically generate # succeeded, c2Hc1, inliers, redisual = Homography.ransac(u1, v1, u2, v2, c2Hc1, inliers, residual, 12, seuilOutlier, False) - print(inliers) # TODO: inliers isn't modified by the call to ransac + print('Inliers = ', inliers) + print('Residual = ', residual) # Compute the homography with all inliers u1r = u1s[inliers] v1r = v1s[inliers] diff --git a/modules/python/generator/header.py b/modules/python/generator/header.py index 40c35c2d2a..2c64791263 100644 --- a/modules/python/generator/header.py +++ b/modules/python/generator/header.py @@ -147,7 +147,7 @@ def run_preprocessor(self): # TODO: run without generating a new file '-D', 'VISP_EXPORT=', '-I', '/home/sfelton/software/visp_build/include', '-I', '/usr/local/include', - '-I', '/usr/include', + #'-I', '/usr/include', '-N', 'VISP_BUILD_DEPRECATED_FUNCTIONS', '--passthru-includes', "^((?!vpConfig.h).)*$", '--passthru-unfound-includes', @@ -292,11 +292,8 @@ def define_classical_method(method: types.Method, method_config, specs): py_arg_strs = [f'py::arg("{param.name}")' for param in method.parameters] method_name = get_name(method.name) py_method_name = method_config.get('custom_name') or method_name - - contains_ref_to_immut = any(map(lambda param: is_non_const_ref_to_immutable_type(param.type), method.parameters)) - if contains_ref_to_immut: - print(f'REF TO IMMUT in method {method_name} parameters') return_type = get_type(method.return_type, specs, header_env.mapping) + # Fetch documentation if available if self.documentation_holder is not None: method_doc_signature = MethodDocSignature(method_name, get_type(method.return_type, {}, header_env.mapping), # Don't use specializations so that we can match with doc @@ -308,9 +305,39 @@ def define_classical_method(method: types.Method, method_config, specs): else: py_arg_strs = [method_doc.documentation] + py_arg_strs - method_ref_str = ref_to_class_method(method, name_cpp, method_name, return_type, params_strs) - method_str = define_method(py_method_name, method_ref_str, py_arg_strs, method.static) + # If a function has refs to immutable params, we need to return them. + param_is_ref_to_immut = list(map(lambda param: is_non_const_ref_to_immutable_type(param.type), method.parameters)) + contains_ref_to_immut = any(param_is_ref_to_immut) + if contains_ref_to_immut: + param_names = [param.name or 'arg' + i for i, param in enumerate(method.parameters)] + params_with_names = [t + ' ' + name for t, name in zip(params_strs, param_names)] + immutable_param_names = [param_names[i] for i in range(len(param_is_ref_to_immut)) if param_is_ref_to_immut[i]] + if not method.static: + self_param_with_name = name_cpp + '& self' + method_caller = 'self.' + else: + self_param_with_name = None + method_caller = name_cpp + '::' + + if return_type is None or return_type == 'void': + lambda_body = f''' + {method_caller}{method_name}({", ".join(param_names)}); + return py::make_tuple({", ".join(immutable_param_names)}); +''' + else: + lambda_body = f''' + auto res = {method_caller}{method_name}({", ".join(param_names)}); + return py::make_tuple(res, {", ".join(immutable_param_names)}); +''' + final_lambda_params = [self_param_with_name] + params_with_names if self_param_with_name is not None else params_with_names + method_body_str = define_lambda('', final_lambda_params, 'py::tuple', lambda_body) + + print(f'REF TO IMMUT in method {method_name} parameters') + else: + method_body_str = ref_to_class_method(method, name_cpp, method_name, return_type, params_strs) + method_str = define_method(py_method_name, method_body_str, py_arg_strs, method.static) method_str = f'{python_ident}.{method_str};' + method_strs.append(method_str) generated_methods.append((py_method_name, method)) diff --git a/modules/python/generator/methods.py b/modules/python/generator/methods.py index 004ee264a3..48dae29a2a 100644 --- a/modules/python/generator/methods.py +++ b/modules/python/generator/methods.py @@ -107,6 +107,13 @@ def define_constructor(params: List[str], additional_args: List[str]) -> str: additional_args_str = ', ' + additional_args_str return f'def(py::init<{", ".join(params)}>(){additional_args_str})' +def define_lambda(capture: str, params: List[str], return_type: str, body: str) -> str: + return f''' +[{capture}]({", ".join(params)}) -> {return_type} {{ + {body} +}} + +''' class NotGeneratedReason(Enum): UserIgnored = 'user_ignored', diff --git a/modules/python/generator/utils.py b/modules/python/generator/utils.py index a59f807c4c..62ea4dfa9e 100644 --- a/modules/python/generator/utils.py +++ b/modules/python/generator/utils.py @@ -119,7 +119,6 @@ def is_non_const_ref_to_immutable_type(param: types.DecoratedType) -> bool: return is_immut_container - def is_unsupported_return_type(param: Union[types.FunctionType, types.DecoratedType]) -> bool: ''' Returns whether the passed param is supported as a return type for automatic code generation. From f500ccec410d43578d6dbf7de12df47c3bf3b19e Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Thu, 28 Sep 2023 16:48:53 +0200 Subject: [PATCH 052/169] trying to implement realsense2, some issues with 3rd party types... --- modules/python/config/sensor.json | 2 +- modules/python/generator/utils.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/python/config/sensor.json b/modules/python/config/sensor.json index 50632d6ccd..a9c3a625e2 100644 --- a/modules/python/config/sensor.json +++ b/modules/python/config/sensor.json @@ -1,3 +1,3 @@ { - "ignored_headers": ["vpRealSense2.h"] + "ignored_headers": [] } \ No newline at end of file diff --git a/modules/python/generator/utils.py b/modules/python/generator/utils.py index 62ea4dfa9e..f9fe7b7dc2 100644 --- a/modules/python/generator/utils.py +++ b/modules/python/generator/utils.py @@ -45,7 +45,10 @@ def get_type(param: Union[types.FunctionType, types.DecoratedType, types.Value], ''' if isinstance(param, types.Value): return ''.join([token.value for token in param.tokens]) - + if isinstance(param, types.FunctionType): + return_type = get_type(param.return_type, owner_specs, header_env_mapping) + param_types = [get_type(p.type, owner_specs, header_env_mapping) for p in param.parameters] + return f'{return_type}({", ".join(param_types)})' if isinstance(param, types.Type): repr_str = get_typename(param.typename, owner_specs, header_env_mapping) split = repr_str.split('<') From 23fa1d5fe02979057e864dd55d9307e9fde145d4 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Mon, 2 Oct 2023 17:15:25 +0200 Subject: [PATCH 053/169] trying to generate robot and detection modules, some issues --- modules/python/config/detection.json | 3 +++ modules/python/config/robot.json | 23 +++++++++++++++++++++++ modules/python/generator/doc_parser.py | 2 +- modules/python/generator/generator.py | 13 +++++++++++-- modules/python/generator/submodule.py | 2 +- 5 files changed, 39 insertions(+), 4 deletions(-) create mode 100644 modules/python/config/detection.json create mode 100644 modules/python/config/robot.json diff --git a/modules/python/config/detection.json b/modules/python/config/detection.json new file mode 100644 index 0000000000..0e0dcd235c --- /dev/null +++ b/modules/python/config/detection.json @@ -0,0 +1,3 @@ +{ + +} \ No newline at end of file diff --git a/modules/python/config/robot.json b/modules/python/config/robot.json new file mode 100644 index 0000000000..dca81f27b6 --- /dev/null +++ b/modules/python/config/robot.json @@ -0,0 +1,23 @@ +{ + "ignored_headers": ["vpWireFrameSimulatorTypes.h"], + + + "classes": { + "vpImageSimulator": { + + "methods": + [ + { + "static": true, + "signature": "void getImage(vpImage&, std::list&, const vpCameraParameters&)", + "custom_name": "getImageMultiplePlanes" + }, + { + "static": true, + "signature": "void getImage(vpImage&, std::list&, const vpCameraParameters&)", + "custom_name": "getImageMultiplePlanes" + } + ] + } + } +} \ No newline at end of file diff --git a/modules/python/generator/doc_parser.py b/modules/python/generator/doc_parser.py index 795a39f1d1..29bfa7ecee 100644 --- a/modules/python/generator/doc_parser.py +++ b/modules/python/generator/doc_parser.py @@ -160,7 +160,7 @@ def process_mixed_container(container: MixedContainer, level: int) -> str: res += '\n' + indent_str + '* ' + item_content + '\n' + indent_str return res + '\n' - return f'' + return f'' def process_paragraph(para: docParaType, level: int) -> str: diff --git a/modules/python/generator/generator.py b/modules/python/generator/generator.py index 08809103d7..3db586406c 100644 --- a/modules/python/generator/generator.py +++ b/modules/python/generator/generator.py @@ -7,8 +7,14 @@ from multiprocessing import Pool def header_preprocess(header: HeaderFile): - header.preprocess() - return header + try: + header.preprocess() + return header + except Exception as e: + print('There was an error when processing header', header.path) + import traceback + traceback.print_exc() + return None def main_str(submodule_fn_declarations, submodule_fn_calls): ''' @@ -45,8 +51,11 @@ def generate_module(generate_path: Path) -> None: with Pool() as pool: new_all_headers = [] for result in list(tqdm(pool.imap(header_preprocess, all_headers), total=len(all_headers), file=sys.stderr)): + if result is None: + raise RuntimeError('There was an exception when processing headers: You should either ignore them, ignore the failing class, or fix the generator code!') new_all_headers.append(result) + # Sort headers according to the dependencies. This is done across all modules. # TODO: sort module generation order. For now this works but it's fairly brittle new_all_headers = sort_headers(new_all_headers) diff --git a/modules/python/generator/submodule.py b/modules/python/generator/submodule.py index 0bec5b8362..1a5ddb4f78 100644 --- a/modules/python/generator/submodule.py +++ b/modules/python/generator/submodule.py @@ -157,7 +157,7 @@ def get_method_config(self, class_name: Optional[str], method, owner_specs, head return res def get_submodules(include_path: Path, generate_path: Path) -> List[Submodule]: - modules = ['core', 'vision', 'visual_features', 'vs', 'sensor', 'io'] + modules = ['core', 'vision', 'visual_features', 'vs', 'sensor', 'io', 'detection', 'robot'] result = [] for module in modules: result.append(Submodule(module, Path(f'/home/sfelton/software/visp-sfelton/modules/{module}/include/visp3/{module}'), generate_path / f'{module}.cpp')) From 64403c94882fbe0a8f9472e454a93078d4b3828e Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Mon, 2 Oct 2023 18:55:24 +0200 Subject: [PATCH 054/169] fix undefined references in detection module, wrap robot and detection modules --- .../visp3/detection/vpDetectorAprilTag.h | 20 ++++- .../detection/src/tag/vpDetectorAprilTag.cpp | 75 +++++++++---------- modules/python/CMakeLists.txt | 1 - modules/python/config/detection.json | 2 +- modules/python/config/robot.json | 5 +- modules/python/generator/header.py | 5 +- modules/python/generator/submodule.py | 17 ++++- 7 files changed, 75 insertions(+), 50 deletions(-) diff --git a/modules/detection/include/visp3/detection/vpDetectorAprilTag.h b/modules/detection/include/visp3/detection/vpDetectorAprilTag.h index 33d5748b08..b9b33dfeeb 100644 --- a/modules/detection/include/visp3/detection/vpDetectorAprilTag.h +++ b/modules/detection/include/visp3/detection/vpDetectorAprilTag.h @@ -216,7 +216,8 @@ Tag code 1: class VISP_EXPORT vpDetectorAprilTag : public vpDetectorBase { public: - enum vpAprilTagFamily { + enum vpAprilTagFamily + { TAG_36h11, ///< AprilTag 36h11 pattern (recommended) TAG_36h10, ///< DEPRECATED TAG_36ARTOOLKIT, ///< DEPRECATED AND WILL NOT DETECT ARTOOLKIT TAGS @@ -230,7 +231,8 @@ class VISP_EXPORT vpDetectorAprilTag : public vpDetectorBase TAG_STANDARD52h13 ///< AprilTag Standard52h13 pattern }; - enum vpPoseEstimationMethod { + enum vpPoseEstimationMethod + { HOMOGRAPHY, /*!< Pose from homography */ HOMOGRAPHY_VIRTUAL_VS, /*!< Non linear virtual visual servoing approach initialized by the homography approach */ @@ -284,9 +286,9 @@ class VISP_EXPORT vpDetectorAprilTag : public vpDetectorBase void setAprilTagPoseEstimationMethod(const vpPoseEstimationMethod &poseEstimationMethod); void setAprilTagQuadDecimate(float quadDecimate); void setAprilTagQuadSigma(float quadSigma); - void setAprilTagRefineDecode(bool refineDecode); void setAprilTagRefineEdges(bool refineEdges); - void setAprilTagRefinePose(bool refinePose); + + /*! Allow to enable the display of overlay tag information in the windows * (vpDisplay) associated to the input image. */ @@ -301,6 +303,16 @@ class VISP_EXPORT vpDetectorAprilTag : public vpDetectorBase void setZAlignedWithCameraAxis(bool zAlignedWithCameraFrame); +#if defined(VISP_BUILD_DEPRECATED_FUNCTIONS) + /*! + @name Deprecated functions + */ + //@{ + vp_deprecated void setAprilTagRefinePose(bool refinePose); + vp_deprecated void setAprilTagRefineDecode(bool refineDecode); + //@} +#endif + protected: bool m_displayTag; vpColor m_displayTagColor; diff --git a/modules/detection/src/tag/vpDetectorAprilTag.cpp b/modules/detection/src/tag/vpDetectorAprilTag.cpp index 984ce3182f..81dedc0e99 100644 --- a/modules/detection/src/tag/vpDetectorAprilTag.cpp +++ b/modules/detection/src/tag/vpDetectorAprilTag.cpp @@ -66,7 +66,7 @@ class vpDetectorAprilTag::Impl public: Impl(const vpAprilTagFamily &tagFamily, const vpPoseEstimationMethod &method) : m_poseEstimationMethod(method), m_tagsId(), m_tagFamily(tagFamily), m_td(NULL), m_tf(NULL), m_detections(NULL), - m_zAlignedWithCameraFrame(false) + m_zAlignedWithCameraFrame(false) { switch (m_tagFamily) { case TAG_36h11: @@ -135,7 +135,7 @@ class vpDetectorAprilTag::Impl Impl(const Impl &o) : m_poseEstimationMethod(o.m_poseEstimationMethod), m_tagsId(o.m_tagsId), m_tagFamily(o.m_tagFamily), m_td(NULL), - m_tf(NULL), m_detections(NULL), m_zAlignedWithCameraFrame(o.m_zAlignedWithCameraFrame) + m_tf(NULL), m_detections(NULL), m_zAlignedWithCameraFrame(o.m_zAlignedWithCameraFrame) { switch (m_tagFamily) { case TAG_36h11: @@ -301,7 +301,7 @@ class vpDetectorAprilTag::Impl if (m_tagFamily == TAG_CIRCLE49h12 || m_tagFamily == TAG_CUSTOM48h12 || m_tagFamily == TAG_STANDARD41h12 || m_tagFamily == TAG_STANDARD52h13) { std::cerr << "TAG_CIRCLE49h12, TAG_CUSTOM48h12, TAG_STANDARD41h12 and TAG_STANDARD52h13 are disabled." - << std::endl; + << std::endl; return false; } #endif @@ -309,9 +309,9 @@ class vpDetectorAprilTag::Impl const bool computePose = (cMo_vec != NULL); image_u8_t im = {/*.width =*/(int32_t)I.getWidth(), - /*.height =*/(int32_t)I.getHeight(), - /*.stride =*/(int32_t)I.getWidth(), - /*.buf =*/I.bitmap}; + /*.height =*/(int32_t)I.getHeight(), + /*.stride =*/(int32_t)I.getWidth(), + /*.buf =*/I.bitmap }; if (m_detections) { apriltag_detections_destroy(m_detections); @@ -458,7 +458,7 @@ class vpDetectorAprilTag::Impl if (m_tagFamily == TAG_CIRCLE49h12 || m_tagFamily == TAG_CUSTOM48h12 || m_tagFamily == TAG_STANDARD41h12 || m_tagFamily == TAG_STANDARD52h13) { std::cerr << "TAG_CIRCLE49h12, TAG_CUSTOM48h12, TAG_STANDARD41h12 and TAG_STANDARD52h13 are disabled." - << std::endl; + << std::endl; return false; } #endif @@ -563,7 +563,7 @@ class vpDetectorAprilTag::Impl vpHomogeneousMatrix cMo_dementhon, cMo_lagrange; double residual_dementhon = std::numeric_limits::max(), - residual_lagrange = std::numeric_limits::max(); + residual_lagrange = std::numeric_limits::max(); double residual_homography = pose.computeResidual(cMo_homography); double residual_homography_ortho_iter = pose.computeResidual(cMo_homography_ortho_iter); @@ -588,7 +588,8 @@ class vpDetectorAprilTag::Impl std::ptrdiff_t minIndex = std::min_element(residuals.begin(), residuals.end()) - residuals.begin(); cMo = *(poses.begin() + minIndex); - } else { + } + else { pose.computePose(m_mapOfCorrespondingPoseMethods[m_poseEstimationMethod], cMo); } } @@ -602,16 +603,16 @@ class vpDetectorAprilTag::Impl if (m_poseEstimationMethod != HOMOGRAPHY_ORTHOGONAL_ITERATION) { if (cMo2) { double scale = tagSize / 2.0; - double data_p0[] = {-scale, scale, 0}; - double data_p1[] = {scale, scale, 0}; - double data_p2[] = {scale, -scale, 0}; - double data_p3[] = {-scale, -scale, 0}; - matd_t *p[4] = {matd_create_data(3, 1, data_p0), matd_create_data(3, 1, data_p1), - matd_create_data(3, 1, data_p2), matd_create_data(3, 1, data_p3)}; + double data_p0[] = { -scale, scale, 0 }; + double data_p1[] = { scale, scale, 0 }; + double data_p2[] = { scale, -scale, 0 }; + double data_p3[] = { -scale, -scale, 0 }; + matd_t *p[4] = { matd_create_data(3, 1, data_p0), matd_create_data(3, 1, data_p1), + matd_create_data(3, 1, data_p2), matd_create_data(3, 1, data_p3) }; matd_t *v[4]; for (int i = 0; i < 4; i++) { - double data_v[] = {(det->p[i][0] - cam.get_u0()) / cam.get_px(), (det->p[i][1] - cam.get_v0()) / cam.get_py(), - 1}; + double data_v[] = { (det->p[i][0] - cam.get_u0()) / cam.get_px(), (det->p[i][1] - cam.get_v0()) / cam.get_py(), + 1 }; v[i] = matd_create_data(3, 1, data_v); } @@ -680,11 +681,13 @@ class vpDetectorAprilTag::Impl if (cMo2) { if (pose2.R) { convertHomogeneousMatrix(pose2, *cMo2); - } else { + } + else { *cMo2 = cMo1; } } - } else { + } + else { convertHomogeneousMatrix(pose2, cMo1); if (cMo2) { convertHomogeneousMatrix(pose1, *cMo2); @@ -783,7 +786,7 @@ class vpDetectorAprilTag::Impl } } - void setRefineDecode(bool) {} + void setRefineDecode(bool) { } void setRefineEdges(bool refineEdges) { @@ -792,7 +795,7 @@ class vpDetectorAprilTag::Impl } } - void setRefinePose(bool) {} + void setRefinePose(bool) { } void setPoseEstimationMethod(const vpPoseEstimationMethod &method) { m_poseEstimationMethod = method; } @@ -813,17 +816,15 @@ class vpDetectorAprilTag::Impl vpDetectorAprilTag::vpDetectorAprilTag(const vpAprilTagFamily &tagFamily, const vpPoseEstimationMethod &poseEstimationMethod) : m_displayTag(false), m_displayTagColor(vpColor::none), m_displayTagThickness(2), - m_poseEstimationMethod(poseEstimationMethod), m_tagFamily(tagFamily), m_defaultCam(), - m_impl(new Impl(tagFamily, poseEstimationMethod)) -{ -} + m_poseEstimationMethod(poseEstimationMethod), m_tagFamily(tagFamily), m_defaultCam(), + m_impl(new Impl(tagFamily, poseEstimationMethod)) +{ } vpDetectorAprilTag::vpDetectorAprilTag(const vpDetectorAprilTag &o) : vpDetectorBase(o), m_displayTag(false), m_displayTagColor(vpColor::none), m_displayTagThickness(2), - m_poseEstimationMethod(o.m_poseEstimationMethod), m_tagFamily(o.m_tagFamily), m_defaultCam(), - m_impl(new Impl(*o.m_impl)) -{ -} + m_poseEstimationMethod(o.m_poseEstimationMethod), m_tagFamily(o.m_tagFamily), m_defaultCam(), + m_impl(new Impl(*o.m_impl)) +{ } vpDetectorAprilTag &vpDetectorAprilTag::operator=(vpDetectorAprilTag o) { @@ -1026,7 +1027,8 @@ std::vector > vpDetectorAprilTag::getTagsPoints3D(const std throw(vpException(vpException::fatalError, "Tag with id %d has no 3D size or there is no default 3D size defined", tagsId[i])); } - } else { + } + else { tagSize = it->second; } std::vector points3D(4); @@ -1035,7 +1037,8 @@ std::vector > vpDetectorAprilTag::getTagsPoints3D(const std points3D[1] = vpPoint(tagSize / 2, tagSize / 2, 0); points3D[2] = vpPoint(tagSize / 2, -tagSize / 2, 0); points3D[3] = vpPoint(-tagSize / 2, -tagSize / 2, 0); - } else { + } + else { points3D[0] = vpPoint(-tagSize / 2, -tagSize / 2, 0); points3D[1] = vpPoint(tagSize / 2, -tagSize / 2, 0); points3D[2] = vpPoint(tagSize / 2, tagSize / 2, 0); @@ -1150,6 +1153,7 @@ vp_deprecated void vpDetectorAprilTag::setAprilTagRefineDecode(bool refineDecode { m_impl->setRefineDecode(refineDecode); } +vp_deprecated void vpDetectorAprilTag::setAprilTagRefinePose(bool refinePose) { m_impl->setRefinePose(refinePose); } #endif /*! @@ -1168,13 +1172,6 @@ vp_deprecated void vpDetectorAprilTag::setAprilTagRefineDecode(bool refineDecode */ void vpDetectorAprilTag::setAprilTagRefineEdges(bool refineEdges) { m_impl->setRefineEdges(refineEdges); } -#if defined(VISP_BUILD_DEPRECATED_FUNCTIONS) -/*! - Deprecated parameter from AprilTag 2 version. -*/ -vp_deprecated void vpDetectorAprilTag::setAprilTagRefinePose(bool refinePose) { m_impl->setRefinePose(refinePose); } -#endif - void swap(vpDetectorAprilTag &o1, vpDetectorAprilTag &o2) { using std::swap; @@ -1195,5 +1192,5 @@ void vpDetectorAprilTag::setZAlignedWithCameraAxis(bool zAlignedWithCameraFrame) #elif !defined(VISP_BUILD_SHARED_LIBS) // Work around to avoid warning: libvisp_core.a(vpDetectorAprilTag.cpp.o) has // no symbols -void dummy_vpDetectorAprilTag() {} +void dummy_vpDetectorAprilTag() { } #endif diff --git a/modules/python/CMakeLists.txt b/modules/python/CMakeLists.txt index 034b70fe9a..7570274894 100644 --- a/modules/python/CMakeLists.txt +++ b/modules/python/CMakeLists.txt @@ -14,6 +14,5 @@ message(${VISP_VERSION}) message(${pybind11_VERSION}) file(GLOB generated_cpp src/generated/*.cpp) file(GLOB static_cpp src/static/*.cpp) - pybind11_add_module(visp src/main.cpp ${generated_cpp} ${static_cpp} THIN_LTO) target_link_libraries(visp PRIVATE ${VISP_LIBRARIES}) diff --git a/modules/python/config/detection.json b/modules/python/config/detection.json index 0e0dcd235c..78946149cf 100644 --- a/modules/python/config/detection.json +++ b/modules/python/config/detection.json @@ -1,3 +1,3 @@ { - + "required_headers": ["visp3/core/vpPoint.h"] } \ No newline at end of file diff --git a/modules/python/config/robot.json b/modules/python/config/robot.json index dca81f27b6..9790ac0bb6 100644 --- a/modules/python/config/robot.json +++ b/modules/python/config/robot.json @@ -1,5 +1,5 @@ { - "ignored_headers": ["vpWireFrameSimulatorTypes.h"], + "ignored_headers": ["vpWireFrameSimulatorTypes.h", "vpRobotException.h"], "classes": { @@ -18,6 +18,9 @@ "custom_name": "getImageMultiplePlanes" } ] + }, + "vpRobotSimulator": { + "is_virtual": true } } } \ No newline at end of file diff --git a/modules/python/generator/header.py b/modules/python/generator/header.py index 2c64791263..3340731aea 100644 --- a/modules/python/generator/header.py +++ b/modules/python/generator/header.py @@ -147,7 +147,7 @@ def run_preprocessor(self): # TODO: run without generating a new file '-D', 'VISP_EXPORT=', '-I', '/home/sfelton/software/visp_build/include', '-I', '/usr/local/include', - #'-I', '/usr/include', + '-I', '/usr/include', '-N', 'VISP_BUILD_DEPRECATED_FUNCTIONS', '--passthru-includes', "^((?!vpConfig.h).)*$", '--passthru-unfound-includes', @@ -221,6 +221,9 @@ def generate_class_with_potiental_specialization(name_python: str, owner_specs: if method.pure_virtual: contains_pure_virtual_methods = True break + # User marked this class as virtual. + # This is required if no virtual method is declared in this class, but it does not implement pure virtual methods of a base class + contains_pure_virtual_methods = contains_pure_virtual_methods or cls_config['is_virtual'] # Find bindable methods generated_methods = [] diff --git a/modules/python/generator/submodule.py b/modules/python/generator/submodule.py index 1a5ddb4f78..8d5246c50c 100644 --- a/modules/python/generator/submodule.py +++ b/modules/python/generator/submodule.py @@ -62,17 +62,22 @@ def generate(self) -> None: submodule_declaration = f'py::module_ submodule = m.def_submodule("{self.name}");\n' bindings = '\n'.join(header_code) declarations = '\n'.join(declarations) + user_defined_headers = '\n'.join(self.get_user_defined_headers()) includes_strs = [f'#include {include}' for include in includes_set] includes_str = '\n'.join(includes_strs) - user_defined_headers = '\n'.join(self.get_user_defined_headers()) + additional_required_headers = '\n'.join(self.get_required_headers()) + format_str = f''' #include #include #include #include +/*User-defined headers (e.g. additional bindings)*/ {user_defined_headers} - +/*Required headers that are not retrieved in submodule headers (e.g. there are forward definitions but no includes) */ +{additional_required_headers} +/*Submodule headers*/ {includes_str} namespace py = pybind11; @@ -118,6 +123,11 @@ def get_user_defined_headers(self) -> List[str]: header_names = self.config['user_defined_headers'] return [f'#include "{header_name}"' for header_name in header_names] return [] + def get_required_headers(self) -> List[str]: + if 'required_headers' in self.config: + header_names = self.config['required_headers'] + return [f'#include <{header_name}>' for header_name in header_names] + return [] def get_class_config(self, class_name: str) -> Optional[Dict]: default_config = { @@ -125,7 +135,8 @@ def get_class_config(self, class_name: str) -> Optional[Dict]: 'operators': [], 'use_buffer_protocol': False, 'additional_bindings': None, - 'ignore_repr': False + 'ignore_repr': False, + 'is_virtual': False } if 'classes' not in self.config: return default_config From 4fc0b89013083baa17eb604227c9b8032d869773 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Tue, 3 Oct 2023 00:40:18 +0200 Subject: [PATCH 055/169] generate report for methods with default param policy --- modules/python/generator/gen_report.py | 40 ++++++++++++++++++++++++-- modules/python/generator/header.py | 10 ++++++- modules/python/generator/submodule.py | 1 + 3 files changed, 48 insertions(+), 3 deletions(-) diff --git a/modules/python/generator/gen_report.py b/modules/python/generator/gen_report.py index a3edfcaa89..2c5aa8dfe0 100644 --- a/modules/python/generator/gen_report.py +++ b/modules/python/generator/gen_report.py @@ -12,7 +12,8 @@ def __init__(self, submodule: 'Submodule'): self.result = { 'ignored_headers': [], 'classes': {}, - 'methods': {} + 'methods': {}, + 'default_param_policy_methods': [] } def add_ignored_header(self, path: Path) -> None: @@ -28,7 +29,7 @@ def add_non_generated_method(self, method: RejectedMethod) -> None: proposed_help = { 'static': method.method.static, 'signature': method.signature, - 'ignored': True + 'ignore': True } report_dict = { 'reason': method.rejection_reason.value, @@ -37,6 +38,41 @@ def add_non_generated_method(self, method: RejectedMethod) -> None: if method.cls_name is not None: report_dict['class'] = method.cls_name self.result['methods'][method.signature] = report_dict + + def add_default_policy_method(self, cls_name: str, method: types.Method, signature: str, input_params: List[bool], output_params: List[bool]) -> None: + proposed_help = [ + { + 'static': method.static, + 'signature': signature, + 'use_default_param_policy': True + }, + { + 'static': method.static, + 'signature': signature, + 'use_default_param_policy': False, + 'param_is_input': input_params, + 'param_is_output': output_params + } + ] + report_dict = { + 'reason': 'Method uses default parameter policy, make sure that this is correct! If it is use "use_default_param_policy": true. Otherwise, set the custom inputness/outputness of params', + 'signature': signature, + 'static': method.static, + 'class': cls_name, + 'possible_fixes': proposed_help + } + self.result['default_param_policy_methods'].append(report_dict) + def write(self, path: Path) -> None: + print(f'Statistics for module {self.submodule_name} report:') + stats = [ + f'Ignored headers: {len(self.result["ignored_headers"])}', + f'Ignored classes: {len(self.result["classes"].keys())}', + f'Not generated methods: {len(self.result["methods"].keys())}', + f'Method with default parameter policy: {len(self.result["default_param_policy_methods"])}', + + + ] + print('\n\t'.join(stats)) with open(path, 'w') as report_file: json.dump(self.result, report_file, indent=2) diff --git a/modules/python/generator/header.py b/modules/python/generator/header.py index 3340731aea..9b58389c4f 100644 --- a/modules/python/generator/header.py +++ b/modules/python/generator/header.py @@ -296,6 +296,7 @@ def define_classical_method(method: types.Method, method_config, specs): method_name = get_name(method.name) py_method_name = method_config.get('custom_name') or method_name return_type = get_type(method.return_type, specs, header_env.mapping) + # Fetch documentation if available if self.documentation_holder is not None: method_doc_signature = MethodDocSignature(method_name, @@ -315,6 +316,13 @@ def define_classical_method(method: types.Method, method_config, specs): param_names = [param.name or 'arg' + i for i, param in enumerate(method.parameters)] params_with_names = [t + ' ' + name for t, name in zip(params_strs, param_names)] immutable_param_names = [param_names[i] for i in range(len(param_is_ref_to_immut)) if param_is_ref_to_immut[i]] + if not method_config['use_default_param_policy']: + method_signature = get_method_signature(method_name, + get_type(method.return_type, {}, header_env.mapping), + [get_type(param.type, {}, header_env.mapping) for param in method.parameters]) + inputs = [True for _ in range(len(param_names))] + outputs = [p in immutable_param_names for p in param_names] + self.submodule.report.add_default_policy_method(name_cpp_no_template, method, method_signature, inputs, outputs) if not method.static: self_param_with_name = name_cpp + '& self' method_caller = 'self.' @@ -338,9 +346,9 @@ def define_classical_method(method: types.Method, method_config, specs): print(f'REF TO IMMUT in method {method_name} parameters') else: method_body_str = ref_to_class_method(method, name_cpp, method_name, return_type, params_strs) + method_str = define_method(py_method_name, method_body_str, py_arg_strs, method.static) method_str = f'{python_ident}.{method_str};' - method_strs.append(method_str) generated_methods.append((py_method_name, method)) diff --git a/modules/python/generator/submodule.py b/modules/python/generator/submodule.py index 8d5246c50c..41a5147073 100644 --- a/modules/python/generator/submodule.py +++ b/modules/python/generator/submodule.py @@ -148,6 +148,7 @@ def get_class_config(self, class_name: str) -> Optional[Dict]: def get_method_config(self, class_name: Optional[str], method, owner_specs, header_mapping) -> Dict: res = { 'ignore': False, + 'use_default_param_policy': False, 'custom_name': None, 'custom_code': None } From ae3a29177891b010d14fe79fc702f3247e73fc44 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Tue, 3 Oct 2023 16:24:34 +0200 Subject: [PATCH 056/169] Generate empty image proc, better handle input/output params --- .../core/include/visp3/core/vpImageFilter.h | 16 ++-- .../visp3/imgproc/vpCircleHoughTransform.h | 18 ++--- modules/python/config/imgproc.json | 3 + modules/python/config/robot.json | 26 ++++++- modules/python/docs/api.rst | 2 + modules/python/docs/static/todos.rst | 12 +-- modules/python/generator/header.py | 78 ++++++++++++------- modules/python/generator/submodule.py | 4 +- modules/python/generator/utils.py | 3 + 9 files changed, 111 insertions(+), 51 deletions(-) create mode 100644 modules/python/config/imgproc.json diff --git a/modules/core/include/visp3/core/vpImageFilter.h b/modules/core/include/visp3/core/vpImageFilter.h index 054fcba05b..643595fef8 100644 --- a/modules/core/include/visp3/core/vpImageFilter.h +++ b/modules/core/include/visp3/core/vpImageFilter.h @@ -361,10 +361,11 @@ class VISP_EXPORT vpImageFilter } static void filterX(const vpImage &I, vpImage &dIx, const double *filter, unsigned int size); +#ifndef DOXYGEN_SHOULD_SKIP_THIS static void filterXR(const vpImage &I, vpImage &dIx, const double *filter, unsigned int size); static void filterXG(const vpImage &I, vpImage &dIx, const double *filter, unsigned int size); static void filterXB(const vpImage &I, vpImage &dIx, const double *filter, unsigned int size); - +#endif template static inline FilterType filterX(const vpImage &I, unsigned int r, unsigned int c, const FilterType *filter, unsigned int size) { @@ -377,7 +378,7 @@ class VISP_EXPORT vpImageFilter } return result + filter[0] * I[r][c]; } - +#ifndef DOXYGEN_SHOULD_SKIP_THIS static inline double filterXR(const vpImage &I, unsigned int r, unsigned int c, const double *filter, unsigned int size) { double result; @@ -543,6 +544,7 @@ class VISP_EXPORT vpImageFilter } return result + filter[0] * I[r][c].B; } +#endif template static inline FilterType filterX(const vpImage &I, unsigned int r, unsigned int c, @@ -557,7 +559,7 @@ class VISP_EXPORT vpImageFilter } return result + filter[0] * I[r][c]; } - +#ifndef DOXYGEN_SHOULD_SKIP_THIS template static inline FilterType filterXLeftBorder(const vpImage &I, unsigned int r, unsigned int c, const FilterType *filter, unsigned int size) @@ -591,6 +593,7 @@ class VISP_EXPORT vpImageFilter } return result + filter[0] * I[r][c]; } +#endif template static void filterY(const vpImage &I, vpImage &dIy, const FilterType *filter, unsigned int size) @@ -614,10 +617,11 @@ class VISP_EXPORT vpImageFilter } static void filterY(const vpImage &I, vpImage &dIx, const double *filter, unsigned int size); +#ifndef DOXYGEN_SHOULD_SKIP_THIS static void filterYR(const vpImage &I, vpImage &dIx, const double *filter, unsigned int size); static void filterYG(const vpImage &I, vpImage &dIx, const double *filter, unsigned int size); static void filterYB(const vpImage &I, vpImage &dIx, const double *filter, unsigned int size); - +#endif template static void filterY(const vpImage &I, vpImage &dIy, const FilterType *filter, unsigned int size) { @@ -651,7 +655,7 @@ class VISP_EXPORT vpImageFilter } return result + filter[0] * I[r][c]; } - +#ifndef DOXYGEN_SHOULD_SKIP_THIS static inline double filterYR(const vpImage &I, unsigned int r, unsigned int c, const double *filter, unsigned int size) { double result; @@ -847,7 +851,7 @@ class VISP_EXPORT vpImageFilter } return result + filter[0] * I[r][c]; } - +#endif template static inline FilterType filterY(const vpImage &I, unsigned int r, unsigned int c, const FilterType *filter, unsigned int size) diff --git a/modules/imgproc/include/visp3/imgproc/vpCircleHoughTransform.h b/modules/imgproc/include/visp3/imgproc/vpCircleHoughTransform.h index f02bddb803..3ac926fb37 100644 --- a/modules/imgproc/include/visp3/imgproc/vpCircleHoughTransform.h +++ b/modules/imgproc/include/visp3/imgproc/vpCircleHoughTransform.h @@ -266,7 +266,7 @@ class VISP_EXPORT vpCircleHoughTransform * \param[in] j : The JSON object, resulting from the parsing of a JSON file. * \param[out] params : The circle Hough transform parameters that will be initialized from the JSON data. */ - inline friend void from_json(const json &j, vpCircleHoughTransformParameters ¶ms) + friend inline void from_json(const json &j, vpCircleHoughTransformParameters ¶ms) { params.m_gaussianKernelSize = j.value("gaussianKernelSize", params.m_gaussianKernelSize); if ((params.m_gaussianKernelSize % 2) != 1) { @@ -325,7 +325,7 @@ class VISP_EXPORT vpCircleHoughTransform * \param[out] j : A JSON parser object. * \param[in] params : The circle Hough transform parameters that will be serialized in the json object. */ - inline friend void to_json(json &j, const vpCircleHoughTransformParameters ¶ms) + friend inline void to_json(json &j, const vpCircleHoughTransformParameters ¶ms) { std::pair radiusLimits = { params.m_minRadius, params.m_maxRadius }; @@ -345,13 +345,13 @@ class VISP_EXPORT vpCircleHoughTransform {"circlePerfectnessThreshold", params.m_circlePerfectness}, {"centerMinDistance", params.m_centerMinDist}, {"mergingRadiusDiffThresh", params.m_mergingRadiusDiffThresh} }; - } + } #endif -}; + }; -/** - * \brief Construct a new vpCircleHoughTransform object with default parameters. - */ + /** + * \brief Construct a new vpCircleHoughTransform object with default parameters. + */ vpCircleHoughTransform(); /** @@ -444,7 +444,7 @@ class VISP_EXPORT vpCircleHoughTransform * \param[in] j The JSON object, resulting from the parsing of a JSON file. * \param[out] detector The detector, that will be initialized from the JSON data. */ - inline friend void from_json(const json &j, vpCircleHoughTransform &detector) + friend inline void from_json(const json &j, vpCircleHoughTransform &detector) { detector.m_algoParams = j; } @@ -455,7 +455,7 @@ class VISP_EXPORT vpCircleHoughTransform * \param[out] j A JSON parser object. * \param[in] detector The vpCircleHoughTransform that must be parsed into JSON format. */ - inline friend void to_json(json &j, const vpCircleHoughTransform &detector) + friend inline void to_json(json &j, const vpCircleHoughTransform &detector) { j = detector.m_algoParams; } diff --git a/modules/python/config/imgproc.json b/modules/python/config/imgproc.json new file mode 100644 index 0000000000..0e0dcd235c --- /dev/null +++ b/modules/python/config/imgproc.json @@ -0,0 +1,3 @@ +{ + +} \ No newline at end of file diff --git a/modules/python/config/robot.json b/modules/python/config/robot.json index 9790ac0bb6..bf240f748e 100644 --- a/modules/python/config/robot.json +++ b/modules/python/config/robot.json @@ -10,12 +10,34 @@ { "static": true, "signature": "void getImage(vpImage&, std::list&, const vpCameraParameters&)", - "custom_name": "getImageMultiplePlanes" + "custom_name": "getImageMultiplePlanes", + "use_default_param_policy": false, + "param_is_input": [ + true, + true, + true + ], + "param_is_output": [ + false, + false, + false + ] }, { "static": true, "signature": "void getImage(vpImage&, std::list&, const vpCameraParameters&)", - "custom_name": "getImageMultiplePlanes" + "custom_name": "getImageMultiplePlanes", + "use_default_param_policy": false, + "param_is_input": [ + true, + true, + true + ], + "param_is_output": [ + false, + false, + false + ] } ] }, diff --git a/modules/python/docs/api.rst b/modules/python/docs/api.rst index ad0bc9389a..1fcec08151 100644 --- a/modules/python/docs/api.rst +++ b/modules/python/docs/api.rst @@ -12,3 +12,5 @@ API reference visp.vision visp.visual_features visp.vs + visp.robot + visp.detection diff --git a/modules/python/docs/static/todos.rst b/modules/python/docs/static/todos.rst index 854c0b7d97..f7392b84c5 100644 --- a/modules/python/docs/static/todos.rst +++ b/modules/python/docs/static/todos.rst @@ -2,12 +2,12 @@ List of todos ====================== * There is an issue when indexing readonly arrays such as HomogeneousMatrix or RotationMatrix -* Immutable (in python) parameters that are passed by reference are not modified. This includes: - * ints, floats, double - * std::string and char arrays - * To remedy this, they should be returned as new values by defining the fn as a lambda by changing - -* Std containers are not modified, same as immutable parameters +* Generate documentation for enums +* In classes, generate documentation for: constructors, operators +* Unary and n ary operators +* Exclude get operators for vpArray2D ? +* Parse subnamespaces + * Be careful of the anonymous namespace: this namespace is only visible in header, so it should be ignored * How should we handle parameters coming from external APIs ? e.g. realsense2, PCL. Can we interact with other bindings such as of opencv's * Reimplement a framegrabber tutorial in python, with matplotlib \ No newline at end of file diff --git a/modules/python/generator/header.py b/modules/python/generator/header.py index 9b58389c4f..146ac3f227 100644 --- a/modules/python/generator/header.py +++ b/modules/python/generator/header.py @@ -66,13 +66,19 @@ def add_level(result: List['HeaderFile'], remainder: List['HeaderFile'], depende class HeaderEnvironment(): def __init__(self, data: ParsedData): self.mapping = self.build_mapping(data.namespace) + def build_mapping(self, data: Union[NamespaceScope, ClassScope], mapping={}, scope: str = ''): if isinstance(data, NamespaceScope): for alias in data.using_alias: mapping[alias.alias] = get_type(alias.type, {}, mapping) + for typedef in data.typedefs: + mapping[typedef.name] = scope + typedef.name + for enum in data.enums: - enum_name = '::'.join([seg.name for seg in enum.base.segments]) - mapping[enum_name] = scope + enum_name + if not name_is_anonymous(enum.typename): + enum_name = '::'.join([seg.name for seg in enum.typename.segments]) + print('MAPPING enum_name', enum_name) + mapping[enum_name] = scope + enum_name for cls in data.classes: cls_name = '::'.join([seg.name for seg in cls.class_decl.typename.segments]) mapping[cls_name] = scope + cls_name @@ -86,8 +92,10 @@ def build_mapping(self, data: Union[NamespaceScope, ClassScope], mapping={}, sco for typedef in data.typedefs: mapping[typedef.name] = scope + typedef.name for enum in data.enums: - enum_name = '::'.join([seg.name for seg in enum.typename.segments if not isinstance(seg, types.AnonymousName)]) - mapping[enum_name] = scope + enum_name + print('MAPPING enum_name', enum.typename) + if not name_is_anonymous(enum.typename): + enum_name = '::'.join([seg.name for seg in enum.typename.segments]) + mapping[enum_name] = scope + enum_name for cls in data.classes: cls_name = '::'.join([seg.name for seg in cls.class_decl.typename.segments if not isinstance(seg, types.AnonymousName)]) mapping[cls_name] = scope + cls_name @@ -137,17 +145,16 @@ def preprocess(self) -> None: if self.documentation_holder_path is None: self.documentation_holder_path = DocumentationData.get_xml_path_if_exists(name_cpp_no_template, DocumentationObjectKind.Class) - - def run_preprocessor(self): # TODO: run without generating a new file tmp_file_path = self.submodule.submodule_file_path.parent / "tmp" / self.path.name argv = [ '', '-D', 'vp_deprecated=', '-D', 'VISP_EXPORT=', + '-D', 'DOXYGEN_SHOULD_SKIP_THIS', # Skip methods and classes that are not exposed in documentation: they are internals '-I', '/home/sfelton/software/visp_build/include', '-I', '/usr/local/include', - '-I', '/usr/include', + #'-I', '/usr/include', '-N', 'VISP_BUILD_DEPRECATED_FUNCTIONS', '--passthru-includes', "^((?!vpConfig.h).)*$", '--passthru-unfound-includes', @@ -160,7 +167,7 @@ def run_preprocessor(self): # TODO: run without generating a new file preprocessed_header_content = None with open(tmp_file_path, 'r') as header_file: preprocessed_header_content = '\n'.join(header_file.readlines()) - preprocessed_header_content = preprocessed_header_content.replace('#include<', '#include <') + preprocessed_header_content = preprocessed_header_content.replace('#include<', '#include <') # Bug in cpp header parser return preprocessed_header_content def generate_binding_code(self) -> None: @@ -172,6 +179,7 @@ def generate_binding_code(self) -> None: def parse_data(self): from enum_binding import enum_bindings result = '' + print(f'Building environment for {self.path}') header_env = HeaderEnvironment(self.header_repr) if self.documentation_holder_path is not None: self.documentation_holder = DocumentationHolder(self.documentation_holder_path, header_env.mapping) @@ -309,20 +317,35 @@ def define_classical_method(method: types.Method, method_config, specs): else: py_arg_strs = [method_doc.documentation] + py_arg_strs - # If a function has refs to immutable params, we need to return them. - param_is_ref_to_immut = list(map(lambda param: is_non_const_ref_to_immutable_type(param.type), method.parameters)) - contains_ref_to_immut = any(param_is_ref_to_immut) - if contains_ref_to_immut: - param_names = [param.name or 'arg' + i for i, param in enumerate(method.parameters)] - params_with_names = [t + ' ' + name for t, name in zip(params_strs, param_names)] - immutable_param_names = [param_names[i] for i in range(len(param_is_ref_to_immut)) if param_is_ref_to_immut[i]] - if not method_config['use_default_param_policy']: + # Detect input and output parameters for a method + use_default_param_policy = method_config['use_default_param_policy'] + param_is_input, param_is_output = method_config['param_is_input'], method_config['param_is_output'] + if use_default_param_policy or param_is_input is None and param_is_output is None: + param_is_input = [True for _ in range(len(method.parameters))] + param_is_output = list(map(lambda param: is_non_const_ref_to_immutable_type(param.type), method.parameters)) + if any(param_is_output): method_signature = get_method_signature(method_name, get_type(method.return_type, {}, header_env.mapping), [get_type(param.type, {}, header_env.mapping) for param in method.parameters]) - inputs = [True for _ in range(len(param_names))] - outputs = [p in immutable_param_names for p in param_names] - self.submodule.report.add_default_policy_method(name_cpp_no_template, method, method_signature, inputs, outputs) + self.submodule.report.add_default_policy_method(name_cpp_no_template, method, method_signature, param_is_input, param_is_output) + + # If a function has refs to immutable params, we need to return them. + should_wrap_for_tuple_return = param_is_output is not None and any(param_is_output) + if should_wrap_for_tuple_return: + param_names = [param.name or 'arg' + i for i, param in enumerate(method.parameters)] + + # Arguments that are inputs to the lambda function that wraps the ViSP function + input_param_names = [param_names[i] for i in range(len(param_is_input)) if param_is_input[i]] + input_param_types = [params_strs[i] for i in range(len(param_is_input)) if param_is_input[i]] + params_with_names = [t + ' ' + name for t, name in zip(input_param_types, input_param_names)] + + # Params that are only outputs: they should be declared in function. Assume that they are default constructible + param_is_only_output = [not is_input and is_output for is_input, is_output in zip(param_is_input, param_is_output)] + param_declarations = [f'{params_strs[i]} {param_names[i]};' for i in range(len(param_is_only_output)) if param_is_only_output[i]] + param_declarations = '\n'.join(param_declarations) + # Name of params that should be returned in tuple + output_param_names = [param_names[i] for i in range(len(param_is_output)) if param_is_output[i]] + if not method.static: self_param_with_name = name_cpp + '& self' method_caller = 'self.' @@ -331,19 +354,20 @@ def define_classical_method(method: types.Method, method_config, specs): method_caller = name_cpp + '::' if return_type is None or return_type == 'void': - lambda_body = f''' - {method_caller}{method_name}({", ".join(param_names)}); - return py::make_tuple({", ".join(immutable_param_names)}); -''' + maybe_get_return = '' + maybe_return_in_tuple = '' else: - lambda_body = f''' - auto res = {method_caller}{method_name}({", ".join(param_names)}); - return py::make_tuple(res, {", ".join(immutable_param_names)}); + maybe_get_return = 'auto res = ' + maybe_return_in_tuple = 'res, ' + + lambda_body = f''' + {param_declarations} + {maybe_get_return}{method_caller}{method_name}({", ".join(param_names)}); + return py::make_tuple({maybe_return_in_tuple}{", ".join(output_param_names)}); ''' final_lambda_params = [self_param_with_name] + params_with_names if self_param_with_name is not None else params_with_names method_body_str = define_lambda('', final_lambda_params, 'py::tuple', lambda_body) - print(f'REF TO IMMUT in method {method_name} parameters') else: method_body_str = ref_to_class_method(method, name_cpp, method_name, return_type, params_strs) diff --git a/modules/python/generator/submodule.py b/modules/python/generator/submodule.py index 41a5147073..bbd90d1737 100644 --- a/modules/python/generator/submodule.py +++ b/modules/python/generator/submodule.py @@ -149,6 +149,8 @@ def get_method_config(self, class_name: Optional[str], method, owner_specs, head res = { 'ignore': False, 'use_default_param_policy': False, + 'param_is_input': None, + 'param_is_output': None, 'custom_name': None, 'custom_code': None } @@ -169,7 +171,7 @@ def get_method_config(self, class_name: Optional[str], method, owner_specs, head return res def get_submodules(include_path: Path, generate_path: Path) -> List[Submodule]: - modules = ['core', 'vision', 'visual_features', 'vs', 'sensor', 'io', 'detection', 'robot'] + modules = ['core', 'imgproc', 'vision', 'visual_features', 'vs', 'sensor', 'io', 'detection', 'robot'] result = [] for module in modules: result.append(Submodule(module, Path(f'/home/sfelton/software/visp-sfelton/modules/{module}/include/visp3/{module}'), generate_path / f'{module}.cpp')) diff --git a/modules/python/generator/utils.py b/modules/python/generator/utils.py index f9fe7b7dc2..6c59d3cbf3 100644 --- a/modules/python/generator/utils.py +++ b/modules/python/generator/utils.py @@ -14,6 +14,9 @@ def get_name(name: types.PQName) -> str: ''' return '::'.join([segment.name for segment in name.segments]) +def name_is_anonymous(name: types.PQName) -> bool: + return any(isinstance(s, types.AnonymousName) for s in name.segments) + def get_typename(typename: types.PQName, owner_specs, header_env_mapping) -> str: '''Resolve the string representation of a raw type, resolving template specializations and using complete typenames (aliases, shortened names when in same namescope). From a4bb2f685fbc4a77ddc6da2dcea7abfb2432c130 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Wed, 4 Oct 2023 12:47:58 +0200 Subject: [PATCH 057/169] Better tuple return, better doc for methods with modified returntype --- modules/python/config/visual_features.json | 23 ++++++++- .../docs/_templates/custom-class-template.rst | 2 +- modules/python/generator/doc_parser.py | 25 +++++++--- modules/python/generator/header.py | 47 +++++++++++-------- modules/python/generator/methods.py | 5 +- 5 files changed, 72 insertions(+), 30 deletions(-) diff --git a/modules/python/config/visual_features.json b/modules/python/config/visual_features.json index f9917c803f..20567de6a4 100644 --- a/modules/python/config/visual_features.json +++ b/modules/python/config/visual_features.json @@ -1,3 +1,24 @@ { - "ignored_headers": ["vpFeatureException.h"] + "ignored_headers": ["vpFeatureException.h"], + "classes": { + "vpGenericFeature": { + "methods": [ + { + "static": false, + "signature": "void get_s(double&)", + "ignore": true + }, + { + "static": false, + "signature": "void get_s(double&, double&)", + "ignore": true + }, + { + "static": false, + "signature": "void get_s(double&, double&, double&)", + "ignore": true + } + ] + } + } } \ No newline at end of file diff --git a/modules/python/docs/_templates/custom-class-template.rst b/modules/python/docs/_templates/custom-class-template.rst index 4b77aa1a18..ed587e9843 100644 --- a/modules/python/docs/_templates/custom-class-template.rst +++ b/modules/python/docs/_templates/custom-class-template.rst @@ -6,7 +6,7 @@ :members: :show-inheritance: :member-order: groupwise - :inherited-members: pybind11_object + :inherited-members: pybind11_object, pybind11_type :special-members: {% block methods %} diff --git a/modules/python/generator/doc_parser.py b/modules/python/generator/doc_parser.py index 29bfa7ecee..15fa0d3bfd 100644 --- a/modules/python/generator/doc_parser.py +++ b/modules/python/generator/doc_parser.py @@ -236,7 +236,8 @@ def generate_class_description_string(self, compounddef: compounddefType) -> str detailed = process_description(compounddef.get_detaileddescription()) return brief + '\n\n' + detailed - def get_documentation_for_method(self, cls_name: str, signature: MethodDocSignature, cpp_ref_to_python: Dict[str, str], specs: Dict[str, str]) -> Optional[MethodDocumentation]: + def get_documentation_for_method(self, cls_name: str, signature: MethodDocSignature, cpp_ref_to_python: Dict[str, str], + specs: Dict[str, str], input_param_names: List[str], output_param_names: List[str]) -> Optional[MethodDocumentation]: method_def = self.elements.methods.get((cls_name, signature)) if method_def is None: return None @@ -244,11 +245,23 @@ def get_documentation_for_method(self, cls_name: str, signature: MethodDocSignat descr = self.generate_method_description_string(method_def) params_dict = self.get_method_params(method_def) - param_strs = [f':param {name}: {descr}' for name, descr in params_dict.items()] - param_str = '\n'.join(param_strs) - cpp_return_str = self.get_method_return_str(method_def) - return_str = f':return: {cpp_return_str}' if len(cpp_return_str) > 0 else '' + param_strs = [] + for param_name in input_param_names: + if param_name in params_dict: + param_strs.append(f':param {param_name}: {params_dict[param_name]}') + param_str = '\n'.join(param_strs) + if len(output_param_names) > 0: + return_str = ':return: A tuple containing:\n' + if signature.ret != 'void' and signature.ret is not None: + return_str += f'\n\t * {cpp_return_str}' + for param_name in output_param_names: + if param_name in params_dict: + return_str += f'\n\t * {param_name}: {params_dict[param_name]}' + else: + return_str += f'\n\t * {param_name}' + else: + return_str = f':return: {cpp_return_str}' if len(cpp_return_str) > 0 else '' res = to_cstring('\n\n'.join([descr, param_str, return_str])) return MethodDocumentation(res) @@ -273,7 +286,7 @@ def get_method_params(self, method_def: doxmlparser.memberdefType) -> Dict[str, from functools import reduce name_list: List[doxmlparser.compound.docParamName] = reduce(lambda all, pnl: all + pnl.parametername, param_info.parameternamelist, []) param_descr: doxmlparser.compound.descriptionType = param_info.parameterdescription - param_descr_str = ' '.join(map(lambda para: process_paragraph(para, 0), param_descr.para)).lstrip(': ') + param_descr_str = ' '.join(map(lambda para: process_paragraph(para, 0), param_descr.para)).lstrip(': ').strip().replace('\n', '\n\t') for param_name in name_list: params_dict[param_name.valueOf_] = param_descr_str return params_dict diff --git a/modules/python/generator/header.py b/modules/python/generator/header.py index 146ac3f227..5a28ba341b 100644 --- a/modules/python/generator/header.py +++ b/modules/python/generator/header.py @@ -154,7 +154,7 @@ def run_preprocessor(self): # TODO: run without generating a new file '-D', 'DOXYGEN_SHOULD_SKIP_THIS', # Skip methods and classes that are not exposed in documentation: they are internals '-I', '/home/sfelton/software/visp_build/include', '-I', '/usr/local/include', - #'-I', '/usr/include', + '-I', '/usr/include', '-N', 'VISP_BUILD_DEPRECATED_FUNCTIONS', '--passthru-includes', "^((?!vpConfig.h).)*$", '--passthru-unfound-includes', @@ -305,37 +305,42 @@ def define_classical_method(method: types.Method, method_config, specs): py_method_name = method_config.get('custom_name') or method_name return_type = get_type(method.return_type, specs, header_env.mapping) + # Detect input and output parameters for a method + use_default_param_policy = method_config['use_default_param_policy'] + param_is_input, param_is_output = method_config['param_is_input'], method_config['param_is_output'] + if use_default_param_policy or param_is_input is None and param_is_output is None: + param_is_input = [True for _ in range(len(method.parameters))] + param_is_output = list(map(lambda param: is_non_const_ref_to_immutable_type(param.type), method.parameters)) + if any(param_is_output): # Emit a warning when using default policy + method_signature = get_method_signature(method_name, + get_type(method.return_type, {}, header_env.mapping), + [get_type(param.type, {}, header_env.mapping) for param in method.parameters]) + self.submodule.report.add_default_policy_method(name_cpp_no_template, method, method_signature, param_is_input, param_is_output) + + # Get parameter names + param_names = [param.name or 'arg' + str(i) for i, param in enumerate(method.parameters)] + input_param_names = [param_names[i] for i in range(len(param_is_input)) if param_is_input[i]] + output_param_names = [param_names[i] for i in range(len(param_is_output)) if param_is_output[i]] + # Fetch documentation if available if self.documentation_holder is not None: method_doc_signature = MethodDocSignature(method_name, get_type(method.return_type, {}, header_env.mapping), # Don't use specializations so that we can match with doc [get_type(param.type, {}, header_env.mapping) for param in method.parameters], method.const, method.static) - method_doc = self.documentation_holder.get_documentation_for_method(name_cpp_no_template, method_doc_signature, {}, specs) + method_doc = self.documentation_holder.get_documentation_for_method(name_cpp_no_template, method_doc_signature, {}, specs, input_param_names, output_param_names) if method_doc is None: print(f'Could not find documentation for {name_cpp}::{method_name}!') else: py_arg_strs = [method_doc.documentation] + py_arg_strs - # Detect input and output parameters for a method - use_default_param_policy = method_config['use_default_param_policy'] - param_is_input, param_is_output = method_config['param_is_input'], method_config['param_is_output'] - if use_default_param_policy or param_is_input is None and param_is_output is None: - param_is_input = [True for _ in range(len(method.parameters))] - param_is_output = list(map(lambda param: is_non_const_ref_to_immutable_type(param.type), method.parameters)) - if any(param_is_output): - method_signature = get_method_signature(method_name, - get_type(method.return_type, {}, header_env.mapping), - [get_type(param.type, {}, header_env.mapping) for param in method.parameters]) - self.submodule.report.add_default_policy_method(name_cpp_no_template, method, method_signature, param_is_input, param_is_output) + # If a function has refs to immutable params, we need to return them. should_wrap_for_tuple_return = param_is_output is not None and any(param_is_output) if should_wrap_for_tuple_return: - param_names = [param.name or 'arg' + i for i, param in enumerate(method.parameters)] # Arguments that are inputs to the lambda function that wraps the ViSP function - input_param_names = [param_names[i] for i in range(len(param_is_input)) if param_is_input[i]] input_param_types = [params_strs[i] for i in range(len(param_is_input)) if param_is_input[i]] params_with_names = [t + ' ' + name for t, name in zip(input_param_types, input_param_names)] @@ -343,9 +348,6 @@ def define_classical_method(method: types.Method, method_config, specs): param_is_only_output = [not is_input and is_output for is_input, is_output in zip(param_is_input, param_is_output)] param_declarations = [f'{params_strs[i]} {param_names[i]};' for i in range(len(param_is_only_output)) if param_is_only_output[i]] param_declarations = '\n'.join(param_declarations) - # Name of params that should be returned in tuple - output_param_names = [param_names[i] for i in range(len(param_is_output)) if param_is_output[i]] - if not method.static: self_param_with_name = name_cpp + '& self' method_caller = 'self.' @@ -360,13 +362,18 @@ def define_classical_method(method: types.Method, method_config, specs): maybe_get_return = 'auto res = ' maybe_return_in_tuple = 'res, ' + if len(output_param_names) == 1 and (return_type is None or return_type == 'void'): + return_str = output_param_names[0] + else: + return_str = f'std::make_tuple({maybe_return_in_tuple}{", ".join(output_param_names)})' + lambda_body = f''' {param_declarations} {maybe_get_return}{method_caller}{method_name}({", ".join(param_names)}); - return py::make_tuple({maybe_return_in_tuple}{", ".join(output_param_names)}); + return {return_str}; ''' final_lambda_params = [self_param_with_name] + params_with_names if self_param_with_name is not None else params_with_names - method_body_str = define_lambda('', final_lambda_params, 'py::tuple', lambda_body) + method_body_str = define_lambda('', final_lambda_params, None, lambda_body) else: method_body_str = ref_to_class_method(method, name_cpp, method_name, return_type, params_strs) diff --git a/modules/python/generator/methods.py b/modules/python/generator/methods.py index 48dae29a2a..daa7b5bfc4 100644 --- a/modules/python/generator/methods.py +++ b/modules/python/generator/methods.py @@ -107,9 +107,10 @@ def define_constructor(params: List[str], additional_args: List[str]) -> str: additional_args_str = ', ' + additional_args_str return f'def(py::init<{", ".join(params)}>(){additional_args_str})' -def define_lambda(capture: str, params: List[str], return_type: str, body: str) -> str: +def define_lambda(capture: str, params: List[str], return_type: Optional[str], body: str) -> str: + return_str = f'-> {return_type}' if return_type else '' return f''' -[{capture}]({", ".join(params)}) -> {return_type} {{ +[{capture}]({", ".join(params)}) {return_str} {{ {body} }} From 7f00f6dd30b51e1cf0dbe03db688614ae81649e9 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Wed, 4 Oct 2023 16:36:47 +0200 Subject: [PATCH 058/169] refactor method generation, improve documentation --- modules/python/docs/static/todos.rst | 3 +- modules/python/generator/doc_parser.py | 81 ++++++++++++++----- modules/python/generator/header.py | 108 +++++-------------------- modules/python/generator/methods.py | 89 +++++++++++++++++++- 4 files changed, 171 insertions(+), 110 deletions(-) diff --git a/modules/python/docs/static/todos.rst b/modules/python/docs/static/todos.rst index f7392b84c5..67efaf2aa0 100644 --- a/modules/python/docs/static/todos.rst +++ b/modules/python/docs/static/todos.rst @@ -2,12 +2,13 @@ List of todos ====================== * There is an issue when indexing readonly arrays such as HomogeneousMatrix or RotationMatrix - * Generate documentation for enums * In classes, generate documentation for: constructors, operators +* Default values for parameters * Unary and n ary operators * Exclude get operators for vpArray2D ? * Parse subnamespaces * Be careful of the anonymous namespace: this namespace is only visible in header, so it should be ignored +* Parse "free" functions (See imgproc module) * How should we handle parameters coming from external APIs ? e.g. realsense2, PCL. Can we interact with other bindings such as of opencv's * Reimplement a framegrabber tutorial in python, with matplotlib \ No newline at end of file diff --git a/modules/python/generator/doc_parser.py b/modules/python/generator/doc_parser.py index 15fa0d3bfd..77abb0785e 100644 --- a/modules/python/generator/doc_parser.py +++ b/modules/python/generator/doc_parser.py @@ -46,6 +46,7 @@ def get_xml_path_if_exists(name: str, kind: DocumentationObjectKind) -> Optional def to_cstring(s: str) -> str: s = s.replace('\t', ' ') + s = re.sub('\n\n\n+', '\n\n', s) return f'''R"doc( {s} )doc"''' @@ -81,53 +82,97 @@ class DocElements(object): methods: Dict[Tuple[str, MethodDocSignature], List[doxmlparser.memberdefType]] -def process_mixed_container(container: MixedContainer, level: int) -> str: +IGNORED_MIXED_CONTAINERS = [ + + 'parameterlist' +] + +IGNORED_SIMPLE_SECTS = [ + 'author', + 'date', +] + +def process_mixed_container(container: MixedContainer, level: int, level_string='') -> str: + ''' + :param level_string: the string being built for a single level (e.g. a line/paragraph of text) + ''' + if container.name in IGNORED_MIXED_CONTAINERS: + return level_string one_indent = ' ' * 2 indent_str = one_indent * level + requires_space = not level_string.endswith(('\n', '\t', ' ')) and len(level_string) > 0 + # Inline blocks if isinstance(container.value, str): - return container.value.replace('\n', '\n' + indent_str).strip() - # text + return level_string + container.value.replace('\n', '\n' + indent_str).strip() if container.name == 'text': return container.value.replace('\n', '\n' + indent_str).strip() if container.name == 'bold': - return ' **' + container.value.valueOf_ + '** ' + markup_start = '**' if not requires_space or len(level_string) == 0 else ' **' + return level_string + markup_start + container.value.valueOf_ + '** ' + if container.name == 'computeroutput': + markup_start = '`' if not requires_space or len(level_string) == 0 else ' `' + return level_string + markup_start + container.value.valueOf_ + '` ' if container.name == 'emphasis': - return ' *' + container.value.valueOf_ + '* ' + markup_start = '*' if not requires_space else ' *' + return level_string + markup_start + container.value.valueOf_ + '* ' if container.name == 'sp': - return ' ' + return level_string + ' ' + if container.name == 'linebreak': + return level_string + '\n' + if container.name == 'heading': + text = container.value.valueOf_ + new_line_with_sep = '\n' + indent_str + '=' * len(text) + return level_string + new_line_with_sep + '\n' + indent_str + text + new_line_with_sep + if container.name == 'ulink': + url: doxmlparser.docURLLink = container.value + text = url.valueOf_ + url_value = url.url + return level_string + (' ' if requires_space else '') + f'`{text} <{url_value}>`_ ' + if container.name == 'formula': v: str = container.value.valueOf_.strip() if v.startswith(('\\[', '$$')): pure_math = indent_str + one_indent + v[2:-2].replace('\n', '') - return ('\n' + indent_str) * 2 + '.. math::' + '\n' + pure_math + '\n' + '\n' + return level_string + ('\n' + indent_str) * 2 + '.. math::' + '\n' + pure_math + '\n' + '\n' else: pure_math = v[1:-1].replace('\n', indent_str + one_indent) - return ' :math:`' + pure_math.strip() + '` ' + return level_string + (' ' if requires_space else '') + ':math:`' + pure_math.strip() + '` ' if container.name == 'ref': # TODO: replace with Python refs if possible - return ' ' + container.value.valueOf_ + ' ' + return level_string + (' ' if requires_space else '') + container.value.valueOf_ + ' ' if container.name == 'verbatim': raise NotImplementedError() + # Block types if container.name == 'simplesect': process_fn = lambda item: process_paragraph(item, level + 1) res = '\n' + kind = container.value.kind + if kind in IGNORED_SIMPLE_SECTS: + return level_string item_content = '\n'.join(map(process_fn, container.value.para)) item_content = re.sub('\n\n\n+', '\n\n', item_content) - kind = container.value.kind if kind == 'note': res += '\n' + indent_str + '.. note:: ' + item_content + '\n' + indent_str elif kind == 'warning' or kind == 'attention': res += '\n' + indent_str + '.. warning:: ' + item_content + '\n' + indent_str elif kind == 'see': - res += '\n' + indent_str + '.. note:: See' + item_content + '\n' + indent_str + res += '\n' + indent_str + '.. note:: See ' + item_content + '\n' + indent_str elif kind == 'return': # Don't do anything, we will parse them separately when we get method documentation return '' else: res += '\n' + f'' - return res + '\n' + return level_string + res + '\n' + + if container.name == 'blockquote': + blockquote: doxmlparser.docBlockQuoteType = container.value + process_fn = lambda item: process_paragraph(item, level + 1) + res = '\n' + item_content = '\n'.join(map(process_fn, blockquote.para)) + return level_string + item_content + '\n' + if container.name == 'programlisting': program: doxmlparser.listingType = container.value @@ -137,17 +182,17 @@ def process_mixed_container(container: MixedContainer, level: int) -> str: for line in codelines: cs = [] for h in line.highlight: - c = ''.join([process_mixed_container(h, level) for h in h.content_]) + c = '' + for hh in h.content_: + c = process_mixed_container(hh, level, c) cs.append(c) s = ''.join(cs) lines.append(s) code = ('\n' + indent_str + one_indent).join(lines) res += code + '\n\n' - return res + return level_string + res - if container.name == 'parameterlist': # Parameter list is ignored since we have custom parsing for it - return '' if container.name == 'itemizedlist': items: List[doxmlparser.docListItemType] = container.value.listitem @@ -158,7 +203,7 @@ def process_mixed_container(container: MixedContainer, level: int) -> str: item_content = re.sub('\n\n\n+', '\n\n', item_content) #item_content = item_content.replace('\n' + indent_str, '\n' + indent_str + ' ') res += '\n' + indent_str + '* ' + item_content + '\n' + indent_str - return res + '\n' + return level_string + res + '\n' return f'' @@ -167,7 +212,7 @@ def process_paragraph(para: docParaType, level: int) -> str: res = '' contents: List[MixedContainer] = para.content_ for content_item in contents: - res += process_mixed_container(content_item, level) + res = process_mixed_container(content_item, level, res) return res def process_description(brief: Optional[descriptionType]) -> str: diff --git a/modules/python/generator/header.py b/modules/python/generator/header.py index 5a28ba341b..7603f7ef17 100644 --- a/modules/python/generator/header.py +++ b/modules/python/generator/header.py @@ -16,7 +16,12 @@ if TYPE_CHECKING: from submodule import Submodule - +@dataclass +class BoundObjectNames: + python_ident: str + python_name: str + cpp_no_template_name: str + cpp_name: str def filter_includes(include_names: Set[str]) -> List[str]: result = [] @@ -154,7 +159,7 @@ def run_preprocessor(self): # TODO: run without generating a new file '-D', 'DOXYGEN_SHOULD_SKIP_THIS', # Skip methods and classes that are not exposed in documentation: they are internals '-I', '/home/sfelton/software/visp_build/include', '-I', '/usr/local/include', - '-I', '/usr/include', + #'-I', '/usr/include', '-N', 'VISP_BUILD_DEPRECATED_FUNCTIONS', '--passthru-includes', "^((?!vpConfig.h).)*$", '--passthru-unfound-includes', @@ -230,7 +235,8 @@ def generate_class_with_potiental_specialization(name_python: str, owner_specs: contains_pure_virtual_methods = True break # User marked this class as virtual. - # This is required if no virtual method is declared in this class, but it does not implement pure virtual methods of a base class + # This is required if no virtual method is declared in this class, + # but it does not implement pure virtual methods of a base class contains_pure_virtual_methods = contains_pure_virtual_methods or cls_config['is_virtual'] # Find bindable methods @@ -298,92 +304,8 @@ def generate_class_with_potiental_specialization(name_python: str, owner_specs: method_strs.append(operator_str) break - def define_classical_method(method: types.Method, method_config, specs): - params_strs = [get_type(param.type, specs, header_env.mapping) for param in method.parameters] - py_arg_strs = [f'py::arg("{param.name}")' for param in method.parameters] - method_name = get_name(method.name) - py_method_name = method_config.get('custom_name') or method_name - return_type = get_type(method.return_type, specs, header_env.mapping) - - # Detect input and output parameters for a method - use_default_param_policy = method_config['use_default_param_policy'] - param_is_input, param_is_output = method_config['param_is_input'], method_config['param_is_output'] - if use_default_param_policy or param_is_input is None and param_is_output is None: - param_is_input = [True for _ in range(len(method.parameters))] - param_is_output = list(map(lambda param: is_non_const_ref_to_immutable_type(param.type), method.parameters)) - if any(param_is_output): # Emit a warning when using default policy - method_signature = get_method_signature(method_name, - get_type(method.return_type, {}, header_env.mapping), - [get_type(param.type, {}, header_env.mapping) for param in method.parameters]) - self.submodule.report.add_default_policy_method(name_cpp_no_template, method, method_signature, param_is_input, param_is_output) - - # Get parameter names - param_names = [param.name or 'arg' + str(i) for i, param in enumerate(method.parameters)] - input_param_names = [param_names[i] for i in range(len(param_is_input)) if param_is_input[i]] - output_param_names = [param_names[i] for i in range(len(param_is_output)) if param_is_output[i]] - - # Fetch documentation if available - if self.documentation_holder is not None: - method_doc_signature = MethodDocSignature(method_name, - get_type(method.return_type, {}, header_env.mapping), # Don't use specializations so that we can match with doc - [get_type(param.type, {}, header_env.mapping) for param in method.parameters], - method.const, method.static) - method_doc = self.documentation_holder.get_documentation_for_method(name_cpp_no_template, method_doc_signature, {}, specs, input_param_names, output_param_names) - if method_doc is None: - print(f'Could not find documentation for {name_cpp}::{method_name}!') - else: - py_arg_strs = [method_doc.documentation] + py_arg_strs - - - - # If a function has refs to immutable params, we need to return them. - should_wrap_for_tuple_return = param_is_output is not None and any(param_is_output) - if should_wrap_for_tuple_return: - - # Arguments that are inputs to the lambda function that wraps the ViSP function - input_param_types = [params_strs[i] for i in range(len(param_is_input)) if param_is_input[i]] - params_with_names = [t + ' ' + name for t, name in zip(input_param_types, input_param_names)] - - # Params that are only outputs: they should be declared in function. Assume that they are default constructible - param_is_only_output = [not is_input and is_output for is_input, is_output in zip(param_is_input, param_is_output)] - param_declarations = [f'{params_strs[i]} {param_names[i]};' for i in range(len(param_is_only_output)) if param_is_only_output[i]] - param_declarations = '\n'.join(param_declarations) - if not method.static: - self_param_with_name = name_cpp + '& self' - method_caller = 'self.' - else: - self_param_with_name = None - method_caller = name_cpp + '::' - - if return_type is None or return_type == 'void': - maybe_get_return = '' - maybe_return_in_tuple = '' - else: - maybe_get_return = 'auto res = ' - maybe_return_in_tuple = 'res, ' - - if len(output_param_names) == 1 and (return_type is None or return_type == 'void'): - return_str = output_param_names[0] - else: - return_str = f'std::make_tuple({maybe_return_in_tuple}{", ".join(output_param_names)})' - - lambda_body = f''' - {param_declarations} - {maybe_get_return}{method_caller}{method_name}({", ".join(param_names)}); - return {return_str}; -''' - final_lambda_params = [self_param_with_name] + params_with_names if self_param_with_name is not None else params_with_names - method_body_str = define_lambda('', final_lambda_params, None, lambda_body) - - else: - method_body_str = ref_to_class_method(method, name_cpp, method_name, return_type, params_strs) - - method_str = define_method(py_method_name, method_body_str, py_arg_strs, method.static) - method_str = f'{python_ident}.{method_str};' - method_strs.append(method_str) - generated_methods.append((py_method_name, method)) - # Define classical methods + class_def_names = BoundObjectNames(python_ident, name_python, name_cpp_no_template, name_cpp) for method, method_config in basic_methods: if method.template is not None and method_config.get('specializations') is not None: method_template_names = [t.name for t in method.template.params] @@ -393,9 +315,15 @@ def define_classical_method(method: types.Method, method_config, specs): assert len(method_template_names) == len(method_spec) method_spec_dict = OrderedDict(k for k in zip(method_template_names, method_spec)) new_specs.update(method_spec_dict) - define_classical_method(method, method_config, new_specs) + method_str, generated_method_tuple = define_method(method, method_config, True, + new_specs, self, header_env, class_def_names) + method_strs.append(method_str) + generated_methods.append(generated_method_tuple) else: - define_classical_method(method, method_config, owner_specs) + method_str, generated_method_tuple = define_method(method, method_config, True, + owner_specs, self, header_env, class_def_names) + method_strs.append(method_str) + generated_methods.append(generated_method_tuple) # Add to string representation if not cls_config['ignore_repr']: diff --git a/modules/python/generator/methods.py b/modules/python/generator/methods.py index daa7b5bfc4..98cbf1c638 100644 --- a/modules/python/generator/methods.py +++ b/modules/python/generator/methods.py @@ -12,8 +12,10 @@ from enum import Enum from typing import TYPE_CHECKING +from doc_parser import MethodDocSignature if TYPE_CHECKING: from submodule import Submodule + from header import HeaderFile, HeaderEnvironment, BoundObjectNames def cpp_operator_list(): ''' @@ -94,13 +96,98 @@ def ref_to_class_method(method: types.Method, cls_name: str, method_name: str, r cast_str = f'{return_type} {pointer_to_type}({", ".join(params)}) {maybe_const}' return f'static_cast<{cast_str}>(&{cls_name}::{method_name})' -def define_method(py_name: str, method: str, additional_args: List[str], static: bool) -> str: +def method_def(py_name: str, method: str, additional_args: List[str], static: bool) -> str: def_type = 'def' if not static else 'def_static' additional_args_str = ', '.join(additional_args) if len(additional_args) > 0: additional_args_str = ', ' + additional_args_str return f'{def_type}("{py_name}", {method}{additional_args_str})' + +def define_method(method: types.Method, method_config: Dict, is_class_method, specs: Dict, header: 'HeaderFile', header_env: 'HeaderEnvironment', bound_object: 'BoundObjectNames'): + params_strs = [get_type(param.type, specs, header_env.mapping) for param in method.parameters] + py_arg_strs = [f'py::arg("{param.name}")' for param in method.parameters] + method_name = get_name(method.name) + py_method_name = method_config.get('custom_name') or method_name + return_type = get_type(method.return_type, specs, header_env.mapping) + + # Detect input and output parameters for a method + use_default_param_policy = method_config['use_default_param_policy'] + param_is_input, param_is_output = method_config['param_is_input'], method_config['param_is_output'] + if use_default_param_policy or param_is_input is None and param_is_output is None: + param_is_input = [True for _ in range(len(method.parameters))] + param_is_output = list(map(lambda param: is_non_const_ref_to_immutable_type(param.type), method.parameters)) + if any(param_is_output): # Emit a warning when using default policy + method_signature = get_method_signature(method_name, + get_type(method.return_type, {}, header_env.mapping), + [get_type(param.type, {}, header_env.mapping) for param in method.parameters]) + header.submodule.report.add_default_policy_method(bound_object.cpp_no_template_name, method, method_signature, param_is_input, param_is_output) + + # Get parameter names + param_names = [param.name or 'arg' + str(i) for i, param in enumerate(method.parameters)] + input_param_names = [param_names[i] for i in range(len(param_is_input)) if param_is_input[i]] + output_param_names = [param_names[i] for i in range(len(param_is_output)) if param_is_output[i]] + + # Fetch documentation if available + if header.documentation_holder is not None: + method_doc_signature = MethodDocSignature(method_name, + get_type(method.return_type, {}, header_env.mapping), # Don't use specializations so that we can match with doc + [get_type(param.type, {}, header_env.mapping) for param in method.parameters], + method.const, method.static) + method_doc = header.documentation_holder.get_documentation_for_method(bound_object.cpp_no_template_name, method_doc_signature, {}, specs, input_param_names, output_param_names) + if method_doc is None: + print(f'Could not find documentation for {bound_object.cpp_name}::{method_name}!') + else: + py_arg_strs = [method_doc.documentation] + py_arg_strs + + + + # If a function has refs to immutable params, we need to return them. + should_wrap_for_tuple_return = param_is_output is not None and any(param_is_output) + if should_wrap_for_tuple_return: + + # Arguments that are inputs to the lambda function that wraps the ViSP function + input_param_types = [params_strs[i] for i in range(len(param_is_input)) if param_is_input[i]] + params_with_names = [t + ' ' + name for t, name in zip(input_param_types, input_param_names)] + + # Params that are only outputs: they should be declared in function. Assume that they are default constructible + param_is_only_output = [not is_input and is_output for is_input, is_output in zip(param_is_input, param_is_output)] + param_declarations = [f'{params_strs[i]} {param_names[i]};' for i in range(len(param_is_only_output)) if param_is_only_output[i]] + param_declarations = '\n'.join(param_declarations) + if not method.static: + self_param_with_name = bound_object.cpp_name + '& self' + method_caller = 'self.' + else: + self_param_with_name = None + method_caller = bound_object.cpp_name + '::' + + if return_type is None or return_type == 'void': + maybe_get_return = '' + maybe_return_in_tuple = '' + else: + maybe_get_return = 'auto res = ' + maybe_return_in_tuple = 'res, ' + + if len(output_param_names) == 1 and (return_type is None or return_type == 'void'): + return_str = output_param_names[0] + else: + return_str = f'std::make_tuple({maybe_return_in_tuple}{", ".join(output_param_names)})' + + lambda_body = f''' + {param_declarations} + {maybe_get_return}{method_caller}{method_name}({", ".join(param_names)}); + return {return_str}; + ''' + final_lambda_params = [self_param_with_name] + params_with_names if self_param_with_name is not None else params_with_names + method_body_str = define_lambda('', final_lambda_params, None, lambda_body) + + else: + method_body_str = ref_to_class_method(method, bound_object.cpp_name, method_name, return_type, params_strs) + + method_str = method_def(py_method_name, method_body_str, py_arg_strs, method.static) + method_str = f'{bound_object.python_ident}.{method_str};' + return method_str, (py_method_name, method) + def define_constructor(params: List[str], additional_args: List[str]) -> str: additional_args_str = ', '.join(additional_args) if len(additional_args) > 0: From 71917ae3f1141b15a3dcda9db8ced95f07d2a9b7 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Wed, 4 Oct 2023 16:56:49 +0200 Subject: [PATCH 059/169] remove py_args helpers for parameters that become output only --- modules/python/generator/methods.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/modules/python/generator/methods.py b/modules/python/generator/methods.py index 98cbf1c638..aaf3e17a30 100644 --- a/modules/python/generator/methods.py +++ b/modules/python/generator/methods.py @@ -122,7 +122,7 @@ def define_method(method: types.Method, method_config: Dict, is_class_method, sp get_type(method.return_type, {}, header_env.mapping), [get_type(param.type, {}, header_env.mapping) for param in method.parameters]) header.submodule.report.add_default_policy_method(bound_object.cpp_no_template_name, method, method_signature, param_is_input, param_is_output) - + py_arg_strs = [py_arg_strs[i] for i in range(len(params_strs)) if param_is_input[i]] # Get parameter names param_names = [param.name or 'arg' + str(i) for i, param in enumerate(method.parameters)] input_param_names = [param_names[i] for i in range(len(param_is_input)) if param_is_input[i]] @@ -140,8 +140,6 @@ def define_method(method: types.Method, method_config: Dict, is_class_method, sp else: py_arg_strs = [method_doc.documentation] + py_arg_strs - - # If a function has refs to immutable params, we need to return them. should_wrap_for_tuple_return = param_is_output is not None and any(param_is_output) if should_wrap_for_tuple_return: From 59e5f7d3451ba7718976f014fa3a45dd63a5449d Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Thu, 5 Oct 2023 12:56:59 +0200 Subject: [PATCH 060/169] rework directory structure for future packaging, work on default parameters (enum params are buggy) --- modules/python/.gitignore | 3 +- modules/python/{ => bindings}/CMakeLists.txt | 0 .../python/{ => bindings}/include/core.hpp | 0 modules/python/{ => bindings}/pyproject.toml | 0 modules/python/{ => bindings}/setup.py | 1 - modules/python/build.sh | 2 +- modules/python/generator/generator.py | 2 +- modules/python/generator/header.py | 11 +++--- modules/python/generator/methods.py | 35 ++++++++++++++++++- 9 files changed, 43 insertions(+), 11 deletions(-) rename modules/python/{ => bindings}/CMakeLists.txt (100%) rename modules/python/{ => bindings}/include/core.hpp (100%) rename modules/python/{ => bindings}/pyproject.toml (100%) rename modules/python/{ => bindings}/setup.py (98%) diff --git a/modules/python/.gitignore b/modules/python/.gitignore index 3a1818b414..c53d2f4939 100644 --- a/modules/python/.gitignore +++ b/modules/python/.gitignore @@ -1,6 +1,5 @@ *.egg-info -src/generated -src/main.cpp +bindings/src build stubs/visp stubs/build diff --git a/modules/python/CMakeLists.txt b/modules/python/bindings/CMakeLists.txt similarity index 100% rename from modules/python/CMakeLists.txt rename to modules/python/bindings/CMakeLists.txt diff --git a/modules/python/include/core.hpp b/modules/python/bindings/include/core.hpp similarity index 100% rename from modules/python/include/core.hpp rename to modules/python/bindings/include/core.hpp diff --git a/modules/python/pyproject.toml b/modules/python/bindings/pyproject.toml similarity index 100% rename from modules/python/pyproject.toml rename to modules/python/bindings/pyproject.toml diff --git a/modules/python/setup.py b/modules/python/bindings/setup.py similarity index 98% rename from modules/python/setup.py rename to modules/python/bindings/setup.py index 292f59299e..8a4cf21416 100644 --- a/modules/python/setup.py +++ b/modules/python/bindings/setup.py @@ -161,7 +161,6 @@ def build_extension(self, ext: CMakeExtension) -> None: cmdclass={"build_ext": CMakeBuild, 'build': build, 'install': CustomInstall}, zip_safe=False, include_package_data=True, - # package_data={'visp': ["py.typed", *find_stubs(path=stubs_path)]}, extras_require={"test": ["pytest>=6.0"]}, python_requires=">=3.7", ) diff --git a/modules/python/build.sh b/modules/python/build.sh index 50ce42803a..be41b8d0e9 100755 --- a/modules/python/build.sh +++ b/modules/python/build.sh @@ -1 +1 @@ -python generator/generator.py && pip install . && rm -r stubs/build && pip install ./stubs && cd docs && rm -r _build && make html && cd .. \ No newline at end of file +python generator/generator.py && pip install ./bindings && rm -r stubs/build && pip install ./stubs && cd docs && rm -r _build && make html && cd .. \ No newline at end of file diff --git a/modules/python/generator/generator.py b/modules/python/generator/generator.py index 3db586406c..fdf2e3322b 100644 --- a/modules/python/generator/generator.py +++ b/modules/python/generator/generator.py @@ -84,4 +84,4 @@ def generate_module(generate_path: Path) -> None: main_file.write(format_str) if __name__ == '__main__': - generate_module(Path('src')) \ No newline at end of file + generate_module(Path('bindings/src')) \ No newline at end of file diff --git a/modules/python/generator/header.py b/modules/python/generator/header.py index 7603f7ef17..38a04e587d 100644 --- a/modules/python/generator/header.py +++ b/modules/python/generator/header.py @@ -159,7 +159,7 @@ def run_preprocessor(self): # TODO: run without generating a new file '-D', 'DOXYGEN_SHOULD_SKIP_THIS', # Skip methods and classes that are not exposed in documentation: they are internals '-I', '/home/sfelton/software/visp_build/include', '-I', '/usr/local/include', - #'-I', '/usr/include', + '-I', '/usr/include', '-N', 'VISP_BUILD_DEPRECATED_FUNCTIONS', '--passthru-includes', "^((?!vpConfig.h).)*$", '--passthru-unfound-includes', @@ -265,7 +265,7 @@ def generate_class_with_potiental_specialization(name_python: str, owner_specs: if not contains_pure_virtual_methods: for method, method_config in constructors: params_strs = [get_type(param.type, owner_specs, header_env.mapping) for param in method.parameters] - py_arg_strs = [f'py::arg("{param.name}")' for param in method.parameters] + py_arg_strs = get_py_args(method.parameters, owner_specs, header_env.mapping) ctor_str = f'''{python_ident}.{define_constructor(params_strs, py_arg_strs)};''' method_strs.append(ctor_str) @@ -278,6 +278,8 @@ def generate_class_with_potiental_specialization(name_python: str, owner_specs: method_is_const = method.const params_strs = [get_type(param.type, owner_specs, header_env.mapping) for param in method.parameters] return_type_str = get_type(method.return_type, owner_specs, header_env.mapping) + py_args = get_py_args(method.parameters, owner_specs, header_env.mapping) + py_args = py_args + ['py::is_operator()'] if len(params_strs) > 1: print(f'Found operator {name_cpp}{method_name} with more than one parameter, skipping') rejection = RejectedMethod(name_cpp, method, method_config, get_method_signature(method_name, return_type_str, params_strs), NotGeneratedReason.NotHandled) @@ -291,7 +293,7 @@ def generate_class_with_potiental_specialization(name_python: str, owner_specs: operator_str = f''' {python_ident}.def("__{python_op_name}__", []({"const" if method_is_const else ""} {name_cpp}& self, {params_strs[0]} o) {{ return (self {cpp_op} o); -}}, py::is_operator());''' +}}, {", ".join(py_args)});''' method_strs.append(operator_str) break for cpp_op, python_op_name in binary_in_place_ops.items(): @@ -300,7 +302,7 @@ def generate_class_with_potiental_specialization(name_python: str, owner_specs: {python_ident}.def("__{python_op_name}__", []({"const" if method_is_const else ""} {name_cpp}& self, {params_strs[0]} o) {{ self {cpp_op} o; return self; -}}, py::is_operator());''' +}}, {", ".join(py_args)});''' method_strs.append(operator_str) break @@ -384,7 +386,6 @@ def generate_class_with_potiental_specialization(name_python: str, owner_specs: name_python = spec['python_name'] args = spec['arguments'] assert len(template_names) == len(args), f'Specializing {name_cpp_no_template}: Template arguments are {template_names} but found specialization {args} which has the wrong number of arguments' - spec_dict = OrderedDict(k for k in zip(template_names, args)) specialization_strs.append(generate_class_with_potiental_specialization(name_python, spec_dict, cls_config)) diff --git a/modules/python/generator/methods.py b/modules/python/generator/methods.py index aaf3e17a30..37431fbaea 100644 --- a/modules/python/generator/methods.py +++ b/modules/python/generator/methods.py @@ -103,10 +103,43 @@ def method_def(py_name: str, method: str, additional_args: List[str], static: bo additional_args_str = ', ' + additional_args_str return f'{def_type}("{py_name}", {method}{additional_args_str})' +def tokens_to_str(tokens: List[types.Token]) -> str: + return ''.join([token.value for token in tokens]) + +def get_py_args(parameters: List[types.Parameter], specs, env_mapping) -> List[str]: + ''' + Get the py::arg parameters of a function binding definition. + They are used to give the argument their names in the doc and the api. + They can also have default values (optional arguments). + ''' + py_args = [] + for parameter in parameters: + if parameter.default is None: + py_args.append(f'py::arg("{parameter.name}")') + else: + t = parameter.type + gt = lambda typename: get_typename(typename, specs, env_mapping) + if isinstance(t, types.Type): + type_name = gt(t.typename) + elif isinstance(t, types.Reference): + type_name = gt(t.ref_to.typename) + else: + type_name = '' + + if type_name.startswith('std::vector'): + default_value = type_name + '()' + default_value_rep = '[]' + else: + default_value = tokens_to_str(parameter.default.tokens) + default_value_rep = default_value.strip('"') # To handle default char* and std::string args + + py_args.append(f'py::arg_v("{parameter.name}", {default_value}, "{default_value_rep}")') + + return py_args def define_method(method: types.Method, method_config: Dict, is_class_method, specs: Dict, header: 'HeaderFile', header_env: 'HeaderEnvironment', bound_object: 'BoundObjectNames'): params_strs = [get_type(param.type, specs, header_env.mapping) for param in method.parameters] - py_arg_strs = [f'py::arg("{param.name}")' for param in method.parameters] + py_arg_strs = get_py_args(method.parameters, specs, header_env.mapping) method_name = get_name(method.name) py_method_name = method_config.get('custom_name') or method_name return_type = get_type(method.return_type, specs, header_env.mapping) From 42014bd2e1f14b7ed30374dba1828b2dd3906106 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Thu, 5 Oct 2023 17:32:53 +0200 Subject: [PATCH 061/169] default values almost working, need to retrieve values from parent class... --- modules/python/bindings/CMakeLists.txt | 4 +-- modules/python/generator/enum_binding.py | 29 ++++++++++++++++------ modules/python/generator/generator.py | 7 ++++-- modules/python/generator/header.py | 31 +++++++++++++++--------- modules/python/generator/methods.py | 11 ++++++++- 5 files changed, 59 insertions(+), 23 deletions(-) diff --git a/modules/python/bindings/CMakeLists.txt b/modules/python/bindings/CMakeLists.txt index 7570274894..1dfb48f264 100644 --- a/modules/python/bindings/CMakeLists.txt +++ b/modules/python/bindings/CMakeLists.txt @@ -12,7 +12,7 @@ string(REPLACE ";" "\n" str "${VISP_LIBRARIES}") message(STATUS ${str}) message(${VISP_VERSION}) message(${pybind11_VERSION}) -file(GLOB generated_cpp src/generated/*.cpp) +file(GLOB generated_cpp src/*.cpp) file(GLOB static_cpp src/static/*.cpp) -pybind11_add_module(visp src/main.cpp ${generated_cpp} ${static_cpp} THIN_LTO) +pybind11_add_module(visp ${generated_cpp} ${static_cpp} THIN_LTO) target_link_libraries(visp PRIVATE ${VISP_LIBRARIES}) diff --git a/modules/python/generator/enum_binding.py b/modules/python/generator/enum_binding.py index 555b111d9d..8a57e78c71 100644 --- a/modules/python/generator/enum_binding.py +++ b/modules/python/generator/enum_binding.py @@ -33,7 +33,7 @@ def is_anonymous_name(typename: types.PQName) -> Tuple[bool, int]: for segment in typename.segments: if isinstance(segment, types.AnonymousName): return True, segment.id - return False, 0 + return False, None def get_owner_py_ident(owner_name: str, root_scope: NamespaceScope) -> Optional[str]: @@ -64,13 +64,12 @@ def get_cpp_identifier_scope(fully_qualified_name: str, root_scope: Union[Namesp return get_cpp_identifier_scope('::'.join(remainder), root_scope.namespaces[ns]) return root_scope - -def enum_bindings(root_scope: NamespaceScope, mapping: Dict, submodule: Submodule) -> List[Tuple[str, str]]: +def resolve_enums_and_typedefs(root_scope: NamespaceScope, mapping: Dict) -> Tuple[List[EnumRepr], List[EnumRepr]]: final_data: List[EnumRepr] = [] temp_data: List[EnumRepr] = [] # Data that is incomplete for preprocessing - match_id = lambda repr, enum_id: repr.id is not None and repr.id == enum_id + match_id = lambda repr, enum_id: repr.id is not None and enum_id is not None and repr.id == enum_id match_name = lambda repr, full_name: repr.name is not None and full_name is not None and repr.name == full_name - enum_repr_is_ready = lambda repr: repr.name is not None and repr.values is not None and repr.public_access + enum_repr_is_ready = lambda repr: repr.name is not None and repr.values is not None def accumulate_data(scope: Union[NamespaceScope, ClassScope]): if isinstance(scope, ClassScope): @@ -88,11 +87,12 @@ def accumulate_data(scope: Union[NamespaceScope, ClassScope]): anonymous_enum, enum_id = is_anonymous_name(enum.typename) full_name = get_typename(enum.typename, {}, mapping) if not anonymous_enum else None - + print('SAW ENUM NAME :', full_name, 'with values', enum.values) matches = lambda repr: match_id(repr, enum_id) or match_name(repr, full_name) matching = list(filter(matches, temp_data)) assert len(matching) <= 1, f"There cannot be more than one repr found. Matches = {matching}" if len(matching) == 0: + print('APPENDING ', EnumRepr(enum_id, full_name, enum.values, public_access)) temp_data.append(EnumRepr(enum_id, full_name, enum.values, public_access)) else: if full_name is not None: @@ -122,17 +122,32 @@ def accumulate_data(scope: Union[NamespaceScope, ClassScope]): matching[0].public_access = matching[0].public_access and public_access ready_enums = list(filter(enum_repr_is_ready, temp_data)) + print('READY ENUMS', ready_enums) for repr in ready_enums: final_data.append(repr) temp_data.remove(repr) accumulate_data(root_scope) + print(final_data, temp_data) + return final_data, temp_data + + +def enum_bindings(root_scope: NamespaceScope, mapping: Dict, submodule: Submodule) -> List[Tuple[str, str]]: + + final_data, temp_data = resolve_enums_and_typedefs(root_scope, mapping) + result = [] + final_reprs = [] + for repr in final_data: + if repr.public_access: + final_reprs.append(repr) + else: + temp_data.append(repr) for repr in temp_data: print(f'Enum {repr} was ignored, because it is either marked as private or it is incomplete (missing values or name)') - for enum_repr in final_data: + for enum_repr in final_reprs: name_segments = enum_repr.name.split('::') py_name = name_segments[-1].replace('vp', '') # If an owner class is ignored, don't export this enum diff --git a/modules/python/generator/generator.py b/modules/python/generator/generator.py index fdf2e3322b..c9b9147772 100644 --- a/modules/python/generator/generator.py +++ b/modules/python/generator/generator.py @@ -39,7 +39,7 @@ def main_str(submodule_fn_declarations, submodule_fn_calls): def generate_module(generate_path: Path) -> None: include_path = Path('/usr/local/include/visp3') - submodules: List[Submodule] = get_submodules(include_path, generate_path / 'generated') + submodules: List[Submodule] = get_submodules(include_path, generate_path) # Step 1: Preprocess all headers all_headers: List[HeaderFile] = [] @@ -84,4 +84,7 @@ def generate_module(generate_path: Path) -> None: main_file.write(format_str) if __name__ == '__main__': - generate_module(Path('bindings/src')) \ No newline at end of file + generation_path = Path('bindings/src') + generation_path.mkdir(exist_ok=True) + + generate_module(generation_path) \ No newline at end of file diff --git a/modules/python/generator/header.py b/modules/python/generator/header.py index 38a04e587d..55e4cd8a6f 100644 --- a/modules/python/generator/header.py +++ b/modules/python/generator/header.py @@ -70,9 +70,14 @@ def add_level(result: List['HeaderFile'], remainder: List['HeaderFile'], depende class HeaderEnvironment(): def __init__(self, data: ParsedData): - self.mapping = self.build_mapping(data.namespace) - - def build_mapping(self, data: Union[NamespaceScope, ClassScope], mapping={}, scope: str = ''): + self.mapping = self.build_naive_mapping(data.namespace) + from enum_binding import resolve_enums_and_typedefs + enum_reprs, _ = resolve_enums_and_typedefs(data.namespace, self.mapping) + for enum_repr in enum_reprs: + for value in enum_repr.values: + self.mapping[value.name] = enum_repr.name + '::' + value.name + + def build_naive_mapping(self, data: Union[NamespaceScope, ClassScope], mapping={}, scope: str = ''): if isinstance(data, NamespaceScope): for alias in data.using_alias: mapping[alias.alias] = get_type(alias.type, {}, mapping) @@ -82,14 +87,14 @@ def build_mapping(self, data: Union[NamespaceScope, ClassScope], mapping={}, sco for enum in data.enums: if not name_is_anonymous(enum.typename): enum_name = '::'.join([seg.name for seg in enum.typename.segments]) - print('MAPPING enum_name', enum_name) mapping[enum_name] = scope + enum_name + for cls in data.classes: cls_name = '::'.join([seg.name for seg in cls.class_decl.typename.segments]) mapping[cls_name] = scope + cls_name - mapping.update(self.build_mapping(cls, mapping=mapping, scope=f'{scope}{cls_name}::')) + mapping.update(self.build_naive_mapping(cls, mapping=mapping, scope=f'{scope}{cls_name}::')) for namespace in data.namespaces: - mapping.update(self.build_mapping(data.namespaces[namespace], mapping=mapping, scope=f'{scope}{namespace}::')) + mapping.update(self.build_naive_mapping(data.namespaces[namespace], mapping=mapping, scope=f'{scope}{namespace}::')) elif isinstance(data, ClassScope): for alias in data.using_alias: @@ -97,15 +102,14 @@ def build_mapping(self, data: Union[NamespaceScope, ClassScope], mapping={}, sco for typedef in data.typedefs: mapping[typedef.name] = scope + typedef.name for enum in data.enums: - print('MAPPING enum_name', enum.typename) if not name_is_anonymous(enum.typename): enum_name = '::'.join([seg.name for seg in enum.typename.segments]) mapping[enum_name] = scope + enum_name + for cls in data.classes: cls_name = '::'.join([seg.name for seg in cls.class_decl.typename.segments if not isinstance(seg, types.AnonymousName)]) mapping[cls_name] = scope + cls_name - mapping.update(self.build_mapping(cls, mapping=mapping, scope=f'{scope}{cls_name}::')) - + mapping.update(self.build_naive_mapping(cls, mapping=mapping, scope=f'{scope}{cls_name}::')) return mapping class HeaderFile(): @@ -151,7 +155,9 @@ def preprocess(self) -> None: self.documentation_holder_path = DocumentationData.get_xml_path_if_exists(name_cpp_no_template, DocumentationObjectKind.Class) def run_preprocessor(self): # TODO: run without generating a new file - tmp_file_path = self.submodule.submodule_file_path.parent / "tmp" / self.path.name + tmp_dir = self.submodule.submodule_file_path.parent / "tmp" + tmp_dir.mkdir(exist_ok=True) + tmp_file_path = tmp_dir / self.path.name argv = [ '', '-D', 'vp_deprecated=', @@ -159,7 +165,7 @@ def run_preprocessor(self): # TODO: run without generating a new file '-D', 'DOXYGEN_SHOULD_SKIP_THIS', # Skip methods and classes that are not exposed in documentation: they are internals '-I', '/home/sfelton/software/visp_build/include', '-I', '/usr/local/include', - '-I', '/usr/include', + #'-I', '/usr/include', '-N', 'VISP_BUILD_DEPRECATED_FUNCTIONS', '--passthru-includes', "^((?!vpConfig.h).)*$", '--passthru-unfound-includes', @@ -186,6 +192,9 @@ def parse_data(self): result = '' print(f'Building environment for {self.path}') header_env = HeaderEnvironment(self.header_repr) + if 'AprilTag' in self.path.name: + import pprint + pprint.pprint(header_env.mapping) if self.documentation_holder_path is not None: self.documentation_holder = DocumentationHolder(self.documentation_holder_path, header_env.mapping) else: diff --git a/modules/python/generator/methods.py b/modules/python/generator/methods.py index 37431fbaea..a2766768f0 100644 --- a/modules/python/generator/methods.py +++ b/modules/python/generator/methods.py @@ -129,9 +129,18 @@ def get_py_args(parameters: List[types.Parameter], specs, env_mapping) -> List[s if type_name.startswith('std::vector'): default_value = type_name + '()' default_value_rep = '[]' + elif type_name.startswith('std::optional'): + default_value = type_name + '{}' + default_value_rep = 'None' else: default_value = tokens_to_str(parameter.default.tokens) - default_value_rep = default_value.strip('"') # To handle default char* and std::string args + if default_value in ['nullptr', 'NULL']: + full_typename = get_type(t, specs, env_mapping) + default_value = f'static_cast<{full_typename}>(nullptr)' + default_value_rep = 'None' + else: + default_value_rep = default_value.strip('"') # To handle default char* and std::string args + default_value = env_mapping.get(default_value) or default_value py_args.append(f'py::arg_v("{parameter.name}", {default_value}, "{default_value_rep}")') From 852121710b73f83bba61b7ae2b573bd66fb1719d Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Fri, 6 Oct 2023 13:29:48 +0200 Subject: [PATCH 062/169] some progress on resolving header environments for parent base classes --- modules/python/generator/enum_binding.py | 4 -- modules/python/generator/generator.py | 13 +++++ modules/python/generator/header.py | 49 ++++++++++++++++--- .../visp3/visual_features/vpBasicFeature.h | 2 +- .../visual_features/vpFeatureVanishingPoint.h | 8 +-- 5 files changed, 59 insertions(+), 17 deletions(-) diff --git a/modules/python/generator/enum_binding.py b/modules/python/generator/enum_binding.py index 8a57e78c71..782da20edf 100644 --- a/modules/python/generator/enum_binding.py +++ b/modules/python/generator/enum_binding.py @@ -87,12 +87,10 @@ def accumulate_data(scope: Union[NamespaceScope, ClassScope]): anonymous_enum, enum_id = is_anonymous_name(enum.typename) full_name = get_typename(enum.typename, {}, mapping) if not anonymous_enum else None - print('SAW ENUM NAME :', full_name, 'with values', enum.values) matches = lambda repr: match_id(repr, enum_id) or match_name(repr, full_name) matching = list(filter(matches, temp_data)) assert len(matching) <= 1, f"There cannot be more than one repr found. Matches = {matching}" if len(matching) == 0: - print('APPENDING ', EnumRepr(enum_id, full_name, enum.values, public_access)) temp_data.append(EnumRepr(enum_id, full_name, enum.values, public_access)) else: if full_name is not None: @@ -122,13 +120,11 @@ def accumulate_data(scope: Union[NamespaceScope, ClassScope]): matching[0].public_access = matching[0].public_access and public_access ready_enums = list(filter(enum_repr_is_ready, temp_data)) - print('READY ENUMS', ready_enums) for repr in ready_enums: final_data.append(repr) temp_data.remove(repr) accumulate_data(root_scope) - print(final_data, temp_data) return final_data, temp_data diff --git a/modules/python/generator/generator.py b/modules/python/generator/generator.py index c9b9147772..6a53491d9e 100644 --- a/modules/python/generator/generator.py +++ b/modules/python/generator/generator.py @@ -59,6 +59,19 @@ def generate_module(generate_path: Path) -> None: # Sort headers according to the dependencies. This is done across all modules. # TODO: sort module generation order. For now this works but it's fairly brittle new_all_headers = sort_headers(new_all_headers) + for header in new_all_headers: + header.compute_environment() + + all_environments = list(map(lambda header: header.environment, new_all_headers)) + print('LS', [h.path.name for h in new_all_headers]) + for header in new_all_headers: + print(f'BEFORE {header.path.name}') + import pprint + pprint.pprint(header.environment.mapping) + header.environment.update_with_dependencies(header.depends, all_environments, header.path.name) + print(f'AFTER {header.path.name}') + pprint.pprint(header.environment.mapping) + for submodule in submodules: submodule.set_headers_from_common_list(new_all_headers) diff --git a/modules/python/generator/header.py b/modules/python/generator/header.py index 55e4cd8a6f..339baee065 100644 --- a/modules/python/generator/header.py +++ b/modules/python/generator/header.py @@ -70,14 +70,17 @@ def add_level(result: List['HeaderFile'], remainder: List['HeaderFile'], depende class HeaderEnvironment(): def __init__(self, data: ParsedData): - self.mapping = self.build_naive_mapping(data.namespace) + self.mapping = self.build_naive_mapping(data.namespace, {}) + print(self.mapping) + + # Step 2: resolve enumeration names that are possibly hidden behind typedefs from enum_binding import resolve_enums_and_typedefs enum_reprs, _ = resolve_enums_and_typedefs(data.namespace, self.mapping) for enum_repr in enum_reprs: for value in enum_repr.values: self.mapping[value.name] = enum_repr.name + '::' + value.name - def build_naive_mapping(self, data: Union[NamespaceScope, ClassScope], mapping={}, scope: str = ''): + def build_naive_mapping(self, data: Union[NamespaceScope, ClassScope], mapping, scope: str = ''): if isinstance(data, NamespaceScope): for alias in data.using_alias: mapping[alias.alias] = get_type(alias.type, {}, mapping) @@ -112,6 +115,28 @@ def build_naive_mapping(self, data: Union[NamespaceScope, ClassScope], mapping={ mapping.update(self.build_naive_mapping(cls, mapping=mapping, scope=f'{scope}{cls_name}::')) return mapping + def update_with_dependencies(self, dependencies: List[str], all_envs: List['HeaderEnvironment'], header_name) -> None: + for env in all_envs: + if env == self: + continue + other_mapping = env.mapping + # Check if dependency is in this mapping + contains_dependency = False + for dep in dependencies: + if dep in other_mapping: + print(f'FOUND DEPENDENCY {dep} for {header_name} iN MAP') + contains_dependency = True + break + if not contains_dependency: + continue + # We have a dependency, pull all the items that are in this dependency + for partial_name, full_name in other_mapping.items(): + full_name_has_dep = any(map(lambda s: s in full_name, dependencies)) # TODO: This is wrong => this does not pull dependencies that are from a two level inheritance (vpBasicFeature => vpFeatureMoment => vpFeatureMomentAlpha: the last class doesn't see vpBasicFeature) + if full_name_has_dep and partial_name not in self.mapping: + self.mapping[partial_name] = full_name + print(f'Updated mapping with {partial_name} -> {full_name}') + + class HeaderFile(): def __init__(self, path: Path, submodule: 'Submodule'): self.path = path @@ -124,6 +149,7 @@ def __init__(self, path: Path, submodule: 'Submodule'): self.depends = [] self.documentation_holder_path: Path = None self.documentation_holder = None + self.environment: HeaderEnvironment = None def __getstate__(self): return self.__dict__ @@ -145,10 +171,9 @@ def preprocess(self) -> None: # Add parent classes as dependencies for base_class in cls.class_decl.bases: - if base_class.access == 'public': - base_class_str_no_template = '::'.join([segment.name for segment in base_class.typename.segments]) - if base_class_str_no_template.startswith('vp'): - self.depends.append(base_class_str_no_template) + base_class_str_no_template = '::'.join([segment.name for segment in base_class.typename.segments]) + if base_class_str_no_template.startswith('vp'): + self.depends.append(base_class_str_no_template) # Get documentation if available, only one document supported for now if self.documentation_holder_path is None: @@ -165,7 +190,7 @@ def run_preprocessor(self): # TODO: run without generating a new file '-D', 'DOXYGEN_SHOULD_SKIP_THIS', # Skip methods and classes that are not exposed in documentation: they are internals '-I', '/home/sfelton/software/visp_build/include', '-I', '/usr/local/include', - #'-I', '/usr/include', + '-I', '/usr/include', '-N', 'VISP_BUILD_DEPRECATED_FUNCTIONS', '--passthru-includes', "^((?!vpConfig.h).)*$", '--passthru-unfound-includes', @@ -186,12 +211,20 @@ def generate_binding_code(self) -> None: self.binding_code = self.parse_data() + def compute_environment(self): + ''' + Compute the header environment + This environment contains: + - The mapping from partially qualified names to fully qualified names + If a class inherits from another, the environment should be updated with what is contained in the base class environment. This should be done in another step + ''' + self.environment = HeaderEnvironment(self.header_repr) def parse_data(self): from enum_binding import enum_bindings result = '' print(f'Building environment for {self.path}') - header_env = HeaderEnvironment(self.header_repr) + header_env = self.environment if 'AprilTag' in self.path.name: import pprint pprint.pprint(header_env.mapping) diff --git a/modules/visual_features/include/visp3/visual_features/vpBasicFeature.h b/modules/visual_features/include/visp3/visual_features/vpBasicFeature.h index 486199e0ba..d32f336579 100644 --- a/modules/visual_features/include/visp3/visual_features/vpBasicFeature.h +++ b/modules/visual_features/include/visp3/visual_features/vpBasicFeature.h @@ -78,7 +78,7 @@ class VISP_EXPORT vpBasicFeature public: // Public constantes static const unsigned int FEATURE_LINE[32]; - enum { FEATURE_ALL = 0xffff }; + enum vpBasicFeatureSelect { FEATURE_ALL = 0xffff }; /*! \enum vpBasicFeatureDeallocatorType Indicates who should deallocate the feature. diff --git a/modules/visual_features/include/visp3/visual_features/vpFeatureVanishingPoint.h b/modules/visual_features/include/visp3/visual_features/vpFeatureVanishingPoint.h index 491c7a53d1..cafd63855b 100644 --- a/modules/visual_features/include/visp3/visual_features/vpFeatureVanishingPoint.h +++ b/modules/visual_features/include/visp3/visual_features/vpFeatureVanishingPoint.h @@ -84,7 +84,7 @@ class VISP_EXPORT vpFeatureVanishingPoint : public vpBasicFeature public: vpFeatureVanishingPoint(); //! Destructor. - virtual ~vpFeatureVanishingPoint() {} + virtual ~vpFeatureVanishingPoint() { } void buildFrom(double x, double y); @@ -95,7 +95,7 @@ class VISP_EXPORT vpFeatureVanishingPoint : public vpBasicFeature vpFeatureVanishingPoint *duplicate() const; - vpColVector error(const vpBasicFeature &s_star, unsigned int select = (selectX() | selectY())); + vpColVector error(const vpBasicFeature &s_star, unsigned int select = (vpFeatureVanishingPoint::selectX() | vpFeatureVanishingPoint::selectY())); double get_x() const; double get_y() const; @@ -104,9 +104,9 @@ class VISP_EXPORT vpFeatureVanishingPoint : public vpBasicFeature double getAlpha() const; void init(); - vpMatrix interaction(unsigned int select = (selectX() | selectY())); + vpMatrix interaction(unsigned int select = (vpFeatureVanishingPoint::selectX() | vpFeatureVanishingPoint::selectY())); - void print(unsigned int select = (selectX() | selectY())) const; + void print(unsigned int select = (vpFeatureVanishingPoint::selectX() | vpFeatureVanishingPoint::selectY())) const; void set_x(double x); void set_y(double y); From 35054b5bfb38e3c127787f04247457d1eac94f8c Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Fri, 6 Oct 2023 17:02:14 +0200 Subject: [PATCH 063/169] Adding default arguments, with some restrictions --- modules/python/generator/generator.py | 15 +++++---- modules/python/generator/header.py | 46 +++++++++++++------------- modules/python/generator/methods.py | 47 +++++++++++++++++++++++++-- modules/python/generator/submodule.py | 1 + 4 files changed, 77 insertions(+), 32 deletions(-) diff --git a/modules/python/generator/generator.py b/modules/python/generator/generator.py index 6a53491d9e..e7b9ee45ad 100644 --- a/modules/python/generator/generator.py +++ b/modules/python/generator/generator.py @@ -24,6 +24,7 @@ def main_str(submodule_fn_declarations, submodule_fn_calls): ''' return f''' +#define PYBIND11_DETAILED_ERROR_MESSAGES #include namespace py = pybind11; {submodule_fn_declarations} @@ -64,13 +65,13 @@ def generate_module(generate_path: Path) -> None: all_environments = list(map(lambda header: header.environment, new_all_headers)) print('LS', [h.path.name for h in new_all_headers]) - for header in new_all_headers: - print(f'BEFORE {header.path.name}') - import pprint - pprint.pprint(header.environment.mapping) - header.environment.update_with_dependencies(header.depends, all_environments, header.path.name) - print(f'AFTER {header.path.name}') - pprint.pprint(header.environment.mapping) + + headers_with_deps = list(map(lambda header: (header, header.get_header_dependencies(new_all_headers)), new_all_headers)) + + for header, header_deps in headers_with_deps: + other_mappings = list(map(lambda h: h.environment.mapping, header_deps)) + print(f'Dependencies of {header.path.name}: {list(map(lambda h: h.path.name, header_deps))}') + header.environment.update_with_dependencies(other_mappings) for submodule in submodules: submodule.set_headers_from_common_list(new_all_headers) diff --git a/modules/python/generator/header.py b/modules/python/generator/header.py index 339baee065..fb5a51b533 100644 --- a/modules/python/generator/header.py +++ b/modules/python/generator/header.py @@ -70,8 +70,7 @@ def add_level(result: List['HeaderFile'], remainder: List['HeaderFile'], depende class HeaderEnvironment(): def __init__(self, data: ParsedData): - self.mapping = self.build_naive_mapping(data.namespace, {}) - print(self.mapping) + self.mapping: Dict[str, str] = self.build_naive_mapping(data.namespace, {}) # Step 2: resolve enumeration names that are possibly hidden behind typedefs from enum_binding import resolve_enums_and_typedefs @@ -115,27 +114,10 @@ def build_naive_mapping(self, data: Union[NamespaceScope, ClassScope], mapping, mapping.update(self.build_naive_mapping(cls, mapping=mapping, scope=f'{scope}{cls_name}::')) return mapping - def update_with_dependencies(self, dependencies: List[str], all_envs: List['HeaderEnvironment'], header_name) -> None: - for env in all_envs: - if env == self: - continue - other_mapping = env.mapping - # Check if dependency is in this mapping - contains_dependency = False - for dep in dependencies: - if dep in other_mapping: - print(f'FOUND DEPENDENCY {dep} for {header_name} iN MAP') - contains_dependency = True - break - if not contains_dependency: - continue - # We have a dependency, pull all the items that are in this dependency - for partial_name, full_name in other_mapping.items(): - full_name_has_dep = any(map(lambda s: s in full_name, dependencies)) # TODO: This is wrong => this does not pull dependencies that are from a two level inheritance (vpBasicFeature => vpFeatureMoment => vpFeatureMomentAlpha: the last class doesn't see vpBasicFeature) - if full_name_has_dep and partial_name not in self.mapping: - self.mapping[partial_name] = full_name - print(f'Updated mapping with {partial_name} -> {full_name}') + def update_with_dependencies(self, other_envs: List['HeaderEnvironment']) -> None: + for env in other_envs: + self.mapping.update(env) class HeaderFile(): def __init__(self, path: Path, submodule: 'Submodule'): @@ -156,6 +138,24 @@ def __getstate__(self): def __setstate__(self, d): self.__dict__ = d + def get_header_dependencies(self, headers: List['HeaderFile']) -> List['HeaderFile']: + if len(self.depends) == 0: + return [] + header_deps = [] + for header in headers: + if header == self: + continue + is_dependency = False + for d in self.depends: + if d in header.contains: + is_dependency = True + break + if is_dependency: + header_deps.append(header) + upper_dependencies = header.get_header_dependencies(headers) + header_deps.extend(upper_dependencies) + return header_deps + def preprocess(self) -> None: ''' Preprocess the header to obtain the abstract representation of the cpp classes available. @@ -190,7 +190,7 @@ def run_preprocessor(self): # TODO: run without generating a new file '-D', 'DOXYGEN_SHOULD_SKIP_THIS', # Skip methods and classes that are not exposed in documentation: they are internals '-I', '/home/sfelton/software/visp_build/include', '-I', '/usr/local/include', - '-I', '/usr/include', + #'-I', '/usr/include', '-N', 'VISP_BUILD_DEPRECATED_FUNCTIONS', '--passthru-includes', "^((?!vpConfig.h).)*$", '--passthru-unfound-includes', diff --git a/modules/python/generator/methods.py b/modules/python/generator/methods.py index a2766768f0..08277995fc 100644 --- a/modules/python/generator/methods.py +++ b/modules/python/generator/methods.py @@ -106,16 +106,59 @@ def method_def(py_name: str, method: str, additional_args: List[str], static: bo def tokens_to_str(tokens: List[types.Token]) -> str: return ''.join([token.value for token in tokens]) + +FORBIDDEN_DEFAULT_ARGUMENT_TYPES = [ + 'std::ostream', + 'std::initializer_list', + 'rs2::', + 'cv::' +] + +def parameter_can_have_default_value(parameter: types.Parameter, specs, env_mapping) -> bool: + ''' + Return whether an argument can have a default value. + This is important! In python, default argument are instanciated only once (when the package is imported), while this is not the case in C++ + We need to be careful in what we allow + ''' + t = parameter.type + gt = lambda typename: get_typename(typename, specs, env_mapping) + is_const = False + if isinstance(t, types.Type): + type_name = gt(t.typename) + is_const = t.const + elif isinstance(t, types.Reference): + type_name = gt(t.ref_to.typename) + is_const = t.ref_to.const + elif isinstance(t, types.Pointer): + type_name = gt(t.ptr_to.typename) + is_const = t.ptr_to.const + else: + type_name = '' + for forbidden in FORBIDDEN_DEFAULT_ARGUMENT_TYPES: # Eg, arguments that have no mapping to python + if type_name.startswith(forbidden): + return False + + if is_const: # Parameter is const, so we can safely give a default value knowing it won't be modified + return True + if type_name in IMMUTABLE_TYPES: # Immutable type on python side + return True + + return False + + + def get_py_args(parameters: List[types.Parameter], specs, env_mapping) -> List[str]: ''' Get the py::arg parameters of a function binding definition. They are used to give the argument their names in the doc and the api. They can also have default values (optional arguments). ''' + def make_arg(name: str) -> str: + return f'py::arg("{name}")' py_args = [] for parameter in parameters: - if parameter.default is None: - py_args.append(f'py::arg("{parameter.name}")') + if parameter.default is None or not parameter_can_have_default_value(parameter, specs, env_mapping): + py_args.append(make_arg(parameter.name)) else: t = parameter.type gt = lambda typename: get_typename(typename, specs, env_mapping) diff --git a/modules/python/generator/submodule.py b/modules/python/generator/submodule.py index bbd90d1737..d0a6901c8e 100644 --- a/modules/python/generator/submodule.py +++ b/modules/python/generator/submodule.py @@ -68,6 +68,7 @@ def generate(self) -> None: additional_required_headers = '\n'.join(self.get_required_headers()) format_str = f''' +#define PYBIND11_DETAILED_ERROR_MESSAGES #include #include #include From 110cbed1b9c0394cd9c35252e447698e87b67d4a Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Fri, 6 Oct 2023 17:38:53 +0200 Subject: [PATCH 064/169] export gui module, seems to work --- .../include/visp3/gui/vpColorBlindFriendlyPalette.h | 7 ------- modules/python/config/gui.json | 1 + modules/python/generator/header.py | 13 +++++++++++++ modules/python/generator/submodule.py | 2 +- 4 files changed, 15 insertions(+), 8 deletions(-) create mode 100644 modules/python/config/gui.json diff --git a/modules/gui/include/visp3/gui/vpColorBlindFriendlyPalette.h b/modules/gui/include/visp3/gui/vpColorBlindFriendlyPalette.h index b0974ecb5e..3e199733a8 100755 --- a/modules/gui/include/visp3/gui/vpColorBlindFriendlyPalette.h +++ b/modules/gui/include/visp3/gui/vpColorBlindFriendlyPalette.h @@ -140,13 +140,6 @@ class VISP_EXPORT vpColorBlindFriendlyPalette */ std::string to_string() const; - /** - * \brief Cast the object into an unsigned int that matches the value of its \b _colorID member. - * - * \return unsigned int that matches the value of its \b _colorID member. - */ - unsigned int to_uint() const; - /** * \brief Get the list of available colors names. * diff --git a/modules/python/config/gui.json b/modules/python/config/gui.json new file mode 100644 index 0000000000..9e26dfeeb6 --- /dev/null +++ b/modules/python/config/gui.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/modules/python/generator/header.py b/modules/python/generator/header.py index fb5a51b533..3a9975f452 100644 --- a/modules/python/generator/header.py +++ b/modules/python/generator/header.py @@ -306,8 +306,21 @@ def generate_class_with_potiental_specialization(name_python: str, owner_specs: # Constructors definitions if not contains_pure_virtual_methods: for method, method_config in constructors: + method_name = get_name(method.name) params_strs = [get_type(param.type, owner_specs, header_env.mapping) for param in method.parameters] py_arg_strs = get_py_args(method.parameters, owner_specs, header_env.mapping) + param_names = [param.name or 'arg' + str(i) for i, param in enumerate(method.parameters)] + if self.documentation_holder is not None: + method_doc_signature = MethodDocSignature(method_name, + get_type(method.return_type, {}, header_env.mapping) or '', # Don't use specializations so that we can match with doc + [get_type(param.type, {}, header_env.mapping) for param in method.parameters], + method.const, method.static) + method_doc = self.documentation_holder.get_documentation_for_method(name_cpp_no_template, method_doc_signature, {}, owner_specs, param_names, []) + if method_doc is None: + print(f'Could not find documentation for {name_cpp}::{method_name}!') + else: + py_arg_strs = [method_doc.documentation] + py_arg_strs + ctor_str = f'''{python_ident}.{define_constructor(params_strs, py_arg_strs)};''' method_strs.append(ctor_str) diff --git a/modules/python/generator/submodule.py b/modules/python/generator/submodule.py index d0a6901c8e..22ee7a0922 100644 --- a/modules/python/generator/submodule.py +++ b/modules/python/generator/submodule.py @@ -172,7 +172,7 @@ def get_method_config(self, class_name: Optional[str], method, owner_specs, head return res def get_submodules(include_path: Path, generate_path: Path) -> List[Submodule]: - modules = ['core', 'imgproc', 'vision', 'visual_features', 'vs', 'sensor', 'io', 'detection', 'robot'] + modules = ['core', 'imgproc', 'vision', 'visual_features', 'vs', 'sensor', 'io', 'detection', 'robot', 'gui'] result = [] for module in modules: result.append(Submodule(module, Path(f'/home/sfelton/software/visp-sfelton/modules/{module}/include/visp3/{module}'), generate_path / f'{module}.cpp')) From 518b98f02612bc3b06cbea44719b3e5ca344bd70 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Sat, 7 Oct 2023 01:08:27 +0200 Subject: [PATCH 065/169] fix header sorting --- modules/python/generator/generator.py | 5 +---- modules/python/generator/header.py | 23 +++++++++++++++++------ 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/modules/python/generator/generator.py b/modules/python/generator/generator.py index e7b9ee45ad..50251cb4bc 100644 --- a/modules/python/generator/generator.py +++ b/modules/python/generator/generator.py @@ -56,16 +56,13 @@ def generate_module(generate_path: Path) -> None: raise RuntimeError('There was an exception when processing headers: You should either ignore them, ignore the failing class, or fix the generator code!') new_all_headers.append(result) - # Sort headers according to the dependencies. This is done across all modules. # TODO: sort module generation order. For now this works but it's fairly brittle new_all_headers = sort_headers(new_all_headers) + print('NSM', [h.path.name for h in new_all_headers]) for header in new_all_headers: header.compute_environment() - all_environments = list(map(lambda header: header.environment, new_all_headers)) - print('LS', [h.path.name for h in new_all_headers]) - headers_with_deps = list(map(lambda header: (header, header.get_header_dependencies(new_all_headers)), new_all_headers)) for header, header_deps in headers_with_deps: diff --git a/modules/python/generator/header.py b/modules/python/generator/header.py index 3a9975f452..d9de4076c8 100644 --- a/modules/python/generator/header.py +++ b/modules/python/generator/header.py @@ -15,7 +15,7 @@ from typing import TYPE_CHECKING if TYPE_CHECKING: from submodule import Submodule - +import sys @dataclass class BoundObjectNames: python_ident: str @@ -41,6 +41,13 @@ def filter_includes(include_names: Set[str]) -> List[str]: return result def sort_headers(headers: List['HeaderFile']) -> List['HeaderFile']: + ''' + Sort headers based on their dependencies on other classes. + If a class does not inherit from any other, then it will be placed at the start of the list. + If it has a dependency, then it will be placed after this dependency in the list. + This step is important to ensure that the code generation is performed in the correct order. + It is not possible to declare an inheriting class to pybind without first exposing the base class. + ''' def add_level(result: List['HeaderFile'], remainder: List['HeaderFile'], dependencies: Set[str]): if len(remainder) == 0: return @@ -49,18 +56,22 @@ def add_level(result: List['HeaderFile'], remainder: List['HeaderFile'], depende if len(result) == 0: # First iteration, query all headers that have no dependencies include_in_result_fn = lambda h: len(h.depends) == 0 else: - include_in_result_fn = lambda h: any(map(lambda x: x in dependencies, h.depends)) + # Some header define multiple classes, where one may rely on another. So we filter h.depends + include_in_result_fn = lambda h: all(map(lambda x: x in dependencies, filter(lambda s: s not in h.contains, h.depends))) new_remainder = [] - new_dependencies = [] + new_dependencies = dependencies.copy() for header_file in remainder: has_dependency = include_in_result_fn(header_file) + if 'vpFeatureMoment.h' in header_file.path.name: + print(header_file.contains, header_file.depends, has_dependency) if has_dependency: - new_dependencies.extend(header_file.contains) + new_dependencies = new_dependencies | set(header_file.contains) result.append(header_file) else: new_remainder.append(header_file) if new_remainder == remainder: - print('Warning: Could not completely solve dependencies, generating but might have some errors') + print('REMAINING and deps', dependencies, new_dependencies) + print(f'Warning: Could not completely solve dependencies, generating but might have some errors\n Faulty headers: {[h.path.name for h in remainder]}', file=sys.stderr) result.extend(remainder) else: add_level(result, new_remainder, set(new_dependencies)) @@ -190,7 +201,7 @@ def run_preprocessor(self): # TODO: run without generating a new file '-D', 'DOXYGEN_SHOULD_SKIP_THIS', # Skip methods and classes that are not exposed in documentation: they are internals '-I', '/home/sfelton/software/visp_build/include', '-I', '/usr/local/include', - #'-I', '/usr/include', + '-I', '/usr/include', '-N', 'VISP_BUILD_DEPRECATED_FUNCTIONS', '--passthru-includes', "^((?!vpConfig.h).)*$", '--passthru-unfound-includes', From 25c20acd79000918b4a157db90a1894aef6fd348 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Mon, 9 Oct 2023 13:05:29 +0200 Subject: [PATCH 066/169] Migrate header env to separate file, a lot of config, fix lvalue output only parameters --- modules/python/config/io.json | 20 +++- modules/python/config/robot.json | 37 ++++++++ modules/python/config/sensor.json | 101 +++++++++++++++++++- modules/python/generator/header.py | 115 ++--------------------- modules/python/generator/header_utils.py | 103 ++++++++++++++++++++ modules/python/generator/methods.py | 2 +- modules/python/generator/submodule.py | 4 +- modules/python/generator/utils.py | 6 ++ 8 files changed, 275 insertions(+), 113 deletions(-) create mode 100644 modules/python/generator/header_utils.py diff --git a/modules/python/config/io.json b/modules/python/config/io.json index 83f86f3ab1..838f1963aa 100644 --- a/modules/python/config/io.json +++ b/modules/python/config/io.json @@ -1,4 +1,22 @@ { "ignored_headers": ["vpParallelPortException.h"], - "ignored_classes": ["vpJsonArgumentParser", "vpParseArgv"] + "ignored_classes": ["vpJsonArgumentParser", "vpParseArgv"], + + "classes": { + "vpParallelPort": { + "methods": [ + { + "static": false, + "signature": "void sendData(unsigned char&)", + "use_default_param_policy": false, + "param_is_input": [ + true + ], + "param_is_output": [ + false + ] + } + ] + } + } } \ No newline at end of file diff --git a/modules/python/config/robot.json b/modules/python/config/robot.json index bf240f748e..f79adebd52 100644 --- a/modules/python/config/robot.json +++ b/modules/python/config/robot.json @@ -38,11 +38,48 @@ false, false ] + }, + { + "static": false, + "signature": "void init(const vpImage&, vpColVector*)", + "ignore": true + }, + { + "static": false, + "signature": "void init(const vpImage&, vpColVector*)", + "ignore": true } ] }, "vpRobotSimulator": { "is_virtual": true + }, + + "vpWireFrameSimulator" : { + "methods": [ + { + "static": false, + "signature": "void get_fMo_History(std::list&)", + "use_default_param_policy": false, + "param_is_input": [ + false + ], + "param_is_output": [ + true + ] + }, + { + "static": false, + "signature": "void get_cMo_History(std::list&)", + "use_default_param_policy": false, + "param_is_input": [ + false + ], + "param_is_output": [ + true + ] + } + ] } } } \ No newline at end of file diff --git a/modules/python/config/sensor.json b/modules/python/config/sensor.json index a9c3a625e2..adbcbb3663 100644 --- a/modules/python/config/sensor.json +++ b/modules/python/config/sensor.json @@ -1,3 +1,102 @@ { - "ignored_headers": [] + "ignored_headers": [], + "classes": { + "vp1394TwoGrabber": { + "methods": [ + { + "static": false, + "signature": "void acquire(vpImage&, uint64_t&, uint32_t&)", + "use_default_param_policy": false, + "param_is_input": [ + true, + false, + false + ], + "param_is_output": [ + false, + true, + true + ] + }, + { + "static": false, + "signature": "void acquire(vpImage&, uint64_t&, uint32_t&)", + "use_default_param_policy": false, + "param_is_input": [ + true, + false, + false + ], + "param_is_output": [ + false, + true, + true + ] + }, + { + "static": false, + "signature": "void getNumCameras(unsigned int&)", + "use_default_param_policy": false, + "param_is_input": [ + false + ], + "param_is_output": [ + true + ] + }, + { + "static": false, + "signature": "void getWidth(unsigned int&)", + "ignore": true + }, + { + "static": false, + "signature": "void getHeight(unsigned int&)", + "ignore": true + }, + { + "static": false, + "signature": "void getCamera(uint64_t&)", + "ignore": true + }, + { + "static": false, + "signature": "uint32_t getVideoModeSupported(std::list&)", + "use_default_param_policy": false, + "param_is_input": [ + false + ], + "param_is_output": [ + true + ] + }, + { + "static": false, + "signature": "uint32_t getFramerateSupported(vp1394TwoGrabber::vp1394TwoVideoModeType, std::list&)", + "use_default_param_policy": false, + "param_is_input": [ + true, + false + ], + "param_is_output": [ + false, + true + ] + }, + { + "static": false, + "signature": "void getAutoGain(unsigned int&, unsigned int&)", + "use_default_param_policy": false, + "param_is_input": [ + false, + false + ], + "param_is_output": [ + true, + true + ] + } + ] + } + } } \ No newline at end of file diff --git a/modules/python/generator/header.py b/modules/python/generator/header.py index d9de4076c8..3e05fa6ca1 100644 --- a/modules/python/generator/header.py +++ b/modules/python/generator/header.py @@ -11,124 +11,23 @@ from utils import * from methods import * from doc_parser import * +from header_utils import * from typing import TYPE_CHECKING if TYPE_CHECKING: from submodule import Submodule import sys + @dataclass class BoundObjectNames: - python_ident: str - python_name: str - cpp_no_template_name: str - cpp_name: str - -def filter_includes(include_names: Set[str]) -> List[str]: - result = [] - for include_name in include_names: - if include_name.startswith('"') and include_name.endswith('"'): - continue - forbidden_strs = ['winsock', ''] - forbidden_found = False - for forbidden_str in forbidden_strs: - if forbidden_str in include_name: - forbidden_found = True - break - if forbidden_found: - continue - - result.append(include_name) - return result - -def sort_headers(headers: List['HeaderFile']) -> List['HeaderFile']: ''' - Sort headers based on their dependencies on other classes. - If a class does not inherit from any other, then it will be placed at the start of the list. - If it has a dependency, then it will be placed after this dependency in the list. - This step is important to ensure that the code generation is performed in the correct order. - It is not possible to declare an inheriting class to pybind without first exposing the base class. + The different names that link to a cpp class ''' - def add_level(result: List['HeaderFile'], remainder: List['HeaderFile'], dependencies: Set[str]): - if len(remainder) == 0: - return + python_ident: str # the identifier (variable) that defines the pybind object + python_name: str # the name exposed in Python + cpp_no_template_name: str # C++ name without any template => vpArray2D becomes vpArray2D (useful for dependencies) + cpp_name: str # C++ name with templates - include_in_result_fn = None - if len(result) == 0: # First iteration, query all headers that have no dependencies - include_in_result_fn = lambda h: len(h.depends) == 0 - else: - # Some header define multiple classes, where one may rely on another. So we filter h.depends - include_in_result_fn = lambda h: all(map(lambda x: x in dependencies, filter(lambda s: s not in h.contains, h.depends))) - new_remainder = [] - new_dependencies = dependencies.copy() - for header_file in remainder: - has_dependency = include_in_result_fn(header_file) - if 'vpFeatureMoment.h' in header_file.path.name: - print(header_file.contains, header_file.depends, has_dependency) - if has_dependency: - new_dependencies = new_dependencies | set(header_file.contains) - result.append(header_file) - else: - new_remainder.append(header_file) - if new_remainder == remainder: - print('REMAINING and deps', dependencies, new_dependencies) - print(f'Warning: Could not completely solve dependencies, generating but might have some errors\n Faulty headers: {[h.path.name for h in remainder]}', file=sys.stderr) - result.extend(remainder) - else: - add_level(result, new_remainder, set(new_dependencies)) - result = [] - add_level(result, headers, set()) - return result - -class HeaderEnvironment(): - def __init__(self, data: ParsedData): - self.mapping: Dict[str, str] = self.build_naive_mapping(data.namespace, {}) - - # Step 2: resolve enumeration names that are possibly hidden behind typedefs - from enum_binding import resolve_enums_and_typedefs - enum_reprs, _ = resolve_enums_and_typedefs(data.namespace, self.mapping) - for enum_repr in enum_reprs: - for value in enum_repr.values: - self.mapping[value.name] = enum_repr.name + '::' + value.name - - def build_naive_mapping(self, data: Union[NamespaceScope, ClassScope], mapping, scope: str = ''): - if isinstance(data, NamespaceScope): - for alias in data.using_alias: - mapping[alias.alias] = get_type(alias.type, {}, mapping) - for typedef in data.typedefs: - mapping[typedef.name] = scope + typedef.name - - for enum in data.enums: - if not name_is_anonymous(enum.typename): - enum_name = '::'.join([seg.name for seg in enum.typename.segments]) - mapping[enum_name] = scope + enum_name - - for cls in data.classes: - cls_name = '::'.join([seg.name for seg in cls.class_decl.typename.segments]) - mapping[cls_name] = scope + cls_name - mapping.update(self.build_naive_mapping(cls, mapping=mapping, scope=f'{scope}{cls_name}::')) - for namespace in data.namespaces: - mapping.update(self.build_naive_mapping(data.namespaces[namespace], mapping=mapping, scope=f'{scope}{namespace}::')) - - elif isinstance(data, ClassScope): - for alias in data.using_alias: - mapping[alias.alias] = get_type(alias.type, {}, mapping) - for typedef in data.typedefs: - mapping[typedef.name] = scope + typedef.name - for enum in data.enums: - if not name_is_anonymous(enum.typename): - enum_name = '::'.join([seg.name for seg in enum.typename.segments]) - mapping[enum_name] = scope + enum_name - - for cls in data.classes: - cls_name = '::'.join([seg.name for seg in cls.class_decl.typename.segments if not isinstance(seg, types.AnonymousName)]) - mapping[cls_name] = scope + cls_name - mapping.update(self.build_naive_mapping(cls, mapping=mapping, scope=f'{scope}{cls_name}::')) - return mapping - - - def update_with_dependencies(self, other_envs: List['HeaderEnvironment']) -> None: - for env in other_envs: - self.mapping.update(env) class HeaderFile(): def __init__(self, path: Path, submodule: 'Submodule'): diff --git a/modules/python/generator/header_utils.py b/modules/python/generator/header_utils.py new file mode 100644 index 0000000000..9fcc3ff84d --- /dev/null +++ b/modules/python/generator/header_utils.py @@ -0,0 +1,103 @@ +from typing import List, Set, Dict, Union +from pathlib import Path +from dataclasses import dataclass + +from cxxheaderparser import types +from cxxheaderparser.simple import ParsedData, NamespaceScope, ClassScope + +from utils import * +from methods import * +from doc_parser import * + +from typing import TYPE_CHECKING +if TYPE_CHECKING: + from submodule import Submodule + from header import HeaderFile +import sys + +def sort_headers(headers: List['HeaderFile']) -> List['HeaderFile']: + ''' + Sort headers based on their dependencies on other classes. + If a class does not inherit from any other, then it will be placed at the start of the list. + If it has a dependency, then it will be placed after this dependency in the list. + This step is important to ensure that the code generation is performed in the correct order. + It is not possible to declare an inheriting class to pybind without first exposing the base class. + ''' + def add_level(result: List['HeaderFile'], remainder: List['HeaderFile'], dependencies: Set[str]): + if len(remainder) == 0: + return + + include_in_result_fn = None + if len(result) == 0: # First iteration, query all headers that have no dependencies + include_in_result_fn = lambda h: len(h.depends) == 0 + else: + # Some header define multiple classes, where one may rely on another. So we filter h.depends + include_in_result_fn = lambda h: all(map(lambda x: x in dependencies, filter(lambda s: s not in h.contains, h.depends))) + new_remainder = [] + new_dependencies = dependencies.copy() + for header_file in remainder: + has_dependency = include_in_result_fn(header_file) + if has_dependency: + new_dependencies = new_dependencies | set(header_file.contains) + result.append(header_file) + else: + new_remainder.append(header_file) + if new_remainder == remainder: + print(f'Warning: Could not completely solve dependencies, generating but might have some errors\n Faulty headers: {[h.path.name for h in remainder]}', file=sys.stderr) + result.extend(remainder) + else: + add_level(result, new_remainder, set(new_dependencies)) + result = [] + add_level(result, headers, set()) + return result + +class HeaderEnvironment(): + def __init__(self, data: ParsedData): + self.mapping: Dict[str, str] = self.build_naive_mapping(data.namespace, {}) + + # Step 2: resolve enumeration names that are possibly hidden behind typedefs + from enum_binding import resolve_enums_and_typedefs + enum_reprs, _ = resolve_enums_and_typedefs(data.namespace, self.mapping) + for enum_repr in enum_reprs: + for value in enum_repr.values: + self.mapping[value.name] = enum_repr.name + '::' + value.name + + def build_naive_mapping(self, data: Union[NamespaceScope, ClassScope], mapping, scope: str = ''): + if isinstance(data, NamespaceScope): + for alias in data.using_alias: + mapping[alias.alias] = get_type(alias.type, {}, mapping) + for typedef in data.typedefs: + mapping[typedef.name] = scope + typedef.name + + for enum in data.enums: + if not name_is_anonymous(enum.typename): + enum_name = '::'.join([seg.name for seg in enum.typename.segments]) + mapping[enum_name] = scope + enum_name + + for cls in data.classes: + cls_name = '::'.join([seg.name for seg in cls.class_decl.typename.segments]) + mapping[cls_name] = scope + cls_name + mapping.update(self.build_naive_mapping(cls, mapping=mapping, scope=f'{scope}{cls_name}::')) + for namespace in data.namespaces: + mapping.update(self.build_naive_mapping(data.namespaces[namespace], mapping=mapping, scope=f'{scope}{namespace}::')) + + elif isinstance(data, ClassScope): + for alias in data.using_alias: + mapping[alias.alias] = get_type(alias.type, {}, mapping) + for typedef in data.typedefs: + mapping[typedef.name] = scope + typedef.name + for enum in data.enums: + if not name_is_anonymous(enum.typename): + enum_name = '::'.join([seg.name for seg in enum.typename.segments]) + mapping[enum_name] = scope + enum_name + + for cls in data.classes: + cls_name = '::'.join([seg.name for seg in cls.class_decl.typename.segments if not isinstance(seg, types.AnonymousName)]) + mapping[cls_name] = scope + cls_name + mapping.update(self.build_naive_mapping(cls, mapping=mapping, scope=f'{scope}{cls_name}::')) + return mapping + + + def update_with_dependencies(self, other_envs: List['HeaderEnvironment']) -> None: + for env in other_envs: + self.mapping.update(env) diff --git a/modules/python/generator/methods.py b/modules/python/generator/methods.py index 08277995fc..a600220212 100644 --- a/modules/python/generator/methods.py +++ b/modules/python/generator/methods.py @@ -235,7 +235,7 @@ def define_method(method: types.Method, method_config: Dict, is_class_method, sp # Params that are only outputs: they should be declared in function. Assume that they are default constructible param_is_only_output = [not is_input and is_output for is_input, is_output in zip(param_is_input, param_is_output)] - param_declarations = [f'{params_strs[i]} {param_names[i]};' for i in range(len(param_is_only_output)) if param_is_only_output[i]] + param_declarations = [f'{get_type_for_declaration(method.parameters[i].type, specs, header_env.mapping)} {param_names[i]};' for i in range(len(param_is_only_output)) if param_is_only_output[i]] param_declarations = '\n'.join(param_declarations) if not method.static: self_param_with_name = bound_object.cpp_name + '& self' diff --git a/modules/python/generator/submodule.py b/modules/python/generator/submodule.py index 22ee7a0922..278d9714c5 100644 --- a/modules/python/generator/submodule.py +++ b/modules/python/generator/submodule.py @@ -8,7 +8,7 @@ from pathlib import Path import json -from header import HeaderFile, sort_headers, filter_includes +from header import HeaderFile from utils import * from gen_report import Report @@ -58,7 +58,7 @@ def generate(self) -> None: header_code.append(header.binding_code) declarations.extend(header.declarations) includes.extend(header.includes) - includes_set = filter_includes(set(includes)) + includes_set = set(includes) submodule_declaration = f'py::module_ submodule = m.def_submodule("{self.name}");\n' bindings = '\n'.join(header_code) declarations = '\n'.join(declarations) diff --git a/modules/python/generator/utils.py b/modules/python/generator/utils.py index 6c59d3cbf3..9bcea22acc 100644 --- a/modules/python/generator/utils.py +++ b/modules/python/generator/utils.py @@ -82,6 +82,12 @@ def get_type(param: Union[types.FunctionType, types.DecoratedType, types.Value], else: return None +def get_type_for_declaration(param: Union[types.FunctionType, types.DecoratedType, types.Value], owner_specs: Dict[str, str], header_env_mapping: Dict[str, str]) -> Optional[str]: + if isinstance(param, types.Reference): + return get_type(param.ref_to, owner_specs, header_env_mapping) + else: + return get_type(param, owner_specs, header_env_mapping) + def is_pointer_to_const_cstr(param: types.Pointer) -> bool: ''' Whether the passed in pointer is of type const char* From b492ba741104175c9bed4a72b8fc0ad1ecf3d050 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Mon, 9 Oct 2023 16:58:39 +0200 Subject: [PATCH 067/169] parsing functions, almost good! --- modules/python/config/core.json | 2 +- modules/python/generator/gen_report.py | 2 +- modules/python/generator/header.py | 54 ++++++++++++++++------ modules/python/generator/header_utils.py | 4 ++ modules/python/generator/methods.py | 59 ++++++++++++++++++++---- modules/python/generator/submodule.py | 1 + 6 files changed, 98 insertions(+), 24 deletions(-) diff --git a/modules/python/config/core.json b/modules/python/config/core.json index 50c2613db5..67e03b409a 100644 --- a/modules/python/config/core.json +++ b/modules/python/config/core.json @@ -1,5 +1,5 @@ { - "ignored_headers": ["vpGEMM.h"], + "ignored_headers": ["vpGEMM.h", "vpDebug.h"], "ignored_classes": ["vpException", "vpImageException", "vpTrackingException", "vpFrameGrabberException", "vpIoException", "vpDisplayException", "vpMatrixException"], diff --git a/modules/python/generator/gen_report.py b/modules/python/generator/gen_report.py index 2c5aa8dfe0..2bb8191692 100644 --- a/modules/python/generator/gen_report.py +++ b/modules/python/generator/gen_report.py @@ -13,7 +13,7 @@ def __init__(self, submodule: 'Submodule'): 'ignored_headers': [], 'classes': {}, 'methods': {}, - 'default_param_policy_methods': [] + 'default_param_policy_methods': [], } def add_ignored_header(self, path: Path) -> None: diff --git a/modules/python/generator/header.py b/modules/python/generator/header.py index 3e05fa6ca1..95284a0b40 100644 --- a/modules/python/generator/header.py +++ b/modules/python/generator/header.py @@ -100,7 +100,7 @@ def run_preprocessor(self): # TODO: run without generating a new file '-D', 'DOXYGEN_SHOULD_SKIP_THIS', # Skip methods and classes that are not exposed in documentation: they are internals '-I', '/home/sfelton/software/visp_build/include', '-I', '/usr/local/include', - '-I', '/usr/include', + #'-I', '/usr/include', '-N', 'VISP_BUILD_DEPRECATED_FUNCTIONS', '--passthru-includes', "^((?!vpConfig.h).)*$", '--passthru-unfound-includes', @@ -132,22 +132,48 @@ def compute_environment(self): def parse_data(self): from enum_binding import enum_bindings - result = '' - print(f'Building environment for {self.path}') - header_env = self.environment - if 'AprilTag' in self.path.name: - import pprint - pprint.pprint(header_env.mapping) + result = '' # String containing the definitions (actual bindings and not class/enum declarations) + + # Fetch documentation if available if self.documentation_holder_path is not None: - self.documentation_holder = DocumentationHolder(self.documentation_holder_path, header_env.mapping) + self.documentation_holder = DocumentationHolder(self.documentation_holder_path, self.environment.mapping) else: print(f'No documentation found for header {self.path}') + for cls in self.header_repr.namespace.classes: - result += self.generate_class(cls, header_env) + '\n' - enum_decls_and_bindings = enum_bindings(self.header_repr.namespace, header_env.mapping, self.submodule) + result += self.generate_class(cls, self.environment) + '\n' + enum_decls_and_bindings = enum_bindings(self.header_repr.namespace, self.environment.mapping, self.submodule) for declaration, binding in enum_decls_and_bindings: self.declarations.append(declaration) result += binding + # Parse functions that are not linked to a class + result += self.parse_sub_namespace(self.header_repr.namespace) + return result + + def parse_sub_namespace(self, ns: NamespaceScope, namespace_prefix = '', is_root=True) -> str: + if not is_root and ns.name == '': # Anonymous namespace, only visible in header, so we ignore it + return '' + + result = '' + functions_with_configs, rejected_functions = get_bindable_functions_with_config(self.submodule, ns.functions, self.environment.mapping) + + # Log rejected functions + rejection_strs = [] + for rejected_function in rejected_functions: + self.submodule.report.add_non_generated_method(rejected_function) + if NotGeneratedReason.is_non_trivial_reason(rejected_function.rejection_reason): + rejection_strs.append(f'\t{rejected_function.signature} was rejected! Reason: {rejected_function.rejection_reason}') + if len(rejection_strs) > 0: + print(f'Rejected function in namespace: {ns.name}') + print('\n'.join(rejection_strs)) + + bound_object = BoundObjectNames('submodule', self.submodule.name, namespace_prefix, namespace_prefix) + for function, function_config in functions_with_configs: + result += define_method(function, function_config, False, {}, self, self.environment, bound_object)[0] + '\n' + + for sub_ns in ns.namespaces: + result += self.parse_sub_namespace(ns.namespaces[sub_ns], namespace_prefix + sub_ns + '::', False) + return result def generate_class(self, cls: ClassScope, header_env: HeaderEnvironment) -> str: @@ -168,13 +194,13 @@ def generate_class_with_potiental_specialization(name_python: str, owner_specs: template_str = f'<{", ".join(template_strs)}>' name_cpp += template_str - # Reference base classes when creating pybind class binding + # Reference public base classes when creating pybind class binding base_class_strs = map(lambda base_class: get_typename(base_class.typename, owner_specs, header_env.mapping), filter(lambda b: b.access == 'public', cls.class_decl.bases)) class_template_str = ', '.join([name_cpp] + list(base_class_strs)) doc_param = [] if class_doc is None else [class_doc.documentation] - - cls_argument_strs = ['submodule', f'"{name_python}"'] + doc_param + (['py::buffer_protocol()'] if cls_config['use_buffer_protocol'] else []) + buffer_protocol_arg = ['py::buffer_protocol()'] if cls_config['use_buffer_protocol'] else [] + cls_argument_strs = ['submodule', f'"{name_python}"'] + doc_param + buffer_protocol_arg class_decl = f'\tpy::class_ {python_ident} = py::class_<{class_template_str}>({", ".join(cls_argument_strs)});' self.declarations.append(class_decl) @@ -186,6 +212,7 @@ def generate_class_with_potiental_specialization(name_python: str, owner_specs: if method.pure_virtual: contains_pure_virtual_methods = True break + # User marked this class as virtual. # This is required if no virtual method is declared in this class, # but it does not implement pure virtual methods of a base class @@ -307,7 +334,6 @@ def generate_class_with_potiental_specialization(name_python: str, owner_specs: if len(owner_specs.keys()) > 0: template_types = owner_specs.values() template_str = f'<{", ".join([template_type for template_type in template_types])}>' - method_strs.append(f'{cls_config["additional_bindings"]}({python_ident});') diff --git a/modules/python/generator/header_utils.py b/modules/python/generator/header_utils.py index 9fcc3ff84d..28a25bd48c 100644 --- a/modules/python/generator/header_utils.py +++ b/modules/python/generator/header_utils.py @@ -66,6 +66,7 @@ def build_naive_mapping(self, data: Union[NamespaceScope, ClassScope], mapping, if isinstance(data, NamespaceScope): for alias in data.using_alias: mapping[alias.alias] = get_type(alias.type, {}, mapping) + for typedef in data.typedefs: mapping[typedef.name] = scope + typedef.name @@ -78,14 +79,17 @@ def build_naive_mapping(self, data: Union[NamespaceScope, ClassScope], mapping, cls_name = '::'.join([seg.name for seg in cls.class_decl.typename.segments]) mapping[cls_name] = scope + cls_name mapping.update(self.build_naive_mapping(cls, mapping=mapping, scope=f'{scope}{cls_name}::')) + for namespace in data.namespaces: mapping.update(self.build_naive_mapping(data.namespaces[namespace], mapping=mapping, scope=f'{scope}{namespace}::')) elif isinstance(data, ClassScope): for alias in data.using_alias: mapping[alias.alias] = get_type(alias.type, {}, mapping) + for typedef in data.typedefs: mapping[typedef.name] = scope + typedef.name + for enum in data.enums: if not name_is_anonymous(enum.typename): enum_name = '::'.join([seg.name for seg in enum.typename.segments]) diff --git a/modules/python/generator/methods.py b/modules/python/generator/methods.py index a600220212..0b9bf6248c 100644 --- a/modules/python/generator/methods.py +++ b/modules/python/generator/methods.py @@ -96,6 +96,11 @@ def ref_to_class_method(method: types.Method, cls_name: str, method_name: str, r cast_str = f'{return_type} {pointer_to_type}({", ".join(params)}) {maybe_const}' return f'static_cast<{cast_str}>(&{cls_name}::{method_name})' +def ref_to_function(method_name: str, return_type: str, params: List[str]) -> str: + pointer_to_type = '(*)' + cast_str = f'{return_type} {pointer_to_type}({", ".join(params)})' + return f'static_cast<{cast_str}>(&{method_name})' + def method_def(py_name: str, method: str, additional_args: List[str], static: bool) -> str: def_type = 'def' if not static else 'def_static' additional_args_str = ', '.join(additional_args) @@ -215,16 +220,26 @@ def define_method(method: types.Method, method_config: Dict, is_class_method, sp # Fetch documentation if available if header.documentation_holder is not None: - method_doc_signature = MethodDocSignature(method_name, - get_type(method.return_type, {}, header_env.mapping), # Don't use specializations so that we can match with doc - [get_type(param.type, {}, header_env.mapping) for param in method.parameters], - method.const, method.static) + if is_class_method: + method_doc_signature = MethodDocSignature(method_name, + get_type(method.return_type, {}, header_env.mapping), # Don't use specializations so that we can match with doc + [get_type(param.type, {}, header_env.mapping) for param in method.parameters], + method.const, method.static) + else: + method_doc_signature = MethodDocSignature(method_name, + get_type(method.return_type, {}, header_env.mapping), # Don't use specializations so that we can match with doc + [get_type(param.type, {}, header_env.mapping) for param in method.parameters], + True, True) method_doc = header.documentation_holder.get_documentation_for_method(bound_object.cpp_no_template_name, method_doc_signature, {}, specs, input_param_names, output_param_names) if method_doc is None: print(f'Could not find documentation for {bound_object.cpp_name}::{method_name}!') else: py_arg_strs = [method_doc.documentation] + py_arg_strs + if 'vpAutoThresholdMethod' in header_env.mapping: + print('AAAAA', header_env.mapping) + print(params_strs) + # If a function has refs to immutable params, we need to return them. should_wrap_for_tuple_return = param_is_output is not None and any(param_is_output) if should_wrap_for_tuple_return: @@ -237,12 +252,12 @@ def define_method(method: types.Method, method_config: Dict, is_class_method, sp param_is_only_output = [not is_input and is_output for is_input, is_output in zip(param_is_input, param_is_output)] param_declarations = [f'{get_type_for_declaration(method.parameters[i].type, specs, header_env.mapping)} {param_names[i]};' for i in range(len(param_is_only_output)) if param_is_only_output[i]] param_declarations = '\n'.join(param_declarations) - if not method.static: + if is_class_method and not method.static: self_param_with_name = bound_object.cpp_name + '& self' method_caller = 'self.' else: self_param_with_name = None - method_caller = bound_object.cpp_name + '::' + method_caller = bound_object.cpp_name + '::' if is_class_method else bound_object.cpp_name if return_type is None or return_type == 'void': maybe_get_return = '' @@ -265,9 +280,12 @@ def define_method(method: types.Method, method_config: Dict, is_class_method, sp method_body_str = define_lambda('', final_lambda_params, None, lambda_body) else: - method_body_str = ref_to_class_method(method, bound_object.cpp_name, method_name, return_type, params_strs) + if is_class_method: + method_body_str = ref_to_class_method(method, bound_object.cpp_name, method_name, return_type, params_strs) + else: + method_body_str = ref_to_function(bound_object.cpp_name + method_name, return_type, params_strs) - method_str = method_def(py_method_name, method_body_str, py_arg_strs, method.static) + method_str = method_def(py_method_name, method_body_str, py_arg_strs, method.static if is_class_method else False) method_str = f'{bound_object.python_ident}.{method_str};' return method_str, (py_method_name, method) @@ -340,7 +358,32 @@ def get_bindable_methods_with_config(submodule: 'Submodule', methods: List[types return bindable_methods, rejected_methods +def get_bindable_functions_with_config(submodule: 'Submodule', functions: List[types.Function], mapping) -> Tuple[List[Tuple[types.Function, Dict]], List[RejectedMethod]]: + bindable_functions = [] + rejected_functions = [] + # Order of predicates is important: The first predicate that matches will be the one shown in the log, and they do not all have the same importance + filtering_predicates_and_motives = [ + (lambda _, conf: conf['ignore'], NotGeneratedReason.UserIgnored), + (lambda m, _: get_name(m.name) in ['from_json', 'to_json', 'operator<<'], NotGeneratedReason.UserIgnored), + (lambda m, conf: m.template is not None and (conf.get('specializations') is None or len(conf['specializations']) == 0), NotGeneratedReason.UnspecifiedTemplateSpecialization), + (lambda m, _: any(is_unsupported_argument_type(param.type) for param in m.parameters), NotGeneratedReason.ArgumentType), + (lambda m, _: is_unsupported_return_type(m.return_type), NotGeneratedReason.ReturnType) + ] + for function in functions: + function_config = submodule.get_method_config(None, function, {}, mapping) + method_can_be_bound = True + for predicate, motive in filtering_predicates_and_motives: + if predicate(function, function_config): + return_str = '' if function.return_type is None else (get_type(function.return_type, {}, mapping) or '') + method_name = '::'.join(seg.name for seg in function.name.segments) + param_strs = [get_type(param.type, {}, mapping) or '' for param in function.parameters] + rejected_functions.append(RejectedMethod('', function, function_config, get_method_signature(method_name, return_str, param_strs), motive)) + method_can_be_bound = False + break + if method_can_be_bound: + bindable_functions.append((function, function_config)) + return bindable_functions, rejected_functions def split_methods_with_config(methods: List[Tuple[types.Method, Dict]], predicate: Callable[[types.Method], bool]) -> Tuple[List[Tuple[types.Method, Dict]], List[Tuple[types.Method, Dict]]]: matching = [] diff --git a/modules/python/generator/submodule.py b/modules/python/generator/submodule.py index 278d9714c5..cc3ba211e0 100644 --- a/modules/python/generator/submodule.py +++ b/modules/python/generator/submodule.py @@ -171,6 +171,7 @@ def get_method_config(self, class_name: Optional[str], method, owner_specs, head #import sys; sys.exit() return res + def get_submodules(include_path: Path, generate_path: Path) -> List[Submodule]: modules = ['core', 'imgproc', 'vision', 'visual_features', 'vs', 'sensor', 'io', 'detection', 'robot', 'gui'] result = [] From 92e9f0c5719f7e8b2fabe76c73775cb51db5fb64 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Tue, 10 Oct 2023 12:29:44 +0200 Subject: [PATCH 068/169] fix issue with name resolution when a symbol is in a namespace --- modules/python/bindings/CMakeLists.txt | 2 +- modules/python/generator/doc_parser.py | 3 ++- modules/python/generator/enum_binding.py | 11 +++++++---- modules/python/generator/header.py | 2 +- modules/python/generator/methods.py | 3 ++- modules/python/generator/utils.py | 18 +++++++++++++++++- 6 files changed, 30 insertions(+), 9 deletions(-) diff --git a/modules/python/bindings/CMakeLists.txt b/modules/python/bindings/CMakeLists.txt index 1dfb48f264..1dd4bc7dda 100644 --- a/modules/python/bindings/CMakeLists.txt +++ b/modules/python/bindings/CMakeLists.txt @@ -14,5 +14,5 @@ message(${VISP_VERSION}) message(${pybind11_VERSION}) file(GLOB generated_cpp src/*.cpp) file(GLOB static_cpp src/static/*.cpp) -pybind11_add_module(visp ${generated_cpp} ${static_cpp} THIN_LTO) +pybind11_add_module(visp THIN_LTO ${generated_cpp} ${static_cpp}) target_link_libraries(visp PRIVATE ${VISP_LIBRARIES}) diff --git a/modules/python/generator/doc_parser.py b/modules/python/generator/doc_parser.py index 77abb0785e..4fca9ac4eb 100644 --- a/modules/python/generator/doc_parser.py +++ b/modules/python/generator/doc_parser.py @@ -76,6 +76,7 @@ class MethodDocumentation(object): @dataclass class ClassDocumentation(object): documentation: str + @dataclass class DocElements(object): compounddefs: Dict[str, compounddefType] @@ -297,7 +298,7 @@ def get_documentation_for_method(self, cls_name: str, signature: MethodDocSignat param_strs.append(f':param {param_name}: {params_dict[param_name]}') param_str = '\n'.join(param_strs) if len(output_param_names) > 0: - return_str = ':return: A tuple containing:\n' + return_str = ':return: A tuple containing:\n' # TODO: if we only return a single element, we should modify this if signature.ret != 'void' and signature.ret is not None: return_str += f'\n\t * {cpp_return_str}' for param_name in output_param_names: diff --git a/modules/python/generator/enum_binding.py b/modules/python/generator/enum_binding.py index 782da20edf..07f0cce70e 100644 --- a/modules/python/generator/enum_binding.py +++ b/modules/python/generator/enum_binding.py @@ -82,11 +82,13 @@ def accumulate_data(scope: Union[NamespaceScope, ClassScope]): accumulate_data(scope.namespaces[namespace]) for enum in scope.enums: public_access = True - if enum.access is None or enum.access != 'public': + if enum.access is not None or enum.access != 'public': public_access = False anonymous_enum, enum_id = is_anonymous_name(enum.typename) full_name = get_typename(enum.typename, {}, mapping) if not anonymous_enum else None + if not public_access: + print(f'Not public: {full_name}, {enum.access}') matches = lambda repr: match_id(repr, enum_id) or match_name(repr, full_name) matching = list(filter(matches, temp_data)) assert len(matching) <= 1, f"There cannot be more than one repr found. Matches = {matching}" @@ -138,23 +140,26 @@ def enum_bindings(root_scope: NamespaceScope, mapping: Dict, submodule: Submodul if repr.public_access: final_reprs.append(repr) else: + print(f'Filtered {repr.name}') temp_data.append(repr) for repr in temp_data: print(f'Enum {repr} was ignored, because it is either marked as private or it is incomplete (missing values or name)') - for enum_repr in final_reprs: + print(f'seeing {enum_repr.name}') name_segments = enum_repr.name.split('::') py_name = name_segments[-1].replace('vp', '') # If an owner class is ignored, don't export this enum parent_ignored = False ignored_parent_name = None + for segment in name_segments[:-1]: full_segment_name = mapping.get(segment) if full_segment_name is not None and submodule.class_should_be_ignored(full_segment_name): parent_ignored = True ignored_parent_name = full_segment_name break + if parent_ignored: print(f'Ignoring enum {py_name} because {ignored_parent_name} is ignored') continue @@ -171,6 +176,4 @@ def enum_bindings(root_scope: NamespaceScope, mapping: Dict, submodule: Submodul values.append(f'{py_ident}.export_values();') definition = '\n'.join(values) result.append((declaration, definition)) - - return result \ No newline at end of file diff --git a/modules/python/generator/header.py b/modules/python/generator/header.py index 95284a0b40..a9536ee8bc 100644 --- a/modules/python/generator/header.py +++ b/modules/python/generator/header.py @@ -100,7 +100,7 @@ def run_preprocessor(self): # TODO: run without generating a new file '-D', 'DOXYGEN_SHOULD_SKIP_THIS', # Skip methods and classes that are not exposed in documentation: they are internals '-I', '/home/sfelton/software/visp_build/include', '-I', '/usr/local/include', - #'-I', '/usr/include', + '-I', '/usr/include', '-N', 'VISP_BUILD_DEPRECATED_FUNCTIONS', '--passthru-includes', "^((?!vpConfig.h).)*$", '--passthru-unfound-includes', diff --git a/modules/python/generator/methods.py b/modules/python/generator/methods.py index 0b9bf6248c..439d2130f0 100644 --- a/modules/python/generator/methods.py +++ b/modules/python/generator/methods.py @@ -364,7 +364,8 @@ def get_bindable_functions_with_config(submodule: 'Submodule', functions: List[t # Order of predicates is important: The first predicate that matches will be the one shown in the log, and they do not all have the same importance filtering_predicates_and_motives = [ (lambda _, conf: conf['ignore'], NotGeneratedReason.UserIgnored), - (lambda m, _: get_name(m.name) in ['from_json', 'to_json', 'operator<<'], NotGeneratedReason.UserIgnored), + (lambda m, _: get_name(m.name) in ['from_json', 'to_json'], NotGeneratedReason.UserIgnored), + (lambda m, _: get_name(m.name).startswith('operator'), NotGeneratedReason.UserIgnored), (lambda m, conf: m.template is not None and (conf.get('specializations') is None or len(conf['specializations']) == 0), NotGeneratedReason.UnspecifiedTemplateSpecialization), (lambda m, _: any(is_unsupported_argument_type(param.type) for param in m.parameters), NotGeneratedReason.ArgumentType), (lambda m, _: is_unsupported_return_type(m.return_type), NotGeneratedReason.ReturnType) diff --git a/modules/python/generator/utils.py b/modules/python/generator/utils.py index 9bcea22acc..5f0ba5d622 100644 --- a/modules/python/generator/utils.py +++ b/modules/python/generator/utils.py @@ -40,7 +40,23 @@ def segment_repr(segment: types.PQNameSegment) -> str: spec_str = f'<{",".join(template_strs)}>' return segment_name + spec_str - return '::'.join(list(map(segment_repr, typename.segments))) + segment_reprs = list(map(segment_repr, typename.segments)) + # Through environment mapping, it is possible that a segment is resolved into two "segments" + # E.g. a class "vpA" in a namespace "vp" is resolve to "vp::vpA" + # If we resolve for the segments ["vp", "vpA"], we will obtain "vp::vp::vpA" + # We must thus check that this is not the case and filter out redundant segments (in this case, "vp") + final_segment_reprs = [segment_reprs[-1]] # this is always final + + for i in range(len(segment_reprs) - 1): + all_segs_prefix = '::'.join(segment_reprs[i:-1]) + # We only compare with the last one (which should be a class name) since this is what is resolved to a complete name + # TODO: When the problem arises with a templated type, this may fail. + if not final_segment_reprs[-1].startswith(all_segs_prefix + '::'): + final_segment_reprs.insert(len(final_segment_reprs) - 1, segment_reprs[i]) + else: + break + + return '::'.join(final_segment_reprs) def get_type(param: Union[types.FunctionType, types.DecoratedType, types.Value], owner_specs: Dict[str, str], header_env_mapping: Dict[str, str]) -> Optional[str]: ''' From a0c4803e22e4698405e3feb87eb67e2d393aceb8 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Tue, 10 Oct 2023 18:09:44 +0200 Subject: [PATCH 069/169] document todos, generate tt, tt_mi, blob and me wip --- modules/python/build.sh | 2 +- modules/python/config/blob.json | 35 ++++++++++++ modules/python/config/core.json | 8 +++ modules/python/config/klt.json | 1 + modules/python/config/me.json | 65 ++++++++++++++++++++++ modules/python/config/tt.json | 1 + modules/python/config/tt_mi.json | 1 + modules/python/docs/api.rst | 1 + modules/python/docs/static/todos.rst | 68 +++++++++++++++++++++--- modules/python/generator/enum_binding.py | 35 +++++++----- modules/python/generator/header.py | 2 +- modules/python/generator/submodule.py | 34 +++++++++++- modules/python/generator/utils.py | 36 +++++++++++++ 13 files changed, 267 insertions(+), 22 deletions(-) create mode 100644 modules/python/config/blob.json create mode 100644 modules/python/config/klt.json create mode 100644 modules/python/config/me.json create mode 100644 modules/python/config/tt.json create mode 100644 modules/python/config/tt_mi.json diff --git a/modules/python/build.sh b/modules/python/build.sh index be41b8d0e9..26264414ff 100755 --- a/modules/python/build.sh +++ b/modules/python/build.sh @@ -1 +1 @@ -python generator/generator.py && pip install ./bindings && rm -r stubs/build && pip install ./stubs && cd docs && rm -r _build && make html && cd .. \ No newline at end of file +python generator/generator.py && pip install ./bindings && pip install ./stubs && cd docs && rm -r _build && make html && cd .. \ No newline at end of file diff --git a/modules/python/config/blob.json b/modules/python/config/blob.json new file mode 100644 index 0000000000..69ac5fdf0e --- /dev/null +++ b/modules/python/config/blob.json @@ -0,0 +1,35 @@ +{ + "ignored_headers": [], + "ignored_classes": [], + "user_defined_headers": [], + "classes": { + "vpDot": { + "methods": [ + { + "static": true, + "signature": "void display(const vpImage&, const vpImagePoint&, const std::list&, vpColor, unsigned int)", + "custom_name": "displayDot" + }, + { + "static": true, + "signature": "void display(const vpImage&, const vpImagePoint&, const std::list&, vpColor, unsigned int)", + "custom_name": "displayDot" + } + ] + }, + "vpDot2": { + "methods": [ + { + "static": true, + "signature": "void display(const vpImage&, const vpImagePoint&, const std::list&, vpColor, unsigned int)", + "custom_name": "displayDot" + }, + { + "static": true, + "signature": "void display(const vpImage&, const vpImagePoint&, const std::list&, vpColor, unsigned int)", + "custom_name": "displayDot" + } + ] + } + }, + "enums": {}} \ No newline at end of file diff --git a/modules/python/config/core.json b/modules/python/config/core.json index 67e03b409a..a6422b5876 100644 --- a/modules/python/config/core.json +++ b/modules/python/config/core.json @@ -4,6 +4,14 @@ "vpFrameGrabberException", "vpIoException", "vpDisplayException", "vpMatrixException"], "user_defined_headers": ["core.hpp"], + "enums": { + "vpMunkres::STEP_T": { + "ignore": true + }, + "vpMunkres::ZERO_T": { + "ignore": true + } + }, "classes": { "vpArray2D": { "additional_bindings": "bindings_vpArray2D", diff --git a/modules/python/config/klt.json b/modules/python/config/klt.json new file mode 100644 index 0000000000..871b47c723 --- /dev/null +++ b/modules/python/config/klt.json @@ -0,0 +1 @@ +{"ignored_headers": [], "ignored_classes": [], "user_defined_headers": [], "classes": {}, "enums": {}} \ No newline at end of file diff --git a/modules/python/config/me.json b/modules/python/config/me.json new file mode 100644 index 0000000000..f481830444 --- /dev/null +++ b/modules/python/config/me.json @@ -0,0 +1,65 @@ +{ + "ignored_headers": [], + "ignored_classes": [], + "user_defined_headers": [], + "enums": {}, + "classes": { + "vpMeSite": { + "methods": [ + { + "static": true, + "signature": "void display(const vpImage &, const double &, const double &, const vpMeSite::vpMeSiteState&)", + "custom_name": "displayMeSite" + }, + { + "static": true, + "signature": "void display(const vpImage &, const double &, const double &, const vpMeSite::vpMeSiteState&)", + "custom_name": "displayMeSite" + } + ] + }, + "vpNurbs": { + "methods": [ + { + "static": true, + "signature": "unsigned int removeCurveKnot(double, unsigned int, unsigned int, double, unsigned int, unsigned int, std::vector &, std::vector &, std::vector &)", + "custom_name": "removeCurveKnotStatic" + }, + { + "static": true, + "signature": "void globalCurveInterp(std::vector &, unsigned int, std::vector &, std::vector &, std::vector &)", + "custom_name": "globalCurveInterpStatic" + }, + { + "static": true, + "signature": "void globalCurveApprox(std::vector &, unsigned int, unsigned int, std::vector &, std::vector &, std::vector &)", + "custom_name": "globalCurveApproxStatic" + }, + { + "static": true, + "signature": "vpImagePoint computeCurvePoint(double, unsigned int, unsigned int, std::vector &, std::vector &, std::vector &)", + "custom_name": "computeCurvePointStatic" + }, + { + "static": true, + "signature": "void curveKnotIns(double, unsigned int, unsigned int, unsigned int, unsigned int, std::vector &, std::vector &, std::vector &)", + "custom_name": "curveKnotInsStatic" + } + ] + }, + "vpMeNurbs": { + "methods": [ + { + "static": true, + "signature": "void display(const vpImage&, vpNurbs&, const vpColor&, unsigned int)", + "custom_name": "displayMeNurbs" + }, + { + "static": true, + "signature": "void display(const vpImage&, vpNurbs&, const vpColor&, unsigned int)", + "custom_name": "displayMeNurbs" + } + ] + } + } +} \ No newline at end of file diff --git a/modules/python/config/tt.json b/modules/python/config/tt.json new file mode 100644 index 0000000000..871b47c723 --- /dev/null +++ b/modules/python/config/tt.json @@ -0,0 +1 @@ +{"ignored_headers": [], "ignored_classes": [], "user_defined_headers": [], "classes": {}, "enums": {}} \ No newline at end of file diff --git a/modules/python/config/tt_mi.json b/modules/python/config/tt_mi.json new file mode 100644 index 0000000000..871b47c723 --- /dev/null +++ b/modules/python/config/tt_mi.json @@ -0,0 +1 @@ +{"ignored_headers": [], "ignored_classes": [], "user_defined_headers": [], "classes": {}, "enums": {}} \ No newline at end of file diff --git a/modules/python/docs/api.rst b/modules/python/docs/api.rst index 1fcec08151..300e5a49f0 100644 --- a/modules/python/docs/api.rst +++ b/modules/python/docs/api.rst @@ -14,3 +14,4 @@ API reference visp.vs visp.robot visp.detection + visp.imgproc diff --git a/modules/python/docs/static/todos.rst b/modules/python/docs/static/todos.rst index 67efaf2aa0..fedace77c8 100644 --- a/modules/python/docs/static/todos.rst +++ b/modules/python/docs/static/todos.rst @@ -1,14 +1,70 @@ List of todos ====================== +What remains to be done + +Code generation +--------------- + * There is an issue when indexing readonly arrays such as HomogeneousMatrix or RotationMatrix -* Generate documentation for enums -* In classes, generate documentation for: constructors, operators -* Default values for parameters * Unary and n ary operators * Exclude get operators for vpArray2D ? * Parse subnamespaces - * Be careful of the anonymous namespace: this namespace is only visible in header, so it should be ignored -* Parse "free" functions (See imgproc module) + * Classes in subnamespaces are ignored +* Keep alive for numpy interfaces * How should we handle parameters coming from external APIs ? e.g. realsense2, PCL. Can we interact with other bindings such as of opencv's -* Reimplement a framegrabber tutorial in python, with matplotlib \ No newline at end of file +* Reimplement a framegrabber tutorial in python, with matplotlib + + +Documentation +---------------- + +* In classes, generate documentation for: constructors, operators +* Reference python types in Documentation +* Prefer Python examples instead of C++ ones ? +* Generate documentation for functions that are not in classes +* Generate documentation for enums +* Allow passing py::gil_scope_release etc to function from config +* Same for keep_alive (feature moments database) +* Export Tracking modules +* Add callback for before_module and after_module so that we can define additional bindings by hand in the module. This is already done per class +* Add a way to replace a default method binding with a custom one (What about doc?) + +To be written: +* Specific changes from C++ to Python API +* Documentation for the overall workflow of the bindings generation +* In code documentation for the generator +* Document config files + + +Packaging +------------------ + +* Root CMake + + * Build last + * Build after doc if doc can be generated + * Correspondance between headers and modules + * Copy to binary dir + * Compile in binary dir + +* Package generator to install as an editable +* Automatic version + +Python side +----------------- +* Testing + + * Test numpy arrays, partially done + * Test specific methods with specific returns + * Test keep alive if possible ? + +* Generate some examples + + * Tracking (megapose/mbt) + * Frame grabbing + * UI + +* Add python sources to visp package + + * Matplotlib based plotter diff --git a/modules/python/generator/enum_binding.py b/modules/python/generator/enum_binding.py index 07f0cce70e..d5183cd165 100644 --- a/modules/python/generator/enum_binding.py +++ b/modules/python/generator/enum_binding.py @@ -82,13 +82,19 @@ def accumulate_data(scope: Union[NamespaceScope, ClassScope]): accumulate_data(scope.namespaces[namespace]) for enum in scope.enums: public_access = True - if enum.access is not None or enum.access != 'public': - public_access = False anonymous_enum, enum_id = is_anonymous_name(enum.typename) full_name = get_typename(enum.typename, {}, mapping) if not anonymous_enum else None - if not public_access: - print(f'Not public: {full_name}, {enum.access}') + # If in a namespace or parent class, this symbol can be referenced from outside and the visibility will be incorrect + if enum.access is not None and enum.access != 'public': + public_access = False + + if full_name is not None and '::' in full_name: + base_ref = fetch_fully_qualified_id(root_scope, full_name.split('::')) + print(full_name, base_ref) + if base_ref is not None and isinstance(base_ref, types.EnumDecl) and base_ref.access is not None and base_ref.access != 'public': + public_access = False + matches = lambda repr: match_id(repr, enum_id) or match_name(repr, full_name) matching = list(filter(matches, temp_data)) assert len(matching) <= 1, f"There cannot be more than one repr found. Matches = {matching}" @@ -105,7 +111,7 @@ def accumulate_data(scope: Union[NamespaceScope, ClassScope]): if not is_typedef_to_enum(typedef): continue public_access = True - if typedef.access is None or typedef.access != 'public': + if typedef.access is not None and typedef.access != 'public': public_access = False anonymous_enum, enum_id = is_anonymous_name(typedef.type.typename) @@ -132,21 +138,26 @@ def accumulate_data(scope: Union[NamespaceScope, ClassScope]): def enum_bindings(root_scope: NamespaceScope, mapping: Dict, submodule: Submodule) -> List[Tuple[str, str]]: - final_data, temp_data = resolve_enums_and_typedefs(root_scope, mapping) + final_data, filtered_reprs = resolve_enums_and_typedefs(root_scope, mapping) + + for repr in filtered_reprs: + print(f'Enum {repr} was ignored, because it is incomplete (missing values or name)') result = [] final_reprs = [] for repr in final_data: - if repr.public_access: + enum_config = submodule.get_enum_config(repr.name) + if enum_config['ignore']: + filtered_reprs.append(repr) + print(f'Enum {repr.name} is ignored by user') + elif repr.public_access: final_reprs.append(repr) else: - print(f'Filtered {repr.name}') - temp_data.append(repr) + filtered_reprs.append(repr) + + - for repr in temp_data: - print(f'Enum {repr} was ignored, because it is either marked as private or it is incomplete (missing values or name)') for enum_repr in final_reprs: - print(f'seeing {enum_repr.name}') name_segments = enum_repr.name.split('::') py_name = name_segments[-1].replace('vp', '') # If an owner class is ignored, don't export this enum diff --git a/modules/python/generator/header.py b/modules/python/generator/header.py index a9536ee8bc..95284a0b40 100644 --- a/modules/python/generator/header.py +++ b/modules/python/generator/header.py @@ -100,7 +100,7 @@ def run_preprocessor(self): # TODO: run without generating a new file '-D', 'DOXYGEN_SHOULD_SKIP_THIS', # Skip methods and classes that are not exposed in documentation: they are internals '-I', '/home/sfelton/software/visp_build/include', '-I', '/usr/local/include', - '-I', '/usr/include', + #'-I', '/usr/include', '-N', 'VISP_BUILD_DEPRECATED_FUNCTIONS', '--passthru-includes', "^((?!vpConfig.h).)*$", '--passthru-unfound-includes', diff --git a/modules/python/generator/submodule.py b/modules/python/generator/submodule.py index cc3ba211e0..1603f1c3bd 100644 --- a/modules/python/generator/submodule.py +++ b/modules/python/generator/submodule.py @@ -18,8 +18,7 @@ def __init__(self, name: str, include_path: Path, submodule_file_path: Path): self.include_path = include_path self.submodule_file_path = submodule_file_path self.config_path = Path('config') / (name + '.json') - with open(self.config_path, 'r') as config_file: - self.config = json.load(config_file) + self.config = self._get_config_file_or_create_default(self.config_path) self.report = Report(self) self.headers = self._get_headers() assert self.include_path.exists(), f'Submodule path {self.include_path} not found' @@ -34,6 +33,22 @@ def _get_headers(self) -> List[HeaderFile]: continue headers.append(HeaderFile(include_file, self)) return headers + def _get_config_file_or_create_default(self, path: Path) -> Dict: + if not path.exists(): + default_config = { + 'ignored_headers': [], + 'ignored_classes': [], + 'user_defined_headers': [], + 'classes': {}, + 'enums': {} + } + with open(path, 'w') as config_file: + json.dump(default_config, config_file) + return default_config + else: + with open(path, 'r') as config_file: + config = json.load(config_file) + return config def set_headers_from_common_list(self, all_headers: List[HeaderFile]) -> None: ''' @@ -145,6 +160,16 @@ def get_class_config(self, class_name: str) -> Optional[Dict]: return default_config default_config.update(self.config['classes'][class_name]) return default_config + def get_enum_config(self, enum_name: str) -> Optional[Dict]: + default_config = { + 'ignore': False, + } + if 'enums' not in self.config: + return default_config + if enum_name not in self.config['enums']: + return default_config + default_config.update(self.config['enums'][enum_name]) + return default_config def get_method_config(self, class_name: Optional[str], method, owner_specs, header_mapping) -> Dict: res = { @@ -177,4 +202,9 @@ def get_submodules(include_path: Path, generate_path: Path) -> List[Submodule]: result = [] for module in modules: result.append(Submodule(module, Path(f'/home/sfelton/software/visp-sfelton/modules/{module}/include/visp3/{module}'), generate_path / f'{module}.cpp')) + tracking_modules = ['tt', 'tt_mi', 'klt', 'me', 'blob'] + for module in tracking_modules: + result.append(Submodule(module, Path(f'/home/sfelton/software/visp-sfelton/modules/tracker/{module}/include/visp3/{module}'), generate_path / f'{module}.cpp')) + + return result diff --git a/modules/python/generator/utils.py b/modules/python/generator/utils.py index 5f0ba5d622..369731828d 100644 --- a/modules/python/generator/utils.py +++ b/modules/python/generator/utils.py @@ -104,6 +104,42 @@ def get_type_for_declaration(param: Union[types.FunctionType, types.DecoratedTyp else: return get_type(param, owner_specs, header_env_mapping) +def fetch_fully_qualified_id(scope: Union[NamespaceScope, ClassScope], segments: List[str]) -> Union[None, types.EnumDecl, NamespaceScope, ClassScope]: + ''' + Retrieve the declaration of an object from its fully qualified name. + This can be useful when a symbol is reference in two places: + such as in the following header: + + class vpA { + private: + enum vpEnum: unsigned int; + }; + enum vpA::vpEnum : unsigned int {...}; + + In this case, the vpA::vpEnum symbol's visibility (here it is actually private) is undefined in cxxheaderparser (None) when looking at enum declarations outside the class + Here, calling this method with the name vpA::vpEnum will retrieve the enum declaration in the class vpA, for which the visibility is correctly set to private. + ''' + + if len(segments) == 0: + return scope + + seg = segments[0] + if isinstance(scope, NamespaceScope): + for ns in scope.namespaces: + if ns == seg: + return fetch_fully_qualified_id(scope.namespaces[ns], segments[1:]) + for cls in scope.classes: + if get_name(cls.class_decl.typename) == seg: + return fetch_fully_qualified_id(cls, segments[1:]) + if len(segments) == 1: # Test objects that cannot have children + for enum in scope.enums: + if not name_is_anonymous(enum.typename) and get_name(enum.typename) == seg: + return enum + + return None + + + def is_pointer_to_const_cstr(param: types.Pointer) -> bool: ''' Whether the passed in pointer is of type const char* From 0d7ab74dae17d71ac1283576451f0e1f9e1c9951 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Wed, 11 Oct 2023 17:36:22 +0200 Subject: [PATCH 070/169] Exporting dnn_tracker and MBT modules, with some major issues --- modules/python/bindings/CMakeLists.txt | 34 +++++++++---------- modules/python/config/dnn_tracker.json | 1 + modules/python/config/klt.json | 17 +++++++++- modules/python/config/mbt.json | 1 + modules/python/docs/api.rst | 2 ++ modules/python/docs/static/todos.rst | 7 ++++ modules/python/generator/header.py | 5 +-- modules/python/generator/methods.py | 4 +-- modules/python/generator/submodule.py | 7 ++-- modules/python/generator/utils.py | 24 ++++++++----- .../include/visp3/mbt/vpMbGenericTracker.h | 1 + .../tracker/me/include/visp3/me/vpMeNurbs.h | 7 ---- .../visp3/tt_mi/vpTemplateTrackerMIESM.h | 9 ++--- 13 files changed, 76 insertions(+), 43 deletions(-) create mode 100644 modules/python/config/dnn_tracker.json create mode 100644 modules/python/config/mbt.json diff --git a/modules/python/bindings/CMakeLists.txt b/modules/python/bindings/CMakeLists.txt index 1dd4bc7dda..797d08a794 100644 --- a/modules/python/bindings/CMakeLists.txt +++ b/modules/python/bindings/CMakeLists.txt @@ -1,18 +1,18 @@ -cmake_minimum_required (VERSION 3.5) -project(visp) +# cmake_minimum_required (VERSION 3.5) +# project(visp) -find_package(pybind11 REQUIRED) -find_package(VISP REQUIRED) -include_directories(${VISP_INCLUDE_DIRS}) -include_directories(include) -message(${VISP_DIR}) -string(REPLACE ";" "\n" str "${VISP_INCLUDE_DIRS}") -message(STATUS ${str}) -string(REPLACE ";" "\n" str "${VISP_LIBRARIES}") -message(STATUS ${str}) -message(${VISP_VERSION}) -message(${pybind11_VERSION}) -file(GLOB generated_cpp src/*.cpp) -file(GLOB static_cpp src/static/*.cpp) -pybind11_add_module(visp THIN_LTO ${generated_cpp} ${static_cpp}) -target_link_libraries(visp PRIVATE ${VISP_LIBRARIES}) +# find_package(pybind11 REQUIRED) +# find_package(VISP REQUIRED) +# include_directories(${VISP_INCLUDE_DIRS}) +# include_directories(include) +# message(${VISP_DIR}) +# string(REPLACE ";" "\n" str "${VISP_INCLUDE_DIRS}") +# message(STATUS ${str}) +# string(REPLACE ";" "\n" str "${VISP_LIBRARIES}") +# message(STATUS ${str}) +# message(${VISP_VERSION}) +# message(${pybind11_VERSION}) +# file(GLOB generated_cpp src/*.cpp) +# file(GLOB static_cpp src/static/*.cpp) +# pybind11_add_module(visp THIN_LTO ${generated_cpp} ${static_cpp}) +# target_link_libraries(visp PRIVATE ${VISP_LIBRARIES}) diff --git a/modules/python/config/dnn_tracker.json b/modules/python/config/dnn_tracker.json new file mode 100644 index 0000000000..871b47c723 --- /dev/null +++ b/modules/python/config/dnn_tracker.json @@ -0,0 +1 @@ +{"ignored_headers": [], "ignored_classes": [], "user_defined_headers": [], "classes": {}, "enums": {}} \ No newline at end of file diff --git a/modules/python/config/klt.json b/modules/python/config/klt.json index 871b47c723..f6f8c5403f 100644 --- a/modules/python/config/klt.json +++ b/modules/python/config/klt.json @@ -1 +1,16 @@ -{"ignored_headers": [], "ignored_classes": [], "user_defined_headers": [], "classes": {}, "enums": {}} \ No newline at end of file +{ + "ignored_headers": [], + "ignored_classes": [], + "user_defined_headers": [], + "classes": { + "vpKltOpencv": { + "methods": [ + { + "static": false, + "signature": "void display(const vpImage&, const vpColor&, unsigned int)", + "custom_name": "displaySelf" + } + ] + } + }, + "enums": {}} \ No newline at end of file diff --git a/modules/python/config/mbt.json b/modules/python/config/mbt.json new file mode 100644 index 0000000000..871b47c723 --- /dev/null +++ b/modules/python/config/mbt.json @@ -0,0 +1 @@ +{"ignored_headers": [], "ignored_classes": [], "user_defined_headers": [], "classes": {}, "enums": {}} \ No newline at end of file diff --git a/modules/python/docs/api.rst b/modules/python/docs/api.rst index 300e5a49f0..ad76004fc2 100644 --- a/modules/python/docs/api.rst +++ b/modules/python/docs/api.rst @@ -15,3 +15,5 @@ API reference visp.robot visp.detection visp.imgproc + visp.dnn_tracker + visp.mbt diff --git a/modules/python/docs/static/todos.rst b/modules/python/docs/static/todos.rst index fedace77c8..c2cb8a9664 100644 --- a/modules/python/docs/static/todos.rst +++ b/modules/python/docs/static/todos.rst @@ -3,6 +3,12 @@ List of todos What remains to be done +Changes to ViSP +------------- + +* Write initTracking for vpKltOpencv taking a vpImage as input. Ignore setInitialGuess. + + Code generation --------------- @@ -12,6 +18,7 @@ Code generation * Parse subnamespaces * Classes in subnamespaces are ignored * Keep alive for numpy interfaces +* Keep alive very probably for mbt * How should we handle parameters coming from external APIs ? e.g. realsense2, PCL. Can we interact with other bindings such as of opencv's * Reimplement a framegrabber tutorial in python, with matplotlib diff --git a/modules/python/generator/header.py b/modules/python/generator/header.py index 95284a0b40..6ad8fb5f57 100644 --- a/modules/python/generator/header.py +++ b/modules/python/generator/header.py @@ -97,12 +97,13 @@ def run_preprocessor(self): # TODO: run without generating a new file '', '-D', 'vp_deprecated=', '-D', 'VISP_EXPORT=', + '-D', '__cplusplus', # Fix for warning when reading opencv modules '-D', 'DOXYGEN_SHOULD_SKIP_THIS', # Skip methods and classes that are not exposed in documentation: they are internals '-I', '/home/sfelton/software/visp_build/include', '-I', '/usr/local/include', - #'-I', '/usr/include', + '-I', '/usr/include', '-N', 'VISP_BUILD_DEPRECATED_FUNCTIONS', - '--passthru-includes', "^((?!vpConfig.h).)*$", + '--passthru-includes', "^((?!vpConfig\.h|opencv_modules\.hpp|visp_modules.h).)*$", '--passthru-unfound-includes', '--passthru-comments', '--line-directive', '', diff --git a/modules/python/generator/methods.py b/modules/python/generator/methods.py index 439d2130f0..43981c55f2 100644 --- a/modules/python/generator/methods.py +++ b/modules/python/generator/methods.py @@ -364,7 +364,7 @@ def get_bindable_functions_with_config(submodule: 'Submodule', functions: List[t # Order of predicates is important: The first predicate that matches will be the one shown in the log, and they do not all have the same importance filtering_predicates_and_motives = [ (lambda _, conf: conf['ignore'], NotGeneratedReason.UserIgnored), - (lambda m, _: get_name(m.name) in ['from_json', 'to_json'], NotGeneratedReason.UserIgnored), + (lambda m, _: get_name(m.name) in ['from_json', 'to_json', 'from_megapose_json', 'to_megapose_json'], NotGeneratedReason.UserIgnored), # TODO: Remove hardcoded names (lambda m, _: get_name(m.name).startswith('operator'), NotGeneratedReason.UserIgnored), (lambda m, conf: m.template is not None and (conf.get('specializations') is None or len(conf['specializations']) == 0), NotGeneratedReason.UnspecifiedTemplateSpecialization), (lambda m, _: any(is_unsupported_argument_type(param.type) for param in m.parameters), NotGeneratedReason.ArgumentType), @@ -374,7 +374,7 @@ def get_bindable_functions_with_config(submodule: 'Submodule', functions: List[t function_config = submodule.get_method_config(None, function, {}, mapping) method_can_be_bound = True for predicate, motive in filtering_predicates_and_motives: - if predicate(function, function_config): + if predicate(function, function_config): # Function should be rejected return_str = '' if function.return_type is None else (get_type(function.return_type, {}, mapping) or '') method_name = '::'.join(seg.name for seg in function.name.segments) param_strs = [get_type(param.type, {}, mapping) or '' for param in function.parameters] diff --git a/modules/python/generator/submodule.py b/modules/python/generator/submodule.py index 1603f1c3bd..34bcd2254a 100644 --- a/modules/python/generator/submodule.py +++ b/modules/python/generator/submodule.py @@ -202,9 +202,12 @@ def get_submodules(include_path: Path, generate_path: Path) -> List[Submodule]: result = [] for module in modules: result.append(Submodule(module, Path(f'/home/sfelton/software/visp-sfelton/modules/{module}/include/visp3/{module}'), generate_path / f'{module}.cpp')) - tracking_modules = ['tt', 'tt_mi', 'klt', 'me', 'blob'] + tracking_modules = ['tt', 'tt_mi', 'klt', 'me', 'blob', ('dnn', 'dnn_tracker'), 'mbt'] for module in tracking_modules: - result.append(Submodule(module, Path(f'/home/sfelton/software/visp-sfelton/modules/tracker/{module}/include/visp3/{module}'), generate_path / f'{module}.cpp')) + if isinstance(module, str): + result.append(Submodule(module, Path(f'/home/sfelton/software/visp-sfelton/modules/tracker/{module}/include/visp3/{module}'), generate_path / f'{module}.cpp')) + else: + result.append(Submodule(module[1], Path(f'/home/sfelton/software/visp-sfelton/modules/tracker/{module[0]}/include/visp3/{module[1]}'), generate_path / f'{module[1]}.cpp')) return result diff --git a/modules/python/generator/utils.py b/modules/python/generator/utils.py index 369731828d..50edf94399 100644 --- a/modules/python/generator/utils.py +++ b/modules/python/generator/utils.py @@ -3,6 +3,7 @@ import pcpp import cxxheaderparser from cxxheaderparser.visitor import CxxVisitor +from cxxheaderparser.tokfmt import tokfmt from cxxheaderparser import types from cxxheaderparser.simple import parse_string, ParsedData, NamespaceScope, ClassScope from pathlib import Path @@ -23,7 +24,6 @@ def get_typename(typename: types.PQName, owner_specs, header_env_mapping) -> str This does not include constness, whether it is a pointer or a ref etc. ''' def segment_repr(segment: types.PQNameSegment) -> str: - spec_str = '' if isinstance(segment, types.FundamentalSpecifier): return segment.name segment_name = segment.name @@ -32,12 +32,13 @@ def segment_repr(segment: types.PQNameSegment) -> str: if segment.name in header_env_mapping: segment_name = header_env_mapping[segment.name] + spec_str = '' if segment.specialization is not None: template_strs = [] + for arg in segment.specialization.args: template_strs.append(get_type(arg.arg, owner_specs, header_env_mapping)) - - spec_str = f'<{",".join(template_strs)}>' + spec_str = f'<{", ".join(template_strs)}>' return segment_name + spec_str segment_reprs = list(map(segment_repr, typename.segments)) @@ -63,17 +64,18 @@ def get_type(param: Union[types.FunctionType, types.DecoratedType, types.Value], Get the type of a parameter. Compared to get_typename, this function resolves the parameter's constness, whether it is a ref, moveref or pointer. ''' if isinstance(param, types.Value): - return ''.join([token.value for token in param.tokens]) + return tokfmt(param.tokens) # This can appear when parsing templated types! Example: std::map*> as in MBT if isinstance(param, types.FunctionType): return_type = get_type(param.return_type, owner_specs, header_env_mapping) param_types = [get_type(p.type, owner_specs, header_env_mapping) for p in param.parameters] return f'{return_type}({", ".join(param_types)})' if isinstance(param, types.Type): repr_str = get_typename(param.typename, owner_specs, header_env_mapping) - split = repr_str.split('<') - if split[0] in header_env_mapping: - split[0] = header_env_mapping[split[0]] - repr_str = '<'.join(split) + + # split = repr_str.split('<') + # if split[0] in header_env_mapping: + # split[0] = header_env_mapping[split[0]] + # repr_str = '<'.join(split) if param.const: repr_str = 'const ' + repr_str return repr_str @@ -99,6 +101,12 @@ def get_type(param: Union[types.FunctionType, types.DecoratedType, types.Value], return None def get_type_for_declaration(param: Union[types.FunctionType, types.DecoratedType, types.Value], owner_specs: Dict[str, str], header_env_mapping: Dict[str, str]) -> Optional[str]: + ''' + Type string for when we want to declare a variable of a certain type. + We cannot declare an lref without initializing it (which we can't really do when generating code) + Example use case: declaring a variable inside a lambda. + ''' + if isinstance(param, types.Reference): return get_type(param.ref_to, owner_specs, header_env_mapping) else: diff --git a/modules/tracker/mbt/include/visp3/mbt/vpMbGenericTracker.h b/modules/tracker/mbt/include/visp3/mbt/vpMbGenericTracker.h index c8a40c05dd..7cb80ca70a 100644 --- a/modules/tracker/mbt/include/visp3/mbt/vpMbGenericTracker.h +++ b/modules/tracker/mbt/include/visp3/mbt/vpMbGenericTracker.h @@ -40,6 +40,7 @@ #ifndef _vpMbGenericTracker_h_ #define _vpMbGenericTracker_h_ +#include #include #include #include diff --git a/modules/tracker/me/include/visp3/me/vpMeNurbs.h b/modules/tracker/me/include/visp3/me/vpMeNurbs.h index 74e70c848c..658da4a7e1 100644 --- a/modules/tracker/me/include/visp3/me/vpMeNurbs.h +++ b/modules/tracker/me/include/visp3/me/vpMeNurbs.h @@ -248,13 +248,6 @@ class VISP_EXPORT vpMeNurbs : public vpMeTracker */ void updateDelta(); - /*! - * Seek along the edge defined by the nurbs, the two extremities of - * the edge. This function is useful in case of translation of the - * edge. - */ - void setExtremities(); - /*! * Seek along the edge defined by the nurbs, the two extremities of * the edge. This function is useful in case of translation of the diff --git a/modules/tracker/tt_mi/include/visp3/tt_mi/vpTemplateTrackerMIESM.h b/modules/tracker/tt_mi/include/visp3/tt_mi/vpTemplateTrackerMIESM.h index 570ac88289..4f92ef50a0 100644 --- a/modules/tracker/tt_mi/include/visp3/tt_mi/vpTemplateTrackerMIESM.h +++ b/modules/tracker/tt_mi/include/visp3/tt_mi/vpTemplateTrackerMIESM.h @@ -52,8 +52,10 @@ */ class VISP_EXPORT vpTemplateTrackerMIESM : public vpTemplateTrackerMI { +public: /*! Minimization method. */ - typedef enum { + typedef enum + { USE_NEWTON, // not used USE_LMA, // not used USE_GRADIENT, @@ -96,9 +98,8 @@ class VISP_EXPORT vpTemplateTrackerMIESM : public vpTemplateTrackerMI //! Default constructor. vpTemplateTrackerMIESM() : vpTemplateTrackerMI(), minimizationMethod(USE_NEWTON), CompoInitialised(false), HDirect(), HInverse(), - HdesireDirect(), HdesireInverse(), GDirect(), GInverse() - { - } + HdesireDirect(), HdesireInverse(), GDirect(), GInverse() + { } explicit vpTemplateTrackerMIESM(vpTemplateTrackerWarp *_warp); void setMinimizationMethod(vpMinimizationTypeMIESM method) { minimizationMethod = method; } From 714b5d595373b5a2e8efacebb470b58d6450a585 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Thu, 12 Oct 2023 12:41:40 +0200 Subject: [PATCH 071/169] move some hardcoded params into a config file --- modules/python/bindings/CMakeLists.txt | 34 +++++++++++++------------- modules/python/config/main_config.json | 19 ++++++++++++++ modules/python/generator/header.py | 1 + modules/python/generator/methods.py | 3 --- 4 files changed, 37 insertions(+), 20 deletions(-) create mode 100644 modules/python/config/main_config.json diff --git a/modules/python/bindings/CMakeLists.txt b/modules/python/bindings/CMakeLists.txt index 797d08a794..1dd4bc7dda 100644 --- a/modules/python/bindings/CMakeLists.txt +++ b/modules/python/bindings/CMakeLists.txt @@ -1,18 +1,18 @@ -# cmake_minimum_required (VERSION 3.5) -# project(visp) +cmake_minimum_required (VERSION 3.5) +project(visp) -# find_package(pybind11 REQUIRED) -# find_package(VISP REQUIRED) -# include_directories(${VISP_INCLUDE_DIRS}) -# include_directories(include) -# message(${VISP_DIR}) -# string(REPLACE ";" "\n" str "${VISP_INCLUDE_DIRS}") -# message(STATUS ${str}) -# string(REPLACE ";" "\n" str "${VISP_LIBRARIES}") -# message(STATUS ${str}) -# message(${VISP_VERSION}) -# message(${pybind11_VERSION}) -# file(GLOB generated_cpp src/*.cpp) -# file(GLOB static_cpp src/static/*.cpp) -# pybind11_add_module(visp THIN_LTO ${generated_cpp} ${static_cpp}) -# target_link_libraries(visp PRIVATE ${VISP_LIBRARIES}) +find_package(pybind11 REQUIRED) +find_package(VISP REQUIRED) +include_directories(${VISP_INCLUDE_DIRS}) +include_directories(include) +message(${VISP_DIR}) +string(REPLACE ";" "\n" str "${VISP_INCLUDE_DIRS}") +message(STATUS ${str}) +string(REPLACE ";" "\n" str "${VISP_LIBRARIES}") +message(STATUS ${str}) +message(${VISP_VERSION}) +message(${pybind11_VERSION}) +file(GLOB generated_cpp src/*.cpp) +file(GLOB static_cpp src/static/*.cpp) +pybind11_add_module(visp THIN_LTO ${generated_cpp} ${static_cpp}) +target_link_libraries(visp PRIVATE ${VISP_LIBRARIES}) diff --git a/modules/python/config/main_config.json b/modules/python/config/main_config.json new file mode 100644 index 0000000000..472923b843 --- /dev/null +++ b/modules/python/config/main_config.json @@ -0,0 +1,19 @@ +{ + "preprocessor": + { + "defines": { + "VISP_EXPORT": "", + "vp_deprecated": "", + "DOXYGEN_SHOULD_SKIP_THIS": "1", + "NLOHMANN_JSON_SERIALIZE_ENUM(a,...)": "void ignored() {}", + "__cplusplus" : "1" + }, + "passThroughIncludesRegex": "^((?!vpConfig\\.h|opencv_modules\\.hpp|visp_modules\\.h).)*$", + "neverDefine": [ + "VISP_BUILD_DEPRECATED_FUNCTIONS" + ], + "otherArguments": [ + "--passthru-unfound-includes", "--passthru-comments","--line-directive", "" + ] + } +} \ No newline at end of file diff --git a/modules/python/generator/header.py b/modules/python/generator/header.py index 6ad8fb5f57..45f5d6b379 100644 --- a/modules/python/generator/header.py +++ b/modules/python/generator/header.py @@ -103,6 +103,7 @@ def run_preprocessor(self): # TODO: run without generating a new file '-I', '/usr/local/include', '-I', '/usr/include', '-N', 'VISP_BUILD_DEPRECATED_FUNCTIONS', + '-D', 'NLOHMANN_JSON_SERIALIZE_ENUM(a,...)=void ignored() {}', '--passthru-includes', "^((?!vpConfig\.h|opencv_modules\.hpp|visp_modules.h).)*$", '--passthru-unfound-includes', '--passthru-comments', diff --git a/modules/python/generator/methods.py b/modules/python/generator/methods.py index 43981c55f2..48c56cd9c1 100644 --- a/modules/python/generator/methods.py +++ b/modules/python/generator/methods.py @@ -236,9 +236,6 @@ def define_method(method: types.Method, method_config: Dict, is_class_method, sp else: py_arg_strs = [method_doc.documentation] + py_arg_strs - if 'vpAutoThresholdMethod' in header_env.mapping: - print('AAAAA', header_env.mapping) - print(params_strs) # If a function has refs to immutable params, we need to return them. should_wrap_for_tuple_return = param_is_output is not None and any(param_is_output) From 7ce8d41c741adb94bc130c7ec43ab973dc4cfdb6 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Thu, 12 Oct 2023 17:19:56 +0200 Subject: [PATCH 072/169] Cleanup hardcoded values and put them in a specific config file --- modules/python/config/main_config.json | 19 ---- modules/python/docs/static/todos.rst | 26 +++-- modules/python/generator/enum_binding.py | 3 - modules/python/generator/generator.py | 8 +- modules/python/generator/generator_config.py | 106 +++++++++++++++++++ modules/python/generator/header.py | 19 +--- modules/python/generator/methods.py | 26 ++--- modules/python/generator/utils.py | 24 ++--- 8 files changed, 153 insertions(+), 78 deletions(-) delete mode 100644 modules/python/config/main_config.json create mode 100644 modules/python/generator/generator_config.py diff --git a/modules/python/config/main_config.json b/modules/python/config/main_config.json deleted file mode 100644 index 472923b843..0000000000 --- a/modules/python/config/main_config.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "preprocessor": - { - "defines": { - "VISP_EXPORT": "", - "vp_deprecated": "", - "DOXYGEN_SHOULD_SKIP_THIS": "1", - "NLOHMANN_JSON_SERIALIZE_ENUM(a,...)": "void ignored() {}", - "__cplusplus" : "1" - }, - "passThroughIncludesRegex": "^((?!vpConfig\\.h|opencv_modules\\.hpp|visp_modules\\.h).)*$", - "neverDefine": [ - "VISP_BUILD_DEPRECATED_FUNCTIONS" - ], - "otherArguments": [ - "--passthru-unfound-includes", "--passthru-comments","--line-directive", "" - ] - } -} \ No newline at end of file diff --git a/modules/python/docs/static/todos.rst b/modules/python/docs/static/todos.rst index c2cb8a9664..e8f3f881f7 100644 --- a/modules/python/docs/static/todos.rst +++ b/modules/python/docs/static/todos.rst @@ -4,36 +4,46 @@ List of todos What remains to be done Changes to ViSP -------------- +------------------ * Write initTracking for vpKltOpencv taking a vpImage as input. Ignore setInitialGuess. Code generation ---------------- +------------------- * There is an issue when indexing readonly arrays such as HomogeneousMatrix or RotationMatrix * Unary and n ary operators * Exclude get operators for vpArray2D ? * Parse subnamespaces + * Classes in subnamespaces are ignored + * Keep alive for numpy interfaces * Keep alive very probably for mbt * How should we handle parameters coming from external APIs ? e.g. realsense2, PCL. Can we interact with other bindings such as of opencv's * Reimplement a framegrabber tutorial in python, with matplotlib +* Test return policy for lvalue references (automatic is copy, so this is problematic) +* Add parameters in config for: + + * Return policy (feature moments database) + * Keep alive + * GIL scope Documentation ---------------- +* Generate documentation for: + + * Enums + * Functions in namespaces etc. + * In classes + + * Constructors + * Operators -* In classes, generate documentation for: constructors, operators * Reference python types in Documentation * Prefer Python examples instead of C++ ones ? -* Generate documentation for functions that are not in classes -* Generate documentation for enums -* Allow passing py::gil_scope_release etc to function from config -* Same for keep_alive (feature moments database) -* Export Tracking modules * Add callback for before_module and after_module so that we can define additional bindings by hand in the module. This is already done per class * Add a way to replace a default method binding with a custom one (What about doc?) diff --git a/modules/python/generator/enum_binding.py b/modules/python/generator/enum_binding.py index d5183cd165..123ffcebc6 100644 --- a/modules/python/generator/enum_binding.py +++ b/modules/python/generator/enum_binding.py @@ -91,7 +91,6 @@ def accumulate_data(scope: Union[NamespaceScope, ClassScope]): if full_name is not None and '::' in full_name: base_ref = fetch_fully_qualified_id(root_scope, full_name.split('::')) - print(full_name, base_ref) if base_ref is not None and isinstance(base_ref, types.EnumDecl) and base_ref.access is not None and base_ref.access != 'public': public_access = False @@ -155,8 +154,6 @@ def enum_bindings(root_scope: NamespaceScope, mapping: Dict, submodule: Submodul else: filtered_reprs.append(repr) - - for enum_repr in final_reprs: name_segments = enum_repr.name.split('::') py_name = name_segments[-1].replace('vp', '') diff --git a/modules/python/generator/generator.py b/modules/python/generator/generator.py index 50251cb4bc..08fa47e323 100644 --- a/modules/python/generator/generator.py +++ b/modules/python/generator/generator.py @@ -1,12 +1,16 @@ import sys from typing import List, Optional, Set, Tuple, Dict, Union from pathlib import Path +from multiprocessing import Pool from header import * from submodule import * -from multiprocessing import Pool + def header_preprocess(header: HeaderFile): + ''' + Preprocess a single header. Supposed to be called from a subprocess. + ''' try: header.preprocess() return header @@ -59,7 +63,6 @@ def generate_module(generate_path: Path) -> None: # Sort headers according to the dependencies. This is done across all modules. # TODO: sort module generation order. For now this works but it's fairly brittle new_all_headers = sort_headers(new_all_headers) - print('NSM', [h.path.name for h in new_all_headers]) for header in new_all_headers: header.compute_environment() @@ -67,7 +70,6 @@ def generate_module(generate_path: Path) -> None: for header, header_deps in headers_with_deps: other_mappings = list(map(lambda h: h.environment.mapping, header_deps)) - print(f'Dependencies of {header.path.name}: {list(map(lambda h: h.path.name, header_deps))}') header.environment.update_with_dependencies(other_mappings) for submodule in submodules: diff --git a/modules/python/generator/generator_config.py b/modules/python/generator/generator_config.py new file mode 100644 index 0000000000..bea09dd104 --- /dev/null +++ b/modules/python/generator/generator_config.py @@ -0,0 +1,106 @@ + +from dataclasses import dataclass +from typing import Dict, Final, List, Tuple, Optional +import re + + +@dataclass +class PreprocessorConfig(object): + ''' + Preprocessor config. Contains the arguments that are passed to pcpp to preprocess a header. + ''' + + defines: Dict[str, str] # Mapping from a #define to its value (#define A 1 is equal to a pair "A": "1") + never_defined: List[str] # List of macros that should never be defined, even if they are defined in other included headers + passthrough_includes_regex: str # Regex to see which header should be included (expanded and put in the resulting pcpp output) or ignored + line_directive: Optional[str] # prefix for Warning/logging emitted by pcpp. If none, no warning + other_args: List[str] + + def to_pcpp_args_list(self) -> List[str]: + args = [ + *[f'-D{k}={v}' for k,v in self.defines.items()], + *[f'-N{v}' for v in self.never_defined], + *self.other_args, + ] + args.extend(['--passthru-includes', '^((?!vpConfig\.h|opencv_modules\.hpp|visp_modules\.h).)*$']) + if self.line_directive is not None: + args.extend(['--line-directive', self.line_directive]) + else: + args.extend(['--line-directive', '']) + return args + +''' +Regular expressions that should match with types that are considered as immutable on the Python side +This only encompasses raw types +''' +IMMUTABLE_TYPES_REGEXS = [ + '^(float|double|u?int\d+_t|unsigned|char|long|long\wlong)$', + '^std::string$' +] + +''' +Regular expressions that should match with types that are considered as immutable on the Python side +This only encompasses raw types +''' +IMMUTABLE_CONTAINERS_REGEXS = [ + '^std::vector', '^std::list' +] + + +''' +Specific argument regexs for which having default arguments is specifically forbidden +''' +FORBIDDEN_DEFAULT_ARGUMENT_TYPES_REGEXS = [ + '^std::ostream', + '^std::initializer_list', + '^rs2::', + '^cv::' +] + +''' +Regexes for names of functions that should be ignored +''' +FORBIDDEN_FUNCTION_NAMES_REGEXS = [ + '^(from|to)_.*json', + '^operator.*', + '^ignored$' +] + +class GeneratorConfig(object): + pcpp_config: Final[PreprocessorConfig] = PreprocessorConfig( + defines={ + 'VISP_EXPORT': '', # remove symbol as it messes the cxxheaderparsing + 'vp_deprecated': '', # remove symbol as it messes the cxxheaderparsing + 'DOXYGEN_SHOULD_SKIP_THIS': '1', # Do not generate methods that do not appear in public api doc + 'NLOHMANN_JSON_SERIALIZE_ENUM(a,...)': 'void ignored() {}', # Remove json enum serialization as it cnanot correctly be parsed + '__cplusplus' : '1' # To silence OpenCV warnings + }, + never_defined=[ + 'VISP_BUILD_DEPRECATED_FUNCTIONS' # Do not bind deprecated functions + ], + passthrough_includes_regex='^((?!vpConfig\\.h|opencv_modules\\.hpp|visp_modules\\.h).)*$', # Only expand vpConfig, opencv_modules etc. + line_directive=None, + other_args=["--passthru-unfound-includes", "--passthru-comments"] + ) + + @staticmethod + def _matches_regex_in_list(s: str, regexes: List[str]) -> bool: + return any(map(lambda regex: re.match(regex, s) is not None, regexes)) + + @staticmethod + def is_immutable_type(type: str) -> bool: + return GeneratorConfig._matches_regex_in_list(type, IMMUTABLE_TYPES_REGEXS) + + + @staticmethod + def is_immutable_container(type: str) -> bool: + return GeneratorConfig._matches_regex_in_list(type, IMMUTABLE_CONTAINERS_REGEXS) + + + @staticmethod + def is_forbidden_default_argument_type(type: str) -> bool: + return GeneratorConfig._matches_regex_in_list(type, FORBIDDEN_DEFAULT_ARGUMENT_TYPES_REGEXS) + + @staticmethod + def is_forbidden_function_name(name: str) -> bool: + return GeneratorConfig._matches_regex_in_list(name, FORBIDDEN_FUNCTION_NAMES_REGEXS) diff --git a/modules/python/generator/header.py b/modules/python/generator/header.py index 45f5d6b379..04fd517ce8 100644 --- a/modules/python/generator/header.py +++ b/modules/python/generator/header.py @@ -12,6 +12,7 @@ from methods import * from doc_parser import * from header_utils import * +from generator_config import GeneratorConfig from typing import TYPE_CHECKING if TYPE_CHECKING: @@ -93,24 +94,14 @@ def run_preprocessor(self): # TODO: run without generating a new file tmp_dir = self.submodule.submodule_file_path.parent / "tmp" tmp_dir.mkdir(exist_ok=True) tmp_file_path = tmp_dir / self.path.name - argv = [ - '', - '-D', 'vp_deprecated=', - '-D', 'VISP_EXPORT=', - '-D', '__cplusplus', # Fix for warning when reading opencv modules - '-D', 'DOXYGEN_SHOULD_SKIP_THIS', # Skip methods and classes that are not exposed in documentation: they are internals + argv = [''] + GeneratorConfig.pcpp_config.to_pcpp_args_list() + argv += ['-o', f'{tmp_file_path}', str(self.path.absolute())] + argv += [ '-I', '/home/sfelton/software/visp_build/include', '-I', '/usr/local/include', '-I', '/usr/include', - '-N', 'VISP_BUILD_DEPRECATED_FUNCTIONS', - '-D', 'NLOHMANN_JSON_SERIALIZE_ENUM(a,...)=void ignored() {}', - '--passthru-includes', "^((?!vpConfig\.h|opencv_modules\.hpp|visp_modules.h).)*$", - '--passthru-unfound-includes', - '--passthru-comments', - '--line-directive', '', - '-o', f'{tmp_file_path}', - str(self.path.absolute()) ] + pcpp.CmdPreprocessor(argv) preprocessed_header_content = None with open(tmp_file_path, 'r') as header_file: diff --git a/modules/python/generator/methods.py b/modules/python/generator/methods.py index 48c56cd9c1..e0b35430ec 100644 --- a/modules/python/generator/methods.py +++ b/modules/python/generator/methods.py @@ -7,12 +7,14 @@ from cxxheaderparser.simple import parse_string, ParsedData, NamespaceScope, ClassScope, parse_file from pathlib import Path import json -from utils import * from dataclasses import dataclass from enum import Enum - from typing import TYPE_CHECKING from doc_parser import MethodDocSignature + +from utils import * +from generator_config import GeneratorConfig + if TYPE_CHECKING: from submodule import Submodule from header import HeaderFile, HeaderEnvironment, BoundObjectNames @@ -112,12 +114,7 @@ def tokens_to_str(tokens: List[types.Token]) -> str: return ''.join([token.value for token in tokens]) -FORBIDDEN_DEFAULT_ARGUMENT_TYPES = [ - 'std::ostream', - 'std::initializer_list', - 'rs2::', - 'cv::' -] + def parameter_can_have_default_value(parameter: types.Parameter, specs, env_mapping) -> bool: ''' @@ -139,13 +136,13 @@ def parameter_can_have_default_value(parameter: types.Parameter, specs, env_mapp is_const = t.ptr_to.const else: type_name = '' - for forbidden in FORBIDDEN_DEFAULT_ARGUMENT_TYPES: # Eg, arguments that have no mapping to python - if type_name.startswith(forbidden): - return False + if GeneratorConfig.is_forbidden_default_argument_type(type_name): + return False + if is_const: # Parameter is const, so we can safely give a default value knowing it won't be modified return True - if type_name in IMMUTABLE_TYPES: # Immutable type on python side + if GeneratorConfig.is_immutable_type(type_name): # Immutable type on python side return True return False @@ -361,8 +358,7 @@ def get_bindable_functions_with_config(submodule: 'Submodule', functions: List[t # Order of predicates is important: The first predicate that matches will be the one shown in the log, and they do not all have the same importance filtering_predicates_and_motives = [ (lambda _, conf: conf['ignore'], NotGeneratedReason.UserIgnored), - (lambda m, _: get_name(m.name) in ['from_json', 'to_json', 'from_megapose_json', 'to_megapose_json'], NotGeneratedReason.UserIgnored), # TODO: Remove hardcoded names - (lambda m, _: get_name(m.name).startswith('operator'), NotGeneratedReason.UserIgnored), + (lambda m, _: GeneratorConfig.is_forbidden_function_name(get_name(m.name)), NotGeneratedReason.UserIgnored), (lambda m, conf: m.template is not None and (conf.get('specializations') is None or len(conf['specializations']) == 0), NotGeneratedReason.UnspecifiedTemplateSpecialization), (lambda m, _: any(is_unsupported_argument_type(param.type) for param in m.parameters), NotGeneratedReason.ArgumentType), (lambda m, _: is_unsupported_return_type(m.return_type), NotGeneratedReason.ReturnType) @@ -373,7 +369,7 @@ def get_bindable_functions_with_config(submodule: 'Submodule', functions: List[t for predicate, motive in filtering_predicates_and_motives: if predicate(function, function_config): # Function should be rejected return_str = '' if function.return_type is None else (get_type(function.return_type, {}, mapping) or '') - method_name = '::'.join(seg.name for seg in function.name.segments) + method_name = get_name(function.name) param_strs = [get_type(param.type, {}, mapping) or '' for param in function.parameters] rejected_functions.append(RejectedMethod('', function, function_config, get_method_signature(method_name, return_str, param_strs), motive)) method_can_be_bound = False diff --git a/modules/python/generator/utils.py b/modules/python/generator/utils.py index 50edf94399..f224f31bbc 100644 --- a/modules/python/generator/utils.py +++ b/modules/python/generator/utils.py @@ -8,6 +8,9 @@ from cxxheaderparser.simple import parse_string, ParsedData, NamespaceScope, ClassScope from pathlib import Path import json + +from generator_config import GeneratorConfig + def get_name(name: types.PQName) -> str: ''' Get the fully qualified name of a type. @@ -147,7 +150,6 @@ class vpA { return None - def is_pointer_to_const_cstr(param: types.Pointer) -> bool: ''' Whether the passed in pointer is of type const char* @@ -159,17 +161,7 @@ def is_pointer_to_const_cstr(param: types.Pointer) -> bool: return False -IMMUTABLE_TYPES = [ - 'double', 'float', - 'int', 'int32_t', 'int16_t', 'int8_t', - 'unsigned int', 'uint8_t', 'uint16_t', 'uint32_t', 'uint64_t', - 'long', 'long long', 'unsigned long', - 'unsigned char', 'char', 'std::string' -] -IMMUTABLE_CONTAINERS = [ - 'std::vector', 'std::list' -] def is_non_const_ref_to_immutable_type(param: types.DecoratedType) -> bool: ''' @@ -184,11 +176,11 @@ def is_non_const_ref_to_immutable_type(param: types.DecoratedType) -> bool: return False if param.ref_to.const: return False - param_name = get_typename(param.ref_to.typename, {}, {}) - if param_name in IMMUTABLE_TYPES: + param_type = get_typename(param.ref_to.typename, {}, {}) + if GeneratorConfig.is_immutable_type(param_type): return True - is_immut_container = any(map(lambda c: param_name.startswith(c), IMMUTABLE_CONTAINERS)) - return is_immut_container + return GeneratorConfig.is_immutable_type(param_type) or GeneratorConfig.is_immutable_container(param_type) + def is_unsupported_return_type(param: Union[types.FunctionType, types.DecoratedType]) -> bool: @@ -226,7 +218,7 @@ def is_unsupported_argument_type(param: Union[types.FunctionType, types.Decorate if isinstance(param, types.MoveReference): return True if isinstance(param, types.Pointer): - return not is_pointer_to_const_cstr(param) + return not is_pointer_to_const_cstr(param) # Pointers of type "const char*" are handled by pybind return True def get_method_signature(name: str, return_type: str, params: List[str]) -> str: From 93d4a077107568a00fafbda0615757077eb60bd1 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Fri, 13 Oct 2023 17:25:31 +0200 Subject: [PATCH 073/169] Start working on packaging --- modules/python/CMakeLists.txt | 47 ++++++ modules/python/generator/pyproject.toml | 155 ++++++++++++++++++ .../{ => visp_python_bindgen}/__init__.py | 0 .../{ => visp_python_bindgen}/doc_parser.py | 5 +- .../{ => visp_python_bindgen}/enum_binding.py | 26 +-- .../{ => visp_python_bindgen}/gen_report.py | 19 ++- .../{ => visp_python_bindgen}/generator.py | 13 +- .../generator_config.py | 9 +- .../{ => visp_python_bindgen}/header.py | 14 +- .../{ => visp_python_bindgen}/header_utils.py | 13 +- .../{ => visp_python_bindgen}/methods.py | 28 ++-- .../{ => visp_python_bindgen}/submodule.py | 14 +- .../{ => visp_python_bindgen}/utils.py | 11 +- 13 files changed, 273 insertions(+), 81 deletions(-) create mode 100644 modules/python/CMakeLists.txt create mode 100644 modules/python/generator/pyproject.toml rename modules/python/generator/{ => visp_python_bindgen}/__init__.py (100%) rename modules/python/generator/{ => visp_python_bindgen}/doc_parser.py (99%) rename modules/python/generator/{ => visp_python_bindgen}/enum_binding.py (92%) rename modules/python/generator/{ => visp_python_bindgen}/gen_report.py (89%) rename modules/python/generator/{ => visp_python_bindgen}/generator.py (95%) rename modules/python/generator/{ => visp_python_bindgen}/generator_config.py (94%) rename modules/python/generator/{ => visp_python_bindgen}/header.py (98%) rename modules/python/generator/{ => visp_python_bindgen}/header_utils.py (95%) rename modules/python/generator/{ => visp_python_bindgen}/methods.py (96%) rename modules/python/generator/{ => visp_python_bindgen}/submodule.py (94%) rename modules/python/generator/{ => visp_python_bindgen}/utils.py (97%) diff --git a/modules/python/CMakeLists.txt b/modules/python/CMakeLists.txt new file mode 100644 index 0000000000..483f31fe06 --- /dev/null +++ b/modules/python/CMakeLists.txt @@ -0,0 +1,47 @@ + +set(opt_incs "") +set(opt_libs "") + +find_package(Python COMPONENTS Interpreter) +if(Python_FOUND) # We have Python, we can install module + + # Define ViSP module + vp_add_module(python BINDINGS ${VISP_MODULES_BUILD}) + + # Set pip args + if(DEFINED ENV{VIRTUAL_ENV} OR DEFINED ENV{CONDA_PREFIX}) + set(_pip_args) + else() + set(_pip_args "--user") + endif() + set(bindgen_package_location "${CMAKE_CURRENT_SOURCE_DIR}/generator") + # Step 1: Install Bindings generator as an editable package + add_custom_target(visp_python_bindings_generator_install + COMMAND ${Python_EXECUTABLE} -m pip install ${_pip_args} -e ${bindgen_package_location} + ) + + # Step 2: copy static bindings sources to bin directory + set(bindings_gen_location "${CMAKE_CURRENT_BINARY_DIR}/bindings") + add_custom_target(visp_python_bindings_generator_run + COMMAND visp_pybindgen -- + DEPENDS visp_python_bindings_generator_install OPTIONAL visp_doc + ) + add_custom_command( + TARGET visp_python_bindings_generator_run + PRE_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_directory "${root_dir}/${rel_dir}" "$/${rel_dir}" + ) + + +# Step 3: Compile and install bindings as a python package + + +# Step 4: Copy stubs dir and install stubs for autocompletion + +# Step 5: Build documentation + + + + + +endif() diff --git a/modules/python/generator/pyproject.toml b/modules/python/generator/pyproject.toml new file mode 100644 index 0000000000..4763495348 --- /dev/null +++ b/modules/python/generator/pyproject.toml @@ -0,0 +1,155 @@ +[project] +# This is the name of your project. The first time you publish this +# package, this name will be registered for you. It will determine how +# users can install this project, e.g.: +# +# $ pip install sampleproject +# +# And where it will live on PyPI: https://pypi.org/project/sampleproject/ +# +# There are some restrictions on what makes a valid project name +# specification here: +# https://packaging.python.org/specifications/core-metadata/#name +name = "visp_python_bindgen" # Required + +# Versions should comply with PEP 440: +# https://www.python.org/dev/peps/pep-0440/ +# +# For a discussion on single-sourcing the version, see +# https://packaging.python.org/guides/single-sourcing-package-version/ +version = "0.0.1" # Required + +# This is a one-line description or tagline of what your project does. This +# corresponds to the "Summary" metadata field: +# https://packaging.python.org/specifications/core-metadata/#summary +description = "Bindings generator for the ViSP library. Generates C++ code base on Pybind that allows using ViSP in Python." # Optional + +# This is an optional longer description of your project that represents +# the body of text which users will see when they visit PyPI. +# +# Often, this is the same as your README, so you can just read it in from +# that file directly (as we have already done above) +# +# This field corresponds to the "Description" metadata field: +# https://packaging.python.org/specifications/core-metadata/#description-optional +readme = "README.md" # Optional + +# Specify which Python versions you support. In contrast to the +# 'Programming Language' classifiers above, 'pip install' will check this +# and refuse to install the project if the version does not match. See +# https://packaging.python.org/guides/distributing-packages-using-setuptools/#python-requires +requires-python = ">=3.7" + +# This is either text indicating the license for the distribution, or a file +# that contains the license +# https://packaging.python.org/en/latest/specifications/core-metadata/#license +license = {file = "LICENSE.txt"} + +# This field adds keywords for your project which will appear on the +# project page. What does your project relate to? +# +# Note that this is a list of additional keywords, separated +# by commas, to be used to assist searching for the distribution in a +# larger catalog. +keywords = ["ViSP", "Visual Servoing", "Bindings generator", "Pybind"] # Optional + +# This should be your name or the name of the organization who originally +# authored the project, and a valid email address corresponding to the name +# listed. +authors = [ + {name = "Samuel Felton", email = "samuel.felton@irisa.fr" } # Optional +] + +# This should be your name or the names of the organization who currently +# maintains the project, and a valid email address corresponding to the name +# listed. +maintainers = [ + {name = "Samuel Felton", email = "samuel.felton@irisa.fr" } # Optional +] + +# Classifiers help users find your project by categorizing it. +# +# For a list of valid classifiers, see https://pypi.org/classifiers/ +classifiers = [ # Optional + # How mature is this project? Common values are + # 3 - Alpha + # 4 - Beta + # 5 - Production/Stable + "Development Status :: 3 - Beta", + + # Indicate who your project is intended for + "Intended Audience :: Developers", + "Topic :: Software Development :: Build Tools", + "Topic :: Text Processing :: General", + + # Specify the Python versions you support here. In particular, ensure + # that you indicate you support Python 3. These classifiers are *not* + # checked by "pip install". See instead "python_requires" below. + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3 :: Only", +] + +# This field lists other packages that your project depends on to run. +# Any package you put here will be installed by pip when your project is +# installed, so they must be valid existing projects. +# +# For an analysis of this field vs pip's requirements files see: +# https://packaging.python.org/discussions/install-requires-vs-requirements/ +dependencies = [ + "pcpp", + "cxxheaderparser@git+https://github.com/robotpy/cxxheaderparser#egg=master" +] + +# List additional groups of dependencies here (e.g. development +# dependencies). Users will be able to install these using the "extras" +# syntax, for example: +# +# $ pip install sampleproject[dev] +# +# Similar to `dependencies` above, these must be valid existing +# projects. +[project.optional-dependencies] # Optional +doc = [ + "lxml", + "doxmlparser@git+https://github.com/doxygen/doxygen#subdirectory=addon/doxmlparser" +] + +# List URLs that are relevant to your project +# +# This field corresponds to the "Project-URL" and "Home-Page" metadata fields: +# https://packaging.python.org/specifications/core-metadata/#project-url-multiple-use +# https://packaging.python.org/specifications/core-metadata/#home-page-optional +# +# Examples listed include a pattern for specifying where the package tracks +# issues, where the source is hosted, where to say thanks to the package +# maintainers, and where to support the project financially. The key is +# what's used to render the link text on PyPI. +[project.urls] # Optional +"Homepage" = "https://github.com/pypa/sampleproject" +"Bug Reports" = "https://github.com/pypa/sampleproject/issues" +"Funding" = "https://donate.pypi.org" +"Say Thanks!" = "http://saythanks.io/to/example" +"Source" = "https://github.com/pypa/sampleproject/" + +# The following would provide a command line executable called `sample` +# which executes the function `main` from this package when invoked. +[project.scripts] # Optional +visp_pybindgen = "visp_python_bindgen.generator:main" + +# This is configuration specific to the `setuptools` build backend. +# If you are using a different build backend, you will need to change this. +[tool.setuptools] +# If there are data files included in your packages that need to be +# installed, specify them here. +# package-data = {"sample" = ["*.dat"]} + +[build-system] +# These are the assumed default build requirements from pip: +# https://pip.pypa.io/en/stable/reference/pip/#pep-517-and-518-support +requires = ["setuptools>=43.0.0", "wheel"] +build-backend = "setuptools.build_meta" \ No newline at end of file diff --git a/modules/python/generator/__init__.py b/modules/python/generator/visp_python_bindgen/__init__.py similarity index 100% rename from modules/python/generator/__init__.py rename to modules/python/generator/visp_python_bindgen/__init__.py diff --git a/modules/python/generator/doc_parser.py b/modules/python/generator/visp_python_bindgen/doc_parser.py similarity index 99% rename from modules/python/generator/doc_parser.py rename to modules/python/generator/visp_python_bindgen/doc_parser.py index 4fca9ac4eb..b63f2ad9b7 100644 --- a/modules/python/generator/doc_parser.py +++ b/modules/python/generator/visp_python_bindgen/doc_parser.py @@ -1,8 +1,8 @@ import_failed = False +from typing import Dict, List, Optional, Tuple from dataclasses import dataclass from enum import Enum from pathlib import Path -from typing import Dict, List, Optional, Tuple import re from cxxheaderparser.simple import parse_string try: @@ -12,7 +12,7 @@ print('Cannot import xml parser') import_failed = True -from utils import * +from visp_python_bindgen.utils import * class DocumentationObjectKind(Enum): ''' @@ -50,6 +50,7 @@ def to_cstring(s: str) -> str: return f'''R"doc( {s} )doc"''' + @dataclass class MethodDocSignature: name: str diff --git a/modules/python/generator/enum_binding.py b/modules/python/generator/visp_python_bindgen/enum_binding.py similarity index 92% rename from modules/python/generator/enum_binding.py rename to modules/python/generator/visp_python_bindgen/enum_binding.py index 123ffcebc6..fef6f988ce 100644 --- a/modules/python/generator/enum_binding.py +++ b/modules/python/generator/visp_python_bindgen/enum_binding.py @@ -1,18 +1,22 @@ -from typing import Callable, List, Optional, Set, Tuple, Dict, Union -from cxxheaderparser.parserstate import ClassBlockState, State -import pcpp -import cxxheaderparser +from typing import List, Optional, Tuple, Dict, Union +from dataclasses import dataclass + from cxxheaderparser import types from cxxheaderparser.simple import NamespaceScope, ClassScope -from utils import * -from dataclasses import dataclass -from submodule import Submodule + +from visp_python_bindgen.utils import * +from visp_python_bindgen.submodule import Submodule + + @dataclass class EnumRepr: - id: Optional[int] - name: Optional[str] - values: Optional[List[types.Enumerator]] - public_access: bool = True + ''' + Intermediate representation of an enumeration + ''' + id: Optional[int] # Integer Id for an enumeration. Used when an enumeration is anonymous (hidden behind a typedef). Id is unique per header file + name: Optional[str] # Name of the enumeration + values: Optional[List[types.Enumerator]] # The values of the enumeration + public_access: bool = True # Whether this enum is visible from outside the header file def is_typedef_to_enum(typedef: types.Typedef): diff --git a/modules/python/generator/gen_report.py b/modules/python/generator/visp_python_bindgen/gen_report.py similarity index 89% rename from modules/python/generator/gen_report.py rename to modules/python/generator/visp_python_bindgen/gen_report.py index 2bb8191692..a5144a3677 100644 --- a/modules/python/generator/gen_report.py +++ b/modules/python/generator/visp_python_bindgen/gen_report.py @@ -1,11 +1,16 @@ -from typing import Callable, List, Optional, Set, Tuple, Dict, Union -from cxxheaderparser.parserstate import ClassBlockState, State -import pcpp -import cxxheaderparser +from typing import List, Dict +from pathlib import Path +import json + from cxxheaderparser import types -from cxxheaderparser.simple import NamespaceScope, ClassScope -from utils import * -from methods import NotGeneratedReason, RejectedMethod + +from visp_python_bindgen.utils import * +from visp_python_bindgen.methods import NotGeneratedReason, RejectedMethod + +from typing import TYPE_CHECKING +if TYPE_CHECKING: + from visp_python_bindgen.submodule import Submodule + class Report(object): def __init__(self, submodule: 'Submodule'): self.submodule_name = submodule.name diff --git a/modules/python/generator/generator.py b/modules/python/generator/visp_python_bindgen/generator.py similarity index 95% rename from modules/python/generator/generator.py rename to modules/python/generator/visp_python_bindgen/generator.py index 08fa47e323..a05025d88e 100644 --- a/modules/python/generator/generator.py +++ b/modules/python/generator/visp_python_bindgen/generator.py @@ -1,10 +1,10 @@ +from typing import List import sys -from typing import List, Optional, Set, Tuple, Dict, Union from pathlib import Path from multiprocessing import Pool -from header import * -from submodule import * +from visp_python_bindgen.header import * +from visp_python_bindgen.submodule import * def header_preprocess(header: HeaderFile): @@ -96,8 +96,11 @@ def generate_module(generate_path: Path) -> None: format_str = main_str(submodule_fn_declarations, submodule_fn_calls) main_file.write(format_str) -if __name__ == '__main__': +def main(): generation_path = Path('bindings/src') generation_path.mkdir(exist_ok=True) - generate_module(generation_path) \ No newline at end of file + generate_module(generation_path) + +if __name__ == '__main__': + main() \ No newline at end of file diff --git a/modules/python/generator/generator_config.py b/modules/python/generator/visp_python_bindgen/generator_config.py similarity index 94% rename from modules/python/generator/generator_config.py rename to modules/python/generator/visp_python_bindgen/generator_config.py index bea09dd104..23bd0342e1 100644 --- a/modules/python/generator/generator_config.py +++ b/modules/python/generator/visp_python_bindgen/generator_config.py @@ -1,8 +1,7 @@ -from dataclasses import dataclass -from typing import Dict, Final, List, Tuple, Optional +from typing import Dict, Final, List, Optional import re - +from dataclasses import dataclass @dataclass class PreprocessorConfig(object): @@ -69,8 +68,8 @@ def to_pcpp_args_list(self) -> List[str]: class GeneratorConfig(object): pcpp_config: Final[PreprocessorConfig] = PreprocessorConfig( defines={ - 'VISP_EXPORT': '', # remove symbol as it messes the cxxheaderparsing - 'vp_deprecated': '', # remove symbol as it messes the cxxheaderparsing + 'VISP_EXPORT': '', # remove symbol as it messes up the cxxheaderparsing + 'vp_deprecated': '', # remove symbol as it messes up the cxxheaderparsing 'DOXYGEN_SHOULD_SKIP_THIS': '1', # Do not generate methods that do not appear in public api doc 'NLOHMANN_JSON_SERIALIZE_ENUM(a,...)': 'void ignored() {}', # Remove json enum serialization as it cnanot correctly be parsed '__cplusplus' : '1' # To silence OpenCV warnings diff --git a/modules/python/generator/header.py b/modules/python/generator/visp_python_bindgen/header.py similarity index 98% rename from modules/python/generator/header.py rename to modules/python/generator/visp_python_bindgen/header.py index 04fd517ce8..190efafd67 100644 --- a/modules/python/generator/header.py +++ b/modules/python/generator/visp_python_bindgen/header.py @@ -1,23 +1,21 @@ -from typing import List, Optional, Set, Tuple, Dict, Union +from typing import List, Optional, Dict from pathlib import Path from dataclasses import dataclass from collections import OrderedDict import pcpp -from cxxheaderparser.parserstate import ClassBlockState, State from cxxheaderparser import types from cxxheaderparser.simple import parse_string, ParsedData, NamespaceScope, ClassScope -from utils import * -from methods import * -from doc_parser import * -from header_utils import * -from generator_config import GeneratorConfig +from visp_python_bindgen.utils import * +from visp_python_bindgen.methods import * +from visp_python_bindgen.doc_parser import * +from visp_python_bindgen.header_utils import * +from visp_python_bindgen.generator_config import GeneratorConfig from typing import TYPE_CHECKING if TYPE_CHECKING: from submodule import Submodule -import sys @dataclass class BoundObjectNames: diff --git a/modules/python/generator/header_utils.py b/modules/python/generator/visp_python_bindgen/header_utils.py similarity index 95% rename from modules/python/generator/header_utils.py rename to modules/python/generator/visp_python_bindgen/header_utils.py index 28a25bd48c..ff4fb4b6cb 100644 --- a/modules/python/generator/header_utils.py +++ b/modules/python/generator/visp_python_bindgen/header_utils.py @@ -1,19 +1,16 @@ from typing import List, Set, Dict, Union -from pathlib import Path -from dataclasses import dataclass +import sys from cxxheaderparser import types from cxxheaderparser.simple import ParsedData, NamespaceScope, ClassScope -from utils import * -from methods import * -from doc_parser import * +from visp_python_bindgen.utils import * +from visp_python_bindgen.methods import * +from visp_python_bindgen.doc_parser import * from typing import TYPE_CHECKING if TYPE_CHECKING: - from submodule import Submodule - from header import HeaderFile -import sys + from visp_python_bindgen.header import HeaderFile def sort_headers(headers: List['HeaderFile']) -> List['HeaderFile']: ''' diff --git a/modules/python/generator/methods.py b/modules/python/generator/visp_python_bindgen/methods.py similarity index 96% rename from modules/python/generator/methods.py rename to modules/python/generator/visp_python_bindgen/methods.py index e0b35430ec..603ee8930f 100644 --- a/modules/python/generator/methods.py +++ b/modules/python/generator/visp_python_bindgen/methods.py @@ -1,23 +1,18 @@ -from typing import Any, Callable, List, Optional, Set, Tuple, Dict, Union -from cxxheaderparser.parserstate import ClassBlockState, State -import pcpp -import cxxheaderparser -from cxxheaderparser.visitor import CxxVisitor -from cxxheaderparser import types -from cxxheaderparser.simple import parse_string, ParsedData, NamespaceScope, ClassScope, parse_file -from pathlib import Path -import json -from dataclasses import dataclass +from typing import Any, Callable, List, Optional, Tuple, Dict from enum import Enum -from typing import TYPE_CHECKING -from doc_parser import MethodDocSignature +from dataclasses import dataclass -from utils import * -from generator_config import GeneratorConfig +from cxxheaderparser import types +from cxxheaderparser.simple import ClassScope + +from visp_python_bindgen.doc_parser import MethodDocSignature +from visp_python_bindgen.utils import * +from visp_python_bindgen.generator_config import GeneratorConfig +from typing import TYPE_CHECKING if TYPE_CHECKING: - from submodule import Submodule - from header import HeaderFile, HeaderEnvironment, BoundObjectNames + from visp_python_bindgen.submodule import Submodule + from visp_python_bindgen.header import HeaderFile, HeaderEnvironment, BoundObjectNames def cpp_operator_list(): ''' @@ -148,7 +143,6 @@ def parameter_can_have_default_value(parameter: types.Parameter, specs, env_mapp return False - def get_py_args(parameters: List[types.Parameter], specs, env_mapping) -> List[str]: ''' Get the py::arg parameters of a function binding definition. diff --git a/modules/python/generator/submodule.py b/modules/python/generator/visp_python_bindgen/submodule.py similarity index 94% rename from modules/python/generator/submodule.py rename to modules/python/generator/visp_python_bindgen/submodule.py index 34bcd2254a..d94019dc5b 100644 --- a/modules/python/generator/submodule.py +++ b/modules/python/generator/visp_python_bindgen/submodule.py @@ -1,16 +1,10 @@ -from typing import List, Optional, Set, Tuple, Dict, Union -from cxxheaderparser.parserstate import ClassBlockState, State -import pcpp -import cxxheaderparser -from cxxheaderparser.visitor import CxxVisitor -from cxxheaderparser import types -from cxxheaderparser.simple import parse_string, ParsedData, NamespaceScope, ClassScope +from typing import List, Optional, Dict from pathlib import Path import json -from header import HeaderFile -from utils import * -from gen_report import Report +from visp_python_bindgen.header import HeaderFile +from visp_python_bindgen.utils import * +from visp_python_bindgen.gen_report import Report class Submodule(): def __init__(self, name: str, include_path: Path, submodule_file_path: Path): diff --git a/modules/python/generator/utils.py b/modules/python/generator/visp_python_bindgen/utils.py similarity index 97% rename from modules/python/generator/utils.py rename to modules/python/generator/visp_python_bindgen/utils.py index f224f31bbc..5d36e872f1 100644 --- a/modules/python/generator/utils.py +++ b/modules/python/generator/visp_python_bindgen/utils.py @@ -1,15 +1,10 @@ from typing import List, Optional, Set, Tuple, Dict, Union -from cxxheaderparser.parserstate import ClassBlockState, State -import pcpp -import cxxheaderparser -from cxxheaderparser.visitor import CxxVisitor + from cxxheaderparser.tokfmt import tokfmt from cxxheaderparser import types -from cxxheaderparser.simple import parse_string, ParsedData, NamespaceScope, ClassScope -from pathlib import Path -import json +from cxxheaderparser.simple import NamespaceScope, ClassScope -from generator_config import GeneratorConfig +from visp_python_bindgen.generator_config import GeneratorConfig def get_name(name: types.PQName) -> str: ''' From 76ea5b7868509a58def785b2ce31929f84018603 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Mon, 16 Oct 2023 13:10:21 +0200 Subject: [PATCH 074/169] work on packaging: package generator and install and run through cmake --- modules/python/CMakeLists.txt | 51 +++++++++++-------- modules/python/bindings/CMakeLists.txt | 8 +-- modules/python/bindings/pyproject.toml | 2 - modules/python/generator/pyproject.toml | 19 +++---- .../visp_python_bindgen/generator.py | 20 ++++++-- .../visp_python_bindgen/generator_config.py | 20 ++++---- .../generator/visp_python_bindgen/header.py | 11 ++-- .../visp_python_bindgen/header_utils.py | 2 +- .../visp_python_bindgen/submodule.py | 17 ++++--- 9 files changed, 83 insertions(+), 67 deletions(-) diff --git a/modules/python/CMakeLists.txt b/modules/python/CMakeLists.txt index 483f31fe06..ac0ea4e2c7 100644 --- a/modules/python/CMakeLists.txt +++ b/modules/python/CMakeLists.txt @@ -1,45 +1,52 @@ -set(opt_incs "") -set(opt_libs "") - find_package(Python COMPONENTS Interpreter) if(Python_FOUND) # We have Python, we can install module - # Define ViSP module - vp_add_module(python BINDINGS ${VISP_MODULES_BUILD}) - # Set pip args if(DEFINED ENV{VIRTUAL_ENV} OR DEFINED ENV{CONDA_PREFIX}) set(_pip_args) else() set(_pip_args "--user") endif() - set(bindgen_package_location "${CMAKE_CURRENT_SOURCE_DIR}/generator") - # Step 1: Install Bindings generator as an editable package - add_custom_target(visp_python_bindings_generator_install - COMMAND ${Python_EXECUTABLE} -m pip install ${_pip_args} -e ${bindgen_package_location} - ) + # Step 1: Generate configuration file + # Define modules for which to generate python bindings + set(python_ignored_modules "visp_python" "visp_java_bindings_generator") + set(python_bound_modules ${VISP_MODULES_BUILD}) + list(REMOVE_ITEM python_bound_modules ${python_ignored_modules}) + + # Define ViSP module + vp_add_module(python BINDINGS OPTIONAL ${python_bound_modules}) + message("${VISP_MODULE_${visp_python}_REQ_DEPS}") + + foreach(module ${python_bound_modules}) + message("Module ${module} headers: ${VISP_MODULE_${module}_HEADERS}") + endforeach() - # Step 2: copy static bindings sources to bin directory + + + + + # Step 1: Generate bindings + set(bindgen_package_location "${CMAKE_CURRENT_SOURCE_DIR}/generator") set(bindings_gen_location "${CMAKE_CURRENT_BINARY_DIR}/bindings") add_custom_target(visp_python_bindings_generator_run - COMMAND visp_pybindgen -- - DEPENDS visp_python_bindings_generator_install OPTIONAL visp_doc - ) - add_custom_command( - TARGET visp_python_bindings_generator_run - PRE_BUILD - COMMAND ${CMAKE_COMMAND} -E copy_directory "${root_dir}/${rel_dir}" "$/${rel_dir}" + COMMAND ${Python_EXECUTABLE} -m pip install ${_pip_args} -e ${bindgen_package_location} + COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMAKE_CURRENT_SOURCE_DIR}/bindings" ${bindings_gen_location} + COMMAND visp_pybindgen --config "${CMAKE_CURRENT_SOURCE_DIR}/config" --build-folder ${bindings_gen_location} + DEPENDS visp_doc ) -# Step 3: Compile and install bindings as a python package -# Step 4: Copy stubs dir and install stubs for autocompletion + # Step 3: Compile and install bindings as a python package + add_custom_target(visp_python_bindings_install + COMMAND ${Python_EXECUTABLE} -m pip install ${_pip_args} -e ${bindings_gen_location} + ) -# Step 5: Build documentation + # Step 4: Copy stubs dir and install stubs for autocompletion + # Step 5: Build documentation diff --git a/modules/python/bindings/CMakeLists.txt b/modules/python/bindings/CMakeLists.txt index 1dd4bc7dda..caa0955411 100644 --- a/modules/python/bindings/CMakeLists.txt +++ b/modules/python/bindings/CMakeLists.txt @@ -5,13 +5,7 @@ find_package(pybind11 REQUIRED) find_package(VISP REQUIRED) include_directories(${VISP_INCLUDE_DIRS}) include_directories(include) -message(${VISP_DIR}) -string(REPLACE ";" "\n" str "${VISP_INCLUDE_DIRS}") -message(STATUS ${str}) -string(REPLACE ";" "\n" str "${VISP_LIBRARIES}") -message(STATUS ${str}) -message(${VISP_VERSION}) -message(${pybind11_VERSION}) + file(GLOB generated_cpp src/*.cpp) file(GLOB static_cpp src/static/*.cpp) pybind11_add_module(visp THIN_LTO ${generated_cpp} ${static_cpp}) diff --git a/modules/python/bindings/pyproject.toml b/modules/python/bindings/pyproject.toml index a017b22de5..861c2dd65e 100644 --- a/modules/python/bindings/pyproject.toml +++ b/modules/python/bindings/pyproject.toml @@ -1,8 +1,6 @@ [build-system] requires = [ "setuptools>=42", - "pcpp", - "cxxheaderparser@git+https://github.com/robotpy/cxxheaderparser#egg=master" ] build-backend = "setuptools.build_meta" diff --git a/modules/python/generator/pyproject.toml b/modules/python/generator/pyproject.toml index 4763495348..ccd2ef01da 100644 --- a/modules/python/generator/pyproject.toml +++ b/modules/python/generator/pyproject.toml @@ -101,8 +101,11 @@ classifiers = [ # Optional # For an analysis of this field vs pip's requirements files see: # https://packaging.python.org/discussions/install-requires-vs-requirements/ dependencies = [ + "tqdm", "pcpp", - "cxxheaderparser@git+https://github.com/robotpy/cxxheaderparser#egg=master" + "cxxheaderparser@git+https://github.com/robotpy/cxxheaderparser#egg=master", + "lxml", + "doxmlparser@git+https://github.com/doxygen/doxygen#subdirectory=addon/doxmlparser" ] # List additional groups of dependencies here (e.g. development @@ -113,11 +116,8 @@ dependencies = [ # # Similar to `dependencies` above, these must be valid existing # projects. -[project.optional-dependencies] # Optional -doc = [ - "lxml", - "doxmlparser@git+https://github.com/doxygen/doxygen#subdirectory=addon/doxmlparser" -] +# [project.optional-dependencies] # Optional + # List URLs that are relevant to your project # @@ -130,11 +130,8 @@ doc = [ # maintainers, and where to support the project financially. The key is # what's used to render the link text on PyPI. [project.urls] # Optional -"Homepage" = "https://github.com/pypa/sampleproject" -"Bug Reports" = "https://github.com/pypa/sampleproject/issues" -"Funding" = "https://donate.pypi.org" -"Say Thanks!" = "http://saythanks.io/to/example" -"Source" = "https://github.com/pypa/sampleproject/" +"Homepage" = "https://github.com/lagadic/visp" +"Bug Reports" = "https://github.com/lagadic/visp/issues" # The following would provide a command line executable called `sample` # which executes the function `main` from this package when invoked. diff --git a/modules/python/generator/visp_python_bindgen/generator.py b/modules/python/generator/visp_python_bindgen/generator.py index a05025d88e..fe6b8cbb8f 100644 --- a/modules/python/generator/visp_python_bindgen/generator.py +++ b/modules/python/generator/visp_python_bindgen/generator.py @@ -2,6 +2,7 @@ import sys from pathlib import Path from multiprocessing import Pool +import argparse from visp_python_bindgen.header import * from visp_python_bindgen.submodule import * @@ -41,10 +42,9 @@ def main_str(submodule_fn_declarations, submodule_fn_calls): }} ''' -def generate_module(generate_path: Path) -> None: +def generate_module(generate_path: Path, config_path: Path) -> None: - include_path = Path('/usr/local/include/visp3') - submodules: List[Submodule] = get_submodules(include_path, generate_path) + submodules: List[Submodule] = get_submodules(config_path, generate_path) # Step 1: Preprocess all headers all_headers: List[HeaderFile] = [] @@ -97,10 +97,20 @@ def generate_module(generate_path: Path) -> None: main_file.write(format_str) def main(): - generation_path = Path('bindings/src') + parser = argparse.ArgumentParser('Python Bindings generator for ViSP') + parser.add_argument('--config', type=str, required=True) + parser.add_argument('--build-folder', type=str, required=True) + args = parser.parse_args() + + generation_path = Path(args.build_folder) + assert generation_path.exists(), f'Path to where to generate bindings does not exist!Path: {generation_path}' + generation_path = generation_path / 'src' generation_path.mkdir(exist_ok=True) - generate_module(generation_path) + config_path = Path(args.config) + assert config_path.exists(), f'Path to the folder containing the configuration files does not exist! Path: {config_path}' + + generate_module(generation_path, config_path) if __name__ == '__main__': main() \ No newline at end of file diff --git a/modules/python/generator/visp_python_bindgen/generator_config.py b/modules/python/generator/visp_python_bindgen/generator_config.py index 23bd0342e1..ff2051c2d4 100644 --- a/modules/python/generator/visp_python_bindgen/generator_config.py +++ b/modules/python/generator/visp_python_bindgen/generator_config.py @@ -7,6 +7,7 @@ class PreprocessorConfig(object): ''' Preprocessor config. Contains the arguments that are passed to pcpp to preprocess a header. + This does not include the header search path (-I) or the input and output paths ''' defines: Dict[str, str] # Mapping from a #define to its value (#define A 1 is equal to a pair "A": "1") @@ -16,12 +17,13 @@ class PreprocessorConfig(object): other_args: List[str] def to_pcpp_args_list(self) -> List[str]: - args = [ - *[f'-D{k}={v}' for k,v in self.defines.items()], - *[f'-N{v}' for v in self.never_defined], - *self.other_args, - ] - args.extend(['--passthru-includes', '^((?!vpConfig\.h|opencv_modules\.hpp|visp_modules\.h).)*$']) + args = [] + for k,v in self.defines.items(): + args += ['-D', f'{k}={v}'] if v is not None else ['-D', k] + for v in self.never_defined: + args += ['-N', v] + args += self.other_args + args.extend(['--passthru-includes', self.passthrough_includes_regex]) if self.line_directive is not None: args.extend(['--line-directive', self.line_directive]) else: @@ -70,14 +72,14 @@ class GeneratorConfig(object): defines={ 'VISP_EXPORT': '', # remove symbol as it messes up the cxxheaderparsing 'vp_deprecated': '', # remove symbol as it messes up the cxxheaderparsing - 'DOXYGEN_SHOULD_SKIP_THIS': '1', # Do not generate methods that do not appear in public api doc + 'DOXYGEN_SHOULD_SKIP_THIS': None, # Do not generate methods that do not appear in public api doc 'NLOHMANN_JSON_SERIALIZE_ENUM(a,...)': 'void ignored() {}', # Remove json enum serialization as it cnanot correctly be parsed - '__cplusplus' : '1' # To silence OpenCV warnings + '__cplusplus' : None # To silence OpenCV warnings }, never_defined=[ 'VISP_BUILD_DEPRECATED_FUNCTIONS' # Do not bind deprecated functions ], - passthrough_includes_regex='^((?!vpConfig\\.h|opencv_modules\\.hpp|visp_modules\\.h).)*$', # Only expand vpConfig, opencv_modules etc. + passthrough_includes_regex="^((?!vpConfig\.h|opencv_modules\.hpp|visp_modules\.h).)*$", # Only expand vpConfig, opencv_modules etc. line_directive=None, other_args=["--passthru-unfound-includes", "--passthru-comments"] ) diff --git a/modules/python/generator/visp_python_bindgen/header.py b/modules/python/generator/visp_python_bindgen/header.py index 190efafd67..88aea8e8a0 100644 --- a/modules/python/generator/visp_python_bindgen/header.py +++ b/modules/python/generator/visp_python_bindgen/header.py @@ -93,17 +93,22 @@ def run_preprocessor(self): # TODO: run without generating a new file tmp_dir.mkdir(exist_ok=True) tmp_file_path = tmp_dir / self.path.name argv = [''] + GeneratorConfig.pcpp_config.to_pcpp_args_list() - argv += ['-o', f'{tmp_file_path}', str(self.path.absolute())] argv += [ '-I', '/home/sfelton/software/visp_build/include', '-I', '/usr/local/include', '-I', '/usr/include', ] + argv += ['-o', f'{tmp_file_path}', str(self.path.absolute())] pcpp.CmdPreprocessor(argv) preprocessed_header_content = None with open(tmp_file_path, 'r') as header_file: - preprocessed_header_content = '\n'.join(header_file.readlines()) + preprocessed_header_lines = [] + for line in header_file.readlines(): + if not line.startswith('#define'): + preprocessed_header_lines.append(line) + preprocessed_header_content = '\n'.join(preprocessed_header_lines) + preprocessed_header_content = preprocessed_header_content.replace('#include<', '#include <') # Bug in cpp header parser return preprocessed_header_content @@ -122,7 +127,7 @@ def compute_environment(self): self.environment = HeaderEnvironment(self.header_repr) def parse_data(self): - from enum_binding import enum_bindings + from visp_python_bindgen.enum_binding import enum_bindings result = '' # String containing the definitions (actual bindings and not class/enum declarations) # Fetch documentation if available diff --git a/modules/python/generator/visp_python_bindgen/header_utils.py b/modules/python/generator/visp_python_bindgen/header_utils.py index ff4fb4b6cb..cc4275d20e 100644 --- a/modules/python/generator/visp_python_bindgen/header_utils.py +++ b/modules/python/generator/visp_python_bindgen/header_utils.py @@ -53,7 +53,7 @@ def __init__(self, data: ParsedData): self.mapping: Dict[str, str] = self.build_naive_mapping(data.namespace, {}) # Step 2: resolve enumeration names that are possibly hidden behind typedefs - from enum_binding import resolve_enums_and_typedefs + from visp_python_bindgen.enum_binding import resolve_enums_and_typedefs enum_reprs, _ = resolve_enums_and_typedefs(data.namespace, self.mapping) for enum_repr in enum_reprs: for value in enum_repr.values: diff --git a/modules/python/generator/visp_python_bindgen/submodule.py b/modules/python/generator/visp_python_bindgen/submodule.py index d94019dc5b..84a94b94f0 100644 --- a/modules/python/generator/visp_python_bindgen/submodule.py +++ b/modules/python/generator/visp_python_bindgen/submodule.py @@ -7,11 +7,11 @@ from visp_python_bindgen.gen_report import Report class Submodule(): - def __init__(self, name: str, include_path: Path, submodule_file_path: Path): + def __init__(self, name: str, include_path: Path, config_file_path: Path, submodule_file_path: Path): self.name = name self.include_path = include_path self.submodule_file_path = submodule_file_path - self.config_path = Path('config') / (name + '.json') + self.config_path = config_file_path / (name + '.json') self.config = self._get_config_file_or_create_default(self.config_path) self.report = Report(self) self.headers = self._get_headers() @@ -114,7 +114,10 @@ def generate(self) -> None: ''' with open(self.submodule_file_path, 'w') as submodule_file: submodule_file.write(format_str) - self.report.write(Path(f'build/{self.name}_log.json')) + + logs_path = self.submodule_file_path.parent / 'logs' + logs_path.mkdir(exist_ok=True) + self.report.write(logs_path / f'{self.name}_log.json') def generation_function_name(self) -> str: return f'init_submodule_{self.name}' @@ -191,17 +194,17 @@ def get_method_config(self, class_name: Optional[str], method, owner_specs, head return res -def get_submodules(include_path: Path, generate_path: Path) -> List[Submodule]: +def get_submodules(config_path: Path, generate_path: Path) -> List[Submodule]: modules = ['core', 'imgproc', 'vision', 'visual_features', 'vs', 'sensor', 'io', 'detection', 'robot', 'gui'] result = [] for module in modules: - result.append(Submodule(module, Path(f'/home/sfelton/software/visp-sfelton/modules/{module}/include/visp3/{module}'), generate_path / f'{module}.cpp')) + result.append(Submodule(module, Path(f'/home/sfelton/software/visp-sfelton/modules/{module}/include/visp3/{module}'), config_path, generate_path / f'{module}.cpp')) tracking_modules = ['tt', 'tt_mi', 'klt', 'me', 'blob', ('dnn', 'dnn_tracker'), 'mbt'] for module in tracking_modules: if isinstance(module, str): - result.append(Submodule(module, Path(f'/home/sfelton/software/visp-sfelton/modules/tracker/{module}/include/visp3/{module}'), generate_path / f'{module}.cpp')) + result.append(Submodule(module, Path(f'/home/sfelton/software/visp-sfelton/modules/tracker/{module}/include/visp3/{module}'), config_path, generate_path / f'{module}.cpp')) else: - result.append(Submodule(module[1], Path(f'/home/sfelton/software/visp-sfelton/modules/tracker/{module[0]}/include/visp3/{module[1]}'), generate_path / f'{module[1]}.cpp')) + result.append(Submodule(module[1], Path(f'/home/sfelton/software/visp-sfelton/modules/tracker/{module[0]}/include/visp3/{module[1]}'), config_path, generate_path / f'{module[1]}.cpp')) return result From 171a4a2d817d7c7bbedc980a2f30fe7a818ae8c2 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Mon, 16 Oct 2023 17:28:56 +0200 Subject: [PATCH 075/169] rework cmake for package installation, still not great --- .vscode/settings.json | 3 ++- CMakeLists.txt | 16 ++++++++++++++++ modules/python/CMakeLists.txt | 22 ++++++++++++---------- modules/python/bindings/CMakeLists.txt | 9 ++++----- modules/python/bindings/setup.py | 10 +--------- 5 files changed, 35 insertions(+), 25 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 2a31aeaf5f..d3a88e9356 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -114,7 +114,8 @@ "numbers": "cpp", "semaphore": "cpp", "stop_token": "cpp", - "view": "cpp" + "view": "cpp", + "filesystem": "cpp" }, "C_Cpp.vcFormat.indent.namespaceContents": false, "editor.formatOnSave": true, diff --git a/CMakeLists.txt b/CMakeLists.txt index 646b40f269..1c7912b608 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -411,6 +411,17 @@ VP_OPTION(BUILD_ANDROID_PROJECTS "" "" "Build Android projects providing .apk f VP_OPTION(BUILD_ANDROID_EXAMPLES "" "" "Build examples for Android platform" "" ON IF ANDROID ) VP_OPTION(INSTALL_ANDROID_EXAMPLES "" "" "Install Android examples" "" OFF IF ANDROID ) +# Build python bindings as an option +VP_OPTION(BUILD_PYTHON "" "" "Enable Python support" "" ON ) +VP_OPTION(BUILD_PYTHON_DOC "" "" "Build the documentation for the Python bindings" "" ON ) + + +VP_OPTION(BUILD_FAT_JAVA_LIB "" "" "Create Java wrapper exporting all functions of ViSP library (requires static build of ViSP modules)" "" ANDROID IF NOT BUILD_SHARED_LIBS) +VP_OPTION(BUILD_ANDROID_SERVICE "" "" "Build ViSP Manager for Google Play" "" OFF IF ANDROID ) +VP_OPTION(BUILD_ANDROID_PROJECTS "" "" "Build Android projects providing .apk files" "" ON IF ANDROID ) +VP_OPTION(BUILD_ANDROID_EXAMPLES "" "" "Build examples for Android platform" "" ON IF ANDROID ) +VP_OPTION(INSTALL_ANDROID_EXAMPLES "" "" "Install Android examples" "" OFF IF ANDROID ) + # Build demos as an option. VP_OPTION(BUILD_DEMOS "" "" "Build ViSP demos" "" ON) # Build tutorials as an option. @@ -844,6 +855,8 @@ if(BUILD_JAVA) endif() endif() + + if(ANDROID AND ANDROID_EXECUTABLE AND ANT_EXECUTABLE AND (ANT_VERSION VERSION_GREATER 1.7) AND (ANDROID_TOOLS_Pkg_Revision GREATER 13)) SET(CAN_BUILD_ANDROID_PROJECTS TRUE) else() @@ -1188,6 +1201,9 @@ if(BUILD_APPS) vp_add_subdirectories(VISP_CONTRIB_MODULES_PATH apps) endif() + + + # ---------------------------------------------------------------------------- # Make some cmake vars advanced # ---------------------------------------------------------------------------- diff --git a/modules/python/CMakeLists.txt b/modules/python/CMakeLists.txt index ac0ea4e2c7..8968f6603d 100644 --- a/modules/python/CMakeLists.txt +++ b/modules/python/CMakeLists.txt @@ -1,5 +1,8 @@ + +if(BUILD_PYTHON) find_package(Python COMPONENTS Interpreter) + if(Python_FOUND) # We have Python, we can install module # Set pip args @@ -8,6 +11,7 @@ if(Python_FOUND) # We have Python, we can install module else() set(_pip_args "--user") endif() + # Step 1: Generate configuration file # Define modules for which to generate python bindings set(python_ignored_modules "visp_python" "visp_java_bindings_generator") @@ -16,22 +20,19 @@ if(Python_FOUND) # We have Python, we can install module # Define ViSP module vp_add_module(python BINDINGS OPTIONAL ${python_bound_modules}) - message("${VISP_MODULE_${visp_python}_REQ_DEPS}") - - foreach(module ${python_bound_modules}) - message("Module ${module} headers: ${VISP_MODULE_${module}_HEADERS}") - endforeach() - - - + message("${VISP_MODULE_${visp_python}_OPT_DEPS}") + # foreach(module ${python_bound_modules}) + # message("Module ${module} headers: ${VISP_MODULE_${module}_HEADERS}") + # endforeach() # Step 1: Generate bindings set(bindgen_package_location "${CMAKE_CURRENT_SOURCE_DIR}/generator") + set(bindings_package_location "${CMAKE_CURRENT_SOURCE_DIR}/bindings") + set(bindings_gen_location "${CMAKE_CURRENT_BINARY_DIR}/bindings") add_custom_target(visp_python_bindings_generator_run COMMAND ${Python_EXECUTABLE} -m pip install ${_pip_args} -e ${bindgen_package_location} - COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMAKE_CURRENT_SOURCE_DIR}/bindings" ${bindings_gen_location} COMMAND visp_pybindgen --config "${CMAKE_CURRENT_SOURCE_DIR}/config" --build-folder ${bindings_gen_location} DEPENDS visp_doc ) @@ -41,7 +42,7 @@ if(Python_FOUND) # We have Python, we can install module # Step 3: Compile and install bindings as a python package add_custom_target(visp_python_bindings_install - COMMAND ${Python_EXECUTABLE} -m pip install ${_pip_args} -e ${bindings_gen_location} + COMMAND ${Python_EXECUTABLE} -m pip install ${_pip_args} ${bindings_package_location} ) # Step 4: Copy stubs dir and install stubs for autocompletion @@ -52,3 +53,4 @@ if(Python_FOUND) # We have Python, we can install module endif() +endif() \ No newline at end of file diff --git a/modules/python/bindings/CMakeLists.txt b/modules/python/bindings/CMakeLists.txt index caa0955411..afd961060d 100644 --- a/modules/python/bindings/CMakeLists.txt +++ b/modules/python/bindings/CMakeLists.txt @@ -1,12 +1,11 @@ cmake_minimum_required (VERSION 3.5) project(visp) -find_package(pybind11 REQUIRED) find_package(VISP REQUIRED) -include_directories(${VISP_INCLUDE_DIRS}) +find_package(pybind11 REQUIRED) include_directories(include) +include_directories(${VISP_INCLUDE_DIRS}) -file(GLOB generated_cpp src/*.cpp) -file(GLOB static_cpp src/static/*.cpp) -pybind11_add_module(visp THIN_LTO ${generated_cpp} ${static_cpp}) +file(GLOB generated_cpp ${VISP_DIR}/modules/python/bindings/src/*.cpp) +pybind11_add_module(visp THIN_LTO ${generated_cpp}) target_link_libraries(visp PRIVATE ${VISP_LIBRARIES}) diff --git a/modules/python/bindings/setup.py b/modules/python/bindings/setup.py index 8a4cf21416..cb7259b8de 100644 --- a/modules/python/bindings/setup.py +++ b/modules/python/bindings/setup.py @@ -148,15 +148,7 @@ def build_extension(self, ext: CMakeExtension) -> None: author_email="samuel.felton@irisa.fr", description="Python wrapper for the Visual Servoing Platform", long_description="", - setup_requires=[ - "pcpp", - "cxxheaderparser@git+https://github.com/robotpy/cxxheaderparser#egg=master", - "lxml", - "doxmlparser@git+https://github.com/doxygen/doxygen#subdirectory=addon/doxmlparser" - # "sphinx", - # "sphinx-rtd-theme", - # "sphinx-autopackagesummary" - ], + setup_requires=[], ext_modules=[CMakeExtension("visp")], cmdclass={"build_ext": CMakeBuild, 'build': build, 'install': CustomInstall}, zip_safe=False, From c8ca24bd3f44b0dc381f512827cdcc095f62020c Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Tue, 17 Oct 2023 00:30:30 +0200 Subject: [PATCH 076/169] more work on python bindings packaging, some issues with finding the correct python --- modules/python/CMakeLists.txt | 41 ++++-- modules/python/bindings/CMakeLists.txt | 14 +- modules/python/bindings/setup.py | 136 ++---------------- .../visp_python_bindgen/generator.py | 4 +- .../visp_python_bindgen/submodule.py | 2 +- 5 files changed, 54 insertions(+), 143 deletions(-) diff --git a/modules/python/CMakeLists.txt b/modules/python/CMakeLists.txt index 8968f6603d..3fbcdd786c 100644 --- a/modules/python/CMakeLists.txt +++ b/modules/python/CMakeLists.txt @@ -1,10 +1,12 @@ if(BUILD_PYTHON) -find_package(Python COMPONENTS Interpreter) -if(Python_FOUND) # We have Python, we can install module +find_package(Python COMPONENTS Interpreter Development) # TODO: use visp function to find python +if(Python_FOUND) # We have Python, we can install module + include(ProcessorCount) + ProcessorCount(N_PROC) # Set pip args if(DEFINED ENV{VIRTUAL_ENV} OR DEFINED ENV{CONDA_PREFIX}) set(_pip_args) @@ -29,21 +31,40 @@ if(Python_FOUND) # We have Python, we can install module # Step 1: Generate bindings set(bindgen_package_location "${CMAKE_CURRENT_SOURCE_DIR}/generator") set(bindings_package_location "${CMAKE_CURRENT_SOURCE_DIR}/bindings") - + message("${Python_EXECUTABLE}") set(bindings_gen_location "${CMAKE_CURRENT_BINARY_DIR}/bindings") add_custom_target(visp_python_bindings_generator_run - COMMAND ${Python_EXECUTABLE} -m pip install ${_pip_args} -e ${bindgen_package_location} - COMMAND visp_pybindgen --config "${CMAKE_CURRENT_SOURCE_DIR}/config" --build-folder ${bindings_gen_location} - DEPENDS visp_doc + COMMAND ${Python_EXECUTABLE} -m pip install ${_pip_args} -v ${bindgen_package_location} + COMMAND ${Python_EXECUTABLE} -m visp_python_bindgen.generator --config "${CMAKE_CURRENT_SOURCE_DIR}/config" --build-folder ${bindings_gen_location} + BYPRODUCTS "${bindings_gen_location}/src/main.cpp" + DEPENDS ${python_bound_modules} + #DEPENDS visp_doc ) + file(MAKE_DIRECTORY "${bindings_gen_location}/src") + file(TOUCH "${bindings_gen_location}/src/main.cpp") + set(python_bindings_cpp_src "") + foreach(module ${python_bound_modules}) + string(REPLACE "visp_" "" clean_module_name ${module}) + set(cpp_src "${bindings_gen_location}/src/${clean_module_name}.cpp") + list(APPEND python_bindings_cpp_src "${cpp_src}") + file(TOUCH "${cpp_src}") + endforeach() - + add_subdirectory(bindings) # Step 3: Compile and install bindings as a python package - add_custom_target(visp_python_bindings_install - COMMAND ${Python_EXECUTABLE} -m pip install ${_pip_args} ${bindings_package_location} - ) + # Cmake needs to be run + # add_custom_target(visp_python_bindings_compile + # COMMAND "${CMAKE_COMMAND}" -G "${CMAKE_GENERATOR}" "${bindings_package_location}" -DVISP_DIR="${VISP_BINARY_DIR}" + # COMMAND "${CMAKE_COMMAND}" --build . --parallel ${N_PROC} + # WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" + # DEPENDS visp_python_bindings_generator_run + # ) + + # add_custom_target(visp_python_bindings_install + # COMMAND ${Python_EXECUTABLE} -m pip install ${_pip_args} ${bindings_package_location} + # ) # Step 4: Copy stubs dir and install stubs for autocompletion diff --git a/modules/python/bindings/CMakeLists.txt b/modules/python/bindings/CMakeLists.txt index afd961060d..41dece3fa3 100644 --- a/modules/python/bindings/CMakeLists.txt +++ b/modules/python/bindings/CMakeLists.txt @@ -1,11 +1,13 @@ -cmake_minimum_required (VERSION 3.5) -project(visp) +# cmake_minimum_required(VERSION 3.5) +# project(_visp) -find_package(VISP REQUIRED) find_package(pybind11 REQUIRED) +find_package(VISP PATHS ${VISP_BINARY_DIR} NO_DEFAULT_PATH) + include_directories(include) include_directories(${VISP_INCLUDE_DIRS}) -file(GLOB generated_cpp ${VISP_DIR}/modules/python/bindings/src/*.cpp) -pybind11_add_module(visp THIN_LTO ${generated_cpp}) -target_link_libraries(visp PRIVATE ${VISP_LIBRARIES}) +pybind11_add_module(_visp THIN_LTO ${python_bindings_cpp_src}) + +target_link_libraries(_visp PRIVATE ${VISP_LIBRARIES}) +add_dependencies(_visp visp_python_bindings_generator_run) diff --git a/modules/python/bindings/setup.py b/modules/python/bindings/setup.py index cb7259b8de..3851cb22ad 100644 --- a/modules/python/bindings/setup.py +++ b/modules/python/bindings/setup.py @@ -12,132 +12,20 @@ package_name = 'visp' version = '0.0.4' -stubs_path = Path('stubs') -# Convert distutils Windows platform specifiers to CMake -A arguments -PLAT_TO_CMAKE = { - "win32": "Win32", - "win-amd64": "x64", - "win-arm32": "ARM", - "win-arm64": "ARM64", -} +package_data = {} -class CustomInstall(install): - def run(self): - install.run(self) +if os.name == 'posix': + package_data[package_name] = ['*.so'] +else: + package_data[package_name] = ['*.pyd', '*.dll'] -class build(build_module.build): - def run(self): - import os - #output = subprocess.run('python generator/generator.py', env=os.environ, shell=True, capture_output=True, check=True) - build_module.build.run(self) -# A CMakeExtension needs a sourcedir instead of a file list. -# The name must be the _single_ output extension from the CMake build. -# If you need multiple extensions, see scikit-build. -class CMakeExtension(Extension): - def __init__(self, name: str, sourcedir: str = "") -> None: - super().__init__(name, sources=[]) - self.sourcedir = os.fspath(Path(sourcedir).resolve()) - - -class CMakeBuild(build_ext): - def build_extension(self, ext: CMakeExtension) -> None: - # Must be in this form due to bug in .resolve() only fixed in Python 3.10+ - ext_fullpath = Path.cwd() / self.get_ext_fullpath(ext.name) - extdir = ext_fullpath.parent.resolve() - - # Using this requires trailing slash for auto-detection & inclusion of - # auxiliary "native" libs - debug = int(os.environ.get("DEBUG", 0)) if self.debug is None else self.debug - print('DEBUG', debug) - cfg = "Debug" if debug else "Release" - - # CMake lets you override the generator - we need to check this. - # Can be set with Conda-Build, for example. - cmake_generator = os.environ.get("CMAKE_GENERATOR", "") - - # Set Python_EXECUTABLE instead if you use PYBIND11_FINDPYTHON - # EXAMPLE_VERSION_INFO shows you how to pass a value into the C++ code - # from Python. - cmake_args = [ - f"-DCMAKE_LIBRARY_OUTPUT_DIRECTORY={extdir}{os.sep}", - f"-DPYTHON_EXECUTABLE={sys.executable}", - f"-DCMAKE_BUILD_TYPE={cfg}", # not used on MSVC, but no harm - ] - build_args = [] - # Adding CMake arguments set as environment variable - # (needed e.g. to build for ARM OSx on conda-forge) - if "CMAKE_ARGS" in os.environ: - cmake_args += [item for item in os.environ["CMAKE_ARGS"].split(" ") if item] - - # In this example, we pass in the version to C++. You might not need to. - cmake_args += [f"-DVISP_PYTHON_VERSION_INFO={self.distribution.get_version()}"] - - if self.compiler.compiler_type != "msvc": - # Using Ninja-build since it a) is available as a wheel and b) - # multithreads automatically. MSVC would require all variables be - # exported for Ninja to pick it up, which is a little tricky to do. - # Users can override the generator with CMAKE_GENERATOR in CMake - # 3.15+. - if not cmake_generator or cmake_generator == "Ninja": - try: - import ninja - - ninja_executable_path = Path(ninja.BIN_DIR) / "ninja" - cmake_args += [ - "-GNinja", - f"-DCMAKE_MAKE_PROGRAM:FILEPATH={ninja_executable_path}", - ] - except ImportError: - pass - - else: - # Single config generators are handled "normally" - single_config = any(x in cmake_generator for x in {"NMake", "Ninja"}) - - # CMake allows an arch-in-generator style for backward compatibility - contains_arch = any(x in cmake_generator for x in {"ARM", "Win64"}) - - # Specify the arch if using MSVC generator, but only if it doesn't - # contain a backward-compatibility arch spec already in the - # generator name. - if not single_config and not contains_arch: - cmake_args += ["-A", PLAT_TO_CMAKE[self.plat_name]] - - # Multi-config generators have a different way to specify configs - if not single_config: - cmake_args += [ - f"-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_{cfg.upper()}={extdir}" - ] - build_args += ["--config", cfg] - - if sys.platform.startswith("darwin"): - # Cross-compile support for macOS - respect ARCHFLAGS if set - archs = re.findall(r"-arch (\S+)", os.environ.get("ARCHFLAGS", "")) - if archs: - cmake_args += ["-DCMAKE_OSX_ARCHITECTURES={}".format(";".join(archs))] - - # Set CMAKE_BUILD_PARALLEL_LEVEL to control the parallel build level - # across all generators. - if "CMAKE_BUILD_PARALLEL_LEVEL" not in os.environ: - # self.parallel is a Python 3 only way to set parallel jobs by hand - # using -j in the build_ext call, not supported by pip or PyPA-build. - if hasattr(self, "parallel") and self.parallel: - # CMake 3.12+ only. - build_args += [f"-j{self.parallel}"] - - build_temp = Path(self.build_temp) / ext.name - if not build_temp.exists(): - build_temp.mkdir(parents=True) - - subprocess.run( - ["cmake", ext.sourcedir, *cmake_args], cwd=build_temp, check=True - ) - subprocess.run( - ["cmake", "--build", ".", *build_args], cwd=build_temp, check=True - ) - +# This creates a list which is empty but returns a length of 1. +# Should make the wheel a binary distribution and platlib compliant. +class EmptyListWithLength(list): + def __len__(self): + return 1 # The information here can also be placed in setup.cfg - better separation of # logic and declaration, and simpler if you include description/version in a file. @@ -149,10 +37,10 @@ def build_extension(self, ext: CMakeExtension) -> None: description="Python wrapper for the Visual Servoing Platform", long_description="", setup_requires=[], - ext_modules=[CMakeExtension("visp")], - cmdclass={"build_ext": CMakeBuild, 'build': build, 'install': CustomInstall}, + ext_modules=EmptyListWithLength, zip_safe=False, include_package_data=True, + package_data=package_data, extras_require={"test": ["pytest>=6.0"]}, python_requires=">=3.7", ) diff --git a/modules/python/generator/visp_python_bindgen/generator.py b/modules/python/generator/visp_python_bindgen/generator.py index fe6b8cbb8f..036a70dd38 100644 --- a/modules/python/generator/visp_python_bindgen/generator.py +++ b/modules/python/generator/visp_python_bindgen/generator.py @@ -29,12 +29,12 @@ def main_str(submodule_fn_declarations, submodule_fn_calls): ''' return f''' -#define PYBIND11_DETAILED_ERROR_MESSAGES +//#define PYBIND11_DETAILED_ERROR_MESSAGES #include namespace py = pybind11; {submodule_fn_declarations} -PYBIND11_MODULE(visp, m) +PYBIND11_MODULE(_visp, m) {{ m.doc() = "ViSP Python binding"; diff --git a/modules/python/generator/visp_python_bindgen/submodule.py b/modules/python/generator/visp_python_bindgen/submodule.py index 84a94b94f0..4f7257f7ca 100644 --- a/modules/python/generator/visp_python_bindgen/submodule.py +++ b/modules/python/generator/visp_python_bindgen/submodule.py @@ -77,7 +77,7 @@ def generate(self) -> None: additional_required_headers = '\n'.join(self.get_required_headers()) format_str = f''' -#define PYBIND11_DETAILED_ERROR_MESSAGES +//#define PYBIND11_DETAILED_ERROR_MESSAGES #include #include #include From 99203a61d0f258384de51b98c15fec84cd426810 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Tue, 17 Oct 2023 16:47:09 +0200 Subject: [PATCH 077/169] worko n cmake --- modules/python/CMakeLists.txt | 45 ++++++++++++++------------ modules/python/bindings/CMakeLists.txt | 4 +-- 2 files changed, 26 insertions(+), 23 deletions(-) diff --git a/modules/python/CMakeLists.txt b/modules/python/CMakeLists.txt index 3fbcdd786c..4fb18d7ff7 100644 --- a/modules/python/CMakeLists.txt +++ b/modules/python/CMakeLists.txt @@ -4,9 +4,11 @@ if(BUILD_PYTHON) find_package(Python COMPONENTS Interpreter Development) # TODO: use visp function to find python +#todo : Run generator in an initial pass, depends on ConfigFile and vpConfig.h + + if(Python_FOUND) # We have Python, we can install module - include(ProcessorCount) - ProcessorCount(N_PROC) + # Set pip args if(DEFINED ENV{VIRTUAL_ENV} OR DEFINED ENV{CONDA_PREFIX}) set(_pip_args) @@ -16,7 +18,7 @@ if(Python_FOUND) # We have Python, we can install module # Step 1: Generate configuration file # Define modules for which to generate python bindings - set(python_ignored_modules "visp_python" "visp_java_bindings_generator") + set(python_ignored_modules "visp_python" "visp_java_bindings_generator" "visp_java") set(python_bound_modules ${VISP_MODULES_BUILD}) list(REMOVE_ITEM python_bound_modules ${python_ignored_modules}) @@ -33,24 +35,25 @@ if(Python_FOUND) # We have Python, we can install module set(bindings_package_location "${CMAKE_CURRENT_SOURCE_DIR}/bindings") message("${Python_EXECUTABLE}") set(bindings_gen_location "${CMAKE_CURRENT_BINARY_DIR}/bindings") - add_custom_target(visp_python_bindings_generator_run - COMMAND ${Python_EXECUTABLE} -m pip install ${_pip_args} -v ${bindgen_package_location} - COMMAND ${Python_EXECUTABLE} -m visp_python_bindgen.generator --config "${CMAKE_CURRENT_SOURCE_DIR}/config" --build-folder ${bindings_gen_location} - BYPRODUCTS "${bindings_gen_location}/src/main.cpp" - DEPENDS ${python_bound_modules} - #DEPENDS visp_doc - ) - file(MAKE_DIRECTORY "${bindings_gen_location}/src") - file(TOUCH "${bindings_gen_location}/src/main.cpp") - set(python_bindings_cpp_src "") - foreach(module ${python_bound_modules}) - string(REPLACE "visp_" "" clean_module_name ${module}) - set(cpp_src "${bindings_gen_location}/src/${clean_module_name}.cpp") - list(APPEND python_bindings_cpp_src "${cpp_src}") - file(TOUCH "${cpp_src}") - endforeach() - - add_subdirectory(bindings) + if(VISP_INITIAL_PASS) + add_custom_command( OUTPUT "${bindings_gen_location}/src/*.cpp" + COMMAND ${Python_EXECUTABLE} -m pip install ${_pip_args} -v ${bindgen_package_location} + COMMAND ${Python_EXECUTABLE} -m visp_python_bindgen.generator --config "${CMAKE_CURRENT_SOURCE_DIR}/config" --build-folder ${bindings_gen_location} + DEPENDS "${VISP_INCLUDE_DIR}/visp3/core/vpConfig.h" + #DEPENDS visp_doc + ) + endif() + # file(MAKE_DIRECTORY "${bindings_gen_location}/src") + # file(TOUCH "${bindings_gen_location}/src/main.cpp") + # set(python_bindings_cpp_src "${bindings_gen_location}/src/main.cpp") + # foreach(module ${python_bound_modules}) + # string(REPLACE "visp_" "" clean_module_name ${module}) + # set(cpp_src "${bindings_gen_location}/src/${clean_module_name}.cpp") + # list(APPEND python_bindings_cpp_src "${cpp_src}") + # file(TOUCH "${cpp_src}") + # endforeach() + + add_subdirectory(bindings "${bindings_gen_location}") # Step 3: Compile and install bindings as a python package diff --git a/modules/python/bindings/CMakeLists.txt b/modules/python/bindings/CMakeLists.txt index 41dece3fa3..29edc74121 100644 --- a/modules/python/bindings/CMakeLists.txt +++ b/modules/python/bindings/CMakeLists.txt @@ -3,11 +3,11 @@ find_package(pybind11 REQUIRED) find_package(VISP PATHS ${VISP_BINARY_DIR} NO_DEFAULT_PATH) - +#find_package(VISP REQUIRED) include_directories(include) include_directories(${VISP_INCLUDE_DIRS}) pybind11_add_module(_visp THIN_LTO ${python_bindings_cpp_src}) - +message("${VISP_LIBRARIES}") target_link_libraries(_visp PRIVATE ${VISP_LIBRARIES}) add_dependencies(_visp visp_python_bindings_generator_run) From a32de822e317952740da0f127c6b2575a34cef6a Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Tue, 17 Oct 2023 17:50:50 +0200 Subject: [PATCH 078/169] using set_source_files_properties for cmake, seems ok --- modules/python/CMakeLists.txt | 35 +++++++++++++------------- modules/python/bindings/CMakeLists.txt | 1 + 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/modules/python/CMakeLists.txt b/modules/python/CMakeLists.txt index 4fb18d7ff7..d6750ff89f 100644 --- a/modules/python/CMakeLists.txt +++ b/modules/python/CMakeLists.txt @@ -35,23 +35,24 @@ if(Python_FOUND) # We have Python, we can install module set(bindings_package_location "${CMAKE_CURRENT_SOURCE_DIR}/bindings") message("${Python_EXECUTABLE}") set(bindings_gen_location "${CMAKE_CURRENT_BINARY_DIR}/bindings") - if(VISP_INITIAL_PASS) - add_custom_command( OUTPUT "${bindings_gen_location}/src/*.cpp" - COMMAND ${Python_EXECUTABLE} -m pip install ${_pip_args} -v ${bindgen_package_location} - COMMAND ${Python_EXECUTABLE} -m visp_python_bindgen.generator --config "${CMAKE_CURRENT_SOURCE_DIR}/config" --build-folder ${bindings_gen_location} - DEPENDS "${VISP_INCLUDE_DIR}/visp3/core/vpConfig.h" - #DEPENDS visp_doc - ) - endif() - # file(MAKE_DIRECTORY "${bindings_gen_location}/src") - # file(TOUCH "${bindings_gen_location}/src/main.cpp") - # set(python_bindings_cpp_src "${bindings_gen_location}/src/main.cpp") - # foreach(module ${python_bound_modules}) - # string(REPLACE "visp_" "" clean_module_name ${module}) - # set(cpp_src "${bindings_gen_location}/src/${clean_module_name}.cpp") - # list(APPEND python_bindings_cpp_src "${cpp_src}") - # file(TOUCH "${cpp_src}") - # endforeach() + add_custom_target( visp_python_bindings_generator_run + COMMAND ${Python_EXECUTABLE} -m pip install ${_pip_args} -v ${bindgen_package_location} + COMMAND ${Python_EXECUTABLE} -m visp_python_bindgen.generator --config "${CMAKE_CURRENT_SOURCE_DIR}/config" --build-folder ${bindings_gen_location} + #DEPENDS "${VISP_INCLUDE_DIR}/visp3/core/vpConfig.h" + DEPENDS ${python_bound_modules} + #DEPENDS visp_doc + ) + file(MAKE_DIRECTORY "${bindings_gen_location}/src") + #file(TOUCH "${bindings_gen_location}/src/main.cpp") + set(python_bindings_cpp_src "${bindings_gen_location}/src/main.cpp") + + foreach(module ${python_bound_modules}) + string(REPLACE "visp_" "" clean_module_name ${module}) + set(cpp_src "${bindings_gen_location}/src/${clean_module_name}.cpp") + list(APPEND python_bindings_cpp_src "${cpp_src}") + #file(TOUCH "${cpp_src}") + endforeach() + add_subdirectory(bindings "${bindings_gen_location}") diff --git a/modules/python/bindings/CMakeLists.txt b/modules/python/bindings/CMakeLists.txt index 29edc74121..8314320b6b 100644 --- a/modules/python/bindings/CMakeLists.txt +++ b/modules/python/bindings/CMakeLists.txt @@ -3,6 +3,7 @@ find_package(pybind11 REQUIRED) find_package(VISP PATHS ${VISP_BINARY_DIR} NO_DEFAULT_PATH) +set_source_files_properties(${python_bindings_cpp_src} PROPERTIES GENERATED TRUE) #find_package(VISP REQUIRED) include_directories(include) include_directories(${VISP_INCLUDE_DIRS}) From 0c5d8ea92b999b6d83cc9f59d461ec48f21852c4 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Wed, 18 Oct 2023 01:11:17 +0200 Subject: [PATCH 079/169] work on json file generation --- modules/python/CMakeLists.txt | 61 ++++++++++++++++--- modules/python/bindings/CMakeLists.txt | 8 ++- modules/python/config/ar.json | 1 + .../visp_python_bindgen/submodule.py | 2 +- 4 files changed, 58 insertions(+), 14 deletions(-) create mode 100644 modules/python/config/ar.json diff --git a/modules/python/CMakeLists.txt b/modules/python/CMakeLists.txt index d6750ff89f..1122658c8f 100644 --- a/modules/python/CMakeLists.txt +++ b/modules/python/CMakeLists.txt @@ -1,8 +1,22 @@ if(BUILD_PYTHON) - -find_package(Python COMPONENTS Interpreter Development) # TODO: use visp function to find python +# this avoids non-active conda from getting picked anyway on Windows +set(Python_FIND_REGISTRY LAST) + +# Use environment variable PATH to decide preference for Python +set(Python_FIND_VIRTUALENV FIRST) +set(Python_FIND_STRATEGY LOCATION) +find_package(Python 3.7 COMPONENTS Interpreter Development) # TODO: use visp function to find python? +find_package(pybind11 CONFIG REQUIRED) +# message("${Python_LIBRARIES}") +# message("${Python_INCLUDE_DIRS}") +# if(NOT DEFINED PYTHON_LIBRARIES) +# set(PYTHON_LIBRARIES ${Python_LIBRARIES}) +# endif() +# if(NOT DEFINED PYTHON_INCLUDE_DIRS) +# set(PYTHON_INCLUDE_DIRS ${Python_INCLUDE_DIRS}) +# endif() #todo : Run generator in an initial pass, depends on ConfigFile and vpConfig.h @@ -30,28 +44,55 @@ if(Python_FOUND) # We have Python, we can install module # message("Module ${module} headers: ${VISP_MODULE_${module}_HEADERS}") # endforeach() + + + # Step 1: Generate bindings + + # Configure set(bindgen_package_location "${CMAKE_CURRENT_SOURCE_DIR}/generator") set(bindings_package_location "${CMAKE_CURRENT_SOURCE_DIR}/bindings") message("${Python_EXECUTABLE}") set(bindings_gen_location "${CMAKE_CURRENT_BINARY_DIR}/bindings") - add_custom_target( visp_python_bindings_generator_run - COMMAND ${Python_EXECUTABLE} -m pip install ${_pip_args} -v ${bindgen_package_location} - COMMAND ${Python_EXECUTABLE} -m visp_python_bindgen.generator --config "${CMAKE_CURRENT_SOURCE_DIR}/config" --build-folder ${bindings_gen_location} - #DEPENDS "${VISP_INCLUDE_DIR}/visp3/core/vpConfig.h" - DEPENDS ${python_bound_modules} - #DEPENDS visp_doc - ) file(MAKE_DIRECTORY "${bindings_gen_location}/src") #file(TOUCH "${bindings_gen_location}/src/main.cpp") set(python_bindings_cpp_src "${bindings_gen_location}/src/main.cpp") - + set(json_config_file "{}") + #string(JSON json_config_file SET ${json_config_file} ${clean_module_name} "{}") + set(json_include_dirs "[]") + set(include_dirs_count 0) + foreach(include_dir ${VISP_INCLUDE_DIRS}) + message("Include dir: ${include_dir}") + string(JSON json_include_dirs SET ${json_include_dirs} "${include_dirs_count}" "\"${include_dir}\"") + MATH(EXPR include_dirs_count "${include_dirs_count}+1") + endforeach() + string(JSON json_config_file SET ${json_config_file} "include_dirs" "${json_include_dirs}") foreach(module ${python_bound_modules}) string(REPLACE "visp_" "" clean_module_name ${module}) set(cpp_src "${bindings_gen_location}/src/${clean_module_name}.cpp") list(APPEND python_bindings_cpp_src "${cpp_src}") + + string(JSON json_config_file SET ${json_config_file} ${clean_module_name} "{}") + + set(json_header_list "[]") + set(header_count 0) + foreach(module_header ${VISP_MODULE_${module}_HEADERS}) + string(JSON json_header_list SET ${json_header_list} "${header_count}" "\"${module_header}\"") + MATH(EXPR header_count "${header_count}+1") + endforeach() + string(JSON json_config_file SET ${json_config_file} ${clean_module_name} "headers" "${json_header_list}") #file(TOUCH "${cpp_src}") endforeach() + message("${json_config_file}") + + + add_custom_target( visp_python_bindings_generator_run + COMMAND ${Python_EXECUTABLE} -m pip install ${_pip_args} -v ${bindgen_package_location} + COMMAND ${Python_EXECUTABLE} -m visp_python_bindgen.generator --config "${CMAKE_CURRENT_SOURCE_DIR}/config" --build-folder ${bindings_gen_location} + #DEPENDS "${VISP_INCLUDE_DIR}/visp3/core/vpConfig.h" + DEPENDS ${python_bound_modules} + #DEPENDS visp_doc + ) add_subdirectory(bindings "${bindings_gen_location}") diff --git a/modules/python/bindings/CMakeLists.txt b/modules/python/bindings/CMakeLists.txt index 8314320b6b..d47fed27ef 100644 --- a/modules/python/bindings/CMakeLists.txt +++ b/modules/python/bindings/CMakeLists.txt @@ -1,14 +1,16 @@ # cmake_minimum_required(VERSION 3.5) # project(_visp) -find_package(pybind11 REQUIRED) find_package(VISP PATHS ${VISP_BINARY_DIR} NO_DEFAULT_PATH) set_source_files_properties(${python_bindings_cpp_src} PROPERTIES GENERATED TRUE) + #find_package(VISP REQUIRED) -include_directories(include) -include_directories(${VISP_INCLUDE_DIRS}) pybind11_add_module(_visp THIN_LTO ${python_bindings_cpp_src}) +target_include_directories(_visp PRIVATE include) +target_include_directories(_visp PRIVATE ${VISP_INCLUDE_DIRS}) message("${VISP_LIBRARIES}") +message("${VISP_INCLUDE_DIRS}") + target_link_libraries(_visp PRIVATE ${VISP_LIBRARIES}) add_dependencies(_visp visp_python_bindings_generator_run) diff --git a/modules/python/config/ar.json b/modules/python/config/ar.json new file mode 100644 index 0000000000..871b47c723 --- /dev/null +++ b/modules/python/config/ar.json @@ -0,0 +1 @@ +{"ignored_headers": [], "ignored_classes": [], "user_defined_headers": [], "classes": {}, "enums": {}} \ No newline at end of file diff --git a/modules/python/generator/visp_python_bindgen/submodule.py b/modules/python/generator/visp_python_bindgen/submodule.py index 4f7257f7ca..7bfacc691b 100644 --- a/modules/python/generator/visp_python_bindgen/submodule.py +++ b/modules/python/generator/visp_python_bindgen/submodule.py @@ -195,7 +195,7 @@ def get_method_config(self, class_name: Optional[str], method, owner_specs, head def get_submodules(config_path: Path, generate_path: Path) -> List[Submodule]: - modules = ['core', 'imgproc', 'vision', 'visual_features', 'vs', 'sensor', 'io', 'detection', 'robot', 'gui'] + modules = ['core', 'imgproc', 'vision', 'visual_features', 'vs', 'sensor', 'io', 'detection', 'robot', 'gui', 'ar'] result = [] for module in modules: result.append(Submodule(module, Path(f'/home/sfelton/software/visp-sfelton/modules/{module}/include/visp3/{module}'), config_path, generate_path / f'{module}.cpp')) From 2edcd3ebeceb305d82b431709be891da308f90ea Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Wed, 18 Oct 2023 17:34:51 +0200 Subject: [PATCH 080/169] still having problems finding correct cmake variables --- modules/python/CMakeLists.txt | 52 ++++++++++++-------------- modules/python/bindings/CMakeLists.txt | 2 + 2 files changed, 26 insertions(+), 28 deletions(-) diff --git a/modules/python/CMakeLists.txt b/modules/python/CMakeLists.txt index 1122658c8f..887fe6e187 100644 --- a/modules/python/CMakeLists.txt +++ b/modules/python/CMakeLists.txt @@ -1,25 +1,16 @@ - if(BUILD_PYTHON) + # this avoids non-active conda from getting picked anyway on Windows set(Python_FIND_REGISTRY LAST) - +message("CMAKE INCLUDE DIRS ${VISP}") # Use environment variable PATH to decide preference for Python set(Python_FIND_VIRTUALENV FIRST) set(Python_FIND_STRATEGY LOCATION) find_package(Python 3.7 COMPONENTS Interpreter Development) # TODO: use visp function to find python? -find_package(pybind11 CONFIG REQUIRED) -# message("${Python_LIBRARIES}") -# message("${Python_INCLUDE_DIRS}") -# if(NOT DEFINED PYTHON_LIBRARIES) -# set(PYTHON_LIBRARIES ${Python_LIBRARIES}) -# endif() -# if(NOT DEFINED PYTHON_INCLUDE_DIRS) -# set(PYTHON_INCLUDE_DIRS ${Python_INCLUDE_DIRS}) -# endif() -#todo : Run generator in an initial pass, depends on ConfigFile and vpConfig.h +#todo : Run generator in an initial pass, depends on ConfigFile and vpConfig.h if(Python_FOUND) # We have Python, we can install module @@ -38,39 +29,37 @@ if(Python_FOUND) # We have Python, we can install module # Define ViSP module vp_add_module(python BINDINGS OPTIONAL ${python_bound_modules}) - message("${VISP_MODULE_${visp_python}_OPT_DEPS}") - - # foreach(module ${python_bound_modules}) - # message("Module ${module} headers: ${VISP_MODULE_${module}_HEADERS}") - # endforeach() - - - # Step 1: Generate bindings - # Configure set(bindgen_package_location "${CMAKE_CURRENT_SOURCE_DIR}/generator") set(bindings_package_location "${CMAKE_CURRENT_SOURCE_DIR}/bindings") - message("${Python_EXECUTABLE}") set(bindings_gen_location "${CMAKE_CURRENT_BINARY_DIR}/bindings") file(MAKE_DIRECTORY "${bindings_gen_location}/src") #file(TOUCH "${bindings_gen_location}/src/main.cpp") set(python_bindings_cpp_src "${bindings_gen_location}/src/main.cpp") + + foreach(module ${python_bound_modules}) + # get_target_property(dirs "${module}" INCLUDE_DIRECTORIES) + # message("Dirs = ${dirs}") + string(REPLACE "visp_" "" clean_module_name ${module}) + set(cpp_src "${bindings_gen_location}/src/${clean_module_name}.cpp") + list(APPEND python_bindings_cpp_src "${cpp_src}") + endforeach() + + set(json_config_file "{}") - #string(JSON json_config_file SET ${json_config_file} ${clean_module_name} "{}") set(json_include_dirs "[]") set(include_dirs_count 0) foreach(include_dir ${VISP_INCLUDE_DIRS}) message("Include dir: ${include_dir}") string(JSON json_include_dirs SET ${json_include_dirs} "${include_dirs_count}" "\"${include_dir}\"") - MATH(EXPR include_dirs_count "${include_dirs_count}+1") + MATH(EXPR include_dir${CMAKE_BINARY_DIR}/VISPGenerateConfigScript.info.cmakes_count "${include_dirs_count}+1") endforeach() string(JSON json_config_file SET ${json_config_file} "include_dirs" "${json_include_dirs}") foreach(module ${python_bound_modules}) + message("${python_bound_modules}") string(REPLACE "visp_" "" clean_module_name ${module}) - set(cpp_src "${bindings_gen_location}/src/${clean_module_name}.cpp") - list(APPEND python_bindings_cpp_src "${cpp_src}") string(JSON json_config_file SET ${json_config_file} ${clean_module_name} "{}") @@ -86,12 +75,18 @@ if(Python_FOUND) # We have Python, we can install module message("${json_config_file}") + + + # Step 2: Generate bindings + + + + add_custom_target( visp_python_bindings_generator_run COMMAND ${Python_EXECUTABLE} -m pip install ${_pip_args} -v ${bindgen_package_location} COMMAND ${Python_EXECUTABLE} -m visp_python_bindgen.generator --config "${CMAKE_CURRENT_SOURCE_DIR}/config" --build-folder ${bindings_gen_location} - #DEPENDS "${VISP_INCLUDE_DIR}/visp3/core/vpConfig.h" + BYPRODUCTS ${python_bindings_cpp_src} DEPENDS ${python_bound_modules} - #DEPENDS visp_doc ) @@ -119,4 +114,5 @@ if(Python_FOUND) # We have Python, we can install module endif() + endif() \ No newline at end of file diff --git a/modules/python/bindings/CMakeLists.txt b/modules/python/bindings/CMakeLists.txt index d47fed27ef..af9e32bfcd 100644 --- a/modules/python/bindings/CMakeLists.txt +++ b/modules/python/bindings/CMakeLists.txt @@ -2,6 +2,8 @@ # project(_visp) find_package(VISP PATHS ${VISP_BINARY_DIR} NO_DEFAULT_PATH) +find_package(pybind11 REQUIRED) + set_source_files_properties(${python_bindings_cpp_src} PROPERTIES GENERATED TRUE) #find_package(VISP REQUIRED) From 2b3c496283cfbcd0ade0e9078ad9a0d0df95502a Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Thu, 19 Oct 2023 13:47:39 +0200 Subject: [PATCH 081/169] start working on pip install of the module --- CMakeLists.txt | 4 +- modules/python/CMakeLists.txt | 184 +++++++++--------- modules/python/bindings/CMakeLists.txt | 31 +-- modules/python/bindings/pyproject.toml | 25 --- .../python/bindings/{setup.py => setup.py.in} | 9 +- modules/python/bindings/visp/__init__.py | 1 + 6 files changed, 126 insertions(+), 128 deletions(-) delete mode 100644 modules/python/bindings/pyproject.toml rename modules/python/bindings/{setup.py => setup.py.in} (88%) create mode 100644 modules/python/bindings/visp/__init__.py diff --git a/CMakeLists.txt b/CMakeLists.txt index 1c7912b608..f7e291b0d7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1200,7 +1200,9 @@ endif() if(BUILD_APPS) vp_add_subdirectories(VISP_CONTRIB_MODULES_PATH apps) endif() - +if(BUILD_PYTHON) + add_subdirectory(modules/python) +endif() diff --git a/modules/python/CMakeLists.txt b/modules/python/CMakeLists.txt index 887fe6e187..cc53467677 100644 --- a/modules/python/CMakeLists.txt +++ b/modules/python/CMakeLists.txt @@ -1,118 +1,126 @@ -if(BUILD_PYTHON) +if(NOT VISP_DIR) + return() +endif() + + +find_package(VISP REQUIRED) # this avoids non-active conda from getting picked anyway on Windows set(Python_FIND_REGISTRY LAST) -message("CMAKE INCLUDE DIRS ${VISP}") # Use environment variable PATH to decide preference for Python set(Python_FIND_VIRTUALENV FIRST) set(Python_FIND_STRATEGY LOCATION) find_package(Python 3.7 COMPONENTS Interpreter Development) # TODO: use visp function to find python? +find_package(pybind11 REQUIRED) -#todo : Run generator in an initial pass, depends on ConfigFile and vpConfig.h - -if(Python_FOUND) # We have Python, we can install module - - # Set pip args - if(DEFINED ENV{VIRTUAL_ENV} OR DEFINED ENV{CONDA_PREFIX}) - set(_pip_args) - else() - set(_pip_args "--user") - endif() - - # Step 1: Generate configuration file - # Define modules for which to generate python bindings - set(python_ignored_modules "visp_python" "visp_java_bindings_generator" "visp_java") - set(python_bound_modules ${VISP_MODULES_BUILD}) - list(REMOVE_ITEM python_bound_modules ${python_ignored_modules}) - - # Define ViSP module - vp_add_module(python BINDINGS OPTIONAL ${python_bound_modules}) - - - # Configure - set(bindgen_package_location "${CMAKE_CURRENT_SOURCE_DIR}/generator") - set(bindings_package_location "${CMAKE_CURRENT_SOURCE_DIR}/bindings") - set(bindings_gen_location "${CMAKE_CURRENT_BINARY_DIR}/bindings") - file(MAKE_DIRECTORY "${bindings_gen_location}/src") - #file(TOUCH "${bindings_gen_location}/src/main.cpp") - set(python_bindings_cpp_src "${bindings_gen_location}/src/main.cpp") - - foreach(module ${python_bound_modules}) - # get_target_property(dirs "${module}" INCLUDE_DIRECTORIES) - # message("Dirs = ${dirs}") - string(REPLACE "visp_" "" clean_module_name ${module}) - set(cpp_src "${bindings_gen_location}/src/${clean_module_name}.cpp") - list(APPEND python_bindings_cpp_src "${cpp_src}") - endforeach() +message("${VISP_INCLUDE_DIRS}") +# TODO: check for pip +if(Python_FOUND AND pybind11_FOUND) # We have Python and pybind11, we can install module +# Set pip args +if(DEFINED ENV{VIRTUAL_ENV} OR DEFINED ENV{CONDA_PREFIX}) + set(_pip_args) +else() + set(_pip_args "--user") +endif() - set(json_config_file "{}") - set(json_include_dirs "[]") - set(include_dirs_count 0) - foreach(include_dir ${VISP_INCLUDE_DIRS}) - message("Include dir: ${include_dir}") - string(JSON json_include_dirs SET ${json_include_dirs} "${include_dirs_count}" "\"${include_dir}\"") - MATH(EXPR include_dir${CMAKE_BINARY_DIR}/VISPGenerateConfigScript.info.cmakes_count "${include_dirs_count}+1") +# Step 1: Generate configuration file +# Define modules for which to generate python bindings +set(python_ignored_modules "visp_python" "visp_java_bindings_generator" "visp_java") +set(python_bound_modules ${VISP_MODULES_BUILD}) +list(REMOVE_ITEM python_bound_modules ${python_ignored_modules}) + +# Define ViSP module + + +# Configure +set(bindgen_package_location "${CMAKE_CURRENT_SOURCE_DIR}/generator") +set(bindings_package_location "${CMAKE_CURRENT_SOURCE_DIR}/bindings") +set(bindings_gen_location "${CMAKE_CURRENT_BINARY_DIR}/bindings") +file(MAKE_DIRECTORY "${bindings_gen_location}/src") +#file(TOUCH "${bindings_gen_location}/src/main.cpp") +set(python_bindings_cpp_src "${bindings_gen_location}/src/main.cpp") + +foreach(module ${python_bound_modules}) + get_target_property(dirs "${module}" INCLUDE_DIRECTORIES) + message("Dirs = ${dirs}") + string(REPLACE "visp_" "" clean_module_name ${module}) + set(cpp_src "${bindings_gen_location}/src/${clean_module_name}.cpp") + list(APPEND python_bindings_cpp_src "${cpp_src}") +endforeach() + +set(json_config_file "{}") +set(json_config_file_path "${CMAKE_CURRENT_BINARY_DIR}/cmake_config.json") + +# Add include directories to config file +set(json_include_dirs "[]") +set(include_dirs_count 0) +foreach(include_dir ${VISP_INCLUDE_DIRS}) + message("Include dir: ${include_dir}") + string(JSON json_include_dirs SET ${json_include_dirs} "${include_dirs_count}" "\"${include_dir}\"") + MATH(EXPR include_dirs_count "${include_dirs_count}+1") +endforeach() +string(JSON json_config_file SET ${json_config_file} "include_dirs" "${json_include_dirs}") + +# For each bound module, add its headers to config file +foreach(module ${python_bound_modules}) + message("${python_bound_modules}") + string(REPLACE "visp_" "" clean_module_name ${module}) + + string(JSON json_config_file SET ${json_config_file} ${clean_module_name} "{}") + + set(json_header_list "[]") + set(header_count 0) + foreach(module_header ${VISP_MODULE_${module}_HEADERS}) + string(JSON json_header_list SET ${json_header_list} "${header_count}" "\"${module_header}\"") + MATH(EXPR header_count "${header_count}+1") endforeach() - string(JSON json_config_file SET ${json_config_file} "include_dirs" "${json_include_dirs}") - foreach(module ${python_bound_modules}) - message("${python_bound_modules}") - string(REPLACE "visp_" "" clean_module_name ${module}) - - string(JSON json_config_file SET ${json_config_file} ${clean_module_name} "{}") - - set(json_header_list "[]") - set(header_count 0) - foreach(module_header ${VISP_MODULE_${module}_HEADERS}) - string(JSON json_header_list SET ${json_header_list} "${header_count}" "\"${module_header}\"") - MATH(EXPR header_count "${header_count}+1") - endforeach() - string(JSON json_config_file SET ${json_config_file} ${clean_module_name} "headers" "${json_header_list}") - #file(TOUCH "${cpp_src}") - endforeach() - message("${json_config_file}") - - + string(JSON json_config_file SET ${json_config_file} ${clean_module_name} "headers" "${json_header_list}") + #file(TOUCH "${cpp_src}") +endforeach() +file(WRITE ${json_config_file_path} "${json_config_file}") - # Step 2: Generate bindings +# Step 2: Generate bindings +# First, we install the bindings generator as an editable pip package +# Then, we call it with the configuration files as argument. The .cpp files are generated in the cmake build directory +add_custom_target( visp_python_bindings_generator_run + COMMAND ${Python_EXECUTABLE} -m pip install ${_pip_args} -v ${bindgen_package_location} + COMMAND ${Python_EXECUTABLE} -m visp_python_bindgen.generator --config "${CMAKE_CURRENT_SOURCE_DIR}/config" --build-folder ${bindings_gen_location} + BYPRODUCTS ${python_bindings_cpp_src} + DEPENDS ${python_bound_modules} +) +set(VISP_PYTHON_VERSION "${VISP_VERSION}") +# Step 3: Compile and install bindings as a python package +# First, we compile +add_subdirectory(bindings "${bindings_gen_location}") - add_custom_target( visp_python_bindings_generator_run - COMMAND ${Python_EXECUTABLE} -m pip install ${_pip_args} -v ${bindgen_package_location} - COMMAND ${Python_EXECUTABLE} -m visp_python_bindgen.generator --config "${CMAKE_CURRENT_SOURCE_DIR}/config" --build-folder ${bindings_gen_location} - BYPRODUCTS ${python_bindings_cpp_src} - DEPENDS ${python_bound_modules} - ) - add_subdirectory(bindings "${bindings_gen_location}") +# Cmake needs to be run +# add_custom_target(visp_python_bindings_compile +# COMMAND "${CMAKE_COMMAND}" -G "${CMAKE_GENERATOR}" "${bindings_package_location}" -DVISP_DIR="${VISP_BINARY_DIR}" +# COMMAND "${CMAKE_COMMAND}" --build . --parallel ${N_PROC} +# WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" +# DEPENDS visp_python_bindings_generator_run +# ) +# add_custom_target(visp_python_bindings_install +# COMMAND ${Python_EXECUTABLE} -m pip install ${_pip_args} ${bindings_package_location} +# ) - # Step 3: Compile and install bindings as a python package - # Cmake needs to be run - # add_custom_target(visp_python_bindings_compile - # COMMAND "${CMAKE_COMMAND}" -G "${CMAKE_GENERATOR}" "${bindings_package_location}" -DVISP_DIR="${VISP_BINARY_DIR}" - # COMMAND "${CMAKE_COMMAND}" --build . --parallel ${N_PROC} - # WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" - # DEPENDS visp_python_bindings_generator_run - # ) +# Step 4: Copy stubs dir and install stubs for autocompletion - # add_custom_target(visp_python_bindings_install - # COMMAND ${Python_EXECUTABLE} -m pip install ${_pip_args} ${bindings_package_location} - # ) - - # Step 4: Copy stubs dir and install stubs for autocompletion - - # Step 5: Build documentation +# Step 5: Build documentation endif() -endif() \ No newline at end of file +#todo : Run generator in an initial pass, depends on ConfigFile and vpConfig.h diff --git a/modules/python/bindings/CMakeLists.txt b/modules/python/bindings/CMakeLists.txt index af9e32bfcd..74b579c44c 100644 --- a/modules/python/bindings/CMakeLists.txt +++ b/modules/python/bindings/CMakeLists.txt @@ -1,18 +1,27 @@ -# cmake_minimum_required(VERSION 3.5) -# project(_visp) - -find_package(VISP PATHS ${VISP_BINARY_DIR} NO_DEFAULT_PATH) -find_package(pybind11 REQUIRED) +# Declare the cpp source files as explicitely generated so that pybind11_add_module does not look for them when they are not yet created set_source_files_properties(${python_bindings_cpp_src} PROPERTIES GENERATED TRUE) -#find_package(VISP REQUIRED) - pybind11_add_module(_visp THIN_LTO ${python_bindings_cpp_src}) -target_include_directories(_visp PRIVATE include) -target_include_directories(_visp PRIVATE ${VISP_INCLUDE_DIRS}) -message("${VISP_LIBRARIES}") -message("${VISP_INCLUDE_DIRS}") +# Place library in binary dir so that it doesn't pollute lib dir +# This .so file is not treated the same as the others and we shouldn't link against it when compiling in C++ +set_target_properties(_visp PROPERTIES + LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} +) + +target_include_directories(_visp PRIVATE include) # Include directory containing custom bindings +target_include_directories(_visp PRIVATE ${VISP_INCLUDE_DIRS}) target_link_libraries(_visp PRIVATE ${VISP_LIBRARIES}) add_dependencies(_visp visp_python_bindings_generator_run) + +# Setup pip install +if(Python_FOUND) + configure_file("${CMAKE_CURRENT_SOURCE_DIR}/setup.py.in" "${CMAKE_CURRENT_BINARY_DIR}/setup.py" @ONLY) + + add_custom_target( visp_python_bindings_install + COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMAKE_CURRENT_SOURCE_DIR}/visp" "${CMAKE_CURRENT_BINARY_DIR}/visp" + COMMAND ${Python_EXECUTABLE} -m pip install ${_pip_args} -v "${CMAKE_CURRENT_BINARY_DIR}" + DEPENDS _visp + ) +endif() \ No newline at end of file diff --git a/modules/python/bindings/pyproject.toml b/modules/python/bindings/pyproject.toml deleted file mode 100644 index 861c2dd65e..0000000000 --- a/modules/python/bindings/pyproject.toml +++ /dev/null @@ -1,25 +0,0 @@ -[build-system] -requires = [ - "setuptools>=42", -] -build-backend = "setuptools.build_meta" - -[tool.cibuildwheel] -test-command = "python {project}/tests/test.py" - -[tool.ruff] -extend-select = [ - "B", # flake8-bugbear - "I", # isort - "PGH", # pygrep-hooks - "RUF", # Ruff-specific - "UP", # pyupgrade -] -extend-ignore = [ - "E501", # Line too long -] -target-version = "py39" -dependencies = [ - "pcpp", - "cxxheaderparser@git+https://github.com/robotpy/cxxheaderparser#egg=master" -] \ No newline at end of file diff --git a/modules/python/bindings/setup.py b/modules/python/bindings/setup.py.in similarity index 88% rename from modules/python/bindings/setup.py rename to modules/python/bindings/setup.py.in index 3851cb22ad..84e38ac81b 100644 --- a/modules/python/bindings/setup.py +++ b/modules/python/bindings/setup.py.in @@ -11,7 +11,7 @@ from pathlib import Path package_name = 'visp' -version = '0.0.4' +version = '@VISP_PYTHON_VERSION@' package_data = {} @@ -33,11 +33,14 @@ def __len__(self): name=package_name, version=version, author="Samuel Felton", + pacakges=setuptools.find_packages(), author_email="samuel.felton@irisa.fr", description="Python wrapper for the Visual Servoing Platform", long_description="", - setup_requires=[], - ext_modules=EmptyListWithLength, + setup_requires=[ + "setuptools" + ], + ext_modules=EmptyListWithLength(), zip_safe=False, include_package_data=True, package_data=package_data, diff --git a/modules/python/bindings/visp/__init__.py b/modules/python/bindings/visp/__init__.py new file mode 100644 index 0000000000..5a1e3a156e --- /dev/null +++ b/modules/python/bindings/visp/__init__.py @@ -0,0 +1 @@ +from _visp import * From c3e1a57e54fd774983765c85972c2883ee3836f8 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Thu, 19 Oct 2023 17:10:52 +0200 Subject: [PATCH 082/169] Working on pip install procedure, some problems with importing submodules --- modules/python/bindings/include/core.hpp | 2 +- modules/python/bindings/setup.py.in | 43 ++++++++++++------------ modules/python/bindings/visp/__init__.py | 15 ++++++++- 3 files changed, 36 insertions(+), 24 deletions(-) diff --git a/modules/python/bindings/include/core.hpp b/modules/python/bindings/include/core.hpp index c05e094dc7..adac478a20 100644 --- a/modules/python/bindings/include/core.hpp +++ b/modules/python/bindings/include/core.hpp @@ -49,7 +49,7 @@ std::string shape_to_string(const std::vector &shape) { std::stringstream ss; ss << "("; - for (int i = 0; i < shape.size() - 1; ++i) { + for (int i = 0; i < int(shape.size()) - 1; ++i) { ss << shape[i] << ","; } if (shape.size() > 0) { diff --git a/modules/python/bindings/setup.py.in b/modules/python/bindings/setup.py.in index 84e38ac81b..339dc936ab 100644 --- a/modules/python/bindings/setup.py.in +++ b/modules/python/bindings/setup.py.in @@ -4,6 +4,7 @@ import subprocess import sys from pathlib import Path +import setuptools from setuptools import Extension, setup from setuptools.command.build_ext import build_ext from setuptools.command.install import install @@ -16,34 +17,32 @@ version = '@VISP_PYTHON_VERSION@' package_data = {} if os.name == 'posix': - package_data[package_name] = ['*.so'] + package_data[package_name] = ['*.so'] else: - package_data[package_name] = ['*.pyd', '*.dll'] + package_data[package_name] = ['*.pyd', '*.dll'] # This creates a list which is empty but returns a length of 1. # Should make the wheel a binary distribution and platlib compliant. class EmptyListWithLength(list): - def __len__(self): - return 1 + def __len__(self): + return 1 -# The information here can also be placed in setup.cfg - better separation of -# logic and declaration, and simpler if you include description/version in a file. setup( - name=package_name, - version=version, - author="Samuel Felton", - pacakges=setuptools.find_packages(), - author_email="samuel.felton@irisa.fr", - description="Python wrapper for the Visual Servoing Platform", - long_description="", - setup_requires=[ - "setuptools" - ], - ext_modules=EmptyListWithLength(), - zip_safe=False, - include_package_data=True, - package_data=package_data, - extras_require={"test": ["pytest>=6.0"]}, - python_requires=">=3.7", + name=package_name, + version=version, + author="Samuel Felton", + packages=setuptools.find_packages(), + author_email="samuel.felton@irisa.fr", + description="Python wrapper for the Visual Servoing Platform", + long_description="", + setup_requires=[ + "setuptools" + ], + ext_modules=EmptyListWithLength(), + zip_safe=False, + include_package_data=True, + package_data=package_data, + extras_require={"test": ["pytest>=6.0"]}, + python_requires=">=3.7", ) diff --git a/modules/python/bindings/visp/__init__.py b/modules/python/bindings/visp/__init__.py index 5a1e3a156e..3bb4730910 100644 --- a/modules/python/bindings/visp/__init__.py +++ b/modules/python/bindings/visp/__init__.py @@ -1 +1,14 @@ -from _visp import * + +from types import ModuleType +from . import _visp as bindings +from ._visp import * + +all_exports = [] + +for k in bindings.__dict__: + d = bindings.__dict__[k] + if isinstance(d, ModuleType): + all_exports.append(d) + + +__all__ = all_exports From d7abe71c507b681f48a93dc20b27ac613cb06783 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Fri, 20 Oct 2023 02:10:07 +0200 Subject: [PATCH 083/169] Some issues with importing submodules, fix constant regeneration of python targets --- modules/python/CMakeLists.txt | 28 ++++++++++-------------- modules/python/bindings/CMakeLists.txt | 7 ++++-- modules/python/bindings/visp/__init__.py | 17 ++++---------- modules/python/config/ar.json | 8 ++++++- modules/python/stubs/setup.py | 5 ----- 5 files changed, 27 insertions(+), 38 deletions(-) diff --git a/modules/python/CMakeLists.txt b/modules/python/CMakeLists.txt index cc53467677..979d905b1b 100644 --- a/modules/python/CMakeLists.txt +++ b/modules/python/CMakeLists.txt @@ -88,32 +88,26 @@ file(WRITE ${json_config_file_path} "${json_config_file}") # First, we install the bindings generator as an editable pip package # Then, we call it with the configuration files as argument. The .cpp files are generated in the cmake build directory -add_custom_target( visp_python_bindings_generator_run +# Get dependencies of the bindings generator +# We should only run the generator when the config files, the sources or the C++ modules have changed +file(GLOB config_files "${CMAKE_CURRENT_SOURCE_DIR}/config/*.json") +file(GLOB_RECURSE python_sources "${CMAKE_CURRENT_SOURCE_DIR}/generator/visp_python_bindgen/*.py") +set(pip_files "${CMAKE_CURRENT_SOURCE_DIR}/generator/pyproject.toml") + + +add_custom_command( + OUTPUT ${python_bindings_cpp_src} COMMAND ${Python_EXECUTABLE} -m pip install ${_pip_args} -v ${bindgen_package_location} COMMAND ${Python_EXECUTABLE} -m visp_python_bindgen.generator --config "${CMAKE_CURRENT_SOURCE_DIR}/config" --build-folder ${bindings_gen_location} - BYPRODUCTS ${python_bindings_cpp_src} - DEPENDS ${python_bound_modules} + DEPENDS ${python_bound_modules} ${json_config_file_path} ${config_files} ${python_sources} ${pip_files} ) +add_custom_target(visp_python_bindings_generator_run DEPENDS ${python_bindings_cpp_src}) set(VISP_PYTHON_VERSION "${VISP_VERSION}") # Step 3: Compile and install bindings as a python package # First, we compile add_subdirectory(bindings "${bindings_gen_location}") - - -# Cmake needs to be run -# add_custom_target(visp_python_bindings_compile -# COMMAND "${CMAKE_COMMAND}" -G "${CMAKE_GENERATOR}" "${bindings_package_location}" -DVISP_DIR="${VISP_BINARY_DIR}" -# COMMAND "${CMAKE_COMMAND}" --build . --parallel ${N_PROC} -# WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" -# DEPENDS visp_python_bindings_generator_run -# ) - -# add_custom_target(visp_python_bindings_install -# COMMAND ${Python_EXECUTABLE} -m pip install ${_pip_args} ${bindings_package_location} -# ) - # Step 4: Copy stubs dir and install stubs for autocompletion # Step 5: Build documentation diff --git a/modules/python/bindings/CMakeLists.txt b/modules/python/bindings/CMakeLists.txt index 74b579c44c..7dc6e90925 100644 --- a/modules/python/bindings/CMakeLists.txt +++ b/modules/python/bindings/CMakeLists.txt @@ -4,10 +4,13 @@ set_source_files_properties(${python_bindings_cpp_src} PROPERTIES GENERATED TRUE pybind11_add_module(_visp THIN_LTO ${python_bindings_cpp_src}) -# Place library in binary dir so that it doesn't pollute lib dir +# Place library in binary/visp dir so that it doesn't pollute lib dir # This .so file is not treated the same as the others and we shouldn't link against it when compiling in C++ +# when installing the python module, pip will look into the "visp" subfolder for .so files to copy into the site-packages + +file(MAKE_DIRECTORY "${bindings_gen_location}/src") set_target_properties(_visp PROPERTIES - LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/visp" ) target_include_directories(_visp PRIVATE include) # Include directory containing custom bindings diff --git a/modules/python/bindings/visp/__init__.py b/modules/python/bindings/visp/__init__.py index 3bb4730910..4733fc5e63 100644 --- a/modules/python/bindings/visp/__init__.py +++ b/modules/python/bindings/visp/__init__.py @@ -1,14 +1,5 @@ -from types import ModuleType -from . import _visp as bindings -from ._visp import * - -all_exports = [] - -for k in bindings.__dict__: - d = bindings.__dict__[k] - if isinstance(d, ModuleType): - all_exports.append(d) - - -__all__ = all_exports +import sys +import os +sys.path.append(os.path.dirname(__file__)) +print(sys.path) diff --git a/modules/python/config/ar.json b/modules/python/config/ar.json index 871b47c723..9b6b904d82 100644 --- a/modules/python/config/ar.json +++ b/modules/python/config/ar.json @@ -1 +1,7 @@ -{"ignored_headers": [], "ignored_classes": [], "user_defined_headers": [], "classes": {}, "enums": {}} \ No newline at end of file +{ + "ignored_headers": [], + "ignored_classes": [], + "user_defined_headers": [], + "classes": {}, + "enums": {} +} \ No newline at end of file diff --git a/modules/python/stubs/setup.py b/modules/python/stubs/setup.py index 78a81f9cf0..9c8a1019e7 100644 --- a/modules/python/stubs/setup.py +++ b/modules/python/stubs/setup.py @@ -5,11 +5,6 @@ import subprocess import sys - -def find_stubs(path: Path): - print([str(p.relative_to('.')) for p in path.rglob('*.pyi')]) - return [str(p.relative_to('.')) for p in path.rglob('*.pyi')] - class CustomInstall(install): def run(self): subprocess.run(['pybind11-stubgen', '-o', '.', '--ignore-all-errors', 'visp'], check=True) From 9bbd8ed361746ed69642f15ad87c78e7a6d7a271 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Mon, 23 Oct 2023 12:39:46 +0200 Subject: [PATCH 084/169] Correct stub generation and module import, using includes from the generated json file --- .../visp3/detection/vpDetectorDNNOpenCV.h | 12 ++--- modules/python/CMakeLists.txt | 7 +-- modules/python/bindings/CMakeLists.txt | 3 +- modules/python/bindings/setup.py.in | 6 +-- modules/python/bindings/visp/__init__.py | 16 +++++-- modules/python/bindings/visp/bindings.py | 1 + .../visp_python_bindgen/generator.py | 15 ++++--- .../visp_python_bindgen/generator_config.py | 13 ++++++ .../generator/visp_python_bindgen/header.py | 5 --- .../generator/visp_python_bindgen/methods.py | 3 +- modules/python/stubs/CMakeLists.txt | 10 +++++ modules/python/stubs/setup.py | 28 ------------ modules/python/stubs/setup.py.in | 44 +++++++++++++++++++ 13 files changed, 107 insertions(+), 56 deletions(-) create mode 100644 modules/python/bindings/visp/bindings.py create mode 100644 modules/python/stubs/CMakeLists.txt delete mode 100644 modules/python/stubs/setup.py create mode 100644 modules/python/stubs/setup.py.in diff --git a/modules/detection/include/visp3/detection/vpDetectorDNNOpenCV.h b/modules/detection/include/visp3/detection/vpDetectorDNNOpenCV.h index e0010b5367..4a21c1687b 100644 --- a/modules/detection/include/visp3/detection/vpDetectorDNNOpenCV.h +++ b/modules/detection/include/visp3/detection/vpDetectorDNNOpenCV.h @@ -199,7 +199,7 @@ class VISP_EXPORT vpDetectorDNNOpenCV * \param j The JSON object, resulting from the parsing of a JSON file. * \param config The configuration of the network, that will be initialized from the JSON data. */ - inline friend void from_json(const json &j, NetConfig &config) + friend inline void from_json(const json &j, NetConfig &config) { config.m_confThreshold = j.value("confidenceThreshold", config.m_confThreshold); if (config.m_confThreshold <= 0) { @@ -239,7 +239,7 @@ class VISP_EXPORT vpDetectorDNNOpenCV * \param j A JSON parser object. * \param config The vpDetectorDNNOpenCV::NetConfig that must be parsed into JSON format. */ - inline friend void to_json(json &j, const NetConfig &config) + friend inline void to_json(json &j, const NetConfig &config) { std::pair resolution = { config.m_inputSize.width, config.m_inputSize.height }; std::vector v_mean = { config.m_mean[0], config.m_mean[1], config.m_mean[2] }; @@ -438,7 +438,7 @@ class VISP_EXPORT vpDetectorDNNOpenCV return text; } - inline friend std::ostream &operator<<(std::ostream &os, const NetConfig &config) + friend inline std::ostream &operator<<(std::ostream &os, const NetConfig &config) { os << config.toString(); return os; @@ -513,7 +513,7 @@ class VISP_EXPORT vpDetectorDNNOpenCV * \param j The JSON object, resulting from the parsing of a JSON file. * \param network The network, that will be initialized from the JSON data. */ - inline friend void from_json(const json &j, vpDetectorDNNOpenCV &network) + friend inline void from_json(const json &j, vpDetectorDNNOpenCV &network) { network.m_netConfig = j.value("networkSettings", network.m_netConfig); } @@ -524,7 +524,7 @@ class VISP_EXPORT vpDetectorDNNOpenCV * \param j The JSON parser. * \param network The network we want to parse the configuration. */ - inline friend void to_json(json &j, const vpDetectorDNNOpenCV &network) + friend inline void to_json(json &j, const vpDetectorDNNOpenCV &network) { j = json { {"networkSettings", network.m_netConfig} @@ -532,7 +532,7 @@ class VISP_EXPORT vpDetectorDNNOpenCV } #endif - inline friend std::ostream &operator<<(std::ostream &os, const vpDetectorDNNOpenCV &network) + friend inline std::ostream &operator<<(std::ostream &os, const vpDetectorDNNOpenCV &network) { os << network.m_netConfig; return os; diff --git a/modules/python/CMakeLists.txt b/modules/python/CMakeLists.txt index 979d905b1b..72bbaf2f21 100644 --- a/modules/python/CMakeLists.txt +++ b/modules/python/CMakeLists.txt @@ -98,17 +98,18 @@ set(pip_files "${CMAKE_CURRENT_SOURCE_DIR}/generator/pyproject.toml") add_custom_command( OUTPUT ${python_bindings_cpp_src} COMMAND ${Python_EXECUTABLE} -m pip install ${_pip_args} -v ${bindgen_package_location} - COMMAND ${Python_EXECUTABLE} -m visp_python_bindgen.generator --config "${CMAKE_CURRENT_SOURCE_DIR}/config" --build-folder ${bindings_gen_location} + COMMAND ${Python_EXECUTABLE} -m visp_python_bindgen.generator --config "${CMAKE_CURRENT_SOURCE_DIR}/config" --build-folder ${bindings_gen_location} --main-config "${json_config_file_path}" DEPENDS ${python_bound_modules} ${json_config_file_path} ${config_files} ${python_sources} ${pip_files} ) add_custom_target(visp_python_bindings_generator_run DEPENDS ${python_bindings_cpp_src}) set(VISP_PYTHON_VERSION "${VISP_VERSION}") # Step 3: Compile and install bindings as a python package -# First, we compile -add_subdirectory(bindings "${bindings_gen_location}") +add_subdirectory(bindings) + # Step 4: Copy stubs dir and install stubs for autocompletion +add_subdirectory(stubs) # Step 5: Build documentation diff --git a/modules/python/bindings/CMakeLists.txt b/modules/python/bindings/CMakeLists.txt index 7dc6e90925..ebbdfb4353 100644 --- a/modules/python/bindings/CMakeLists.txt +++ b/modules/python/bindings/CMakeLists.txt @@ -10,7 +10,7 @@ pybind11_add_module(_visp THIN_LTO ${python_bindings_cpp_src}) file(MAKE_DIRECTORY "${bindings_gen_location}/src") set_target_properties(_visp PROPERTIES - LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/visp" + LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" ) target_include_directories(_visp PRIVATE include) # Include directory containing custom bindings @@ -21,7 +21,6 @@ add_dependencies(_visp visp_python_bindings_generator_run) # Setup pip install if(Python_FOUND) configure_file("${CMAKE_CURRENT_SOURCE_DIR}/setup.py.in" "${CMAKE_CURRENT_BINARY_DIR}/setup.py" @ONLY) - add_custom_target( visp_python_bindings_install COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMAKE_CURRENT_SOURCE_DIR}/visp" "${CMAKE_CURRENT_BINARY_DIR}/visp" COMMAND ${Python_EXECUTABLE} -m pip install ${_pip_args} -v "${CMAKE_CURRENT_BINARY_DIR}" diff --git a/modules/python/bindings/setup.py.in b/modules/python/bindings/setup.py.in index 339dc936ab..84c45283c2 100644 --- a/modules/python/bindings/setup.py.in +++ b/modules/python/bindings/setup.py.in @@ -17,9 +17,9 @@ version = '@VISP_PYTHON_VERSION@' package_data = {} if os.name == 'posix': - package_data[package_name] = ['*.so'] + package_data[''] = ['*.so'] else: - package_data[package_name] = ['*.pyd', '*.dll'] + package_data[''] = ['*.pyd', '*.dll'] # This creates a list which is empty but returns a length of 1. @@ -32,7 +32,7 @@ setup( name=package_name, version=version, author="Samuel Felton", - packages=setuptools.find_packages(), + packages=['visp'], author_email="samuel.felton@irisa.fr", description="Python wrapper for the Visual Servoing Platform", long_description="", diff --git a/modules/python/bindings/visp/__init__.py b/modules/python/bindings/visp/__init__.py index 4733fc5e63..2488a7b9ac 100644 --- a/modules/python/bindings/visp/__init__.py +++ b/modules/python/bindings/visp/__init__.py @@ -1,5 +1,15 @@ import sys -import os -sys.path.append(os.path.dirname(__file__)) -print(sys.path) +# import os +# sys.path.append(os.path.dirname(__file__)) +# print(sys.path) + + +from .bindings import * +import _visp + +# Fake module names +for k in _visp.__dict__: + from types import ModuleType + if isinstance(_visp.__dict__[k], ModuleType): + sys.modules[f'{__name__}.{k}'] = f'{__name__}._visp.{k}' diff --git a/modules/python/bindings/visp/bindings.py b/modules/python/bindings/visp/bindings.py new file mode 100644 index 0000000000..fd7a58924b --- /dev/null +++ b/modules/python/bindings/visp/bindings.py @@ -0,0 +1 @@ +from _visp import * \ No newline at end of file diff --git a/modules/python/generator/visp_python_bindgen/generator.py b/modules/python/generator/visp_python_bindgen/generator.py index 036a70dd38..cf6a240fe1 100644 --- a/modules/python/generator/visp_python_bindgen/generator.py +++ b/modules/python/generator/visp_python_bindgen/generator.py @@ -6,7 +6,7 @@ from visp_python_bindgen.header import * from visp_python_bindgen.submodule import * - +from visp_python_bindgen.generator_config import GeneratorConfig def header_preprocess(header: HeaderFile): ''' @@ -97,19 +97,24 @@ def generate_module(generate_path: Path, config_path: Path) -> None: main_file.write(format_str) def main(): - parser = argparse.ArgumentParser('Python Bindings generator for ViSP') - parser.add_argument('--config', type=str, required=True) - parser.add_argument('--build-folder', type=str, required=True) + parser = argparse.ArgumentParser(description='Python Bindings generator for ViSP') + parser.add_argument('--config', type=str, required=True, help='Path to the folder containing the module configurations (one .json file per module)') + parser.add_argument('--build-folder', type=str, required=True, help='Where to save the generated binding code') + parser.add_argument('--main-config', type=str, required=True, help='Path to the .json file detailing which modules to build, include directories etc.') + args = parser.parse_args() generation_path = Path(args.build_folder) - assert generation_path.exists(), f'Path to where to generate bindings does not exist!Path: {generation_path}' + assert generation_path.exists(), f'Path to where to generate bindings does not exist! Path: {generation_path}' generation_path = generation_path / 'src' generation_path.mkdir(exist_ok=True) config_path = Path(args.config) assert config_path.exists(), f'Path to the folder containing the configuration files does not exist! Path: {config_path}' + main_config_path = Path(args.main_config) + assert main_config_path.exists(), f'Path to the main JSON configuration is invalid! Path: {main_config_path}' + GeneratorConfig.update_from_main_config_file(main_config_path) generate_module(generation_path, config_path) if __name__ == '__main__': diff --git a/modules/python/generator/visp_python_bindgen/generator_config.py b/modules/python/generator/visp_python_bindgen/generator_config.py index ff2051c2d4..222ec001f7 100644 --- a/modules/python/generator/visp_python_bindgen/generator_config.py +++ b/modules/python/generator/visp_python_bindgen/generator_config.py @@ -1,7 +1,9 @@ from typing import Dict, Final, List, Optional import re +from pathlib import Path from dataclasses import dataclass +import json @dataclass class PreprocessorConfig(object): @@ -12,6 +14,7 @@ class PreprocessorConfig(object): defines: Dict[str, str] # Mapping from a #define to its value (#define A 1 is equal to a pair "A": "1") never_defined: List[str] # List of macros that should never be defined, even if they are defined in other included headers + include_directories: List[str] passthrough_includes_regex: str # Regex to see which header should be included (expanded and put in the resulting pcpp output) or ignored line_directive: Optional[str] # prefix for Warning/logging emitted by pcpp. If none, no warning other_args: List[str] @@ -22,6 +25,8 @@ def to_pcpp_args_list(self) -> List[str]: args += ['-D', f'{k}={v}'] if v is not None else ['-D', k] for v in self.never_defined: args += ['-N', v] + for v in self.include_directories: + args += ['-I', v] args += self.other_args args.extend(['--passthru-includes', self.passthrough_includes_regex]) if self.line_directive is not None: @@ -79,6 +84,7 @@ class GeneratorConfig(object): never_defined=[ 'VISP_BUILD_DEPRECATED_FUNCTIONS' # Do not bind deprecated functions ], + include_directories=[], # Populate through the main configuration file passthrough_includes_regex="^((?!vpConfig\.h|opencv_modules\.hpp|visp_modules\.h).)*$", # Only expand vpConfig, opencv_modules etc. line_directive=None, other_args=["--passthru-unfound-includes", "--passthru-comments"] @@ -105,3 +111,10 @@ def is_forbidden_default_argument_type(type: str) -> bool: @staticmethod def is_forbidden_function_name(name: str) -> bool: return GeneratorConfig._matches_regex_in_list(name, FORBIDDEN_FUNCTION_NAMES_REGEXS) + + @staticmethod + def update_from_main_config_file(path: Path) -> None: + assert path.exists() + with open(path, 'r') as main_config_file: + main_config = json.load(main_config_file) + GeneratorConfig.pcpp_config.include_directories = main_config['include_dirs'] \ No newline at end of file diff --git a/modules/python/generator/visp_python_bindgen/header.py b/modules/python/generator/visp_python_bindgen/header.py index 88aea8e8a0..58a283c216 100644 --- a/modules/python/generator/visp_python_bindgen/header.py +++ b/modules/python/generator/visp_python_bindgen/header.py @@ -93,11 +93,6 @@ def run_preprocessor(self): # TODO: run without generating a new file tmp_dir.mkdir(exist_ok=True) tmp_file_path = tmp_dir / self.path.name argv = [''] + GeneratorConfig.pcpp_config.to_pcpp_args_list() - argv += [ - '-I', '/home/sfelton/software/visp_build/include', - '-I', '/usr/local/include', - '-I', '/usr/include', - ] argv += ['-o', f'{tmp_file_path}', str(self.path.absolute())] pcpp.CmdPreprocessor(argv) diff --git a/modules/python/generator/visp_python_bindgen/methods.py b/modules/python/generator/visp_python_bindgen/methods.py index 603ee8930f..9f55d206d7 100644 --- a/modules/python/generator/visp_python_bindgen/methods.py +++ b/modules/python/generator/visp_python_bindgen/methods.py @@ -178,7 +178,8 @@ def make_arg(name: str) -> str: default_value = f'static_cast<{full_typename}>(nullptr)' default_value_rep = 'None' else: - default_value_rep = default_value.strip('"') # To handle default char* and std::string args + default_value_rep = default_value.strip('"') # To handle default char* and raw std::string args + default_value_rep = default_value_rep.replace('"', '\"') # Escape inner quotes in std::string args like std::string("hello"). This would break parsing at compile time default_value = env_mapping.get(default_value) or default_value py_args.append(f'py::arg_v("{parameter.name}", {default_value}, "{default_value_rep}")') diff --git a/modules/python/stubs/CMakeLists.txt b/modules/python/stubs/CMakeLists.txt new file mode 100644 index 0000000000..2e857e009c --- /dev/null +++ b/modules/python/stubs/CMakeLists.txt @@ -0,0 +1,10 @@ + +configure_file("${CMAKE_CURRENT_SOURCE_DIR}/setup.py.in" "${CMAKE_CURRENT_BINARY_DIR}/setup.py" @ONLY) +# MANIFEST file is not really configured by CMAKE, but doing it like this ensures that the target will be regenerated if MANIFEST.in is modified +configure_file("${CMAKE_CURRENT_SOURCE_DIR}/MANIFEST.in" "${CMAKE_CURRENT_BINARY_DIR}/MANIFEST.in" COPYONLY) + + +add_custom_target( visp_python_stubs + COMMAND ${Python_EXECUTABLE} -m pip install ${_pip_args} -v "${CMAKE_CURRENT_BINARY_DIR}" + DEPENDS visp_python_bindings_install +) \ No newline at end of file diff --git a/modules/python/stubs/setup.py b/modules/python/stubs/setup.py deleted file mode 100644 index 9c8a1019e7..0000000000 --- a/modules/python/stubs/setup.py +++ /dev/null @@ -1,28 +0,0 @@ -from pathlib import Path -from setuptools import setup -from setuptools.command.install import install - -import subprocess -import sys - -class CustomInstall(install): - def run(self): - subprocess.run(['pybind11-stubgen', '-o', '.', '--ignore-all-errors', 'visp'], check=True) - install.run(self) - -setup( - name='visp-stubs', - version='0.0.4', - author="Samuel Felton", - author_email="samuel.felton@irisa.fr", - description="Python stubs for the ViSP wrapper", - zip_safe=False, - include_package_data=True, - # package_data={'visp-stubs': find_stubs(path=Path('.'))}, - setup_requires=[ - "pybind11-stubgen>=2.1", - "visp" - ], - cmdclass={'install': CustomInstall}, - python_requires=">=3.7", -) \ No newline at end of file diff --git a/modules/python/stubs/setup.py.in b/modules/python/stubs/setup.py.in new file mode 100644 index 0000000000..ec038a58fb --- /dev/null +++ b/modules/python/stubs/setup.py.in @@ -0,0 +1,44 @@ +from pathlib import Path +from shutil import copy +from setuptools import setup +from setuptools.command.install import install + +import subprocess +import sys + +class CustomInstall(install): + def run(self): + # Find the pybind11-stubgen like this: If the base env has pybind11-stubgen it may take precedence in the path + # It would thus not be able to see the _visp is package + bin_folder = Path(sys.executable).parent + stubgen_entry_point = bin_folder / 'pybind11-stubgen' + assert stubgen_entry_point.exists() + + subprocess.run([str(stubgen_entry_point), '-o', '.', '--ignore-all-errors', '_visp'], check=True) + + # Generate stubs for the bindings (C++ side) and mock it so that they appear in the true 'visp' package + p = Path('./_visp') + target_path = Path('./visp') + target_path.mkdir(exist_ok=True) + for pyi_file in p.iterdir(): + if pyi_file.name.endswith('.pyi'): + copy(pyi_file, target_path / pyi_file.name) # Copy replace old files + + install.run(self) + +setup( + name='visp-stubs', + version='@VISP_PYTHON_VERSION@', + packages=['visp'], + author="Samuel Felton", + author_email="samuel.felton@irisa.fr", + description="Python stubs for the ViSP wrapper", + zip_safe=False, + include_package_data=True, + setup_requires=[ + "pybind11-stubgen>=2.1", + "visp" + ], + cmdclass={'install': CustomInstall}, + python_requires=">=3.7", +) \ No newline at end of file From b6569e04610a9540b8b5a24c34eb6ea8123f0984 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Mon, 23 Oct 2023 17:58:52 +0200 Subject: [PATCH 085/169] reworking preprocessing --- .../visp_python_bindgen/generator_config.py | 7 +- .../generator/visp_python_bindgen/header.py | 31 +++- .../visp_python_bindgen/preprocessor.py | 172 ++++++++++++++++++ modules/python/stubs/CMakeLists.txt | 1 + modules/python/stubs/setup.py.in | 2 +- 5 files changed, 205 insertions(+), 8 deletions(-) create mode 100644 modules/python/generator/visp_python_bindgen/preprocessor.py diff --git a/modules/python/generator/visp_python_bindgen/generator_config.py b/modules/python/generator/visp_python_bindgen/generator_config.py index 222ec001f7..47fbab81b9 100644 --- a/modules/python/generator/visp_python_bindgen/generator_config.py +++ b/modules/python/generator/visp_python_bindgen/generator_config.py @@ -79,13 +79,14 @@ class GeneratorConfig(object): 'vp_deprecated': '', # remove symbol as it messes up the cxxheaderparsing 'DOXYGEN_SHOULD_SKIP_THIS': None, # Do not generate methods that do not appear in public api doc 'NLOHMANN_JSON_SERIALIZE_ENUM(a,...)': 'void ignored() {}', # Remove json enum serialization as it cnanot correctly be parsed - '__cplusplus' : None # To silence OpenCV warnings + '__cplusplus' : '201103L' # To silence OpenCV warnings }, never_defined=[ - 'VISP_BUILD_DEPRECATED_FUNCTIONS' # Do not bind deprecated functions + 'VISP_BUILD_DEPRECATED_FUNCTIONS', # Do not bind deprecated functions + 'VISP_RUBIK_REGULAR_FONT_RESOURCES' ], include_directories=[], # Populate through the main configuration file - passthrough_includes_regex="^((?!vpConfig\.h|opencv_modules\.hpp|visp_modules\.h).)*$", # Only expand vpConfig, opencv_modules etc. + passthrough_includes_regex="^.*$", # Never output the result of other includes. line_directive=None, other_args=["--passthru-unfound-includes", "--passthru-comments"] ) diff --git a/modules/python/generator/visp_python_bindgen/header.py b/modules/python/generator/visp_python_bindgen/header.py index 58a283c216..265ef1e4a4 100644 --- a/modules/python/generator/visp_python_bindgen/header.py +++ b/modules/python/generator/visp_python_bindgen/header.py @@ -91,19 +91,42 @@ def preprocess(self) -> None: def run_preprocessor(self): # TODO: run without generating a new file tmp_dir = self.submodule.submodule_file_path.parent / "tmp" tmp_dir.mkdir(exist_ok=True) - tmp_file_path = tmp_dir / self.path.name + tmp_file_path = tmp_dir / (self.path.name + '.in') + preprocessor_output_path = tmp_dir / (self.path.name) + tmp_file_content = [] + forced_includes = [ + 'visp3/core/vpConfig.h', + 'opencv2/opencv_modules.hpp' + ] + for include in forced_includes: + tmp_file_content.append(f'#include <{include}>') + + # Remove all includes: we only include configuration headers, defined above + with open(self.path.absolute(), 'r') as input_header_file: + include_regex = '#include\s*<(.*)>' + for line in input_header_file.readlines(): + matches = re.search(include_regex, line) + if matches is None: # Include line if its not an include + tmp_file_content.append(line) + + with open(tmp_file_path.absolute(), 'w') as tmp_file: + tmp_file.write('\n'.join(tmp_file_content)) + tmp_file.flush() + + argv = [''] + GeneratorConfig.pcpp_config.to_pcpp_args_list() - argv += ['-o', f'{tmp_file_path}', str(self.path.absolute())] + argv += ['-o', f'{preprocessor_output_path}', str(tmp_file_path.absolute())] pcpp.CmdPreprocessor(argv) preprocessed_header_content = None - with open(tmp_file_path, 'r') as header_file: + + # Remove all #defines that could have been left by the preprocessor + with open(preprocessor_output_path, 'r') as header_file: preprocessed_header_lines = [] for line in header_file.readlines(): if not line.startswith('#define'): preprocessed_header_lines.append(line) preprocessed_header_content = '\n'.join(preprocessed_header_lines) - preprocessed_header_content = preprocessed_header_content.replace('#include<', '#include <') # Bug in cpp header parser return preprocessed_header_content diff --git a/modules/python/generator/visp_python_bindgen/preprocessor.py b/modules/python/generator/visp_python_bindgen/preprocessor.py new file mode 100644 index 0000000000..532ba21945 --- /dev/null +++ b/modules/python/generator/visp_python_bindgen/preprocessor.py @@ -0,0 +1,172 @@ + +# ''' +# Preprocessor, derived from the command line preprocesor provided at https://github.com/ned14/pcpp/blob/master/pcpp/pcmd.py + +# ''' +# from __future__ import generators, print_function, absolute_import, division + +# import sys, argparse, traceback, os, copy, io, re +# from pcpp.preprocessor import Preprocessor, OutputDirective, Action +# from visp_python_bindgen.generator_config import PreprocessorConfig + + + +# class CmdPreprocessor(Preprocessor): +# def __init__(self, config: PreprocessorConfig, input: str): +# if len(argv) < 2: +# argv = [argv[0], '--help'] +# argp = argparse.ArgumentParser(prog='pcpp', +# description= +# '''A pure universal Python C (pre-)preprocessor implementation very useful for +# pre-preprocessing header only C++ libraries into single file includes and +# other such build or packaging stage malarky.''', +# epilog= +# '''Note that so pcpp can stand in for other preprocessor tooling, it +# ignores any arguments it does not understand.''') +# argp.add_argument('-o', dest = 'output', metavar = 'path', type = argparse.FileType('wt'), default=sys.stdout, nargs = '?', help = 'Output to a file instead of stdout') +# argp.add_argument('-D', dest = 'defines', metavar = 'macro[=val]', nargs = 1, action = 'append', help = 'Predefine name as a macro [with value]') +# argp.add_argument('-U', dest = 'undefines', metavar = 'macro', nargs = 1, action = 'append', help = 'Pre-undefine name as a macro') +# argp.add_argument('-N', dest = 'nevers', metavar = 'macro', nargs = 1, action = 'append', help = 'Never define name as a macro, even if defined during the preprocessing.') +# argp.add_argument('-I', dest = 'includes', metavar = 'path', nargs = 1, action = 'append', help = "Path to search for unfound #include's") +# #argp.add_argument('--passthru', dest = 'passthru', action = 'store_true', help = 'Pass through everything unexecuted except for #include and include guards (which need to be the first thing in an include file') +# argp.add_argument('--passthru-defines', dest = 'passthru_defines', action = 'store_true', help = 'Pass through but still execute #defines and #undefs if not always removed by preprocessor logic') +# argp.add_argument('--passthru-unfound-includes', dest = 'passthru_unfound_includes', action = 'store_true', help = 'Pass through #includes not found without execution') +# argp.add_argument('--passthru-unknown-exprs', dest = 'passthru_undefined_exprs', action = 'store_true', help = 'Unknown macros in expressions cause preprocessor logic to be passed through instead of executed by treating unknown macros as 0L') +# argp.add_argument('--passthru-comments', dest = 'passthru_comments', action = 'store_true', help = 'Pass through comments unmodified') +# argp.add_argument('--passthru-magic-macros', dest = 'passthru_magic_macros', action = 'store_true', help = 'Pass through double underscore magic macros unmodified') +# argp.add_argument('--passthru-includes', dest = 'passthru_includes', metavar = '', default = None, nargs = 1, help = "Regular expression for which #includes to not expand. #includes, if found, are always executed") +# argp.add_argument('--line-directive', dest = 'line_directive', metavar = 'form', default = '#line', nargs = '?', help = "Form of line directive to use, defaults to #line, specify nothing to disable output of line directives") +# args = argp.parse_known_args(argv[1:]) +# #print(args) +# for arg in args[1]: +# print("NOTE: Argument %s not known, ignoring!" % arg, file = sys.stderr) + +# self.args = args[0] +# super(CmdPreprocessor, self).__init__() + +# # Override Preprocessor instance variables +# self.define("__PCPP_ALWAYS_FALSE__ 0") +# self.define("__PCPP_ALWAYS_TRUE__ 1") + +# self.auto_pragma_once_enabled = True +# self.line_directive = config.line_directive +# if self.line_directive is not None and self.line_directive.lower() in ('nothing', 'none', ''): +# self.line_directive = None +# self.passthru_includes = re.compile(config.passthrough_includes_regex) +# self.compress = 0 +# # Pass through magic macros +# if False: +# self.undef('__DATE__') +# self.undef('__TIME__') +# self.expand_linemacro = False +# self.expand_filemacro = False +# self.expand_countermacro = False + +# # My own instance variables +# self.bypass_ifpassthru = False +# self.potential_include_guard = None + + +# for d in config.defines: +# if '=' not in d: +# d += '=1' +# d = d.replace('=', ' ', 1) +# self.define(d) +# # for d in config.undefines: +# # self.undef(d) +# self.nevers = config.never_defined +# if self.args.nevers: +# self.args.nevers = [x[0] for x in self.args.nevers] + +# for include in config.include_directories: +# self.add_path(include) + + +# try: +# if len(self.args.inputs) == 1: +# self.parse(self.args.inputs[0]) +# else: +# input = '' +# for i in self.args.inputs: +# input += '#include "' + i.name + '"\n' +# self.parse(input) +# self.write(self.args.output) +# except: +# print(traceback.print_exc(10), file = sys.stderr) +# print("\nINTERNAL PREPROCESSOR ERROR AT AROUND %s:%d, FATALLY EXITING NOW\n" +# % (self.lastdirective.source, self.lastdirective.lineno), file = sys.stderr) +# sys.exit(-99) +# finally: +# for i in self.args.inputs: +# i.close() +# if self.args.output != sys.stdout: +# self.args.output.close() + + + +# def on_include_not_found(self,is_malformed,is_system_include,curdir,includepath): +# if self.args.passthru_unfound_includes: +# raise OutputDirective(Action.IgnoreAndPassThrough) +# return super(CmdPreprocessor, self).on_include_not_found(is_malformed,is_system_include,curdir,includepath) + +# def on_unknown_macro_in_defined_expr(self,tok): +# if self.args.undefines: +# if tok.value in self.args.undefines: +# return False +# if self.args.passthru_undefined_exprs: +# return None # Pass through as expanded as possible +# return super(CmdPreprocessor, self).on_unknown_macro_in_defined_expr(tok) + +# def on_unknown_macro_in_expr(self,ident): +# if self.args.undefines: +# if ident in self.args.undefines: +# return super(CmdPreprocessor, self).on_unknown_macro_in_expr(ident) +# if self.args.passthru_undefined_exprs: +# return None # Pass through as expanded as possible +# return super(CmdPreprocessor, self).on_unknown_macro_in_expr(ident) + +# def on_unknown_macro_function_in_expr(self,ident): +# if self.args.undefines: +# if ident in self.args.undefines: +# return super(CmdPreprocessor, self).on_unknown_macro_function_in_expr(ident) +# if self.args.passthru_undefined_exprs: +# return None # Pass through as expanded as possible +# return super(CmdPreprocessor, self).on_unknown_macro_function_in_expr(ident) + +# def on_directive_handle(self,directive,toks,ifpassthru,precedingtoks): +# if ifpassthru: +# if directive.value == 'if' or directive.value == 'elif' or directive == 'else' or directive.value == 'endif': +# self.bypass_ifpassthru = len([tok for tok in toks if tok.value == '__PCPP_ALWAYS_FALSE__' or tok.value == '__PCPP_ALWAYS_TRUE__']) > 0 +# if not self.bypass_ifpassthru and (directive.value == 'define' or directive.value == 'undef'): +# if toks[0].value != self.potential_include_guard: +# raise OutputDirective(Action.IgnoreAndPassThrough) # Don't execute anything with effects when inside an #if expr with undefined macro +# if (directive.value == 'define' or directive.value == 'undef') and self.args.nevers: +# if toks[0].value in self.args.nevers: +# raise OutputDirective(Action.IgnoreAndPassThrough) +# if self.args.passthru_defines: +# super(CmdPreprocessor, self).on_directive_handle(directive,toks,ifpassthru,precedingtoks) +# return None # Pass through where possible +# return super(CmdPreprocessor, self).on_directive_handle(directive,toks,ifpassthru,precedingtoks) + +# def on_directive_unknown(self,directive,toks,ifpassthru,precedingtoks): +# if ifpassthru: +# return None # Pass through +# return super(CmdPreprocessor, self).on_directive_unknown(directive,toks,ifpassthru,precedingtoks) + +# def on_potential_include_guard(self,macro): +# self.potential_include_guard = macro +# return super(CmdPreprocessor, self).on_potential_include_guard(macro) + +# def on_comment(self,tok): +# if self.args.passthru_comments: +# return True # Pass through +# return super(CmdPreprocessor, self).on_comment(tok) + +# def main(argv=None): +# if argv is None: +# argv = sys.argv +# p = CmdPreprocessor(argv) +# return p.return_code + +# if __name__ == "__main__": +# sys.exit(main(sys.argv)) diff --git a/modules/python/stubs/CMakeLists.txt b/modules/python/stubs/CMakeLists.txt index 2e857e009c..f87add5b55 100644 --- a/modules/python/stubs/CMakeLists.txt +++ b/modules/python/stubs/CMakeLists.txt @@ -5,6 +5,7 @@ configure_file("${CMAKE_CURRENT_SOURCE_DIR}/MANIFEST.in" "${CMAKE_CURRENT_BINARY add_custom_target( visp_python_stubs + COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_CURRENT_BINARY_DIR}/visp" COMMAND ${Python_EXECUTABLE} -m pip install ${_pip_args} -v "${CMAKE_CURRENT_BINARY_DIR}" DEPENDS visp_python_bindings_install ) \ No newline at end of file diff --git a/modules/python/stubs/setup.py.in b/modules/python/stubs/setup.py.in index ec038a58fb..3ed51ec9fb 100644 --- a/modules/python/stubs/setup.py.in +++ b/modules/python/stubs/setup.py.in @@ -37,7 +37,7 @@ setup( include_package_data=True, setup_requires=[ "pybind11-stubgen>=2.1", - "visp" + #"visp" ], cmdclass={'install': CustomInstall}, python_requires=">=3.7", From e36521bf8c2a656daac16bd6d8739b53eb0db9aa Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Tue, 24 Oct 2023 01:55:07 +0200 Subject: [PATCH 086/169] reworking stubs package, investigating visp python package not being uninstallable --- modules/python/bindings/CMakeLists.txt | 2 +- modules/python/bindings/setup.py.in | 4 +++- modules/python/bindings/visp/py.typed | 0 .../python/generator/visp_python_bindgen/generator.py | 9 ++++++++- .../generator/visp_python_bindgen/generator_config.py | 7 +++++-- modules/python/generator/visp_python_bindgen/header.py | 8 ++++---- modules/python/stubs/CMakeLists.txt | 6 ++++-- modules/python/stubs/MANIFEST.in | 1 - modules/python/stubs/setup.py.in | 9 ++++++--- 9 files changed, 31 insertions(+), 15 deletions(-) create mode 100644 modules/python/bindings/visp/py.typed delete mode 100644 modules/python/stubs/MANIFEST.in diff --git a/modules/python/bindings/CMakeLists.txt b/modules/python/bindings/CMakeLists.txt index ebbdfb4353..1526e9e9a2 100644 --- a/modules/python/bindings/CMakeLists.txt +++ b/modules/python/bindings/CMakeLists.txt @@ -2,7 +2,7 @@ # Declare the cpp source files as explicitely generated so that pybind11_add_module does not look for them when they are not yet created set_source_files_properties(${python_bindings_cpp_src} PROPERTIES GENERATED TRUE) -pybind11_add_module(_visp THIN_LTO ${python_bindings_cpp_src}) +pybind11_add_module(_visp ${python_bindings_cpp_src}) # Place library in binary/visp dir so that it doesn't pollute lib dir # This .so file is not treated the same as the others and we shouldn't link against it when compiling in C++ diff --git a/modules/python/bindings/setup.py.in b/modules/python/bindings/setup.py.in index 84c45283c2..87326efb74 100644 --- a/modules/python/bindings/setup.py.in +++ b/modules/python/bindings/setup.py.in @@ -16,6 +16,8 @@ version = '@VISP_PYTHON_VERSION@' package_data = {} +# Inspired by the pyrealsense2 binding +# Include a .so lib that is already compiled into the package if os.name == 'posix': package_data[''] = ['*.so'] else: @@ -32,7 +34,7 @@ setup( name=package_name, version=version, author="Samuel Felton", - packages=['visp'], + packages=['', 'visp'], author_email="samuel.felton@irisa.fr", description="Python wrapper for the Visual Servoing Platform", long_description="", diff --git a/modules/python/bindings/visp/py.typed b/modules/python/bindings/visp/py.typed new file mode 100644 index 0000000000..e69de29bb2 diff --git a/modules/python/generator/visp_python_bindgen/generator.py b/modules/python/generator/visp_python_bindgen/generator.py index cf6a240fe1..926d0171f0 100644 --- a/modules/python/generator/visp_python_bindgen/generator.py +++ b/modules/python/generator/visp_python_bindgen/generator.py @@ -4,6 +4,8 @@ from multiprocessing import Pool import argparse +from cxxheaderparser.errors import CxxParseError + from visp_python_bindgen.header import * from visp_python_bindgen.submodule import * from visp_python_bindgen.generator_config import GeneratorConfig @@ -19,6 +21,11 @@ def header_preprocess(header: HeaderFile): print('There was an error when processing header', header.path) import traceback traceback.print_exc() + print(type(e)) + if isinstance(e, CxxParseError): + + print(header.preprocessed_header_str) + return None def main_str(submodule_fn_declarations, submodule_fn_calls): @@ -57,7 +64,7 @@ def generate_module(generate_path: Path, config_path: Path) -> None: new_all_headers = [] for result in list(tqdm(pool.imap(header_preprocess, all_headers), total=len(all_headers), file=sys.stderr)): if result is None: - raise RuntimeError('There was an exception when processing headers: You should either ignore them, ignore the failing class, or fix the generator code!') + raise RuntimeError('There was an exception when processing headers: You should either ignore the faulty header/class, or fix the generator code!') new_all_headers.append(result) # Sort headers according to the dependencies. This is done across all modules. diff --git a/modules/python/generator/visp_python_bindgen/generator_config.py b/modules/python/generator/visp_python_bindgen/generator_config.py index 47fbab81b9..f9aa1615bf 100644 --- a/modules/python/generator/visp_python_bindgen/generator_config.py +++ b/modules/python/generator/visp_python_bindgen/generator_config.py @@ -5,6 +5,8 @@ from dataclasses import dataclass import json + + @dataclass class PreprocessorConfig(object): ''' @@ -79,7 +81,8 @@ class GeneratorConfig(object): 'vp_deprecated': '', # remove symbol as it messes up the cxxheaderparsing 'DOXYGEN_SHOULD_SKIP_THIS': None, # Do not generate methods that do not appear in public api doc 'NLOHMANN_JSON_SERIALIZE_ENUM(a,...)': 'void ignored() {}', # Remove json enum serialization as it cnanot correctly be parsed - '__cplusplus' : '201103L' # To silence OpenCV warnings + '__cplusplus' : '201103L', # To silence OpenCV warnings, + #'OPENCV_ALL_HPP': None, # Don't preprocess the full opencv headers }, never_defined=[ 'VISP_BUILD_DEPRECATED_FUNCTIONS', # Do not bind deprecated functions @@ -88,7 +91,7 @@ class GeneratorConfig(object): include_directories=[], # Populate through the main configuration file passthrough_includes_regex="^.*$", # Never output the result of other includes. line_directive=None, - other_args=["--passthru-unfound-includes", "--passthru-comments"] + other_args=["--passthru-unfound-includes"] #"--passthru-comments" ) @staticmethod diff --git a/modules/python/generator/visp_python_bindgen/header.py b/modules/python/generator/visp_python_bindgen/header.py index 265ef1e4a4..18512f5dbd 100644 --- a/modules/python/generator/visp_python_bindgen/header.py +++ b/modules/python/generator/visp_python_bindgen/header.py @@ -70,8 +70,8 @@ def preprocess(self) -> None: Preprocess the header to obtain the abstract representation of the cpp classes available. Additionally get the path to the xml documentation file generated by doxygen ''' - preprocessed_header_str = self.run_preprocessor() # Run preprocessor, get only code that can be compiled with current visp - self.header_repr: ParsedData = parse_string(preprocessed_header_str) # Get the cxxheaderparser representation of the header + self.preprocessed_header_str = self.run_preprocessor() # Run preprocessor, get only code that can be compiled with current visp + self.header_repr: ParsedData = parse_string(self.preprocessed_header_str) # Get the cxxheaderparser representation of the header # Get dependencies of this header. This is important for the code generation order for cls in self.header_repr.namespace.classes: @@ -99,7 +99,7 @@ def run_preprocessor(self): # TODO: run without generating a new file 'opencv2/opencv_modules.hpp' ] for include in forced_includes: - tmp_file_content.append(f'#include <{include}>') + tmp_file_content.append(f'#include <{include}>\n') # Remove all includes: we only include configuration headers, defined above with open(self.path.absolute(), 'r') as input_header_file: @@ -110,7 +110,7 @@ def run_preprocessor(self): # TODO: run without generating a new file tmp_file_content.append(line) with open(tmp_file_path.absolute(), 'w') as tmp_file: - tmp_file.write('\n'.join(tmp_file_content)) + tmp_file.write(''.join(tmp_file_content)) tmp_file.flush() diff --git a/modules/python/stubs/CMakeLists.txt b/modules/python/stubs/CMakeLists.txt index f87add5b55..1c5a5a24f8 100644 --- a/modules/python/stubs/CMakeLists.txt +++ b/modules/python/stubs/CMakeLists.txt @@ -1,11 +1,13 @@ configure_file("${CMAKE_CURRENT_SOURCE_DIR}/setup.py.in" "${CMAKE_CURRENT_BINARY_DIR}/setup.py" @ONLY) # MANIFEST file is not really configured by CMAKE, but doing it like this ensures that the target will be regenerated if MANIFEST.in is modified -configure_file("${CMAKE_CURRENT_SOURCE_DIR}/MANIFEST.in" "${CMAKE_CURRENT_BINARY_DIR}/MANIFEST.in" COPYONLY) +#configure_file("${CMAKE_CURRENT_SOURCE_DIR}/MANIFEST.in" "${CMAKE_CURRENT_BINARY_DIR}/MANIFEST.in" COPYONLY) add_custom_target( visp_python_stubs - COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_CURRENT_BINARY_DIR}/visp" + COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMAKE_CURRENT_SOURCE_DIR}/visp-stubs" "${CMAKE_CURRENT_BINARY_DIR}/visp-stubs" + COMMAND ${Python_EXECUTABLE} -m pip install ${_pip_args} pybind11-stubgen COMMAND ${Python_EXECUTABLE} -m pip install ${_pip_args} -v "${CMAKE_CURRENT_BINARY_DIR}" + DEPENDS visp_python_bindings_install ) \ No newline at end of file diff --git a/modules/python/stubs/MANIFEST.in b/modules/python/stubs/MANIFEST.in deleted file mode 100644 index f3feb24825..0000000000 --- a/modules/python/stubs/MANIFEST.in +++ /dev/null @@ -1 +0,0 @@ -recursive-include visp *.pyi \ No newline at end of file diff --git a/modules/python/stubs/setup.py.in b/modules/python/stubs/setup.py.in index 3ed51ec9fb..c98fbd8e4e 100644 --- a/modules/python/stubs/setup.py.in +++ b/modules/python/stubs/setup.py.in @@ -18,7 +18,7 @@ class CustomInstall(install): # Generate stubs for the bindings (C++ side) and mock it so that they appear in the true 'visp' package p = Path('./_visp') - target_path = Path('./visp') + target_path = Path('./visp-stubs') target_path.mkdir(exist_ok=True) for pyi_file in p.iterdir(): if pyi_file.name.endswith('.pyi'): @@ -29,12 +29,15 @@ class CustomInstall(install): setup( name='visp-stubs', version='@VISP_PYTHON_VERSION@', - packages=['visp'], + packages=['visp-stubs'], author="Samuel Felton", author_email="samuel.felton@irisa.fr", description="Python stubs for the ViSP wrapper", zip_safe=False, - include_package_data=True, + #include_package_data=True, + package_data = { + 'visp-stubs': ['*.pyi'] + }, setup_requires=[ "pybind11-stubgen>=2.1", #"visp" From b12a8745947b101535012e647d984dd815f54a71 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Tue, 24 Oct 2023 15:40:01 +0200 Subject: [PATCH 087/169] everything in order for packaging --- modules/python/bindings/setup.py.in | 4 ++-- modules/python/stubs/CMakeLists.txt | 2 +- modules/python/test/test.py | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/python/bindings/setup.py.in b/modules/python/bindings/setup.py.in index 87326efb74..7b53cbccf1 100644 --- a/modules/python/bindings/setup.py.in +++ b/modules/python/bindings/setup.py.in @@ -19,9 +19,9 @@ package_data = {} # Inspired by the pyrealsense2 binding # Include a .so lib that is already compiled into the package if os.name == 'posix': - package_data[''] = ['*.so'] + package_data[''] = ['*.so', 'py.typed'] else: - package_data[''] = ['*.pyd', '*.dll'] + package_data[''] = ['*.pyd', '*.dll', 'py.typed'] # This creates a list which is empty but returns a length of 1. diff --git a/modules/python/stubs/CMakeLists.txt b/modules/python/stubs/CMakeLists.txt index 1c5a5a24f8..5fdaeb5e8a 100644 --- a/modules/python/stubs/CMakeLists.txt +++ b/modules/python/stubs/CMakeLists.txt @@ -5,7 +5,7 @@ configure_file("${CMAKE_CURRENT_SOURCE_DIR}/setup.py.in" "${CMAKE_CURRENT_BINARY add_custom_target( visp_python_stubs - COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMAKE_CURRENT_SOURCE_DIR}/visp-stubs" "${CMAKE_CURRENT_BINARY_DIR}/visp-stubs" + COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_CURRENT_BINARY_DIR}/visp-stubs" COMMAND ${Python_EXECUTABLE} -m pip install ${_pip_args} pybind11-stubgen COMMAND ${Python_EXECUTABLE} -m pip install ${_pip_args} -v "${CMAKE_CURRENT_BINARY_DIR}" diff --git a/modules/python/test/test.py b/modules/python/test/test.py index e80ee22858..b345c59489 100644 --- a/modules/python/test/test.py +++ b/modules/python/test/test.py @@ -3,6 +3,7 @@ from visp.core import HomogeneousMatrix, ExponentialMap, UniRand, CameraParameters from visp.core import ColVector + if __name__ == '__main__': T = HomogeneousMatrix(TranslationVector(1, 0, 1), ThetaUVector(0.0, 0.0, 0.0)) print(T) From 674321d6581484f20b8cedc2757b2563ca287c29 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Tue, 24 Oct 2023 20:00:31 +0200 Subject: [PATCH 088/169] rework pybind11-stubgen call --- modules/python/stubs/CMakeLists.txt | 1 + modules/python/stubs/run_stub_generator.py | 26 ++++++++++++++++++ modules/python/stubs/setup.py.in | 31 +--------------------- 3 files changed, 28 insertions(+), 30 deletions(-) create mode 100644 modules/python/stubs/run_stub_generator.py diff --git a/modules/python/stubs/CMakeLists.txt b/modules/python/stubs/CMakeLists.txt index 5fdaeb5e8a..4b74ce1bc0 100644 --- a/modules/python/stubs/CMakeLists.txt +++ b/modules/python/stubs/CMakeLists.txt @@ -7,6 +7,7 @@ configure_file("${CMAKE_CURRENT_SOURCE_DIR}/setup.py.in" "${CMAKE_CURRENT_BINARY add_custom_target( visp_python_stubs COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_CURRENT_BINARY_DIR}/visp-stubs" COMMAND ${Python_EXECUTABLE} -m pip install ${_pip_args} pybind11-stubgen + COMMAND ${Python_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/run_stub_generator.py --output-root ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${Python_EXECUTABLE} -m pip install ${_pip_args} -v "${CMAKE_CURRENT_BINARY_DIR}" DEPENDS visp_python_bindings_install diff --git a/modules/python/stubs/run_stub_generator.py b/modules/python/stubs/run_stub_generator.py new file mode 100644 index 0000000000..0b999b53f6 --- /dev/null +++ b/modules/python/stubs/run_stub_generator.py @@ -0,0 +1,26 @@ +from shutil import copy +from pathlib import Path +import subprocess +import sys +import argparse + +if __name__ == '__main__': + parser = argparse.ArgumentParser() + parser.add_argument('--output-root', type=str, help='Path where to save the stubs') + + args = parser.parse_args() + output_root = Path(args.output_root) + assert output_root.exists() + bin_folder = Path(sys.executable).parent + stubgen_entry_point = bin_folder / 'pybind11-stubgen' + assert stubgen_entry_point.exists() + + subprocess.run([str(stubgen_entry_point), '-o', str(output_root.absolute()), '--ignore-all-errors', '_visp'], check=True) + + # Generate stubs for the bindings (C++ side) and mock it so that they appear in the true 'visp' package + p = Path('./_visp') + target_path = Path('./visp-stubs') + target_path.mkdir(exist_ok=True) + for pyi_file in p.iterdir(): + if pyi_file.name.endswith('.pyi'): + copy(pyi_file, target_path / pyi_file.name) # Copy replace old files \ No newline at end of file diff --git a/modules/python/stubs/setup.py.in b/modules/python/stubs/setup.py.in index c98fbd8e4e..5092057fc6 100644 --- a/modules/python/stubs/setup.py.in +++ b/modules/python/stubs/setup.py.in @@ -1,30 +1,6 @@ from pathlib import Path -from shutil import copy from setuptools import setup -from setuptools.command.install import install -import subprocess -import sys - -class CustomInstall(install): - def run(self): - # Find the pybind11-stubgen like this: If the base env has pybind11-stubgen it may take precedence in the path - # It would thus not be able to see the _visp is package - bin_folder = Path(sys.executable).parent - stubgen_entry_point = bin_folder / 'pybind11-stubgen' - assert stubgen_entry_point.exists() - - subprocess.run([str(stubgen_entry_point), '-o', '.', '--ignore-all-errors', '_visp'], check=True) - - # Generate stubs for the bindings (C++ side) and mock it so that they appear in the true 'visp' package - p = Path('./_visp') - target_path = Path('./visp-stubs') - target_path.mkdir(exist_ok=True) - for pyi_file in p.iterdir(): - if pyi_file.name.endswith('.pyi'): - copy(pyi_file, target_path / pyi_file.name) # Copy replace old files - - install.run(self) setup( name='visp-stubs', @@ -38,10 +14,5 @@ setup( package_data = { 'visp-stubs': ['*.pyi'] }, - setup_requires=[ - "pybind11-stubgen>=2.1", - #"visp" - ], - cmdclass={'install': CustomInstall}, python_requires=">=3.7", -) \ No newline at end of file +) From 171f72d1e23d3fd90a48b2012c4e0cf07de4d9d1 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Wed, 25 Oct 2023 17:21:20 +0200 Subject: [PATCH 089/169] more outputs on python cmake, start packaging sphinx doc --- CMakeLists.txt | 37 ++++++++++++++++----- modules/python/CMakeLists.txt | 24 +++++++++---- modules/python/docs/{api.rst => api.rst.in} | 0 modules/python/docs/{conf.py => conf.py.in} | 4 +-- modules/python/docs/index.rst | 2 +- modules/python/docs/requirements.txt | 0 modules/python/docs/{static => }/todos.rst | 0 7 files changed, 48 insertions(+), 19 deletions(-) rename modules/python/docs/{api.rst => api.rst.in} (100%) rename modules/python/docs/{conf.py => conf.py.in} (99%) create mode 100644 modules/python/docs/requirements.txt rename modules/python/docs/{static => }/todos.rst (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index f7e291b0d7..9ec2e25d27 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -272,6 +272,19 @@ if(NOT IOS) include(cmake/VISPDetectPython.cmake) endif() +# --- Python Bindings requirements --- +find_package(Python 3.7 COMPONENTS Interpreter Development) # TODO: use visp function to find python? +if(Python_FOUND) + set(VISP_PYTHON_BINDINGS_EXECUTABLE "${Python_EXECUTABLE}") +endif() +find_package(pybind11) +if(pybind11_FOUND) + set(VISP_PYBIND11_DIR "${pybind11_DIR}") +endif() +message("${pybind11_FOUND}") +# --- + + include_directories(${VISP_INCLUDE_DIR}) #---------------------------------------------------------------------- @@ -412,16 +425,10 @@ VP_OPTION(BUILD_ANDROID_EXAMPLES "" "" "Build examples for Android platform" VP_OPTION(INSTALL_ANDROID_EXAMPLES "" "" "Install Android examples" "" OFF IF ANDROID ) # Build python bindings as an option -VP_OPTION(BUILD_PYTHON "" "" "Enable Python support" "" ON ) -VP_OPTION(BUILD_PYTHON_DOC "" "" "Build the documentation for the Python bindings" "" ON ) +VP_OPTION(BUILD_PYTHON "" "" "Enable Python support" "" ON IF (VISP_PYTHON_BINDINGS_EXECUTABLE AND VISP_PYBIND11_DIR) ) +VP_OPTION(BUILD_PYTHON_DOC "" "" "Build the documentation for the Python bindings" "" ON IF BUILD_PYTHON ) -VP_OPTION(BUILD_FAT_JAVA_LIB "" "" "Create Java wrapper exporting all functions of ViSP library (requires static build of ViSP modules)" "" ANDROID IF NOT BUILD_SHARED_LIBS) -VP_OPTION(BUILD_ANDROID_SERVICE "" "" "Build ViSP Manager for Google Play" "" OFF IF ANDROID ) -VP_OPTION(BUILD_ANDROID_PROJECTS "" "" "Build Android projects providing .apk files" "" ON IF ANDROID ) -VP_OPTION(BUILD_ANDROID_EXAMPLES "" "" "Build examples for Android platform" "" ON IF ANDROID ) -VP_OPTION(INSTALL_ANDROID_EXAMPLES "" "" "Install Android examples" "" OFF IF ANDROID ) - # Build demos as an option. VP_OPTION(BUILD_DEMOS "" "" "Build ViSP demos" "" ON) # Build tutorials as an option. @@ -1483,7 +1490,7 @@ endif() # ========================== java ========================== status("") -status(" Python (for build):" PYTHON_DEFAULT_AVAILABLE THEN "${PYTHON_DEFAULT_EXECUTABLE}" ELSE "no") +status(" Python (for java build):" PYTHON_DEFAULT_AVAILABLE THEN "${PYTHON_DEFAULT_EXECUTABLE}" ELSE "no") if(BUILD_JAVA OR BUILD_visp_java) status("") @@ -1494,6 +1501,18 @@ if(BUILD_JAVA OR BUILD_visp_java) endif() endif() +# ========================== Python ========================== +status("") +status(" Building Python wrapper :" BUILD_PYTHON THEN "yes" ELSE "no") +if(BUILD_PYTHON) + status(" Python interpreter:" Python_FOUND THEN "${Python_EXECUTABLE}" ELSE "no") + status(" Pybind11:" pybind11_FOUND THEN "${pybind11_DIR}" ELSE "no") + status(" Package version:" "${VISP_PYTHON_PACKAGE_VERSION}") + status(" Wrapped modules:" "${VISP_PYTHON_BOUND_MODULES}") + status(" Generated input config:" "${VISP_PYTHON_GENERATED_CONFIG_FILE}") + +endif() + # ============================ Options =========================== status("") status(" Build options: ") diff --git a/modules/python/CMakeLists.txt b/modules/python/CMakeLists.txt index 72bbaf2f21..e2cfbbadf4 100644 --- a/modules/python/CMakeLists.txt +++ b/modules/python/CMakeLists.txt @@ -1,9 +1,12 @@ + +# Prevent CMAKE from interpreting this directory as a standard module. if(NOT VISP_DIR) return() endif() - +# As we need all the others modules to already be configured, +# we should configure the python directory by add_subdirectory("modules/python") in the main cmake. find_package(VISP REQUIRED) # this avoids non-active conda from getting picked anyway on Windows @@ -11,11 +14,7 @@ set(Python_FIND_REGISTRY LAST) # Use environment variable PATH to decide preference for Python set(Python_FIND_VIRTUALENV FIRST) set(Python_FIND_STRATEGY LOCATION) -find_package(Python 3.7 COMPONENTS Interpreter Development) # TODO: use visp function to find python? -find_package(pybind11 REQUIRED) - -message("${VISP_INCLUDE_DIRS}") # TODO: check for pip if(Python_FOUND AND pybind11_FOUND) # We have Python and pybind11, we can install module @@ -66,7 +65,6 @@ string(JSON json_config_file SET ${json_config_file} "include_dirs" "${json_incl # For each bound module, add its headers to config file foreach(module ${python_bound_modules}) - message("${python_bound_modules}") string(REPLACE "visp_" "" clean_module_name ${module}) string(JSON json_config_file SET ${json_config_file} ${clean_module_name} "{}") @@ -78,7 +76,6 @@ foreach(module ${python_bound_modules}) MATH(EXPR header_count "${header_count}+1") endforeach() string(JSON json_config_file SET ${json_config_file} ${clean_module_name} "headers" "${json_header_list}") - #file(TOUCH "${cpp_src}") endforeach() file(WRITE ${json_config_file_path} "${json_config_file}") @@ -116,6 +113,19 @@ add_subdirectory(stubs) +# Export Variables to parent cmake +set(VISP_PYTHON_BOUND_MODULES "") +foreach(module ${python_bound_modules}) + string(REPLACE "visp_" "" clean_module_name ${module}) + list(APPEND VISP_PYTHON_BOUND_MODULES "${clean_module_name}") +endforeach() +set(VISP_PYTHON_BOUND_MODULES "${VISP_PYTHON_BOUND_MODULES}" PARENT_SCOPE) +set(VISP_PYTHON_GENERATED_CONFIG_FILE "${json_config_file_path}" PARENT_SCOPE) + +set(VISP_PYTHON_PACKAGE_VERSION "${VISP_PYTHON_VERSION}" PARENT_SCOPE) + + + endif() #todo : Run generator in an initial pass, depends on ConfigFile and vpConfig.h diff --git a/modules/python/docs/api.rst b/modules/python/docs/api.rst.in similarity index 100% rename from modules/python/docs/api.rst rename to modules/python/docs/api.rst.in diff --git a/modules/python/docs/conf.py b/modules/python/docs/conf.py.in similarity index 99% rename from modules/python/docs/conf.py rename to modules/python/docs/conf.py.in index d35c94494e..d504e93f60 100644 --- a/modules/python/docs/conf.py +++ b/modules/python/docs/conf.py.in @@ -102,9 +102,9 @@ # built documents. # # The short X.Y version. -version = "0.0.1" +version = "@VISP_PYTHON_VERSION@" # The full version, including alpha/beta/rc tags. -release = "0.0.1" +release = "@VISP_PYTHON_VERSION@" # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/modules/python/docs/index.rst b/modules/python/docs/index.rst index afa5d6712e..2cb49ca2d9 100644 --- a/modules/python/docs/index.rst +++ b/modules/python/docs/index.rst @@ -11,7 +11,7 @@ Todos and known issues .. toctree:: :glob: - static/* + todos.rst api.rst diff --git a/modules/python/docs/requirements.txt b/modules/python/docs/requirements.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/modules/python/docs/static/todos.rst b/modules/python/docs/todos.rst similarity index 100% rename from modules/python/docs/static/todos.rst rename to modules/python/docs/todos.rst From 2e42ba5820d27060f2f891fa90ff26916453cfd5 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Thu, 26 Oct 2023 13:24:55 +0200 Subject: [PATCH 090/169] generating doc through cmake --- CMakeLists.txt | 7 ++++ modules/python/.gitignore | 1 + modules/python/CMakeLists.txt | 15 ++------- modules/python/bindings/visp/__init__.py | 2 +- modules/python/docs/CMakeLists.txt | 43 ++++++++++++++++++++++++ modules/python/docs/api.rst.in | 11 +----- modules/python/docs/conf.py.in | 10 ------ modules/python/docs/requirements.txt | 3 ++ 8 files changed, 59 insertions(+), 33 deletions(-) create mode 100644 modules/python/docs/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index f0facd5aa6..075385b70b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -273,6 +273,13 @@ if(NOT IOS) endif() # --- Python Bindings requirements --- + +# this avoids non-active conda from getting picked anyway on Windows +set(Python_FIND_REGISTRY LAST) +# Use environment variable PATH to decide preference for Python +set(Python_FIND_VIRTUALENV FIRST) +set(Python_FIND_STRATEGY LOCATION) + find_package(Python 3.7 COMPONENTS Interpreter Development) # TODO: use visp function to find python? if(Python_FOUND) set(VISP_PYTHON_BINDINGS_EXECUTABLE "${Python_EXECUTABLE}") diff --git a/modules/python/.gitignore b/modules/python/.gitignore index c53d2f4939..ad78a1b413 100644 --- a/modules/python/.gitignore +++ b/modules/python/.gitignore @@ -7,3 +7,4 @@ stubs/build docs/_build docs/_autosummary docs/generated +docs/api.rst diff --git a/modules/python/CMakeLists.txt b/modules/python/CMakeLists.txt index e2cfbbadf4..f59ea42ebb 100644 --- a/modules/python/CMakeLists.txt +++ b/modules/python/CMakeLists.txt @@ -9,14 +9,8 @@ endif() # we should configure the python directory by add_subdirectory("modules/python") in the main cmake. find_package(VISP REQUIRED) -# this avoids non-active conda from getting picked anyway on Windows -set(Python_FIND_REGISTRY LAST) -# Use environment variable PATH to decide preference for Python -set(Python_FIND_VIRTUALENV FIRST) -set(Python_FIND_STRATEGY LOCATION) # TODO: check for pip -if(Python_FOUND AND pybind11_FOUND) # We have Python and pybind11, we can install module # Set pip args if(DEFINED ENV{VIRTUAL_ENV} OR DEFINED ENV{CONDA_PREFIX}) @@ -109,6 +103,9 @@ add_subdirectory(bindings) add_subdirectory(stubs) # Step 5: Build documentation +if(BUILD_PYTHON_DOC) + add_subdirectory(docs) +endif() @@ -123,9 +120,3 @@ set(VISP_PYTHON_BOUND_MODULES "${VISP_PYTHON_BOUND_MODULES}" PARENT_SCOPE) set(VISP_PYTHON_GENERATED_CONFIG_FILE "${json_config_file_path}" PARENT_SCOPE) set(VISP_PYTHON_PACKAGE_VERSION "${VISP_PYTHON_VERSION}" PARENT_SCOPE) - - - -endif() - -#todo : Run generator in an initial pass, depends on ConfigFile and vpConfig.h diff --git a/modules/python/bindings/visp/__init__.py b/modules/python/bindings/visp/__init__.py index 2488a7b9ac..56f9ac7658 100644 --- a/modules/python/bindings/visp/__init__.py +++ b/modules/python/bindings/visp/__init__.py @@ -12,4 +12,4 @@ for k in _visp.__dict__: from types import ModuleType if isinstance(_visp.__dict__[k], ModuleType): - sys.modules[f'{__name__}.{k}'] = f'{__name__}._visp.{k}' + sys.modules[f'{__name__}.{k}'] = _visp.__dict__[k] diff --git a/modules/python/docs/CMakeLists.txt b/modules/python/docs/CMakeLists.txt new file mode 100644 index 0000000000..1bf6c679f4 --- /dev/null +++ b/modules/python/docs/CMakeLists.txt @@ -0,0 +1,43 @@ +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake") + +# configured documentation tools and intermediate build results +set(BINARY_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/_build") + +# Sphinx cache with pickled ReST documents +set(SPHINX_CACHE_DIR "${CMAKE_CURRENT_BINARY_DIR}/_doctrees") + +# HTML output directory +set(SPHINX_HTML_DIR "${CMAKE_CURRENT_BINARY_DIR}/html") + +# Sphinx Template directory +set(SPHINX_TEMPLATE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/_templates") + +configure_file( + "${CMAKE_CURRENT_SOURCE_DIR}/conf.py.in" + "${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}) + string(APPEND VISP_PYTHON_MODULES_DOC_INCLUDE ${python_module_name} "\n") +endforeach() + +configure_file( + "${CMAKE_CURRENT_SOURCE_DIR}/api.rst.in" + "${CMAKE_CURRENT_SOURCE_DIR}/api.rst" + @ONLY) + +add_custom_target(visp_python_docs + COMMAND ${Python_EXECUTABLE} -m pip install -r "${CMAKE_CURRENT_SOURCE_DIR}/requirements.txt" + COMMAND sphinx-build + -q -b html + -c "${BINARY_BUILD_DIR}" + -d "${SPHINX_CACHE_DIR}" + "${CMAKE_CURRENT_SOURCE_DIR}" + "${SPHINX_HTML_DIR}" + COMMENT "Building HTML documentation for ViSP Python doc with Sphinx") + +add_dependencies(visp_python_docs visp_python_bindings_install) diff --git a/modules/python/docs/api.rst.in b/modules/python/docs/api.rst.in index ad76004fc2..2d24c2efdb 100644 --- a/modules/python/docs/api.rst.in +++ b/modules/python/docs/api.rst.in @@ -7,13 +7,4 @@ API reference :recursive: :template: custom-module-template.rst - visp.core - visp.io - visp.vision - visp.visual_features - visp.vs - visp.robot - visp.detection - visp.imgproc - visp.dnn_tracker - visp.mbt +@VISP_PYTHON_MODULES_DOC_INCLUDE@ diff --git a/modules/python/docs/conf.py.in b/modules/python/docs/conf.py.in index d504e93f60..3a01d6ecc0 100644 --- a/modules/python/docs/conf.py.in +++ b/modules/python/docs/conf.py.in @@ -66,17 +66,7 @@ add_module_names = False # Remove namespaces from class/method signatures import visp -from types import ModuleType -module_names = [] -for k in visp.__dict__: - if isinstance(visp.__dict__[k], ModuleType): - module_names.append(k) -all_modules = '\\ '.join(f'visp.{module_name}' for module_name in module_names) - -rst_prolog = f""" -.. |all_modules| replace:: visp.core -""" # Add any paths that contain templates here, relative to this directory. templates_path = ["_templates"] diff --git a/modules/python/docs/requirements.txt b/modules/python/docs/requirements.txt index e69de29bb2..1e8f099944 100644 --- a/modules/python/docs/requirements.txt +++ b/modules/python/docs/requirements.txt @@ -0,0 +1,3 @@ +sphinx +sphinx-immaterial +sphinxcontrib-jsmath From e05e73c1500af8798eec8f5432c377080906c473 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Thu, 26 Oct 2023 17:13:14 +0200 Subject: [PATCH 091/169] Removed hardcoding of XML documentation path and modules, modules require sorting --- modules/python/CMakeLists.txt | 19 +++++++++++---- .../visp_python_bindgen/doc_parser.py | 6 ++--- .../visp_python_bindgen/generator_config.py | 23 ++++++++++++++++++- .../generator/visp_python_bindgen/header.py | 6 +++-- .../visp_python_bindgen/submodule.py | 23 +++++++++++-------- 5 files changed, 57 insertions(+), 20 deletions(-) diff --git a/modules/python/CMakeLists.txt b/modules/python/CMakeLists.txt index f59ea42ebb..3b73f256d9 100644 --- a/modules/python/CMakeLists.txt +++ b/modules/python/CMakeLists.txt @@ -57,11 +57,17 @@ foreach(include_dir ${VISP_INCLUDE_DIRS}) endforeach() string(JSON json_config_file SET ${json_config_file} "include_dirs" "${json_include_dirs}") +string(JSON json_config_file SET ${json_config_file} "xml_doc_path" "\"${VISP_DOC_DIR}/xml\"") +string(JSON json_config_file SET ${json_config_file} "build_dir" "\"${CMAKE_BINARY_DIR}\"") +string(JSON json_config_file SET ${json_config_file} "source_dir" "\"${CMAKE_SOURCE_DIR}\"") + + # For each bound module, add its headers to config file +set(json_modules "{}") foreach(module ${python_bound_modules}) string(REPLACE "visp_" "" clean_module_name ${module}) - string(JSON json_config_file SET ${json_config_file} ${clean_module_name} "{}") + string(JSON json_modules SET ${json_modules} ${clean_module_name} "{}") set(json_header_list "[]") set(header_count 0) @@ -69,8 +75,10 @@ foreach(module ${python_bound_modules}) string(JSON json_header_list SET ${json_header_list} "${header_count}" "\"${module_header}\"") MATH(EXPR header_count "${header_count}+1") endforeach() - string(JSON json_config_file SET ${json_config_file} ${clean_module_name} "headers" "${json_header_list}") + string(JSON json_modules SET ${json_modules} ${clean_module_name} "headers" "${json_header_list}") endforeach() +string(JSON json_config_file SET ${json_config_file} "modules" ${json_modules}) + file(WRITE ${json_config_file_path} "${json_config_file}") @@ -85,14 +93,17 @@ file(GLOB config_files "${CMAKE_CURRENT_SOURCE_DIR}/config/*.json") file(GLOB_RECURSE python_sources "${CMAKE_CURRENT_SOURCE_DIR}/generator/visp_python_bindgen/*.py") set(pip_files "${CMAKE_CURRENT_SOURCE_DIR}/generator/pyproject.toml") - add_custom_command( OUTPUT ${python_bindings_cpp_src} COMMAND ${Python_EXECUTABLE} -m pip install ${_pip_args} -v ${bindgen_package_location} COMMAND ${Python_EXECUTABLE} -m visp_python_bindgen.generator --config "${CMAKE_CURRENT_SOURCE_DIR}/config" --build-folder ${bindings_gen_location} --main-config "${json_config_file_path}" DEPENDS ${python_bound_modules} ${json_config_file_path} ${config_files} ${python_sources} ${pip_files} ) -add_custom_target(visp_python_bindings_generator_run DEPENDS ${python_bindings_cpp_src}) +add_custom_target( + visp_python_bindings_generator_run + DEPENDS ${python_bindings_cpp_src} + +) set(VISP_PYTHON_VERSION "${VISP_VERSION}") # Step 3: Compile and install bindings as a python package diff --git a/modules/python/generator/visp_python_bindgen/doc_parser.py b/modules/python/generator/visp_python_bindgen/doc_parser.py index b63f2ad9b7..b3a4d3a14b 100644 --- a/modules/python/generator/visp_python_bindgen/doc_parser.py +++ b/modules/python/generator/visp_python_bindgen/doc_parser.py @@ -13,6 +13,7 @@ import_failed = True from visp_python_bindgen.utils import * +from visp_python_bindgen.generator_config import GeneratorConfig class DocumentationObjectKind(Enum): ''' @@ -23,14 +24,13 @@ class DocumentationObjectKind(Enum): Method = 'method' class DocumentationData(object): - documentation_xml_location: Optional[Path] = Path('/home/sfelton/software/visp_build/doc/xml') @staticmethod def get_xml_path_if_exists(name: str, kind: DocumentationObjectKind) -> Optional[Path]: if import_failed: return None - xml_root = DocumentationData.documentation_xml_location + xml_root = GeneratorConfig.xml_doc_path if xml_root is None or not xml_root.exists(): return None p = None @@ -227,7 +227,7 @@ class DocumentationHolder(object): def __init__(self, path: Optional[Path], env_mapping: Dict[str, str]): self.xml_path = path self.elements = None - if not import_failed and DocumentationData.documentation_xml_location is not None: + if not import_failed and GeneratorConfig.xml_doc_path is not None: if not self.xml_path.exists(): print(f'Could not find documentation when looking in {str(path)}') else: diff --git a/modules/python/generator/visp_python_bindgen/generator_config.py b/modules/python/generator/visp_python_bindgen/generator_config.py index f9aa1615bf..001750e5d4 100644 --- a/modules/python/generator/visp_python_bindgen/generator_config.py +++ b/modules/python/generator/visp_python_bindgen/generator_config.py @@ -6,6 +6,11 @@ import json +@dataclass +class ModuleInputData(object): + name: str + headers: List[Path] + @dataclass class PreprocessorConfig(object): @@ -94,6 +99,10 @@ class GeneratorConfig(object): other_args=["--passthru-unfound-includes"] #"--passthru-comments" ) + xml_doc_path: Optional[Path] = None + + module_data: List[ModuleInputData] = [] + @staticmethod def _matches_regex_in_list(s: str, regexes: List[str]) -> bool: return any(map(lambda regex: re.match(regex, s) is not None, regexes)) @@ -121,4 +130,16 @@ def update_from_main_config_file(path: Path) -> None: assert path.exists() with open(path, 'r') as main_config_file: main_config = json.load(main_config_file) - GeneratorConfig.pcpp_config.include_directories = main_config['include_dirs'] \ No newline at end of file + GeneratorConfig.pcpp_config.include_directories = main_config['include_dirs'] + xml_doc_path = main_config.get('xml_doc_path') + if xml_doc_path is not None: + GeneratorConfig.xml_doc_path = Path(xml_doc_path) + + modules_dict = main_config.get('modules') + source_dir = Path(main_config.get('source_dir')) + for module_name in modules_dict: + headers = map(lambda s: Path(s), modules_dict[module_name].get('headers')) + + # Include only headers that are in the VISP source directory + headers = list(filter(lambda h: source_dir in h.parents, headers)) + GeneratorConfig.module_data.append(ModuleInputData(module_name, headers)) diff --git a/modules/python/generator/visp_python_bindgen/header.py b/modules/python/generator/visp_python_bindgen/header.py index 18512f5dbd..68b73a1d54 100644 --- a/modules/python/generator/visp_python_bindgen/header.py +++ b/modules/python/generator/visp_python_bindgen/header.py @@ -88,14 +88,16 @@ def preprocess(self) -> None: if self.documentation_holder_path is None: self.documentation_holder_path = DocumentationData.get_xml_path_if_exists(name_cpp_no_template, DocumentationObjectKind.Class) - def run_preprocessor(self): # TODO: run without generating a new file + def run_preprocessor(self): tmp_dir = self.submodule.submodule_file_path.parent / "tmp" tmp_dir.mkdir(exist_ok=True) tmp_file_path = tmp_dir / (self.path.name + '.in') preprocessor_output_path = tmp_dir / (self.path.name) tmp_file_content = [] + + # Includes that should be appended at the start of every file forced_includes = [ - 'visp3/core/vpConfig.h', + 'visp3/core/vpConfig.h', # Always include vpConfig: ensure that VISP macros are correctly defined 'opencv2/opencv_modules.hpp' ] for include in forced_includes: diff --git a/modules/python/generator/visp_python_bindgen/submodule.py b/modules/python/generator/visp_python_bindgen/submodule.py index 7bfacc691b..eeb69e1114 100644 --- a/modules/python/generator/visp_python_bindgen/submodule.py +++ b/modules/python/generator/visp_python_bindgen/submodule.py @@ -195,16 +195,19 @@ def get_method_config(self, class_name: Optional[str], method, owner_specs, head def get_submodules(config_path: Path, generate_path: Path) -> List[Submodule]: - modules = ['core', 'imgproc', 'vision', 'visual_features', 'vs', 'sensor', 'io', 'detection', 'robot', 'gui', 'ar'] + modules_input_data = GeneratorConfig.module_data result = [] - for module in modules: - result.append(Submodule(module, Path(f'/home/sfelton/software/visp-sfelton/modules/{module}/include/visp3/{module}'), config_path, generate_path / f'{module}.cpp')) - tracking_modules = ['tt', 'tt_mi', 'klt', 'me', 'blob', ('dnn', 'dnn_tracker'), 'mbt'] - for module in tracking_modules: - if isinstance(module, str): - result.append(Submodule(module, Path(f'/home/sfelton/software/visp-sfelton/modules/tracker/{module}/include/visp3/{module}'), config_path, generate_path / f'{module}.cpp')) - else: - result.append(Submodule(module[1], Path(f'/home/sfelton/software/visp-sfelton/modules/tracker/{module[0]}/include/visp3/{module[1]}'), config_path, generate_path / f'{module[1]}.cpp')) - + for module_data in modules_input_data: + headers = module_data.headers + if len(headers) == 0: + print(f'Module {module_data.name} has no input headers, skipping!') + + continue + include_dir = headers[0].parent + hh = "\n".join(map(lambda s: str(s), headers)) + assert all(map(lambda header_path: header_path.parent == include_dir, headers)), f'Found headers in different directory, this case is not yet handled. Headers = {hh}' + submodule = Submodule(module_data.name, include_dir, config_path, generate_path / f'{module_data.name}.cpp') + print(submodule) + result.append(submodule) return result From b103ed262aba9fb6b007eeed929bcb287983e652 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Fri, 27 Oct 2023 01:31:16 +0200 Subject: [PATCH 092/169] Add compiler/OS defines, Sort submodules based on ViSP dependencies --- modules/python/CMakeLists.txt | 75 +++++++++++++++++-- modules/python/build.sh | 1 - .../visp_python_bindgen/generator_config.py | 12 ++- .../visp_python_bindgen/submodule.py | 34 ++++++++- 4 files changed, 109 insertions(+), 13 deletions(-) delete mode 100755 modules/python/build.sh diff --git a/modules/python/CMakeLists.txt b/modules/python/CMakeLists.txt index 3b73f256d9..36522bb1b8 100644 --- a/modules/python/CMakeLists.txt +++ b/modules/python/CMakeLists.txt @@ -47,22 +47,23 @@ endforeach() set(json_config_file "{}") set(json_config_file_path "${CMAKE_CURRENT_BINARY_DIR}/cmake_config.json") +# Paths to important directories +string(JSON json_config_file SET ${json_config_file} "xml_doc_path" "\"${VISP_DOC_DIR}/xml\"") +string(JSON json_config_file SET ${json_config_file} "build_dir" "\"${CMAKE_BINARY_DIR}\"") +string(JSON json_config_file SET ${json_config_file} "source_dir" "\"${CMAKE_SOURCE_DIR}\"") + # Add include directories to config file set(json_include_dirs "[]") set(include_dirs_count 0) foreach(include_dir ${VISP_INCLUDE_DIRS}) - message("Include dir: ${include_dir}") string(JSON json_include_dirs SET ${json_include_dirs} "${include_dirs_count}" "\"${include_dir}\"") MATH(EXPR include_dirs_count "${include_dirs_count}+1") endforeach() string(JSON json_config_file SET ${json_config_file} "include_dirs" "${json_include_dirs}") -string(JSON json_config_file SET ${json_config_file} "xml_doc_path" "\"${VISP_DOC_DIR}/xml\"") -string(JSON json_config_file SET ${json_config_file} "build_dir" "\"${CMAKE_BINARY_DIR}\"") -string(JSON json_config_file SET ${json_config_file} "source_dir" "\"${CMAKE_SOURCE_DIR}\"") -# For each bound module, add its headers to config file +# For each bound module, add its headers and dependencies to config file set(json_modules "{}") foreach(module ${python_bound_modules}) string(REPLACE "visp_" "" clean_module_name ${module}) @@ -76,9 +77,73 @@ foreach(module ${python_bound_modules}) MATH(EXPR header_count "${header_count}+1") endforeach() string(JSON json_modules SET ${json_modules} ${clean_module_name} "headers" "${json_header_list}") + set(json_deps_list "[]") + set(dep_count 0) + foreach(dep ${VISP_MODULE_${module}_DEPS}) + string(REPLACE "visp_" "" clean_dep ${dep}) + string(JSON json_deps_list SET ${json_deps_list} "${dep_count}" "\"${clean_dep}\"") + MATH(EXPR dep_count "${dep_count}+1") + endforeach() + string(JSON json_modules SET ${json_modules} ${clean_module_name} "dependencies" "${json_deps_list}") endforeach() string(JSON json_config_file SET ${json_config_file} "modules" ${json_modules}) +# See https://github.com/cpredef/predef/tree/master for compiler/OS specific #defines +set(json_defines "{}") +string(JSON json_defines SET ${json_defines} "__cplusplus" "${VISP_CXX_STANDARD}") +# Compiler +if(CMAKE_COMPILER_IS_GNUCXX) + message("${CMAKE_CXX_COMPILER_VERSION}") + + string(REPLACE "." ";" GCC_VERSION_LIST ${CMAKE_CXX_COMPILER_VERSION}) + list(GET GCC_VERSION_LIST 0 GCC_MAJOR) + list(GET GCC_VERSION_LIST 1 GCC_MINOR) + list(GET GCC_VERSION_LIST 2 GCC_PATCH) + + string(JSON json_defines SET ${json_defines} "__GNUC__" "${GCC_MAJOR}") + string(JSON json_defines SET ${json_defines} "__GNUC_MINOR__" "${GCC_MINOR}") + string(JSON json_defines SET ${json_defines} "__GNUC_PATCHLEVEL__" "${GCC_PATCH}") +endif() +if(CMAKE_COMPILER_IS_CLANGCXX) + message("${CMAKE_CXX_COMPILER_VERSION}") + + string(REPLACE "." ";" CLANG_VERSION_LIST ${CMAKE_CXX_COMPILER_VERSION}) + list(GET CLANG_VERSION_LIST 0 CLANG_MAJOR) + list(GET CLANG_VERSION_LIST 1 CLANG_MINOR) + list(GET CLANG_VERSION_LIST 2 CLANG_PATCH) + + string(JSON json_defines SET ${json_defines} "__clang__" "${CLANG_MAJOR}") + string(JSON json_defines SET ${json_defines} "__clang_minor__" "${CLANG_MINOR}") + string(JSON json_defines SET ${json_defines} "__clang_patchlevel__" "${CLANG_PATCH}") + string(JSON json_defines SET ${json_defines} "__clang_version__" "${CMAKE_CXX_COMPILER_VERSION}") +endif() + +if(MSVC) + string(JSON json_defines SET ${json_defines} "_MSC_VER" "${MSVC_VERSION}") +endif() + +if(MINGW) + string(JSON json_defines SET ${json_defines} "__MINGW32__" "null") +endif() +# OS +if(WIN32) + string(JSON json_defines SET ${json_defines} "_WIN32" "null") +endif() +if(UNIX) + string(JSON json_defines SET ${json_defines} "__linux__" "null") + string(JSON json_defines SET ${json_defines} "__unix__" "null") + string(JSON json_defines SET ${json_defines} "_unix" "null") +endif() +if(APPLE) + string(JSON json_defines SET ${json_defines} "__APPLE__" "null") + string(JSON json_defines SET ${json_defines} "__MACH__" "null") +endif() +message("${json_defines}") + +string(JSON json_config_file SET ${json_config_file} "defines" ${json_defines}) + + + file(WRITE ${json_config_file_path} "${json_config_file}") diff --git a/modules/python/build.sh b/modules/python/build.sh deleted file mode 100755 index 26264414ff..0000000000 --- a/modules/python/build.sh +++ /dev/null @@ -1 +0,0 @@ -python generator/generator.py && pip install ./bindings && pip install ./stubs && cd docs && rm -r _build && make html && cd .. \ No newline at end of file diff --git a/modules/python/generator/visp_python_bindgen/generator_config.py b/modules/python/generator/visp_python_bindgen/generator_config.py index 001750e5d4..c4d2a07b79 100644 --- a/modules/python/generator/visp_python_bindgen/generator_config.py +++ b/modules/python/generator/visp_python_bindgen/generator_config.py @@ -10,6 +10,7 @@ class ModuleInputData(object): name: str headers: List[Path] + dependencies: List[str] @dataclass @@ -86,8 +87,6 @@ class GeneratorConfig(object): 'vp_deprecated': '', # remove symbol as it messes up the cxxheaderparsing 'DOXYGEN_SHOULD_SKIP_THIS': None, # Do not generate methods that do not appear in public api doc 'NLOHMANN_JSON_SERIALIZE_ENUM(a,...)': 'void ignored() {}', # Remove json enum serialization as it cnanot correctly be parsed - '__cplusplus' : '201103L', # To silence OpenCV warnings, - #'OPENCV_ALL_HPP': None, # Don't preprocess the full opencv headers }, never_defined=[ 'VISP_BUILD_DEPRECATED_FUNCTIONS', # Do not bind deprecated functions @@ -131,6 +130,12 @@ def update_from_main_config_file(path: Path) -> None: with open(path, 'r') as main_config_file: main_config = json.load(main_config_file) GeneratorConfig.pcpp_config.include_directories = main_config['include_dirs'] + + defines = main_config.get('defines') + if defines is not None: + for define_key in defines: + GeneratorConfig.pcpp_config.defines[define_key] = defines[define_key] + xml_doc_path = main_config.get('xml_doc_path') if xml_doc_path is not None: GeneratorConfig.xml_doc_path = Path(xml_doc_path) @@ -139,7 +144,8 @@ def update_from_main_config_file(path: Path) -> None: source_dir = Path(main_config.get('source_dir')) for module_name in modules_dict: headers = map(lambda s: Path(s), modules_dict[module_name].get('headers')) + deps = modules_dict[module_name].get('dependencies') # Include only headers that are in the VISP source directory headers = list(filter(lambda h: source_dir in h.parents, headers)) - GeneratorConfig.module_data.append(ModuleInputData(module_name, headers)) + GeneratorConfig.module_data.append(ModuleInputData(module_name, headers, deps)) diff --git a/modules/python/generator/visp_python_bindgen/submodule.py b/modules/python/generator/visp_python_bindgen/submodule.py index eeb69e1114..8f51b54d5d 100644 --- a/modules/python/generator/visp_python_bindgen/submodule.py +++ b/modules/python/generator/visp_python_bindgen/submodule.py @@ -6,6 +6,10 @@ from visp_python_bindgen.utils import * from visp_python_bindgen.gen_report import Report + + + + class Submodule(): def __init__(self, name: str, include_path: Path, config_file_path: Path, submodule_file_path: Path): self.name = name @@ -17,6 +21,12 @@ def __init__(self, name: str, include_path: Path, config_file_path: Path, submod self.headers = self._get_headers() assert self.include_path.exists(), f'Submodule path {self.include_path} not found' + def set_dependencies_from_dict(self, dict_modules: Dict[str, 'Submodule'], dep_names: List[str]): + deps = [] + for dep_name in dep_names: + if dep_name in dict_modules: + deps.append(dict_modules[dep_name]) + self.dependencies = deps def _get_headers(self) -> List[HeaderFile]: headers = [] for include_file in self.include_path.iterdir(): @@ -196,7 +206,7 @@ def get_method_config(self, class_name: Optional[str], method, owner_specs, head def get_submodules(config_path: Path, generate_path: Path) -> List[Submodule]: modules_input_data = GeneratorConfig.module_data - result = [] + result: Dict[str, Submodule] = {} for module_data in modules_input_data: headers = module_data.headers if len(headers) == 0: @@ -207,7 +217,23 @@ def get_submodules(config_path: Path, generate_path: Path) -> List[Submodule]: hh = "\n".join(map(lambda s: str(s), headers)) assert all(map(lambda header_path: header_path.parent == include_dir, headers)), f'Found headers in different directory, this case is not yet handled. Headers = {hh}' submodule = Submodule(module_data.name, include_dir, config_path, generate_path / f'{module_data.name}.cpp') - print(submodule) - result.append(submodule) + result[module_data.name] = submodule - return result + # Second pass to link dependencies + for module_data in modules_input_data: + if module_data.name in result: + result[module_data.name].set_dependencies_from_dict(result, module_data.dependencies) + return sort_submodules(list(result.values())) + + +def sort_submodules(submodules: List[Submodule]) -> List[Submodule]: + res = [] + submodules_tmp = submodules.copy() + while len(res) < len(submodules): + can_add = lambda submodule: all(map(lambda dep: dep in res, submodule.dependencies)) + res_round = list(filter(can_add, submodules_tmp)) + submodules_tmp = [submodule for submodule in submodules_tmp if submodule not in res_round] + res += res_round + + print(list(map(lambda sub: sub.name, res))) + return res From ce8fb366f3968d0bd2a1efc7cd4add7dada1cd94 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Fri, 27 Oct 2023 02:27:03 +0200 Subject: [PATCH 093/169] fix after merge --- .../python/generator/visp_python_bindgen/generator.py | 3 ++- modules/python/generator/visp_python_bindgen/header.py | 10 ++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/modules/python/generator/visp_python_bindgen/generator.py b/modules/python/generator/visp_python_bindgen/generator.py index 926d0171f0..174b0b9233 100644 --- a/modules/python/generator/visp_python_bindgen/generator.py +++ b/modules/python/generator/visp_python_bindgen/generator.py @@ -67,6 +67,7 @@ def generate_module(generate_path: Path, config_path: Path) -> None: raise RuntimeError('There was an exception when processing headers: You should either ignore the faulty header/class, or fix the generator code!') new_all_headers.append(result) + # Sort headers according to the dependencies. This is done across all modules. # TODO: sort module generation order. For now this works but it's fairly brittle new_all_headers = sort_headers(new_all_headers) @@ -125,4 +126,4 @@ def main(): generate_module(generation_path, config_path) if __name__ == '__main__': - main() \ No newline at end of file + main() diff --git a/modules/python/generator/visp_python_bindgen/header.py b/modules/python/generator/visp_python_bindgen/header.py index 68b73a1d54..ce19465115 100644 --- a/modules/python/generator/visp_python_bindgen/header.py +++ b/modules/python/generator/visp_python_bindgen/header.py @@ -70,8 +70,10 @@ def preprocess(self) -> None: Preprocess the header to obtain the abstract representation of the cpp classes available. Additionally get the path to the xml documentation file generated by doxygen ''' + from cxxheaderparser.options import ParserOptions self.preprocessed_header_str = self.run_preprocessor() # Run preprocessor, get only code that can be compiled with current visp - self.header_repr: ParsedData = parse_string(self.preprocessed_header_str) # Get the cxxheaderparser representation of the header + + self.header_repr: ParsedData = parse_string(self.preprocessed_header_str, options=ParserOptions(verbose=False, convert_void_to_zero_params=True)) # Get the cxxheaderparser representation of the header # Get dependencies of this header. This is important for the code generation order for cls in self.header_repr.namespace.classes: @@ -98,7 +100,7 @@ def run_preprocessor(self): # Includes that should be appended at the start of every file forced_includes = [ 'visp3/core/vpConfig.h', # Always include vpConfig: ensure that VISP macros are correctly defined - 'opencv2/opencv_modules.hpp' + 'opencv2/opencv.hpp' ] for include in forced_includes: tmp_file_content.append(f'#include <{include}>\n') @@ -110,6 +112,9 @@ def run_preprocessor(self): matches = re.search(include_regex, line) if matches is None: # Include line if its not an include tmp_file_content.append(line) + # else: + # if 'visp3' in matches.group() or 'opencv' in matches.group(): + # tmp_file_content.append(line) with open(tmp_file_path.absolute(), 'w') as tmp_file: tmp_file.write(''.join(tmp_file_content)) @@ -130,6 +135,7 @@ def run_preprocessor(self): preprocessed_header_lines.append(line) preprocessed_header_content = '\n'.join(preprocessed_header_lines) preprocessed_header_content = preprocessed_header_content.replace('#include<', '#include <') # Bug in cpp header parser + return preprocessed_header_content def generate_binding_code(self) -> None: From b137a0a62aea92a1875719f3f70a7d86513a9eb6 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Mon, 30 Oct 2023 17:23:13 +0100 Subject: [PATCH 094/169] Exporting struct and class public properties --- .../visp_python_bindgen/doc_parser.py | 6 ++--- .../generator/visp_python_bindgen/header.py | 24 ++++++++++++++++--- 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/modules/python/generator/visp_python_bindgen/doc_parser.py b/modules/python/generator/visp_python_bindgen/doc_parser.py index b3a4d3a14b..e0f39a555a 100644 --- a/modules/python/generator/visp_python_bindgen/doc_parser.py +++ b/modules/python/generator/visp_python_bindgen/doc_parser.py @@ -259,9 +259,9 @@ def __init__(self, path: Optional[Path], env_mapping: Dict[str, str]): method.const = is_const signature = MethodDocSignature(method_def.name, - get_type(method.return_type, {}, env_mapping) or '', # Don't use specializations so that we can match with doc - [get_type(param.type, {}, env_mapping) or '' for param in method.parameters], - method.const, method.static) + get_type(method.return_type, {}, env_mapping) or '', # Don't use specializations so that we can match with doc + [get_type(param.type, {}, env_mapping) or '' for param in method.parameters], + method.const, method.static) key = (compounddef.get_compoundname(), signature) if key in methods_res: num_paras = len(method_def.detaileddescription.para) + len(method_def.briefdescription.para) diff --git a/modules/python/generator/visp_python_bindgen/header.py b/modules/python/generator/visp_python_bindgen/header.py index ce19465115..8c09d58ba4 100644 --- a/modules/python/generator/visp_python_bindgen/header.py +++ b/modules/python/generator/visp_python_bindgen/header.py @@ -140,7 +140,6 @@ def run_preprocessor(self): def generate_binding_code(self) -> None: assert self.header_repr is not None, 'The header was not preprocessed before calling the generation step!' - self.binding_code = self.parse_data() def compute_environment(self): @@ -371,8 +370,27 @@ def generate_class_with_potiental_specialization(name_python: str, owner_specs: print(error_generating_overloads) raise RuntimeError - #spec_result += cls_result - return '\n'.join(method_strs) + field_strs = [] + for field in cls.fields: + if field.access == 'public': + if is_unsupported_argument_type(field.type): + continue + field_type = get_type(field.type, owner_specs, header_env.mapping) + print(f'Field in {name_cpp}: {field_type} {field.name}') + + field_name_python = field.name.lstrip('m_') + + def_str = 'def_' + def_str += 'readonly' if field.type.const else 'readwrite' + if field.static: + def_str += '_static' + + field_str = f'{python_ident}.{def_str}("{field_name_python}", &{name_cpp}::{field.name});' + field_strs.append(field_str) + + definitions_strs = method_strs + field_strs + + return '\n'.join(definitions_strs) name_cpp_no_template = '::'.join([seg.name for seg in cls.class_decl.typename.segments]) From 2072700ffac7bbe7aa8ee07a751bd33d448fca7d Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Tue, 31 Oct 2023 12:17:48 +0100 Subject: [PATCH 095/169] fix exported attributes, remove the forced opencv includes --- modules/python/config/core.json | 5 ++++- .../generator/visp_python_bindgen/generator_config.py | 1 + modules/python/generator/visp_python_bindgen/header.py | 7 +++++-- modules/python/generator/visp_python_bindgen/submodule.py | 1 + 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/modules/python/config/core.json b/modules/python/config/core.json index a6422b5876..991e08ac3a 100644 --- a/modules/python/config/core.json +++ b/modules/python/config/core.json @@ -13,6 +13,9 @@ } }, "classes": { + "vpIoTools": { + "ignored_attributes": ["separator"] + }, "vpArray2D": { "additional_bindings": "bindings_vpArray2D", "use_buffer_protocol": true, @@ -286,4 +289,4 @@ } } -} \ No newline at end of file +} diff --git a/modules/python/generator/visp_python_bindgen/generator_config.py b/modules/python/generator/visp_python_bindgen/generator_config.py index c4d2a07b79..aae4193bde 100644 --- a/modules/python/generator/visp_python_bindgen/generator_config.py +++ b/modules/python/generator/visp_python_bindgen/generator_config.py @@ -87,6 +87,7 @@ class GeneratorConfig(object): 'vp_deprecated': '', # remove symbol as it messes up the cxxheaderparsing 'DOXYGEN_SHOULD_SKIP_THIS': None, # Do not generate methods that do not appear in public api doc 'NLOHMANN_JSON_SERIALIZE_ENUM(a,...)': 'void ignored() {}', # Remove json enum serialization as it cnanot correctly be parsed + 'CV_OUT': '', # In vpKeyPoint, this appears and breaks parsing }, never_defined=[ 'VISP_BUILD_DEPRECATED_FUNCTIONS', # Do not bind deprecated functions diff --git a/modules/python/generator/visp_python_bindgen/header.py b/modules/python/generator/visp_python_bindgen/header.py index 8c09d58ba4..d0c278841e 100644 --- a/modules/python/generator/visp_python_bindgen/header.py +++ b/modules/python/generator/visp_python_bindgen/header.py @@ -100,7 +100,7 @@ def run_preprocessor(self): # Includes that should be appended at the start of every file forced_includes = [ 'visp3/core/vpConfig.h', # Always include vpConfig: ensure that VISP macros are correctly defined - 'opencv2/opencv.hpp' + 'opencv2/opencv_modules.hpp' ] for include in forced_includes: tmp_file_content.append(f'#include <{include}>\n') @@ -133,7 +133,7 @@ def run_preprocessor(self): for line in header_file.readlines(): if not line.startswith('#define'): preprocessed_header_lines.append(line) - preprocessed_header_content = '\n'.join(preprocessed_header_lines) + preprocessed_header_content = ''.join(preprocessed_header_lines) preprocessed_header_content = preprocessed_header_content.replace('#include<', '#include <') # Bug in cpp header parser return preprocessed_header_content @@ -372,9 +372,12 @@ def generate_class_with_potiental_specialization(name_python: str, owner_specs: field_strs = [] for field in cls.fields: + if field.name in cls_config['ignored_attributes']: + continue if field.access == 'public': if is_unsupported_argument_type(field.type): continue + field_type = get_type(field.type, owner_specs, header_env.mapping) print(f'Field in {name_cpp}: {field_type} {field.name}') diff --git a/modules/python/generator/visp_python_bindgen/submodule.py b/modules/python/generator/visp_python_bindgen/submodule.py index 8f51b54d5d..69ffbe8df9 100644 --- a/modules/python/generator/visp_python_bindgen/submodule.py +++ b/modules/python/generator/visp_python_bindgen/submodule.py @@ -156,6 +156,7 @@ def get_class_config(self, class_name: str) -> Optional[Dict]: default_config = { 'methods': [], 'operators': [], + 'ignored_attributes': [], 'use_buffer_protocol': False, 'additional_bindings': None, 'ignore_repr': False, From 21c2f84a8b1cea399ad56dc38b7396413d6a9b2f Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Tue, 31 Oct 2023 17:01:39 +0100 Subject: [PATCH 096/169] cleanup python doc, support for unary operators --- modules/python/CMakeLists.txt | 6 - modules/python/docs/Makefile | 216 ------------------ .../docs/_templates/custom-class-template.rst | 4 +- .../_templates/custom-module-template.rst | 3 +- modules/python/docs/conf.py.in | 2 +- modules/python/docs/todos.rst | 13 +- .../generator/visp_python_bindgen/header.py | 11 + .../generator/visp_python_bindgen/methods.py | 7 + 8 files changed, 26 insertions(+), 236 deletions(-) delete mode 100644 modules/python/docs/Makefile diff --git a/modules/python/CMakeLists.txt b/modules/python/CMakeLists.txt index 36522bb1b8..c45008afee 100644 --- a/modules/python/CMakeLists.txt +++ b/modules/python/CMakeLists.txt @@ -38,7 +38,6 @@ set(python_bindings_cpp_src "${bindings_gen_location}/src/main.cpp") foreach(module ${python_bound_modules}) get_target_property(dirs "${module}" INCLUDE_DIRECTORIES) - message("Dirs = ${dirs}") string(REPLACE "visp_" "" clean_module_name ${module}) set(cpp_src "${bindings_gen_location}/src/${clean_module_name}.cpp") list(APPEND python_bindings_cpp_src "${cpp_src}") @@ -93,8 +92,6 @@ set(json_defines "{}") string(JSON json_defines SET ${json_defines} "__cplusplus" "${VISP_CXX_STANDARD}") # Compiler if(CMAKE_COMPILER_IS_GNUCXX) - message("${CMAKE_CXX_COMPILER_VERSION}") - string(REPLACE "." ";" GCC_VERSION_LIST ${CMAKE_CXX_COMPILER_VERSION}) list(GET GCC_VERSION_LIST 0 GCC_MAJOR) list(GET GCC_VERSION_LIST 1 GCC_MINOR) @@ -105,8 +102,6 @@ if(CMAKE_COMPILER_IS_GNUCXX) string(JSON json_defines SET ${json_defines} "__GNUC_PATCHLEVEL__" "${GCC_PATCH}") endif() if(CMAKE_COMPILER_IS_CLANGCXX) - message("${CMAKE_CXX_COMPILER_VERSION}") - string(REPLACE "." ";" CLANG_VERSION_LIST ${CMAKE_CXX_COMPILER_VERSION}) list(GET CLANG_VERSION_LIST 0 CLANG_MAJOR) list(GET CLANG_VERSION_LIST 1 CLANG_MINOR) @@ -138,7 +133,6 @@ if(APPLE) string(JSON json_defines SET ${json_defines} "__APPLE__" "null") string(JSON json_defines SET ${json_defines} "__MACH__" "null") endif() -message("${json_defines}") string(JSON json_config_file SET ${json_config_file} "defines" ${json_defines}) diff --git a/modules/python/docs/Makefile b/modules/python/docs/Makefile deleted file mode 100644 index 8195292574..0000000000 --- a/modules/python/docs/Makefile +++ /dev/null @@ -1,216 +0,0 @@ -# Makefile for Sphinx documentation -# - -# You can set these variables from the command line. -SPHINXOPTS = -SPHINXBUILD = sphinx-build -PAPER = -BUILDDIR = _build - -# User-friendly check for sphinx-build -ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1) -$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/) -endif - -# Internal variables. -PAPEROPT_a4 = -D latex_paper_size=a4 -PAPEROPT_letter = -D latex_paper_size=letter -ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . -# the i18n builder cannot share the environment and doctrees with the others -I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . - -.PHONY: help -help: - @echo "Please use \`make ' where is one of" - @echo " html to make standalone HTML files" - @echo " dirhtml to make HTML files named index.html in directories" - @echo " singlehtml to make a single large HTML file" - @echo " pickle to make pickle files" - @echo " json to make JSON files" - @echo " htmlhelp to make HTML files and a HTML help project" - @echo " qthelp to make HTML files and a qthelp project" - @echo " applehelp to make an Apple Help Book" - @echo " devhelp to make HTML files and a Devhelp project" - @echo " epub to make an epub" - @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" - @echo " latexpdf to make LaTeX files and run them through pdflatex" - @echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx" - @echo " text to make text files" - @echo " man to make manual pages" - @echo " texinfo to make Texinfo files" - @echo " info to make Texinfo files and run them through makeinfo" - @echo " gettext to make PO message catalogs" - @echo " changes to make an overview of all changed/added/deprecated items" - @echo " xml to make Docutils-native XML files" - @echo " pseudoxml to make pseudoxml-XML files for display purposes" - @echo " linkcheck to check all external links for integrity" - @echo " doctest to run all doctests embedded in the documentation (if enabled)" - @echo " coverage to run coverage check of the documentation (if enabled)" - -.PHONY: clean -clean: - rm -rf $(BUILDDIR)/* - -.PHONY: html -html: - $(SPHINXBUILD) -v -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html - @echo - @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." - -.PHONY: dirhtml -dirhtml: - $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml - @echo - @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." - -.PHONY: singlehtml -singlehtml: - $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml - @echo - @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." - -.PHONY: pickle -pickle: - $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle - @echo - @echo "Build finished; now you can process the pickle files." - -.PHONY: json -json: - $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json - @echo - @echo "Build finished; now you can process the JSON files." - -.PHONY: htmlhelp -htmlhelp: - $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp - @echo - @echo "Build finished; now you can run HTML Help Workshop with the" \ - ".hhp project file in $(BUILDDIR)/htmlhelp." - -.PHONY: qthelp -qthelp: - $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp - @echo - @echo "Build finished; now you can run "qcollectiongenerator" with the" \ - ".qhcp project file in $(BUILDDIR)/qthelp, like this:" - @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/python_example.qhcp" - @echo "To view the help file:" - @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/python_example.qhc" - -.PHONY: applehelp -applehelp: - $(SPHINXBUILD) -b applehelp $(ALLSPHINXOPTS) $(BUILDDIR)/applehelp - @echo - @echo "Build finished. The help book is in $(BUILDDIR)/applehelp." - @echo "N.B. You won't be able to view it unless you put it in" \ - "~/Library/Documentation/Help or install it in your application" \ - "bundle." - -.PHONY: devhelp -devhelp: - $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp - @echo - @echo "Build finished." - @echo "To view the help file:" - @echo "# mkdir -p $$HOME/.local/share/devhelp/python_example" - @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/python_example" - @echo "# devhelp" - -.PHONY: epub -epub: - $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub - @echo - @echo "Build finished. The epub file is in $(BUILDDIR)/epub." - -.PHONY: latex -latex: - $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex - @echo - @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." - @echo "Run \`make' in that directory to run these through (pdf)latex" \ - "(use \`make latexpdf' here to do that automatically)." - -.PHONY: latexpdf -latexpdf: - $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex - @echo "Running LaTeX files through pdflatex..." - $(MAKE) -C $(BUILDDIR)/latex all-pdf - @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." - -.PHONY: latexpdfja -latexpdfja: - $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex - @echo "Running LaTeX files through platex and dvipdfmx..." - $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja - @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." - -.PHONY: text -text: - $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text - @echo - @echo "Build finished. The text files are in $(BUILDDIR)/text." - -.PHONY: man -man: - $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man - @echo - @echo "Build finished. The manual pages are in $(BUILDDIR)/man." - -.PHONY: texinfo -texinfo: - $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo - @echo - @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." - @echo "Run \`make' in that directory to run these through makeinfo" \ - "(use \`make info' here to do that automatically)." - -.PHONY: info -info: - $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo - @echo "Running Texinfo files through makeinfo..." - make -C $(BUILDDIR)/texinfo info - @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." - -.PHONY: gettext -gettext: - $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale - @echo - @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." - -.PHONY: changes -changes: - $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes - @echo - @echo "The overview file is in $(BUILDDIR)/changes." - -.PHONY: linkcheck -linkcheck: - $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck - @echo - @echo "Link check complete; look for any errors in the above output " \ - "or in $(BUILDDIR)/linkcheck/output.txt." - -.PHONY: doctest -doctest: - $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest - @echo "Testing of doctests in the sources finished, look at the " \ - "results in $(BUILDDIR)/doctest/output.txt." - -.PHONY: coverage -coverage: - $(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(BUILDDIR)/coverage - @echo "Testing of coverage in the sources finished, look at the " \ - "results in $(BUILDDIR)/coverage/python.txt." - -.PHONY: xml -xml: - $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml - @echo - @echo "Build finished. The XML files are in $(BUILDDIR)/xml." - -.PHONY: pseudoxml -pseudoxml: - $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml - @echo - @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml." diff --git a/modules/python/docs/_templates/custom-class-template.rst b/modules/python/docs/_templates/custom-class-template.rst index ed587e9843..a36d943ba5 100644 --- a/modules/python/docs/_templates/custom-class-template.rst +++ b/modules/python/docs/_templates/custom-class-template.rst @@ -6,7 +6,7 @@ :members: :show-inheritance: :member-order: groupwise - :inherited-members: pybind11_object, pybind11_type + :inherited-members: pybind11_builtins.pybind11_object :special-members: {% block methods %} @@ -60,4 +60,4 @@ ~{{ name }}.{{ item }} {%- endfor %} {% endif %} - {% endblock %} \ No newline at end of file + {% endblock %} diff --git a/modules/python/docs/_templates/custom-module-template.rst b/modules/python/docs/_templates/custom-module-template.rst index 6af2a258cf..22bd4a50b6 100644 --- a/modules/python/docs/_templates/custom-module-template.rst +++ b/modules/python/docs/_templates/custom-module-template.rst @@ -19,7 +19,6 @@ .. rubric:: {{ _('Functions') }} .. autosummary:: - :toctree: :nosignatures: {% for item in functions %} {{ item }} @@ -63,4 +62,4 @@ {{ item }} {%- endfor %} {% endif %} -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/modules/python/docs/conf.py.in b/modules/python/docs/conf.py.in index 3a01d6ecc0..c2713cdeac 100644 --- a/modules/python/docs/conf.py.in +++ b/modules/python/docs/conf.py.in @@ -177,7 +177,7 @@ html_theme_options = { # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ["_static"] +html_static_path = [] # Add any extra paths that contain custom files (such as robots.txt or # .htaccess) here, relative to this directory. These files are copied diff --git a/modules/python/docs/todos.rst b/modules/python/docs/todos.rst index e8f3f881f7..c98134ed2e 100644 --- a/modules/python/docs/todos.rst +++ b/modules/python/docs/todos.rst @@ -13,7 +13,7 @@ Code generation ------------------- * There is an issue when indexing readonly arrays such as HomogeneousMatrix or RotationMatrix -* Unary and n ary operators +* n ary operators * Exclude get operators for vpArray2D ? * Parse subnamespaces @@ -30,6 +30,8 @@ Code generation * Keep alive * GIL scope +* Add callback for before_module and after_module so that we can define additional bindings by hand in the module. This is already done per class +* Add a way to replace a default method binding with a custom one (What about doc?) Documentation ---------------- @@ -44,8 +46,7 @@ Documentation * Reference python types in Documentation * Prefer Python examples instead of C++ ones ? -* Add callback for before_module and after_module so that we can define additional bindings by hand in the module. This is already done per class -* Add a way to replace a default method binding with a custom one (What about doc?) + To be written: * Specific changes from C++ to Python API @@ -59,14 +60,8 @@ Packaging * Root CMake - * Build last * Build after doc if doc can be generated - * Correspondance between headers and modules - * Copy to binary dir - * Compile in binary dir -* Package generator to install as an editable -* Automatic version Python side ----------------- diff --git a/modules/python/generator/visp_python_bindgen/header.py b/modules/python/generator/visp_python_bindgen/header.py index d0c278841e..feba7efee2 100644 --- a/modules/python/generator/visp_python_bindgen/header.py +++ b/modules/python/generator/visp_python_bindgen/header.py @@ -285,6 +285,8 @@ def generate_class_with_potiental_specialization(name_python: str, owner_specs: # Operator definitions binary_return_ops = supported_const_return_binary_op_map() binary_in_place_ops = supported_in_place_binary_op_map() + unary_return_ops = supported_const_return_unary_op_map() + for method, method_config in operators: method_name = get_name(method.name) @@ -299,6 +301,15 @@ def generate_class_with_potiental_specialization(name_python: str, owner_specs: self.submodule.report.add_non_generated_method(rejection) continue elif len(params_strs) < 1: + for cpp_op, python_op_name in unary_return_ops.items(): + if method_name == f'operator{cpp_op}': + operator_str = f''' +{python_ident}.def("__{python_op_name}__", []({"const" if method_is_const else ""} {name_cpp}& self) {{ + return {cpp_op}self; +}}, {", ".join(py_args)});''' + method_strs.append(operator_str) + break + print(f'Found unary operator {name_cpp}::{method_name}, skipping') continue for cpp_op, python_op_name in binary_return_ops.items(): diff --git a/modules/python/generator/visp_python_bindgen/methods.py b/modules/python/generator/visp_python_bindgen/methods.py index 9f55d206d7..ba555cc311 100644 --- a/modules/python/generator/visp_python_bindgen/methods.py +++ b/modules/python/generator/visp_python_bindgen/methods.py @@ -56,6 +56,7 @@ def supported_const_return_binary_op_map(): '|': 'or', '^': 'xor', } + def supported_in_place_binary_op_map(): return { '+=': 'iadd', @@ -63,6 +64,12 @@ def supported_in_place_binary_op_map(): '-=': 'isub', '/=': 'itruediv', } + +def supported_const_return_unary_op_map(): + return { + '-': 'neg', + '~': 'invert', + } def find_and_define_repr_str(cls: ClassScope, cls_name: str, python_ident: str) -> str: for friend in cls.friends: if friend.fn is not None: From ec87c87aaa94e0b5855d17769490e817e394047b Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Tue, 31 Oct 2023 17:17:54 +0100 Subject: [PATCH 097/169] cleaning up operator list in documentation --- modules/python/docs/_templates/custom-class-template.rst | 2 +- modules/python/docs/conf.py.in | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/python/docs/_templates/custom-class-template.rst b/modules/python/docs/_templates/custom-class-template.rst index a36d943ba5..737f7c8986 100644 --- a/modules/python/docs/_templates/custom-class-template.rst +++ b/modules/python/docs/_templates/custom-class-template.rst @@ -44,7 +44,7 @@ .. autosummary:: :nosignatures: {% for item in members %} - {%- if item.startswith('__') and item.endswith('__') and item not in ['__new__', '__repr__', '__hash__', '__init__', '__doc__', '__module__', '__reduce__', '__reduce_ex__', '__subclasshook__'] %} + {%- if item not in inherited_members and item.startswith('__') and item.endswith('__') %} ~{{ name }}.{{ item }} {%- endif -%} {%- endfor %} diff --git a/modules/python/docs/conf.py.in b/modules/python/docs/conf.py.in index c2713cdeac..28b7c8f169 100644 --- a/modules/python/docs/conf.py.in +++ b/modules/python/docs/conf.py.in @@ -332,4 +332,4 @@ texinfo_documents = [ # Example configuration for intersphinx: refer to the Python standard library. -intersphinx_mapping = {"https://docs.python.org/": None} +intersphinx_mapping = {"python": ("https://docs.python.org/", None)} From 4ac87c0a22640ac05fdd5c3b368918aa0def61ed Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Thu, 2 Nov 2023 15:43:30 +0100 Subject: [PATCH 098/169] Define new extra target, visp_doc_xml, and depend on it from python --- CMakeLists.txt | 26 ++++ cmake/VISPExtraTargets.cmake | 8 ++ doc/config-doxygen.in | 177 +++++++++++++--------------- modules/python/CMakeLists.txt | 117 +++--------------- modules/python/GenerateConfig.cmake | 97 +++++++++++++++ 5 files changed, 231 insertions(+), 194 deletions(-) create mode 100644 modules/python/GenerateConfig.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 075385b70b..8019e1cbac 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -775,10 +775,36 @@ if(DOXYGEN_FOUND) set(DOXYGEN_USE_MATHJAX "NO") endif() + # HTML version of the doc + set(DOXYGEN_GENERATE_HTML "YES") + set(DOXYGEN_GENERATE_XML "NO") + set(DOXYGEN_GENERATE_TEST_LIST "YES") + set(DOXYGEN_INPUTS + "${VISP_SOURCE_DIR}/modules" + "${VISP_SOURCE_DIR}/example" + "${VISP_SOURCE_DIR}/tutorial" + "${VISP_SOURCE_DIR}/demo" + "${VISP_SOURCE_DIR}/doc" + "${VISP_BINARY_DIR}/doc" + "${VISP_CONTRIB_MODULES_PATH}" + ) + string (REPLACE ";" " " DOXYGEN_INPUTS "${DOXYGEN_INPUTS}") configure_file(${VISP_SOURCE_DIR}/doc/config-doxygen.in ${VISP_DOC_DIR}/config-doxygen @ONLY ) + # XML version of the doc + set(DOXYGEN_GENERATE_HTML "NO") + set(DOXYGEN_GENERATE_XML "YES") + set(DOXYGEN_GENERATE_TEST_LIST "NO") + set(DOXYGEN_INPUTS + "${VISP_SOURCE_DIR}/modules" + ) + string (REPLACE ";" " " DOXYGEN_INPUTS "${DOXYGEN_INPUTS}") + configure_file(${VISP_SOURCE_DIR}/doc/config-doxygen.in + ${VISP_DOC_DIR}/config-doxygen-xml + @ONLY ) + # set vars used in mainpage.dox.in # - VISP_MAINPAGE_EXTENSION set(VISP_MAINPAGE_EXTENSION "") diff --git a/cmake/VISPExtraTargets.cmake b/cmake/VISPExtraTargets.cmake index 19d4ffb6c1..0b30a5267c 100644 --- a/cmake/VISPExtraTargets.cmake +++ b/cmake/VISPExtraTargets.cmake @@ -57,17 +57,25 @@ if(DOXYGEN_FOUND) COMMAND "${DOXYGEN_EXECUTABLE}" "${VISP_DOC_DIR}/config-doxygen" DEPENDS "${VISP_DOC_DIR}/config-doxygen" ) + add_custom_target(visp_doc_xml + COMMAND "${DOXYGEN_EXECUTABLE}" "${VISP_DOC_DIR}/config-doxygen-xml" + DEPENDS "${VISP_DOC_DIR}/config-doxygen-xml" + ) if(CMAKE_GENERATOR MATCHES "Xcode") add_dependencies(visp_doc man) # developer_scripts not available when Xcode + add_dependencies(visp_doc man) elseif(UNIX AND NOT ANDROID) # man target available only on unix add_dependencies(visp_doc man developer_scripts) + add_dependencies(visp_doc_xml man developer_scripts) elseif(NOT(MINGW OR IOS)) add_dependencies(visp_doc developer_scripts) + add_dependencies(visp_doc_xml developer_scripts) endif() if(ENABLE_SOLUTION_FOLDERS) set_target_properties(visp_doc PROPERTIES FOLDER "extra") + set_target_properties(visp_doc_xml PROPERTIES FOLDER "extra") set_target_properties(html-doc PROPERTIES FOLDER "extra") endif() endif() diff --git a/doc/config-doxygen.in b/doc/config-doxygen.in index 9db3daa448..4372c7a145 100644 --- a/doc/config-doxygen.in +++ b/doc/config-doxygen.in @@ -1,158 +1,158 @@ # Doxyfile 1.8.17 # This file describes the settings to be used by the documentation system -# doxygen(www.doxygen.org) for a project. +# doxygen (www.doxygen.org) for a project. # -# All text after a double hash(##) is considered a comment and is placed in +# All text after a double hash (##) is considered a comment and is placed in # front of the TAG it is preceding. # -# All text after a single hash(#) is considered a comment and will be ignored. -# The format is : -# TAG = value[value, ...] +# All text after a single hash (#) is considered a comment and will be ignored. +# The format is: +# TAG = value [value, ...] # For lists, items can also be appended using: -# TAG += value[value, ...] -# Values that contain spaces should be placed between quotes(\" \"). +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (\" \"). #--------------------------------------------------------------------------- # Project related configuration options #--------------------------------------------------------------------------- # This tag specifies the encoding used for all characters in the configuration -# file that follow.The default is UTF-8 which is also the encoding used for all -# text before the first occurrence of this tag.Doxygen uses libiconv(or the - # iconv built into libc) for the transcoding.See +# file that follow. The default is UTF-8 which is also the encoding used for all +# text before the first occurrence of this tag. Doxygen uses libiconv (or the +# iconv built into libc) for the transcoding. See # https://www.gnu.org/software/libiconv/ for the list of possible encodings. -# The default value is : UTF-8. +# The default value is: UTF-8. -DOXYFILE_ENCODING = UTF-8 +DOXYFILE_ENCODING = UTF-8 -# The PROJECT_NAME tag is a single word(or a sequence of words surrounded by +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by # double-quotes, unless you are using Doxywizard) that should identify the -# project for which the documentation is generated.This name is used in the +# project for which the documentation is generated. This name is used in the # title of most generated pages and in a few other places. -# The default value is : My Project. +# The default value is: My Project. -PROJECT_NAME = "Visual Servoing Platform" +PROJECT_NAME = "Visual Servoing Platform" -# The PROJECT_NUMBER tag can be used to enter a project or revision number.This +# The PROJECT_NUMBER tag can be used to enter a project or revision number. This # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = "version @VISP_VERSION@" +PROJECT_NUMBER = "version @VISP_VERSION@" # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a -# quick idea about the purpose of the project.Keep the description short. +# quick idea about the purpose of the project. Keep the description short. -PROJECT_BRIEF = +PROJECT_BRIEF = # With the PROJECT_LOGO tag one can specify a logo or an icon that is included -# in the documentation.The maximum height of the logo should not exceed 55 -# pixels and the maximum width should not exceed 200 pixels.Doxygen will copy +# in the documentation. The maximum height of the logo should not exceed 55 +# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy # the logo to the output directory. -PROJECT_LOGO = "@VISP_SOURCE_DIR@/doc/image/logo/img-logo-visp.png" +PROJECT_LOGO = "@VISP_SOURCE_DIR@/doc/image/logo/img-logo-visp.png" -# The OUTPUT_DIRECTORY tag is used to specify the(relative or absolute) path -# into which the generated documentation will be written.If a relative path is -# entered, it will be relative to the location where doxygen was started.If +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path +# into which the generated documentation will be written. If a relative path is +# entered, it will be relative to the location where doxygen was started. If # left blank the current directory will be used. -OUTPUT_DIRECTORY = doc +OUTPUT_DIRECTORY = doc # If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub- -# directories(in 2 levels) under the output directory of each output format and -# will distribute the generated files over these directories.Enabling this +# directories (in 2 levels) under the output directory of each output format and +# will distribute the generated files over these directories. Enabling this # option can be useful when feeding doxygen a huge amount of source files, where # putting all generated files in the same directory would otherwise causes # performance problems for the file system. -# The default value is : NO. +# The default value is: NO. -CREATE_SUBDIRS = NO +CREATE_SUBDIRS = NO # If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII -# characters to appear in the names of generated files.If set to NO, non-ASCII +# characters to appear in the names of generated files. If set to NO, non-ASCII # characters will be escaped, for example _xE3_x81_x84 will be used for Unicode # U+3044. -# The default value is : NO. +# The default value is: NO. -ALLOW_UNICODE_NAMES = NO +ALLOW_UNICODE_NAMES = NO # The OUTPUT_LANGUAGE tag is used to specify the language in which all -# documentation generated by doxygen is written.Doxygen will use this +# documentation generated by doxygen is written. Doxygen will use this # information to generate all constant output in the proper language. -# Possible values are : Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese, -# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English(United States), -# Esperanto, Farsi(Persian), Finnish, French, German, Greek, Hungarian, -# Indonesian, Italian, Japanese, Japanese-en(Japanese with English messages), -# Korean, Korean-en(Korean with English messages), Latvian, Lithuanian, -# Macedonian, Norwegian, Persian(Farsi), Polish, Portuguese, Romanian, Russian, +# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese, +# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States), +# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian, +# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages), +# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian, +# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian, # Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish, # Ukrainian and Vietnamese. -# The default value is : English. +# The default value is: English. -OUTPUT_LANGUAGE = English +OUTPUT_LANGUAGE = English # The OUTPUT_TEXT_DIRECTION tag is used to specify the direction in which all -# documentation generated by doxygen is written.Doxygen will use this +# documentation generated by doxygen is written. Doxygen will use this # information to generate all generated output in the proper direction. -# Possible values are : None, LTR, RTL and Context. -# The default value is : None. +# Possible values are: None, LTR, RTL and Context. +# The default value is: None. -OUTPUT_TEXT_DIRECTION = None +OUTPUT_TEXT_DIRECTION = None # If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member # descriptions after the members that are listed in the file and class -# documentation(similar to Javadoc).Set to NO to disable this. -# The default value is : YES. +# documentation (similar to Javadoc). Set to NO to disable this. +# The default value is: YES. -BRIEF_MEMBER_DESC = NO +BRIEF_MEMBER_DESC = NO # If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief # description of a member or function before the detailed description # # Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the # brief descriptions will be completely suppressed. -# The default value is : YES. +# The default value is: YES. -REPEAT_BRIEF = YES +REPEAT_BRIEF = YES # This tag implements a quasi-intelligent brief description abbreviator that is -# used to form the text in various listings.Each string in this list, if found +# used to form the text in various listings. Each string in this list, if found # as the leading text of the brief description, will be stripped from the text # and the result, after processing the whole list, is used as the annotated -# text.Otherwise, the brief description is used as-is.If left blank, the -# following values are used($name is automatically replaced with the name of -# the entity) :The $name class, The $name widget, The $name file, is, provides, +# text. Otherwise, the brief description is used as-is. If left blank, the +# following values are used ($name is automatically replaced with the name of +# the entity):The $name class, The $name widget, The $name file, is, provides, # specifies, contains, represents, a, an and the. -ABBREVIATE_BRIEF = +ABBREVIATE_BRIEF = # If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then # doxygen will generate a detailed section even if there is only a brief # description. -# The default value is : NO. +# The default value is: NO. -ALWAYS_DETAILED_SEC = YES +ALWAYS_DETAILED_SEC = YES # If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all # inherited members of a class in the documentation of that class as if those -# members were ordinary class members.Constructors, destructors and assignment +# members were ordinary class members. Constructors, destructors and assignment # operators of the base classes will not be shown. -# The default value is : NO. +# The default value is: NO. -INLINE_INHERITED_MEMB = YES +INLINE_INHERITED_MEMB = YES # If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path -# before files name in the file list and in the header files.If set to NO the +# before files name in the file list and in the header files. If set to NO the # shortest path that makes the file name unique will be used -# The default value is : YES. +# The default value is: YES. -FULL_PATH_NAMES = YES +FULL_PATH_NAMES = YES # The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. # Stripping is only done if one of the specified strings matches the left-hand -# part of the path.The tag can be used to show relative paths in the file list. +# part of the path. The tag can be used to show relative paths in the file list. # If left blank the directory from which doxygen is run is used as the path to # strip. # @@ -160,33 +160,33 @@ FULL_PATH_NAMES = YES # will be relative from the directory where doxygen is started. # This tag requires that the tag FULL_PATH_NAMES is set to YES. -STRIP_FROM_PATH = +STRIP_FROM_PATH = # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the # path mentioned in the documentation of a class, which tells the reader which -# header file to include in order to use a class.If left blank only the name of -# the header file containing the class definition is used.Otherwise one should +# header file to include in order to use a class. If left blank only the name of +# the header file containing the class definition is used. Otherwise one should # specify the list of include paths that are normally passed to the compiler # using the -I flag. -STRIP_FROM_INC_PATH = @DOXYGEN_STRIP_FROM_INC_PATH@ +STRIP_FROM_INC_PATH = @DOXYGEN_STRIP_FROM_INC_PATH@ -# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter(but -# less readable) file names.This can be useful is your file systems doesn't +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but +# less readable) file names. This can be useful is your file systems doesn't # support long names like on DOS, Mac, or CD-ROM. -# The default value is : NO. +# The default value is: NO. -SHORT_NAMES = NO +SHORT_NAMES = NO # If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the -# first line(until the first dot) of a Javadoc-style comment as the brief -# description.If set to NO, the Javadoc-style will behave just like regular Qt- -# style comments(thus requiring an explicit @brief command for a brief +# first line (until the first dot) of a Javadoc-style comment as the brief +# description. If set to NO, the Javadoc-style will behave just like regular Qt- +# style comments (thus requiring an explicit @brief command for a brief # description.) -# The default value is : NO. +# The default value is: NO. -JAVADOC_AUTOBRIEF = NO +JAVADOC_AUTOBRIEF = NO # If the JAVADOC_BANNER tag is set to YES then doxygen will interpret a line # such as @@ -658,7 +658,7 @@ GENERATE_TODOLIST = YES # list. This list is created by putting \test commands in the documentation. # The default value is: YES. -GENERATE_TESTLIST = YES +GENERATE_TESTLIST = @DOXYGEN_GENERATE_TEST_LIST@ # The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug # list. This list is created by putting \bug commands in the documentation. @@ -820,13 +820,7 @@ WARN_LOGFILE = warning.log # spaces. See also FILE_PATTERNS and EXTENSION_MAPPING # Note: If this tag is empty the current directory is searched. -INPUT = "@VISP_SOURCE_DIR@/modules" \ - "@VISP_SOURCE_DIR@/example" \ - "@VISP_SOURCE_DIR@/tutorial" \ - "@VISP_SOURCE_DIR@/demo" \ - "@VISP_SOURCE_DIR@/doc" \ - "@VISP_BINARY_DIR@/doc" \ - "@VISP_CONTRIB_MODULES_PATH@" +INPUT = @DOXYGEN_INPUTS@ # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses @@ -1114,7 +1108,7 @@ IGNORE_PREFIX = vp # If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output # The default value is: YES. -GENERATE_HTML = YES +GENERATE_HTML = @DOXYGEN_GENERATE_HTML@ # The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a # relative path is entered the value of OUTPUT_DIRECTORY will be put in front of @@ -1979,7 +1973,7 @@ MAN_LINKS = NO # captures the structure of the code including all documentation. # The default value is: NO. -GENERATE_XML = YES +GENERATE_XML = @DOXYGEN_GENERATE_XML@ # The XML_OUTPUT tag is used to specify where the XML pages will be put. If a # relative path is entered the value of OUTPUT_DIRECTORY will be put in front of @@ -1996,7 +1990,7 @@ XML_OUTPUT = xml # The default value is: YES. # This tag requires that the tag GENERATE_XML is set to YES. -XML_PROGRAMLISTING = YES +XML_PROGRAMLISTING = NO # If the XML_NS_MEMB_FILE_SCOPE tag is set to YES, doxygen will include # namespace members in file scope as well, matching the HTML output. @@ -2153,9 +2147,6 @@ PREDEFINED = @DOXYGEN_SHOULD_SKIP_THIS@ \ VISP_HAVE_COIN3D \ VISP_HAVE_COIN3D_AND_GUI \ VISP_HAVE_COMEDI \ - VISP_HAVE_CPP11_COMPATIBILITY \ - VISP_HAVE_CXX11 \ - VISP_CXX_STANDARD_98=@VISP_CXX_STANDARD_98@ \ VISP_CXX_STANDARD_11=@VISP_CXX_STANDARD_11@ \ VISP_CXX_STANDARD_14=@VISP_CXX_STANDARD_14@ \ VISP_CXX_STANDARD_17=@VISP_CXX_STANDARD_17@ \ diff --git a/modules/python/CMakeLists.txt b/modules/python/CMakeLists.txt index c45008afee..973dc0fc2b 100644 --- a/modules/python/CMakeLists.txt +++ b/modules/python/CMakeLists.txt @@ -25,10 +25,9 @@ set(python_ignored_modules "visp_python" "visp_java_bindings_generator" "visp_ja set(python_bound_modules ${VISP_MODULES_BUILD}) list(REMOVE_ITEM python_bound_modules ${python_ignored_modules}) -# Define ViSP module -# Configure +# Configure the different directories set(bindgen_package_location "${CMAKE_CURRENT_SOURCE_DIR}/generator") set(bindings_package_location "${CMAKE_CURRENT_SOURCE_DIR}/bindings") set(bindings_gen_location "${CMAKE_CURRENT_BINARY_DIR}/bindings") @@ -43,103 +42,7 @@ foreach(module ${python_bound_modules}) list(APPEND python_bindings_cpp_src "${cpp_src}") endforeach() -set(json_config_file "{}") -set(json_config_file_path "${CMAKE_CURRENT_BINARY_DIR}/cmake_config.json") - -# Paths to important directories -string(JSON json_config_file SET ${json_config_file} "xml_doc_path" "\"${VISP_DOC_DIR}/xml\"") -string(JSON json_config_file SET ${json_config_file} "build_dir" "\"${CMAKE_BINARY_DIR}\"") -string(JSON json_config_file SET ${json_config_file} "source_dir" "\"${CMAKE_SOURCE_DIR}\"") - -# Add include directories to config file -set(json_include_dirs "[]") -set(include_dirs_count 0) -foreach(include_dir ${VISP_INCLUDE_DIRS}) - string(JSON json_include_dirs SET ${json_include_dirs} "${include_dirs_count}" "\"${include_dir}\"") - MATH(EXPR include_dirs_count "${include_dirs_count}+1") -endforeach() -string(JSON json_config_file SET ${json_config_file} "include_dirs" "${json_include_dirs}") - - - -# For each bound module, add its headers and dependencies to config file -set(json_modules "{}") -foreach(module ${python_bound_modules}) - string(REPLACE "visp_" "" clean_module_name ${module}) - - string(JSON json_modules SET ${json_modules} ${clean_module_name} "{}") - - set(json_header_list "[]") - set(header_count 0) - foreach(module_header ${VISP_MODULE_${module}_HEADERS}) - string(JSON json_header_list SET ${json_header_list} "${header_count}" "\"${module_header}\"") - MATH(EXPR header_count "${header_count}+1") - endforeach() - string(JSON json_modules SET ${json_modules} ${clean_module_name} "headers" "${json_header_list}") - set(json_deps_list "[]") - set(dep_count 0) - foreach(dep ${VISP_MODULE_${module}_DEPS}) - string(REPLACE "visp_" "" clean_dep ${dep}) - string(JSON json_deps_list SET ${json_deps_list} "${dep_count}" "\"${clean_dep}\"") - MATH(EXPR dep_count "${dep_count}+1") - endforeach() - string(JSON json_modules SET ${json_modules} ${clean_module_name} "dependencies" "${json_deps_list}") -endforeach() -string(JSON json_config_file SET ${json_config_file} "modules" ${json_modules}) - -# See https://github.com/cpredef/predef/tree/master for compiler/OS specific #defines -set(json_defines "{}") -string(JSON json_defines SET ${json_defines} "__cplusplus" "${VISP_CXX_STANDARD}") -# Compiler -if(CMAKE_COMPILER_IS_GNUCXX) - string(REPLACE "." ";" GCC_VERSION_LIST ${CMAKE_CXX_COMPILER_VERSION}) - list(GET GCC_VERSION_LIST 0 GCC_MAJOR) - list(GET GCC_VERSION_LIST 1 GCC_MINOR) - list(GET GCC_VERSION_LIST 2 GCC_PATCH) - - string(JSON json_defines SET ${json_defines} "__GNUC__" "${GCC_MAJOR}") - string(JSON json_defines SET ${json_defines} "__GNUC_MINOR__" "${GCC_MINOR}") - string(JSON json_defines SET ${json_defines} "__GNUC_PATCHLEVEL__" "${GCC_PATCH}") -endif() -if(CMAKE_COMPILER_IS_CLANGCXX) - string(REPLACE "." ";" CLANG_VERSION_LIST ${CMAKE_CXX_COMPILER_VERSION}) - list(GET CLANG_VERSION_LIST 0 CLANG_MAJOR) - list(GET CLANG_VERSION_LIST 1 CLANG_MINOR) - list(GET CLANG_VERSION_LIST 2 CLANG_PATCH) - - string(JSON json_defines SET ${json_defines} "__clang__" "${CLANG_MAJOR}") - string(JSON json_defines SET ${json_defines} "__clang_minor__" "${CLANG_MINOR}") - string(JSON json_defines SET ${json_defines} "__clang_patchlevel__" "${CLANG_PATCH}") - string(JSON json_defines SET ${json_defines} "__clang_version__" "${CMAKE_CXX_COMPILER_VERSION}") -endif() - -if(MSVC) - string(JSON json_defines SET ${json_defines} "_MSC_VER" "${MSVC_VERSION}") -endif() - -if(MINGW) - string(JSON json_defines SET ${json_defines} "__MINGW32__" "null") -endif() -# OS -if(WIN32) - string(JSON json_defines SET ${json_defines} "_WIN32" "null") -endif() -if(UNIX) - string(JSON json_defines SET ${json_defines} "__linux__" "null") - string(JSON json_defines SET ${json_defines} "__unix__" "null") - string(JSON json_defines SET ${json_defines} "_unix" "null") -endif() -if(APPLE) - string(JSON json_defines SET ${json_defines} "__APPLE__" "null") - string(JSON json_defines SET ${json_defines} "__MACH__" "null") -endif() - -string(JSON json_config_file SET ${json_config_file} "defines" ${json_defines}) - - - - -file(WRITE ${json_config_file_path} "${json_config_file}") +include("${CMAKE_CURRENT_SOURCE_DIR}/GenerateConfig.cmake") # Step 2: Generate bindings @@ -152,11 +55,23 @@ file(GLOB config_files "${CMAKE_CURRENT_SOURCE_DIR}/config/*.json") file(GLOB_RECURSE python_sources "${CMAKE_CURRENT_SOURCE_DIR}/generator/visp_python_bindgen/*.py") set(pip_files "${CMAKE_CURRENT_SOURCE_DIR}/generator/pyproject.toml") +set(bindings_dependencies + ${python_bound_modules} + ${json_config_file_path} ${config_files} + ${python_sources} ${pip_files} +) +# If we have doxygen, we should first generate the XML documentation +# so that the binding stubs and doc is as complete as possible +if(DOXYGEN_FOUND) + list(APPEND bindings_dependencies visp_doc_xml) +endif() + add_custom_command( OUTPUT ${python_bindings_cpp_src} - COMMAND ${Python_EXECUTABLE} -m pip install ${_pip_args} -v ${bindgen_package_location} + COMMAND ${Python_EXECUTABLE} -m pip install ${_pip_args} ${bindgen_package_location} COMMAND ${Python_EXECUTABLE} -m visp_python_bindgen.generator --config "${CMAKE_CURRENT_SOURCE_DIR}/config" --build-folder ${bindings_gen_location} --main-config "${json_config_file_path}" - DEPENDS ${python_bound_modules} ${json_config_file_path} ${config_files} ${python_sources} ${pip_files} + DEPENDS ${bindings_dependencies} + COMMENT "Installing the bindings generator and running it..." ) add_custom_target( visp_python_bindings_generator_run diff --git a/modules/python/GenerateConfig.cmake b/modules/python/GenerateConfig.cmake new file mode 100644 index 0000000000..ef8823a743 --- /dev/null +++ b/modules/python/GenerateConfig.cmake @@ -0,0 +1,97 @@ +set(json_config_file "{}") +set(json_config_file_path "${CMAKE_CURRENT_BINARY_DIR}/cmake_config.json") + +# Paths to important directories +string(JSON json_config_file SET ${json_config_file} "xml_doc_path" "\"${VISP_DOC_DIR}/xml\"") +string(JSON json_config_file SET ${json_config_file} "build_dir" "\"${CMAKE_BINARY_DIR}\"") +string(JSON json_config_file SET ${json_config_file} "source_dir" "\"${CMAKE_SOURCE_DIR}\"") + +# Add include directories to config file +set(json_include_dirs "[]") +set(include_dirs_count 0) +foreach(include_dir ${VISP_INCLUDE_DIRS}) + string(JSON json_include_dirs SET ${json_include_dirs} "${include_dirs_count}" "\"${include_dir}\"") + MATH(EXPR include_dirs_count "${include_dirs_count}+1") +endforeach() +string(JSON json_config_file SET ${json_config_file} "include_dirs" "${json_include_dirs}") + + + +# For each bound module, add its headers and dependencies to config file +set(json_modules "{}") +foreach(module ${python_bound_modules}) + string(REPLACE "visp_" "" clean_module_name ${module}) + string(JSON json_modules SET ${json_modules} ${clean_module_name} "{}") + # Get module headers + set(json_header_list "[]") + set(header_count 0) + foreach(module_header ${VISP_MODULE_${module}_HEADERS}) + string(JSON json_header_list SET ${json_header_list} "${header_count}" "\"${module_header}\"") + MATH(EXPR header_count "${header_count}+1") + endforeach() + string(JSON json_modules SET ${json_modules} ${clean_module_name} "headers" "${json_header_list}") + # Get module dependencies + set(json_deps_list "[]") + set(dep_count 0) + foreach(dep ${VISP_MODULE_${module}_DEPS}) + string(REPLACE "visp_" "" clean_dep ${dep}) + string(JSON json_deps_list SET ${json_deps_list} "${dep_count}" "\"${clean_dep}\"") + MATH(EXPR dep_count "${dep_count}+1") + endforeach() + string(JSON json_modules SET ${json_modules} ${clean_module_name} "dependencies" "${json_deps_list}") +endforeach() +string(JSON json_config_file SET ${json_config_file} "modules" ${json_modules}) + +# Define platform specific macros +# These should be the same as those defined when compiling the visp libraries +# The impact will only be visible if the macros defined (or not) below appear in ViSP's headers +# See https://github.com/cpredef/predef/tree/master for compiler/OS specific #defines +set(json_defines "{}") +string(JSON json_defines SET ${json_defines} "__cplusplus" "${VISP_CXX_STANDARD}") +# Compiler +if(CMAKE_COMPILER_IS_GNUCXX) + string(REPLACE "." ";" GCC_VERSION_LIST ${CMAKE_CXX_COMPILER_VERSION}) + list(GET GCC_VERSION_LIST 0 GCC_MAJOR) + list(GET GCC_VERSION_LIST 1 GCC_MINOR) + list(GET GCC_VERSION_LIST 2 GCC_PATCH) + + string(JSON json_defines SET ${json_defines} "__GNUC__" "${GCC_MAJOR}") + string(JSON json_defines SET ${json_defines} "__GNUC_MINOR__" "${GCC_MINOR}") + string(JSON json_defines SET ${json_defines} "__GNUC_PATCHLEVEL__" "${GCC_PATCH}") +endif() +if(CMAKE_COMPILER_IS_CLANGCXX) + string(REPLACE "." ";" CLANG_VERSION_LIST ${CMAKE_CXX_COMPILER_VERSION}) + list(GET CLANG_VERSION_LIST 0 CLANG_MAJOR) + list(GET CLANG_VERSION_LIST 1 CLANG_MINOR) + list(GET CLANG_VERSION_LIST 2 CLANG_PATCH) + + string(JSON json_defines SET ${json_defines} "__clang__" "${CLANG_MAJOR}") + string(JSON json_defines SET ${json_defines} "__clang_minor__" "${CLANG_MINOR}") + string(JSON json_defines SET ${json_defines} "__clang_patchlevel__" "${CLANG_PATCH}") + string(JSON json_defines SET ${json_defines} "__clang_version__" "${CMAKE_CXX_COMPILER_VERSION}") +endif() + +if(MSVC) + string(JSON json_defines SET ${json_defines} "_MSC_VER" "${MSVC_VERSION}") +endif() + +if(MINGW) + string(JSON json_defines SET ${json_defines} "__MINGW32__" "null") +endif() +# OS +if(WIN32) + string(JSON json_defines SET ${json_defines} "_WIN32" "null") +endif() +if(UNIX) + string(JSON json_defines SET ${json_defines} "__linux__" "null") + string(JSON json_defines SET ${json_defines} "__unix__" "null") + string(JSON json_defines SET ${json_defines} "_unix" "null") +endif() +if(APPLE) + string(JSON json_defines SET ${json_defines} "__APPLE__" "null") + string(JSON json_defines SET ${json_defines} "__MACH__" "null") +endif() + +string(JSON json_config_file SET ${json_config_file} "defines" ${json_defines}) + +file(WRITE ${json_config_file_path} "${json_config_file}") From a61f8d43ab6a516b7d2e99ae3e1e7b2ffe2c5713 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Thu, 2 Nov 2023 18:01:51 +0100 Subject: [PATCH 099/169] start fixing numpy conversion for non writable arrays --- modules/python/bindings/include/core.hpp | 45 +++++++++++++------ modules/python/test/test.py | 31 ------------- modules/python/test/test_core_repr.py | 25 +++++++++++ .../test/{test_basic.py => test_numpy.py} | 43 ++++++++---------- 4 files changed, 76 insertions(+), 68 deletions(-) delete mode 100644 modules/python/test/test.py create mode 100644 modules/python/test/test_core_repr.py rename modules/python/test/{test_basic.py => test_numpy.py} (76%) diff --git a/modules/python/bindings/include/core.hpp b/modules/python/bindings/include/core.hpp index adac478a20..d750f77be2 100644 --- a/modules/python/bindings/include/core.hpp +++ b/modules/python/bindings/include/core.hpp @@ -198,22 +198,35 @@ void define_get_item_2d_array(PyClass &pyClass, bool readonly) } +const char *numpy_fn_doc_writable = R"doc( + Numpy view of the underlying array data. + This numpy view can be used to directly modify the array. +)doc"; + +const char *numpy_fn_doc_nonwritable = R"doc( + Numpy view of the underlying array data. + This numpy view cannot be modified. + If you try to modify the array, an exception will be raised. +)doc"; template void bindings_vpArray2D(py::class_> &pyArray2D) { pyArray2D.def_buffer(&get_buffer_info); + pyArray2D.def("numpy", [](vpArray2D &self) -> np_array_cf { - return np_array_cf(get_buffer_info(self), py::cast(self)); - }, R"doc(Numpy view of the underlying array data)doc"); - pyArray2D.def(py::init([](np_array_cf np_array) { + return py::cast(self).template cast >(); + }, numpy_fn_doc_writable); + + pyArray2D.def(py::init([](np_array_cf &np_array) { verify_array_shape_and_dims(np_array, 2, "ViSP 2D array"); const std::vector shape = np_array.request().shape; vpArray2D result(shape[0], shape[1]); copy_data_from_np(np_array, result.data); return result; })); + define_get_item_2d_array>, vpArray2D, T>(pyArray2D, false); } @@ -221,9 +234,11 @@ void bindings_vpMatrix(py::class_> &pyMatrix) { pyMatrix.def_buffer(&get_buffer_info); + pyMatrix.def("numpy", [](vpMatrix &self) -> np_array_cf { - return np_array_cf(get_buffer_info(self), py::cast(self)); - }, R"doc(Numpy view of the underlying array data)doc"); + return py::cast(self).cast>(); + }, numpy_fn_doc_writable); + pyMatrix.def(py::init([](np_array_cf np_array) { verify_array_shape_and_dims(np_array, 2, "ViSP Matrix"); const std::vector shape = np_array.request().shape; @@ -231,6 +246,7 @@ void bindings_vpMatrix(py::class_> &pyMatrix) copy_data_from_np(np_array, result.data); return result; })); + define_get_item_2d_array>, vpMatrix, double>(pyMatrix, false); } @@ -238,9 +254,11 @@ void bindings_vpMatrix(py::class_> &pyMatrix) void bindings_vpColVector(py::class_> &pyColVector) { pyColVector.def_buffer(&get_buffer_info); + pyColVector.def("numpy", [](vpColVector &self) -> np_array_cf { - return np_array_cf(get_buffer_info(self), py::cast(self)); - }, R"doc(Numpy view of the underlying array data)doc"); + return py::cast(self).cast>(); + }, numpy_fn_doc_writable); + pyColVector.def(py::init([](np_array_cf np_array) { verify_array_shape_and_dims(np_array, 1, "ViSP column vector"); const std::vector shape = np_array.request().shape; @@ -248,6 +266,7 @@ void bindings_vpColVector(py::class_> &pyColVecto copy_data_from_np(np_array, result.data); return result; })); + } void bindings_vpRowVector(py::class_> &pyRowVector) @@ -255,7 +274,7 @@ void bindings_vpRowVector(py::class_> &pyRowVecto pyRowVector.def_buffer(&get_buffer_info); pyRowVector.def("numpy", [](vpRowVector &self) -> np_array_cf { return np_array_cf(get_buffer_info(self), py::cast(self)); - }, R"doc(Numpy view of the underlying array data)doc"); + }, numpy_fn_doc_writable); pyRowVector.def(py::init([](np_array_cf np_array) { verify_array_shape_and_dims(np_array, 1, "ViSP row vector"); const std::vector shape = np_array.request().shape; @@ -271,8 +290,8 @@ void bindings_vpRotationMatrix(py::class_> & pyRotationMatrix.def_buffer(&get_buffer_info); pyRotationMatrix.def("numpy", [](vpRotationMatrix &self) -> np_array_cf { - return np_array_cf(get_buffer_info(self), py::cast(self)); - }, R"doc(Numpy view of the underlying array data. Cannot be written to.)doc"); + return py::cast(self).cast>(); + }, numpy_fn_doc_nonwritable); pyRotationMatrix.def(py::init([](np_array_cf np_array) { verify_array_shape_and_dims(np_array, { 3, 3 }, "ViSP rotation matrix"); const std::vector shape = np_array.request().shape; @@ -291,8 +310,8 @@ void bindings_vpHomogeneousMatrix(py::class_); pyHomogeneousMatrix.def("numpy", [](vpHomogeneousMatrix &self) -> np_array_cf { - return np_array_cf(get_buffer_info(self), py::cast(self)); - }, R"doc(Numpy view of the underlying array data. Cannot be written to.)doc"); + return py::cast(self).cast>(); + }, numpy_fn_doc_nonwritable); pyHomogeneousMatrix.def(py::init([](np_array_cf np_array) { verify_array_shape_and_dims(np_array, { 4, 4 }, "ViSP homogeneous matrix"); @@ -342,4 +361,4 @@ bindings_vpImage(py::class_> &pyImage) -#endif \ No newline at end of file +#endif diff --git a/modules/python/test/test.py b/modules/python/test/test.py deleted file mode 100644 index b345c59489..0000000000 --- a/modules/python/test/test.py +++ /dev/null @@ -1,31 +0,0 @@ -import visp -from visp.core import TranslationVector, ThetaUVector, Matrix -from visp.core import HomogeneousMatrix, ExponentialMap, UniRand, CameraParameters -from visp.core import ColVector - - -if __name__ == '__main__': - T = HomogeneousMatrix(TranslationVector(1, 0, 1), ThetaUVector(0.0, 0.0, 0.0)) - print(T) - print(f'Homogeneous matrix inverse \n{T.inverse()}') - v = ExponentialMap.inverse(M=T, delta_t=1.0) - print(f'Velocity = {v}') - TT = ExponentialMap.direct(v) - print(f'Original T = \n{T},\nExponentialMap inverse-direct: \n{TT}') - - v = ColVector([i ** 2 for i in range(5)]) - print(f'Vector of size {v.size()} with squared indices is equal to \n{v}') - vt = v.transpose() - print(f'Transpose of col vector is a row vector: {isinstance(vt, visp.core.RowVector)}') - random_gen = UniRand() - - mat = Matrix(5, 5, random_gen.uniform(0.0, 1.0)) - print(f'Matrix = \n{mat}') - print(f'Condition = {mat.cond(1e-5)}') - - print(f'diagonal = \n{mat.getDiag()}') - print(f'Submatrix = \n{mat.extract(0, 0, 2, 2)}') - - cam = CameraParameters(600, 600, 240, 320) - print(cam) - print(cam.get_K()) diff --git a/modules/python/test/test_core_repr.py b/modules/python/test/test_core_repr.py new file mode 100644 index 0000000000..bbdec76389 --- /dev/null +++ b/modules/python/test/test_core_repr.py @@ -0,0 +1,25 @@ +import visp +from visp.core import ArrayDouble2D, RotationMatrix, Matrix, HomogeneousMatrix, PoseVector + +import numpy as np +import pytest + +def test_array_operations(): + array1 = ArrayDouble2D(2, 2, 1) + array2 = ArrayDouble2D(2, 2, 1) + assert array1 == array2 + +def test_matrix_operations(): + m1 = Matrix(4, 4, 2.0) + m2 = Matrix(4, 4, 1.0) + m3 = Matrix(4, 4, 3.0) + m4 = Matrix(4, 4, 6 * 4) + + assert m1 + m2 == m3 + assert m3 - m1 == m2 + assert m1 * m3 == m4 + assert m2 * 2 == m1 + + +def test_rotation_repr_can_be_defined_by_hand(): + R = RotationMatrix() diff --git a/modules/python/test/test_basic.py b/modules/python/test/test_numpy.py similarity index 76% rename from modules/python/test/test_basic.py rename to modules/python/test/test_numpy.py index 0528e34437..a67e05bc78 100644 --- a/modules/python/test/test_basic.py +++ b/modules/python/test/test_numpy.py @@ -14,24 +14,7 @@ def test_np_array_modifies_vp_array(): array_np[0:2, 0:2] = 2 assert array.getMinValue() == 1 and array.getMaxValue() == 2 -def test_array_operations(): - array1 = ArrayDouble2D(2, 2, 1) - array2 = ArrayDouble2D(2, 2, 1) - assert array1 == array2 - -def test_matrix_operations(): - m1 = Matrix(4, 4, 2.0) - m2 = Matrix(4, 4, 1.0) - m3 = Matrix(4, 4, 3.0) - m4 = Matrix(4, 4, 6 * 4) - - assert m1 + m2 == m3 - assert m3 - m1 == m2 - assert m1 * m3 == m4 - assert m2 * 2 == m1 - -def test_representations_not_writable(): - # Test that some classes have non writable numpy arrays +def test_rotation_matrix_not_writable(): R = RotationMatrix() R_np = np.array(R, copy=False) with pytest.raises(ValueError): @@ -44,14 +27,20 @@ def test_representations_not_writable(): with pytest.raises(ValueError): sub = R[:2, :2] sub[0, :] = 1 + +def test_homogeneous_matrix_not_writable(): T = HomogeneousMatrix() T_np = np.array(T, copy=False) with pytest.raises(ValueError): T_np[0, 0] = 1 - # q = visp.core.QuaternionVector() - # q_np = np.array(q, copy=False) - # with pytest.raises(ValueError): - # q_np[0] = 1 + with pytest.raises(ValueError): + T.numpy()[:1] = 0 + with pytest.raises(ValueError): + row = T[0] + row[0] = 1 + with pytest.raises(ValueError): + sub = T[:2, :2] + sub[0, :] = 1 def test_numpy_constructor(): n_invalid = np.array([1, 2, 3]) @@ -97,5 +86,11 @@ def test_index_array2D_is_not_copy(): assert a[0, -1] == 0.0 -def test_rotation_repr_can_be_defined_by_hand(): - R = RotationMatrix() \ No newline at end of file +def test_keep_alive_numpy_repr(): + # Destroying the base ViSP object should not be allowed while there is a numpy view of the array + import gc + M = Matrix(5, 5, 0) + #M_np = M.numpy() + gc.collect() + del M + assert gc.collect() == 0 From f1caafef82f90e732989d59c16dbf8fe7ca76527 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Fri, 3 Nov 2023 00:31:56 +0100 Subject: [PATCH 100/169] fix python tests --- modules/python/bindings/include/core.hpp | 18 +++------ modules/python/test/test_numpy.py | 50 +++++++++++------------- 2 files changed, 29 insertions(+), 39 deletions(-) diff --git a/modules/python/bindings/include/core.hpp b/modules/python/bindings/include/core.hpp index d750f77be2..7a636effd7 100644 --- a/modules/python/bindings/include/core.hpp +++ b/modules/python/bindings/include/core.hpp @@ -170,7 +170,7 @@ void define_get_item_2d_array(PyClass &pyClass, bool readonly) } return self[i][j]; }); - pyClass.def("__getitem__", [readonly](const Class &self, int i) -> np_array_cf { + pyClass.def("__getitem__", [](const Class &self, int i) -> np_array_cf { const unsigned int rows = self.getRows(); if (abs(i) > rows) { std::stringstream ss; @@ -181,19 +181,13 @@ void define_get_item_2d_array(PyClass &pyClass, bool readonly) if (i < 0) { i = rows + i; } - return np_array_cf(make_array_buffer(self[i], { self.getCols() }, readonly), py::cast(self)); + return (py::cast(self).template cast >())[py::cast(i)].template cast>(); }); - pyClass.def("__getitem__", [readonly](const Class &self, py::slice slice) { - auto as_array = np_array_cf(make_array_buffer(self.data, { self.getRows(), self.getCols() }, readonly), py::cast(self)); - auto view = as_array[slice].template cast>(); - return py::array_t(view.request(!readonly), as_array); + pyClass.def("__getitem__", [](const Class &self, py::slice slice) -> np_array_cf { + return (py::cast(self).template cast >())[slice].template cast>(); }); - pyClass.def("__getitem__", [readonly](const Class &self, py::tuple tuple) { - auto as_array = np_array_cf(make_array_buffer(self.data, { self.getRows(), self.getCols() }, readonly), py::cast(self)); - // py::detail::generic_item acc = as_array[tuple]; - auto view = as_array[tuple].template cast>(); - return py::array_t(view.request(!readonly), as_array); - + pyClass.def("__getitem__", [](const Class &self, py::tuple tuple) { + return (py::cast(self).template cast >())[tuple].template cast>(); }); } diff --git a/modules/python/test/test_numpy.py b/modules/python/test/test_numpy.py index a67e05bc78..bc56e005d6 100644 --- a/modules/python/test/test_numpy.py +++ b/modules/python/test/test_numpy.py @@ -14,8 +14,8 @@ def test_np_array_modifies_vp_array(): array_np[0:2, 0:2] = 2 assert array.getMinValue() == 1 and array.getMaxValue() == 2 -def test_rotation_matrix_not_writable(): - R = RotationMatrix() + +def fn_test_not_writable_2d(R): R_np = np.array(R, copy=False) with pytest.raises(ValueError): R_np[0, 0] = 1 @@ -28,19 +28,13 @@ def test_rotation_matrix_not_writable(): sub = R[:2, :2] sub[0, :] = 1 +def test_rotation_matrix_not_writable(): + R = RotationMatrix() + fn_test_not_writable_2d(R) + def test_homogeneous_matrix_not_writable(): T = HomogeneousMatrix() - T_np = np.array(T, copy=False) - with pytest.raises(ValueError): - T_np[0, 0] = 1 - with pytest.raises(ValueError): - T.numpy()[:1] = 0 - with pytest.raises(ValueError): - row = T[0] - row[0] = 1 - with pytest.raises(ValueError): - sub = T[:2, :2] - sub[0, :] = 1 + fn_test_not_writable_2d(T) def test_numpy_constructor(): n_invalid = np.array([1, 2, 3]) @@ -73,24 +67,26 @@ def test_indexing_array2D(): assert np.all(a[:, i] == col) assert np.all(a[:, -i - 1] == col) -def test_index_array2D_is_not_copy(): +def test_index_row_not_copy(): a = ArrayDouble2D(5, 5, 1.0) first_row_view = a[0] first_row_view[0] = 0.0 assert a[0, 0] == 0.0 - sub_matrix = a[1:3, 1:3] - sub_matrix[0, 0] = 0.0 - assert a[1, 1] == 0.0 + +def test_index_slice_not_copy(): + a = ArrayDouble2D(5, 5, 1.0) + sub_matrix = a[1:3] + sub_matrix[0] = 0.0 + for i in range(a.getCols()): + assert a[1, i] == 0.0 + +def test_index_tuple_not_copy(): + a = ArrayDouble2D(5, 5, 1.0) col = a[:, -1] col[0] = 0.0 assert a[0, -1] == 0.0 - - -def test_keep_alive_numpy_repr(): - # Destroying the base ViSP object should not be allowed while there is a numpy view of the array - import gc - M = Matrix(5, 5, 0) - #M_np = M.numpy() - gc.collect() - del M - assert gc.collect() == 0 + sub = a[0:2, 0:2] + sub[:, :] = 0.0 + for i in range(2): + for j in range(2): + assert a[i, j] == 0.0 From da88d3f886d9fd748c2df5f6c5a942cf6b6d1c30 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Fri, 3 Nov 2023 17:06:24 +0100 Subject: [PATCH 101/169] wrap up numpy array reading, start MBT example --- modules/python/bindings/include/core.hpp | 57 ++++++++++++--- modules/python/docs/conf.py.in | 7 ++ modules/python/examples/synthetic_data_mbt.py | 72 +++++++++++++++++++ 3 files changed, 125 insertions(+), 11 deletions(-) create mode 100644 modules/python/examples/synthetic_data_mbt.py diff --git a/modules/python/bindings/include/core.hpp b/modules/python/bindings/include/core.hpp index 7a636effd7..00731fd293 100644 --- a/modules/python/bindings/include/core.hpp +++ b/modules/python/bindings/include/core.hpp @@ -150,7 +150,7 @@ py::buffer_info get_buffer_info(vpHomogeneousMatrix &array) /*Array 2D indexing*/ template -void define_get_item_2d_array(PyClass &pyClass, bool readonly) +void define_get_item_2d_array(PyClass &pyClass) { pyClass.def("__getitem__", [](const Class &self, std::pair pair) -> Item { @@ -203,6 +203,7 @@ const char *numpy_fn_doc_nonwritable = R"doc( If you try to modify the array, an exception will be raised. )doc"; + template void bindings_vpArray2D(py::class_> &pyArray2D) { @@ -219,9 +220,14 @@ void bindings_vpArray2D(py::class_> &pyArray2D) vpArray2D result(shape[0], shape[1]); copy_data_from_np(np_array, result.data); return result; - })); + }), R"doc( +Construct a 2D ViSP array by **copying** a 2D numpy array. + +:param np_array: The numpy array to copy. - define_get_item_2d_array>, vpArray2D, T>(pyArray2D, false); +)doc", py::arg("np_array")); + + define_get_item_2d_array>, vpArray2D, T>(pyArray2D); } void bindings_vpMatrix(py::class_> &pyMatrix) @@ -239,9 +245,14 @@ void bindings_vpMatrix(py::class_> &pyMatrix) vpMatrix result(shape[0], shape[1]); copy_data_from_np(np_array, result.data); return result; - })); + }), R"doc( +Construct a matrix by **copying** a 2D numpy array. + +:param np_array: The numpy array to copy. - define_get_item_2d_array>, vpMatrix, double>(pyMatrix, false); +)doc", py::arg("np_array")); + + define_get_item_2d_array>, vpMatrix, double>(pyMatrix); } @@ -259,7 +270,12 @@ void bindings_vpColVector(py::class_> &pyColVecto vpColVector result(shape[0]); copy_data_from_np(np_array, result.data); return result; - })); + }), R"doc( +Construct a column vector by **copying** a 1D numpy array. + +:param np_array: The numpy 1D array to copy. + +)doc", py::arg("np_array")); } @@ -275,7 +291,12 @@ void bindings_vpRowVector(py::class_> &pyRowVecto vpRowVector result(shape[0]); copy_data_from_np(np_array, result.data); return result; - })); + }), R"doc( +Construct a row vector by **copying** a 1D numpy array. + +:param np_array: The numpy 1D array to copy. + +)doc", py::arg("np_array")); } @@ -295,8 +316,15 @@ void bindings_vpRotationMatrix(py::class_> & throw std::runtime_error("Input numpy array is not a valid rotation matrix"); } return result; - })); - define_get_item_2d_array>, vpRotationMatrix, double>(pyRotationMatrix, true); + }), R"doc( +Construct a rotation matrix by **copying** a 2D numpy array. +This numpy array should be of dimensions :math:`3 \times 3` and be a valid rotation matrix. +If it is not a rotation matrix, an exception will be raised. + +:param np_array: The numpy 1D array to copy. + +)doc", py::arg("np_array")); + define_get_item_2d_array>, vpRotationMatrix, double>(pyRotationMatrix); } void bindings_vpHomogeneousMatrix(py::class_> &pyHomogeneousMatrix) @@ -316,8 +344,15 @@ void bindings_vpHomogeneousMatrix(py::class_>, vpHomogeneousMatrix, double>(pyHomogeneousMatrix, false); + }), R"doc( +Construct a homogeneous matrix by **copying** a 2D numpy array. +This numpy array should be of dimensions :math:`4 \times 4` and be a valid homogeneous matrix. +If it is not a homogeneous matrix, an exception will be raised. + +:param np_array: The numpy 1D array to copy. + +)doc", py::arg("np_array")); + define_get_item_2d_array>, vpHomogeneousMatrix, double>(pyHomogeneousMatrix); } diff --git a/modules/python/docs/conf.py.in b/modules/python/docs/conf.py.in index 28b7c8f169..2e3077c457 100644 --- a/modules/python/docs/conf.py.in +++ b/modules/python/docs/conf.py.in @@ -153,6 +153,13 @@ html_theme = 'sphinx_immaterial' # html_theme_options = {} html_theme_options = { "toc_title_is_page_title": True, + "repo_url": "https://github.com/lagadic/visp", + "repo_name": "visp", + "features": [ + "toc.follow", + "toc.integrate", + "navigation.instant" + ] } # Add any paths that contain custom themes here, relative to this directory. diff --git a/modules/python/examples/synthetic_data_mbt.py b/modules/python/examples/synthetic_data_mbt.py new file mode 100644 index 0000000000..955b59921d --- /dev/null +++ b/modules/python/examples/synthetic_data_mbt.py @@ -0,0 +1,72 @@ +import argparse +from pathlib import Path +from typing import List + +from visp.core import XmlParserCamera, CameraParameters +from visp.mbt import MbGenericTracker + +class MBTModelData: + def __init__(self, data_root: Path): + model_path = data_root / 'model' / 'teabox' + assert model_path.exists() + self.config_color = model_path / 'teabox_color.xml' + self.config_depth = model_path / 'teabox_depth.xml' + self.cad_file = model_path / 'teabox.cao' + self.init_file = model_path / 'teabox.init' + + +class MBTConfig: + + def __init__(self, data_root: Path): + data_path = data_root / 'data' + assert data_path.exists() + self.color_camera_name = 'Camera_L' + self.depth_camera_name = 'Camera_R' + + self.color_intrinsics_file = data_path / f'{self.color_camera_name}.xml' + self.depth_intrinsics_file = data_path / f'{self.depth_camera_name}.xml' + + self.extrinsic_file = str(data_root / 'data' / 'depth_M_color.txt') + # self.ground_truth = str(data_root / 'data' / 'depth_M_color.txt') + + + +def parse_camera_file(file: Path, camera_name: str, proj_model: CameraParameters.CameraParametersProjType) -> CameraParameters: + assert file.exists() + cam = CameraParameters() + xml_parser = XmlParserCamera() + parse_res = xml_parser.parse(cam, str(file.absolute()), camera_name, proj_model) + assert parse_res == XmlParserCamera.SEQUENCE_OK # Check result + return cam + +if __name__ == '__main__': + parser = argparse.ArgumentParser() + parser.add_argument('--data-root', type=str, required=True, + help='Path to the folder containing all the data for the synthetic MBT example') + parser.add_argument('--display-ground-truth', action='store_true') + parser.add_argument('--disable-klt', action='store_true') + parser.add_argument('--disable-depth', action='store_true') + + + + args = parser.parse_args() + data_root = Path(args.data_root) + + mbt_model = MBTModelData(data_root) + exp_config = MBTConfig(data_root) + + assert data_root.exists() and data_root.is_dir() + + rgb_tracker: int = MbGenericTracker.EDGE_TRACKER | (MbGenericTracker.KLT_TRACKER if not args.disable_klt else 0) + tracker_types: List[int] = [rgb_tracker] + if not args.disable_depth: + depth_tracker = MbGenericTracker.DEPTH_DENSE_TRACKER + tracker_types.append(depth_tracker) + + tracker = MbGenericTracker(tracker_types) + + if args.disable_depth: + tracker.loadConfigFile(str(mbt_model.config_color), False) + else: + tracker.loadConfigFile(str(mbt_model.config_color), str(mbt_model.config_depth), False) + tracker.loadModel(str(mbt_model.cad_file)) From 018aba35789e0a640bcc26e525d06020bfc4f942 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Fri, 3 Nov 2023 18:28:37 +0100 Subject: [PATCH 102/169] bugfix: booleans can now have default values --- modules/python/config/core.json | 9 +++++++++ modules/python/config/visual_features.json | 12 +++++++++++- modules/python/docs/todos.rst | 2 +- modules/python/examples/synthetic_data_mbt.py | 4 ++-- .../visp_python_bindgen/generator_config.py | 2 +- .../python/generator/visp_python_bindgen/methods.py | 2 +- 6 files changed, 25 insertions(+), 6 deletions(-) diff --git a/modules/python/config/core.json b/modules/python/config/core.json index 991e08ac3a..92d8ebff33 100644 --- a/modules/python/config/core.json +++ b/modules/python/config/core.json @@ -286,6 +286,15 @@ "custom_name": "displayCircleStatic" } ] + }, + "vpMomentDatabase": { + "methods": [ + { + "static": false, + "signature": "const vpMoment& get(const char*, bool&)", + "ignore": true + } + ] } } diff --git a/modules/python/config/visual_features.json b/modules/python/config/visual_features.json index 20567de6a4..4e8352ef6a 100644 --- a/modules/python/config/visual_features.json +++ b/modules/python/config/visual_features.json @@ -19,6 +19,16 @@ "ignore": true } ] + }, + "vpFeatureMomentDatabase": { + "methods": [ + { + "static": false, + "signature": "vpFeatureMoment& get(const char*, bool&)", + "ignore": true + } + ] } + } -} \ No newline at end of file +} diff --git a/modules/python/docs/todos.rst b/modules/python/docs/todos.rst index c98134ed2e..3e618a1d3e 100644 --- a/modules/python/docs/todos.rst +++ b/modules/python/docs/todos.rst @@ -12,7 +12,7 @@ Changes to ViSP Code generation ------------------- -* There is an issue when indexing readonly arrays such as HomogeneousMatrix or RotationMatrix +* There is an issue with vpFeatureMomentDatabse::get and vpMomentDatabase::get, ignored for now * n ary operators * Exclude get operators for vpArray2D ? * Parse subnamespaces diff --git a/modules/python/examples/synthetic_data_mbt.py b/modules/python/examples/synthetic_data_mbt.py index 955b59921d..8f76e1cd54 100644 --- a/modules/python/examples/synthetic_data_mbt.py +++ b/modules/python/examples/synthetic_data_mbt.py @@ -66,7 +66,7 @@ def parse_camera_file(file: Path, camera_name: str, proj_model: CameraParameters tracker = MbGenericTracker(tracker_types) if args.disable_depth: - tracker.loadConfigFile(str(mbt_model.config_color), False) + tracker.loadConfigFile(str(mbt_model.config_color)) else: - tracker.loadConfigFile(str(mbt_model.config_color), str(mbt_model.config_depth), False) + tracker.loadConfigFile(str(mbt_model.config_color), str(mbt_model.config_depth)) tracker.loadModel(str(mbt_model.cad_file)) diff --git a/modules/python/generator/visp_python_bindgen/generator_config.py b/modules/python/generator/visp_python_bindgen/generator_config.py index aae4193bde..de21315b4a 100644 --- a/modules/python/generator/visp_python_bindgen/generator_config.py +++ b/modules/python/generator/visp_python_bindgen/generator_config.py @@ -48,7 +48,7 @@ def to_pcpp_args_list(self) -> List[str]: This only encompasses raw types ''' IMMUTABLE_TYPES_REGEXS = [ - '^(float|double|u?int\d+_t|unsigned|char|long|long\wlong)$', + '^(float|double|u?int\d+_t|unsigned|char|long|long\wlong|bool)$', '^std::string$' ] diff --git a/modules/python/generator/visp_python_bindgen/methods.py b/modules/python/generator/visp_python_bindgen/methods.py index ba555cc311..136bf44eb1 100644 --- a/modules/python/generator/visp_python_bindgen/methods.py +++ b/modules/python/generator/visp_python_bindgen/methods.py @@ -259,7 +259,7 @@ def define_method(method: types.Method, method_config: Dict, is_class_method, sp maybe_get_return = '' maybe_return_in_tuple = '' else: - maybe_get_return = 'auto res = ' + maybe_get_return = f'{return_type} res = ' maybe_return_in_tuple = 'res, ' if len(output_param_names) == 1 and (return_type is None or return_type == 'void'): From 7eac1866b137b21a6112b795396e3a5aa56256d2 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Mon, 6 Nov 2023 13:22:47 +0100 Subject: [PATCH 103/169] more work on MBT blender example --- modules/python/bindings/include/core.hpp | 37 ++++ modules/python/examples/synthetic_data_mbt.py | 201 +++++++++++++++++- 2 files changed, 229 insertions(+), 9 deletions(-) diff --git a/modules/python/bindings/include/core.hpp b/modules/python/bindings/include/core.hpp index 00731fd293..6865fcb936 100644 --- a/modules/python/bindings/include/core.hpp +++ b/modules/python/bindings/include/core.hpp @@ -366,7 +366,24 @@ bindings_vpImage(py::class_> &pyImage) pyImage.def_buffer([](vpImage &image) -> py::buffer_info { return make_array_buffer(image.bitmap, { image.getHeight(), image.getWidth() }, false); }); + pyImage.def("numpy", [](vpImage &self) -> np_array_cf { + return py::cast(self).template cast>(); + }, numpy_fn_doc_writable); + + pyImage.def(py::init([](np_array_cf np_array) { + verify_array_shape_and_dims(np_array, 2, "ViSP Image"); + const std::vector shape = np_array.request().shape; + vpImage result(shape[0], shape[1]); + copy_data_from_np(np_array, result.bitmap); + return result; + }), R"doc( +Construct an image by **copying** a 2D numpy array. + +:param np_array: The numpy array to copy. + +)doc", py::arg("np_array")); } + template typename std::enable_if::value, void>::type bindings_vpImage(py::class_> &pyImage) @@ -375,6 +392,26 @@ bindings_vpImage(py::class_> &pyImage) pyImage.def_buffer([](vpImage &image) -> py::buffer_info { return make_array_buffer(reinterpret_cast(image.bitmap), { image.getHeight(), image.getWidth(), 4 }, false); }); + pyImage.def("numpy", [](vpImage &self) -> np_array_cf { + return py::cast(self).template cast>(); + }, numpy_fn_doc_writable); + + pyImage.def(py::init([](np_array_cf np_array) { + verify_array_shape_and_dims(np_array, 3, "ViSP RGBa image"); + const std::vector shape = np_array.request().shape; + if (shape[2] != 4) { + throw std::runtime_error("Tried to copy a 3D numpy array that does not have 4 elements per pixel into a ViSP RGBA image"); + } + vpImage result(shape[0], shape[1]); + copy_data_from_np(np_array, (unsigned char *)result.bitmap); + return result; + }), R"doc( +Construct an image by **copying** a 3D numpy array. this numpy array should be of the form :math:`H \times W \times 4` +where the 4 denotes the red, green, blue and alpha components of the image. + +:param np_array: The numpy array to copy. + +)doc", py::arg("np_array")); } template diff --git a/modules/python/examples/synthetic_data_mbt.py b/modules/python/examples/synthetic_data_mbt.py index 8f76e1cd54..92f3a835ae 100644 --- a/modules/python/examples/synthetic_data_mbt.py +++ b/modules/python/examples/synthetic_data_mbt.py @@ -1,9 +1,90 @@ import argparse +from dataclasses import dataclass from pathlib import Path -from typing import List +from typing import List, Optional + +from visp.core import XmlParserCamera, CameraParameters, ColVector, HomogeneousMatrix, Display, ImageConvert +from visp.core import ImageGray, ImageUInt16 +from visp.io import ImageIo +from visp.mbt import MbGenericTracker, MbTracker +from visp.gui import DisplayOpenCV + +try: + import cv2 +except: + print('Could not import opencv python! make sure that it is installed as it is required') + import sys + sys.exit(1) + +import matplotlib.pyplot as plt + +# bool read_data(unsigned int cpt, const std::string &video_color_images, const std::string &video_depth_images, +# bool disable_depth, const std::string &video_ground_truth, +# vpImage &I, vpImage &I_depth_raw, +# unsigned int &depth_width, unsigned int &depth_height, +# std::vector &pointcloud, const vpCameraParameters &cam_depth, +# vpHomogeneousMatrix &cMo_ground_truth) +# { +# char buffer[FILENAME_MAX]; +# // Read color +# snprintf(buffer, FILENAME_MAX, video_color_images.c_str(), cpt); +# std::string filename_color = buffer; + +# if (!vpIoTools::checkFilename(filename_color)) { +# std::cerr << "Cannot read: " << filename_color << std::endl; +# return false; +# } +# vpImageIo::read(I, filename_color); + +# if (!disable_depth) { +# // Read depth +# snprintf(buffer, FILENAME_MAX, video_depth_images.c_str(), cpt); +# std::string filename_depth = buffer; + +# if (!vpIoTools::checkFilename(filename_depth)) { +# std::cerr << "Cannot read: " << filename_depth << std::endl; +# return false; +# } +# cv::Mat depth_raw = cv::imread(filename_depth, cv::IMREAD_ANYDEPTH | cv::IMREAD_ANYCOLOR); +# if (depth_raw.empty()) { +# std::cerr << "Cannot read: " << filename_depth << std::endl; +# return false; +# } + +# depth_width = static_cast(depth_raw.cols); +# depth_height = static_cast(depth_raw.rows); +# I_depth_raw.resize(depth_height, depth_width); +# pointcloud.resize(depth_width * depth_height); + +# for (int i = 0; i < depth_raw.rows; i++) { +# for (int j = 0; j < depth_raw.cols; j++) { +# I_depth_raw[i][j] = static_cast(32767.5f * depth_raw.at(i, j)[0]); +# double x = 0.0, y = 0.0; +# // Manually limit the field of view of the depth camera +# double Z = depth_raw.at(i, j)[0] > 2.0f ? 0.0 : static_cast(depth_raw.at(i, j)[0]); +# vpPixelMeterConversion::convertPoint(cam_depth, j, i, x, y); +# size_t idx = static_cast(i * depth_raw.cols + j); +# pointcloud[idx].resize(3); +# pointcloud[idx][0] = x * Z; +# pointcloud[idx][1] = y * Z; +# pointcloud[idx][2] = Z; +# } +# } +# } + +# // Read ground truth +# snprintf(buffer, FILENAME_MAX, video_ground_truth.c_str(), cpt); +# std::string filename_pose = buffer; + +# cMo_ground_truth.load(filename_pose); + +# return true; + + + + + -from visp.core import XmlParserCamera, CameraParameters -from visp.mbt import MbGenericTracker class MBTModelData: def __init__(self, data_root: Path): @@ -16,9 +97,8 @@ def __init__(self, data_root: Path): class MBTConfig: - def __init__(self, data_root: Path): - data_path = data_root / 'data' + data_path = data_root / 'data' / 'teabox' assert data_path.exists() self.color_camera_name = 'Camera_L' self.depth_camera_name = 'Camera_R' @@ -26,16 +106,67 @@ def __init__(self, data_root: Path): self.color_intrinsics_file = data_path / f'{self.color_camera_name}.xml' self.depth_intrinsics_file = data_path / f'{self.depth_camera_name}.xml' - self.extrinsic_file = str(data_root / 'data' / 'depth_M_color.txt') + self.color_images_dir = data_path / 'color' + self.depth_images_dir = data_path / 'depth' + self.ground_truth_dir = data_path / 'ground-truth' + + + self.depth_intrinsics_file = data_path / f'{self.depth_camera_name}.xml' + + self.extrinsic_file = str(data_path / 'depth_M_color.txt') # self.ground_truth = str(data_root / 'data' / 'depth_M_color.txt') +@dataclass +class FrameData: + I: ImageGray + I_depth: Optional[ImageUInt16] + point_cloud: Optional[List[ColVector]] + cMo_ground_truth: HomogeneousMatrix + + + +def read_data(exp_config: MBTConfig, use_depth: bool, I: ImageGray): + color_format = '{:04d}_L.jpg' + depth_format = 'Image{:04d}_R.exr' + + iteration = 1 + while True: + color_filepath = exp_config.color_images_dir / color_format.format(iteration) + if not color_filepath.exists(): + print(f'Could not find image {color_filepath}, is the sequence finished?') + return + ImageIo.read(I, str(color_filepath), ImageIo.IO_DEFAULT_BACKEND) + + + I_depth_raw = None + if use_depth: + depth_filepath = exp_config.depth_images_dir / depth_format.format(iteration) + if not depth_filepath.exists(): + print(f'Could not find image {depth_filepath}, is the sequence finished?') + return + I_depth_np = cv2.imread(str(depth_filepath), cv2.IMREAD_ANYCOLOR | cv2.IMREAD_ANYDEPTH) + I_depth_np = I_depth_np[..., 0] + I_depth_raw = ImageUInt16(I_depth_np * 32767.5) + if I_depth_np.size == 0: + print('Could not successfully read the depth image') + + cMo_ground_truth = HomogeneousMatrix() + ground_truth_file = exp_config.ground_truth_dir / (exp_config.color_camera_name + '_{:04d}.txt'.format(iteration)) + cMo_ground_truth.load(str(ground_truth_file)) + iteration += 1 + yield FrameData(I, I_depth_raw, None, cMo_ground_truth) + -def parse_camera_file(file: Path, camera_name: str, proj_model: CameraParameters.CameraParametersProjType) -> CameraParameters: - assert file.exists() +def parse_camera_file(exp_config: MBTConfig, is_color: bool) -> CameraParameters: cam = CameraParameters() xml_parser = XmlParserCamera() - parse_res = xml_parser.parse(cam, str(file.absolute()), camera_name, proj_model) + if is_color: + camera_name, file_path = exp_config.color_camera_name, exp_config.color_intrinsics_file + else: + camera_name, file_path = exp_config.depth_camera_name, exp_config.depth_intrinsics_file + parse_res = xml_parser.parse(cam, str(file_path), camera_name, + CameraParameters.perspectiveProjWithoutDistortion, 0, 0, True) assert parse_res == XmlParserCamera.SEQUENCE_OK # Check result return cam @@ -70,3 +201,55 @@ def parse_camera_file(file: Path, camera_name: str, proj_model: CameraParameters else: tracker.loadConfigFile(str(mbt_model.config_color), str(mbt_model.config_depth)) tracker.loadModel(str(mbt_model.cad_file)) + + # Camera intrinsics + cam_color = parse_camera_file(exp_config, True) + cam_depth = parse_camera_file(exp_config, False) if not args.disable_depth else None + + tracker.setCameraParameters(*((cam_color,) if args.disable_depth else (cam_color, cam_depth))) + tracker.setDisplayFeatures(True) + + print('Color intrinsics:', cam_color) + print('Depth intrinsics:', cam_depth) + I = ImageGray() + data_generator = read_data(exp_config, not args.disable_depth, I) + + frame_data = next(data_generator) # Get first frame for init + + depth_M_color = HomogeneousMatrix() + if not args.disable_depth: + depth_M_color.load(exp_config.extrinsic_file) + tracker.setCameraTransformationMatrix('Camera2', depth_M_color) + + + # tracker.initClick(I, str(mbt_model.init_file), True, HomogeneousMatrix()) TODO: does not work + tracker.initFromPose(I, frame_data.cMo_ground_truth) + + # Initialize displays + dI = DisplayOpenCV() + dI.init(I, 0, 0, 'Color image') + I_depth = None if args.disable_depth else ImageGray() + dDepth = DisplayOpenCV() + if not args.disable_depth: + ImageConvert.createDepthHistogram(frame_data.I_depth, I_depth) + dDepth.init(I_depth, 0, 640, 'Depth') + + for frame_data in data_generator: + if frame_data.I_depth is not None: + ImageConvert.createDepthHistogram(frame_data.I_depth, I_depth) + Display.display(I) + if not args.disable_depth: + Display.display(I_depth) + tracker.track(I) + cMo = HomogeneousMatrix() + tracker.getPose(cMo) + print(cMo) + Display.flush(I) + if not args.disable_depth: + Display.flush(I_depth) + + + + + + pass From ccd4f14bc4c363cacff0970cd16f6ad214322925 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Tue, 7 Nov 2023 17:19:01 +0100 Subject: [PATCH 104/169] starting work on resolving shadowing, cleaning up generation code --- .../visp_python_bindgen/enum_binding.py | 16 +++-- .../generator/visp_python_bindgen/header.py | 58 ++++++++----------- .../generator/visp_python_bindgen/utils.py | 52 ++++++++++++++++- 3 files changed, 86 insertions(+), 40 deletions(-) diff --git a/modules/python/generator/visp_python_bindgen/enum_binding.py b/modules/python/generator/visp_python_bindgen/enum_binding.py index fef6f988ce..f30c989d35 100644 --- a/modules/python/generator/visp_python_bindgen/enum_binding.py +++ b/modules/python/generator/visp_python_bindgen/enum_binding.py @@ -8,6 +8,11 @@ from visp_python_bindgen.submodule import Submodule +from typing import TYPE_CHECKING +if TYPE_CHECKING: + from visp_python_bindgen.header import SingleObjectBindings + + @dataclass class EnumRepr: ''' @@ -139,14 +144,14 @@ def accumulate_data(scope: Union[NamespaceScope, ClassScope]): return final_data, temp_data -def enum_bindings(root_scope: NamespaceScope, mapping: Dict, submodule: Submodule) -> List[Tuple[str, str]]: +def get_enum_bindings(root_scope: NamespaceScope, mapping: Dict, submodule: Submodule) -> List['SingleObjectBindings']: final_data, filtered_reprs = resolve_enums_and_typedefs(root_scope, mapping) for repr in filtered_reprs: print(f'Enum {repr} was ignored, because it is incomplete (missing values or name)') - result = [] + result: List['SingleObjectBindings'] = [] final_reprs = [] for repr in final_data: enum_config = submodule.get_enum_config(repr.name) @@ -186,6 +191,7 @@ def enum_bindings(root_scope: NamespaceScope, mapping: Dict, submodule: Submodul values.append(f'{py_ident}.value("{enumerator.name}", {enum_repr.name}::{enumerator.name});') values.append(f'{py_ident}.export_values();') - definition = '\n'.join(values) - result.append((declaration, definition)) - return result \ No newline at end of file + enum_names = BoundObjectNames(py_ident, py_name, enum_repr.name, enum_repr.name) + enum_binding = SingleObjectBindings(enum_names, declaration, values, GenerationObjectType.Enum) + result.append(enum_binding) + return result diff --git a/modules/python/generator/visp_python_bindgen/header.py b/modules/python/generator/visp_python_bindgen/header.py index feba7efee2..8fc5f295e1 100644 --- a/modules/python/generator/visp_python_bindgen/header.py +++ b/modules/python/generator/visp_python_bindgen/header.py @@ -17,15 +17,6 @@ if TYPE_CHECKING: from submodule import Submodule -@dataclass -class BoundObjectNames: - ''' - The different names that link to a cpp class - ''' - python_ident: str # the identifier (variable) that defines the pybind object - python_name: str # the name exposed in Python - cpp_no_template_name: str # C++ name without any template => vpArray2D becomes vpArray2D (useful for dependencies) - cpp_name: str # C++ name with templates class HeaderFile(): @@ -35,7 +26,6 @@ def __init__(self, path: Path, submodule: 'Submodule'): self.includes = [f''] self.binding_code = None self.header_repr = None - self.declarations = [] self.contains = [] self.depends = [] self.documentation_holder_path: Path = None @@ -138,23 +128,26 @@ def run_preprocessor(self): return preprocessed_header_content - def generate_binding_code(self) -> None: + def generate_binding_code(self, bindings_container: BindingsContainer) -> None: assert self.header_repr is not None, 'The header was not preprocessed before calling the generation step!' - self.binding_code = self.parse_data() + self.parse_data(bindings_container) def compute_environment(self): ''' Compute the header environment This environment contains: - The mapping from partially qualified names to fully qualified names - If a class inherits from another, the environment should be updated with what is contained in the base class environment. This should be done in another step + If a class inherits from another, the environment should be updated with what is contained in the base class environment. + This should be done in another step ''' self.environment = HeaderEnvironment(self.header_repr) - def parse_data(self): - from visp_python_bindgen.enum_binding import enum_bindings - result = '' # String containing the definitions (actual bindings and not class/enum declarations) + def parse_data(self, bindings_container: BindingsContainer) -> None: + ''' + Update the bindings container passed in parameter with the bindings linked to this header file + ''' + from visp_python_bindgen.enum_binding import get_enum_bindings # Fetch documentation if available if self.documentation_holder_path is not None: self.documentation_holder = DocumentationHolder(self.documentation_holder_path, self.environment.mapping) @@ -162,20 +155,18 @@ def parse_data(self): print(f'No documentation found for header {self.path}') for cls in self.header_repr.namespace.classes: - result += self.generate_class(cls, self.environment) + '\n' - enum_decls_and_bindings = enum_bindings(self.header_repr.namespace, self.environment.mapping, self.submodule) - for declaration, binding in enum_decls_and_bindings: - self.declarations.append(declaration) - result += binding + bindings_container.add_bindings(self.generate_class(cls, self.environment)) + enum_bindings = get_enum_bindings(self.header_repr.namespace, self.environment.mapping, self.submodule) + for enum_binding in enum_bindings: + bindings_container.add_bindings(enum_binding) + # Parse functions that are not linked to a class - result += self.parse_sub_namespace(self.header_repr.namespace) - return result + self.parse_sub_namespace(bindings_container, self.header_repr.namespace) - def parse_sub_namespace(self, ns: NamespaceScope, namespace_prefix = '', is_root=True) -> str: + def parse_sub_namespace(self, bindings_container: BindingsContainer, ns: NamespaceScope, namespace_prefix = '', is_root=True) -> None: if not is_root and ns.name == '': # Anonymous namespace, only visible in header, so we ignore it - return '' + return - result = '' functions_with_configs, rejected_functions = get_bindable_functions_with_config(self.submodule, ns.functions, self.environment.mapping) # Log rejected functions @@ -189,15 +180,16 @@ def parse_sub_namespace(self, ns: NamespaceScope, namespace_prefix = '', is_root print('\n'.join(rejection_strs)) bound_object = BoundObjectNames('submodule', self.submodule.name, namespace_prefix, namespace_prefix) + defs = [] for function, function_config in functions_with_configs: - result += define_method(function, function_config, False, {}, self, self.environment, bound_object)[0] + '\n' + defs.append(define_method(function, function_config, False, {}, self, self.environment, bound_object)[0]) + bindings_container.add_bindings(SingleObjectBindings(bound_object, None, defs, GenerationObjectType.Namespace)) for sub_ns in ns.namespaces: - result += self.parse_sub_namespace(ns.namespaces[sub_ns], namespace_prefix + sub_ns + '::', False) + self.parse_sub_namespace(bindings_container, ns.namespaces[sub_ns], namespace_prefix + sub_ns + '::', False) - return result - def generate_class(self, cls: ClassScope, header_env: HeaderEnvironment) -> str: + def generate_class(self, bindings_container: BindingsContainer, cls: ClassScope, header_env: HeaderEnvironment) -> SingleObjectBindings: def generate_class_with_potiental_specialization(name_python: str, owner_specs: OrderedDict[str, str], cls_config: Dict) -> str: python_ident = f'py{name_python}' name_cpp = get_typename(cls.class_decl.typename, owner_specs, header_env.mapping) @@ -403,9 +395,7 @@ def generate_class_with_potiental_specialization(name_python: str, owner_specs: field_strs.append(field_str) definitions_strs = method_strs + field_strs - - return '\n'.join(definitions_strs) - + return SingleObjectBindings(class_def_names, class_decl, definitions_strs, GenerationObjectType.Class) name_cpp_no_template = '::'.join([seg.name for seg in cls.class_decl.typename.segments]) print(f'Parsing class "{name_cpp_no_template}"') @@ -422,7 +412,7 @@ def generate_class_with_potiental_specialization(name_python: str, owner_specs: if cls_config is None or 'specializations' not in cls_config or len(cls_config['specializations']) == 0: print(f'Could not find template specialization for class {name_cpp_no_template}: skipping!') self.submodule.report.add_non_generated_class(name_cpp_no_template, cls_config, 'Skipped because there was no declared specializations') - return '' + return else: specialization_strs = [] specs = cls_config['specializations'] diff --git a/modules/python/generator/visp_python_bindgen/utils.py b/modules/python/generator/visp_python_bindgen/utils.py index 5d36e872f1..11e9cb5290 100644 --- a/modules/python/generator/visp_python_bindgen/utils.py +++ b/modules/python/generator/visp_python_bindgen/utils.py @@ -1,11 +1,61 @@ from typing import List, Optional, Set, Tuple, Dict, Union - +from enum import Enum +from dataclasses import dataclass from cxxheaderparser.tokfmt import tokfmt from cxxheaderparser import types from cxxheaderparser.simple import NamespaceScope, ClassScope from visp_python_bindgen.generator_config import GeneratorConfig + +@dataclass +class BoundObjectNames: + ''' + The different names that link to a cpp class + ''' + python_ident: str # the identifier (variable) that defines the pybind object + python_name: str # the name exposed in Python + cpp_no_template_name: str # C++ name without any template => vpArray2D becomes vpArray2D (useful for dependencies) + cpp_name: str # C++ name with templates + +class GenerationObjectType(Enum): + Enum = 'enum' + Class = 'class' + Function = 'function' + Namespace = 'namespace' + +@dataclass +class ClassBindingDefinitions: + ''' + Class containing the bindings for a single class + ''' + fields: Dict[str, str] + methods: Dict[str, List[str]] # Mapping from python method name to the bindings definitions. There can be overloads + +@dataclass +class SingleObjectBindings: + ''' + Result of running the binding generator for a single type (class, enum) + ''' + object_names: BoundObjectNames + declaration: Optional[str] # Pybind type instanciation, eg py::class_<> ... (if any) + definitions: Union[List[str], ClassBindingDefinitions] # List of method bindings, attributes etc for this pybind object + object_type: GenerationObjectType # Type of the object + +class BindingsContainer: + def __init__(self): + self.object_bindings: List[SingleObjectBindings] = [] + + def add_bindings(self, other: SingleObjectBindings) -> None: + self.object_bindings.append(other) + + def find_bindings(self, cpp_name: str) -> Optional[SingleObjectBindings]: + for sob in self.object_bindings: + if sob.object_names.cpp_name == cpp_name: + return sob + return None + + def get_name(name: types.PQName) -> str: ''' Get the fully qualified name of a type. From 61d05948b228e84691ce82e5bd039ef323166185 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Tue, 7 Nov 2023 23:32:40 +0100 Subject: [PATCH 105/169] Initial shadowing fix didn't work, resorting to lambda functions --- modules/python/CMakeLists.txt | 2 +- .../visp_python_bindgen/enum_binding.py | 2 +- .../generator/visp_python_bindgen/header.py | 94 +++++++++++++------ .../generator/visp_python_bindgen/methods.py | 84 +++++++++-------- .../visp_python_bindgen/submodule.py | 15 ++- .../generator/visp_python_bindgen/utils.py | 42 ++++++++- 6 files changed, 161 insertions(+), 78 deletions(-) diff --git a/modules/python/CMakeLists.txt b/modules/python/CMakeLists.txt index 973dc0fc2b..321eeb9197 100644 --- a/modules/python/CMakeLists.txt +++ b/modules/python/CMakeLists.txt @@ -21,7 +21,7 @@ endif() # Step 1: Generate configuration file # Define modules for which to generate python bindings -set(python_ignored_modules "visp_python" "visp_java_bindings_generator" "visp_java") +set(python_ignored_modules "visp_python" "visp_java_bindings_generator" "visp_java" ) set(python_bound_modules ${VISP_MODULES_BUILD}) list(REMOVE_ITEM python_bound_modules ${python_ignored_modules}) diff --git a/modules/python/generator/visp_python_bindgen/enum_binding.py b/modules/python/generator/visp_python_bindgen/enum_binding.py index f30c989d35..adef7555bd 100644 --- a/modules/python/generator/visp_python_bindgen/enum_binding.py +++ b/modules/python/generator/visp_python_bindgen/enum_binding.py @@ -144,7 +144,7 @@ def accumulate_data(scope: Union[NamespaceScope, ClassScope]): return final_data, temp_data -def get_enum_bindings(root_scope: NamespaceScope, mapping: Dict, submodule: Submodule) -> List['SingleObjectBindings']: +def get_enum_bindings(root_scope: NamespaceScope, mapping: Dict, submodule: Submodule) -> List[SingleObjectBindings]: final_data, filtered_reprs = resolve_enums_and_typedefs(root_scope, mapping) diff --git a/modules/python/generator/visp_python_bindgen/header.py b/modules/python/generator/visp_python_bindgen/header.py index 8fc5f295e1..61439c5d74 100644 --- a/modules/python/generator/visp_python_bindgen/header.py +++ b/modules/python/generator/visp_python_bindgen/header.py @@ -155,7 +155,7 @@ def parse_data(self, bindings_container: BindingsContainer) -> None: print(f'No documentation found for header {self.path}') for cls in self.header_repr.namespace.classes: - bindings_container.add_bindings(self.generate_class(cls, self.environment)) + self.generate_class(bindings_container, cls, self.environment) enum_bindings = get_enum_bindings(self.header_repr.namespace, self.environment.mapping, self.submodule) for enum_binding in enum_bindings: bindings_container.add_bindings(enum_binding) @@ -194,6 +194,12 @@ def generate_class_with_potiental_specialization(name_python: str, owner_specs: python_ident = f'py{name_python}' name_cpp = get_typename(cls.class_decl.typename, owner_specs, header_env.mapping) class_doc = None + methods_dict: Dict[str, List[MethodBinding]] = {} + def add_to_method_dict(key, value): + if key not in methods_dict: + methods_dict[key] = [value] + else: + methods_dict[key].append(value) if self.documentation_holder is not None: class_doc = self.documentation_holder.get_documentation_for_class(name_cpp_no_template, {}, owner_specs) else: @@ -208,15 +214,14 @@ def generate_class_with_potiental_specialization(name_python: str, owner_specs: name_cpp += template_str # Reference public base classes when creating pybind class binding - base_class_strs = map(lambda base_class: get_typename(base_class.typename, owner_specs, header_env.mapping), - filter(lambda b: b.access == 'public', cls.class_decl.bases)) - class_template_str = ', '.join([name_cpp] + list(base_class_strs)) + base_class_strs = list(map(lambda base_class: get_typename(base_class.typename, owner_specs, header_env.mapping), + filter(lambda b: b.access == 'public', cls.class_decl.bases))) + class_template_str = ', '.join([name_cpp] + base_class_strs) doc_param = [] if class_doc is None else [class_doc.documentation] buffer_protocol_arg = ['py::buffer_protocol()'] if cls_config['use_buffer_protocol'] else [] cls_argument_strs = ['submodule', f'"{name_python}"'] + doc_param + buffer_protocol_arg class_decl = f'\tpy::class_ {python_ident} = py::class_<{class_template_str}>({", ".join(cls_argument_strs)});' - self.declarations.append(class_decl) # Definitions # Skip constructors for classes that have pure virtual methods since they cannot be instantiated @@ -233,7 +238,6 @@ def generate_class_with_potiental_specialization(name_python: str, owner_specs: # Find bindable methods generated_methods = [] - method_strs = [] bindable_methods_and_config, rejected_methods = get_bindable_methods_with_config(self.submodule, cls.methods, name_cpp_no_template, owner_specs, header_env.mapping) # Display rejected methods @@ -272,7 +276,9 @@ def generate_class_with_potiental_specialization(name_python: str, owner_specs: py_arg_strs = [method_doc.documentation] + py_arg_strs ctor_str = f'''{python_ident}.{define_constructor(params_strs, py_arg_strs)};''' - method_strs.append(ctor_str) + add_to_method_dict('__init__', MethodBinding(ctor_str, is_static=False, is_lambda=False, + is_operator=False, is_constructor=True)) + # Operator definitions binary_return_ops = supported_const_return_binary_op_map() @@ -299,7 +305,8 @@ def generate_class_with_potiental_specialization(name_python: str, owner_specs: {python_ident}.def("__{python_op_name}__", []({"const" if method_is_const else ""} {name_cpp}& self) {{ return {cpp_op}self; }}, {", ".join(py_args)});''' - method_strs.append(operator_str) + add_to_method_dict(f'__{python_op_name}__', MethodBinding(operator_str, is_static=False, is_lambda=True, + is_operator=True, is_constructor=False)) break print(f'Found unary operator {name_cpp}::{method_name}, skipping') @@ -310,7 +317,8 @@ def generate_class_with_potiental_specialization(name_python: str, owner_specs: {python_ident}.def("__{python_op_name}__", []({"const" if method_is_const else ""} {name_cpp}& self, {params_strs[0]} o) {{ return (self {cpp_op} o); }}, {", ".join(py_args)});''' - method_strs.append(operator_str) + add_to_method_dict(f'__{python_op_name}__', MethodBinding(operator_str, is_static=False, is_lambda=True, + is_operator=True, is_constructor=False)) break for cpp_op, python_op_name in binary_in_place_ops.items(): if method_name == f'operator{cpp_op}': @@ -319,7 +327,8 @@ def generate_class_with_potiental_specialization(name_python: str, owner_specs: self {cpp_op} o; return self; }}, {", ".join(py_args)});''' - method_strs.append(operator_str) + add_to_method_dict(f'__{python_op_name}__', MethodBinding(operator_str, is_static=False, is_lambda=True, + is_operator=True, is_constructor=False)) break # Define classical methods @@ -335,19 +344,53 @@ def generate_class_with_potiental_specialization(name_python: str, owner_specs: new_specs.update(method_spec_dict) method_str, generated_method_tuple = define_method(method, method_config, True, new_specs, self, header_env, class_def_names) - method_strs.append(method_str) + add_to_method_dict(generated_method_tuple[0], MethodBinding(method_str, is_static=method.static, + is_lambda=f'{name_cpp}::*' not in method_str, + is_operator=False, is_constructor=False, lambda_child=generated_method_tuple[-1])) generated_methods.append(generated_method_tuple) else: method_str, generated_method_tuple = define_method(method, method_config, True, owner_specs, self, header_env, class_def_names) - method_strs.append(method_str) + add_to_method_dict(generated_method_tuple[0], MethodBinding(method_str, is_static=method.static, + is_lambda=f'{name_cpp}::*' not in method_str, + is_operator=False, is_constructor=False, lambda_child=generated_method_tuple[-1])) generated_methods.append(generated_method_tuple) + # See https://github.com/pybind/pybind11/issues/974 + # Update with overloads that are shadowed by new overloads defined in this class + # For instance, declaring: + # class A { void foo(int); }; + # class B: public A { void foo(std::string& s); } + # Will result in the following code generating an error: + # from visp.core import B + # b = B() + # b.foo(0) # no overload known with int + base_bindings = list(filter(lambda b: b is not None, map(lambda s: bindings_container.find_bindings(s), base_class_strs))) + + # assert not any(map(lambda b: b is None, base_bindings)), f'Could not retrieve the bindings for a base class of {name_cpp}' + print(base_bindings) + for base_binding_container in base_bindings: + base_defs = base_binding_container.definitions + if not isinstance(base_defs, ClassBindingDefinitions): + raise RuntimeError + base_methods_dict = base_defs.methods + for method_name in methods_dict.keys(): + if method_name == '__init__': # Do not bring constructors of the base class in this class defs as it makes no sense + continue + if method_name in base_methods_dict: + for overload in base_methods_dict[method_name]: + ov = overload + bn = base_binding_container.object_names + ov = ov.replace(bn.python_ident, python_ident) + ov = ov.replace(bn.cpp_name + '::*', name_cpp + '::*') + + methods_dict[method_name].append(ov) + # Add to string representation if not cls_config['ignore_repr']: to_string_str = find_and_define_repr_str(cls, name_cpp, python_ident) if len(to_string_str) > 0: - method_strs.append(to_string_str) + add_to_method_dict('__repr__', to_string_str) # Add call to user defined bindings function # Binding function should be defined in the static part of the generator @@ -358,22 +401,19 @@ def generate_class_with_potiental_specialization(name_python: str, owner_specs: if len(owner_specs.keys()) > 0: template_types = owner_specs.values() template_str = f'<{", ".join([template_type for template_type in template_types])}>' - method_strs.append(f'{cls_config["additional_bindings"]}({python_ident});') + add_to_method_dict('__additional_bindings', MethodBinding(f'{cls_config["additional_bindings"]}({python_ident});', + is_static=False, is_lambda=False, + is_operator=False, is_constructor=False)) # Check for potential error-generating definitions error_generating_overloads = get_static_and_instance_overloads(generated_methods) - for error_overload in error_generating_overloads: - print(f'Overload {error_overload} defined for instance and class, this will generate a pybind error') - for method_str in method_strs: - if error_overload in method_str: - print(method_str) - print() if len(error_generating_overloads) > 0: + print(f'Overloads defined for instance and class, this will generate a pybind error') print(error_generating_overloads) raise RuntimeError - field_strs = [] + field_dict = {} for field in cls.fields: if field.name in cls_config['ignored_attributes']: continue @@ -392,10 +432,10 @@ def generate_class_with_potiental_specialization(name_python: str, owner_specs: def_str += '_static' field_str = f'{python_ident}.{def_str}("{field_name_python}", &{name_cpp}::{field.name});' - field_strs.append(field_str) + field_dict[field_name_python] = field_str - definitions_strs = method_strs + field_strs - return SingleObjectBindings(class_def_names, class_decl, definitions_strs, GenerationObjectType.Class) + classs_binding_defs = ClassBindingDefinitions(field_dict, methods_dict) + bindings_container.add_bindings(SingleObjectBindings(class_def_names, class_decl, classs_binding_defs, GenerationObjectType.Class)) name_cpp_no_template = '::'.join([seg.name for seg in cls.class_decl.typename.segments]) print(f'Parsing class "{name_cpp_no_template}"') @@ -412,9 +452,7 @@ def generate_class_with_potiental_specialization(name_python: str, owner_specs: if cls_config is None or 'specializations' not in cls_config or len(cls_config['specializations']) == 0: print(f'Could not find template specialization for class {name_cpp_no_template}: skipping!') self.submodule.report.add_non_generated_class(name_cpp_no_template, cls_config, 'Skipped because there was no declared specializations') - return else: - specialization_strs = [] specs = cls_config['specializations'] template_names = [t.name for t in cls.class_decl.template.params] for spec in specs: @@ -422,6 +460,4 @@ def generate_class_with_potiental_specialization(name_python: str, owner_specs: args = spec['arguments'] assert len(template_names) == len(args), f'Specializing {name_cpp_no_template}: Template arguments are {template_names} but found specialization {args} which has the wrong number of arguments' spec_dict = OrderedDict(k for k in zip(template_names, args)) - specialization_strs.append(generate_class_with_potiental_specialization(name_python, spec_dict, cls_config)) - - return '\n'.join(specialization_strs) + generate_class_with_potiental_specialization(name_python, spec_dict, cls_config) diff --git a/modules/python/generator/visp_python_bindgen/methods.py b/modules/python/generator/visp_python_bindgen/methods.py index 136bf44eb1..ea45cf59de 100644 --- a/modules/python/generator/visp_python_bindgen/methods.py +++ b/modules/python/generator/visp_python_bindgen/methods.py @@ -14,6 +14,14 @@ from visp_python_bindgen.submodule import Submodule from visp_python_bindgen.header import HeaderFile, HeaderEnvironment, BoundObjectNames +@dataclass +class MethodData: + py_name: str + method: types.Method + lambda_variant: str + py_arg_strs: List[str] + + def cpp_operator_list(): ''' List of cpp methods that are considered operators. @@ -193,6 +201,7 @@ def make_arg(name: str) -> str: return py_args + def define_method(method: types.Method, method_config: Dict, is_class_method, specs: Dict, header: 'HeaderFile', header_env: 'HeaderEnvironment', bound_object: 'BoundObjectNames'): params_strs = [get_type(param.type, specs, header_env.mapping) for param in method.parameters] py_arg_strs = get_py_args(method.parameters, specs, header_env.mapping) @@ -236,54 +245,55 @@ def define_method(method: types.Method, method_config: Dict, is_class_method, sp py_arg_strs = [method_doc.documentation] + py_arg_strs + child_lambda = None # If a function has refs to immutable params, we need to return them. should_wrap_for_tuple_return = param_is_output is not None and any(param_is_output) - if should_wrap_for_tuple_return: - # Arguments that are inputs to the lambda function that wraps the ViSP function - input_param_types = [params_strs[i] for i in range(len(param_is_input)) if param_is_input[i]] - params_with_names = [t + ' ' + name for t, name in zip(input_param_types, input_param_names)] - - # Params that are only outputs: they should be declared in function. Assume that they are default constructible - param_is_only_output = [not is_input and is_output for is_input, is_output in zip(param_is_input, param_is_output)] - param_declarations = [f'{get_type_for_declaration(method.parameters[i].type, specs, header_env.mapping)} {param_names[i]};' for i in range(len(param_is_only_output)) if param_is_only_output[i]] - param_declarations = '\n'.join(param_declarations) - if is_class_method and not method.static: - self_param_with_name = bound_object.cpp_name + '& self' - method_caller = 'self.' - else: - self_param_with_name = None - method_caller = bound_object.cpp_name + '::' if is_class_method else bound_object.cpp_name + # Arguments that are inputs to the lambda function that wraps the ViSP function + input_param_types = [params_strs[i] for i in range(len(param_is_input)) if param_is_input[i]] + params_with_names = [t + ' ' + name for t, name in zip(input_param_types, input_param_names)] - if return_type is None or return_type == 'void': - maybe_get_return = '' - maybe_return_in_tuple = '' - else: - maybe_get_return = f'{return_type} res = ' - maybe_return_in_tuple = 'res, ' + # Params that are only outputs: they should be declared in function. Assume that they are default constructible + param_is_only_output = [not is_input and is_output for is_input, is_output in zip(param_is_input, param_is_output)] + param_declarations = [f'{get_type_for_declaration(method.parameters[i].type, specs, header_env.mapping)} {param_names[i]};' for i in range(len(param_is_only_output)) if param_is_only_output[i]] + param_declarations = '\n'.join(param_declarations) - if len(output_param_names) == 1 and (return_type is None or return_type == 'void'): - return_str = output_param_names[0] - else: - return_str = f'std::make_tuple({maybe_return_in_tuple}{", ".join(output_param_names)})' + if is_class_method and not method.static: + self_param_with_name = bound_object.cpp_name + '& self' + method_caller = 'self.' + else: + self_param_with_name = None + method_caller = bound_object.cpp_name + '::' if is_class_method else bound_object.cpp_name + if return_type is None or return_type == 'void': + maybe_get_return = '' + maybe_return_in_tuple = '' + else: + maybe_get_return = f'{return_type} res = ' + maybe_return_in_tuple = 'res, ' + + if len(output_param_names) == 1 and (return_type is None or return_type == 'void'): + return_str = output_param_names[0] + else: + return_str = f'std::make_tuple({maybe_return_in_tuple}{", ".join(output_param_names)})' - lambda_body = f''' - {param_declarations} - {maybe_get_return}{method_caller}{method_name}({", ".join(param_names)}); - return {return_str}; - ''' - final_lambda_params = [self_param_with_name] + params_with_names if self_param_with_name is not None else params_with_names - method_body_str = define_lambda('', final_lambda_params, None, lambda_body) + lambda_body = f''' + {param_declarations} + {maybe_get_return}{method_caller}{method_name}({", ".join(param_names)}); + return {return_str}; + ''' + final_lambda_params = [self_param_with_name] + params_with_names if self_param_with_name is not None else params_with_names + lambda_variant = define_lambda('', final_lambda_params, None, lambda_body) + if should_wrap_for_tuple_return: + method_body_str = lambda_variant + elif is_class_method: + method_body_str = ref_to_class_method(method, bound_object.cpp_name, method_name, return_type, params_strs) else: - if is_class_method: - method_body_str = ref_to_class_method(method, bound_object.cpp_name, method_name, return_type, params_strs) - else: - method_body_str = ref_to_function(bound_object.cpp_name + method_name, return_type, params_strs) + method_body_str = ref_to_function(bound_object.cpp_name + method_name, return_type, params_strs) method_str = method_def(py_method_name, method_body_str, py_arg_strs, method.static if is_class_method else False) method_str = f'{bound_object.python_ident}.{method_str};' - return method_str, (py_method_name, method) + return method_str, MethodData(py_method_name, method, lambda_variant, py_arg_strs) def define_constructor(params: List[str], additional_args: List[str]) -> str: additional_args_str = ', '.join(additional_args) diff --git a/modules/python/generator/visp_python_bindgen/submodule.py b/modules/python/generator/visp_python_bindgen/submodule.py index 69ffbe8df9..4ea8787223 100644 --- a/modules/python/generator/visp_python_bindgen/submodule.py +++ b/modules/python/generator/visp_python_bindgen/submodule.py @@ -68,20 +68,17 @@ def set_headers_from_common_list(self, all_headers: List[HeaderFile]) -> None: def generate(self) -> None: # Sort by dependency level so that generation is in correct order - - header_code = [] - declarations = [] + module_bindings = BindingsContainer() includes = [] for header in self.headers: - header.generate_binding_code() - header_code.append(header.binding_code) - declarations.extend(header.declarations) + header.generate_binding_code(module_bindings) includes.extend(header.includes) - includes_set = set(includes) submodule_declaration = f'py::module_ submodule = m.def_submodule("{self.name}");\n' - bindings = '\n'.join(header_code) - declarations = '\n'.join(declarations) + bindings = module_bindings.get_definitions() + declarations = module_bindings.get_declarations() user_defined_headers = '\n'.join(self.get_user_defined_headers()) + + includes_set = set(includes) includes_strs = [f'#include {include}' for include in includes_set] includes_str = '\n'.join(includes_strs) additional_required_headers = '\n'.join(self.get_required_headers()) diff --git a/modules/python/generator/visp_python_bindgen/utils.py b/modules/python/generator/visp_python_bindgen/utils.py index 11e9cb5290..bde342a734 100644 --- a/modules/python/generator/visp_python_bindgen/utils.py +++ b/modules/python/generator/visp_python_bindgen/utils.py @@ -24,13 +24,32 @@ class GenerationObjectType(Enum): Function = 'function' Namespace = 'namespace' +@dataclass +class MethodBinding: + binding: str + is_static: bool + is_lambda: bool + is_operator: bool + is_constructor: bool + method_data: Optional['MethodData'] + + + def get_definition_in_child_class(self, child_py_ident) -> str: + if self.is_lambda: + return self.binding + + return self.lambda_child.format(py_ident=child_py_ident) + + + + @dataclass class ClassBindingDefinitions: ''' Class containing the bindings for a single class ''' fields: Dict[str, str] - methods: Dict[str, List[str]] # Mapping from python method name to the bindings definitions. There can be overloads + methods: Dict[str, List[MethodBinding]] # Mapping from python method name to the bindings definitions. There can be overloads @dataclass class SingleObjectBindings: @@ -55,6 +74,27 @@ def find_bindings(self, cpp_name: str) -> Optional[SingleObjectBindings]: return sob return None + def get_declarations(self) -> str: + decls = [] + for sob in self.object_bindings: + if sob.declaration is not None: + decls.append(sob.declaration) + return '\n'.join(decls) + + def get_definitions(self) -> str: + defs = [] + for sob in self.object_bindings: + odefs = sob.definitions + if isinstance(odefs, list): + defs.extend(odefs) + elif isinstance(odefs, ClassBindingDefinitions): + defs.extend(list(odefs.fields.values())) + for method_overloads in odefs.methods.values(): + defs.extend(method_overloads.binding) + return '\n'.join(defs) + + + def get_name(name: types.PQName) -> str: ''' From a7ccd70e1649247615e4aa3beb915d9d9eaf14de Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Wed, 8 Nov 2023 17:36:40 +0100 Subject: [PATCH 106/169] Try and fix the shadowing issue, v2 --- CMakeLists.txt | 2 + doc/config-doxygen.in | 2 +- .../generator/visp_python_bindgen/header.py | 30 ++++++-------- .../generator/visp_python_bindgen/methods.py | 10 +---- .../generator/visp_python_bindgen/utils.py | 40 ++++++++++++++----- 5 files changed, 46 insertions(+), 38 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8019e1cbac..e181e558df 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -779,6 +779,7 @@ if(DOXYGEN_FOUND) set(DOXYGEN_GENERATE_HTML "YES") set(DOXYGEN_GENERATE_XML "NO") set(DOXYGEN_GENERATE_TEST_LIST "YES") + set(DOXYGEN_QUIET "NO") set(DOXYGEN_INPUTS "${VISP_SOURCE_DIR}/modules" "${VISP_SOURCE_DIR}/example" @@ -797,6 +798,7 @@ if(DOXYGEN_FOUND) set(DOXYGEN_GENERATE_HTML "NO") set(DOXYGEN_GENERATE_XML "YES") set(DOXYGEN_GENERATE_TEST_LIST "NO") + set(DOXYGEN_QUIET "YES") set(DOXYGEN_INPUTS "${VISP_SOURCE_DIR}/modules" ) diff --git a/doc/config-doxygen.in b/doc/config-doxygen.in index 4372c7a145..17836c9721 100644 --- a/doc/config-doxygen.in +++ b/doc/config-doxygen.in @@ -753,7 +753,7 @@ CITE_BIB_FILES = @DOXYGEN_CITE_BIB_FILES@ # messages are off. # The default value is: NO. -QUIET = NO +QUIET = @DOXYGEN_QUIET@ # The WARNINGS tag can be used to turn on/off the warning messages that are # generated to standard error (stderr) by doxygen. If WARNINGS is set to YES diff --git a/modules/python/generator/visp_python_bindgen/header.py b/modules/python/generator/visp_python_bindgen/header.py index 61439c5d74..8dc28c7047 100644 --- a/modules/python/generator/visp_python_bindgen/header.py +++ b/modules/python/generator/visp_python_bindgen/header.py @@ -237,7 +237,7 @@ def add_to_method_dict(key, value): contains_pure_virtual_methods = contains_pure_virtual_methods or cls_config['is_virtual'] # Find bindable methods - generated_methods = [] + generated_methods: List[MethodData] = [] bindable_methods_and_config, rejected_methods = get_bindable_methods_with_config(self.submodule, cls.methods, name_cpp_no_template, owner_specs, header_env.mapping) # Display rejected methods @@ -342,19 +342,19 @@ def add_to_method_dict(key, value): assert len(method_template_names) == len(method_spec) method_spec_dict = OrderedDict(k for k in zip(method_template_names, method_spec)) new_specs.update(method_spec_dict) - method_str, generated_method_tuple = define_method(method, method_config, True, + method_str, method_data = define_method(method, method_config, True, new_specs, self, header_env, class_def_names) - add_to_method_dict(generated_method_tuple[0], MethodBinding(method_str, is_static=method.static, + add_to_method_dict(method_data.py_name, MethodBinding(method_str, is_static=method.static, is_lambda=f'{name_cpp}::*' not in method_str, - is_operator=False, is_constructor=False, lambda_child=generated_method_tuple[-1])) - generated_methods.append(generated_method_tuple) + is_operator=False, is_constructor=False, method_data=method_data)) + generated_methods.append(method_data) else: - method_str, generated_method_tuple = define_method(method, method_config, True, + method_str, method_data = define_method(method, method_config, True, owner_specs, self, header_env, class_def_names) - add_to_method_dict(generated_method_tuple[0], MethodBinding(method_str, is_static=method.static, + add_to_method_dict(method_data.py_name, MethodBinding(method_str, is_static=method.static, is_lambda=f'{name_cpp}::*' not in method_str, - is_operator=False, is_constructor=False, lambda_child=generated_method_tuple[-1])) - generated_methods.append(generated_method_tuple) + is_operator=False, is_constructor=False, method_data=method_data)) + generated_methods.append(method_data) # See https://github.com/pybind/pybind11/issues/974 # Update with overloads that are shadowed by new overloads defined in this class @@ -378,19 +378,15 @@ def add_to_method_dict(key, value): if method_name == '__init__': # Do not bring constructors of the base class in this class defs as it makes no sense continue if method_name in base_methods_dict: - for overload in base_methods_dict[method_name]: - ov = overload - bn = base_binding_container.object_names - ov = ov.replace(bn.python_ident, python_ident) - ov = ov.replace(bn.cpp_name + '::*', name_cpp + '::*') - - methods_dict[method_name].append(ov) + for parent_method_binding in base_methods_dict[method_name]: + methods_dict[method_name].append(parent_method_binding.get_definition_in_child_class(python_ident)) # Add to string representation if not cls_config['ignore_repr']: to_string_str = find_and_define_repr_str(cls, name_cpp, python_ident) if len(to_string_str) > 0: - add_to_method_dict('__repr__', to_string_str) + add_to_method_dict('__repr__', MethodBinding(to_string_str, is_static=False, is_lambda=True, is_operator=True, + is_constructor=False)) # Add call to user defined bindings function # Binding function should be defined in the static part of the generator diff --git a/modules/python/generator/visp_python_bindgen/methods.py b/modules/python/generator/visp_python_bindgen/methods.py index ea45cf59de..5516aff636 100644 --- a/modules/python/generator/visp_python_bindgen/methods.py +++ b/modules/python/generator/visp_python_bindgen/methods.py @@ -14,12 +14,7 @@ from visp_python_bindgen.submodule import Submodule from visp_python_bindgen.header import HeaderFile, HeaderEnvironment, BoundObjectNames -@dataclass -class MethodData: - py_name: str - method: types.Method - lambda_variant: str - py_arg_strs: List[str] + def cpp_operator_list(): @@ -124,8 +119,6 @@ def tokens_to_str(tokens: List[types.Token]) -> str: return ''.join([token.value for token in tokens]) - - def parameter_can_have_default_value(parameter: types.Parameter, specs, env_mapping) -> bool: ''' Return whether an argument can have a default value. @@ -245,7 +238,6 @@ def define_method(method: types.Method, method_config: Dict, is_class_method, sp py_arg_strs = [method_doc.documentation] + py_arg_strs - child_lambda = None # If a function has refs to immutable params, we need to return them. should_wrap_for_tuple_return = param_is_output is not None and any(param_is_output) diff --git a/modules/python/generator/visp_python_bindgen/utils.py b/modules/python/generator/visp_python_bindgen/utils.py index bde342a734..7b41e1ddd1 100644 --- a/modules/python/generator/visp_python_bindgen/utils.py +++ b/modules/python/generator/visp_python_bindgen/utils.py @@ -1,12 +1,27 @@ from typing import List, Optional, Set, Tuple, Dict, Union +import copy from enum import Enum from dataclasses import dataclass + from cxxheaderparser.tokfmt import tokfmt from cxxheaderparser import types from cxxheaderparser.simple import NamespaceScope, ClassScope from visp_python_bindgen.generator_config import GeneratorConfig +@dataclass +class MethodData: + py_name: str + method: types.Method + lambda_variant: str + py_arg_strs: List[str] + + def as_lambda(self, py_ident: str) -> str: + args_str = ', '.join(self.py_arg_strs) + def_val = 'def' if not self.method.static else 'def_static' + return f''' + {py_ident}.{def_val}("{self.py_name}", {self.lambda_variant}, {args_str}); + ''' @dataclass class BoundObjectNames: @@ -31,16 +46,18 @@ class MethodBinding: is_lambda: bool is_operator: bool is_constructor: bool - method_data: Optional['MethodData'] + method_data: Optional[MethodData] = None - def get_definition_in_child_class(self, child_py_ident) -> str: + def get_definition_in_child_class(self, child_py_ident) -> 'MethodBinding': + if self.is_constructor: + raise RuntimeError('We should not try to redefine a constructor for a child class') if self.is_lambda: - return self.binding - - return self.lambda_child.format(py_ident=child_py_ident) - - + return copy.deepcopy(self) + new_binding_code = self.method_data.as_lambda(child_py_ident) + res = copy.deepcopy(self) + res.binding = new_binding_code + return res @dataclass @@ -90,7 +107,8 @@ def get_definitions(self) -> str: elif isinstance(odefs, ClassBindingDefinitions): defs.extend(list(odefs.fields.values())) for method_overloads in odefs.methods.values(): - defs.extend(method_overloads.binding) + for method_overload_binding in method_overloads: + defs.append(method_overload_binding.binding) return '\n'.join(defs) @@ -332,11 +350,11 @@ def method_matches_config(method: types.Method, config: Dict, owner_specs, heade return True -def get_static_and_instance_overloads(methods: List[Tuple[str, types.Method]]) -> Set[str]: +def get_static_and_instance_overloads(methods: List[MethodData]) -> Set[str]: ''' Return the set of method names that have static and non-static versions. This is not allowed in PyBind, so this function can be used to raise an error if the resulting set is not empty ''' - instance_methods = set([method[0] for method in methods if not method[1].static]) - static_methods = set([method[0] for method in methods if method[1].static]) + instance_methods = set([method.py_name for method in methods if not method.method.static]) + static_methods = set([method.py_name for method in methods if method.method.static]) return instance_methods.intersection(static_methods) From 81c2d59ff6e5627283ffe9c398406f3896fb3fda Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Thu, 9 Nov 2023 13:07:27 +0100 Subject: [PATCH 107/169] Finally resolved name shadowing --- modules/python/examples/synthetic_data_mbt.py | 2 +- modules/python/generator/visp_python_bindgen/methods.py | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/python/examples/synthetic_data_mbt.py b/modules/python/examples/synthetic_data_mbt.py index 92f3a835ae..9343b88714 100644 --- a/modules/python/examples/synthetic_data_mbt.py +++ b/modules/python/examples/synthetic_data_mbt.py @@ -240,7 +240,7 @@ def parse_camera_file(exp_config: MBTConfig, is_color: bool) -> CameraParameters Display.display(I) if not args.disable_depth: Display.display(I_depth) - tracker.track(I) + tracker.track(I=I) cMo = HomogeneousMatrix() tracker.getPose(cMo) print(cMo) diff --git a/modules/python/generator/visp_python_bindgen/methods.py b/modules/python/generator/visp_python_bindgen/methods.py index 5516aff636..68937c4d56 100644 --- a/modules/python/generator/visp_python_bindgen/methods.py +++ b/modules/python/generator/visp_python_bindgen/methods.py @@ -263,7 +263,11 @@ def define_method(method: types.Method, method_config: Dict, is_class_method, sp maybe_get_return = f'{return_type} res = ' maybe_return_in_tuple = 'res, ' - if len(output_param_names) == 1 and (return_type is None or return_type == 'void'): + if len(output_param_names) == 0 and (return_type is None or return_type == 'void'): + return_str = '' + elif len(output_param_names) == 0: + return_str = 'res' + elif len(output_param_names) == 1 and (return_type is None or return_type == 'void'): return_str = output_param_names[0] else: return_str = f'std::make_tuple({maybe_return_in_tuple}{", ".join(output_param_names)})' From e5556cfb6959ed8db8af8f1525c4ea9e24c2dde5 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Thu, 9 Nov 2023 17:32:32 +0100 Subject: [PATCH 108/169] more work on mbt, adding vectorized conversion functions --- modules/python/bindings/include/core.hpp | 429 +----------------- .../python/bindings/include/core/arrays.hpp | 262 +++++++++++ .../python/bindings/include/core/images.hpp | 79 ++++ .../bindings/include/core/pixel_meter.hpp | 62 +++ .../python/bindings/include/core/utils.hpp | 104 +++++ modules/python/config/core.json | 7 + modules/python/examples/synthetic_data_mbt.py | 58 ++- 7 files changed, 567 insertions(+), 434 deletions(-) create mode 100644 modules/python/bindings/include/core/arrays.hpp create mode 100644 modules/python/bindings/include/core/images.hpp create mode 100644 modules/python/bindings/include/core/pixel_meter.hpp create mode 100644 modules/python/bindings/include/core/utils.hpp diff --git a/modules/python/bindings/include/core.hpp b/modules/python/bindings/include/core.hpp index 6865fcb936..2e1948e78c 100644 --- a/modules/python/bindings/include/core.hpp +++ b/modules/python/bindings/include/core.hpp @@ -1,430 +1,9 @@ #ifndef VISP_PYTHON_CORE_HPP #define VISP_PYTHON_CORE_HPP -#include -#include - -#include -#include -#include - -#include -#include -#include -#include -#include - - - -namespace py = pybind11; - -template -using np_array_cf = py::array_t; - -/* -Create a buffer info for a row major array -*/ -template -py::buffer_info make_array_buffer(T *data, std::array dims, bool readonly) -{ - std::array strides; - for (unsigned i = 0; i < N; i++) { - unsigned s = sizeof(T); - for (unsigned j = i + 1; j < N; ++j) { - s *= dims[j]; - } - strides[i] = s; - } - return py::buffer_info( - data, /* Pointer to data (nullptr -> ask NumPy to allocate!) */ - sizeof(T), /* Size of one item */ - py::format_descriptor::value, /* Buffer format */ - N, /* How many dimensions? */ - dims, /* Number of elements for each dimension */ - strides, /* Strides for each dimension */ - readonly - ); -} - -std::string shape_to_string(const std::vector &shape) -{ - std::stringstream ss; - ss << "("; - for (int i = 0; i < int(shape.size()) - 1; ++i) { - ss << shape[i] << ","; - } - if (shape.size() > 0) { - ss << shape[shape.size() - 1]; - } - ss << ")"; - return ss.str(); -} - -template -void verify_array_shape_and_dims(np_array_cf np_array, unsigned dims, const char *class_name) -{ - py::buffer_info buffer = np_array.request(); - std::vector shape = buffer.shape; - if (shape.size() != dims) { - std::stringstream ss; - ss << "Tried to instanciate " << class_name - << " that expects a " << dims << "D array but got a numpy array of shape " - << shape_to_string(shape); - - throw std::runtime_error(ss.str()); - } -} -template -void verify_array_shape_and_dims(np_array_cf np_array, std::vector expected_dims, const char *class_name) -{ - verify_array_shape_and_dims(np_array, expected_dims.size(), class_name); - py::buffer_info buffer = np_array.request(); - std::vector shape = buffer.shape; - bool invalid_shape = false; - for (unsigned int i = 0; i < expected_dims.size(); ++i) { - if (shape[i] != expected_dims[i]) { - invalid_shape = true; - break; - } - } - if (invalid_shape) { - std::stringstream ss; - ss << "Tried to instanciate " << class_name - << " that expects an array of dimensions " << shape_to_string(expected_dims) - << " but got a numpy array of shape " << shape_to_string(shape); - - throw std::runtime_error(ss.str()); - } -} -template -void copy_data_from_np(np_array_cf src, Item *dest) -{ - py::buffer_info buffer = src.request(); - std::vector shape = buffer.shape; - unsigned int elements = 1; - for (ssize_t dim : shape) { - elements *= dim; - } - const Item *data = (Item *)buffer.ptr; - std::memcpy(dest, data, elements * sizeof(Item)); - -} - -/*Array2D and its children*/ - -/*Get buffer infos : used in def_buffer and the .numpy() function*/ -template py::buffer_info get_buffer_info(T &) = delete; -template class Array, - typename std::enable_if, Array>::value, bool>::type = true> -py::buffer_info get_buffer_info(Array &array) -{ - return make_array_buffer(array.data, { array.getRows(), array.getCols() }, false); -} - -template<> -py::buffer_info get_buffer_info(vpMatrix &array) -{ - return make_array_buffer(array.data, { array.getRows(), array.getCols() }, false); -} - -template<> -py::buffer_info get_buffer_info(vpColVector &array) -{ - return make_array_buffer(array.data, { array.getRows() }, false); -} -template<> -py::buffer_info get_buffer_info(vpRowVector &array) -{ - return make_array_buffer(array.data, { array.getCols() }, false); -} -template<> -py::buffer_info get_buffer_info(vpRotationMatrix &array) -{ - return make_array_buffer(array.data, { array.getRows(), array.getCols() }, true); -} -template<> -py::buffer_info get_buffer_info(vpHomogeneousMatrix &array) -{ - return make_array_buffer(array.data, { array.getRows(), array.getCols() }, true); -} - -/*Array 2D indexing*/ -template -void define_get_item_2d_array(PyClass &pyClass) -{ - - pyClass.def("__getitem__", [](const Class &self, std::pair pair) -> Item { - int i = pair.first, j = pair.second; - const unsigned int rows = self.getRows(), cols = self.getCols(); - if (abs(i) > rows || abs(j) > cols) { - std::stringstream ss; - ss << "Invalid indexing into a 2D array: got indices " << shape_to_string({ i, j }) - << " but array has dimensions " << shape_to_string({ rows, cols }); - throw std::runtime_error(ss.str()); - } - if (i < 0) { - i = rows + i; - } - if (j < 0) { - j = cols + j; - } - return self[i][j]; - }); - pyClass.def("__getitem__", [](const Class &self, int i) -> np_array_cf { - const unsigned int rows = self.getRows(); - if (abs(i) > rows) { - std::stringstream ss; - ss << "Invalid indexing into a 2D array: got row index " << shape_to_string({ i }) - << " but array has " << rows << " rows"; - throw std::runtime_error(ss.str()); - } - if (i < 0) { - i = rows + i; - } - return (py::cast(self).template cast >())[py::cast(i)].template cast>(); - }); - pyClass.def("__getitem__", [](const Class &self, py::slice slice) -> np_array_cf { - return (py::cast(self).template cast >())[slice].template cast>(); - }); - pyClass.def("__getitem__", [](const Class &self, py::tuple tuple) { - return (py::cast(self).template cast >())[tuple].template cast>(); - }); - -} - -const char *numpy_fn_doc_writable = R"doc( - Numpy view of the underlying array data. - This numpy view can be used to directly modify the array. -)doc"; - -const char *numpy_fn_doc_nonwritable = R"doc( - Numpy view of the underlying array data. - This numpy view cannot be modified. - If you try to modify the array, an exception will be raised. -)doc"; - - -template -void bindings_vpArray2D(py::class_> &pyArray2D) -{ - - pyArray2D.def_buffer(&get_buffer_info); - - pyArray2D.def("numpy", [](vpArray2D &self) -> np_array_cf { - return py::cast(self).template cast >(); - }, numpy_fn_doc_writable); - - pyArray2D.def(py::init([](np_array_cf &np_array) { - verify_array_shape_and_dims(np_array, 2, "ViSP 2D array"); - const std::vector shape = np_array.request().shape; - vpArray2D result(shape[0], shape[1]); - copy_data_from_np(np_array, result.data); - return result; - }), R"doc( -Construct a 2D ViSP array by **copying** a 2D numpy array. - -:param np_array: The numpy array to copy. - -)doc", py::arg("np_array")); - - define_get_item_2d_array>, vpArray2D, T>(pyArray2D); -} - -void bindings_vpMatrix(py::class_> &pyMatrix) -{ - - pyMatrix.def_buffer(&get_buffer_info); - - pyMatrix.def("numpy", [](vpMatrix &self) -> np_array_cf { - return py::cast(self).cast>(); - }, numpy_fn_doc_writable); - - pyMatrix.def(py::init([](np_array_cf np_array) { - verify_array_shape_and_dims(np_array, 2, "ViSP Matrix"); - const std::vector shape = np_array.request().shape; - vpMatrix result(shape[0], shape[1]); - copy_data_from_np(np_array, result.data); - return result; - }), R"doc( -Construct a matrix by **copying** a 2D numpy array. - -:param np_array: The numpy array to copy. - -)doc", py::arg("np_array")); - - define_get_item_2d_array>, vpMatrix, double>(pyMatrix); -} - - -void bindings_vpColVector(py::class_> &pyColVector) -{ - pyColVector.def_buffer(&get_buffer_info); - - pyColVector.def("numpy", [](vpColVector &self) -> np_array_cf { - return py::cast(self).cast>(); - }, numpy_fn_doc_writable); - - pyColVector.def(py::init([](np_array_cf np_array) { - verify_array_shape_and_dims(np_array, 1, "ViSP column vector"); - const std::vector shape = np_array.request().shape; - vpColVector result(shape[0]); - copy_data_from_np(np_array, result.data); - return result; - }), R"doc( -Construct a column vector by **copying** a 1D numpy array. - -:param np_array: The numpy 1D array to copy. - -)doc", py::arg("np_array")); - -} - -void bindings_vpRowVector(py::class_> &pyRowVector) -{ - pyRowVector.def_buffer(&get_buffer_info); - pyRowVector.def("numpy", [](vpRowVector &self) -> np_array_cf { - return np_array_cf(get_buffer_info(self), py::cast(self)); - }, numpy_fn_doc_writable); - pyRowVector.def(py::init([](np_array_cf np_array) { - verify_array_shape_and_dims(np_array, 1, "ViSP row vector"); - const std::vector shape = np_array.request().shape; - vpRowVector result(shape[0]); - copy_data_from_np(np_array, result.data); - return result; - }), R"doc( -Construct a row vector by **copying** a 1D numpy array. - -:param np_array: The numpy 1D array to copy. - -)doc", py::arg("np_array")); -} - - -void bindings_vpRotationMatrix(py::class_> &pyRotationMatrix) -{ - - pyRotationMatrix.def_buffer(&get_buffer_info); - pyRotationMatrix.def("numpy", [](vpRotationMatrix &self) -> np_array_cf { - return py::cast(self).cast>(); - }, numpy_fn_doc_nonwritable); - pyRotationMatrix.def(py::init([](np_array_cf np_array) { - verify_array_shape_and_dims(np_array, { 3, 3 }, "ViSP rotation matrix"); - const std::vector shape = np_array.request().shape; - vpRotationMatrix result; - copy_data_from_np(np_array, result.data); - if (!result.isARotationMatrix()) { - throw std::runtime_error("Input numpy array is not a valid rotation matrix"); - } - return result; - }), R"doc( -Construct a rotation matrix by **copying** a 2D numpy array. -This numpy array should be of dimensions :math:`3 \times 3` and be a valid rotation matrix. -If it is not a rotation matrix, an exception will be raised. - -:param np_array: The numpy 1D array to copy. - -)doc", py::arg("np_array")); - define_get_item_2d_array>, vpRotationMatrix, double>(pyRotationMatrix); -} - -void bindings_vpHomogeneousMatrix(py::class_> &pyHomogeneousMatrix) -{ - - pyHomogeneousMatrix.def_buffer(get_buffer_info); - pyHomogeneousMatrix.def("numpy", [](vpHomogeneousMatrix &self) -> np_array_cf { - return py::cast(self).cast>(); - }, numpy_fn_doc_nonwritable); - - pyHomogeneousMatrix.def(py::init([](np_array_cf np_array) { - verify_array_shape_and_dims(np_array, { 4, 4 }, "ViSP homogeneous matrix"); - const std::vector shape = np_array.request().shape; - vpHomogeneousMatrix result; - copy_data_from_np(np_array, result.data); - if (!result.isAnHomogeneousMatrix()) { - throw std::runtime_error("Input numpy array is not a valid homogeneous matrix"); - } - return result; - }), R"doc( -Construct a homogeneous matrix by **copying** a 2D numpy array. -This numpy array should be of dimensions :math:`4 \times 4` and be a valid homogeneous matrix. -If it is not a homogeneous matrix, an exception will be raised. - -:param np_array: The numpy 1D array to copy. - -)doc", py::arg("np_array")); - define_get_item_2d_array>, vpHomogeneousMatrix, double>(pyHomogeneousMatrix); -} - - -/* - vpImage -*/ -template -typename std::enable_if::value, void>::type -bindings_vpImage(py::class_> &pyImage) -{ - pyImage.def_buffer([](vpImage &image) -> py::buffer_info { - return make_array_buffer(image.bitmap, { image.getHeight(), image.getWidth() }, false); - }); - pyImage.def("numpy", [](vpImage &self) -> np_array_cf { - return py::cast(self).template cast>(); - }, numpy_fn_doc_writable); - - pyImage.def(py::init([](np_array_cf np_array) { - verify_array_shape_and_dims(np_array, 2, "ViSP Image"); - const std::vector shape = np_array.request().shape; - vpImage result(shape[0], shape[1]); - copy_data_from_np(np_array, result.bitmap); - return result; - }), R"doc( -Construct an image by **copying** a 2D numpy array. - -:param np_array: The numpy array to copy. - -)doc", py::arg("np_array")); -} - -template -typename std::enable_if::value, void>::type -bindings_vpImage(py::class_> &pyImage) -{ - static_assert(sizeof(T) == 4 * sizeof(unsigned char)); - pyImage.def_buffer([](vpImage &image) -> py::buffer_info { - return make_array_buffer(reinterpret_cast(image.bitmap), { image.getHeight(), image.getWidth(), 4 }, false); - }); - pyImage.def("numpy", [](vpImage &self) -> np_array_cf { - return py::cast(self).template cast>(); - }, numpy_fn_doc_writable); - - pyImage.def(py::init([](np_array_cf np_array) { - verify_array_shape_and_dims(np_array, 3, "ViSP RGBa image"); - const std::vector shape = np_array.request().shape; - if (shape[2] != 4) { - throw std::runtime_error("Tried to copy a 3D numpy array that does not have 4 elements per pixel into a ViSP RGBA image"); - } - vpImage result(shape[0], shape[1]); - copy_data_from_np(np_array, (unsigned char *)result.bitmap); - return result; - }), R"doc( -Construct an image by **copying** a 3D numpy array. this numpy array should be of the form :math:`H \times W \times 4` -where the 4 denotes the red, green, blue and alpha components of the image. - -:param np_array: The numpy array to copy. - -)doc", py::arg("np_array")); - -} -template -typename std::enable_if::value, void>::type -bindings_vpImage(py::class_> &pyImage) -{ - static_assert(sizeof(T) == 3 * sizeof(float)); - pyImage.def_buffer([](vpImage &image) -> py::buffer_info { - return make_array_buffer(reinterpret_cast(image.bitmap), { image.getHeight(), image.getWidth(), 3 }, false); - }); -} - - +#include "core/utils.hpp" +#include "core/arrays.hpp" +#include "core/images.hpp" +#include "core/pixel_meter.hpp" #endif diff --git a/modules/python/bindings/include/core/arrays.hpp b/modules/python/bindings/include/core/arrays.hpp new file mode 100644 index 0000000000..79ff9f67ce --- /dev/null +++ b/modules/python/bindings/include/core/arrays.hpp @@ -0,0 +1,262 @@ +#ifndef VISP_PYTHON_CORE_ARRAYS_HPP +#define VISP_PYTHON_CORE_ARRAYS_HPP +#include "core/utils.hpp" + + +#include +#include +#include + +#include +#include +#include + + +/*Array2D and its children*/ + +/*Get buffer infos : used in def_buffer and the .numpy() function*/ +template py::buffer_info get_buffer_info(T &) = delete; +template class Array, + typename std::enable_if, Array>::value, bool>::type = true> +py::buffer_info get_buffer_info(Array &array) +{ + return make_array_buffer(array.data, { array.getRows(), array.getCols() }, false); +} + +template<> +py::buffer_info get_buffer_info(vpMatrix &array) +{ + return make_array_buffer(array.data, { array.getRows(), array.getCols() }, false); +} + +template<> +py::buffer_info get_buffer_info(vpColVector &array) +{ + return make_array_buffer(array.data, { array.getRows() }, false); +} +template<> +py::buffer_info get_buffer_info(vpRowVector &array) +{ + return make_array_buffer(array.data, { array.getCols() }, false); +} +template<> +py::buffer_info get_buffer_info(vpRotationMatrix &array) +{ + return make_array_buffer(array.data, { array.getRows(), array.getCols() }, true); +} +template<> +py::buffer_info get_buffer_info(vpHomogeneousMatrix &array) +{ + return make_array_buffer(array.data, { array.getRows(), array.getCols() }, true); +} + +/*Array 2D indexing*/ +template +void define_get_item_2d_array(PyClass &pyClass) +{ + + pyClass.def("__getitem__", [](const Class &self, std::pair pair) -> Item { + int i = pair.first, j = pair.second; + const unsigned int rows = self.getRows(), cols = self.getCols(); + if (abs(i) > rows || abs(j) > cols) { + std::stringstream ss; + ss << "Invalid indexing into a 2D array: got indices " << shape_to_string({ i, j }) + << " but array has dimensions " << shape_to_string({ rows, cols }); + throw std::runtime_error(ss.str()); + } + if (i < 0) { + i = rows + i; + } + if (j < 0) { + j = cols + j; + } + return self[i][j]; + }); + pyClass.def("__getitem__", [](const Class &self, int i) -> np_array_cf { + const unsigned int rows = self.getRows(); + if (abs(i) > rows) { + std::stringstream ss; + ss << "Invalid indexing into a 2D array: got row index " << shape_to_string({ i }) + << " but array has " << rows << " rows"; + throw std::runtime_error(ss.str()); + } + if (i < 0) { + i = rows + i; + } + return (py::cast(self).template cast >())[py::cast(i)].template cast>(); + }); + pyClass.def("__getitem__", [](const Class &self, py::slice slice) -> np_array_cf { + return (py::cast(self).template cast >())[slice].template cast>(); + }); + pyClass.def("__getitem__", [](const Class &self, py::tuple tuple) { + return (py::cast(self).template cast >())[tuple].template cast>(); + }); + +} + +const char *numpy_fn_doc_writable = R"doc( + Numpy view of the underlying array data. + This numpy view can be used to directly modify the array. +)doc"; + +const char *numpy_fn_doc_nonwritable = R"doc( + Numpy view of the underlying array data. + This numpy view cannot be modified. + If you try to modify the array, an exception will be raised. +)doc"; + + +template +void bindings_vpArray2D(py::class_> &pyArray2D) +{ + + pyArray2D.def_buffer(&get_buffer_info); + + pyArray2D.def("numpy", [](vpArray2D &self) -> np_array_cf { + return py::cast(self).template cast >(); + }, numpy_fn_doc_writable); + + pyArray2D.def(py::init([](np_array_cf &np_array) { + verify_array_shape_and_dims(np_array, 2, "ViSP 2D array"); + const std::vector shape = np_array.request().shape; + vpArray2D result(shape[0], shape[1]); + copy_data_from_np(np_array, result.data); + return result; + }), R"doc( +Construct a 2D ViSP array by **copying** a 2D numpy array. + +:param np_array: The numpy array to copy. + +)doc", py::arg("np_array")); + + define_get_item_2d_array>, vpArray2D, T>(pyArray2D); +} + +void bindings_vpMatrix(py::class_> &pyMatrix) +{ + + pyMatrix.def_buffer(&get_buffer_info); + + pyMatrix.def("numpy", [](vpMatrix &self) -> np_array_cf { + return py::cast(self).cast>(); + }, numpy_fn_doc_writable); + + pyMatrix.def(py::init([](np_array_cf np_array) { + verify_array_shape_and_dims(np_array, 2, "ViSP Matrix"); + const std::vector shape = np_array.request().shape; + vpMatrix result(shape[0], shape[1]); + copy_data_from_np(np_array, result.data); + return result; + }), R"doc( +Construct a matrix by **copying** a 2D numpy array. + +:param np_array: The numpy array to copy. + +)doc", py::arg("np_array")); + + define_get_item_2d_array>, vpMatrix, double>(pyMatrix); +} + + +void bindings_vpColVector(py::class_> &pyColVector) +{ + pyColVector.def_buffer(&get_buffer_info); + + pyColVector.def("numpy", [](vpColVector &self) -> np_array_cf { + return py::cast(self).cast>(); + }, numpy_fn_doc_writable); + + pyColVector.def(py::init([](np_array_cf np_array) { + verify_array_shape_and_dims(np_array, 1, "ViSP column vector"); + const std::vector shape = np_array.request().shape; + vpColVector result(shape[0]); + copy_data_from_np(np_array, result.data); + return result; + }), R"doc( +Construct a column vector by **copying** a 1D numpy array. + +:param np_array: The numpy 1D array to copy. + +)doc", py::arg("np_array")); + +} + +void bindings_vpRowVector(py::class_> &pyRowVector) +{ + pyRowVector.def_buffer(&get_buffer_info); + pyRowVector.def("numpy", [](vpRowVector &self) -> np_array_cf { + return np_array_cf(get_buffer_info(self), py::cast(self)); + }, numpy_fn_doc_writable); + pyRowVector.def(py::init([](np_array_cf np_array) { + verify_array_shape_and_dims(np_array, 1, "ViSP row vector"); + const std::vector shape = np_array.request().shape; + vpRowVector result(shape[0]); + copy_data_from_np(np_array, result.data); + return result; + }), R"doc( +Construct a row vector by **copying** a 1D numpy array. + +:param np_array: The numpy 1D array to copy. + +)doc", py::arg("np_array")); +} + + +void bindings_vpRotationMatrix(py::class_> &pyRotationMatrix) +{ + + pyRotationMatrix.def_buffer(&get_buffer_info); + pyRotationMatrix.def("numpy", [](vpRotationMatrix &self) -> np_array_cf { + return py::cast(self).cast>(); + }, numpy_fn_doc_nonwritable); + pyRotationMatrix.def(py::init([](np_array_cf np_array) { + verify_array_shape_and_dims(np_array, { 3, 3 }, "ViSP rotation matrix"); + const std::vector shape = np_array.request().shape; + vpRotationMatrix result; + copy_data_from_np(np_array, result.data); + if (!result.isARotationMatrix()) { + throw std::runtime_error("Input numpy array is not a valid rotation matrix"); + } + return result; + }), R"doc( +Construct a rotation matrix by **copying** a 2D numpy array. +This numpy array should be of dimensions :math:`3 \times 3` and be a valid rotation matrix. +If it is not a rotation matrix, an exception will be raised. + +:param np_array: The numpy 1D array to copy. + +)doc", py::arg("np_array")); + define_get_item_2d_array>, vpRotationMatrix, double>(pyRotationMatrix); +} + +void bindings_vpHomogeneousMatrix(py::class_> &pyHomogeneousMatrix) +{ + + pyHomogeneousMatrix.def_buffer(get_buffer_info); + pyHomogeneousMatrix.def("numpy", [](vpHomogeneousMatrix &self) -> np_array_cf { + return py::cast(self).cast>(); + }, numpy_fn_doc_nonwritable); + + pyHomogeneousMatrix.def(py::init([](np_array_cf np_array) { + verify_array_shape_and_dims(np_array, { 4, 4 }, "ViSP homogeneous matrix"); + const std::vector shape = np_array.request().shape; + vpHomogeneousMatrix result; + copy_data_from_np(np_array, result.data); + if (!result.isAnHomogeneousMatrix()) { + throw std::runtime_error("Input numpy array is not a valid homogeneous matrix"); + } + return result; + }), R"doc( +Construct a homogeneous matrix by **copying** a 2D numpy array. +This numpy array should be of dimensions :math:`4 \times 4` and be a valid homogeneous matrix. +If it is not a homogeneous matrix, an exception will be raised. + +:param np_array: The numpy 1D array to copy. + +)doc", py::arg("np_array")); + define_get_item_2d_array>, vpHomogeneousMatrix, double>(pyHomogeneousMatrix); +} + + +#endif diff --git a/modules/python/bindings/include/core/images.hpp b/modules/python/bindings/include/core/images.hpp new file mode 100644 index 0000000000..2f84532f0a --- /dev/null +++ b/modules/python/bindings/include/core/images.hpp @@ -0,0 +1,79 @@ +#ifndef VISP_PYTHON_CORE_IMAGES_HPP +#define VISP_PYTHON_CORE_IMAGES_HPP + + +#include +#include + + +/* + vpImage +*/ +template +typename std::enable_if::value, void>::type +bindings_vpImage(py::class_> &pyImage) +{ + pyImage.def_buffer([](vpImage &image) -> py::buffer_info { + return make_array_buffer(image.bitmap, { image.getHeight(), image.getWidth() }, false); + }); + pyImage.def("numpy", [](vpImage &self) -> np_array_cf { + return py::cast(self).template cast>(); + }, numpy_fn_doc_writable); + + pyImage.def(py::init([](np_array_cf np_array) { + verify_array_shape_and_dims(np_array, 2, "ViSP Image"); + const std::vector shape = np_array.request().shape; + vpImage result(shape[0], shape[1]); + copy_data_from_np(np_array, result.bitmap); + return result; + }), R"doc( +Construct an image by **copying** a 2D numpy array. + +:param np_array: The numpy array to copy. + +)doc", py::arg("np_array")); +} + +template +typename std::enable_if::value, void>::type +bindings_vpImage(py::class_> &pyImage) +{ + static_assert(sizeof(T) == 4 * sizeof(unsigned char)); + pyImage.def_buffer([](vpImage &image) -> py::buffer_info { + return make_array_buffer(reinterpret_cast(image.bitmap), { image.getHeight(), image.getWidth(), 4 }, false); + }); + pyImage.def("numpy", [](vpImage &self) -> np_array_cf { + return py::cast(self).template cast>(); + }, numpy_fn_doc_writable); + + pyImage.def(py::init([](np_array_cf np_array) { + verify_array_shape_and_dims(np_array, 3, "ViSP RGBa image"); + const std::vector shape = np_array.request().shape; + if (shape[2] != 4) { + throw std::runtime_error("Tried to copy a 3D numpy array that does not have 4 elements per pixel into a ViSP RGBA image"); + } + vpImage result(shape[0], shape[1]); + copy_data_from_np(np_array, (unsigned char *)result.bitmap); + return result; + }), R"doc( +Construct an image by **copying** a 3D numpy array. this numpy array should be of the form :math:`H \times W \times 4` +where the 4 denotes the red, green, blue and alpha components of the image. + +:param np_array: The numpy array to copy. + +)doc", py::arg("np_array")); + +} +template +typename std::enable_if::value, void>::type +bindings_vpImage(py::class_> &pyImage) +{ + static_assert(sizeof(T) == 3 * sizeof(float)); + pyImage.def_buffer([](vpImage &image) -> py::buffer_info { + return make_array_buffer(reinterpret_cast(image.bitmap), { image.getHeight(), image.getWidth(), 3 }, false); + }); +} + + + +#endif diff --git a/modules/python/bindings/include/core/pixel_meter.hpp b/modules/python/bindings/include/core/pixel_meter.hpp new file mode 100644 index 0000000000..4a8f4b6cee --- /dev/null +++ b/modules/python/bindings/include/core/pixel_meter.hpp @@ -0,0 +1,62 @@ +#ifndef VISP_PYTHON_CORE_PIXEL_METER_HPP +#define VISP_PYTHON_CORE_PIXEL_METER_HPP + + +#include +#include +#include + +#include +#include + +#include "core/utils.hpp" + +void bindings_vpPixelMeterConversion(py::class_ &pyPM) +{ + + pyPM.def_static("convertPoints", [](const vpCameraParameters &cam, const py::array_t &us, const py::array_t &vs) { + py::buffer_info bufu = us.request(), bufv = vs.request(); + if (bufu.ndim != bufv.ndim || bufu.shape != bufv.shape) { + std::stringstream ss; + ss << "us and vs must have the same number of dimensions and same number of elements, but got us = " << shape_to_string(bufu.shape); + ss << "and vs = " << shape_to_string(bufv.shape); + throw std::runtime_error(ss.str()); + } + py::array_t xs(bufu.shape); + py::array_t ys(bufv.shape); + + const double *u_ptr = static_cast(bufu.ptr); + const double *v_ptr = static_cast(bufv.ptr); + double *x_ptr = static_cast(xs.request().ptr); + double *y_ptr = static_cast(ys.request().ptr); + + for (size_t i = 0; i < bufu.size; ++i) { + vpPixelMeterConversion::convertPoint(cam, u_ptr[i], v_ptr[i], x_ptr[i], y_ptr[i]); + } + + + return std::make_tuple(std::move(xs), std::move(ys)); + + }, R"doc( +Convert a set of 2D pixel coordinates to normalized coordinates. +:param cam: The camera intrinsics with which to convert pixels to normalized coordinates. +:param us: The pixel coordinates along the horizontal axis. +:param vs: The pixel coordinates along the vertical axis. + +:raises RuntimeError: If us and vs do not have the same dimensions and shape. + +:return: A tuple containing the x and y normalized coordinates of the input pixels. + +)doc", py::arg("cam"), py::arg("us"), py::arg("vs")); + +} + + +void bindings_vpMeterPixelConversion(py::class_ &pyMP) +{ + +} + + + +#endif diff --git a/modules/python/bindings/include/core/utils.hpp b/modules/python/bindings/include/core/utils.hpp new file mode 100644 index 0000000000..7179dfb20c --- /dev/null +++ b/modules/python/bindings/include/core/utils.hpp @@ -0,0 +1,104 @@ +#ifndef VISP_PYTHON_CORE_UTILS_HPP +#define VISP_PYTHON_CORE_UTILS_HPP +#include +#include + +#include +#include +#include + +namespace py = pybind11; + +template +using np_array_cf = py::array_t; + +/* +Create a buffer info for a row major array +*/ +template +py::buffer_info make_array_buffer(T *data, std::array dims, bool readonly) +{ + std::array strides; + for (unsigned i = 0; i < N; i++) { + unsigned s = sizeof(T); + for (unsigned j = i + 1; j < N; ++j) { + s *= dims[j]; + } + strides[i] = s; + } + return py::buffer_info( + data, /* Pointer to data (nullptr -> ask NumPy to allocate!) */ + sizeof(T), /* Size of one item */ + py::format_descriptor::value, /* Buffer format */ + N, /* How many dimensions? */ + dims, /* Number of elements for each dimension */ + strides, /* Strides for each dimension */ + readonly + ); +} + +std::string shape_to_string(const std::vector &shape) +{ + std::stringstream ss; + ss << "("; + for (int i = 0; i < int(shape.size()) - 1; ++i) { + ss << shape[i] << ","; + } + if (shape.size() > 0) { + ss << shape[shape.size() - 1]; + } + ss << ")"; + return ss.str(); +} + +template +void verify_array_shape_and_dims(np_array_cf np_array, unsigned dims, const char *class_name) +{ + py::buffer_info buffer = np_array.request(); + std::vector shape = buffer.shape; + if (shape.size() != dims) { + std::stringstream ss; + ss << "Tried to instanciate " << class_name + << " that expects a " << dims << "D array but got a numpy array of shape " + << shape_to_string(shape); + + throw std::runtime_error(ss.str()); + } +} +template +void verify_array_shape_and_dims(np_array_cf np_array, std::vector expected_dims, const char *class_name) +{ + verify_array_shape_and_dims(np_array, expected_dims.size(), class_name); + py::buffer_info buffer = np_array.request(); + std::vector shape = buffer.shape; + bool invalid_shape = false; + for (unsigned int i = 0; i < expected_dims.size(); ++i) { + if (shape[i] != expected_dims[i]) { + invalid_shape = true; + break; + } + } + if (invalid_shape) { + std::stringstream ss; + ss << "Tried to instanciate " << class_name + << " that expects an array of dimensions " << shape_to_string(expected_dims) + << " but got a numpy array of shape " << shape_to_string(shape); + + throw std::runtime_error(ss.str()); + } +} +template +void copy_data_from_np(np_array_cf src, Item *dest) +{ + py::buffer_info buffer = src.request(); + std::vector shape = buffer.shape; + unsigned int elements = 1; + for (ssize_t dim : shape) { + elements *= dim; + } + const Item *data = (Item *)buffer.ptr; + std::memcpy(dest, data, elements * sizeof(Item)); + +} + +#endif diff --git a/modules/python/config/core.json b/modules/python/config/core.json index 92d8ebff33..de5cb7f84f 100644 --- a/modules/python/config/core.json +++ b/modules/python/config/core.json @@ -295,7 +295,14 @@ "ignore": true } ] + }, + "vpPixelMeterConversion": { + "additional_bindings": "bindings_vpPixelMeterConversion" + }, + "vpMeterPixelConversion": { + "additional_bindings": "bindings_vpMeterPixelConversion" } + } } diff --git a/modules/python/examples/synthetic_data_mbt.py b/modules/python/examples/synthetic_data_mbt.py index 9343b88714..0ee578638b 100644 --- a/modules/python/examples/synthetic_data_mbt.py +++ b/modules/python/examples/synthetic_data_mbt.py @@ -2,12 +2,19 @@ from dataclasses import dataclass from pathlib import Path from typing import List, Optional +import numpy as np +import time +import faulthandler +faulthandler.enable() + from visp.core import XmlParserCamera, CameraParameters, ColVector, HomogeneousMatrix, Display, ImageConvert from visp.core import ImageGray, ImageUInt16 from visp.io import ImageIo from visp.mbt import MbGenericTracker, MbTracker from visp.gui import DisplayOpenCV +from visp.core import Color +from visp.core import PixelMeterConversion try: import cv2 @@ -125,10 +132,11 @@ class FrameData: -def read_data(exp_config: MBTConfig, use_depth: bool, I: ImageGray): + +def read_data(exp_config: MBTConfig, cam_depth: CameraParameters | None, I: ImageGray): color_format = '{:04d}_L.jpg' depth_format = 'Image{:04d}_R.exr' - + use_depth = cam_depth is not None iteration = 1 while True: color_filepath = exp_config.color_images_dir / color_format.format(iteration) @@ -139,22 +147,35 @@ def read_data(exp_config: MBTConfig, use_depth: bool, I: ImageGray): I_depth_raw = None + point_cloud = None if use_depth: depth_filepath = exp_config.depth_images_dir / depth_format.format(iteration) if not depth_filepath.exists(): - print(f'Could not find image {depth_filepath}, is the sequence finished?') + print(f'Could not find image {depth_filepath}') return I_depth_np = cv2.imread(str(depth_filepath), cv2.IMREAD_ANYCOLOR | cv2.IMREAD_ANYDEPTH) I_depth_np = I_depth_np[..., 0] I_depth_raw = ImageUInt16(I_depth_np * 32767.5) if I_depth_np.size == 0: print('Could not successfully read the depth image') + return + point_cloud = np.empty((*I_depth_np.shape, 3), dtype=np.float64) + Z = I_depth_np + Z[Z > 2] = 0.0 # Clamping values that are too high + t = time.time() + for i in range(I_depth_np.shape[0]): + for j in range(I_depth_np.shape[1]): + x, y = PixelMeterConversion.convertPoint(cam_depth, j, i, 0.0, 0.0) + point_cloud[i, j, :2] = [x, y] + point_cloud[:, :, 2] = Z + print(f'Point_cloud took {time.time() - t}') + cMo_ground_truth = HomogeneousMatrix() ground_truth_file = exp_config.ground_truth_dir / (exp_config.color_camera_name + '_{:04d}.txt'.format(iteration)) cMo_ground_truth.load(str(ground_truth_file)) iteration += 1 - yield FrameData(I, I_depth_raw, None, cMo_ground_truth) + yield FrameData(I, I_depth_raw, point_cloud, cMo_ground_truth) @@ -212,7 +233,7 @@ def parse_camera_file(exp_config: MBTConfig, is_color: bool) -> CameraParameters print('Color intrinsics:', cam_color) print('Depth intrinsics:', cam_depth) I = ImageGray() - data_generator = read_data(exp_config, not args.disable_depth, I) + data_generator = read_data(exp_config, cam_depth, I) frame_data = next(data_generator) # Get first frame for init @@ -221,7 +242,6 @@ def parse_camera_file(exp_config: MBTConfig, is_color: bool) -> CameraParameters depth_M_color.load(exp_config.extrinsic_file) tracker.setCameraTransformationMatrix('Camera2', depth_M_color) - # tracker.initClick(I, str(mbt_model.init_file), True, HomogeneousMatrix()) TODO: does not work tracker.initFromPose(I, frame_data.cMo_ground_truth) @@ -232,22 +252,42 @@ def parse_camera_file(exp_config: MBTConfig, is_color: bool) -> CameraParameters dDepth = DisplayOpenCV() if not args.disable_depth: ImageConvert.createDepthHistogram(frame_data.I_depth, I_depth) - dDepth.init(I_depth, 0, 640, 'Depth') + dDepth.init(I_depth, 0, I.getWidth(), 'Depth') for frame_data in data_generator: if frame_data.I_depth is not None: ImageConvert.createDepthHistogram(frame_data.I_depth, I_depth) + Display.display(I) if not args.disable_depth: Display.display(I_depth) - tracker.track(I=I) + + if args.disable_depth: + tracker.track(I=I) + else: + pc = frame_data.point_cloud + k = 'Camera2' + print(pc.shape) + image_dict = { + 'Camera1': I + } + pc_h, pc_w, _ = pc.shape + pc_flat = np.reshape(pc, (-1, 3)) + converted_pc = [ColVector(pc_flat[i]) for i in range(len(pc_flat))] + + pc_dict, width_dict, height_dict = ({'Camera2': v} for v in (converted_pc, pc_w, pc_h)) + print(len(converted_pc), converted_pc[0]) + tracker.track(image_dict, pc_dict, width_dict, height_dict) cMo = HomogeneousMatrix() tracker.getPose(cMo) - print(cMo) + + Display.displayFrame(I, cMo, cam_color, 0.05, Color.none, 2); + Display.flush(I) if not args.disable_depth: Display.flush(I_depth) + Display.getKeyboardEvent(I, blocking=True) From 1d75f46583be1a9ff3d5d1317e6e3d882c3c5b52 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Mon, 13 Nov 2023 13:25:02 +0100 Subject: [PATCH 109/169] Running MBT with depth at suboptimal framerate --- .../bindings/include/core/pixel_meter.hpp | 36 +++++- modules/python/bindings/include/mbt.hpp | 55 +++++++++ modules/python/config/mbt.json | 14 ++- modules/python/examples/synthetic_data_mbt.py | 111 +++--------------- 4 files changed, 120 insertions(+), 96 deletions(-) create mode 100644 modules/python/bindings/include/mbt.hpp diff --git a/modules/python/bindings/include/core/pixel_meter.hpp b/modules/python/bindings/include/core/pixel_meter.hpp index 4a8f4b6cee..1610fbe673 100644 --- a/modules/python/bindings/include/core/pixel_meter.hpp +++ b/modules/python/bindings/include/core/pixel_meter.hpp @@ -30,7 +30,7 @@ void bindings_vpPixelMeterConversion(py::class_ &pyPM) double *x_ptr = static_cast(xs.request().ptr); double *y_ptr = static_cast(ys.request().ptr); - for (size_t i = 0; i < bufu.size; ++i) { + for (ssize_t i = 0; i < bufu.size; ++i) { vpPixelMeterConversion::convertPoint(cam, u_ptr[i], v_ptr[i], x_ptr[i], y_ptr[i]); } @@ -54,6 +54,40 @@ Convert a set of 2D pixel coordinates to normalized coordinates. void bindings_vpMeterPixelConversion(py::class_ &pyMP) { + pyMP.def_static("convertPoints", [](const vpCameraParameters &cam, const py::array_t &xs, const py::array_t &ys) { + py::buffer_info bufx = xs.request(), bufy = ys.request(); + if (bufx.ndim != bufy.ndim || bufx.shape != bufy.shape) { + std::stringstream ss; + ss << "xs and ys must have the same number of dimensions and same number of elements, but got xs = " << shape_to_string(bufx.shape); + ss << "and ys = " << shape_to_string(bufy.shape); + throw std::runtime_error(ss.str()); + } + py::array_t us(bufx.shape); + py::array_t vs(bufy.shape); + + const double *x_ptr = static_cast(bufx.ptr); + const double *y_ptr = static_cast(bufy.ptr); + double *u_ptr = static_cast(us.request().ptr); + double *v_ptr = static_cast(vs.request().ptr); + + for (ssize_t i = 0; i < bufx.size; ++i) { + vpMeterPixelConversion::convertPoint(cam, x_ptr[i], y_ptr[i], u_ptr[i], v_ptr[i]); + } + + + return std::make_tuple(std::move(us), std::move(vs)); + + }, R"doc( +Convert a set of 2D normalized coordinates to pixel coordinates. +:param cam: The camera intrinsics with which to convert normalized coordinates to pixels. +:param xs: The normalized coordinates along the horizontal axis. +:param ys: The normalized coordinates along the vertical axis. + +:raises RuntimeError: If xs and ys do not have the same dimensions and shape. + +:return: A tuple containing the u,v pixel coordinates of the input normalized coordinates. + +)doc", py::arg("cam"), py::arg("xs"), py::arg("ys")); } diff --git a/modules/python/bindings/include/mbt.hpp b/modules/python/bindings/include/mbt.hpp new file mode 100644 index 0000000000..9095237ff8 --- /dev/null +++ b/modules/python/bindings/include/mbt.hpp @@ -0,0 +1,55 @@ +#ifndef VISP_PYTHON_MBT_HPP +#define VISP_PYTHON_MBT_HPP +#include +#include +#include +#include + +namespace py = pybind11; + + +void bindings_vpMbGenericTracker(py::class_ &pyMbGenericTracker) +{ + pyMbGenericTracker.def("track", [](vpMbGenericTracker &self, std::map *> &mapOfImages, + std::map> &mapOfPointClouds) { + std::map mapOfWidths, mapOfHeights; + std::map> mapOfVectors; + double t = vpTime::measureTimeMs(); + for (const auto &point_cloud_pair: mapOfPointClouds) { + + py::buffer_info buffer = point_cloud_pair.second.request(); + if (buffer.ndim != 3 and buffer.shape[2] != 3) { + std::stringstream ss; + ss << "Pointcloud error: pointcloud at key: " << point_cloud_pair.first << + " should be a 3D numpy array of dimensions H X W x 3"; + throw std::runtime_error(ss.str()); + } + const auto shape = buffer.shape; + mapOfHeights[point_cloud_pair.first] = shape[0]; + mapOfWidths[point_cloud_pair.first] = shape[1]; + + std::vector pc(shape[0] * shape[1], vpColVector(3)); + const double *data = point_cloud_pair.second.unchecked<3>().data(0, 0, 0); + for (ssize_t i = 0; i < shape[0]; ++i) { + for (ssize_t j = 0; j < shape[1]; ++j) { + size_t vec_idx = i * shape[1] + j; + size_t idx = i * shape[1] * 3 + j * 3; + memcpy(pc[vec_idx].data, data + idx, sizeof(double) * 3); + } + } + + mapOfVectors[point_cloud_pair.first] = std::move(pc); + } + std::map * > mapOfVectorPtrs; + for (const auto &p: mapOfVectors) { + mapOfVectorPtrs[p.first] = &(p.second); + } + double tt = vpTime::measureTimeMs(); + std::cout << (tt - t) << std::endl; + self.track(mapOfImages, mapOfVectorPtrs, mapOfWidths, mapOfHeights); + + + }); +} + +#endif diff --git a/modules/python/config/mbt.json b/modules/python/config/mbt.json index 871b47c723..c189a5cb30 100644 --- a/modules/python/config/mbt.json +++ b/modules/python/config/mbt.json @@ -1 +1,13 @@ -{"ignored_headers": [], "ignored_classes": [], "user_defined_headers": [], "classes": {}, "enums": {}} \ No newline at end of file +{ + + "ignored_headers": [], + "ignored_classes": [], + "user_defined_headers": ["mbt.hpp"], + "classes": { + + "vpMbGenericTracker": { + "additional_bindings": "bindings_vpMbGenericTracker" + } + }, + "enums": {} +} diff --git a/modules/python/examples/synthetic_data_mbt.py b/modules/python/examples/synthetic_data_mbt.py index 0ee578638b..c0f0e4c42c 100644 --- a/modules/python/examples/synthetic_data_mbt.py +++ b/modules/python/examples/synthetic_data_mbt.py @@ -25,73 +25,6 @@ import matplotlib.pyplot as plt -# bool read_data(unsigned int cpt, const std::string &video_color_images, const std::string &video_depth_images, -# bool disable_depth, const std::string &video_ground_truth, -# vpImage &I, vpImage &I_depth_raw, -# unsigned int &depth_width, unsigned int &depth_height, -# std::vector &pointcloud, const vpCameraParameters &cam_depth, -# vpHomogeneousMatrix &cMo_ground_truth) -# { -# char buffer[FILENAME_MAX]; -# // Read color -# snprintf(buffer, FILENAME_MAX, video_color_images.c_str(), cpt); -# std::string filename_color = buffer; - -# if (!vpIoTools::checkFilename(filename_color)) { -# std::cerr << "Cannot read: " << filename_color << std::endl; -# return false; -# } -# vpImageIo::read(I, filename_color); - -# if (!disable_depth) { -# // Read depth -# snprintf(buffer, FILENAME_MAX, video_depth_images.c_str(), cpt); -# std::string filename_depth = buffer; - -# if (!vpIoTools::checkFilename(filename_depth)) { -# std::cerr << "Cannot read: " << filename_depth << std::endl; -# return false; -# } -# cv::Mat depth_raw = cv::imread(filename_depth, cv::IMREAD_ANYDEPTH | cv::IMREAD_ANYCOLOR); -# if (depth_raw.empty()) { -# std::cerr << "Cannot read: " << filename_depth << std::endl; -# return false; -# } - -# depth_width = static_cast(depth_raw.cols); -# depth_height = static_cast(depth_raw.rows); -# I_depth_raw.resize(depth_height, depth_width); -# pointcloud.resize(depth_width * depth_height); - -# for (int i = 0; i < depth_raw.rows; i++) { -# for (int j = 0; j < depth_raw.cols; j++) { -# I_depth_raw[i][j] = static_cast(32767.5f * depth_raw.at(i, j)[0]); -# double x = 0.0, y = 0.0; -# // Manually limit the field of view of the depth camera -# double Z = depth_raw.at(i, j)[0] > 2.0f ? 0.0 : static_cast(depth_raw.at(i, j)[0]); -# vpPixelMeterConversion::convertPoint(cam_depth, j, i, x, y); -# size_t idx = static_cast(i * depth_raw.cols + j); -# pointcloud[idx].resize(3); -# pointcloud[idx][0] = x * Z; -# pointcloud[idx][1] = y * Z; -# pointcloud[idx][2] = Z; -# } -# } -# } - -# // Read ground truth -# snprintf(buffer, FILENAME_MAX, video_ground_truth.c_str(), cpt); -# std::string filename_pose = buffer; - -# cMo_ground_truth.load(filename_pose); - -# return true; - - - - - - class MBTModelData: def __init__(self, data_root: Path): @@ -127,7 +60,7 @@ def __init__(self, data_root: Path): class FrameData: I: ImageGray I_depth: Optional[ImageUInt16] - point_cloud: Optional[List[ColVector]] + point_cloud: Optional[np.ndarray] cMo_ground_truth: HomogeneousMatrix @@ -159,15 +92,16 @@ def read_data(exp_config: MBTConfig, cam_depth: CameraParameters | None, I: Imag if I_depth_np.size == 0: print('Could not successfully read the depth image') return + t = time.time() point_cloud = np.empty((*I_depth_np.shape, 3), dtype=np.float64) - Z = I_depth_np + Z = I_depth_np.copy() Z[Z > 2] = 0.0 # Clamping values that are too high - t = time.time() - for i in range(I_depth_np.shape[0]): - for j in range(I_depth_np.shape[1]): - x, y = PixelMeterConversion.convertPoint(cam_depth, j, i, 0.0, 0.0) - point_cloud[i, j, :2] = [x, y] - point_cloud[:, :, 2] = Z + + vs, us = np.meshgrid(range(I_depth_np.shape[0]), range(I_depth_np.shape[1]), indexing='ij') + xs, ys = PixelMeterConversion.convertPoints(cam_depth, us, vs) + point_cloud[..., 0] = xs * Z + point_cloud[..., 1] = ys * Z + point_cloud[..., 2] = Z print(f'Point_cloud took {time.time() - t}') @@ -234,7 +168,6 @@ def parse_camera_file(exp_config: MBTConfig, is_color: bool) -> CameraParameters print('Depth intrinsics:', cam_depth) I = ImageGray() data_generator = read_data(exp_config, cam_depth, I) - frame_data = next(data_generator) # Get first frame for init depth_M_color = HomogeneousMatrix() @@ -242,12 +175,13 @@ def parse_camera_file(exp_config: MBTConfig, is_color: bool) -> CameraParameters depth_M_color.load(exp_config.extrinsic_file) tracker.setCameraTransformationMatrix('Camera2', depth_M_color) - # tracker.initClick(I, str(mbt_model.init_file), True, HomogeneousMatrix()) TODO: does not work - tracker.initFromPose(I, frame_data.cMo_ground_truth) - # Initialize displays dI = DisplayOpenCV() dI.init(I, 0, 0, 'Color image') + + tracker.initClick(I, str(mbt_model.init_file)) + tracker.initFromPose(I, frame_data.cMo_ground_truth) + I_depth = None if args.disable_depth else ImageGray() dDepth = DisplayOpenCV() if not args.disable_depth: @@ -266,30 +200,19 @@ def parse_camera_file(exp_config: MBTConfig, is_color: bool) -> CameraParameters tracker.track(I=I) else: pc = frame_data.point_cloud - k = 'Camera2' - print(pc.shape) image_dict = { 'Camera1': I } - pc_h, pc_w, _ = pc.shape - pc_flat = np.reshape(pc, (-1, 3)) - converted_pc = [ColVector(pc_flat[i]) for i in range(len(pc_flat))] - - pc_dict, width_dict, height_dict = ({'Camera2': v} for v in (converted_pc, pc_w, pc_h)) - print(len(converted_pc), converted_pc[0]) - tracker.track(image_dict, pc_dict, width_dict, height_dict) + t = time.time() + tracker.track(image_dict, {'Camera2': pc}) + print(f'Tracking took {time.time() - t}s') cMo = HomogeneousMatrix() tracker.getPose(cMo) - Display.displayFrame(I, cMo, cam_color, 0.05, Color.none, 2); + Display.displayFrame(I, cMo, cam_color, 0.05, Color.none, 2) Display.flush(I) if not args.disable_depth: Display.flush(I_depth) Display.getKeyboardEvent(I, blocking=True) - - - - - pass From df0be1212b283b423e845822a9050596f68a77cb Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Mon, 13 Nov 2023 16:27:11 +0100 Subject: [PATCH 110/169] small improvement to mbt python tutorial --- modules/python/examples/synthetic_data_mbt.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/modules/python/examples/synthetic_data_mbt.py b/modules/python/examples/synthetic_data_mbt.py index c0f0e4c42c..0a82ecdc87 100644 --- a/modules/python/examples/synthetic_data_mbt.py +++ b/modules/python/examples/synthetic_data_mbt.py @@ -132,7 +132,8 @@ def parse_camera_file(exp_config: MBTConfig, is_color: bool) -> CameraParameters parser.add_argument('--display-ground-truth', action='store_true') parser.add_argument('--disable-klt', action='store_true') parser.add_argument('--disable-depth', action='store_true') - + parser.add_argument('--step-by-step', action='store_true') + parser.add_argument('--init-ground-truth', action='store_true') args = parser.parse_args() @@ -179,14 +180,16 @@ def parse_camera_file(exp_config: MBTConfig, is_color: bool) -> CameraParameters dI = DisplayOpenCV() dI.init(I, 0, 0, 'Color image') - tracker.initClick(I, str(mbt_model.init_file)) - tracker.initFromPose(I, frame_data.cMo_ground_truth) - I_depth = None if args.disable_depth else ImageGray() dDepth = DisplayOpenCV() if not args.disable_depth: ImageConvert.createDepthHistogram(frame_data.I_depth, I_depth) - dDepth.init(I_depth, 0, I.getWidth(), 'Depth') + dDepth.init(I_depth, I.getWidth(), 0, 'Depth') + + if args.init_ground_truth: + tracker.initFromPose(I, frame_data.cMo_ground_truth) + else: + tracker.initClick(I, str(mbt_model.init_file)) for frame_data in data_generator: if frame_data.I_depth is not None: @@ -210,9 +213,9 @@ def parse_camera_file(exp_config: MBTConfig, is_color: bool) -> CameraParameters tracker.getPose(cMo) Display.displayFrame(I, cMo, cam_color, 0.05, Color.none, 2) - + tracker.display(I, cMo, cam_color, Color.red, 2) Display.flush(I) if not args.disable_depth: Display.flush(I_depth) - - Display.getKeyboardEvent(I, blocking=True) + if args.step_by_step: + Display.getKeyboardEvent(I, blocking=True) From 191663fb3a571d4437035c9fdf252c2d6a08c7f9 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Wed, 22 Nov 2023 17:04:58 +0100 Subject: [PATCH 111/169] fix tuple return issues --- modules/python/config/dnn_tracker.json | 8 +++++++- modules/python/config/gui.json | 8 +++++++- modules/python/config/imgproc.json | 8 ++++++-- modules/python/config/tt.json | 8 +++++++- modules/python/config/tt_mi.json | 12 +++++++++++- modules/python/docs/todos.rst | 12 ++++++++++++ .../generator/visp_python_bindgen/methods.py | 14 +++++++++++--- 7 files changed, 61 insertions(+), 9 deletions(-) diff --git a/modules/python/config/dnn_tracker.json b/modules/python/config/dnn_tracker.json index 871b47c723..294b0d30ac 100644 --- a/modules/python/config/dnn_tracker.json +++ b/modules/python/config/dnn_tracker.json @@ -1 +1,7 @@ -{"ignored_headers": [], "ignored_classes": [], "user_defined_headers": [], "classes": {}, "enums": {}} \ No newline at end of file +{ + "ignored_headers": [], + "ignored_classes": [], + "user_defined_headers": [], + "classes": {}, + "enums": {} +} diff --git a/modules/python/config/gui.json b/modules/python/config/gui.json index 9e26dfeeb6..294b0d30ac 100644 --- a/modules/python/config/gui.json +++ b/modules/python/config/gui.json @@ -1 +1,7 @@ -{} \ No newline at end of file +{ + "ignored_headers": [], + "ignored_classes": [], + "user_defined_headers": [], + "classes": {}, + "enums": {} +} diff --git a/modules/python/config/imgproc.json b/modules/python/config/imgproc.json index 0e0dcd235c..294b0d30ac 100644 --- a/modules/python/config/imgproc.json +++ b/modules/python/config/imgproc.json @@ -1,3 +1,7 @@ { - -} \ No newline at end of file + "ignored_headers": [], + "ignored_classes": [], + "user_defined_headers": [], + "classes": {}, + "enums": {} +} diff --git a/modules/python/config/tt.json b/modules/python/config/tt.json index 871b47c723..294b0d30ac 100644 --- a/modules/python/config/tt.json +++ b/modules/python/config/tt.json @@ -1 +1,7 @@ -{"ignored_headers": [], "ignored_classes": [], "user_defined_headers": [], "classes": {}, "enums": {}} \ No newline at end of file +{ + "ignored_headers": [], + "ignored_classes": [], + "user_defined_headers": [], + "classes": {}, + "enums": {} +} diff --git a/modules/python/config/tt_mi.json b/modules/python/config/tt_mi.json index 871b47c723..689f81f91f 100644 --- a/modules/python/config/tt_mi.json +++ b/modules/python/config/tt_mi.json @@ -1 +1,11 @@ -{"ignored_headers": [], "ignored_classes": [], "user_defined_headers": [], "classes": {}, "enums": {}} \ No newline at end of file +{ + "ignored_headers": [], + "ignored_classes": [], + "user_defined_headers": [], + "classes": { + "vpTemplateTrackerMI": { + "is_virtual": true + } + }, + "enums": {} +} diff --git a/modules/python/docs/todos.rst b/modules/python/docs/todos.rst index 3e618a1d3e..7f29f8a017 100644 --- a/modules/python/docs/todos.rst +++ b/modules/python/docs/todos.rst @@ -54,6 +54,18 @@ To be written: * In code documentation for the generator * Document config files +* Failure cases + + * If you have this error: + error: invalid new-expression of abstract class type ‘vpTemplateTrackerMI’ + return new Class{std::forward(args)...}; + In file included from /home/sfelton/software/visp_build/modules/python/bindings/src/tt_mi.cpp:13:0: + /home/sfelton/software/visp-sfelton/modules/tracker/tt_mi/include/visp3/tt_mi/vpTemplateTrackerMI.h:46:19: note: because the following virtual functions are pure within ‘vpTemplateTrackerMI’: + class VISP_EXPORT vpTemplateTrackerMI : public vpTemplateTracker + You should define the class (here vpTemplaterMI) as pure virtual in the config file (via the flag is_virtual) + This error occurs because some methods are defined as pure virtual in a parent class and are not defined in the class this class: Pure virtual class detection does not look in the class hierarchy but only at the present class + + Packaging ------------------ diff --git a/modules/python/generator/visp_python_bindgen/methods.py b/modules/python/generator/visp_python_bindgen/methods.py index 68937c4d56..0599c049b3 100644 --- a/modules/python/generator/visp_python_bindgen/methods.py +++ b/modules/python/generator/visp_python_bindgen/methods.py @@ -256,12 +256,16 @@ def define_method(method: types.Method, method_config: Dict, is_class_method, sp else: self_param_with_name = None method_caller = bound_object.cpp_name + '::' if is_class_method else bound_object.cpp_name + output_param_symbols = [] if return_type is None or return_type == 'void': maybe_get_return = '' - maybe_return_in_tuple = '' + output_param_symbols.append('') else: maybe_get_return = f'{return_type} res = ' - maybe_return_in_tuple = 'res, ' + if '&' in return_type: + output_param_symbols.append('&res') + else: + output_param_symbols.append('res') if len(output_param_names) == 0 and (return_type is None or return_type == 'void'): return_str = '' @@ -270,7 +274,11 @@ def define_method(method: types.Method, method_config: Dict, is_class_method, sp elif len(output_param_names) == 1 and (return_type is None or return_type == 'void'): return_str = output_param_names[0] else: - return_str = f'std::make_tuple({maybe_return_in_tuple}{", ".join(output_param_names)})' + # When returning a tuple we need to explicitely convert references to pointer. + # This is required since std::tuple will upcast the ref to its base class and try to store a copy of the object + # If a class is pure virtual, this is not possible and will a compilation error! + output_param_symbols.extend(['&' + name for name in output_param_names if '&' in name]) + return_str = f'std::make_tuple({", ".join(output_param_symbols)})' lambda_body = f''' {param_declarations} From f698fe8cb489ce39b3e4ebec86260c728403020c Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Wed, 22 Nov 2023 17:20:44 +0100 Subject: [PATCH 112/169] Fix bug introduced in previous commit --- modules/python/config/core.json | 6 +----- modules/python/config/klt.json | 3 ++- modules/python/config/visual_features.json | 7 ------- modules/python/generator/visp_python_bindgen/methods.py | 5 +++-- 4 files changed, 6 insertions(+), 15 deletions(-) diff --git a/modules/python/config/core.json b/modules/python/config/core.json index de5cb7f84f..86fb50196d 100644 --- a/modules/python/config/core.json +++ b/modules/python/config/core.json @@ -289,11 +289,7 @@ }, "vpMomentDatabase": { "methods": [ - { - "static": false, - "signature": "const vpMoment& get(const char*, bool&)", - "ignore": true - } + ] }, "vpPixelMeterConversion": { diff --git a/modules/python/config/klt.json b/modules/python/config/klt.json index f6f8c5403f..efe99d00ae 100644 --- a/modules/python/config/klt.json +++ b/modules/python/config/klt.json @@ -13,4 +13,5 @@ ] } }, - "enums": {}} \ No newline at end of file + "enums": {} +} diff --git a/modules/python/config/visual_features.json b/modules/python/config/visual_features.json index 4e8352ef6a..f221a84895 100644 --- a/modules/python/config/visual_features.json +++ b/modules/python/config/visual_features.json @@ -21,13 +21,6 @@ ] }, "vpFeatureMomentDatabase": { - "methods": [ - { - "static": false, - "signature": "vpFeatureMoment& get(const char*, bool&)", - "ignore": true - } - ] } } diff --git a/modules/python/generator/visp_python_bindgen/methods.py b/modules/python/generator/visp_python_bindgen/methods.py index 0599c049b3..99e3c7d614 100644 --- a/modules/python/generator/visp_python_bindgen/methods.py +++ b/modules/python/generator/visp_python_bindgen/methods.py @@ -202,6 +202,7 @@ def define_method(method: types.Method, method_config: Dict, is_class_method, sp py_method_name = method_config.get('custom_name') or method_name return_type = get_type(method.return_type, specs, header_env.mapping) + # Detect input and output parameters for a method use_default_param_policy = method_config['use_default_param_policy'] param_is_input, param_is_output = method_config['param_is_input'], method_config['param_is_output'] @@ -218,6 +219,7 @@ def define_method(method: types.Method, method_config: Dict, is_class_method, sp param_names = [param.name or 'arg' + str(i) for i, param in enumerate(method.parameters)] input_param_names = [param_names[i] for i in range(len(param_is_input)) if param_is_input[i]] output_param_names = [param_names[i] for i in range(len(param_is_output)) if param_is_output[i]] + output_param_is_ref = [isinstance(method.parameters[i], types.Reference) for i in range(len(params_strs)) if param_is_output[i]] # Fetch documentation if available if header.documentation_holder is not None: @@ -259,7 +261,6 @@ def define_method(method: types.Method, method_config: Dict, is_class_method, sp output_param_symbols = [] if return_type is None or return_type == 'void': maybe_get_return = '' - output_param_symbols.append('') else: maybe_get_return = f'{return_type} res = ' if '&' in return_type: @@ -277,7 +278,7 @@ def define_method(method: types.Method, method_config: Dict, is_class_method, sp # When returning a tuple we need to explicitely convert references to pointer. # This is required since std::tuple will upcast the ref to its base class and try to store a copy of the object # If a class is pure virtual, this is not possible and will a compilation error! - output_param_symbols.extend(['&' + name for name in output_param_names if '&' in name]) + output_param_symbols.extend(['&' + name if is_ref else name for is_ref, name in zip(output_param_is_ref, output_param_names)]) return_str = f'std::make_tuple({", ".join(output_param_symbols)})' lambda_body = f''' From c58147b260f082c0fbf243412cef2f135982048a Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Thu, 23 Nov 2023 18:09:42 +0100 Subject: [PATCH 113/169] progressing on config files, adding some tests for specific cases (tuple returns etc) --- modules/python/bindings/include/blob.hpp | 34 ++++++++++ modules/python/config/core.json | 74 +++++++++++++++++++++- modules/python/test/test_specific_cases.py | 43 +++++++++++++ 3 files changed, 150 insertions(+), 1 deletion(-) create mode 100644 modules/python/bindings/include/blob.hpp create mode 100644 modules/python/test/test_specific_cases.py diff --git a/modules/python/bindings/include/blob.hpp b/modules/python/bindings/include/blob.hpp new file mode 100644 index 0000000000..091b976510 --- /dev/null +++ b/modules/python/bindings/include/blob.hpp @@ -0,0 +1,34 @@ +#ifndef VISP_PYTHON_BLOB_HPP +#define VISP_PYTHON_BLOB_HPP +#include +#include +#include + +#include +#include + +namespace py = pybind11; + +void bindings_vpDot2(py::class_ &pyDot2) +{ + pyDot2.def_static("defineDots", [](std::vector &dots, + const std::string &dotFile, + vpImage &I, + vpColor col = vpColor::blue, + bool trackDot = true) { + return vpDot2::defineDots(&dots[0], dots.size(), dotFile, I, col, trackDot); + }, R"doc( +Wrapper for the defineDots method, see the C++ ViSP documentation. +)doc", py::arg("dots"), py::arg("dotFile"), py::arg("I"), py::arg("color"), py::arg("trackDot") = true); + pyDot2.def_static("trackAndDisplay", [](std::vector &dots, + vpImage &I, + std::vector &cogs, + std::optional> cogStar) { + vpImagePoint *desireds = cogStar ? &((*cogStar)[0]) : nullptr; + vpDot2::trackAndDisplay(&dots[0], dots.size(), I, cogs, desireds); + }, R"doc( +Wrapper for the trackAndDisplay method, see the C++ ViSP documentation. +)doc", py::arg("dots"), py::arg("I"), py::arg("cogs"), py::arg("desiredCogs")); +} + +#endif diff --git a/modules/python/config/core.json b/modules/python/config/core.json index 86fb50196d..e6dbb6324e 100644 --- a/modules/python/config/core.json +++ b/modules/python/config/core.json @@ -34,6 +34,27 @@ } ] }, + "vpMath" :{ + "methods": [ + { + "static": true, + "signature": "double lineFitting(const std::vector&, double&, double&, double&)", + "use_default_param_policy": false, + "param_is_input": [ + true, + false, + false, + false + ], + "param_is_output": [ + false, + true, + true, + true + ] + } + ] + }, "vpImage": { "additional_bindings": "bindings_vpImage", "use_buffer_protocol": true, @@ -190,7 +211,42 @@ }, "vpHomogeneousMatrix": { "additional_bindings": "bindings_vpHomogeneousMatrix", - "use_buffer_protocol": true + "use_buffer_protocol": true, + "methods": [ + { + "static": false, + "signature": "void convert(std::vector&)", + "use_default_param_policy": false, + "param_is_input": [ + false + ], + "param_is_output": [ + true + ] + }, + { + "static": false, + "signature": "void convert(std::vector&)", + "ignore": true + } + ] + }, + "vpThetaUVector": { + "methods": [ + { + "static": false, + "signature": "void extract(double&, vpColVector&)", + "use_default_param_policy": false, + "param_is_input": [ + false, + false + ], + "param_is_output": [ + true, + true + ] + } + ] }, "vpPolygon": { "methods": @@ -202,6 +258,22 @@ } ] }, + "vpPoint": { + "methods": + [ + { + "static": false, + "ignore": true, + "signature": "void getWorldCoordinates(std::vector&)" + }, + { + "static": false, + "ignore": true, + "signature": "void getWorldCoordinates(double&, double&, double&)" + } + + ] + }, "vpBSpline": { "methods": [ diff --git a/modules/python/test/test_specific_cases.py b/modules/python/test/test_specific_cases.py new file mode 100644 index 0000000000..f5bd991314 --- /dev/null +++ b/modules/python/test/test_specific_cases.py @@ -0,0 +1,43 @@ +from pytest import approx +from visp.core import Math, ImagePoint, ColVector, ThetaUVector, Point +def test_tuple_return_basic_values_only_output(): + ''' + Test that a function that was with signature + double lineFitting(const std::vector<...>& imPts, double& a, double& b, double& c) + is now (with custom configuration) with a signature lineFitting(imPts) -> tuple[double * 4] + + all the reference parameters are used as outputs but not as inputs + + ''' + a = 45.0 + b = 52.0 + points = [ + ImagePoint(a*i+b, i) for i in range(3) + ] + res = Math.lineFitting(points) + print(res) + values = (res[0], -res[1] / res[2], res[3] / res[2]) + expected = (0, a, b) + for i, (val, exp) in enumerate(zip(values, expected)): + print(i) + assert val == approx(exp, 0.0001) + +def test_tuple_return_basic_values_only_output_2(): + theta = 3.14 + vec = [0.0, 0.0, 1.0] + thetau = ThetaUVector(*[v * theta for v in vec]) + theta_out, vec_out = thetau.extract() + assert theta_out == theta + assert vec_out == ColVector(vec) + + +def test_pass_by_ref(): + values = [0, 1, 2] + p = Point(values) + vec_ref = ColVector() + p.getWorldCoordinates(vec_ref) + assert vec_ref == p.getWorldCoordinates() + + +def test_tuple_return_basic_values_mixed(): + pass From 375ea9ff4a8201a1678051e643cc2822ca0b0d0d Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Fri, 24 Nov 2023 14:16:24 +0100 Subject: [PATCH 114/169] fix blob module config --- modules/python/config/blob.json | 72 ++++++++++++++++++- .../generator/visp_python_bindgen/utils.py | 7 ++ 2 files changed, 77 insertions(+), 2 deletions(-) diff --git a/modules/python/config/blob.json b/modules/python/config/blob.json index 69ac5fdf0e..51e9e0a736 100644 --- a/modules/python/config/blob.json +++ b/modules/python/config/blob.json @@ -1,7 +1,7 @@ { "ignored_headers": [], "ignored_classes": [], - "user_defined_headers": [], + "user_defined_headers": ["blob.hpp"], "classes": { "vpDot": { "methods": [ @@ -18,6 +18,7 @@ ] }, "vpDot2": { + "additional_bindings": "bindings_vpDot2", "methods": [ { "static": true, @@ -28,8 +29,75 @@ "static": true, "signature": "void display(const vpImage&, const vpImagePoint&, const std::list&, vpColor, unsigned int)", "custom_name": "displayDot" + }, + { + "static": true, + "signature": "vpMatrix defineDots(vpDot2[], const unsigned int&, const std::string&, vpImage&, vpColor, bool)", + "ignore": true + }, + { + "static": true, + "signature": "void trackAndDisplay(vpDot2[], const unsigned int&, vpImage&, std::vector&, vpImagePoint*)", + "ignore": true + }, + { + "static": false, + "signature": "void getFreemanChain(std::list&)", + "use_default_param_policy": false, + "param_is_input": [ + false + ], + "param_is_output": [ + true + ] + }, + { + "static": false, + "signature": "void searchDotsInArea(const vpImage&, int, int, unsigned int, unsigned int, std::list&)", + "use_default_param_policy": false, + "param_is_input": [ + true, + true, + true, + true, + true, + false + ], + "param_is_output": [ + false, + false, + false, + false, + false, + true + ] + }, + { + "static": false, + "signature": "void searchDotsInArea(const vpImage&, std::list&)", + "use_default_param_policy": false, + "param_is_input": [ + true, + false + ], + "param_is_output": [ + false, + true + ] + }, + { + "static": false, + "signature": "void getEdges(std::list&)", + "use_default_param_policy": false, + "param_is_input": [ + false + ], + "param_is_output": [ + true + ] } ] } }, - "enums": {}} \ No newline at end of file + "enums": {} +} diff --git a/modules/python/generator/visp_python_bindgen/utils.py b/modules/python/generator/visp_python_bindgen/utils.py index 7b41e1ddd1..050cdc7d9e 100644 --- a/modules/python/generator/visp_python_bindgen/utils.py +++ b/modules/python/generator/visp_python_bindgen/utils.py @@ -203,6 +203,13 @@ def get_type(param: Union[types.FunctionType, types.DecoratedType, types.Value], return repr_str + '*' else: return None + elif isinstance(param, types.Array): + repr_str = get_type(param.array_of, owner_specs, header_env_mapping) + if repr_str is not None: + return repr_str + '[]' + else: + return None + else: return None From 147b94b1c14434f0e9be040986b7e5dfe51f14db Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Fri, 24 Nov 2023 17:02:56 +0100 Subject: [PATCH 115/169] Add vpMatrix version of MBT tracking, modify mbt wrapper to use it --- modules/python/bindings/include/mbt.hpp | 16 +- modules/python/config/imgproc.json | 19 ++ modules/python/config/klt.json | 17 ++ modules/python/examples/synthetic_data_mbt.py | 13 +- .../include/visp3/mbt/vpMbDepthDenseTracker.h | 1 + .../visp3/mbt/vpMbDepthNormalTracker.h | 1 + .../include/visp3/mbt/vpMbGenericTracker.h | 16 ++ .../include/visp3/mbt/vpMbtFaceDepthDense.h | 16 +- .../include/visp3/mbt/vpMbtFaceDepthNormal.h | 23 +- .../mbt/src/depth/vpMbDepthDenseTracker.cpp | 81 ++++++- .../mbt/src/depth/vpMbDepthNormalTracker.cpp | 91 ++++++-- .../mbt/src/depth/vpMbtFaceDepthDense.cpp | 85 +++++++ .../mbt/src/depth/vpMbtFaceDepthNormal.cpp | 160 +++++++++++++ .../tracker/mbt/src/vpMbGenericTracker.cpp | 221 ++++++++++++++++++ 14 files changed, 713 insertions(+), 47 deletions(-) diff --git a/modules/python/bindings/include/mbt.hpp b/modules/python/bindings/include/mbt.hpp index 9095237ff8..b3cd321b4a 100644 --- a/modules/python/bindings/include/mbt.hpp +++ b/modules/python/bindings/include/mbt.hpp @@ -13,7 +13,7 @@ void bindings_vpMbGenericTracker(py::class_ &py pyMbGenericTracker.def("track", [](vpMbGenericTracker &self, std::map *> &mapOfImages, std::map> &mapOfPointClouds) { std::map mapOfWidths, mapOfHeights; - std::map> mapOfVectors; + std::map mapOfVectors; double t = vpTime::measureTimeMs(); for (const auto &point_cloud_pair: mapOfPointClouds) { @@ -27,20 +27,12 @@ void bindings_vpMbGenericTracker(py::class_ &py const auto shape = buffer.shape; mapOfHeights[point_cloud_pair.first] = shape[0]; mapOfWidths[point_cloud_pair.first] = shape[1]; - - std::vector pc(shape[0] * shape[1], vpColVector(3)); + vpMatrix pc(shape[0] * shape[1], 3); const double *data = point_cloud_pair.second.unchecked<3>().data(0, 0, 0); - for (ssize_t i = 0; i < shape[0]; ++i) { - for (ssize_t j = 0; j < shape[1]; ++j) { - size_t vec_idx = i * shape[1] + j; - size_t idx = i * shape[1] * 3 + j * 3; - memcpy(pc[vec_idx].data, data + idx, sizeof(double) * 3); - } - } - + memcpy(pc.data, data, shape[0] * shape[1] * 3 * sizeof(double)); mapOfVectors[point_cloud_pair.first] = std::move(pc); } - std::map * > mapOfVectorPtrs; + std::map mapOfVectorPtrs; for (const auto &p: mapOfVectors) { mapOfVectorPtrs[p.first] = &(p.second); } diff --git a/modules/python/config/imgproc.json b/modules/python/config/imgproc.json index 294b0d30ac..307aae2e31 100644 --- a/modules/python/config/imgproc.json +++ b/modules/python/config/imgproc.json @@ -3,5 +3,24 @@ "ignored_classes": [], "user_defined_headers": [], "classes": {}, + "functions": [ + { + "static": false, + "signature": "void findContours(const vpImage&, vp::vpContour&, std::vector>&, const vp::vpContourRetrievalType&)", + "use_default_param_policy": false, + "param_is_input": [ + true, + true, + false, + true + ], + "param_is_output": [ + false, + false, + true, + false + ] + } + ], "enums": {} } diff --git a/modules/python/config/klt.json b/modules/python/config/klt.json index efe99d00ae..ade21dbade 100644 --- a/modules/python/config/klt.json +++ b/modules/python/config/klt.json @@ -9,6 +9,23 @@ "static": false, "signature": "void display(const vpImage&, const vpColor&, unsigned int)", "custom_name": "displaySelf" + }, + { + "static": false, + "signature": "void getFeature(const int&, long&, float&, float&)", + "use_default_param_policy": false, + "param_is_input": [ + true, + false, + false, + false + ], + "param_is_output": [ + false, + true, + true, + true + ] } ] } diff --git a/modules/python/examples/synthetic_data_mbt.py b/modules/python/examples/synthetic_data_mbt.py index 0a82ecdc87..367a070d9b 100644 --- a/modules/python/examples/synthetic_data_mbt.py +++ b/modules/python/examples/synthetic_data_mbt.py @@ -72,6 +72,7 @@ def read_data(exp_config: MBTConfig, cam_depth: CameraParameters | None, I: Imag use_depth = cam_depth is not None iteration = 1 while True: + start_parse_time = time.time() color_filepath = exp_config.color_images_dir / color_format.format(iteration) if not color_filepath.exists(): print(f'Could not find image {color_filepath}, is the sequence finished?') @@ -82,12 +83,14 @@ def read_data(exp_config: MBTConfig, cam_depth: CameraParameters | None, I: Imag I_depth_raw = None point_cloud = None if use_depth: + t = time.time() depth_filepath = exp_config.depth_images_dir / depth_format.format(iteration) if not depth_filepath.exists(): print(f'Could not find image {depth_filepath}') return I_depth_np = cv2.imread(str(depth_filepath), cv2.IMREAD_ANYCOLOR | cv2.IMREAD_ANYDEPTH) I_depth_np = I_depth_np[..., 0] + print(f'\tDepth load took {(time.time() - t) * 1000}ms') I_depth_raw = ImageUInt16(I_depth_np * 32767.5) if I_depth_np.size == 0: print('Could not successfully read the depth image') @@ -102,13 +105,15 @@ def read_data(exp_config: MBTConfig, cam_depth: CameraParameters | None, I: Imag point_cloud[..., 0] = xs * Z point_cloud[..., 1] = ys * Z point_cloud[..., 2] = Z - print(f'Point_cloud took {time.time() - t}') + print(f'\tPoint_cloud took {(time.time() - t) * 1000}ms') cMo_ground_truth = HomogeneousMatrix() ground_truth_file = exp_config.ground_truth_dir / (exp_config.color_camera_name + '_{:04d}.txt'.format(iteration)) cMo_ground_truth.load(str(ground_truth_file)) iteration += 1 + end_parse_time = time.time() + print(f'Data parsing took: {(end_parse_time - start_parse_time) * 1000}ms') yield FrameData(I, I_depth_raw, point_cloud, cMo_ground_truth) @@ -190,7 +195,7 @@ def parse_camera_file(exp_config: MBTConfig, is_color: bool) -> CameraParameters tracker.initFromPose(I, frame_data.cMo_ground_truth) else: tracker.initClick(I, str(mbt_model.init_file)) - + start_time = time.time() for frame_data in data_generator: if frame_data.I_depth is not None: ImageConvert.createDepthHistogram(frame_data.I_depth, I_depth) @@ -208,7 +213,7 @@ def parse_camera_file(exp_config: MBTConfig, is_color: bool) -> CameraParameters } t = time.time() tracker.track(image_dict, {'Camera2': pc}) - print(f'Tracking took {time.time() - t}s') + print(f'Tracking took {(time.time() - t) * 1000}ms') cMo = HomogeneousMatrix() tracker.getPose(cMo) @@ -219,3 +224,5 @@ def parse_camera_file(exp_config: MBTConfig, is_color: bool) -> CameraParameters Display.flush(I_depth) if args.step_by_step: Display.getKeyboardEvent(I, blocking=True) + end_time = time.time() + print(f'total time = {end_time - start_time}') diff --git a/modules/tracker/mbt/include/visp3/mbt/vpMbDepthDenseTracker.h b/modules/tracker/mbt/include/visp3/mbt/vpMbDepthDenseTracker.h index 0dd98709d4..84d1ceb81f 100644 --- a/modules/tracker/mbt/include/visp3/mbt/vpMbDepthDenseTracker.h +++ b/modules/tracker/mbt/include/visp3/mbt/vpMbDepthDenseTracker.h @@ -168,5 +168,6 @@ class VISP_EXPORT vpMbDepthDenseTracker : public virtual vpMbTracker void segmentPointCloud(const pcl::PointCloud::ConstPtr &point_cloud); #endif void segmentPointCloud(const std::vector &point_cloud, unsigned int width, unsigned int height); + void segmentPointCloud(const vpMatrix &point_cloud, unsigned int width, unsigned int height); }; #endif diff --git a/modules/tracker/mbt/include/visp3/mbt/vpMbDepthNormalTracker.h b/modules/tracker/mbt/include/visp3/mbt/vpMbDepthNormalTracker.h index c48d2fd5f4..ed3cca7ab3 100644 --- a/modules/tracker/mbt/include/visp3/mbt/vpMbDepthNormalTracker.h +++ b/modules/tracker/mbt/include/visp3/mbt/vpMbDepthNormalTracker.h @@ -183,5 +183,6 @@ class VISP_EXPORT vpMbDepthNormalTracker : public virtual vpMbTracker void segmentPointCloud(const pcl::PointCloud::ConstPtr &point_cloud); #endif void segmentPointCloud(const std::vector &point_cloud, unsigned int width, unsigned int height); + void segmentPointCloud(const vpMatrix &point_cloud, unsigned int width, unsigned int height); }; #endif diff --git a/modules/tracker/mbt/include/visp3/mbt/vpMbGenericTracker.h b/modules/tracker/mbt/include/visp3/mbt/vpMbGenericTracker.h index 393ae1691e..b4086d14ee 100644 --- a/modules/tracker/mbt/include/visp3/mbt/vpMbGenericTracker.h +++ b/modules/tracker/mbt/include/visp3/mbt/vpMbGenericTracker.h @@ -606,6 +606,15 @@ class VISP_EXPORT vpMbGenericTracker : public vpMbTracker std::map &mapOfPointCloudWidths, std::map &mapOfPointCloudHeights); + virtual void track(std::map *> &mapOfImages, + std::map &mapOfPointClouds, + std::map &mapOfPointCloudWidths, + std::map &mapOfPointCloudHeights); + virtual void track(std::map *> &mapOfColorImages, + std::map &mapOfPointClouds, + std::map &mapOfPointCloudWidths, + std::map &mapOfPointCloudHeights); + protected: virtual void computeProjectionError(); @@ -642,6 +651,10 @@ class VISP_EXPORT vpMbGenericTracker : public vpMbTracker std::map *> &mapOfPointClouds, std::map &mapOfPointCloudWidths, std::map &mapOfPointCloudHeights); + virtual void preTracking(std::map *> &mapOfImages, + std::map &mapOfPointClouds, + std::map &mapOfPointCloudWidths, + std::map &mapOfPointCloudHeights); private: class TrackerWrapper : public vpMbEdgeTracker, @@ -770,6 +783,9 @@ class VISP_EXPORT vpMbGenericTracker : public vpMbTracker virtual void preTracking(const vpImage *const ptr_I = nullptr, const std::vector *const point_cloud = nullptr, const unsigned int pointcloud_width = 0, const unsigned int pointcloud_height = 0); + virtual void preTracking(const vpImage *const ptr_I = nullptr, + const vpMatrix *const point_cloud = nullptr, + const unsigned int pointcloud_width = 0, const unsigned int pointcloud_height = 0); virtual void reInitModel(const vpImage *const I, const vpImage *const I_color, const std::string &cad_name, const vpHomogeneousMatrix &cMo, bool verbose = false, diff --git a/modules/tracker/mbt/include/visp3/mbt/vpMbtFaceDepthDense.h b/modules/tracker/mbt/include/visp3/mbt/vpMbtFaceDepthDense.h index 0ae0eea302..beb1f433b6 100644 --- a/modules/tracker/mbt/include/visp3/mbt/vpMbtFaceDepthDense.h +++ b/modules/tracker/mbt/include/visp3/mbt/vpMbtFaceDepthDense.h @@ -53,7 +53,8 @@ class VISP_EXPORT vpMbtFaceDepthDense { public: - enum vpDepthDenseFilteringType { + enum vpDepthDenseFilteringType + { NO_FILTERING = 0, ///< Face is used if visible DEPTH_OCCUPANCY_RATIO_FILTERING = 1 << 1, ///< Face is used if there is ///< enough depth information in @@ -103,6 +104,14 @@ class VISP_EXPORT vpMbtFaceDepthDense #if DEBUG_DISPLAY_DEPTH_DENSE , vpImage &debugImage, std::vector > &roiPts_vec +#endif + , + const vpImage *mask = nullptr); + bool computeDesiredFeatures(const vpHomogeneousMatrix &cMo, unsigned int width, unsigned int height, + const vpMatrix &point_cloud, unsigned int stepX, unsigned int stepY +#if DEBUG_DISPLAY_DEPTH_DENSE + , + vpImage &debugImage, std::vector > &roiPts_vec #endif , const vpImage *mask = nullptr); @@ -146,7 +155,8 @@ class VISP_EXPORT vpMbtFaceDepthDense { if (occupancyRatio < 0.0 || occupancyRatio > 1.0) { std::cerr << "occupancyRatio < 0.0 || occupancyRatio > 1.0" << std::endl; - } else { + } + else { m_depthDenseFilteringOccupancyRatio = occupancyRatio; } } @@ -168,7 +178,7 @@ class VISP_EXPORT vpMbtFaceDepthDense //! The second extremity clipped in the image frame vpImagePoint m_imPt2; - PolygonLine() : m_p1(nullptr), m_p2(nullptr), m_poly(), m_imPt1(), m_imPt2() {} + PolygonLine() : m_p1(nullptr), m_p2(nullptr), m_poly(), m_imPt1(), m_imPt2() { } PolygonLine(const PolygonLine &polyLine) : m_p1(nullptr), m_p2(nullptr), m_poly(polyLine.m_poly), m_imPt1(polyLine.m_imPt1), m_imPt2(polyLine.m_imPt2) diff --git a/modules/tracker/mbt/include/visp3/mbt/vpMbtFaceDepthNormal.h b/modules/tracker/mbt/include/visp3/mbt/vpMbtFaceDepthNormal.h index db5a673d70..7b59a9b625 100644 --- a/modules/tracker/mbt/include/visp3/mbt/vpMbtFaceDepthNormal.h +++ b/modules/tracker/mbt/include/visp3/mbt/vpMbtFaceDepthNormal.h @@ -53,12 +53,14 @@ class VISP_EXPORT vpMbtFaceDepthNormal { public: - enum vpFaceCentroidType { + enum vpFaceCentroidType + { GEOMETRIC_CENTROID, ///< Compute the geometric centroid MEAN_CENTROID ///< Compute the mean centroid }; - enum vpFeatureEstimationType { + enum vpFeatureEstimationType + { ROBUST_FEATURE_ESTIMATION = 0, ROBUST_SVD_PLANE_ESTIMATION = 1, #ifdef VISP_HAVE_PCL @@ -106,6 +108,15 @@ class VISP_EXPORT vpMbtFaceDepthNormal #if DEBUG_DISPLAY_DEPTH_NORMAL , vpImage &debugImage, std::vector > &roiPts_vec +#endif + , + const vpImage *mask = nullptr); + bool computeDesiredFeatures(const vpHomogeneousMatrix &cMo, unsigned int width, unsigned int height, + const vpMatrix &point_cloud, vpColVector &desired_features, + unsigned int stepX, unsigned int stepY +#if DEBUG_DISPLAY_DEPTH_NORMAL + , + vpImage &debugImage, std::vector > &roiPts_vec #endif , const vpImage *mask = nullptr); @@ -179,7 +190,7 @@ class VISP_EXPORT vpMbtFaceDepthNormal //! The second extremity clipped in the image frame vpImagePoint m_imPt2; - PolygonLine() : m_p1(nullptr), m_p2(nullptr), m_poly(), m_imPt1(), m_imPt2() {} + PolygonLine() : m_p1(nullptr), m_p2(nullptr), m_poly(), m_imPt1(), m_imPt2() { } PolygonLine(const PolygonLine &polyLine) : m_p1(nullptr), m_p2(nullptr), m_poly(polyLine.m_poly), m_imPt1(polyLine.m_imPt1), m_imPt2(polyLine.m_imPt2) @@ -211,7 +222,7 @@ class VISP_EXPORT vpMbtFaceDepthNormal public: std::vector data; - Mat33() : data(9) {} + Mat33() : data(9) { } inline T operator[](const size_t i) const { return data[i]; } @@ -221,7 +232,7 @@ class VISP_EXPORT vpMbtFaceDepthNormal { // determinant T det = data[0] * (data[4] * data[8] - data[7] * data[5]) - data[1] * (data[3] * data[8] - data[5] * data[6]) + - data[2] * (data[3] * data[7] - data[4] * data[6]); + data[2] * (data[3] * data[7] - data[4] * data[6]); T invdet = 1 / det; Mat33 minv; @@ -305,7 +316,7 @@ class VISP_EXPORT vpMbtFaceDepthNormal #ifdef VISP_HAVE_NLOHMANN_JSON #include #ifdef VISP_HAVE_PCL -NLOHMANN_JSON_SERIALIZE_ENUM( vpMbtFaceDepthNormal::vpFeatureEstimationType, { +NLOHMANN_JSON_SERIALIZE_ENUM(vpMbtFaceDepthNormal::vpFeatureEstimationType, { {vpMbtFaceDepthNormal::ROBUST_FEATURE_ESTIMATION, "robust"}, {vpMbtFaceDepthNormal::ROBUST_SVD_PLANE_ESTIMATION, "robustSVD"}, {vpMbtFaceDepthNormal::PCL_PLANE_ESTIMATION, "pcl"} diff --git a/modules/tracker/mbt/src/depth/vpMbDepthDenseTracker.cpp b/modules/tracker/mbt/src/depth/vpMbDepthDenseTracker.cpp index ca74cdc202..db38947bd9 100644 --- a/modules/tracker/mbt/src/depth/vpMbDepthDenseTracker.cpp +++ b/modules/tracker/mbt/src/depth/vpMbDepthDenseTracker.cpp @@ -54,11 +54,11 @@ vpMbDepthDenseTracker::vpMbDepthDenseTracker() : m_depthDenseHiddenFacesDisplay(), m_depthDenseListOfActiveFaces(), m_denseDepthNbFeatures(0), m_depthDenseFaces(), - m_depthDenseSamplingStepX(2), m_depthDenseSamplingStepY(2), m_error_depthDense(), m_L_depthDense(), - m_robust_depthDense(), m_w_depthDense(), m_weightedError_depthDense() + m_depthDenseSamplingStepX(2), m_depthDenseSamplingStepY(2), m_error_depthDense(), m_L_depthDense(), + m_robust_depthDense(), m_w_depthDense(), m_weightedError_depthDense() #if DEBUG_DISPLAY_DEPTH_DENSE - , - m_debugDisp_depthDense(nullptr), m_debugImage_depthDense() + , + m_debugDisp_depthDense(nullptr), m_debugImage_depthDense() #endif { #ifdef VISP_HAVE_OGRE @@ -287,7 +287,7 @@ void vpMbDepthDenseTracker::display(const vpImage &I, const vpHom bool displayFullModel) { std::vector > models = - vpMbDepthDenseTracker::getModelForDisplay(I.getWidth(), I.getHeight(), cMo, cam, displayFullModel); + vpMbDepthDenseTracker::getModelForDisplay(I.getWidth(), I.getHeight(), cMo, cam, displayFullModel); for (size_t i = 0; i < models.size(); i++) { if (vpMath::equal(models[i][0], 0)) { @@ -303,7 +303,7 @@ void vpMbDepthDenseTracker::display(const vpImage &I, const vpHomogeneou bool displayFullModel) { std::vector > models = - vpMbDepthDenseTracker::getModelForDisplay(I.getWidth(), I.getHeight(), cMo, cam, displayFullModel); + vpMbDepthDenseTracker::getModelForDisplay(I.getWidth(), I.getHeight(), cMo, cam, displayFullModel); for (size_t i = 0; i < models.size(); i++) { if (vpMath::equal(models[i][0], 0)) { @@ -352,7 +352,7 @@ std::vector > vpMbDepthDenseTracker::getModelForDisplay(unsi ++it) { vpMbtFaceDepthDense *face_dense = *it; std::vector > modelLines = - face_dense->getModelForDisplay(width, height, cMo, cam, displayFullModel); + face_dense->getModelForDisplay(width, height, cMo, cam, displayFullModel); models.insert(models.end(), modelLines.begin(), modelLines.end()); } @@ -368,7 +368,8 @@ void vpMbDepthDenseTracker::init(const vpImage &I) bool reInitialisation = false; if (!useOgre) { faces.setVisible(I.getWidth(), I.getHeight(), m_cam, m_cMo, angleAppears, angleDisappears, reInitialisation); - } else { + } + else { #ifdef VISP_HAVE_OGRE if (!faces.isOgreInitialised()) { faces.setBackgroundSizeOgre(I.getHeight(), I.getWidth()); @@ -408,7 +409,8 @@ void vpMbDepthDenseTracker::loadConfigFile(const std::string &configFile, bool v std::cout << " *********** Parsing XML for Mb Depth Dense Tracker ************ " << std::endl; } xmlp.parse(configFile); - } catch (const vpException &e) { + } + catch (const vpException &e) { std::cerr << "Exception: " << e.what() << std::endl; throw vpException(vpException::ioError, "Cannot open XML file \"%s\"", configFile.c_str()); } @@ -658,6 +660,65 @@ void vpMbDepthDenseTracker::segmentPointCloud(const std::vector &po #endif } + +void vpMbDepthDenseTracker::segmentPointCloud(const vpMatrix &point_cloud, unsigned int width, + unsigned int height) +{ + m_depthDenseListOfActiveFaces.clear(); + +#if DEBUG_DISPLAY_DEPTH_DENSE + if (!m_debugDisp_depthDense->isInitialised()) { + m_debugImage_depthDense.resize(height, width); + m_debugDisp_depthDense->init(m_debugImage_depthDense, 50, 0, "Debug display dense depth tracker"); + } + + m_debugImage_depthDense = 0; + std::vector > roiPts_vec; +#endif + + for (std::vector::iterator it = m_depthDenseFaces.begin(); it != m_depthDenseFaces.end(); + ++it) { + vpMbtFaceDepthDense *face = *it; + + if (face->isVisible() && face->isTracked()) { +#if DEBUG_DISPLAY_DEPTH_DENSE + std::vector > roiPts_vec_; +#endif + if (face->computeDesiredFeatures(m_cMo, width, height, point_cloud, m_depthDenseSamplingStepX, + m_depthDenseSamplingStepY +#if DEBUG_DISPLAY_DEPTH_DENSE + , + m_debugImage_depthDense, roiPts_vec_ +#endif + , + m_mask)) { + m_depthDenseListOfActiveFaces.push_back(*it); + +#if DEBUG_DISPLAY_DEPTH_DENSE + roiPts_vec.insert(roiPts_vec.end(), roiPts_vec_.begin(), roiPts_vec_.end()); +#endif + } + } + } + +#if DEBUG_DISPLAY_DEPTH_DENSE + vpDisplay::display(m_debugImage_depthDense); + + for (size_t i = 0; i < roiPts_vec.size(); i++) { + if (roiPts_vec[i].empty()) + continue; + + for (size_t j = 0; j < roiPts_vec[i].size() - 1; j++) { + vpDisplay::displayLine(m_debugImage_depthDense, roiPts_vec[i][j], roiPts_vec[i][j + 1], vpColor::red, 2); + } + vpDisplay::displayLine(m_debugImage_depthDense, roiPts_vec[i][0], roiPts_vec[i][roiPts_vec[i].size() - 1], + vpColor::red, 2); + } + + vpDisplay::flush(m_debugImage_depthDense); +#endif +} + void vpMbDepthDenseTracker::setOgreVisibilityTest(const bool &v) { vpMbTracker::setOgreVisibilityTest(v); @@ -710,7 +771,7 @@ void vpMbDepthDenseTracker::setUseDepthDenseTracking(const std::string &name, co } } -void vpMbDepthDenseTracker::testTracking() {} +void vpMbDepthDenseTracker::testTracking() { } void vpMbDepthDenseTracker::track(const vpImage &) { diff --git a/modules/tracker/mbt/src/depth/vpMbDepthNormalTracker.cpp b/modules/tracker/mbt/src/depth/vpMbDepthNormalTracker.cpp index 0901245fca..2b349c8c12 100644 --- a/modules/tracker/mbt/src/depth/vpMbDepthNormalTracker.cpp +++ b/modules/tracker/mbt/src/depth/vpMbDepthNormalTracker.cpp @@ -54,14 +54,14 @@ vpMbDepthNormalTracker::vpMbDepthNormalTracker() : m_depthNormalFeatureEstimationMethod(vpMbtFaceDepthNormal::ROBUST_FEATURE_ESTIMATION), - m_depthNormalHiddenFacesDisplay(), m_depthNormalListOfActiveFaces(), m_depthNormalListOfDesiredFeatures(), - m_depthNormalFaces(), m_depthNormalPclPlaneEstimationMethod(2), m_depthNormalPclPlaneEstimationRansacMaxIter(200), - m_depthNormalPclPlaneEstimationRansacThreshold(0.001), m_depthNormalSamplingStepX(2), m_depthNormalSamplingStepY(2), - m_depthNormalUseRobust(false), m_error_depthNormal(), m_featuresToBeDisplayedDepthNormal(), m_L_depthNormal(), - m_robust_depthNormal(), m_w_depthNormal(), m_weightedError_depthNormal() + m_depthNormalHiddenFacesDisplay(), m_depthNormalListOfActiveFaces(), m_depthNormalListOfDesiredFeatures(), + m_depthNormalFaces(), m_depthNormalPclPlaneEstimationMethod(2), m_depthNormalPclPlaneEstimationRansacMaxIter(200), + m_depthNormalPclPlaneEstimationRansacThreshold(0.001), m_depthNormalSamplingStepX(2), m_depthNormalSamplingStepY(2), + m_depthNormalUseRobust(false), m_error_depthNormal(), m_featuresToBeDisplayedDepthNormal(), m_L_depthNormal(), + m_robust_depthNormal(), m_w_depthNormal(), m_weightedError_depthNormal() #if DEBUG_DISPLAY_DEPTH_NORMAL - , - m_debugDisp_depthNormal(nullptr), m_debugImage_depthNormal() + , + m_debugDisp_depthNormal(nullptr), m_debugImage_depthNormal() #endif { #ifdef VISP_HAVE_OGRE @@ -282,7 +282,7 @@ void vpMbDepthNormalTracker::display(const vpImage &I, const vpHo bool displayFullModel) { std::vector > models = - vpMbDepthNormalTracker::getModelForDisplay(I.getWidth(), I.getHeight(), cMo, cam, displayFullModel); + vpMbDepthNormalTracker::getModelForDisplay(I.getWidth(), I.getHeight(), cMo, cam, displayFullModel); for (size_t i = 0; i < models.size(); i++) { if (vpMath::equal(models[i][0], 0)) { @@ -308,7 +308,7 @@ void vpMbDepthNormalTracker::display(const vpImage &I, const vpHomogeneo bool displayFullModel) { std::vector > models = - vpMbDepthNormalTracker::getModelForDisplay(I.getWidth(), I.getHeight(), cMo, cam, displayFullModel); + vpMbDepthNormalTracker::getModelForDisplay(I.getWidth(), I.getHeight(), cMo, cam, displayFullModel); for (size_t i = 0; i < models.size(); i++) { if (vpMath::equal(models[i][0], 0)) { @@ -381,7 +381,7 @@ std::vector > vpMbDepthNormalTracker::getModelForDisplay(uns it != m_depthNormalFaces.end(); ++it) { vpMbtFaceDepthNormal *face_normal = *it; std::vector > modelLines = - face_normal->getModelForDisplay(width, height, cMo, cam, displayFullModel); + face_normal->getModelForDisplay(width, height, cMo, cam, displayFullModel); models.insert(models.end(), modelLines.begin(), modelLines.end()); } @@ -397,7 +397,8 @@ void vpMbDepthNormalTracker::init(const vpImage &I) bool reInitialisation = false; if (!useOgre) { faces.setVisible(I.getWidth(), I.getHeight(), m_cam, m_cMo, angleAppears, angleDisappears, reInitialisation); - } else { + } + else { #ifdef VISP_HAVE_OGRE if (!faces.isOgreInitialised()) { faces.setBackgroundSizeOgre(I.getHeight(), I.getWidth()); @@ -441,7 +442,8 @@ void vpMbDepthNormalTracker::loadConfigFile(const std::string &configFile, bool std::cout << " *********** Parsing XML for Mb Depth Tracker ************ " << std::endl; } xmlp.parse(configFile); - } catch (const vpException &e) { + } + catch (const vpException &e) { std::cerr << "Exception: " << e.what() << std::endl; throw vpException(vpException::ioError, "Cannot open XML file \"%s\"", configFile.c_str()); } @@ -584,7 +586,7 @@ void vpMbDepthNormalTracker::setUseDepthNormalTracking(const std::string &name, } } -void vpMbDepthNormalTracker::testTracking() {} +void vpMbDepthNormalTracker::testTracking() { } #ifdef VISP_HAVE_PCL void vpMbDepthNormalTracker::segmentPointCloud(const pcl::PointCloud::ConstPtr &point_cloud) @@ -712,6 +714,69 @@ void vpMbDepthNormalTracker::segmentPointCloud(const std::vector &p #endif } +void vpMbDepthNormalTracker::segmentPointCloud(const vpMatrix &point_cloud, unsigned int width, + unsigned int height) +{ + m_depthNormalListOfActiveFaces.clear(); + m_depthNormalListOfDesiredFeatures.clear(); + +#if DEBUG_DISPLAY_DEPTH_NORMAL + if (!m_debugDisp_depthNormal->isInitialised()) { + m_debugImage_depthNormal.resize(height, width); + m_debugDisp_depthNormal->init(m_debugImage_depthNormal, 50, 0, "Debug display normal depth tracker"); + } + + m_debugImage_depthNormal = 0; + std::vector > roiPts_vec; +#endif + + for (std::vector::iterator it = m_depthNormalFaces.begin(); it != m_depthNormalFaces.end(); + ++it) { + vpMbtFaceDepthNormal *face = *it; + + if (face->isVisible() && face->isTracked()) { + vpColVector desired_features; + +#if DEBUG_DISPLAY_DEPTH_NORMAL + std::vector > roiPts_vec_; +#endif + + if (face->computeDesiredFeatures(m_cMo, width, height, point_cloud, desired_features, m_depthNormalSamplingStepX, + m_depthNormalSamplingStepY +#if DEBUG_DISPLAY_DEPTH_NORMAL + , + m_debugImage_depthNormal, roiPts_vec_ +#endif + , + m_mask)) { + m_depthNormalListOfDesiredFeatures.push_back(desired_features); + m_depthNormalListOfActiveFaces.push_back(face); + +#if DEBUG_DISPLAY_DEPTH_NORMAL + roiPts_vec.insert(roiPts_vec.end(), roiPts_vec_.begin(), roiPts_vec_.end()); +#endif + } + } + } + +#if DEBUG_DISPLAY_DEPTH_NORMAL + vpDisplay::display(m_debugImage_depthNormal); + + for (size_t i = 0; i < roiPts_vec.size(); i++) { + if (roiPts_vec[i].empty()) + continue; + + for (size_t j = 0; j < roiPts_vec[i].size() - 1; j++) { + vpDisplay::displayLine(m_debugImage_depthNormal, roiPts_vec[i][j], roiPts_vec[i][j + 1], vpColor::red, 2); + } + vpDisplay::displayLine(m_debugImage_depthNormal, roiPts_vec[i][0], roiPts_vec[i][roiPts_vec[i].size() - 1], + vpColor::red, 2); + } + + vpDisplay::flush(m_debugImage_depthNormal); +#endif +} + void vpMbDepthNormalTracker::setCameraParameters(const vpCameraParameters &cam) { m_cam = cam; diff --git a/modules/tracker/mbt/src/depth/vpMbtFaceDepthDense.cpp b/modules/tracker/mbt/src/depth/vpMbtFaceDepthDense.cpp index 0dacb833f1..7d0249cdc2 100644 --- a/modules/tracker/mbt/src/depth/vpMbtFaceDepthDense.cpp +++ b/modules/tracker/mbt/src/depth/vpMbtFaceDepthDense.cpp @@ -421,6 +421,91 @@ bool vpMbtFaceDepthDense::computeDesiredFeatures(const vpHomogeneousMatrix &cMo, return true; } +bool vpMbtFaceDepthDense::computeDesiredFeatures(const vpHomogeneousMatrix &cMo, unsigned int width, + unsigned int height, const vpMatrix &point_cloud, + unsigned int stepX, unsigned int stepY +#if DEBUG_DISPLAY_DEPTH_DENSE + , + vpImage &debugImage, + std::vector > &roiPts_vec +#endif + , + const vpImage *mask) +{ + m_pointCloudFace.clear(); + + if (width == 0 || height == 0) + return 0; + + std::vector roiPts; + double distanceToFace; + computeROI(cMo, width, height, roiPts +#if DEBUG_DISPLAY_DEPTH_DENSE + , + roiPts_vec +#endif + , + distanceToFace); + + if (roiPts.size() <= 2) { +#ifndef NDEBUG + std::cerr << "Error: roiPts.size() <= 2 in computeDesiredFeatures" << std::endl; +#endif + return false; + } + + if (((m_depthDenseFilteringMethod & MAX_DISTANCE_FILTERING) && distanceToFace > m_depthDenseFilteringMaxDist) || + ((m_depthDenseFilteringMethod & MIN_DISTANCE_FILTERING) && distanceToFace < m_depthDenseFilteringMinDist)) { + return false; + } + + vpPolygon polygon_2d(roiPts); + vpRect bb = polygon_2d.getBoundingBox(); + + unsigned int top = (unsigned int)std::max(0.0, bb.getTop()); + unsigned int bottom = (unsigned int)std::min((double)height, std::max(0.0, bb.getBottom())); + unsigned int left = (unsigned int)std::max(0.0, bb.getLeft()); + unsigned int right = (unsigned int)std::min((double)width, std::max(0.0, bb.getRight())); + + bb.setTop(top); + bb.setBottom(bottom); + bb.setLeft(left); + bb.setRight(right); + + m_pointCloudFace.reserve((size_t)(bb.getWidth() * bb.getHeight())); + + int totalTheoreticalPoints = 0, totalPoints = 0; + for (unsigned int i = top; i < bottom; i += stepY) { + for (unsigned int j = left; j < right; j += stepX) { + if ((m_useScanLine ? (i < m_hiddenFace->getMbScanLineRenderer().getPrimitiveIDs().getHeight() && + j < m_hiddenFace->getMbScanLineRenderer().getPrimitiveIDs().getWidth() && + m_hiddenFace->getMbScanLineRenderer().getPrimitiveIDs()[i][j] == m_polygon->getIndex()) + : polygon_2d.isInside(vpImagePoint(i, j)))) { + totalTheoreticalPoints++; + + if (vpMeTracker::inMask(mask, i, j) && point_cloud[i * width + j][2] > 0) { + totalPoints++; + + m_pointCloudFace.push_back(point_cloud[i * width + j][0]); + m_pointCloudFace.push_back(point_cloud[i * width + j][1]); + m_pointCloudFace.push_back(point_cloud[i * width + j][2]); + +#if DEBUG_DISPLAY_DEPTH_DENSE + debugImage[i][j] = 255; +#endif + } + } + } + } + + if (totalPoints == 0 || ((m_depthDenseFilteringMethod & DEPTH_OCCUPANCY_RATIO_FILTERING) && + totalPoints / (double)totalTheoreticalPoints < m_depthDenseFilteringOccupancyRatio)) { + return false; + } + + return true; +} + void vpMbtFaceDepthDense::computeVisibility() { m_isVisible = m_polygon->isVisible(); } void vpMbtFaceDepthDense::computeVisibilityDisplay() diff --git a/modules/tracker/mbt/src/depth/vpMbtFaceDepthNormal.cpp b/modules/tracker/mbt/src/depth/vpMbtFaceDepthNormal.cpp index faee1d75d3..b741766410 100644 --- a/modules/tracker/mbt/src/depth/vpMbtFaceDepthNormal.cpp +++ b/modules/tracker/mbt/src/depth/vpMbtFaceDepthNormal.cpp @@ -475,6 +475,166 @@ bool vpMbtFaceDepthNormal::computeDesiredFeatures(const vpHomogeneousMatrix &cMo return true; } +bool vpMbtFaceDepthNormal::computeDesiredFeatures(const vpHomogeneousMatrix &cMo, unsigned int width, + unsigned int height, const vpMatrix &point_cloud, + vpColVector &desired_features, unsigned int stepX, unsigned int stepY +#if DEBUG_DISPLAY_DEPTH_NORMAL + , + vpImage &debugImage, + std::vector > &roiPts_vec +#endif + , + const vpImage *mask) +{ + m_faceActivated = false; + + if (width == 0 || height == 0) + return false; + + std::vector roiPts; + vpColVector desired_normal(3); + + computeROI(cMo, width, height, roiPts +#if DEBUG_DISPLAY_DEPTH_NORMAL + , + roiPts_vec +#endif + ); + + if (roiPts.size() <= 2) { +#ifndef NDEBUG + std::cerr << "Error: roiPts.size() <= 2 in computeDesiredFeatures" << std::endl; +#endif + return false; + } + + vpPolygon polygon_2d(roiPts); + vpRect bb = polygon_2d.getBoundingBox(); + + unsigned int top = (unsigned int)std::max(0.0, bb.getTop()); + unsigned int bottom = (unsigned int)std::min((double)height, std::max(0.0, bb.getBottom())); + unsigned int left = (unsigned int)std::max(0.0, bb.getLeft()); + unsigned int right = (unsigned int)std::min((double)width, std::max(0.0, bb.getRight())); + + bb.setTop(top); + bb.setBottom(bottom); + bb.setLeft(left); + bb.setRight(right); + + // Keep only 3D points inside the projected polygon face + std::vector point_cloud_face, point_cloud_face_custom; + + point_cloud_face.reserve((size_t)(3 * bb.getWidth() * bb.getHeight())); + if (m_featureEstimationMethod == ROBUST_FEATURE_ESTIMATION) { + point_cloud_face_custom.reserve((size_t)(3 * bb.getWidth() * bb.getHeight())); + } + + bool checkSSE2 = vpCPUFeatures::checkSSE2(); +#if !USE_SSE + checkSSE2 = false; +#else + bool push = false; + double prev_x, prev_y, prev_z; +#endif + + double x = 0.0, y = 0.0; + for (unsigned int i = top; i < bottom; i += stepY) { + for (unsigned int j = left; j < right; j += stepX) { + if (vpMeTracker::inMask(mask, i, j) && point_cloud[i * width + j][2] > 0 && + (m_useScanLine ? (i < m_hiddenFace->getMbScanLineRenderer().getPrimitiveIDs().getHeight() && + j < m_hiddenFace->getMbScanLineRenderer().getPrimitiveIDs().getWidth() && + m_hiddenFace->getMbScanLineRenderer().getPrimitiveIDs()[i][j] == m_polygon->getIndex()) + : polygon_2d.isInside(vpImagePoint(i, j)))) { +// Add point + point_cloud_face.push_back(point_cloud[i * width + j][0]); + point_cloud_face.push_back(point_cloud[i * width + j][1]); + point_cloud_face.push_back(point_cloud[i * width + j][2]); + + if (m_featureEstimationMethod == ROBUST_FEATURE_ESTIMATION) { + // Add point for custom method for plane equation estimation + vpPixelMeterConversion::convertPoint(m_cam, j, i, x, y); + + if (checkSSE2) { +#if USE_SSE + if (!push) { + push = true; + prev_x = x; + prev_y = y; + prev_z = point_cloud[i * width + j][2]; + } + else { + push = false; + point_cloud_face_custom.push_back(prev_x); + point_cloud_face_custom.push_back(x); + + point_cloud_face_custom.push_back(prev_y); + point_cloud_face_custom.push_back(y); + + point_cloud_face_custom.push_back(prev_z); + point_cloud_face_custom.push_back(point_cloud[i * width + j][2]); + } +#endif + } + else { + point_cloud_face_custom.push_back(x); + point_cloud_face_custom.push_back(y); + point_cloud_face_custom.push_back(point_cloud[i * width + j][2]); + } + } + +#if DEBUG_DISPLAY_DEPTH_NORMAL + debugImage[i][j] = 255; +#endif + } + } + } + +#if USE_SSE + if (checkSSE2 && push) { + point_cloud_face_custom.push_back(prev_x); + point_cloud_face_custom.push_back(prev_y); + point_cloud_face_custom.push_back(prev_z); + } +#endif + + if (point_cloud_face.empty() && point_cloud_face_custom.empty()) { + return false; + } + + // Face centroid computed by the different methods + vpColVector centroid_point(3); + +#ifdef VISP_HAVE_PCL + if (m_featureEstimationMethod == PCL_PLANE_ESTIMATION) { + pcl::PointCloud::Ptr point_cloud_face_pcl(new pcl::PointCloud); + point_cloud_face_pcl->reserve(point_cloud_face.size() / 3); + + for (size_t i = 0; i < point_cloud_face.size() / 3; i++) { + point_cloud_face_pcl->push_back( + pcl::PointXYZ(point_cloud_face[3 * i], point_cloud_face[3 * i + 1], point_cloud_face[3 * i + 2])); + } + + computeDesiredFeaturesPCL(point_cloud_face_pcl, desired_features, desired_normal, centroid_point); + } + else +#endif + if (m_featureEstimationMethod == ROBUST_SVD_PLANE_ESTIMATION) { + computeDesiredFeaturesSVD(point_cloud_face, cMo, desired_features, desired_normal, centroid_point); + } + else if (m_featureEstimationMethod == ROBUST_FEATURE_ESTIMATION) { + computeDesiredFeaturesRobustFeatures(point_cloud_face_custom, point_cloud_face, cMo, desired_features, + desired_normal, centroid_point); + } + else { + throw vpException(vpException::badValue, "Unknown feature estimation method!"); + } + + computeDesiredNormalAndCentroid(cMo, desired_normal, centroid_point); + + m_faceActivated = true; + + return true; +} #ifdef VISP_HAVE_PCL bool vpMbtFaceDepthNormal::computeDesiredFeaturesPCL(const pcl::PointCloud::ConstPtr &point_cloud_face, vpColVector &desired_features, vpColVector &desired_normal, diff --git a/modules/tracker/mbt/src/vpMbGenericTracker.cpp b/modules/tracker/mbt/src/vpMbGenericTracker.cpp index 830ff1577b..c4004b7c04 100644 --- a/modules/tracker/mbt/src/vpMbGenericTracker.cpp +++ b/modules/tracker/mbt/src/vpMbGenericTracker.cpp @@ -3276,6 +3276,19 @@ void vpMbGenericTracker::preTracking(std::map *> &mapOfImages, + std::map &mapOfPointClouds, + std::map &mapOfPointCloudWidths, + std::map &mapOfPointCloudHeights) +{ + for (std::map::const_iterator it = m_mapOfTrackers.begin(); + it != m_mapOfTrackers.end(); ++it) { + TrackerWrapper *tracker = it->second; + tracker->preTracking(mapOfImages[it->first], mapOfPointClouds[it->first], mapOfPointCloudWidths[it->first], + mapOfPointCloudHeights[it->first]); + } +} + /*! Re-initialize the model used by the tracker. @@ -5754,6 +5767,166 @@ void vpMbGenericTracker::track(std::map *> &m computeProjectionError(); } +void vpMbGenericTracker::track(std::map *> &mapOfImages, + std::map &mapOfPointClouds, + std::map &mapOfPointCloudWidths, + std::map &mapOfPointCloudHeights) +{ + for (std::map::const_iterator it = m_mapOfTrackers.begin(); + it != m_mapOfTrackers.end(); ++it) { + TrackerWrapper *tracker = it->second; + + if ((tracker->m_trackerType & (EDGE_TRACKER | +#if defined(VISP_HAVE_MODULE_KLT) && defined(VISP_HAVE_OPENCV) && defined(HAVE_OPENCV_IMGPROC) && defined(HAVE_OPENCV_VIDEO) + KLT_TRACKER | +#endif + DEPTH_NORMAL_TRACKER | DEPTH_DENSE_TRACKER)) == 0) { + throw vpException(vpException::fatalError, "Bad tracker type: %d", tracker->m_trackerType); + } + + if (tracker->m_trackerType & (EDGE_TRACKER +#if defined(VISP_HAVE_MODULE_KLT) && defined(VISP_HAVE_OPENCV) && defined(HAVE_OPENCV_IMGPROC) && defined(HAVE_OPENCV_VIDEO) + | KLT_TRACKER +#endif + ) && + mapOfImages[it->first] == nullptr) { + throw vpException(vpException::fatalError, "Image pointer is nullptr!"); + } + + if (tracker->m_trackerType & (DEPTH_NORMAL_TRACKER | DEPTH_DENSE_TRACKER) && + (mapOfPointClouds[it->first] == nullptr)) { + throw vpException(vpException::fatalError, "Pointcloud is nullptr!"); + } + } + + preTracking(mapOfImages, mapOfPointClouds, mapOfPointCloudWidths, mapOfPointCloudHeights); + + try { + computeVVS(mapOfImages); + } + catch (...) { + covarianceMatrix = -1; + throw; // throw the original exception + } + + testTracking(); + + for (std::map::const_iterator it = m_mapOfTrackers.begin(); + it != m_mapOfTrackers.end(); ++it) { + TrackerWrapper *tracker = it->second; + + if (tracker->m_trackerType & EDGE_TRACKER && displayFeatures) { + tracker->m_featuresToBeDisplayedEdge = tracker->getFeaturesForDisplayEdge(); + } + + tracker->postTracking(mapOfImages[it->first], mapOfPointCloudWidths[it->first], mapOfPointCloudHeights[it->first]); + + if (displayFeatures) { +#if defined(VISP_HAVE_MODULE_KLT) && defined(VISP_HAVE_OPENCV) && defined(HAVE_OPENCV_IMGPROC) && defined(HAVE_OPENCV_VIDEO) + if (tracker->m_trackerType & KLT_TRACKER) { + tracker->m_featuresToBeDisplayedKlt = tracker->getFeaturesForDisplayKlt(); + } +#endif + + if (tracker->m_trackerType & DEPTH_NORMAL_TRACKER) { + tracker->m_featuresToBeDisplayedDepthNormal = tracker->getFeaturesForDisplayDepthNormal(); + } + } + } + + computeProjectionError(); +} + +/*! + Realize the tracking of the object in the image. + + \throw vpException : if the tracking is supposed to have failed + + \param mapOfColorImages : Map of images. + \param mapOfPointClouds : Map of pointclouds. + \param mapOfPointCloudWidths : Map of pointcloud widths. + \param mapOfPointCloudHeights : Map of pointcloud heights. +*/ +void vpMbGenericTracker::track(std::map *> &mapOfColorImages, + std::map &mapOfPointClouds, + std::map &mapOfPointCloudWidths, + std::map &mapOfPointCloudHeights) +{ + std::map *> mapOfImages; + for (std::map::const_iterator it = m_mapOfTrackers.begin(); + it != m_mapOfTrackers.end(); ++it) { + TrackerWrapper *tracker = it->second; + + if ((tracker->m_trackerType & (EDGE_TRACKER | +#if defined(VISP_HAVE_MODULE_KLT) && defined(VISP_HAVE_OPENCV) && defined(HAVE_OPENCV_IMGPROC) && defined(HAVE_OPENCV_VIDEO) + KLT_TRACKER | +#endif + DEPTH_NORMAL_TRACKER | DEPTH_DENSE_TRACKER)) == 0) { + throw vpException(vpException::fatalError, "Bad tracker type: %d", tracker->m_trackerType); + } + + if (tracker->m_trackerType & (EDGE_TRACKER +#if defined(VISP_HAVE_MODULE_KLT) && defined(VISP_HAVE_OPENCV) && defined(HAVE_OPENCV_IMGPROC) && defined(HAVE_OPENCV_VIDEO) + | KLT_TRACKER +#endif + ) && + mapOfColorImages[it->first] == nullptr) { + throw vpException(vpException::fatalError, "Image pointer is nullptr!"); + } + else if (tracker->m_trackerType & (EDGE_TRACKER +#if defined(VISP_HAVE_MODULE_KLT) && defined(VISP_HAVE_OPENCV) && defined(HAVE_OPENCV_IMGPROC) && defined(HAVE_OPENCV_VIDEO) + | KLT_TRACKER +#endif + ) && + mapOfColorImages[it->first] != nullptr) { + vpImageConvert::convert(*mapOfColorImages[it->first], tracker->m_I); + mapOfImages[it->first] = &tracker->m_I; // update grayscale image buffer + } + + if (tracker->m_trackerType & (DEPTH_NORMAL_TRACKER | DEPTH_DENSE_TRACKER) && + (mapOfPointClouds[it->first] == nullptr)) { + throw vpException(vpException::fatalError, "Pointcloud is nullptr!"); + } + } + + preTracking(mapOfImages, mapOfPointClouds, mapOfPointCloudWidths, mapOfPointCloudHeights); + + try { + computeVVS(mapOfImages); + } + catch (...) { + covarianceMatrix = -1; + throw; // throw the original exception + } + + testTracking(); + + for (std::map::const_iterator it = m_mapOfTrackers.begin(); + it != m_mapOfTrackers.end(); ++it) { + TrackerWrapper *tracker = it->second; + + if (tracker->m_trackerType & EDGE_TRACKER && displayFeatures) { + tracker->m_featuresToBeDisplayedEdge = tracker->getFeaturesForDisplayEdge(); + } + + tracker->postTracking(mapOfImages[it->first], mapOfPointCloudWidths[it->first], mapOfPointCloudHeights[it->first]); + + if (displayFeatures) { +#if defined(VISP_HAVE_MODULE_KLT) && defined(VISP_HAVE_OPENCV) && defined(HAVE_OPENCV_IMGPROC) && defined(HAVE_OPENCV_VIDEO) + if (tracker->m_trackerType & KLT_TRACKER) { + tracker->m_featuresToBeDisplayedKlt = tracker->getFeaturesForDisplayKlt(); + } +#endif + + if (tracker->m_trackerType & DEPTH_NORMAL_TRACKER) { + tracker->m_featuresToBeDisplayedDepthNormal = tracker->getFeaturesForDisplayDepthNormal(); + } + } + } + + computeProjectionError(); +} + /** TrackerWrapper **/ vpMbGenericTracker::TrackerWrapper::TrackerWrapper() : m_error(), m_L(), m_trackerType(EDGE_TRACKER), m_w(), m_weightedError() @@ -6831,6 +7004,54 @@ void vpMbGenericTracker::TrackerWrapper::preTracking(const vpImage *const ptr_I, + const vpMatrix *const point_cloud, + const unsigned int pointcloud_width, + const unsigned int pointcloud_height) +{ + if (m_trackerType & EDGE_TRACKER) { + try { + vpMbEdgeTracker::trackMovingEdge(*ptr_I); + } + catch (...) { + std::cerr << "Error in moving edge tracking" << std::endl; + throw; + } + } + +#if defined(VISP_HAVE_MODULE_KLT) && defined(VISP_HAVE_OPENCV) && defined(HAVE_OPENCV_IMGPROC) && defined(HAVE_OPENCV_VIDEO) + if (m_trackerType & KLT_TRACKER) { + try { + vpMbKltTracker::preTracking(*ptr_I); + } + catch (const vpException &e) { + std::cerr << "Error in KLT tracking: " << e.what() << std::endl; + throw; + } + } +#endif + + if (m_trackerType & DEPTH_NORMAL_TRACKER) { + try { + vpMbDepthNormalTracker::segmentPointCloud(*point_cloud, pointcloud_width, pointcloud_height); + } + catch (...) { + std::cerr << "Error in Depth tracking" << std::endl; + throw; + } + } + + if (m_trackerType & DEPTH_DENSE_TRACKER) { + try { + vpMbDepthDenseTracker::segmentPointCloud(*point_cloud, pointcloud_width, pointcloud_height); + } + catch (...) { + std::cerr << "Error in Depth dense tracking" << std::endl; + throw; + } + } +} + void vpMbGenericTracker::TrackerWrapper::reInitModel(const vpImage *const I, const vpImage *const I_color, const std::string &cad_name, const vpHomogeneousMatrix &cMo, bool verbose, From ad692447af6e0747efc03c7009442cebc2b93d38 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Fri, 24 Nov 2023 17:17:07 +0100 Subject: [PATCH 116/169] Remove timing print in MBT data conversion --- modules/python/bindings/include/mbt.hpp | 3 --- modules/python/examples/synthetic_data_mbt.py | 7 +++---- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/modules/python/bindings/include/mbt.hpp b/modules/python/bindings/include/mbt.hpp index b3cd321b4a..311d56252c 100644 --- a/modules/python/bindings/include/mbt.hpp +++ b/modules/python/bindings/include/mbt.hpp @@ -14,7 +14,6 @@ void bindings_vpMbGenericTracker(py::class_ &py std::map> &mapOfPointClouds) { std::map mapOfWidths, mapOfHeights; std::map mapOfVectors; - double t = vpTime::measureTimeMs(); for (const auto &point_cloud_pair: mapOfPointClouds) { py::buffer_info buffer = point_cloud_pair.second.request(); @@ -36,8 +35,6 @@ void bindings_vpMbGenericTracker(py::class_ &py for (const auto &p: mapOfVectors) { mapOfVectorPtrs[p.first] = &(p.second); } - double tt = vpTime::measureTimeMs(); - std::cout << (tt - t) << std::endl; self.track(mapOfImages, mapOfVectorPtrs, mapOfWidths, mapOfHeights); diff --git a/modules/python/examples/synthetic_data_mbt.py b/modules/python/examples/synthetic_data_mbt.py index 367a070d9b..d140b79d89 100644 --- a/modules/python/examples/synthetic_data_mbt.py +++ b/modules/python/examples/synthetic_data_mbt.py @@ -96,15 +96,14 @@ def read_data(exp_config: MBTConfig, cam_depth: CameraParameters | None, I: Imag print('Could not successfully read the depth image') return t = time.time() - point_cloud = np.empty((*I_depth_np.shape, 3), dtype=np.float64) + # point_cloud = np.empty((*I_depth_np.shape, 3), dtype=np.float64) Z = I_depth_np.copy() Z[Z > 2] = 0.0 # Clamping values that are too high vs, us = np.meshgrid(range(I_depth_np.shape[0]), range(I_depth_np.shape[1]), indexing='ij') xs, ys = PixelMeterConversion.convertPoints(cam_depth, us, vs) - point_cloud[..., 0] = xs * Z - point_cloud[..., 1] = ys * Z - point_cloud[..., 2] = Z + point_cloud = np.stack((xs * Z, ys * Z, Z), axis=-1) + print(f'\tPoint_cloud took {(time.time() - t) * 1000}ms') From 4f613e951e03af04a70a9eb72067bd8957d6281b Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Fri, 24 Nov 2023 17:28:46 +0100 Subject: [PATCH 117/169] Started work on MBT with realsense example --- modules/python/examples/realsense_mbt.py | 228 ++++++++++++++++++ modules/python/examples/synthetic_data_mbt.py | 2 +- 2 files changed, 229 insertions(+), 1 deletion(-) create mode 100644 modules/python/examples/realsense_mbt.py diff --git a/modules/python/examples/realsense_mbt.py b/modules/python/examples/realsense_mbt.py new file mode 100644 index 0000000000..53b6013aa3 --- /dev/null +++ b/modules/python/examples/realsense_mbt.py @@ -0,0 +1,228 @@ +import argparse +from dataclasses import dataclass +from pathlib import Path +from typing import List, Optional +import numpy as np +import time +import faulthandler +faulthandler.enable() + + +from visp.core import XmlParserCamera, CameraParameters, ColVector, HomogeneousMatrix, Display, ImageConvert +from visp.core import ImageGray, ImageUInt16 +from visp.io import ImageIo +from visp.mbt import MbGenericTracker, MbTracker +from visp.gui import DisplayOpenCV +from visp.core import Color +from visp.core import PixelMeterConversion + +import pyrealsense2 as rs + + +try: + import cv2 +except: + print('Could not import opencv python! make sure that it is installed as it is required') + import sys + sys.exit(1) + +import matplotlib.pyplot as plt + + +class MBTModelData: + def __init__(self, data_root: Path): + model_path = data_root / 'model' / 'teabox' + assert model_path.exists() + self.config_color = model_path / 'teabox_color.xml' + self.config_depth = model_path / 'teabox_depth.xml' + self.cad_file = model_path / 'teabox.cao' + self.init_file = model_path / 'teabox.init' + + +class MBTConfig: + def __init__(self, data_root: Path): + data_path = data_root / 'data' / 'teabox' + assert data_path.exists() + self.color_camera_name = 'Camera_L' + self.depth_camera_name = 'Camera_R' + + self.color_intrinsics_file = data_path / f'{self.color_camera_name}.xml' + self.depth_intrinsics_file = data_path / f'{self.depth_camera_name}.xml' + + self.color_images_dir = data_path / 'color' + self.depth_images_dir = data_path / 'depth' + self.ground_truth_dir = data_path / 'ground-truth' + + + self.depth_intrinsics_file = data_path / f'{self.depth_camera_name}.xml' + + self.extrinsic_file = str(data_path / 'depth_M_color.txt') + # self.ground_truth = str(data_root / 'data' / 'depth_M_color.txt') + +@dataclass +class FrameData: + I: ImageGray + I_depth: Optional[ImageUInt16] + point_cloud: Optional[np.ndarray] + cMo_ground_truth: HomogeneousMatrix + + + + +def read_data(exp_config: MBTConfig, cam_depth: CameraParameters | None, I: ImageGray): + pipe = rs.pipeline() + profile = pipe.start() + + use_depth = cam_depth is not None + iteration = 1 + while True: + frames = pipe.wait_for_frames() + print(frames) + I_depth_raw = np.asanyarray(frames.get_depth_frame().as_frame().get_data()) + + print(I_depth_raw.shape) + I = np.asanyarray(frames.get_color_frame().as_frame().get_data()) + print(I.shape) + point_cloud = None + if use_depth: + t = time.time() + depth_filepath = exp_config.depth_images_dir / depth_format.format(iteration) + if not depth_filepath.exists(): + print(f'Could not find image {depth_filepath}') + return + I_depth_np = cv2.imread(str(depth_filepath), cv2.IMREAD_ANYCOLOR | cv2.IMREAD_ANYDEPTH) + I_depth_np = I_depth_np[..., 0] + print(f'\tDepth load took {(time.time() - t) * 1000}ms') + I_depth_raw = ImageUInt16(I_depth_np * 32767.5) + if I_depth_np.size == 0: + print('Could not successfully read the depth image') + return + t = time.time() + # point_cloud = np.empty((*I_depth_np.shape, 3), dtype=np.float64) + Z = I_depth_np.copy() + Z[Z > 2] = 0.0 # Clamping values that are too high + + vs, us = np.meshgrid(range(I_depth_np.shape[0]), range(I_depth_np.shape[1]), indexing='ij') + xs, ys = PixelMeterConversion.convertPoints(cam_depth, us, vs) + point_cloud = np.stack((xs * Z, ys * Z, Z), axis=-1) + + print(f'\tPoint_cloud took {(time.time() - t) * 1000}ms') + + cMo_ground_truth = HomogeneousMatrix() + ground_truth_file = exp_config.ground_truth_dir / (exp_config.color_camera_name + '_{:04d}.txt'.format(iteration)) + cMo_ground_truth.load(str(ground_truth_file)) + iteration += 1 + end_parse_time = time.time() + print(f'Data parsing took: {(end_parse_time - start_parse_time) * 1000}ms') + yield FrameData(I, I_depth_raw, point_cloud, cMo_ground_truth) + + + +def parse_camera_file(exp_config: MBTConfig, is_color: bool) -> CameraParameters: + cam = CameraParameters() + xml_parser = XmlParserCamera() + if is_color: + camera_name, file_path = exp_config.color_camera_name, exp_config.color_intrinsics_file + else: + camera_name, file_path = exp_config.depth_camera_name, exp_config.depth_intrinsics_file + parse_res = xml_parser.parse(cam, str(file_path), camera_name, + CameraParameters.perspectiveProjWithoutDistortion, 0, 0, True) + assert parse_res == XmlParserCamera.SEQUENCE_OK # Check result + return cam + +if __name__ == '__main__': + parser = argparse.ArgumentParser() + parser.add_argument('--data-root', type=str, required=True, + help='Path to the folder containing all the data for the synthetic MBT example') + parser.add_argument('--display-ground-truth', action='store_true') + parser.add_argument('--disable-klt', action='store_true') + parser.add_argument('--disable-depth', action='store_true') + parser.add_argument('--step-by-step', action='store_true') + parser.add_argument('--init-ground-truth', action='store_true') + + + args = parser.parse_args() + data_root = Path(args.data_root) + + mbt_model = MBTModelData(data_root) + exp_config = MBTConfig(data_root) + + assert data_root.exists() and data_root.is_dir() + + rgb_tracker: int = MbGenericTracker.EDGE_TRACKER | (MbGenericTracker.KLT_TRACKER if not args.disable_klt else 0) + tracker_types: List[int] = [rgb_tracker] + if not args.disable_depth: + depth_tracker = MbGenericTracker.DEPTH_DENSE_TRACKER + tracker_types.append(depth_tracker) + + tracker = MbGenericTracker(tracker_types) + + if args.disable_depth: + tracker.loadConfigFile(str(mbt_model.config_color)) + else: + tracker.loadConfigFile(str(mbt_model.config_color), str(mbt_model.config_depth)) + tracker.loadModel(str(mbt_model.cad_file)) + + # Camera intrinsics + cam_color = parse_camera_file(exp_config, True) + cam_depth = parse_camera_file(exp_config, False) if not args.disable_depth else None + + tracker.setCameraParameters(*((cam_color,) if args.disable_depth else (cam_color, cam_depth))) + tracker.setDisplayFeatures(True) + + print('Color intrinsics:', cam_color) + print('Depth intrinsics:', cam_depth) + I = ImageGray() + data_generator = read_data(exp_config, cam_depth, I) + frame_data = next(data_generator) # Get first frame for init + + depth_M_color = HomogeneousMatrix() + if not args.disable_depth: + depth_M_color.load(exp_config.extrinsic_file) + tracker.setCameraTransformationMatrix('Camera2', depth_M_color) + + # Initialize displays + dI = DisplayOpenCV() + dI.init(I, 0, 0, 'Color image') + + I_depth = None if args.disable_depth else ImageGray() + dDepth = DisplayOpenCV() + if not args.disable_depth: + ImageConvert.createDepthHistogram(frame_data.I_depth, I_depth) + dDepth.init(I_depth, I.getWidth(), 0, 'Depth') + + if args.init_ground_truth: + tracker.initFromPose(I, frame_data.cMo_ground_truth) + else: + tracker.initClick(I, str(mbt_model.init_file)) + start_time = time.time() + for frame_data in data_generator: + if frame_data.I_depth is not None: + ImageConvert.createDepthHistogram(frame_data.I_depth, I_depth) + + Display.display(I) + if not args.disable_depth: + Display.display(I_depth) + + if args.disable_depth: + tracker.track(I=I) + else: + pc = frame_data.point_cloud + image_dict = { + 'Camera1': I + } + t = time.time() + tracker.track(image_dict, {'Camera2': pc}) + print(f'Tracking took {(time.time() - t) * 1000}ms') + cMo = HomogeneousMatrix() + tracker.getPose(cMo) + + Display.displayFrame(I, cMo, cam_color, 0.05, Color.none, 2) + tracker.display(I, cMo, cam_color, Color.red, 2) + Display.flush(I) + if not args.disable_depth: + Display.flush(I_depth) + if args.step_by_step: + Display.getKeyboardEvent(I, blocking=True) + end_time = time.time() + print(f'total time = {end_time - start_time}s') diff --git a/modules/python/examples/synthetic_data_mbt.py b/modules/python/examples/synthetic_data_mbt.py index d140b79d89..e1fbcb506e 100644 --- a/modules/python/examples/synthetic_data_mbt.py +++ b/modules/python/examples/synthetic_data_mbt.py @@ -224,4 +224,4 @@ def parse_camera_file(exp_config: MBTConfig, is_color: bool) -> CameraParameters if args.step_by_step: Display.getKeyboardEvent(I, blocking=True) end_time = time.time() - print(f'total time = {end_time - start_time}') + print(f'total time = {end_time - start_time}s') From 3b2c9bc63f8da7c3f1543441117bda8993692ac0 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Mon, 27 Nov 2023 17:48:45 +0100 Subject: [PATCH 118/169] Model-based tracker with realsense camera --- modules/python/bindings/include/blob.hpp | 1 + modules/python/docs/todos.rst | 9 +- modules/python/examples/realsense_mbt.py | 129 ++++++++--------------- 3 files changed, 46 insertions(+), 93 deletions(-) diff --git a/modules/python/bindings/include/blob.hpp b/modules/python/bindings/include/blob.hpp index 091b976510..d11a3c4dbd 100644 --- a/modules/python/bindings/include/blob.hpp +++ b/modules/python/bindings/include/blob.hpp @@ -20,6 +20,7 @@ void bindings_vpDot2(py::class_ &pyDot2) }, R"doc( Wrapper for the defineDots method, see the C++ ViSP documentation. )doc", py::arg("dots"), py::arg("dotFile"), py::arg("I"), py::arg("color"), py::arg("trackDot") = true); + pyDot2.def_static("trackAndDisplay", [](std::vector &dots, vpImage &I, std::vector &cogs, diff --git a/modules/python/docs/todos.rst b/modules/python/docs/todos.rst index 7f29f8a017..8a579269af 100644 --- a/modules/python/docs/todos.rst +++ b/modules/python/docs/todos.rst @@ -12,7 +12,7 @@ Changes to ViSP Code generation ------------------- -* There is an issue with vpFeatureMomentDatabse::get and vpMomentDatabase::get, ignored for now +* There is an issue with vpFeatureMomentDatabse::get and vpMomentDatabase::get, ignored for now => a tester * n ary operators * Exclude get operators for vpArray2D ? * Parse subnamespaces @@ -67,13 +67,6 @@ To be written: -Packaging ------------------- - -* Root CMake - - * Build after doc if doc can be generated - Python side ----------------- diff --git a/modules/python/examples/realsense_mbt.py b/modules/python/examples/realsense_mbt.py index 53b6013aa3..7da5380ef6 100644 --- a/modules/python/examples/realsense_mbt.py +++ b/modules/python/examples/realsense_mbt.py @@ -1,7 +1,7 @@ import argparse from dataclasses import dataclass from pathlib import Path -from typing import List, Optional +from typing import List, Optional, Tuple import numpy as np import time import faulthandler @@ -9,7 +9,7 @@ from visp.core import XmlParserCamera, CameraParameters, ColVector, HomogeneousMatrix, Display, ImageConvert -from visp.core import ImageGray, ImageUInt16 +from visp.core import ImageGray, ImageUInt16, ImageRGBA from visp.io import ImageIo from visp.mbt import MbGenericTracker, MbTracker from visp.gui import DisplayOpenCV @@ -30,32 +30,19 @@ class MBTModelData: - def __init__(self, data_root: Path): - model_path = data_root / 'model' / 'teabox' + def __init__(self, data_root: Path, object_name: str): + model_path = data_root / 'model' / object_name assert model_path.exists() - self.config_color = model_path / 'teabox_color.xml' - self.config_depth = model_path / 'teabox_depth.xml' - self.cad_file = model_path / 'teabox.cao' - self.init_file = model_path / 'teabox.init' + self.config_color = model_path / f'{object_name}.xml' + self.config_depth = model_path / f'{object_name}_depth.xml' + self.cad_file = model_path / f'{object_name}.cao' + self.init_file = model_path / f'{object_name}.init' class MBTConfig: def __init__(self, data_root: Path): - data_path = data_root / 'data' / 'teabox' + data_path = data_root / 'data' assert data_path.exists() - self.color_camera_name = 'Camera_L' - self.depth_camera_name = 'Camera_R' - - self.color_intrinsics_file = data_path / f'{self.color_camera_name}.xml' - self.depth_intrinsics_file = data_path / f'{self.depth_camera_name}.xml' - - self.color_images_dir = data_path / 'color' - self.depth_images_dir = data_path / 'depth' - self.ground_truth_dir = data_path / 'ground-truth' - - - self.depth_intrinsics_file = data_path / f'{self.depth_camera_name}.xml' - self.extrinsic_file = str(data_path / 'depth_M_color.txt') # self.ground_truth = str(data_root / 'data' / 'depth_M_color.txt') @@ -64,76 +51,42 @@ class FrameData: I: ImageGray I_depth: Optional[ImageUInt16] point_cloud: Optional[np.ndarray] - cMo_ground_truth: HomogeneousMatrix -def read_data(exp_config: MBTConfig, cam_depth: CameraParameters | None, I: ImageGray): - pipe = rs.pipeline() - profile = pipe.start() - +def read_data(cam_depth: CameraParameters | None, I: ImageGray, pipe: rs.pipeline): use_depth = cam_depth is not None iteration = 1 + point_cloud_computer = rs.pointcloud() while True: frames = pipe.wait_for_frames() - print(frames) - I_depth_raw = np.asanyarray(frames.get_depth_frame().as_frame().get_data()) - - print(I_depth_raw.shape) - I = np.asanyarray(frames.get_color_frame().as_frame().get_data()) - print(I.shape) + I_np = np.asanyarray(frames.get_color_frame().as_frame().get_data()) + I_np = np.concatenate((I_np, np.ones_like(I_np[..., 0:1], dtype=np.uint8)), axis=-1) + I_rgba = ImageRGBA(I_np) + ImageConvert.convert(I_rgba, I, 0) + I_depth_raw = None point_cloud = None if use_depth: - t = time.time() - depth_filepath = exp_config.depth_images_dir / depth_format.format(iteration) - if not depth_filepath.exists(): - print(f'Could not find image {depth_filepath}') - return - I_depth_np = cv2.imread(str(depth_filepath), cv2.IMREAD_ANYCOLOR | cv2.IMREAD_ANYDEPTH) - I_depth_np = I_depth_np[..., 0] - print(f'\tDepth load took {(time.time() - t) * 1000}ms') - I_depth_raw = ImageUInt16(I_depth_np * 32767.5) - if I_depth_np.size == 0: - print('Could not successfully read the depth image') - return - t = time.time() - # point_cloud = np.empty((*I_depth_np.shape, 3), dtype=np.float64) - Z = I_depth_np.copy() - Z[Z > 2] = 0.0 # Clamping values that are too high - - vs, us = np.meshgrid(range(I_depth_np.shape[0]), range(I_depth_np.shape[1]), indexing='ij') - xs, ys = PixelMeterConversion.convertPoints(cam_depth, us, vs) - point_cloud = np.stack((xs * Z, ys * Z, Z), axis=-1) - - print(f'\tPoint_cloud took {(time.time() - t) * 1000}ms') - - cMo_ground_truth = HomogeneousMatrix() - ground_truth_file = exp_config.ground_truth_dir / (exp_config.color_camera_name + '_{:04d}.txt'.format(iteration)) - cMo_ground_truth.load(str(ground_truth_file)) + depth_proc_start = time.time() + I_depth_raw = np.asanyarray(frames.get_depth_frame().as_frame().get_data()) + point_cloud = np.asanyarray(point_cloud_computer.calculate(frames.get_depth_frame()).get_vertices()).view((np.float32, 3)) + print(f'Depth processing took {(time.time() - depth_proc_start) * 1000}ms') iteration += 1 - end_parse_time = time.time() - print(f'Data parsing took: {(end_parse_time - start_parse_time) * 1000}ms') - yield FrameData(I, I_depth_raw, point_cloud, cMo_ground_truth) + yield FrameData(I, ImageUInt16(I_depth_raw), point_cloud) -def parse_camera_file(exp_config: MBTConfig, is_color: bool) -> CameraParameters: - cam = CameraParameters() - xml_parser = XmlParserCamera() - if is_color: - camera_name, file_path = exp_config.color_camera_name, exp_config.color_intrinsics_file - else: - camera_name, file_path = exp_config.depth_camera_name, exp_config.depth_intrinsics_file - parse_res = xml_parser.parse(cam, str(file_path), camera_name, - CameraParameters.perspectiveProjWithoutDistortion, 0, 0, True) - assert parse_res == XmlParserCamera.SEQUENCE_OK # Check result - return cam +def cam_from_rs_profile(profile) -> Tuple[CameraParameters, int, int]: + intr = profile.as_video_stream_profile().get_intrinsics() # Downcast to video_stream_profile and fetch intrinsics + return CameraParameters(intr.fx, intr.fy, intr.ppx, intr.ppy), intr.height, intr.width if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument('--data-root', type=str, required=True, - help='Path to the folder containing all the data for the synthetic MBT example') + help='Path to the folder containing all the data for the MBT example') + parser.add_argument('--object-name', type=str, required=True, + help='Name of the object to track') parser.add_argument('--display-ground-truth', action='store_true') parser.add_argument('--disable-klt', action='store_true') parser.add_argument('--disable-depth', action='store_true') @@ -144,11 +97,23 @@ def parse_camera_file(exp_config: MBTConfig, is_color: bool) -> CameraParameters args = parser.parse_args() data_root = Path(args.data_root) - mbt_model = MBTModelData(data_root) - exp_config = MBTConfig(data_root) + + # Initialize realsense2 + pipe = rs.pipeline() + cfg = pipe.start() + + for i in range(10): + pipe.wait_for_frames() assert data_root.exists() and data_root.is_dir() + mbt_model = MBTModelData(data_root, args.object_name) + exp_config = MBTConfig(data_root) + + cam_color, color_height, color_width = cam_from_rs_profile(cfg.get_stream(rs.stream.color)) + cam_depth, depth_height, depth_width = cam_from_rs_profile(cfg.get_stream(rs.stream.depth)) + + rgb_tracker: int = MbGenericTracker.EDGE_TRACKER | (MbGenericTracker.KLT_TRACKER if not args.disable_klt else 0) tracker_types: List[int] = [rgb_tracker] if not args.disable_depth: @@ -164,8 +129,6 @@ def parse_camera_file(exp_config: MBTConfig, is_color: bool) -> CameraParameters tracker.loadModel(str(mbt_model.cad_file)) # Camera intrinsics - cam_color = parse_camera_file(exp_config, True) - cam_depth = parse_camera_file(exp_config, False) if not args.disable_depth else None tracker.setCameraParameters(*((cam_color,) if args.disable_depth else (cam_color, cam_depth))) tracker.setDisplayFeatures(True) @@ -173,7 +136,7 @@ def parse_camera_file(exp_config: MBTConfig, is_color: bool) -> CameraParameters print('Color intrinsics:', cam_color) print('Depth intrinsics:', cam_depth) I = ImageGray() - data_generator = read_data(exp_config, cam_depth, I) + data_generator = read_data(cam_depth, I, pipe) frame_data = next(data_generator) # Get first frame for init depth_M_color = HomogeneousMatrix() @@ -190,11 +153,7 @@ def parse_camera_file(exp_config: MBTConfig, is_color: bool) -> CameraParameters if not args.disable_depth: ImageConvert.createDepthHistogram(frame_data.I_depth, I_depth) dDepth.init(I_depth, I.getWidth(), 0, 'Depth') - - if args.init_ground_truth: - tracker.initFromPose(I, frame_data.cMo_ground_truth) - else: - tracker.initClick(I, str(mbt_model.init_file)) + tracker.initClick(I, str(mbt_model.init_file)) start_time = time.time() for frame_data in data_generator: if frame_data.I_depth is not None: @@ -212,7 +171,7 @@ def parse_camera_file(exp_config: MBTConfig, is_color: bool) -> CameraParameters 'Camera1': I } t = time.time() - tracker.track(image_dict, {'Camera2': pc}) + tracker.track(image_dict, {'Camera2': pc.reshape(depth_height, depth_width, 3)}) print(f'Tracking took {(time.time() - t) * 1000}ms') cMo = HomogeneousMatrix() tracker.getPose(cMo) From 79baefdf3882cac759711dd94934c33881a0696a Mon Sep 17 00:00:00 2001 From: Fabien Spindler Date: Mon, 27 Nov 2023 18:59:39 +0100 Subject: [PATCH 119/169] Update python3 detection and use ViSP mechanism to detect pybind11 - Rename also all the targets related to python bindings using visp_python_bindings as target prefix name - Add missing copyright header --- CMakeLists.txt | 48 +++++++++++++------------ cmake/VISPDetectPython.cmake | 48 +++++-------------------- modules/python/CMakeLists.txt | 50 +++++++++++++++++++------- modules/python/bindings/CMakeLists.txt | 40 +++++++++++++++++++-- modules/python/docs/CMakeLists.txt | 43 +++++++++++++++++++--- modules/python/stubs/CMakeLists.txt | 45 +++++++++++++++++++---- 6 files changed, 185 insertions(+), 89 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5ab004be10..661c8468cb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -275,20 +275,22 @@ endif() # --- Python Bindings requirements --- # this avoids non-active conda from getting picked anyway on Windows -set(Python_FIND_REGISTRY LAST) +#set(Python_FIND_REGISTRY LAST) # Use environment variable PATH to decide preference for Python -set(Python_FIND_VIRTUALENV FIRST) -set(Python_FIND_STRATEGY LOCATION) - -find_package(Python 3.7 COMPONENTS Interpreter Development) # TODO: use visp function to find python? -if(Python_FOUND) - set(VISP_PYTHON_BINDINGS_EXECUTABLE "${Python_EXECUTABLE}") -endif() -find_package(pybind11) -if(pybind11_FOUND) - set(VISP_PYBIND11_DIR "${pybind11_DIR}") -endif() -message("${pybind11_FOUND}") +#set(Python_FIND_VIRTUALENV FIRST) +#set(Python_FIND_STRATEGY LOCATION) + +#find_package(Python 3.7 COMPONENTS Interpreter Development) # TODO: use visp function to find python? +#if(Python_FOUND) +# set(VISP_PYTHON_BINDINGS_EXECUTABLE "${Python_EXECUTABLE}") +#endif() +#find_package(pybind11) +VP_OPTION(USE_PYBIND11 pybind11 QUIET "Include pybind11 to create Python bindings" "" ON) + +#if(pybind11_FOUND) +# set(VISP_PYBIND11_DIR "${pybind11_DIR}") +#endif() +#message("${pybind11_FOUND}") # --- @@ -434,8 +436,8 @@ VP_OPTION(BUILD_ANDROID_EXAMPLES "" "" "Build examples for Android platform" VP_OPTION(INSTALL_ANDROID_EXAMPLES "" "" "Install Android examples" "" OFF IF ANDROID ) # Build python bindings as an option -VP_OPTION(BUILD_PYTHON "" "" "Enable Python support" "" ON IF (VISP_PYTHON_BINDINGS_EXECUTABLE AND VISP_PYBIND11_DIR) ) -VP_OPTION(BUILD_PYTHON_DOC "" "" "Build the documentation for the Python bindings" "" ON IF BUILD_PYTHON ) +VP_OPTION(BUILD_PYTHON_BINDINGS "" "" "Build Python bindings" "" ON IF (PYTHON3INTERP_FOUND AND USE_PYBIND11) ) +VP_OPTION(BUILD_PYTHON_BINDINGS_DOC "" "" "Build the documentation for the Python bindings" "" ON IF BUILD_PYTHON_BINDINGS ) # Build demos as an option. @@ -1230,7 +1232,7 @@ endif() if(BUILD_APPS) vp_add_subdirectories(VISP_CONTRIB_MODULES_PATH apps) endif() -if(BUILD_PYTHON) +if(BUILD_PYTHON_BINDINGS) add_subdirectory(modules/python) endif() @@ -1505,7 +1507,8 @@ endif() # ========================== java ========================== status("") -status(" Python (for java build):" PYTHON_DEFAULT_AVAILABLE THEN "${PYTHON_DEFAULT_EXECUTABLE}" ELSE "no") +status(" Python 3:") +status(" Interpreter:" PYTHON3INTERP_FOUND THEN "${PYTHON3_EXECUTABLE} (ver ${PYTHON3_VERSION_STRING})" ELSE "no") if(BUILD_JAVA OR BUILD_visp_java) status("") @@ -1516,16 +1519,15 @@ if(BUILD_JAVA OR BUILD_visp_java) endif() endif() -# ========================== Python ========================== +# ======================= Python bindings ======================== status("") -status(" Building Python wrapper :" BUILD_PYTHON THEN "yes" ELSE "no") -if(BUILD_PYTHON) - status(" Python interpreter:" Python_FOUND THEN "${Python_EXECUTABLE}" ELSE "no") - status(" Pybind11:" pybind11_FOUND THEN "${pybind11_DIR}" ELSE "no") +status(" Python3 bindings:" BUILD_PYTHON_BINDINGS THEN "yes" ELSE "no") +if(BUILD_PYTHON_BINDINGS) + status(" Python3 interpreter:" PYTHON3INTERP_FOUND THEN "${PYTHON3_EXECUTABLE} (ver ${PYTHON3_VERSION_STRING})" ELSE "no") + status(" Pybind11:" USE_PYBIND11 THEN "${pybind11_DIR}" ELSE "no") status(" Package version:" "${VISP_PYTHON_PACKAGE_VERSION}") status(" Wrapped modules:" "${VISP_PYTHON_BOUND_MODULES}") status(" Generated input config:" "${VISP_PYTHON_GENERATED_CONFIG_FILE}") - endif() # ============================ Options =========================== diff --git a/cmake/VISPDetectPython.cmake b/cmake/VISPDetectPython.cmake index ee0489fee9..7601715c3c 100644 --- a/cmake/VISPDetectPython.cmake +++ b/cmake/VISPDetectPython.cmake @@ -85,11 +85,7 @@ if(NOT ${found}) endif() vp_clear_vars(PYTHONINTERP_FOUND PYTHON_EXECUTABLE PYTHON_VERSION_STRING PYTHON_VERSION_MAJOR PYTHON_VERSION_MINOR PYTHON_VERSION_PATCH) if(NOT CMAKE_VERSION VERSION_LESS "3.12") - if(_python_version_major STREQUAL "2") - set(__PYTHON_PREFIX Python2) - else() - set(__PYTHON_PREFIX Python3) - endif() + set(__PYTHON_PREFIX Python3) find_host_package(${__PYTHON_PREFIX} "${preferred_version}" COMPONENTS Interpreter) if(${__PYTHON_PREFIX}_EXECUTABLE) set(PYTHON_EXECUTABLE "${${__PYTHON_PREFIX}_EXECUTABLE}") @@ -208,9 +204,6 @@ if(NOT ${found}) if(CMAKE_CROSSCOMPILING) message(STATUS "Cannot probe for Python/Numpy support (because we are cross-compiling ViSP)") message(STATUS "If you want to enable Python/Numpy support, set the following variables:") - message(STATUS " PYTHON2_INCLUDE_PATH") - message(STATUS " PYTHON2_LIBRARIES (optional on Unix-like systems)") - message(STATUS " PYTHON2_NUMPY_INCLUDE_DIRS") message(STATUS " PYTHON3_INCLUDE_PATH") message(STATUS " PYTHON3_LIBRARIES (optional on Unix-like systems)") message(STATUS " PYTHON3_NUMPY_INCLUDE_DIRS") @@ -258,7 +251,7 @@ if(NOT ${found}) set(${include_path} "${_include_path}" CACHE INTERNAL "") set(${include_dir} "${_include_dir}" CACHE PATH "Python include dir") set(${include_dir2} "${_include_dir2}" CACHE PATH "Python include dir 2") - set(${packages_path} "${_packages_path}" CACHE PATH "Where to install the python packages.") + set(${packages_path} "${_packages_path}" CACHE STRING "Where to install the python packages.") set(${numpy_include_dirs} ${_numpy_include_dirs} CACHE PATH "Path to numpy headers") set(${numpy_version} "${_numpy_version}" CACHE INTERNAL "") endif() @@ -268,14 +261,6 @@ if(VISP_PYTHON_SKIP_DETECTION) return() endif() -find_python("" "${MIN_VER_PYTHON2}" PYTHON2_LIBRARY PYTHON2_INCLUDE_DIR - PYTHON2INTERP_FOUND PYTHON2_EXECUTABLE PYTHON2_VERSION_STRING - PYTHON2_VERSION_MAJOR PYTHON2_VERSION_MINOR PYTHON2LIBS_FOUND - PYTHON2LIBS_VERSION_STRING PYTHON2_LIBRARIES PYTHON2_LIBRARY - PYTHON2_DEBUG_LIBRARIES PYTHON2_LIBRARY_DEBUG PYTHON2_INCLUDE_PATH - PYTHON2_INCLUDE_DIR PYTHON2_INCLUDE_DIR2 PYTHON2_PACKAGES_PATH - PYTHON2_NUMPY_INCLUDE_DIRS PYTHON2_NUMPY_VERSION) - option(VISP_PYTHON3_VERSION "Python3 version" "") find_python("${VISP_PYTHON3_VERSION}" "${MIN_VER_PYTHON3}" PYTHON3_LIBRARY PYTHON3_INCLUDE_DIR PYTHON3INTERP_FOUND PYTHON3_EXECUTABLE PYTHON3_VERSION_STRING @@ -285,31 +270,16 @@ find_python("${VISP_PYTHON3_VERSION}" "${MIN_VER_PYTHON3}" PYTHON3_LIBRARY PYTHO PYTHON3_INCLUDE_DIR PYTHON3_INCLUDE_DIR2 PYTHON3_PACKAGES_PATH PYTHON3_NUMPY_INCLUDE_DIRS PYTHON3_NUMPY_VERSION) -mark_as_advanced(PYTHON2_LIBRARY PYTHON2_INCLUDE_DIR - PYTHON2INTERP_FOUND PYTHON2_EXECUTABLE PYTHON2_VERSION_STRING - PYTHON2_VERSION_MAJOR PYTHON2_VERSION_MINOR PYTHON2LIBS_FOUND - PYTHON2LIBS_VERSION_STRING PYTHON2_LIBRARIES PYTHON2_LIBRARY - PYTHON2_DEBUG_LIBRARIES PYTHON2_LIBRARY_DEBUG PYTHON2_INCLUDE_PATH - PYTHON2_INCLUDE_DIR PYTHON2_INCLUDE_DIR2 PYTHON2_PACKAGES_PATH - PYTHON2_NUMPY_INCLUDE_DIRS PYTHON2_NUMPY_VERSION) - -mark_as_advanced(PYTHON3_LIBRARY PYTHON3_INCLUDE_DIR - PYTHON3INTERP_FOUND PYTHON3_EXECUTABLE PYTHON3_VERSION_STRING - PYTHON3_VERSION_MAJOR PYTHON3_VERSION_MINOR PYTHON3LIBS_FOUND - PYTHON3LIBS_VERSION_STRING PYTHON3_LIBRARIES PYTHON3_LIBRARY - PYTHON3_DEBUG_LIBRARIES PYTHON3_LIBRARY_DEBUG PYTHON3_INCLUDE_PATH - PYTHON3_INCLUDE_DIR PYTHON3_INCLUDE_DIR2 PYTHON3_PACKAGES_PATH - PYTHON3_NUMPY_INCLUDE_DIRS PYTHON3_NUMPY_VERSION - VISP_PYTHON3_VERSION) - if(PYTHON_DEFAULT_EXECUTABLE) set(PYTHON_DEFAULT_AVAILABLE "TRUE") -elseif(PYTHON2_EXECUTABLE AND PYTHON2INTERP_FOUND) - # Use Python 2 as default Python interpreter - set(PYTHON_DEFAULT_AVAILABLE "TRUE") - set(PYTHON_DEFAULT_EXECUTABLE "${PYTHON2_EXECUTABLE}") elseif(PYTHON3_EXECUTABLE AND PYTHON3INTERP_FOUND) - # Use Python 3 as fallback Python interpreter (if there is no Python 2) set(PYTHON_DEFAULT_AVAILABLE "TRUE") set(PYTHON_DEFAULT_EXECUTABLE "${PYTHON3_EXECUTABLE}") endif() + +if(PYTHON_DEFAULT_AVAILABLE) + execute_process(COMMAND ${PYTHON_DEFAULT_EXECUTABLE} --version + OUTPUT_VARIABLE PYTHON_DEFAULT_VERSION + OUTPUT_STRIP_TRAILING_WHITESPACE) + string(REGEX MATCH "[0-9]+.[0-9]+.[0-9]+" PYTHON_DEFAULT_VERSION "${PYTHON_DEFAULT_VERSION}") +endif() diff --git a/modules/python/CMakeLists.txt b/modules/python/CMakeLists.txt index 321eeb9197..a24ec61210 100644 --- a/modules/python/CMakeLists.txt +++ b/modules/python/CMakeLists.txt @@ -1,4 +1,37 @@ - +############################################################################# +# +# 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: +# ViSP Python bindings module +# +############################################################################# # Prevent CMAKE from interpreting this directory as a standard module. if(NOT VISP_DIR) @@ -9,7 +42,6 @@ endif() # we should configure the python directory by add_subdirectory("modules/python") in the main cmake. find_package(VISP REQUIRED) - # TODO: check for pip # Set pip args @@ -25,8 +57,6 @@ set(python_ignored_modules "visp_python" "visp_java_bindings_generator" "visp_ja set(python_bound_modules ${VISP_MODULES_BUILD}) list(REMOVE_ITEM python_bound_modules ${python_ignored_modules}) - - # Configure the different directories set(bindgen_package_location "${CMAKE_CURRENT_SOURCE_DIR}/generator") set(bindings_package_location "${CMAKE_CURRENT_SOURCE_DIR}/bindings") @@ -44,7 +74,6 @@ endforeach() include("${CMAKE_CURRENT_SOURCE_DIR}/GenerateConfig.cmake") - # Step 2: Generate bindings # First, we install the bindings generator as an editable pip package # Then, we call it with the configuration files as argument. The .cpp files are generated in the cmake build directory @@ -68,33 +97,28 @@ endif() add_custom_command( OUTPUT ${python_bindings_cpp_src} - COMMAND ${Python_EXECUTABLE} -m pip install ${_pip_args} ${bindgen_package_location} - COMMAND ${Python_EXECUTABLE} -m visp_python_bindgen.generator --config "${CMAKE_CURRENT_SOURCE_DIR}/config" --build-folder ${bindings_gen_location} --main-config "${json_config_file_path}" + COMMAND ${PYTHON3_EXECUTABLE} -m pip install ${_pip_args} ${bindgen_package_location} + COMMAND ${PYTHON3_EXECUTABLE} -m visp_python_bindgen.generator --config "${CMAKE_CURRENT_SOURCE_DIR}/config" --build-folder ${bindings_gen_location} --main-config "${json_config_file_path}" DEPENDS ${bindings_dependencies} COMMENT "Installing the bindings generator and running it..." ) add_custom_target( visp_python_bindings_generator_run DEPENDS ${python_bindings_cpp_src} - ) set(VISP_PYTHON_VERSION "${VISP_VERSION}") # Step 3: Compile and install bindings as a python package add_subdirectory(bindings) - # Step 4: Copy stubs dir and install stubs for autocompletion add_subdirectory(stubs) # Step 5: Build documentation -if(BUILD_PYTHON_DOC) +if(BUILD_PYTHON_BINDINGS_DOC) add_subdirectory(docs) endif() - - - # Export Variables to parent cmake set(VISP_PYTHON_BOUND_MODULES "") foreach(module ${python_bound_modules}) diff --git a/modules/python/bindings/CMakeLists.txt b/modules/python/bindings/CMakeLists.txt index 1526e9e9a2..c8a6080c06 100644 --- a/modules/python/bindings/CMakeLists.txt +++ b/modules/python/bindings/CMakeLists.txt @@ -1,3 +1,37 @@ +############################################################################# +# +# 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: +# ViSP Python bindings module +# +############################################################################# # Declare the cpp source files as explicitely generated so that pybind11_add_module does not look for them when they are not yet created set_source_files_properties(${python_bindings_cpp_src} PROPERTIES GENERATED TRUE) @@ -19,11 +53,11 @@ target_link_libraries(_visp PRIVATE ${VISP_LIBRARIES}) add_dependencies(_visp visp_python_bindings_generator_run) # Setup pip install -if(Python_FOUND) +if(PYTHON3INTERP_FOUND) configure_file("${CMAKE_CURRENT_SOURCE_DIR}/setup.py.in" "${CMAKE_CURRENT_BINARY_DIR}/setup.py" @ONLY) add_custom_target( visp_python_bindings_install COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMAKE_CURRENT_SOURCE_DIR}/visp" "${CMAKE_CURRENT_BINARY_DIR}/visp" - COMMAND ${Python_EXECUTABLE} -m pip install ${_pip_args} -v "${CMAKE_CURRENT_BINARY_DIR}" + COMMAND ${PYTHON3_EXECUTABLE} -m pip install ${_pip_args} -v "${CMAKE_CURRENT_BINARY_DIR}" DEPENDS _visp ) -endif() \ No newline at end of file +endif() diff --git a/modules/python/docs/CMakeLists.txt b/modules/python/docs/CMakeLists.txt index 1bf6c679f4..2c5716f56c 100644 --- a/modules/python/docs/CMakeLists.txt +++ b/modules/python/docs/CMakeLists.txt @@ -9,6 +9,41 @@ set(SPHINX_CACHE_DIR "${CMAKE_CURRENT_BINARY_DIR}/_doctrees") # HTML output directory set(SPHINX_HTML_DIR "${CMAKE_CURRENT_BINARY_DIR}/html") +############################################################################# +# +# 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: +# ViSP Python bindings module +# +############################################################################# + # Sphinx Template directory set(SPHINX_TEMPLATE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/_templates") @@ -17,8 +52,6 @@ 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}) @@ -30,8 +63,8 @@ configure_file( "${CMAKE_CURRENT_SOURCE_DIR}/api.rst" @ONLY) -add_custom_target(visp_python_docs - COMMAND ${Python_EXECUTABLE} -m pip install -r "${CMAKE_CURRENT_SOURCE_DIR}/requirements.txt" +add_custom_target(visp_python_bindings_docs + COMMAND ${PYTHON3_EXECUTABLE} -m pip install -r "${CMAKE_CURRENT_SOURCE_DIR}/requirements.txt" COMMAND sphinx-build -q -b html -c "${BINARY_BUILD_DIR}" @@ -40,4 +73,4 @@ add_custom_target(visp_python_docs "${SPHINX_HTML_DIR}" COMMENT "Building HTML documentation for ViSP Python doc with Sphinx") -add_dependencies(visp_python_docs visp_python_bindings_install) +add_dependencies(visp_python_bindings_docs visp_python_bindings_install) diff --git a/modules/python/stubs/CMakeLists.txt b/modules/python/stubs/CMakeLists.txt index 4b74ce1bc0..81f42c0994 100644 --- a/modules/python/stubs/CMakeLists.txt +++ b/modules/python/stubs/CMakeLists.txt @@ -1,14 +1,47 @@ +############################################################################# +# +# 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: +# ViSP Python bindings stubs +# +############################################################################# configure_file("${CMAKE_CURRENT_SOURCE_DIR}/setup.py.in" "${CMAKE_CURRENT_BINARY_DIR}/setup.py" @ONLY) # MANIFEST file is not really configured by CMAKE, but doing it like this ensures that the target will be regenerated if MANIFEST.in is modified #configure_file("${CMAKE_CURRENT_SOURCE_DIR}/MANIFEST.in" "${CMAKE_CURRENT_BINARY_DIR}/MANIFEST.in" COPYONLY) - -add_custom_target( visp_python_stubs +add_custom_target( visp_python_bindings_stubs COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_CURRENT_BINARY_DIR}/visp-stubs" - COMMAND ${Python_EXECUTABLE} -m pip install ${_pip_args} pybind11-stubgen - COMMAND ${Python_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/run_stub_generator.py --output-root ${CMAKE_CURRENT_BINARY_DIR} - COMMAND ${Python_EXECUTABLE} -m pip install ${_pip_args} -v "${CMAKE_CURRENT_BINARY_DIR}" + COMMAND ${PYTHON3_EXECUTABLE} -m pip install ${_pip_args} pybind11-stubgen + COMMAND ${PYTHON3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/run_stub_generator.py --output-root ${CMAKE_CURRENT_BINARY_DIR} + COMMAND ${PYTHON3_EXECUTABLE} -m pip install ${_pip_args} -v "${CMAKE_CURRENT_BINARY_DIR}" DEPENDS visp_python_bindings_install -) \ No newline at end of file +) From 2feede69913d8eef27baa00aa5cd6d5ab8e78970 Mon Sep 17 00:00:00 2001 From: Fabien Spindler Date: Mon, 27 Nov 2023 19:02:21 +0100 Subject: [PATCH 120/169] Update tutorial by mainly reducing the size of the lines --- .../misc/tutorial-synthetic-blenderproc.dox | 201 ++++++++++++------ 1 file changed, 132 insertions(+), 69 deletions(-) diff --git a/doc/tutorial/misc/tutorial-synthetic-blenderproc.dox b/doc/tutorial/misc/tutorial-synthetic-blenderproc.dox index 46e7b2ca49..91f04a807a 100644 --- a/doc/tutorial/misc/tutorial-synthetic-blenderproc.dox +++ b/doc/tutorial/misc/tutorial-synthetic-blenderproc.dox @@ -5,21 +5,29 @@ \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. +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: +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) +- 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. +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. +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 @@ -29,13 +37,17 @@ Along with RGB images, Blenderproc can generate different labels or inputs: - 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. +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. +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. +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 @@ -47,7 +59,8 @@ 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. +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} @@ -55,24 +68,31 @@ Once Blenderproc is done, you can check its output with: \endcode -Blenderproc stores its output in HDF5 file format. Each HDF5 **may** contain the RGB image, along with depth, normals, and other modalities. +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. +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. +\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 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 @@ -114,12 +134,9 @@ For each scene: \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. @@ -136,9 +153,12 @@ The models should be contained in a folder as such: - 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). +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: @@ -169,7 +189,8 @@ The general parameters are: -You can also control some of the rendering parameters. This will impact the rendering time and the quality of the generated RGB images. +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. @@ -181,12 +202,14 @@ These parameters are located in the "rendering" field. -
NameType, possible valuesDescription
denoiser One 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. + 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. +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. @@ -224,8 +247,10 @@ These parameters are found in the "camera" field of the configuration.
NameType, possible valuesDescription
randomize_params_percent Float, [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]. + 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].
@@ -239,8 +264,10 @@ To customize the scene, you can change the parameters in the "scene" field: Float > 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. + 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. @@ -248,20 +275,25 @@ To customize the scene, you can change the parameters in the "scene" field: Float > 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. + 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_physics Boolean - Whether to simulate physics. If false, then objects will be floating across the room. If true, then objects will fall to the ground. + Whether to simulate physics. If false, then objects will be floating across the room. If true, + then objects will fall to the ground. max_num_textures Int > 0 - Max 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. + Max 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. distractors @@ -280,7 +312,8 @@ To customize the scene, you can change the parameters in the "scene" field: -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. +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 @@ -335,7 +368,8 @@ To modify their properties, you can change the "distractors" field of the scene @@ -344,14 +378,16 @@ To modify their properties, you can change the "distractors" field of the scene @@ -449,23 +485,28 @@ To change the sampling behaviour of target objects, see the properties below:
NameType, possible valuesDescription
Float >= 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. + 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.
Float >= 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. + These properties include the specularity, the "metallicness" and the roughness of the material, according to + Blender's principled BSDF.
emissive_prob Float >= 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. + Probability that a distractor becomes a light source: its surface emits light. Set to more than 0 to add more + light variations and shadows.
Float >= 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. + These properties include the specularity, the "metallicness" and the roughness of the material, according to + Blender's principled BSDF.
cam_min_dist_rel Float >= 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. + 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_rel Float >= 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. + 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.
@@ -481,41 +522,48 @@ To customize the dataset, modify the options in the "dataset" field: save_path String - Path 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. + Path 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_run Int > 0 - Number of scenes to generate per blenderproc run. Between blenderproc runs, Blender is restarted in order to avoid memory issues. + Number of scenes to generate per blenderproc run. Between blenderproc runs, Blender is restarted in order to + avoid memory issues. num_scenes Int > 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. + 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_scene Int > 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). + 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_scene Int >= 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. + 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. pose Boolean - 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$ + 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$ @@ -546,7 +594,8 @@ To customize the dataset, modify the options in the "dataset" field: detection Boolean - 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. + 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". @@ -554,15 +603,19 @@ To customize the dataset, modify the options in the "dataset" field: detection_params:min_size_size_px Int >= 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. + 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_visibility Float [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). + 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. @@ -571,7 +624,8 @@ To customize the dataset, modify the options in the "dataset" field: \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. +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} @@ -581,15 +635,18 @@ You can then run the `generate_dataset.py` script as such 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. +\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. +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 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 @@ -627,7 +684,11 @@ This script can be run like this: (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). +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: @@ -637,12 +698,14 @@ the following: names: - esa nc: 1 -train: /local/sfelton/yolov7_esa_dataset/images/train -val: /local/sfelton/yolov7_esa_dataset/images/val +train: /local/user/yolov7_esa_dataset/images/train +val: /local/user/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. +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 @@ -652,7 +715,8 @@ To start training a YoloV7, you should download the repository an (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. +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 @@ -660,7 +724,7 @@ 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) +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. @@ -684,9 +748,6 @@ Here is an overview of the generated images and the resulting detections for a s

\endhtmlonly - - - \subsection dnn_output_custom_parsing Parsing HDF5 with a custom script In Python, an HDF5 file can be read like a dictionary. @@ -770,7 +831,8 @@ Reading scene 4 \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. +- 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] @@ -778,6 +840,7 @@ You can modify this script to export the dataset to another format, as it was do \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. +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. */ From 129320dcce5057ad18541e376f7bcc1cd91a5abb Mon Sep 17 00:00:00 2001 From: Fabien Spindler Date: Mon, 27 Nov 2023 19:03:22 +0100 Subject: [PATCH 121/169] Add missing copyright header - Remove empty lines when duplicated --- modules/python/GenerateConfig.cmake | 38 +- modules/python/bindings/include/blob.hpp | 40 +- modules/python/bindings/include/core.hpp | 33 ++ .../python/bindings/include/core/arrays.hpp | 70 +++- .../python/bindings/include/core/images.hpp | 45 ++- .../bindings/include/core/pixel_meter.hpp | 42 +- .../python/bindings/include/core/utils.hpp | 38 +- modules/python/bindings/include/mbt.hpp | 83 ++-- modules/python/bindings/setup.py.in | 35 ++ modules/python/bindings/visp/__init__.py | 34 ++ modules/python/bindings/visp/bindings.py | 37 +- modules/python/docs/conf.py.in | 4 - modules/python/docs/index.rst | 2 - modules/python/docs/todos.rst | 13 +- modules/python/examples/realsense_mbt.py | 35 ++ modules/python/examples/repro_tp1.py | 260 +++++++------ modules/python/examples/repro_tp2.py | 162 ++++---- modules/python/examples/repro_tp3.py | 366 ++++++++++-------- modules/python/examples/synthetic_data_mbt.py | 42 +- .../visp_python_bindgen/doc_parser.py | 39 +- .../visp_python_bindgen/enum_binding.py | 42 +- .../visp_python_bindgen/gen_report.py | 37 +- .../visp_python_bindgen/generator.py | 36 +- .../visp_python_bindgen/generator_config.py | 39 +- .../generator/visp_python_bindgen/header.py | 41 +- .../visp_python_bindgen/header_utils.py | 36 +- .../generator/visp_python_bindgen/methods.py | 47 ++- .../visp_python_bindgen/preprocessor.py | 41 +- .../visp_python_bindgen/submodule.py | 55 ++- .../generator/visp_python_bindgen/utils.py | 45 ++- modules/python/stubs/run_stub_generator.py | 37 +- modules/python/stubs/setup.py.in | 36 +- modules/python/test/test_core_repr.py | 36 +- modules/python/test/test_numpy.py | 36 +- modules/python/test/test_specific_cases.py | 37 +- 35 files changed, 1499 insertions(+), 520 deletions(-) diff --git a/modules/python/GenerateConfig.cmake b/modules/python/GenerateConfig.cmake index ef8823a743..9281405e0b 100644 --- a/modules/python/GenerateConfig.cmake +++ b/modules/python/GenerateConfig.cmake @@ -1,3 +1,38 @@ +############################################################################# +# +# 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: +# ViSP Python bindings module +# +############################################################################# + set(json_config_file "{}") set(json_config_file_path "${CMAKE_CURRENT_BINARY_DIR}/cmake_config.json") @@ -15,8 +50,6 @@ foreach(include_dir ${VISP_INCLUDE_DIRS}) endforeach() string(JSON json_config_file SET ${json_config_file} "include_dirs" "${json_include_dirs}") - - # For each bound module, add its headers and dependencies to config file set(json_modules "{}") foreach(module ${python_bound_modules}) @@ -59,6 +92,7 @@ if(CMAKE_COMPILER_IS_GNUCXX) string(JSON json_defines SET ${json_defines} "__GNUC_MINOR__" "${GCC_MINOR}") string(JSON json_defines SET ${json_defines} "__GNUC_PATCHLEVEL__" "${GCC_PATCH}") endif() + if(CMAKE_COMPILER_IS_CLANGCXX) string(REPLACE "." ";" CLANG_VERSION_LIST ${CMAKE_CXX_COMPILER_VERSION}) list(GET CLANG_VERSION_LIST 0 CLANG_MAJOR) diff --git a/modules/python/bindings/include/blob.hpp b/modules/python/bindings/include/blob.hpp index d11a3c4dbd..bfb7fdf4bc 100644 --- a/modules/python/bindings/include/blob.hpp +++ b/modules/python/bindings/include/blob.hpp @@ -1,5 +1,39 @@ +/* + * 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: + * Python bindings. + */ + #ifndef VISP_PYTHON_BLOB_HPP #define VISP_PYTHON_BLOB_HPP + #include #include #include @@ -16,7 +50,7 @@ void bindings_vpDot2(py::class_ &pyDot2) vpImage &I, vpColor col = vpColor::blue, bool trackDot = true) { - return vpDot2::defineDots(&dots[0], dots.size(), dotFile, I, col, trackDot); + return vpDot2::defineDots(&dots[0], dots.size(), dotFile, I, col, trackDot); }, R"doc( Wrapper for the defineDots method, see the C++ ViSP documentation. )doc", py::arg("dots"), py::arg("dotFile"), py::arg("I"), py::arg("color"), py::arg("trackDot") = true); @@ -25,8 +59,8 @@ Wrapper for the defineDots method, see the C++ ViSP documentation. vpImage &I, std::vector &cogs, std::optional> cogStar) { - vpImagePoint *desireds = cogStar ? &((*cogStar)[0]) : nullptr; - vpDot2::trackAndDisplay(&dots[0], dots.size(), I, cogs, desireds); + vpImagePoint *desireds = cogStar ? &((*cogStar)[0]) : nullptr; + vpDot2::trackAndDisplay(&dots[0], dots.size(), I, cogs, desireds); }, R"doc( Wrapper for the trackAndDisplay method, see the C++ ViSP documentation. )doc", py::arg("dots"), py::arg("I"), py::arg("cogs"), py::arg("desiredCogs")); diff --git a/modules/python/bindings/include/core.hpp b/modules/python/bindings/include/core.hpp index 2e1948e78c..5e7f5caefd 100644 --- a/modules/python/bindings/include/core.hpp +++ b/modules/python/bindings/include/core.hpp @@ -1,3 +1,36 @@ +/* + * 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: + * Python bindings. + */ + #ifndef VISP_PYTHON_CORE_HPP #define VISP_PYTHON_CORE_HPP diff --git a/modules/python/bindings/include/core/arrays.hpp b/modules/python/bindings/include/core/arrays.hpp index 79ff9f67ce..e54be92cd8 100644 --- a/modules/python/bindings/include/core/arrays.hpp +++ b/modules/python/bindings/include/core/arrays.hpp @@ -1,7 +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 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: + * Python bindings. + */ + #ifndef VISP_PYTHON_CORE_ARRAYS_HPP #define VISP_PYTHON_CORE_ARRAYS_HPP -#include "core/utils.hpp" +#include "core/utils.hpp" #include #include @@ -11,10 +44,13 @@ #include #include +/* + * Array2D and its children. + */ -/*Array2D and its children*/ - -/*Get buffer infos : used in def_buffer and the .numpy() function*/ +/* + * Get buffer infos : used in def_buffer and the .numpy() function. + */ template py::buffer_info get_buffer_info(T &) = delete; template class Array, @@ -51,11 +87,12 @@ py::buffer_info get_buffer_info(vpHomogeneousMatrix &array) return make_array_buffer(array.data, { array.getRows(), array.getCols() }, true); } -/*Array 2D indexing*/ +/* + * Array 2D indexing + */ template void define_get_item_2d_array(PyClass &pyClass) { - pyClass.def("__getitem__", [](const Class &self, std::pair pair) -> Item { int i = pair.first, j = pair.second; const unsigned int rows = self.getRows(), cols = self.getCols(); @@ -92,7 +129,6 @@ void define_get_item_2d_array(PyClass &pyClass) pyClass.def("__getitem__", [](const Class &self, py::tuple tuple) { return (py::cast(self).template cast >())[tuple].template cast>(); }); - } const char *numpy_fn_doc_writable = R"doc( @@ -106,11 +142,9 @@ const char *numpy_fn_doc_nonwritable = R"doc( If you try to modify the array, an exception will be raised. )doc"; - template void bindings_vpArray2D(py::class_> &pyArray2D) { - pyArray2D.def_buffer(&get_buffer_info); pyArray2D.def("numpy", [](vpArray2D &self) -> np_array_cf { @@ -123,7 +157,7 @@ void bindings_vpArray2D(py::class_> &pyArray2D) vpArray2D result(shape[0], shape[1]); copy_data_from_np(np_array, result.data); return result; - }), R"doc( + }), R"doc( Construct a 2D ViSP array by **copying** a 2D numpy array. :param np_array: The numpy array to copy. @@ -135,7 +169,6 @@ Construct a 2D ViSP array by **copying** a 2D numpy array. void bindings_vpMatrix(py::class_> &pyMatrix) { - pyMatrix.def_buffer(&get_buffer_info); pyMatrix.def("numpy", [](vpMatrix &self) -> np_array_cf { @@ -148,7 +181,7 @@ void bindings_vpMatrix(py::class_> &pyMatrix) vpMatrix result(shape[0], shape[1]); copy_data_from_np(np_array, result.data); return result; - }), R"doc( + }), R"doc( Construct a matrix by **copying** a 2D numpy array. :param np_array: The numpy array to copy. @@ -158,7 +191,6 @@ Construct a matrix by **copying** a 2D numpy array. define_get_item_2d_array>, vpMatrix, double>(pyMatrix); } - void bindings_vpColVector(py::class_> &pyColVector) { pyColVector.def_buffer(&get_buffer_info); @@ -173,13 +205,12 @@ void bindings_vpColVector(py::class_> &pyColVecto vpColVector result(shape[0]); copy_data_from_np(np_array, result.data); return result; - }), R"doc( + }), R"doc( Construct a column vector by **copying** a 1D numpy array. :param np_array: The numpy 1D array to copy. )doc", py::arg("np_array")); - } void bindings_vpRowVector(py::class_> &pyRowVector) @@ -194,7 +225,7 @@ void bindings_vpRowVector(py::class_> &pyRowVecto vpRowVector result(shape[0]); copy_data_from_np(np_array, result.data); return result; - }), R"doc( + }), R"doc( Construct a row vector by **copying** a 1D numpy array. :param np_array: The numpy 1D array to copy. @@ -202,7 +233,6 @@ Construct a row vector by **copying** a 1D numpy array. )doc", py::arg("np_array")); } - void bindings_vpRotationMatrix(py::class_> &pyRotationMatrix) { @@ -219,7 +249,7 @@ void bindings_vpRotationMatrix(py::class_> & throw std::runtime_error("Input numpy array is not a valid rotation matrix"); } return result; - }), R"doc( + }), R"doc( Construct a rotation matrix by **copying** a 2D numpy array. This numpy array should be of dimensions :math:`3 \times 3` and be a valid rotation matrix. If it is not a rotation matrix, an exception will be raised. @@ -232,7 +262,6 @@ If it is not a rotation matrix, an exception will be raised. void bindings_vpHomogeneousMatrix(py::class_> &pyHomogeneousMatrix) { - pyHomogeneousMatrix.def_buffer(get_buffer_info); pyHomogeneousMatrix.def("numpy", [](vpHomogeneousMatrix &self) -> np_array_cf { return py::cast(self).cast>(); @@ -247,7 +276,7 @@ void bindings_vpHomogeneousMatrix(py::class_>, vpHomogeneousMatrix, double>(pyHomogeneousMatrix); } - #endif diff --git a/modules/python/bindings/include/core/images.hpp b/modules/python/bindings/include/core/images.hpp index 2f84532f0a..c6ed856a3f 100644 --- a/modules/python/bindings/include/core/images.hpp +++ b/modules/python/bindings/include/core/images.hpp @@ -1,14 +1,45 @@ +/* + * 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: + * Python bindings. + */ + #ifndef VISP_PYTHON_CORE_IMAGES_HPP #define VISP_PYTHON_CORE_IMAGES_HPP - #include #include - /* - vpImage -*/ + * vpImage + */ template typename std::enable_if::value, void>::type bindings_vpImage(py::class_> &pyImage) @@ -26,7 +57,7 @@ bindings_vpImage(py::class_> &pyImage) vpImage result(shape[0], shape[1]); copy_data_from_np(np_array, result.bitmap); return result; - }), R"doc( + }), R"doc( Construct an image by **copying** a 2D numpy array. :param np_array: The numpy array to copy. @@ -55,7 +86,7 @@ bindings_vpImage(py::class_> &pyImage) vpImage result(shape[0], shape[1]); copy_data_from_np(np_array, (unsigned char *)result.bitmap); return result; - }), R"doc( + }), R"doc( Construct an image by **copying** a 3D numpy array. this numpy array should be of the form :math:`H \times W \times 4` where the 4 denotes the red, green, blue and alpha components of the image. @@ -74,6 +105,4 @@ bindings_vpImage(py::class_> &pyImage) }); } - - #endif diff --git a/modules/python/bindings/include/core/pixel_meter.hpp b/modules/python/bindings/include/core/pixel_meter.hpp index 1610fbe673..51b26078a1 100644 --- a/modules/python/bindings/include/core/pixel_meter.hpp +++ b/modules/python/bindings/include/core/pixel_meter.hpp @@ -1,7 +1,39 @@ +/* + * 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: + * Python bindings. + */ + #ifndef VISP_PYTHON_CORE_PIXEL_METER_HPP #define VISP_PYTHON_CORE_PIXEL_METER_HPP - #include #include #include @@ -13,7 +45,6 @@ void bindings_vpPixelMeterConversion(py::class_ &pyPM) { - pyPM.def_static("convertPoints", [](const vpCameraParameters &cam, const py::array_t &us, const py::array_t &vs) { py::buffer_info bufu = us.request(), bufv = vs.request(); if (bufu.ndim != bufv.ndim || bufu.shape != bufv.shape) { @@ -34,7 +65,6 @@ void bindings_vpPixelMeterConversion(py::class_ &pyPM) vpPixelMeterConversion::convertPoint(cam, u_ptr[i], v_ptr[i], x_ptr[i], y_ptr[i]); } - return std::make_tuple(std::move(xs), std::move(ys)); }, R"doc( @@ -48,10 +78,8 @@ Convert a set of 2D pixel coordinates to normalized coordinates. :return: A tuple containing the x and y normalized coordinates of the input pixels. )doc", py::arg("cam"), py::arg("us"), py::arg("vs")); - } - void bindings_vpMeterPixelConversion(py::class_ &pyMP) { pyMP.def_static("convertPoints", [](const vpCameraParameters &cam, const py::array_t &xs, const py::array_t &ys) { @@ -74,7 +102,6 @@ void bindings_vpMeterPixelConversion(py::class_ &pyMP) vpMeterPixelConversion::convertPoint(cam, x_ptr[i], y_ptr[i], u_ptr[i], v_ptr[i]); } - return std::make_tuple(std::move(us), std::move(vs)); }, R"doc( @@ -88,9 +115,6 @@ Convert a set of 2D normalized coordinates to pixel coordinates. :return: A tuple containing the u,v pixel coordinates of the input normalized coordinates. )doc", py::arg("cam"), py::arg("xs"), py::arg("ys")); - } - - #endif diff --git a/modules/python/bindings/include/core/utils.hpp b/modules/python/bindings/include/core/utils.hpp index 7179dfb20c..3bb413bdf0 100644 --- a/modules/python/bindings/include/core/utils.hpp +++ b/modules/python/bindings/include/core/utils.hpp @@ -1,5 +1,39 @@ +/* + * 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: + * Python bindings. + */ + #ifndef VISP_PYTHON_CORE_UTILS_HPP #define VISP_PYTHON_CORE_UTILS_HPP + #include #include @@ -13,8 +47,8 @@ template using np_array_cf = py::array_t; /* -Create a buffer info for a row major array -*/ + * Create a buffer info for a row major array + */ template py::buffer_info make_array_buffer(T *data, std::array dims, bool readonly) { diff --git a/modules/python/bindings/include/mbt.hpp b/modules/python/bindings/include/mbt.hpp index 311d56252c..89ae6eec53 100644 --- a/modules/python/bindings/include/mbt.hpp +++ b/modules/python/bindings/include/mbt.hpp @@ -1,5 +1,39 @@ +/* + * 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: + * Python bindings. + */ + #ifndef VISP_PYTHON_MBT_HPP #define VISP_PYTHON_MBT_HPP + #include #include #include @@ -7,37 +41,34 @@ namespace py = pybind11; - void bindings_vpMbGenericTracker(py::class_ &pyMbGenericTracker) { pyMbGenericTracker.def("track", [](vpMbGenericTracker &self, std::map *> &mapOfImages, std::map> &mapOfPointClouds) { - std::map mapOfWidths, mapOfHeights; - std::map mapOfVectors; - for (const auto &point_cloud_pair: mapOfPointClouds) { - - py::buffer_info buffer = point_cloud_pair.second.request(); - if (buffer.ndim != 3 and buffer.shape[2] != 3) { - std::stringstream ss; - ss << "Pointcloud error: pointcloud at key: " << point_cloud_pair.first << - " should be a 3D numpy array of dimensions H X W x 3"; - throw std::runtime_error(ss.str()); - } - const auto shape = buffer.shape; - mapOfHeights[point_cloud_pair.first] = shape[0]; - mapOfWidths[point_cloud_pair.first] = shape[1]; - vpMatrix pc(shape[0] * shape[1], 3); - const double *data = point_cloud_pair.second.unchecked<3>().data(0, 0, 0); - memcpy(pc.data, data, shape[0] * shape[1] * 3 * sizeof(double)); - mapOfVectors[point_cloud_pair.first] = std::move(pc); - } - std::map mapOfVectorPtrs; - for (const auto &p: mapOfVectors) { - mapOfVectorPtrs[p.first] = &(p.second); - } - self.track(mapOfImages, mapOfVectorPtrs, mapOfWidths, mapOfHeights); - + std::map mapOfWidths, mapOfHeights; + std::map mapOfVectors; + for (const auto &point_cloud_pair: mapOfPointClouds) { + py::buffer_info buffer = point_cloud_pair.second.request(); + if (buffer.ndim != 3 and buffer.shape[2] != 3) { + std::stringstream ss; + ss << "Pointcloud error: pointcloud at key: " << point_cloud_pair.first << + " should be a 3D numpy array of dimensions H X W x 3"; + throw std::runtime_error(ss.str()); + } + const auto shape = buffer.shape; + mapOfHeights[point_cloud_pair.first] = shape[0]; + mapOfWidths[point_cloud_pair.first] = shape[1]; + vpMatrix pc(shape[0] * shape[1], 3); + const double *data = point_cloud_pair.second.unchecked<3>().data(0, 0, 0); + memcpy(pc.data, data, shape[0] * shape[1] * 3 * sizeof(double)); + mapOfVectors[point_cloud_pair.first] = std::move(pc); + } + std::map mapOfVectorPtrs; + for (const auto &p: mapOfVectors) { + mapOfVectorPtrs[p.first] = &(p.second); + } + self.track(mapOfImages, mapOfVectorPtrs, mapOfWidths, mapOfHeights); }); } diff --git a/modules/python/bindings/setup.py.in b/modules/python/bindings/setup.py.in index 7b53cbccf1..8d72984d6d 100644 --- a/modules/python/bindings/setup.py.in +++ b/modules/python/bindings/setup.py.in @@ -1,3 +1,38 @@ +############################################################################# +# +# 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: +# ViSP Python bindings module +# +############################################################################# + import os import re import subprocess diff --git a/modules/python/bindings/visp/__init__.py b/modules/python/bindings/visp/__init__.py index 56f9ac7658..4807a8bea3 100644 --- a/modules/python/bindings/visp/__init__.py +++ b/modules/python/bindings/visp/__init__.py @@ -1,3 +1,37 @@ +############################################################################# +# +# 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: +# ViSP Python bindings module +# +############################################################################# import sys # import os diff --git a/modules/python/bindings/visp/bindings.py b/modules/python/bindings/visp/bindings.py index fd7a58924b..05b61273e7 100644 --- a/modules/python/bindings/visp/bindings.py +++ b/modules/python/bindings/visp/bindings.py @@ -1 +1,36 @@ -from _visp import * \ No newline at end of file +############################################################################# +# +# 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: +# ViSP Python bindings module +# +############################################################################# + +from _visp import * diff --git a/modules/python/docs/conf.py.in b/modules/python/docs/conf.py.in index 2e3077c457..ef41fba344 100644 --- a/modules/python/docs/conf.py.in +++ b/modules/python/docs/conf.py.in @@ -11,7 +11,6 @@ # All configuration values have a default; values that are commented out # serve to show the default. - # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. @@ -64,10 +63,8 @@ nbsphinx_allow_errors = True # Continue through Jupyter errors autodoc_typehints = "both" # Sphinx-native method. Not as good as sphinx_autodoc_typehints add_module_names = False # Remove namespaces from class/method signatures - import visp - # Add any paths that contain templates here, relative to this directory. templates_path = ["_templates"] @@ -337,6 +334,5 @@ texinfo_documents = [ # If true, do not generate a @detailmenu in the "Top" node's menu. # texinfo_no_detailmenu = False - # Example configuration for intersphinx: refer to the Python standard library. intersphinx_mapping = {"python": ("https://docs.python.org/", None)} diff --git a/modules/python/docs/index.rst b/modules/python/docs/index.rst index 2cb49ca2d9..5906330dfa 100644 --- a/modules/python/docs/index.rst +++ b/modules/python/docs/index.rst @@ -14,8 +14,6 @@ Todos and known issues todos.rst api.rst - - .. Core module .. ============== diff --git a/modules/python/docs/todos.rst b/modules/python/docs/todos.rst index 8a579269af..d1c00348ce 100644 --- a/modules/python/docs/todos.rst +++ b/modules/python/docs/todos.rst @@ -8,7 +8,6 @@ Changes to ViSP * Write initTracking for vpKltOpencv taking a vpImage as input. Ignore setInitialGuess. - Code generation ------------------- @@ -59,14 +58,18 @@ To be written: * If you have this error: error: invalid new-expression of abstract class type ‘vpTemplateTrackerMI’ return new Class{std::forward(args)...}; - In file included from /home/sfelton/software/visp_build/modules/python/bindings/src/tt_mi.cpp:13:0: - /home/sfelton/software/visp-sfelton/modules/tracker/tt_mi/include/visp3/tt_mi/vpTemplateTrackerMI.h:46:19: note: because the following virtual functions are pure within ‘vpTemplateTrackerMI’: + In file included from /home/visp_ws/visp_build/modules/python/bindings/src/tt_mi.cpp:13:0: + /home/visp_ws/visp/modules/tracker/tt_mi/include/visp3/tt_mi/vpTemplateTrackerMI.h:46:19: note: because the following virtual functions are pure within ‘vpTemplateTrackerMI’: class VISP_EXPORT vpTemplateTrackerMI : public vpTemplateTracker - You should define the class (here vpTemplaterMI) as pure virtual in the config file (via the flag is_virtual) - This error occurs because some methods are defined as pure virtual in a parent class and are not defined in the class this class: Pure virtual class detection does not look in the class hierarchy but only at the present class + You should define the class (here vpTemplaterMI) as pure virtual in the config file (via the flag is_virtual). + This error occurs because some methods are defined as pure virtual in a parent class and are not defined in the class this class: Pure virtual class detection does not look in the class hierarchy but only at the present class. +Packaging +------------------ +* Root CMake + * Build after doc if doc can be generated Python side ----------------- diff --git a/modules/python/examples/realsense_mbt.py b/modules/python/examples/realsense_mbt.py index 7da5380ef6..f5a951dcd0 100644 --- a/modules/python/examples/realsense_mbt.py +++ b/modules/python/examples/realsense_mbt.py @@ -1,3 +1,38 @@ +############################################################################# +# +# 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: +# ViSP Python bindings example +# +############################################################################# + import argparse from dataclasses import dataclass from pathlib import Path diff --git a/modules/python/examples/repro_tp1.py b/modules/python/examples/repro_tp1.py index 0fd0a77988..4f54caa109 100644 --- a/modules/python/examples/repro_tp1.py +++ b/modules/python/examples/repro_tp1.py @@ -1,6 +1,37 @@ -# Copyright 2023 Eric Marchand, Eric.Marchand@irisa.fr -# Fabien Spindler, Fabien.Spindler@inria.fr -# Samuel Felton, Samuel.Felton@inria.fr +############################################################################# +# +# 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: +# ViSP Python bindings example +# +############################################################################# import argparse import numpy as np @@ -14,119 +45,110 @@ from visp.io import ImageIo if __name__ == '__main__': - parser = argparse.ArgumentParser(description='The script corresponding to TP 1.') - parser.add_argument('--use-case', type=int, default=1, dest='use_case', help='Use case value 1, 2 or 3') - parser.add_argument('--data', type=str, required=True, help='Path to data') - - args, unknown_args = parser.parse_known_args() - if unknown_args: - print("The following args are not recognized and will not be used: %s" % unknown_args) - - data_path = Path(args.data) - assert data_path.exists() - print("Use case %s" % args.use_case) - assert 0 < args.use_case < 4, 'use case should be between 1 and 3' - - # Position of the reference in the camera 2 frame - translation = TranslationVector(0, 0, 2) - thetau = ThetaUVector(0, 0, 0) - c2Tw = HomogeneousMatrix(translation, thetau) - print(f'c2Tw = \n{c2Tw}') - - print('-----------------') - c1_cases = [ - HomogeneousMatrix(TranslationVector(-0.1, 0, 2), ThetaUVector(0, 0, 0)), - HomogeneousMatrix(TranslationVector(0, 0, 1.8), ThetaUVector(0, 0, 0)), - HomogeneousMatrix(TranslationVector(0.1, 0, 1.9), ThetaUVector(*[np.radians(5) for _ in range(3)])) - ] - c1Tw = c1_cases[args.use_case - 1] - # Position of the reference in the camera 1 frame - print(f'c1Tw = \n{c1Tw}') - - print('-----------------') - cam = CameraParameters(800, 800, 200, 150) - K = cam.get_K() - - - print(f"cam = \n{cam}\nK =\n {K}") - print('-----------------') - x2 = np.array([ - [273, 166, 1], - [112, 84, 1], - [ 90, 196, 1], - [321, 123, 1], - [206, 7, 1] - ]) - plt.figure() - plt.ion() - - #image1 = image.imread(f"data/I1{args.use_case}.png") - image1, image2 = ImageGray(), ImageGray() - ImageIo.read(image1, str(data_path / f'tp1-I1{args.use_case}.png'), ImageIo.ImageIoBackendType.IO_DEFAULT_BACKEND) - ImageIo.read(image2, str(data_path / f'tp1-I2.png'), ImageIo.ImageIoBackendType.IO_DEFAULT_BACKEND) - - - plt1 = plt.subplot(2,1,1) - plt2 = plt.subplot(2,1,2) - - color = ['r','y','b','g','c','m','y','k'] - - # Get image size - img_rows = image1.getHeight() - img_cols = image1.getWidth() - print(f"Image size: {img_rows} x {img_cols}") - - # BEGIN TO COMPLETE - # Calculate the geometric location of a point x1 as a function of x2 - wTc2 = c2Tw.inverse() - c1Tc2: HomogeneousMatrix = c1Tw * wTc2 - print(f'c1Tc2 = \n {c1Tc2}') - - # Option 1: acces numpy - # c1tc2 = c1Tc2[:3,3:] - # c1Rc2 = c1Tc2[:3,:3] - - c1tc2 = c1Tc2.getTranslationVector() - c1Rc2 = c1Tc2.getRotationMatrix() - - Kinv = cam.get_K_inverse() - - A = c1tc2.skew() * c1Rc2 * Kinv - print("A=", A) - print("Kinv=", Kinv) - - Kinvtranspose = Kinv.transpose() - print("Kinv.t=", Kinvtranspose) - - # Compute fundamental matrix F - # On peut passer une matrice a une fonction numpy - F = np.matmul(Kinvtranspose, A) - print("F=", F) - # END TO COMPLETE - - for i in range(len(x2)): - plt2.plot(x2[i][0], x2[i][1], color[i]+'o') - - # BEGIN TO COMPLETE - # Calculate the geometric location of a point x1 as a function of x2 - De1 = np.matmul(F, x2[i]) - # END TO COMPLETE - - print(De1) - - # BEGIN TO COMPLETE - # Draw geometric location in image 1 - x = np.array([0, img_cols]) - y = np.array([-De1[2]/De1[1],(-De1[2]-img_cols*De1[0])/De1[1]]) - - print('x = ',x) - print('y = ',y) - - plt1.plot(x, y, color=color[i], linewidth=1) - # END TO COMPLETE - - plt1.imshow(image1, cmap='gray') - plt2.imshow(image2, cmap='gray') - - plt.waitforbuttonpress() - plt.show() + parser = argparse.ArgumentParser(description='The script corresponding to TP 1.') + parser.add_argument('--use-case', type=int, default=1, dest='use_case', help='Use case value 1, 2 or 3') + parser.add_argument('--data', type=str, required=True, help='Path to data') + + args, unknown_args = parser.parse_known_args() + if unknown_args: + print("The following args are not recognized and will not be used: %s" % unknown_args) + + data_path = Path(args.data) + assert data_path.exists() + print("Use case %s" % args.use_case) + assert 0 < args.use_case < 4, 'use case should be between 1 and 3' + + # Position of the reference in the camera 2 frame + translation = TranslationVector(0, 0, 2) + thetau = ThetaUVector(0, 0, 0) + c2Tw = HomogeneousMatrix(translation, thetau) + print(f'c2Tw = \n{c2Tw}') + + print('-----------------') + c1_cases = [ + HomogeneousMatrix(TranslationVector(-0.1, 0, 2), ThetaUVector(0, 0, 0)), + HomogeneousMatrix(TranslationVector(0, 0, 1.8), ThetaUVector(0, 0, 0)), + HomogeneousMatrix(TranslationVector(0.1, 0, 1.9), ThetaUVector(*[np.radians(5) for _ in range(3)])) + ] + c1Tw = c1_cases[args.use_case - 1] + # Position of the reference in the camera 1 frame + print(f'c1Tw = \n{c1Tw}') + + print('-----------------') + cam = CameraParameters(800, 800, 200, 150) + K = cam.get_K() + + print(f"cam = \n{cam}\nK =\n {K}") + print('-----------------') + x2 = np.array([ + [273, 166, 1], + [112, 84, 1], + [ 90, 196, 1], + [321, 123, 1], + [206, 7, 1] + ]) + plt.figure() + plt.ion() + + #image1 = image.imread(f"data/I1{args.use_case}.png") + image1, image2 = ImageGray(), ImageGray() + ImageIo.read(image1, str(data_path / f'tp1-I1{args.use_case}.png'), ImageIo.ImageIoBackendType.IO_DEFAULT_BACKEND) + ImageIo.read(image2, str(data_path / f'tp1-I2.png'), ImageIo.ImageIoBackendType.IO_DEFAULT_BACKEND) + + plt1 = plt.subplot(2,1,1) + plt2 = plt.subplot(2,1,2) + + color = ['r','y','b','g','c','m','y','k'] + + # Get image size + img_rows = image1.getHeight() + img_cols = image1.getWidth() + print(f"Image size: {img_rows} x {img_cols}") + + # Calculate the geometric location of a point x1 as a function of x2 + wTc2 = c2Tw.inverse() + c1Tc2: HomogeneousMatrix = c1Tw * wTc2 + print(f'c1Tc2 = \n {c1Tc2}') + + # Option 1: access numpy + # c1tc2 = c1Tc2[:3,3:] + # c1Rc2 = c1Tc2[:3,:3] + + c1tc2 = c1Tc2.getTranslationVector() + c1Rc2 = c1Tc2.getRotationMatrix() + + Kinv = cam.get_K_inverse() + + A = c1tc2.skew() * c1Rc2 * Kinv + print("A=", A) + print("Kinv=", Kinv) + + Kinvtranspose = Kinv.transpose() + print("Kinv.t=", Kinvtranspose) + + # Compute fundamental matrix F + F = np.matmul(Kinvtranspose, A) + print("F=", F) + + for i in range(len(x2)): + plt2.plot(x2[i][0], x2[i][1], color[i]+'o') + + # Calculate the geometric location of a point x1 as a function of x2 + De1 = np.matmul(F, x2[i]) + + print(De1) + + # Draw geometric location in image 1 + x = np.array([0, img_cols]) + y = np.array([-De1[2]/De1[1],(-De1[2]-img_cols*De1[0])/De1[1]]) + + print('x = ',x) + print('y = ',y) + + plt1.plot(x, y, color=color[i], linewidth=1) + + plt1.imshow(image1, cmap='gray') + plt2.imshow(image2, cmap='gray') + + plt.waitforbuttonpress() + plt.show() diff --git a/modules/python/examples/repro_tp2.py b/modules/python/examples/repro_tp2.py index 1f02a69671..3332273382 100644 --- a/modules/python/examples/repro_tp2.py +++ b/modules/python/examples/repro_tp2.py @@ -1,6 +1,37 @@ -# Copyright 2023 Eric Marchand, Eric.Marchand@irisa.fr -# Fabien Spindler, Fabien.Spindler@inria.fr -# Samuel Felton, Samuel.Felton@inria.fr +############################################################################# +# +# 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: +# ViSP Python bindings example +# +############################################################################# import argparse import numpy as np @@ -13,90 +44,87 @@ from visp.core import ImageGray, ImageTools from visp.vision import Homography from visp.io import ImageIo + if __name__ == '__main__': - parser = argparse.ArgumentParser(description='The script corresponding to TP 2.') - parser.add_argument('--data', type=str, required=True, help='Path to data') - args = parser.parse_args() - data_path = Path(args.data) - assert data_path.exists() - image1, image2 = ImageGray(), ImageGray() - ImageIo.read(image1, str(data_path / 'tp2-I1.jpg'), ImageIo.ImageIoBackendType.IO_DEFAULT_BACKEND) - ImageIo.read(image2, str(data_path / 'tp2-I2.jpg'), ImageIo.ImageIoBackendType.IO_DEFAULT_BACKEND) + parser = argparse.ArgumentParser(description='The script corresponding to TP 2.') + parser.add_argument('--data', type=str, required=True, help='Path to data') + args = parser.parse_args() + data_path = Path(args.data) + assert data_path.exists() + image1, image2 = ImageGray(), ImageGray() + ImageIo.read(image1, str(data_path / 'tp2-I1.jpg'), ImageIo.ImageIoBackendType.IO_DEFAULT_BACKEND) + ImageIo.read(image2, str(data_path / 'tp2-I2.jpg'), ImageIo.ImageIoBackendType.IO_DEFAULT_BACKEND) - # Pretty print of numpy arrays - np.set_printoptions(precision=7, suppress=True) + # Pretty print of numpy arrays + np.set_printoptions(precision=7, suppress=True) - plt.figure(figsize=(15,15)) - plt.ion() + plt.figure(figsize=(15,15)) + plt.ion() - plt1 = plt.subplot(2,2,1) - plt2 = plt.subplot(2,2,2) - plt3 = plt.subplot(2,2,4) + plt1 = plt.subplot(2,2,1) + plt2 = plt.subplot(2,2,2) + plt3 = plt.subplot(2,2,4) - plt1.imshow(image1, cmap='gray') - plt2.imshow(image2, cmap='gray') + plt1.imshow(image1, cmap='gray') + plt2.imshow(image2, cmap='gray') - # Coordinates of the 5 points in image 1 - u1 = np.array([ 135.0517282, 464.3374805, 432.1843943, 49.75437317, 298.9792208]) - v1 = np.array([44.30715709, 185.9258178, 422.7760738, 339.1144011, 236.5545455]) + # Coordinates of the 5 points in image 1 + u1 = np.array([ 135.0517282, 464.3374805, 432.1843943, 49.75437317, 298.9792208]) + v1 = np.array([44.30715709, 185.9258178, 422.7760738, 339.1144011, 236.5545455]) - # Coordinates of the 5 points in image 2 - u2 = np.array([ 122.9683498, 453.4691964, 521.5894161, 199.0225322, 336.3672109]) - v2 = np.array([ 126.6271928, 61.28444847, 278.4105839, 388.944206, 198.3472826 ]) + # Coordinates of the 5 points in image 2 + u2 = np.array([ 122.9683498, 453.4691964, 521.5894161, 199.0225322, 336.3672109]) + v2 = np.array([ 126.6271928, 61.28444847, 278.4105839, 388.944206, 198.3472826 ]) - color = ['r','y','b','g','c','m','y','k'] + color = ['r','y','b','g','c','m','y','k'] - for i in range(len(u1)): - plt1.plot(u1[i], v1[i],color[i]+'o') - plt2.plot(u2[i], v2[i],color[i]+'o') + for i in range(len(u1)): + plt1.plot(u1[i], v1[i],color[i]+'o') + plt2.plot(u2[i], v2[i],color[i]+'o') - plt1.text(u1[i]+10, v1[i]-10, i, color=color[i]) - plt2.text(u2[i]+10, v2[i]-10, i, color=color[i]) + plt1.text(u1[i]+10, v1[i]-10, i, color=color[i]) + plt2.text(u2[i]+10, v2[i]-10, i, color=color[i]) - # Compute matrix c2Hc1 such as x2 = c2Hc1 * x1 - c2Hc1 = Homography() - Homography.DLT(u1, v1, u2, v2, c2Hc1, False) + # Compute matrix c2Hc1 such as x2 = c2Hc1 * x1 + c2Hc1 = Homography() + Homography.DLT(u1, v1, u2, v2, c2Hc1, False) - print("c2Hc1= \n", c2Hc1) + print("c2Hc1= \n", c2Hc1) - residual = 0 - for i in range(len(u1)): - print('point ', i) - x1 = np.array([u1[i], v1[i], 1]) - # BEGIN TO COMPLETE - x2 = np.matmul(c2Hc1, x1) - x2 = x2/x2[2] - print("x2 = ", x2) - # END TO COMPLETE + residual = 0 + for i in range(len(u1)): + print('point ', i) + x1 = np.array([u1[i], v1[i], 1]) + x2 = np.matmul(c2Hc1, x1) + x2 = x2/x2[2] + print("x2 = ", x2) - # BEGIN TO COMPLETE - error = np.linalg.norm(np.array([u2[i], v2[i], 1]) - x2) - print("Error for point ", i, ":", error) - # END TO COMPLETE + error = np.linalg.norm(np.array([u2[i], v2[i], 1]) - x2) + print("Error for point ", i, ":", error) - residual += error*error + residual += error*error - plt2.plot(u2[i], v2[i],color[i+1]+'+') - plt2.add_artist(plt.Circle((u2[i], v2[i]), error*100, fill=False, color=color[i+1])) + plt2.plot(u2[i], v2[i],color[i+1]+'+') + plt2.add_artist(plt.Circle((u2[i], v2[i]), error*100, fill=False, color=color[i+1])) - residual = np.sqrt(residual / len(u1)) - print("Mean residual: ", residual) + residual = np.sqrt(residual / len(u1)) + print("Mean residual: ", residual) - h, w = image1.getRows(), image1.getCols() + h, w = image1.getRows(), image1.getCols() - hbl = (int)(1.5*h) - wbl = (int)(1.5*w) - blendedImage = ImageGray(height=hbl, width=wbl, value=0) + hbl = (int)(1.5*h) + wbl = (int)(1.5*w) + blendedImage = ImageGray(height=hbl, width=wbl, value=0) - ImageTools.warpImage(image1, Matrix(c2Hc1), blendedImage, ImageTools.ImageInterpolationType.INTERPOLATION_LINEAR, False, True) + ImageTools.warpImage(image1, Matrix(c2Hc1), blendedImage, ImageTools.ImageInterpolationType.INTERPOLATION_LINEAR, False, True) - plt3.imshow(blendedImage, cmap='gray') + plt3.imshow(blendedImage, cmap='gray') - plt.waitforbuttonpress() - plt.show() + plt.waitforbuttonpress() + plt.show() - # Final homography matrix H21 should be - # c2Hc1= - # [[-0.0040643 -0.0031677 -0.0435478] - # [ 0.0034882 -0.0051718 -0.9989996] - # [ 0.000002 -0.0000017 -0.0061552]] + # Final homography matrix H21 should be + # c2Hc1= + # [[-0.0040643 -0.0031677 -0.0435478] + # [ 0.0034882 -0.0051718 -0.9989996] + # [ 0.000002 -0.0000017 -0.0061552]] diff --git a/modules/python/examples/repro_tp3.py b/modules/python/examples/repro_tp3.py index 1e59aaddd2..d0b977f4b0 100644 --- a/modules/python/examples/repro_tp3.py +++ b/modules/python/examples/repro_tp3.py @@ -1,6 +1,37 @@ -# Copyright 2023 Eric Marchand, Eric.Marchand@irisa.fr -# Fabien Spindler, Fabien.Spindler@inria.fr -# Samuel Felton, Samuel.Felton@inria.fr +############################################################################# +# +# 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: +# ViSP Python bindings example +# +############################################################################# import argparse import numpy as np @@ -15,171 +46,164 @@ from visp.io import ImageIo if __name__ == '__main__': - parser = argparse.ArgumentParser(description='The script corresponding to TP 2.') - parser.add_argument('--data', type=str, required=True, help='Path to data') - args = parser.parse_args() - data_path = Path(args.data) - assert data_path.exists() - image1, image2 = ImageGray(), ImageGray() - ImageIo.read(image1, str(data_path / 'tp3-I1.jpg'), ImageIo.ImageIoBackendType.IO_DEFAULT_BACKEND) - ImageIo.read(image2, str(data_path / 'tp3-I2.jpg'), ImageIo.ImageIoBackendType.IO_DEFAULT_BACKEND) - # Pretty print of numpy arrays - np.set_printoptions(precision=7, suppress=True) - - plt.figure(figsize=(15,15)) - plt.ion() - - plt1 = plt.subplot(2, 2, 1) # Image 1 - plt2 = plt.subplot(2, 2, 2) # Image 2 - plt3 = plt.subplot(212) # Image 1 besides Image 2 - - plt1.imshow(image1, cmap='gray') - plt2.imshow(image2, cmap='gray') - - # Utilisation transparent d'image visp dans une fonction numpy! - imageAppariement = np.hstack((image1, image2)) - plt3.imshow(imageAppariement, interpolation='bilinear', cmap='gray') - - # Matrix of coordinates of the points in image - # (u1,v1) are in image1 and (u2,v2) in image2 - point = np.array( - [ # u1, v1, u2, v2 - [117.5130997, 62.34123611, 202.841095, 36.29648209], - [84.06044006, 67.55551147, 169.5350189, 26.80556679], - [80.27194214, 111.0672302, 147.9641113, 64.5475769], - [342.6855164, 199.8661346, 63.4621048, 68.28819275], - [302.6676636, 226.6687317, 300.4017639, 263.6835022], - [101.5870972, 63.0242424, 187.8421478, 29.56011963], - [153.4119415, 91.05652618, 222.968277, 77.2434845], - [190.6780548, 110.7231598, 247.8312683, 110.4263763], - [302.8087463, 133.9337616, 339.9194641, 178.880661], - [162.7279968, 276.4970398, 152.7050171, 248.9367065], - [151.0850067, 36.12360764, 244.672287, 25.44586563], - [171.7740173, 53.67162704, 256.0083618, 49.99362183], - [116.7895355, 74.19098663, 196.8202972, 45.97808456], - [104.2023163, 83.85998535, 181.4200439, 50.26084518], - [84.71365356, 190.8507233, 300.4017639, 263.6835022], - [138.8526764, 273.5761719, 131.6974182, 236.8515778], - [167.2081451, 96.59983063, 233.1238556, 88.96112061], - ] - ) - - # Plot corresponding points - # u1 = point[:,0] - # v1 = point[:,1] - # u2 = point[:,2] - # v2 = point[:,3] - # ViSP Image point format - ip1 = [ - ImagePoint(vv1, uu1) for vv1, uu1 in zip(point[:, 1], point[:, 0]) - ] - ip2 = [ - ImagePoint(vv2, uu2) for vv2, uu2 in zip(point[:, 3], point[:, 2]) - ] - u1s, v1s = np.asarray([p1.get_u() for p1 in ip1]), np.asarray([p1.get_v() for p1 in ip1]) - u2s, v2s = np.asarray([p2.get_u() for p2 in ip2]), np.asarray([p2.get_v() for p2 in ip2]) - - - print(f'Points in image 1: {ip1}') - print(f'Points in image 2: {ip2}') - - # Get image size - img_rows = image1.getHeight() - img_cols = image1.getWidth() - print("Image size:", img_cols, "x", img_rows) - - # Total number of points - nbPoints = len(ip1) - plt1.plot(u1s, v1s, 'r+') - plt2.plot(u2s, v2s, 'r+') - - - - - - # Plot lines between matches - for i, (p1, p2) in enumerate(zip(ip1, ip2)): - u1, v1 = p1.get_u(), p1.get_v() - u2, v2 = p2.get_u(), p2.get_v() - x = np.array([u1, u2 + img_cols]) - y = np.array([v1, v2]) - x = np.array([u1, u2 + img_cols]) - y = np.array([v1, v2]) - plt3.plot(x, y, linewidth=1) - - plt1.text(u1+3, v1-3, i, color='red') - plt2.text(u2+3, v2-3, i, color='red') - plt3.text(u1+3, v1-3, i, color='red') - plt3.text(u2+img_cols-3, v2-3, i, color='red') - - # Compute homography c2Hc1 such as x2 = c2Hc1 * x1 without RANSAC - c2Hc1 = Homography() - Homography.DLT(u1s, v1s, u2s, v2s, c2Hc1, False) - - print("c2Hc1= \n", c2Hc1) - - for i in range(nbPoints): - print('point',i) - x1 = ColVector(np.array([u1s[i], v1s[i], 1])) - x2 = c2Hc1 * x1 - x2 = x2/x2[2] - print(type(x2)) - print("x2 = ", x2) - error = (x2 - ColVector([u2s[i], v2s[i], 1])).frobeniusNorm() - print("error = ", error) - - plt2.plot(u2s[i], v2s[i],'+') - plt2.add_artist(plt.Circle((u2s[i], v2s[i]), error, fill=False, color='g')) - - print("Use a mouse click to continue..") - plt.waitforbuttonpress() - - # Erase image 2 and circle drawings - plt2.cla() - plt2.imshow(image2, cmap='gray') - - # Threshold to detect outliers - seuilOutlier = 10 - - indexInliers = np.zeros(nbPoints) - inliers = [False for _ in range(len(u1s))] - residual = 0.0 # TODO: this should be returned - succeeded, inliers, residual = Homography.ransac(u1s, v1s, u2s, v2s, c2Hc1, [], 0.0, 15, seuilOutlier, False) - # Ideally we have: - # succeeded, c2Hc1, inliers, residual = Homography.ransac(u1, v1, u2, v2, 12, seuilOutlier, False) - # Could automatically generate - # succeeded, c2Hc1, inliers, redisual = Homography.ransac(u1, v1, u2, v2, c2Hc1, inliers, residual, 12, seuilOutlier, False) - - print('Inliers = ', inliers) - print('Residual = ', residual) - # Compute the homography with all inliers - u1r = u1s[inliers] - v1r = v1s[inliers] - u2r = u2s[inliers] - v2r = v2s[inliers] - - print('Inliers = ', u1r, v1r, u2r, v2r) - - - # Compute the error for all the points - for j in range(nbPoints): - # BEGIN TO COMPLETE - # Compute the position of (u2',v2') function of (u1,v1) - x1 = np.array([u1s[j], v1s[j], 1]) - x2 = np.matmul(c2Hc1,x1) - x2 = x2/x2[2] - - # Compute the error between (u2',v2') and (u2,v2) - error = np.linalg.norm(np.array([u2s[j], v2s[j], 1]) - x2) - print("error[",j,"] = ", error) - # END TO COMPLETE - - if error < seuilOutlier: - plt2.plot(x2[0], x2[1],'g+') - plt2.add_artist(plt.Circle((x2[0], x2[1]), error*10, fill=False, color='g')) - else: - plt2.plot(x2[0], x2[1],'r+') - plt2.add_artist(plt.Circle((x2[0], x2[1]), error, fill=False, color='r')) - - plt.waitforbuttonpress() - plt.show() + parser = argparse.ArgumentParser(description='The script corresponding to TP 2.') + parser.add_argument('--data', type=str, required=True, help='Path to data') + args = parser.parse_args() + data_path = Path(args.data) + assert data_path.exists() + image1, image2 = ImageGray(), ImageGray() + ImageIo.read(image1, str(data_path / 'tp3-I1.jpg'), ImageIo.ImageIoBackendType.IO_DEFAULT_BACKEND) + ImageIo.read(image2, str(data_path / 'tp3-I2.jpg'), ImageIo.ImageIoBackendType.IO_DEFAULT_BACKEND) + # Pretty print of numpy arrays + np.set_printoptions(precision=7, suppress=True) + + plt.figure(figsize=(15,15)) + plt.ion() + + plt1 = plt.subplot(2, 2, 1) # Image 1 + plt2 = plt.subplot(2, 2, 2) # Image 2 + plt3 = plt.subplot(212) # Image 1 besides Image 2 + + plt1.imshow(image1, cmap='gray') + plt2.imshow(image2, cmap='gray') + + # Transparent use of a visp image in a numpy function! + imageAppariement = np.hstack((image1, image2)) + plt3.imshow(imageAppariement, interpolation='bilinear', cmap='gray') + + # Matrix of coordinates of the points in image + # (u1,v1) are in image1 and (u2,v2) in image2 + point = np.array( + [ # u1, v1, u2, v2 + [117.5130997, 62.34123611, 202.841095, 36.29648209], + [84.06044006, 67.55551147, 169.5350189, 26.80556679], + [80.27194214, 111.0672302, 147.9641113, 64.5475769], + [342.6855164, 199.8661346, 63.4621048, 68.28819275], + [302.6676636, 226.6687317, 300.4017639, 263.6835022], + [101.5870972, 63.0242424, 187.8421478, 29.56011963], + [153.4119415, 91.05652618, 222.968277, 77.2434845], + [190.6780548, 110.7231598, 247.8312683, 110.4263763], + [302.8087463, 133.9337616, 339.9194641, 178.880661], + [162.7279968, 276.4970398, 152.7050171, 248.9367065], + [151.0850067, 36.12360764, 244.672287, 25.44586563], + [171.7740173, 53.67162704, 256.0083618, 49.99362183], + [116.7895355, 74.19098663, 196.8202972, 45.97808456], + [104.2023163, 83.85998535, 181.4200439, 50.26084518], + [84.71365356, 190.8507233, 300.4017639, 263.6835022], + [138.8526764, 273.5761719, 131.6974182, 236.8515778], + [167.2081451, 96.59983063, 233.1238556, 88.96112061], + ] + ) + + # Plot corresponding points + # u1 = point[:,0] + # v1 = point[:,1] + # u2 = point[:,2] + # v2 = point[:,3] + # ViSP Image point format + ip1 = [ + ImagePoint(vv1, uu1) for vv1, uu1 in zip(point[:, 1], point[:, 0]) + ] + ip2 = [ + ImagePoint(vv2, uu2) for vv2, uu2 in zip(point[:, 3], point[:, 2]) + ] + u1s, v1s = np.asarray([p1.get_u() for p1 in ip1]), np.asarray([p1.get_v() for p1 in ip1]) + u2s, v2s = np.asarray([p2.get_u() for p2 in ip2]), np.asarray([p2.get_v() for p2 in ip2]) + + + print(f'Points in image 1: {ip1}') + print(f'Points in image 2: {ip2}') + + # Get image size + img_rows = image1.getHeight() + img_cols = image1.getWidth() + print("Image size:", img_cols, "x", img_rows) + + # Total number of points + nbPoints = len(ip1) + plt1.plot(u1s, v1s, 'r+') + plt2.plot(u2s, v2s, 'r+') + + # Plot lines between matches + for i, (p1, p2) in enumerate(zip(ip1, ip2)): + u1, v1 = p1.get_u(), p1.get_v() + u2, v2 = p2.get_u(), p2.get_v() + x = np.array([u1, u2 + img_cols]) + y = np.array([v1, v2]) + x = np.array([u1, u2 + img_cols]) + y = np.array([v1, v2]) + plt3.plot(x, y, linewidth=1) + + plt1.text(u1+3, v1-3, i, color='red') + plt2.text(u2+3, v2-3, i, color='red') + plt3.text(u1+3, v1-3, i, color='red') + plt3.text(u2+img_cols-3, v2-3, i, color='red') + + # Compute homography c2Hc1 such as x2 = c2Hc1 * x1 without RANSAC + c2Hc1 = Homography() + Homography.DLT(u1s, v1s, u2s, v2s, c2Hc1, False) + + print("c2Hc1= \n", c2Hc1) + + for i in range(nbPoints): + print('point',i) + x1 = ColVector(np.array([u1s[i], v1s[i], 1])) + x2 = c2Hc1 * x1 + x2 = x2/x2[2] + print(type(x2)) + print("x2 = ", x2) + error = (x2 - ColVector([u2s[i], v2s[i], 1])).frobeniusNorm() + print("error = ", error) + + plt2.plot(u2s[i], v2s[i],'+') + plt2.add_artist(plt.Circle((u2s[i], v2s[i]), error, fill=False, color='g')) + + print("Use a mouse click to continue..") + plt.waitforbuttonpress() + + # Erase image 2 and circle drawings + plt2.cla() + plt2.imshow(image2, cmap='gray') + + # Threshold to detect outliers + seuilOutlier = 10 + + indexInliers = np.zeros(nbPoints) + inliers = [False for _ in range(len(u1s))] + residual = 0.0 # TODO: this should be returned + succeeded, inliers, residual = Homography.ransac(u1s, v1s, u2s, v2s, c2Hc1, [], 0.0, 15, seuilOutlier, False) + # Ideally we have: + # succeeded, c2Hc1, inliers, residual = Homography.ransac(u1, v1, u2, v2, 12, seuilOutlier, False) + # Could automatically generate + # succeeded, c2Hc1, inliers, redisual = Homography.ransac(u1, v1, u2, v2, c2Hc1, inliers, residual, 12, seuilOutlier, False) + + print('Inliers = ', inliers) + print('Residual = ', residual) + # Compute the homography with all inliers + u1r = u1s[inliers] + v1r = v1s[inliers] + u2r = u2s[inliers] + v2r = v2s[inliers] + + print('Inliers = ', u1r, v1r, u2r, v2r) + + # Compute the error for all the points + for j in range(nbPoints): + # Compute the position of (u2',v2') function of (u1,v1) + x1 = np.array([u1s[j], v1s[j], 1]) + x2 = np.matmul(c2Hc1,x1) + x2 = x2/x2[2] + + # Compute the error between (u2',v2') and (u2,v2) + error = np.linalg.norm(np.array([u2s[j], v2s[j], 1]) - x2) + print("error[",j,"] = ", error) + + if error < seuilOutlier: + plt2.plot(x2[0], x2[1],'g+') + plt2.add_artist(plt.Circle((x2[0], x2[1]), error*10, fill=False, color='g')) + else: + plt2.plot(x2[0], x2[1],'r+') + plt2.add_artist(plt.Circle((x2[0], x2[1]), error, fill=False, color='r')) + + plt.waitforbuttonpress() + plt.show() diff --git a/modules/python/examples/synthetic_data_mbt.py b/modules/python/examples/synthetic_data_mbt.py index e1fbcb506e..0d49bfcbfa 100644 --- a/modules/python/examples/synthetic_data_mbt.py +++ b/modules/python/examples/synthetic_data_mbt.py @@ -1,3 +1,38 @@ +############################################################################# +# +# 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: +# ViSP Python bindings example +# +############################################################################# + import argparse from dataclasses import dataclass from pathlib import Path @@ -7,7 +42,6 @@ import faulthandler faulthandler.enable() - from visp.core import XmlParserCamera, CameraParameters, ColVector, HomogeneousMatrix, Display, ImageConvert from visp.core import ImageGray, ImageUInt16 from visp.io import ImageIo @@ -63,9 +97,6 @@ class FrameData: point_cloud: Optional[np.ndarray] cMo_ground_truth: HomogeneousMatrix - - - def read_data(exp_config: MBTConfig, cam_depth: CameraParameters | None, I: ImageGray): color_format = '{:04d}_L.jpg' depth_format = 'Image{:04d}_R.exr' @@ -115,8 +146,6 @@ def read_data(exp_config: MBTConfig, cam_depth: CameraParameters | None, I: Imag print(f'Data parsing took: {(end_parse_time - start_parse_time) * 1000}ms') yield FrameData(I, I_depth_raw, point_cloud, cMo_ground_truth) - - def parse_camera_file(exp_config: MBTConfig, is_color: bool) -> CameraParameters: cam = CameraParameters() xml_parser = XmlParserCamera() @@ -139,7 +168,6 @@ def parse_camera_file(exp_config: MBTConfig, is_color: bool) -> CameraParameters parser.add_argument('--step-by-step', action='store_true') parser.add_argument('--init-ground-truth', action='store_true') - args = parser.parse_args() data_root = Path(args.data_root) diff --git a/modules/python/generator/visp_python_bindgen/doc_parser.py b/modules/python/generator/visp_python_bindgen/doc_parser.py index e0f39a555a..9a92ee69f1 100644 --- a/modules/python/generator/visp_python_bindgen/doc_parser.py +++ b/modules/python/generator/visp_python_bindgen/doc_parser.py @@ -1,3 +1,38 @@ +############################################################################# +# +# 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: +# ViSP Python bindings generator +# +############################################################################# + import_failed = False from typing import Dict, List, Optional, Tuple from dataclasses import dataclass @@ -83,7 +118,6 @@ class DocElements(object): compounddefs: Dict[str, compounddefType] methods: Dict[Tuple[str, MethodDocSignature], List[doxmlparser.memberdefType]] - IGNORED_MIXED_CONTAINERS = [ 'parameterlist' @@ -131,7 +165,6 @@ def process_mixed_container(container: MixedContainer, level: int, level_string= url_value = url.url return level_string + (' ' if requires_space else '') + f'`{text} <{url_value}>`_ ' - if container.name == 'formula': v: str = container.value.valueOf_.strip() if v.startswith(('\\[', '$$')): @@ -175,7 +208,6 @@ def process_mixed_container(container: MixedContainer, level: int, level_string= item_content = '\n'.join(map(process_fn, blockquote.para)) return level_string + item_content + '\n' - if container.name == 'programlisting': program: doxmlparser.listingType = container.value codelines: List[doxmlparser.codelineType] = program.codeline @@ -195,7 +227,6 @@ def process_mixed_container(container: MixedContainer, level: int, level_string= res += code + '\n\n' return level_string + res - if container.name == 'itemizedlist': items: List[doxmlparser.docListItemType] = container.value.listitem res = '\n' diff --git a/modules/python/generator/visp_python_bindgen/enum_binding.py b/modules/python/generator/visp_python_bindgen/enum_binding.py index adef7555bd..86eb68f137 100644 --- a/modules/python/generator/visp_python_bindgen/enum_binding.py +++ b/modules/python/generator/visp_python_bindgen/enum_binding.py @@ -1,3 +1,38 @@ +############################################################################# +# +# 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: +# ViSP Python bindings generator +# +############################################################################# + from typing import List, Optional, Tuple, Dict, Union from dataclasses import dataclass @@ -12,7 +47,6 @@ if TYPE_CHECKING: from visp_python_bindgen.header import SingleObjectBindings - @dataclass class EnumRepr: ''' @@ -23,7 +57,6 @@ class EnumRepr: values: Optional[List[types.Enumerator]] # The values of the enumeration public_access: bool = True # Whether this enum is visible from outside the header file - def is_typedef_to_enum(typedef: types.Typedef): ''' Check whether a typedef refers to an enum @@ -34,7 +67,6 @@ def is_typedef_to_enum(typedef: types.Typedef): return False return True - def is_anonymous_name(typename: types.PQName) -> Tuple[bool, int]: ''' Check whether the name is anonymous. If it is, then the actual name is defined in a typedef. @@ -44,7 +76,6 @@ def is_anonymous_name(typename: types.PQName) -> Tuple[bool, int]: return True, segment.id return False, None - def get_owner_py_ident(owner_name: str, root_scope: NamespaceScope) -> Optional[str]: ''' Get the the owner's identifier (variable in generated code). @@ -57,8 +88,6 @@ def get_owner_py_ident(owner_name: str, root_scope: NamespaceScope) -> Optional[ return f'py{get_name(scope.class_decl.typename).replace("vp", "")}' #TODO: fix for custom names - - def get_cpp_identifier_scope(fully_qualified_name: str, root_scope: Union[NamespaceScope, ClassScope]) -> Union[NamespaceScope, ClassScope]: if fully_qualified_name == '': return root_scope @@ -143,7 +172,6 @@ def accumulate_data(scope: Union[NamespaceScope, ClassScope]): accumulate_data(root_scope) return final_data, temp_data - def get_enum_bindings(root_scope: NamespaceScope, mapping: Dict, submodule: Submodule) -> List[SingleObjectBindings]: final_data, filtered_reprs = resolve_enums_and_typedefs(root_scope, mapping) diff --git a/modules/python/generator/visp_python_bindgen/gen_report.py b/modules/python/generator/visp_python_bindgen/gen_report.py index a5144a3677..6fd4c6a32c 100644 --- a/modules/python/generator/visp_python_bindgen/gen_report.py +++ b/modules/python/generator/visp_python_bindgen/gen_report.py @@ -1,3 +1,38 @@ +############################################################################# +# +# 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: +# ViSP Python bindings generator +# +############################################################################# + from typing import List, Dict from pathlib import Path import json @@ -75,8 +110,6 @@ def write(self, path: Path) -> None: f'Ignored classes: {len(self.result["classes"].keys())}', f'Not generated methods: {len(self.result["methods"].keys())}', f'Method with default parameter policy: {len(self.result["default_param_policy_methods"])}', - - ] print('\n\t'.join(stats)) with open(path, 'w') as report_file: diff --git a/modules/python/generator/visp_python_bindgen/generator.py b/modules/python/generator/visp_python_bindgen/generator.py index 174b0b9233..1efff6ac82 100644 --- a/modules/python/generator/visp_python_bindgen/generator.py +++ b/modules/python/generator/visp_python_bindgen/generator.py @@ -1,3 +1,38 @@ +############################################################################# +# +# 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: +# ViSP Python bindings generator +# +############################################################################# + from typing import List import sys from pathlib import Path @@ -67,7 +102,6 @@ def generate_module(generate_path: Path, config_path: Path) -> None: raise RuntimeError('There was an exception when processing headers: You should either ignore the faulty header/class, or fix the generator code!') new_all_headers.append(result) - # Sort headers according to the dependencies. This is done across all modules. # TODO: sort module generation order. For now this works but it's fairly brittle new_all_headers = sort_headers(new_all_headers) diff --git a/modules/python/generator/visp_python_bindgen/generator_config.py b/modules/python/generator/visp_python_bindgen/generator_config.py index de21315b4a..24a8786d9d 100644 --- a/modules/python/generator/visp_python_bindgen/generator_config.py +++ b/modules/python/generator/visp_python_bindgen/generator_config.py @@ -1,3 +1,37 @@ +############################################################################# +# +# 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: +# ViSP Python bindings generator +# +############################################################################# from typing import Dict, Final, List, Optional import re @@ -5,14 +39,12 @@ from dataclasses import dataclass import json - @dataclass class ModuleInputData(object): name: str headers: List[Path] dependencies: List[str] - @dataclass class PreprocessorConfig(object): ''' @@ -79,7 +111,6 @@ def to_pcpp_args_list(self) -> List[str]: '^operator.*', '^ignored$' ] - class GeneratorConfig(object): pcpp_config: Final[PreprocessorConfig] = PreprocessorConfig( defines={ @@ -111,12 +142,10 @@ def _matches_regex_in_list(s: str, regexes: List[str]) -> bool: def is_immutable_type(type: str) -> bool: return GeneratorConfig._matches_regex_in_list(type, IMMUTABLE_TYPES_REGEXS) - @staticmethod def is_immutable_container(type: str) -> bool: return GeneratorConfig._matches_regex_in_list(type, IMMUTABLE_CONTAINERS_REGEXS) - @staticmethod def is_forbidden_default_argument_type(type: str) -> bool: return GeneratorConfig._matches_regex_in_list(type, FORBIDDEN_DEFAULT_ARGUMENT_TYPES_REGEXS) diff --git a/modules/python/generator/visp_python_bindgen/header.py b/modules/python/generator/visp_python_bindgen/header.py index 8dc28c7047..206aa9c910 100644 --- a/modules/python/generator/visp_python_bindgen/header.py +++ b/modules/python/generator/visp_python_bindgen/header.py @@ -1,3 +1,38 @@ +############################################################################# +# +# 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: +# ViSP Python bindings generator +# +############################################################################# + from typing import List, Optional, Dict from pathlib import Path from dataclasses import dataclass @@ -17,8 +52,6 @@ if TYPE_CHECKING: from submodule import Submodule - - class HeaderFile(): def __init__(self, path: Path, submodule: 'Submodule'): self.path = path @@ -188,7 +221,6 @@ def parse_sub_namespace(self, bindings_container: BindingsContainer, ns: Namespa for sub_ns in ns.namespaces: self.parse_sub_namespace(bindings_container, ns.namespaces[sub_ns], namespace_prefix + sub_ns + '::', False) - def generate_class(self, bindings_container: BindingsContainer, cls: ClassScope, header_env: HeaderEnvironment) -> SingleObjectBindings: def generate_class_with_potiental_specialization(name_python: str, owner_specs: OrderedDict[str, str], cls_config: Dict) -> str: python_ident = f'py{name_python}' @@ -279,13 +311,11 @@ def add_to_method_dict(key, value): add_to_method_dict('__init__', MethodBinding(ctor_str, is_static=False, is_lambda=False, is_operator=False, is_constructor=True)) - # Operator definitions binary_return_ops = supported_const_return_binary_op_map() binary_in_place_ops = supported_in_place_binary_op_map() unary_return_ops = supported_const_return_unary_op_map() - for method, method_config in operators: method_name = get_name(method.name) method_is_const = method.const @@ -401,7 +431,6 @@ def add_to_method_dict(key, value): is_static=False, is_lambda=False, is_operator=False, is_constructor=False)) - # Check for potential error-generating definitions error_generating_overloads = get_static_and_instance_overloads(generated_methods) if len(error_generating_overloads) > 0: diff --git a/modules/python/generator/visp_python_bindgen/header_utils.py b/modules/python/generator/visp_python_bindgen/header_utils.py index cc4275d20e..468517028e 100644 --- a/modules/python/generator/visp_python_bindgen/header_utils.py +++ b/modules/python/generator/visp_python_bindgen/header_utils.py @@ -1,3 +1,38 @@ +############################################################################# +# +# 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: +# ViSP Python bindings generator +# +############################################################################# + from typing import List, Set, Dict, Union import sys @@ -98,7 +133,6 @@ def build_naive_mapping(self, data: Union[NamespaceScope, ClassScope], mapping, mapping.update(self.build_naive_mapping(cls, mapping=mapping, scope=f'{scope}{cls_name}::')) return mapping - def update_with_dependencies(self, other_envs: List['HeaderEnvironment']) -> None: for env in other_envs: self.mapping.update(env) diff --git a/modules/python/generator/visp_python_bindgen/methods.py b/modules/python/generator/visp_python_bindgen/methods.py index 99e3c7d614..e7b11bdfcc 100644 --- a/modules/python/generator/visp_python_bindgen/methods.py +++ b/modules/python/generator/visp_python_bindgen/methods.py @@ -1,3 +1,38 @@ +############################################################################# +# +# 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: +# ViSP Python bindings generator +# +############################################################################# + from typing import Any, Callable, List, Optional, Tuple, Dict from enum import Enum from dataclasses import dataclass @@ -14,9 +49,6 @@ from visp_python_bindgen.submodule import Submodule from visp_python_bindgen.header import HeaderFile, HeaderEnvironment, BoundObjectNames - - - def cpp_operator_list(): ''' List of cpp methods that are considered operators. @@ -118,7 +150,6 @@ def method_def(py_name: str, method: str, additional_args: List[str], static: bo def tokens_to_str(tokens: List[types.Token]) -> str: return ''.join([token.value for token in tokens]) - def parameter_can_have_default_value(parameter: types.Parameter, specs, env_mapping) -> bool: ''' Return whether an argument can have a default value. @@ -142,7 +173,6 @@ def parameter_can_have_default_value(parameter: types.Parameter, specs, env_mapp if GeneratorConfig.is_forbidden_default_argument_type(type_name): return False - if is_const: # Parameter is const, so we can safely give a default value knowing it won't be modified return True if GeneratorConfig.is_immutable_type(type_name): # Immutable type on python side @@ -150,7 +180,6 @@ def parameter_can_have_default_value(parameter: types.Parameter, specs, env_mapp return False - def get_py_args(parameters: List[types.Parameter], specs, env_mapping) -> List[str]: ''' Get the py::arg parameters of a function binding definition. @@ -194,7 +223,6 @@ def make_arg(name: str) -> str: return py_args - def define_method(method: types.Method, method_config: Dict, is_class_method, specs: Dict, header: 'HeaderFile', header_env: 'HeaderEnvironment', bound_object: 'BoundObjectNames'): params_strs = [get_type(param.type, specs, header_env.mapping) for param in method.parameters] py_arg_strs = get_py_args(method.parameters, specs, header_env.mapping) @@ -202,7 +230,6 @@ def define_method(method: types.Method, method_config: Dict, is_class_method, sp py_method_name = method_config.get('custom_name') or method_name return_type = get_type(method.return_type, specs, header_env.mapping) - # Detect input and output parameters for a method use_default_param_policy = method_config['use_default_param_policy'] param_is_input, param_is_output = method_config['param_is_input'], method_config['param_is_output'] @@ -239,7 +266,6 @@ def define_method(method: types.Method, method_config: Dict, is_class_method, sp else: py_arg_strs = [method_doc.documentation] + py_arg_strs - # If a function has refs to immutable params, we need to return them. should_wrap_for_tuple_return = param_is_output is not None and any(param_is_output) @@ -275,7 +301,7 @@ def define_method(method: types.Method, method_config: Dict, is_class_method, sp elif len(output_param_names) == 1 and (return_type is None or return_type == 'void'): return_str = output_param_names[0] else: - # When returning a tuple we need to explicitely convert references to pointer. + # When returning a tuple we need to explicitly convert references to pointer. # This is required since std::tuple will upcast the ref to its base class and try to store a copy of the object # If a class is pure virtual, this is not possible and will a compilation error! output_param_symbols.extend(['&' + name if is_ref else name for is_ref, name in zip(output_param_is_ref, output_param_names)]) @@ -314,7 +340,6 @@ def define_lambda(capture: str, params: List[str], return_type: Optional[str], b }} ''' - class NotGeneratedReason(Enum): UserIgnored = 'user_ignored', Access = 'access', diff --git a/modules/python/generator/visp_python_bindgen/preprocessor.py b/modules/python/generator/visp_python_bindgen/preprocessor.py index 532ba21945..392913f187 100644 --- a/modules/python/generator/visp_python_bindgen/preprocessor.py +++ b/modules/python/generator/visp_python_bindgen/preprocessor.py @@ -1,4 +1,39 @@ +############################################################################# +# +# 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: +# ViSP Python bindings generator +# +############################################################################# + # ''' # Preprocessor, derived from the command line preprocesor provided at https://github.com/ned14/pcpp/blob/master/pcpp/pcmd.py @@ -9,8 +44,6 @@ # from pcpp.preprocessor import Preprocessor, OutputDirective, Action # from visp_python_bindgen.generator_config import PreprocessorConfig - - # class CmdPreprocessor(Preprocessor): # def __init__(self, config: PreprocessorConfig, input: str): # if len(argv) < 2: @@ -66,7 +99,6 @@ # self.bypass_ifpassthru = False # self.potential_include_guard = None - # for d in config.defines: # if '=' not in d: # d += '=1' @@ -81,7 +113,6 @@ # for include in config.include_directories: # self.add_path(include) - # try: # if len(self.args.inputs) == 1: # self.parse(self.args.inputs[0]) @@ -102,8 +133,6 @@ # if self.args.output != sys.stdout: # self.args.output.close() - - # def on_include_not_found(self,is_malformed,is_system_include,curdir,includepath): # if self.args.passthru_unfound_includes: # raise OutputDirective(Action.IgnoreAndPassThrough) diff --git a/modules/python/generator/visp_python_bindgen/submodule.py b/modules/python/generator/visp_python_bindgen/submodule.py index 4ea8787223..d99cd03d50 100644 --- a/modules/python/generator/visp_python_bindgen/submodule.py +++ b/modules/python/generator/visp_python_bindgen/submodule.py @@ -1,3 +1,38 @@ +############################################################################# +# +# 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: +# ViSP Python bindings generator +# +############################################################################# + from typing import List, Optional, Dict from pathlib import Path import json @@ -6,10 +41,6 @@ from visp_python_bindgen.utils import * from visp_python_bindgen.gen_report import Report - - - - class Submodule(): def __init__(self, name: str, include_path: Path, config_file_path: Path, submodule_file_path: Path): self.name = name @@ -99,23 +130,21 @@ def generate(self) -> None: namespace py = pybind11; - void {self.generation_function_name()}(py::module_ &m) {{ /* -Submodule declaration -*/ + * Submodule declaration + */ {submodule_declaration} /* -Class and enums declarations -*/ + * Class and enums declarations + */ {declarations} - /* -Bindings for methods and enum values -*/ + * Bindings for methods and enum values + */ {bindings} }} ''' @@ -201,7 +230,6 @@ def get_method_config(self, class_name: Optional[str], method, owner_specs, head #import sys; sys.exit() return res - def get_submodules(config_path: Path, generate_path: Path) -> List[Submodule]: modules_input_data = GeneratorConfig.module_data result: Dict[str, Submodule] = {} @@ -223,7 +251,6 @@ def get_submodules(config_path: Path, generate_path: Path) -> List[Submodule]: result[module_data.name].set_dependencies_from_dict(result, module_data.dependencies) return sort_submodules(list(result.values())) - def sort_submodules(submodules: List[Submodule]) -> List[Submodule]: res = [] submodules_tmp = submodules.copy() diff --git a/modules/python/generator/visp_python_bindgen/utils.py b/modules/python/generator/visp_python_bindgen/utils.py index 050cdc7d9e..959706782a 100644 --- a/modules/python/generator/visp_python_bindgen/utils.py +++ b/modules/python/generator/visp_python_bindgen/utils.py @@ -1,3 +1,38 @@ +############################################################################# +# +# 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: +# ViSP Python bindings generator +# +############################################################################# + from typing import List, Optional, Set, Tuple, Dict, Union import copy from enum import Enum @@ -48,7 +83,6 @@ class MethodBinding: is_constructor: bool method_data: Optional[MethodData] = None - def get_definition_in_child_class(self, child_py_ident) -> 'MethodBinding': if self.is_constructor: raise RuntimeError('We should not try to redefine a constructor for a child class') @@ -59,7 +93,6 @@ def get_definition_in_child_class(self, child_py_ident) -> 'MethodBinding': res.binding = new_binding_code return res - @dataclass class ClassBindingDefinitions: ''' @@ -111,9 +144,6 @@ def get_definitions(self) -> str: defs.append(method_overload_binding.binding) return '\n'.join(defs) - - - def get_name(name: types.PQName) -> str: ''' Get the fully qualified name of a type. @@ -259,7 +289,6 @@ class vpA { return None - def is_pointer_to_const_cstr(param: types.Pointer) -> bool: ''' Whether the passed in pointer is of type const char* @@ -271,8 +300,6 @@ def is_pointer_to_const_cstr(param: types.Pointer) -> bool: return False - - def is_non_const_ref_to_immutable_type(param: types.DecoratedType) -> bool: ''' Returns true if the parameter is a mutable reference to an immutable type in Python. @@ -291,8 +318,6 @@ def is_non_const_ref_to_immutable_type(param: types.DecoratedType) -> bool: return True return GeneratorConfig.is_immutable_type(param_type) or GeneratorConfig.is_immutable_container(param_type) - - def is_unsupported_return_type(param: Union[types.FunctionType, types.DecoratedType]) -> bool: ''' Returns whether the passed param is supported as a return type for automatic code generation. diff --git a/modules/python/stubs/run_stub_generator.py b/modules/python/stubs/run_stub_generator.py index 0b999b53f6..129c73f9bb 100644 --- a/modules/python/stubs/run_stub_generator.py +++ b/modules/python/stubs/run_stub_generator.py @@ -1,3 +1,38 @@ +############################################################################# +# +# 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: +# ViSP Python bindings stubs +# +############################################################################# + from shutil import copy from pathlib import Path import subprocess @@ -23,4 +58,4 @@ target_path.mkdir(exist_ok=True) for pyi_file in p.iterdir(): if pyi_file.name.endswith('.pyi'): - copy(pyi_file, target_path / pyi_file.name) # Copy replace old files \ No newline at end of file + copy(pyi_file, target_path / pyi_file.name) # Copy replace old files diff --git a/modules/python/stubs/setup.py.in b/modules/python/stubs/setup.py.in index 5092057fc6..0ee3ae1373 100644 --- a/modules/python/stubs/setup.py.in +++ b/modules/python/stubs/setup.py.in @@ -1,7 +1,41 @@ +############################################################################# +# +# 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: +# ViSP Python bindings stubs +# +############################################################################# + from pathlib import Path from setuptools import setup - setup( name='visp-stubs', version='@VISP_PYTHON_VERSION@', diff --git a/modules/python/test/test_core_repr.py b/modules/python/test/test_core_repr.py index bbdec76389..8d7c474940 100644 --- a/modules/python/test/test_core_repr.py +++ b/modules/python/test/test_core_repr.py @@ -1,3 +1,38 @@ +############################################################################# +# +# 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: +# ViSP Python bindings test +# +############################################################################# + import visp from visp.core import ArrayDouble2D, RotationMatrix, Matrix, HomogeneousMatrix, PoseVector @@ -20,6 +55,5 @@ def test_matrix_operations(): assert m1 * m3 == m4 assert m2 * 2 == m1 - def test_rotation_repr_can_be_defined_by_hand(): R = RotationMatrix() diff --git a/modules/python/test/test_numpy.py b/modules/python/test/test_numpy.py index bc56e005d6..f4fd9eff71 100644 --- a/modules/python/test/test_numpy.py +++ b/modules/python/test/test_numpy.py @@ -1,3 +1,38 @@ +############################################################################# +# +# 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: +# ViSP Python bindings test +# +############################################################################# + import visp from visp.core import ArrayDouble2D, RotationMatrix, Matrix, HomogeneousMatrix, PoseVector @@ -14,7 +49,6 @@ def test_np_array_modifies_vp_array(): array_np[0:2, 0:2] = 2 assert array.getMinValue() == 1 and array.getMaxValue() == 2 - def fn_test_not_writable_2d(R): R_np = np.array(R, copy=False) with pytest.raises(ValueError): diff --git a/modules/python/test/test_specific_cases.py b/modules/python/test/test_specific_cases.py index f5bd991314..4015ed1278 100644 --- a/modules/python/test/test_specific_cases.py +++ b/modules/python/test/test_specific_cases.py @@ -1,3 +1,38 @@ +############################################################################# +# +# 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: +# ViSP Python bindings test +# +############################################################################# + from pytest import approx from visp.core import Math, ImagePoint, ColVector, ThetaUVector, Point def test_tuple_return_basic_values_only_output(): @@ -30,7 +65,6 @@ def test_tuple_return_basic_values_only_output_2(): assert theta_out == theta assert vec_out == ColVector(vec) - def test_pass_by_ref(): values = [0, 1, 2] p = Point(values) @@ -38,6 +72,5 @@ def test_pass_by_ref(): p.getWorldCoordinates(vec_ref) assert vec_ref == p.getWorldCoordinates() - def test_tuple_return_basic_values_mixed(): pass From 39f248f6b8a3860784e458aa02947dc48d263a2f Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Tue, 28 Nov 2023 01:57:52 +0100 Subject: [PATCH 122/169] Doing some config for core module --- modules/python/bindings/include/core.hpp | 2 + .../include/core/image_conversions.hpp | 205 ++++++++++++++++++ modules/python/config/core.json | 136 +++++++++++- 3 files changed, 341 insertions(+), 2 deletions(-) create mode 100644 modules/python/bindings/include/core/image_conversions.hpp diff --git a/modules/python/bindings/include/core.hpp b/modules/python/bindings/include/core.hpp index 5e7f5caefd..99c8b7e8ee 100644 --- a/modules/python/bindings/include/core.hpp +++ b/modules/python/bindings/include/core.hpp @@ -38,5 +38,7 @@ #include "core/arrays.hpp" #include "core/images.hpp" #include "core/pixel_meter.hpp" +#include "core/image_conversions.hpp" + #endif diff --git a/modules/python/bindings/include/core/image_conversions.hpp b/modules/python/bindings/include/core/image_conversions.hpp new file mode 100644 index 0000000000..f826b44709 --- /dev/null +++ b/modules/python/bindings/include/core/image_conversions.hpp @@ -0,0 +1,205 @@ +/* + * 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: + * Python bindings. + */ + +#ifndef VISP_PYTHON_CORE_IMAGE_CONVERT_HPP +#define VISP_PYTHON_CORE_IMAGE_CONVERT_HPP + +#include +#include +#include + +#include + +namespace +{ +using ConversionFunction1D = void(*)(unsigned char *, unsigned char *, unsigned int); +using ConversionFunction2D = void(*)(unsigned char *, unsigned char *, unsigned int, unsigned int); +using ComputeBytesFunction = unsigned(*)(unsigned int, unsigned int); + +void call_conversion_fn(ConversionFunction2D fn, unsigned char *src, unsigned char *dest, unsigned int h, unsigned int w) +{ + fn(src, dest, h, w); +} +void call_conversion_fn(ConversionFunction1D fn, unsigned char *src, unsigned char *dest, unsigned int h, unsigned int w) +{ + fn(src, dest, h * w); +} + +template +struct SimpleConversionStruct +{ + SimpleConversionStruct(const std::string &name, ConversionFn fn, unsigned int srcBytesPerPixel, unsigned int destBytesPerPixel) : + name(name), fn(fn), srcBytesPerPixel(srcBytesPerPixel), destBytesPerPixel(destBytesPerPixel) + { } + std::string name; + ConversionFn fn; + unsigned int srcBytesPerPixel; + unsigned int destBytesPerPixel; + + void add_conversion_binding(py::class_ &pyImageConvert) + { + pyImageConvert.def_static(name.c_str(), [this](py::array_t &src, + py::array_t &dest) { + py::buffer_info bufsrc = src.request(), bufdest = dest.request(); + if (bufsrc.ndim < 2 || bufdest.ndim < 2) { + throw std::runtime_error("Expected to have src and dest arrays with at least two dimensions."); + } + if (bufsrc.shape[0] != bufdest.shape[0] || bufsrc.shape[1] != bufdest.shape[1]) { + std::stringstream ss; + ss << "src and dest must have the same number of pixels, but got src = " << shape_to_string(bufsrc.shape); + ss << "and dest = " << shape_to_string(bufdest.shape); + throw std::runtime_error(ss.str()); + } + if (srcBytesPerPixel > 1 && (bufsrc.ndim != 3 || bufsrc.shape[2] != srcBytesPerPixel)) { + std::stringstream ss; + ss << "Source array should be a 3D array of shape (H, W, " << srcBytesPerPixel << ")"; + throw std::runtime_error(ss.str()); + } + else if (srcBytesPerPixel == 1 && bufsrc.ndim == 3 && bufsrc.shape[2] > 1) { + throw std::runtime_error("Source array should be a either a 2D array of shape H x W or a 3D array of shape (H, W, 1)"); + } + if (destBytesPerPixel > 1 && (bufdest.ndim != 3 || bufdest.shape[2] != destBytesPerPixel)) { + std::stringstream ss; + ss << "Destination array should be a 3D array of shape (H, W, " << destBytesPerPixel << ")"; + throw std::runtime_error(ss.str()); + } + else if (destBytesPerPixel == 1 && bufdest.ndim == 3 && bufdest.shape[2] > 1) { + throw std::runtime_error("Destination should be a either a 2D array of shape H x W or a 3D array of shape (H, W, 1)"); + } + + + unsigned char *src_ptr = static_cast(bufsrc.ptr); + unsigned char *dest_ptr = static_cast(bufdest.ptr); + call_conversion_fn(fn, src_ptr, dest_ptr, bufsrc.shape[0], bufsrc.shape[1]); + }, py::arg("src"), py::arg("dest")); + } + +}; + +struct ConversionFromYUVLike +{ + ConversionFromYUVLike(const std::string &name, ConversionFunction2D fn, ComputeBytesFunction sourceBytesFn, unsigned int destBytesPerPixel) : + name(name), fn(fn), , destBytesPerPixel(destBytesPerPixel) + { } + std::string name; + ConversionFunction2D fn; + ComputeBytesFunction sourceBytesFn; + + unsigned int destBytesPerPixel; + + void add_conversion_binding(py::class_ &pyImageConvert) + { + pyImageConvert.def_static(name.c_str(), [this](py::array_t &src, + py::array_t &dest) { + py::buffer_info bufsrc = src.request(), bufdest = dest.request(); + if (bufdest.ndim < 2) { + throw std::runtime_error("Expected to have dest array with at least two dimensions."); + } + + unsigned int height = bufdest.shape[0], width = bufdest.shape[1]; + + unsigned expectedSourceBytes = sourceBytesFn(height, width); + + unsigned actualBytes = 1; + for (unsigned int i = 0; i < bufsrc.ndim; ++i) { + actualBytes *= bufsrc.shape[i]; + } + + if (actualBytes != expectedSourceBytes) { + std::stringstream ss; + ss << "Expected to have " << expectedSourceBytes << " bytes in the input array, but got " << actualBytes << " elements."; + throw std::runtime_error(ss.str()); + } + + if (destBytesPerPixel > 1 && (bufdest.ndim != 3 || bufdest.shape[2] != destBytesPerPixel)) { + std::stringstream ss; + ss << "Destination array should be a 3D array of shape (H, W, " << destBytesPerPixel << ")"; + throw std::runtime_error(ss.str()); + } + else if (destBytesPerPixel == 1 && bufdest.ndim == 3 && bufdest.shape[2] > 1) { + throw std::runtime_error("Destination should be a either a 2D array of shape H x W or a 3D array of shape (H, W, 1)"); + } + + + unsigned char *src_ptr = static_cast(bufsrc.ptr); + unsigned char *dest_ptr = static_cast(bufdest.ptr); + call_conversion_fn(fn, src_ptr, dest_ptr, bufdest.shape[0], bufdest.shape[1]); + }, py::arg("src"), py::arg("dest")); + } + +}; + + + +} + + + +void bindings_vpImageConvert(py::class_ &pyImageConvert) +{ + // Simple conversions where the size input is a single argument + { + std::vector> conversions = { + SimpleConversionStruct("YUV444ToGrey", &vpImageConvert::YUV444ToGrey, 3, 1), + SimpleConversionStruct("YUV444ToRGB", &vpImageConvert::YUV444ToRGB, 3, 3), + SimpleConversionStruct("YUV444ToRGBa", &vpImageConvert::YUV444ToRGBa, 3, 4), + SimpleConversionStruct("RGBToRGBa", static_cast(&vpImageConvert::RGBToRGBa), 3, 4), + SimpleConversionStruct("RGBaToRGB", &vpImageConvert::RGBaToRGB, 4, 3), + SimpleConversionStruct("GreyToRGB", &vpImageConvert::GreyToRGB, 1, 3), + SimpleConversionStruct("GreyToRGBa", static_cast(&vpImageConvert::GreyToRGBa), 1, 4) + }; + for (auto &conversion: conversions) { + conversion.add_conversion_binding(pyImageConvert); + } + } + //Simple conversions where the size input are height and width + { + std::vector> conversions = { + }; + for (auto &conversion: conversions) { + conversion.add_conversion_binding(pyImageConvert); + } + } + //YUV conversions + { + std::vector> conversions = { + }; + for (auto &conversion: conversions) { + conversion.add_conversion_binding(pyImageConvert); + } + } + + +} + +#endif diff --git a/modules/python/config/core.json b/modules/python/config/core.json index e6dbb6324e..44b7ea4bed 100644 --- a/modules/python/config/core.json +++ b/modules/python/config/core.json @@ -313,7 +313,116 @@ } ] }, - + "vpImageConvert": { + "additional_bindings": "bindings_vpImageConvert", + "methods": + [ + { + "static": true, + "signature": "void RGBaToRGB(unsigned char*, unsigned char*, unsigned int)", + "ignore": true + }, + { + "static": true, + "signature": "void RGBToRGBa(unsigned char*, unsigned char*, unsigned int)", + "ignore": true + }, + { + "static": true, + "signature": "void RGBToRGBa(unsigned char*, unsigned char*, unsigned int, unsigned int, bool)", + "ignore": true + }, + { + "static": true, + "signature": "void YUV444ToRGBa(unsigned char*, unsigned char*, unsigned int)", + "ignore": true + }, + { + "static": true, + "signature": "void YUV444ToRGB(unsigned char*, unsigned char*, unsigned int)", + "ignore": true + }, + { + "static": true, + "signature": "void YUV444ToGrey(unsigned char*, unsigned char*, unsigned int)", + "ignore": true + }, + { + "static": true, + "signature": "void GreyToRGBa(unsigned char*, unsigned char*, unsigned int, unsigned int)", + "ignore": true + }, + { + "static": true, + "signature": "void GreyToRGBa(unsigned char*, unsigned char*, unsigned int)", + "ignore": true + }, + { + "static": true, + "signature": "void GreyToRGB(unsigned char*, unsigned char*, unsigned int, unsigned int)", + "ignore": true + } + ] + }, + "vpConvert": { + "methods": [ + { + "static": true, + "signature": "void convertToOpenCV(const std::vector&, std::vector&, bool)", + "ignore" :true + }, + { + "static": true, + "signature": "void convertToOpenCV(const std::vector&, std::vector&, bool)", + "ignore" :true + }, + { + "static": true, + "signature": "void convertToOpenCV(const std::vector&, std::vector&)", + "ignore" :true + }, + { + "static": true, + "signature": "void convertToOpenCV(const std::vector&, std::vector&)", + "ignore": true + }, + { + "static": true, + "signature": "void convertFromOpenCV(const std::vector&, std::vector&)", + "ignore": true + }, + { + "static": true, + "signature": "void convertFromOpenCV(const std::vector&, std::vector&)", + "ignore": true + }, + { + "static": true, + "signature": "void convertFromOpenCV(const std::vector&, std::vector&, bool)", + "ignore": true + }, + { + "static": true, + "signature": "void convertFromOpenCV(const std::vector&, std::vector&, bool)", + "ignore": true + }, + { + "static": true, + "signature": "void convertFromOpenCV(const std::vector&, std::vector&)", + "ignore": true + }, + { + "static": true, + "signature": "void convertFromOpenCV(const std::vector&, std::vector&)", + "ignore": true + }, + { + "static": true, + "signature": "void convertFromOpenCV(const std::vector&, std::vector&)", + "ignore": true + } + ] + }, "vpDisplay": { "methods": [ @@ -361,7 +470,19 @@ }, "vpMomentDatabase": { "methods": [ - + { + "static": false, + "signature": "const vpMoment& get(const std::string&, bool&)", + "use_default_param_policy": false, + "param_is_input": [ + true, + false + ], + "param_is_output": [ + false, + true + ] + } ] }, "vpPixelMeterConversion": { @@ -369,6 +490,17 @@ }, "vpMeterPixelConversion": { "additional_bindings": "bindings_vpMeterPixelConversion" + }, + "vpCircle": { + "methods": [ + { + "static": true, + "signature": "void computeIntersectionPoint(const vpCircle&, const vpCameraParameters&, const double&, const double&, double&, double&)", + "use_default_param_policy": false, + "param_is_input": [true, true, true, true, false, false], + "param_is_output": [false, false, false, false, true, true] + } + ] } } From 1a57a7107786dc2c46ca657d595d170f8df8b70b Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Tue, 28 Nov 2023 14:04:38 +0100 Subject: [PATCH 123/169] Display before initializing tracking in Python MBT + Realsense example --- modules/python/examples/realsense_mbt.py | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/modules/python/examples/realsense_mbt.py b/modules/python/examples/realsense_mbt.py index 7da5380ef6..534c74bbb7 100644 --- a/modules/python/examples/realsense_mbt.py +++ b/modules/python/examples/realsense_mbt.py @@ -68,10 +68,8 @@ def read_data(cam_depth: CameraParameters | None, I: ImageGray, pipe: rs.pipelin I_depth_raw = None point_cloud = None if use_depth: - depth_proc_start = time.time() I_depth_raw = np.asanyarray(frames.get_depth_frame().as_frame().get_data()) point_cloud = np.asanyarray(point_cloud_computer.calculate(frames.get_depth_frame()).get_vertices()).view((np.float32, 3)) - print(f'Depth processing took {(time.time() - depth_proc_start) * 1000}ms') iteration += 1 yield FrameData(I, ImageUInt16(I_depth_raw), point_cloud) @@ -100,10 +98,11 @@ def cam_from_rs_profile(profile) -> Tuple[CameraParameters, int, int]: # Initialize realsense2 pipe = rs.pipeline() - cfg = pipe.start() + config = rs.config() + config.enable_stream(rs.stream.depth, 640, 480, rs.format.z16, 60) + config.enable_stream(rs.stream.color, 640, 480, rs.format.rgb8, 60) - for i in range(10): - pipe.wait_for_frames() + cfg = pipe.start(config) assert data_root.exists() and data_root.is_dir() @@ -153,6 +152,15 @@ def cam_from_rs_profile(profile) -> Tuple[CameraParameters, int, int]: if not args.disable_depth: ImageConvert.createDepthHistogram(frame_data.I_depth, I_depth) dDepth.init(I_depth, I.getWidth(), 0, 'Depth') + + for frame in data_generator: + Display.display(I) + Display.displayText(I, 0, 0, 'Click to initialize tracking', Color.red) + Display.flush(I) + event = Display.getClick(I, blocking=False) + if event: + break + tracker.initClick(I, str(mbt_model.init_file)) start_time = time.time() for frame_data in data_generator: @@ -172,7 +180,6 @@ def cam_from_rs_profile(profile) -> Tuple[CameraParameters, int, int]: } t = time.time() tracker.track(image_dict, {'Camera2': pc.reshape(depth_height, depth_width, 3)}) - print(f'Tracking took {(time.time() - t) * 1000}ms') cMo = HomogeneousMatrix() tracker.getPose(cMo) @@ -181,7 +188,12 @@ def cam_from_rs_profile(profile) -> Tuple[CameraParameters, int, int]: Display.flush(I) if not args.disable_depth: Display.flush(I_depth) + if args.step_by_step: Display.getKeyboardEvent(I, blocking=True) + else: + event = Display.getClick(I, blocking=False) + if event: + break end_time = time.time() print(f'total time = {end_time - start_time}s') From 5a65a24cc1ff5041292afcb195a0c23b60ad466b Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Tue, 28 Nov 2023 15:09:07 +0100 Subject: [PATCH 124/169] Fix for extra generated comma when there are no additional arguments to a derived-class lambda method reimplem --- .../include/core/image_conversions.hpp | 54 +++++++++++-- modules/python/config/core.json | 79 ++++++++++++++++++- .../generator/visp_python_bindgen/header.py | 1 - .../visp_python_bindgen/submodule.py | 2 - .../generator/visp_python_bindgen/utils.py | 3 +- 5 files changed, 125 insertions(+), 14 deletions(-) diff --git a/modules/python/bindings/include/core/image_conversions.hpp b/modules/python/bindings/include/core/image_conversions.hpp index f826b44709..5cec9b185d 100644 --- a/modules/python/bindings/include/core/image_conversions.hpp +++ b/modules/python/bindings/include/core/image_conversions.hpp @@ -106,13 +106,14 @@ struct SimpleConversionStruct }; +template struct ConversionFromYUVLike { - ConversionFromYUVLike(const std::string &name, ConversionFunction2D fn, ComputeBytesFunction sourceBytesFn, unsigned int destBytesPerPixel) : - name(name), fn(fn), , destBytesPerPixel(destBytesPerPixel) + ConversionFromYUVLike(const std::string &name, ConversionFn fn, ComputeBytesFunction sourceBytesFn, unsigned int destBytesPerPixel) : + name(name), fn(fn), sourceBytesFn(sourceBytesFn), destBytesPerPixel(destBytesPerPixel) { } std::string name; - ConversionFunction2D fn; + ConversionFn fn; ComputeBytesFunction sourceBytesFn; unsigned int destBytesPerPixel; @@ -159,7 +160,18 @@ struct ConversionFromYUVLike }; - +unsigned size422(unsigned h, unsigned w) +{ + return h * w + (h * (w / 2)) * 2; +} +unsigned size420(unsigned h, unsigned w) +{ + return h * w + ((h / 2) * (w / 2)) * 2; +} +unsigned size411(unsigned h, unsigned w) +{ + return h * w + ((h / 4) * (w / 4)) * 2; +} } @@ -182,17 +194,43 @@ void bindings_vpImageConvert(py::class_ &pyImageConvert) conversion.add_conversion_binding(pyImageConvert); } } - //Simple conversions where the size input are height and width + + //YUV conversions { - std::vector> conversions = { + using Conv = ConversionFromYUVLike; + std::vector conversions = { + Conv("YUYVToRGBa", &vpImageConvert::YUYVToRGBa, &size422, 4), + Conv("YUYVToRGB", &vpImageConvert::YUYVToRGB, &size422, 3), + + Conv("YV12ToRGBa", &vpImageConvert::YV12ToRGBa, &size420, 4), + Conv("YV12ToRGB", &vpImageConvert::YV12ToRGB, &size420, 3), + Conv("YUV420ToRGBa", &vpImageConvert::YUV420ToRGBa, &size420, 4), + Conv("YUV420ToRGB", &vpImageConvert::YUV420ToRGB, &size420, 3), + + Conv("YVU9ToRGBa", &vpImageConvert::YVU9ToRGBa, &size411, 4), + Conv("YVU9ToRGB", &vpImageConvert::YVU9ToRGB, &size411, 3), }; for (auto &conversion: conversions) { conversion.add_conversion_binding(pyImageConvert); } } - //YUV conversions { - std::vector> conversions = { + using Conv = ConversionFromYUVLike; + std::vector conversions = { + + Conv("YUYVToGrey", &vpImageConvert::YUYVToGrey, &size422, 1), + Conv("YUV422ToRGBa", &vpImageConvert::YUV422ToRGBa, &size422, 4), + Conv("YUV422ToRGB", &vpImageConvert::YUV422ToRGB, &size422, 3), + Conv("YUV422ToGrey", &vpImageConvert::YUV422ToGrey, &size422, 1), + Conv("YCbCrToRGBa", &vpImageConvert::YCbCrToRGBa, &size422, 4), + Conv("YCbCrToRGB", &vpImageConvert::YCbCrToRGB, &size422, 3), + Conv("YCbCrToGrey", &vpImageConvert::YCbCrToGrey, &size422, 1), + Conv("YCrCbToRGBa", &vpImageConvert::YCrCbToRGBa, &size422, 4), + Conv("YCrCbToRGB", &vpImageConvert::YCrCbToRGB, &size422, 3), + Conv("YUV420ToGrey", &vpImageConvert::YUV420ToGrey, &size420, 1), + Conv("YUV411ToRGBa", &vpImageConvert::YUV411ToRGBa, &size411, 4), + Conv("YUV411ToRGB", &vpImageConvert::YUV411ToRGB, &size411, 3), + Conv("YUV411ToGrey", &vpImageConvert::YUV411ToGrey, &size411, 1), }; for (auto &conversion: conversions) { conversion.add_conversion_binding(pyImageConvert); diff --git a/modules/python/config/core.json b/modules/python/config/core.json index 44b7ea4bed..137b7c748e 100644 --- a/modules/python/config/core.json +++ b/modules/python/config/core.json @@ -315,7 +315,7 @@ }, "vpImageConvert": { "additional_bindings": "bindings_vpImageConvert", - "methods": + "methods": [ { "static": true, @@ -361,7 +361,82 @@ "static": true, "signature": "void GreyToRGB(unsigned char*, unsigned char*, unsigned int, unsigned int)", "ignore": true - } + }, + { + "static": true, + "signature": "void YUYVToRGBa(unsigned char*, unsigned char*, unsigned int, unsigned int)", + "ignore": true + }, + { + "static": true, + "signature": "void YUYVToRGB(unsigned char*, unsigned char*, unsigned int, unsigned int)", + "ignore": true + }, + { + "static": true, + "signature": "void YUYVToGrey(unsigned char*, unsigned char*, unsigned int)", + "ignore": true + }, + { + "static": true, + "signature": "void YUV411ToRGBa(unsigned char*, unsigned char*, unsigned int)", + "ignore": true + }, + { + "static": true, + "signature": "void YUV411ToRGB(unsigned char*, unsigned char*, unsigned int)", + "ignore": true + }, + { + "static": true, + "signature": "void YUV411ToGrey(unsigned char*, unsigned char*, unsigned int)", + "ignore": true + }, + { + "static": true, + "signature": "void YUV422ToRGBa(unsigned char*, unsigned char*, unsigned int)", + "ignore": true + }, + { + "static": true, + "signature": "void YUV422ToRGB(unsigned char*, unsigned char*, unsigned int)", + "ignore": true + }, + { + "static": true, + "signature": "void YUV420ToRGBa(unsigned char*, unsigned char*, unsigned int, unsigned int)", + "ignore": true + }, + { + "static": true, + "signature": "void YUV420ToRGB(unsigned char*, unsigned char*, unsigned int, unsigned int)", + "ignore": true + }, + { + "static": true, + "signature": "void YUV420ToGrey(unsigned char*, unsigned char*, unsigned int)", + "ignore": true + }, + { + "static": true, + "signature": "void YV12ToRGBa(unsigned char*, unsigned char*, unsigned int, unsigned int)", + "ignore": true + }, + { + "static": true, + "signature": "void YV12ToRGB(unsigned char*, unsigned char*, unsigned int, unsigned int)", + "ignore": true + }, + { + "static": true, + "signature": "void YVU9ToRGBa(unsigned char*, unsigned char*, unsigned int, unsigned int)", + "ignore": true + }, + { + "static": true, + "signature": "void YVU9ToRGB(unsigned char*, unsigned char*, unsigned int, unsigned int)", + "ignore": true + } ] }, "vpConvert": { diff --git a/modules/python/generator/visp_python_bindgen/header.py b/modules/python/generator/visp_python_bindgen/header.py index 206aa9c910..fb6ddf2ae2 100644 --- a/modules/python/generator/visp_python_bindgen/header.py +++ b/modules/python/generator/visp_python_bindgen/header.py @@ -398,7 +398,6 @@ def add_to_method_dict(key, value): base_bindings = list(filter(lambda b: b is not None, map(lambda s: bindings_container.find_bindings(s), base_class_strs))) # assert not any(map(lambda b: b is None, base_bindings)), f'Could not retrieve the bindings for a base class of {name_cpp}' - print(base_bindings) for base_binding_container in base_bindings: base_defs = base_binding_container.definitions if not isinstance(base_defs, ClassBindingDefinitions): diff --git a/modules/python/generator/visp_python_bindgen/submodule.py b/modules/python/generator/visp_python_bindgen/submodule.py index d99cd03d50..42ae5dc2d9 100644 --- a/modules/python/generator/visp_python_bindgen/submodule.py +++ b/modules/python/generator/visp_python_bindgen/submodule.py @@ -259,6 +259,4 @@ def sort_submodules(submodules: List[Submodule]) -> List[Submodule]: res_round = list(filter(can_add, submodules_tmp)) submodules_tmp = [submodule for submodule in submodules_tmp if submodule not in res_round] res += res_round - - print(list(map(lambda sub: sub.name, res))) return res diff --git a/modules/python/generator/visp_python_bindgen/utils.py b/modules/python/generator/visp_python_bindgen/utils.py index 959706782a..91fcb89def 100644 --- a/modules/python/generator/visp_python_bindgen/utils.py +++ b/modules/python/generator/visp_python_bindgen/utils.py @@ -54,8 +54,9 @@ class MethodData: def as_lambda(self, py_ident: str) -> str: args_str = ', '.join(self.py_arg_strs) def_val = 'def' if not self.method.static else 'def_static' + maybe_comma = ',' if len(args_str.strip()) > 0 else '' return f''' - {py_ident}.{def_val}("{self.py_name}", {self.lambda_variant}, {args_str}); + {py_ident}.{def_val}("{self.py_name}", {self.lambda_variant}{maybe_comma} {args_str}); ''' @dataclass From 9f2fd366f1492cae32303960a44e27dfccdcf55a Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Tue, 28 Nov 2023 15:54:51 +0100 Subject: [PATCH 125/169] Image conversion bindings config --- .../include/core/image_conversions.hpp | 3 +- modules/python/config/core.json | 89 +++++++++++++++++++ 2 files changed, 91 insertions(+), 1 deletion(-) diff --git a/modules/python/bindings/include/core/image_conversions.hpp b/modules/python/bindings/include/core/image_conversions.hpp index 5cec9b185d..85bf4b133d 100644 --- a/modules/python/bindings/include/core/image_conversions.hpp +++ b/modules/python/bindings/include/core/image_conversions.hpp @@ -188,7 +188,8 @@ void bindings_vpImageConvert(py::class_ &pyImageConvert) SimpleConversionStruct("RGBToRGBa", static_cast(&vpImageConvert::RGBToRGBa), 3, 4), SimpleConversionStruct("RGBaToRGB", &vpImageConvert::RGBaToRGB, 4, 3), SimpleConversionStruct("GreyToRGB", &vpImageConvert::GreyToRGB, 1, 3), - SimpleConversionStruct("GreyToRGBa", static_cast(&vpImageConvert::GreyToRGBa), 1, 4) + SimpleConversionStruct("GreyToRGBa", static_cast(&vpImageConvert::GreyToRGBa), 1, 4), + SimpleConversionStruct("RGBToGrey", static_cast(&vpImageConvert::RGBToGrey), 3, 1), }; for (auto &conversion: conversions) { conversion.add_conversion_binding(pyImageConvert); diff --git a/modules/python/config/core.json b/modules/python/config/core.json index 137b7c748e..2b781d25b3 100644 --- a/modules/python/config/core.json +++ b/modules/python/config/core.json @@ -258,6 +258,60 @@ } ] }, + "vpPolygon3D": { + "methods": [ + { + "static": true, + "signature": "void getClippedPolygon(const std::vector&, std::vector&, const vpHomogeneousMatrix&, const unsigned int&, const vpCameraParameters&, const double&, const double&)", + "use_default_param_policy": false, + "param_is_input": [true, false, true, true, true, true, true], + "param_is_output": [false, true, false, false, false, false, false] + }, + { + "static": false, + "signature": "void getPolygonClipped(std::vector&)", + "use_default_param_policy": false, + "param_is_input": [false], + "param_is_output": [true] + }, + { + "static": false, + "signature": "void getPolygonClipped(std::vector>&)", + "custom_name": "getPolygonClippedWithInfo", + "use_default_param_policy": false, + "param_is_input": [false], + "param_is_output": [true] + }, + { + "static": false, + "signature": "void getRoiClipped(const vpCameraParameters&, std::vector>&, const vpHomogeneousMatrix&)", + "use_default_param_policy": false, + "param_is_input": [true, false, true], + "param_is_output": [false, true, false] + }, + { + "static": false, + "signature": "void getRoiClipped(const vpCameraParameters&, std::vector>&)", + "use_default_param_policy": false, + "param_is_input": [true, false], + "param_is_output": [false, true] + }, + { + "static": false, + "signature": "void getRoiClipped(const vpCameraParameters&, std::vector&, const vpHomogeneousMatrix&)", + "use_default_param_policy": false, + "param_is_input": [true, false, true], + "param_is_output": [false, true, false] + }, + { + "static": false, + "signature": "void getRoiClipped(const vpCameraParameters&, std::vector&)", + "use_default_param_policy": false, + "param_is_input": [true, false], + "param_is_output": [false, true] + } + ] + }, "vpPoint": { "methods": [ @@ -362,6 +416,11 @@ "signature": "void GreyToRGB(unsigned char*, unsigned char*, unsigned int, unsigned int)", "ignore": true }, + { + "static": true, + "signature": "void GreyToRGB(unsigned char*, unsigned char*, unsigned int)", + "ignore": true + }, { "static": true, "signature": "void YUYVToRGBa(unsigned char*, unsigned char*, unsigned int, unsigned int)", @@ -402,6 +461,11 @@ "signature": "void YUV422ToRGB(unsigned char*, unsigned char*, unsigned int)", "ignore": true }, + { + "static": true, + "signature": "void YUV422ToGrey(unsigned char*, unsigned char*, unsigned int)", + "ignore": true + }, { "static": true, "signature": "void YUV420ToRGBa(unsigned char*, unsigned char*, unsigned int, unsigned int)", @@ -436,6 +500,31 @@ "static": true, "signature": "void YVU9ToRGB(unsigned char*, unsigned char*, unsigned int, unsigned int)", "ignore": true + }, + { + "static": true, + "signature": "void YCbCrToRGB(unsigned char*, unsigned char*, unsigned int)", + "ignore": true + }, + { + "static": true, + "signature": "void YCbCrToRGBa(unsigned char*, unsigned char*, unsigned int)", + "ignore": true + }, + { + "static": true, + "signature": "void YCbCrToGrey(unsigned char*, unsigned char*, unsigned int)", + "ignore": true + }, + { + "static": true, + "signature": "void YCrCbToRGB(unsigned char*, unsigned char*, unsigned int)", + "ignore": true + }, + { + "static": true, + "signature": "void YCrCbToRGBa(unsigned char*, unsigned char*, unsigned int)", + "ignore": true } ] }, From 0dad37b15f57726a5b502994ec7489a64efc3000 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Tue, 28 Nov 2023 15:58:47 +0100 Subject: [PATCH 126/169] Fix indentation in lambdas --- modules/python/bindings/include/blob.hpp | 6 +-- .../python/bindings/include/core/images.hpp | 4 +- modules/python/bindings/include/mbt.hpp | 46 +++++++++---------- 3 files changed, 28 insertions(+), 28 deletions(-) diff --git a/modules/python/bindings/include/blob.hpp b/modules/python/bindings/include/blob.hpp index bfb7fdf4bc..5dd634a473 100644 --- a/modules/python/bindings/include/blob.hpp +++ b/modules/python/bindings/include/blob.hpp @@ -50,7 +50,7 @@ void bindings_vpDot2(py::class_ &pyDot2) vpImage &I, vpColor col = vpColor::blue, bool trackDot = true) { - return vpDot2::defineDots(&dots[0], dots.size(), dotFile, I, col, trackDot); + return vpDot2::defineDots(&dots[0], dots.size(), dotFile, I, col, trackDot); }, R"doc( Wrapper for the defineDots method, see the C++ ViSP documentation. )doc", py::arg("dots"), py::arg("dotFile"), py::arg("I"), py::arg("color"), py::arg("trackDot") = true); @@ -59,8 +59,8 @@ Wrapper for the defineDots method, see the C++ ViSP documentation. vpImage &I, std::vector &cogs, std::optional> cogStar) { - vpImagePoint *desireds = cogStar ? &((*cogStar)[0]) : nullptr; - vpDot2::trackAndDisplay(&dots[0], dots.size(), I, cogs, desireds); + vpImagePoint *desireds = cogStar ? &((*cogStar)[0]) : nullptr; + vpDot2::trackAndDisplay(&dots[0], dots.size(), I, cogs, desireds); }, R"doc( Wrapper for the trackAndDisplay method, see the C++ ViSP documentation. )doc", py::arg("dots"), py::arg("I"), py::arg("cogs"), py::arg("desiredCogs")); diff --git a/modules/python/bindings/include/core/images.hpp b/modules/python/bindings/include/core/images.hpp index c6ed856a3f..83dabaefb6 100644 --- a/modules/python/bindings/include/core/images.hpp +++ b/modules/python/bindings/include/core/images.hpp @@ -57,7 +57,7 @@ bindings_vpImage(py::class_> &pyImage) vpImage result(shape[0], shape[1]); copy_data_from_np(np_array, result.bitmap); return result; - }), R"doc( + }), R"doc( Construct an image by **copying** a 2D numpy array. :param np_array: The numpy array to copy. @@ -86,7 +86,7 @@ bindings_vpImage(py::class_> &pyImage) vpImage result(shape[0], shape[1]); copy_data_from_np(np_array, (unsigned char *)result.bitmap); return result; - }), R"doc( + }), R"doc( Construct an image by **copying** a 3D numpy array. this numpy array should be of the form :math:`H \times W \times 4` where the 4 denotes the red, green, blue and alpha components of the image. diff --git a/modules/python/bindings/include/mbt.hpp b/modules/python/bindings/include/mbt.hpp index 89ae6eec53..849a0984bc 100644 --- a/modules/python/bindings/include/mbt.hpp +++ b/modules/python/bindings/include/mbt.hpp @@ -45,30 +45,30 @@ void bindings_vpMbGenericTracker(py::class_ &py { pyMbGenericTracker.def("track", [](vpMbGenericTracker &self, std::map *> &mapOfImages, std::map> &mapOfPointClouds) { - std::map mapOfWidths, mapOfHeights; - std::map mapOfVectors; - for (const auto &point_cloud_pair: mapOfPointClouds) { + std::map mapOfWidths, mapOfHeights; + std::map mapOfVectors; + for (const auto &point_cloud_pair: mapOfPointClouds) { - py::buffer_info buffer = point_cloud_pair.second.request(); - if (buffer.ndim != 3 and buffer.shape[2] != 3) { - std::stringstream ss; - ss << "Pointcloud error: pointcloud at key: " << point_cloud_pair.first << - " should be a 3D numpy array of dimensions H X W x 3"; - throw std::runtime_error(ss.str()); - } - const auto shape = buffer.shape; - mapOfHeights[point_cloud_pair.first] = shape[0]; - mapOfWidths[point_cloud_pair.first] = shape[1]; - vpMatrix pc(shape[0] * shape[1], 3); - const double *data = point_cloud_pair.second.unchecked<3>().data(0, 0, 0); - memcpy(pc.data, data, shape[0] * shape[1] * 3 * sizeof(double)); - mapOfVectors[point_cloud_pair.first] = std::move(pc); - } - std::map mapOfVectorPtrs; - for (const auto &p: mapOfVectors) { - mapOfVectorPtrs[p.first] = &(p.second); - } - self.track(mapOfImages, mapOfVectorPtrs, mapOfWidths, mapOfHeights); + py::buffer_info buffer = point_cloud_pair.second.request(); + if (buffer.ndim != 3 and buffer.shape[2] != 3) { + std::stringstream ss; + ss << "Pointcloud error: pointcloud at key: " << point_cloud_pair.first << + " should be a 3D numpy array of dimensions H X W x 3"; + throw std::runtime_error(ss.str()); + } + const auto shape = buffer.shape; + mapOfHeights[point_cloud_pair.first] = shape[0]; + mapOfWidths[point_cloud_pair.first] = shape[1]; + vpMatrix pc(shape[0] * shape[1], 3); + const double *data = point_cloud_pair.second.unchecked<3>().data(0, 0, 0); + memcpy(pc.data, data, shape[0] * shape[1] * 3 * sizeof(double)); + mapOfVectors[point_cloud_pair.first] = std::move(pc); + } + std::map mapOfVectorPtrs; + for (const auto &p: mapOfVectors) { + mapOfVectorPtrs[p.first] = &(p.second); + } + self.track(mapOfImages, mapOfVectorPtrs, mapOfWidths, mapOfHeights); }); } From 9d9ae11766b7c4a3c39097af693e25727ae6d056 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Tue, 28 Nov 2023 16:33:48 +0100 Subject: [PATCH 127/169] Global python target --- modules/python/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/python/CMakeLists.txt b/modules/python/CMakeLists.txt index a24ec61210..75d2d194da 100644 --- a/modules/python/CMakeLists.txt +++ b/modules/python/CMakeLists.txt @@ -119,6 +119,12 @@ if(BUILD_PYTHON_BINDINGS_DOC) add_subdirectory(docs) endif() +# Global target: compile and install the Python bindings +add_custom_target( + visp_python_bindings + DEPENDS visp_python_bindings_stubs +) + # Export Variables to parent cmake set(VISP_PYTHON_BOUND_MODULES "") foreach(module ${python_bound_modules}) From 5c20ef07c6c69772f600c5521f2e1ab9e54f200c Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Tue, 28 Nov 2023 17:17:30 +0100 Subject: [PATCH 128/169] Log python bindings generation to a text file instead of cout, quieter pip install for stubs and bindings --- modules/python/bindings/CMakeLists.txt | 2 +- .../visp_python_bindgen/enum_binding.py | 7 +++-- .../visp_python_bindgen/gen_report.py | 8 +++-- .../visp_python_bindgen/generator.py | 19 +++++++----- .../generator/visp_python_bindgen/header.py | 31 ++++++++++--------- .../visp_python_bindgen/header_utils.py | 8 ++++- .../generator/visp_python_bindgen/methods.py | 3 +- .../visp_python_bindgen/submodule.py | 2 +- modules/python/stubs/CMakeLists.txt | 4 +-- 9 files changed, 52 insertions(+), 32 deletions(-) diff --git a/modules/python/bindings/CMakeLists.txt b/modules/python/bindings/CMakeLists.txt index c8a6080c06..644d148970 100644 --- a/modules/python/bindings/CMakeLists.txt +++ b/modules/python/bindings/CMakeLists.txt @@ -57,7 +57,7 @@ if(PYTHON3INTERP_FOUND) configure_file("${CMAKE_CURRENT_SOURCE_DIR}/setup.py.in" "${CMAKE_CURRENT_BINARY_DIR}/setup.py" @ONLY) add_custom_target( visp_python_bindings_install COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMAKE_CURRENT_SOURCE_DIR}/visp" "${CMAKE_CURRENT_BINARY_DIR}/visp" - COMMAND ${PYTHON3_EXECUTABLE} -m pip install ${_pip_args} -v "${CMAKE_CURRENT_BINARY_DIR}" + COMMAND ${PYTHON3_EXECUTABLE} -m pip install ${_pip_args} "${CMAKE_CURRENT_BINARY_DIR}" DEPENDS _visp ) endif() diff --git a/modules/python/generator/visp_python_bindgen/enum_binding.py b/modules/python/generator/visp_python_bindgen/enum_binding.py index 86eb68f137..c5bfe4fa32 100644 --- a/modules/python/generator/visp_python_bindgen/enum_binding.py +++ b/modules/python/generator/visp_python_bindgen/enum_binding.py @@ -35,6 +35,7 @@ from typing import List, Optional, Tuple, Dict, Union from dataclasses import dataclass +import logging from cxxheaderparser import types from cxxheaderparser.simple import NamespaceScope, ClassScope @@ -177,7 +178,7 @@ def get_enum_bindings(root_scope: NamespaceScope, mapping: Dict, submodule: Subm final_data, filtered_reprs = resolve_enums_and_typedefs(root_scope, mapping) for repr in filtered_reprs: - print(f'Enum {repr} was ignored, because it is incomplete (missing values or name)') + logging.info(f'Enum {repr} was ignored, because it is incomplete (missing values or name)') result: List['SingleObjectBindings'] = [] final_reprs = [] @@ -185,7 +186,7 @@ def get_enum_bindings(root_scope: NamespaceScope, mapping: Dict, submodule: Subm enum_config = submodule.get_enum_config(repr.name) if enum_config['ignore']: filtered_reprs.append(repr) - print(f'Enum {repr.name} is ignored by user') + logging.info(f'Enum {repr.name} is ignored by user') elif repr.public_access: final_reprs.append(repr) else: @@ -206,7 +207,7 @@ def get_enum_bindings(root_scope: NamespaceScope, mapping: Dict, submodule: Subm break if parent_ignored: - print(f'Ignoring enum {py_name} because {ignored_parent_name} is ignored') + logging.info(f'Ignoring enum {py_name} because {ignored_parent_name} is ignored') continue owner_full_name = '::'.join(name_segments[:-1]) diff --git a/modules/python/generator/visp_python_bindgen/gen_report.py b/modules/python/generator/visp_python_bindgen/gen_report.py index 6fd4c6a32c..f01dc51e20 100644 --- a/modules/python/generator/visp_python_bindgen/gen_report.py +++ b/modules/python/generator/visp_python_bindgen/gen_report.py @@ -104,13 +104,17 @@ def add_default_policy_method(self, cls_name: str, method: types.Method, signatu self.result['default_param_policy_methods'].append(report_dict) def write(self, path: Path) -> None: - print(f'Statistics for module {self.submodule_name} report:') + print('=' * 50) + print(f'Statistics for module {self.submodule_name}:') stats = [ f'Ignored headers: {len(self.result["ignored_headers"])}', f'Ignored classes: {len(self.result["classes"].keys())}', f'Not generated methods: {len(self.result["methods"].keys())}', f'Method with default parameter policy: {len(self.result["default_param_policy_methods"])}', ] - print('\n\t'.join(stats)) + print('\n\t', '\n\t'.join(stats), '\n', sep='') with open(path, 'w') as report_file: json.dump(self.result, report_file, indent=2) + + print(f'A JSON report has been written to {path.absolute()}') + print('=' * 50) diff --git a/modules/python/generator/visp_python_bindgen/generator.py b/modules/python/generator/visp_python_bindgen/generator.py index 1efff6ac82..ab3bf198b1 100644 --- a/modules/python/generator/visp_python_bindgen/generator.py +++ b/modules/python/generator/visp_python_bindgen/generator.py @@ -38,6 +38,7 @@ from pathlib import Path from multiprocessing import Pool import argparse +import logging from cxxheaderparser.errors import CxxParseError @@ -53,13 +54,15 @@ def header_preprocess(header: HeaderFile): header.preprocess() return header except Exception as e: - print('There was an error when processing header', header.path) + error_msg = 'There was an error when processing header' + str(header.path) + logging.error(error_msg) import traceback - traceback.print_exc() - print(type(e)) + logging.error(traceback.format_exc()) + logging.error(type(e)) if isinstance(e, CxxParseError): + logging.error(header.preprocessed_header_str) - print(header.preprocessed_header_str) + print(error_msg, 'See the text log in the build folder for more information.') return None @@ -147,9 +150,11 @@ def main(): args = parser.parse_args() generation_path = Path(args.build_folder) + logging.basicConfig(filename=str(generation_path / 'generation.log'), filemode='w', level=logging.DEBUG) assert generation_path.exists(), f'Path to where to generate bindings does not exist! Path: {generation_path}' - generation_path = generation_path / 'src' - generation_path.mkdir(exist_ok=True) + + generation_path_src = generation_path / 'src' + generation_path_src.mkdir(exist_ok=True) config_path = Path(args.config) assert config_path.exists(), f'Path to the folder containing the configuration files does not exist! Path: {config_path}' @@ -157,7 +162,7 @@ def main(): main_config_path = Path(args.main_config) assert main_config_path.exists(), f'Path to the main JSON configuration is invalid! Path: {main_config_path}' GeneratorConfig.update_from_main_config_file(main_config_path) - generate_module(generation_path, config_path) + generate_module(generation_path_src, config_path) if __name__ == '__main__': main() diff --git a/modules/python/generator/visp_python_bindgen/header.py b/modules/python/generator/visp_python_bindgen/header.py index fb6ddf2ae2..631ad434fe 100644 --- a/modules/python/generator/visp_python_bindgen/header.py +++ b/modules/python/generator/visp_python_bindgen/header.py @@ -33,10 +33,12 @@ # ############################################################################# + from typing import List, Optional, Dict from pathlib import Path from dataclasses import dataclass from collections import OrderedDict +import logging import pcpp from cxxheaderparser import types @@ -185,7 +187,7 @@ def parse_data(self, bindings_container: BindingsContainer) -> None: if self.documentation_holder_path is not None: self.documentation_holder = DocumentationHolder(self.documentation_holder_path, self.environment.mapping) else: - print(f'No documentation found for header {self.path}') + logging.warning(f'No documentation found for header {self.path}') for cls in self.header_repr.namespace.classes: self.generate_class(bindings_container, cls, self.environment) @@ -209,8 +211,8 @@ def parse_sub_namespace(self, bindings_container: BindingsContainer, ns: Namespa if NotGeneratedReason.is_non_trivial_reason(rejected_function.rejection_reason): rejection_strs.append(f'\t{rejected_function.signature} was rejected! Reason: {rejected_function.rejection_reason}') if len(rejection_strs) > 0: - print(f'Rejected function in namespace: {ns.name}') - print('\n'.join(rejection_strs)) + logging.warning(f'Rejected function in namespace: {ns.name}') + logging.warning('\n'.join(rejection_strs)) bound_object = BoundObjectNames('submodule', self.submodule.name, namespace_prefix, namespace_prefix) defs = [] @@ -235,7 +237,7 @@ def add_to_method_dict(key, value): if self.documentation_holder is not None: class_doc = self.documentation_holder.get_documentation_for_class(name_cpp_no_template, {}, owner_specs) else: - print(f'Documentation not found when looking up {name_cpp_no_template}') + logging.warning(f'Documentation not found when looking up {name_cpp_no_template}') # Declaration # Add template specializations to cpp class name. e.g., vpArray2D becomes vpArray2D if the template T is double template_decl: Optional[types.TemplateDecl] = cls.class_decl.template @@ -279,8 +281,8 @@ def add_to_method_dict(key, value): if NotGeneratedReason.is_non_trivial_reason(rejected_method.rejection_reason): rejection_strs.append(f'\t{rejected_method.signature} was rejected! Reason: {rejected_method.rejection_reason}') if len(rejection_strs) > 0: - print(f'Rejected method in class: {name_cpp}') - print('\n'.join(rejection_strs)) + logging.warning(f'Rejected method in class: {name_cpp}') + logging.warning('\n'.join(rejection_strs)) # Split between constructors and other methods constructors, non_constructors = split_methods_with_config(bindable_methods_and_config, lambda m: m.constructor) @@ -303,7 +305,7 @@ def add_to_method_dict(key, value): method.const, method.static) method_doc = self.documentation_holder.get_documentation_for_method(name_cpp_no_template, method_doc_signature, {}, owner_specs, param_names, []) if method_doc is None: - print(f'Could not find documentation for {name_cpp}::{method_name}!') + logging.warning(f'Could not find documentation for {name_cpp}::{method_name}!') else: py_arg_strs = [method_doc.documentation] + py_arg_strs @@ -324,7 +326,7 @@ def add_to_method_dict(key, value): py_args = get_py_args(method.parameters, owner_specs, header_env.mapping) py_args = py_args + ['py::is_operator()'] if len(params_strs) > 1: - print(f'Found operator {name_cpp}{method_name} with more than one parameter, skipping') + logging.info(f'Found operator {name_cpp}{method_name} with more than one parameter, skipping') rejection = RejectedMethod(name_cpp, method, method_config, get_method_signature(method_name, return_type_str, params_strs), NotGeneratedReason.NotHandled) self.submodule.report.add_non_generated_method(rejection) continue @@ -339,7 +341,7 @@ def add_to_method_dict(key, value): is_operator=True, is_constructor=False)) break - print(f'Found unary operator {name_cpp}::{method_name}, skipping') + logging.info(f'Found unary operator {name_cpp}::{method_name}, skipping') continue for cpp_op, python_op_name in binary_return_ops.items(): if method_name == f'operator{cpp_op}': @@ -433,20 +435,21 @@ def add_to_method_dict(key, value): # Check for potential error-generating definitions error_generating_overloads = get_static_and_instance_overloads(generated_methods) if len(error_generating_overloads) > 0: - print(f'Overloads defined for instance and class, this will generate a pybind error') - print(error_generating_overloads) + logging.error(f'Overloads defined for instance and class, this will generate a pybind error') + logging.error(error_generating_overloads) raise RuntimeError field_dict = {} for field in cls.fields: if field.name in cls_config['ignored_attributes']: + logging.info(f'Ignoring field in class/struct {name_cpp}: {field.name}') continue if field.access == 'public': if is_unsupported_argument_type(field.type): continue field_type = get_type(field.type, owner_specs, header_env.mapping) - print(f'Field in {name_cpp}: {field_type} {field.name}') + logging.info(f'Found field in class/struct {name_cpp}: {field_type} {field.name}') field_name_python = field.name.lstrip('m_') @@ -462,7 +465,7 @@ def add_to_method_dict(key, value): bindings_container.add_bindings(SingleObjectBindings(class_def_names, class_decl, classs_binding_defs, GenerationObjectType.Class)) name_cpp_no_template = '::'.join([seg.name for seg in cls.class_decl.typename.segments]) - print(f'Parsing class "{name_cpp_no_template}"') + logging.info(f'Parsing class "{name_cpp_no_template}"') if self.submodule.class_should_be_ignored(name_cpp_no_template): self.submodule.report.add_non_generated_class(name_cpp_no_template, {}, 'Skipped by user') @@ -474,7 +477,7 @@ def add_to_method_dict(key, value): return generate_class_with_potiental_specialization(name_python, {}, cls_config) else: if cls_config is None or 'specializations' not in cls_config or len(cls_config['specializations']) == 0: - print(f'Could not find template specialization for class {name_cpp_no_template}: skipping!') + logging.warning(f'Could not find template specialization for class {name_cpp_no_template}: skipping!') self.submodule.report.add_non_generated_class(name_cpp_no_template, cls_config, 'Skipped because there was no declared specializations') else: specs = cls_config['specializations'] diff --git a/modules/python/generator/visp_python_bindgen/header_utils.py b/modules/python/generator/visp_python_bindgen/header_utils.py index 468517028e..51ce4778d5 100644 --- a/modules/python/generator/visp_python_bindgen/header_utils.py +++ b/modules/python/generator/visp_python_bindgen/header_utils.py @@ -36,6 +36,8 @@ from typing import List, Set, Dict, Union import sys +import logging + from cxxheaderparser import types from cxxheaderparser.simple import ParsedData, NamespaceScope, ClassScope @@ -75,7 +77,11 @@ def add_level(result: List['HeaderFile'], remainder: List['HeaderFile'], depende else: new_remainder.append(header_file) if new_remainder == remainder: - print(f'Warning: Could not completely solve dependencies, generating but might have some errors\n Faulty headers: {[h.path.name for h in remainder]}', file=sys.stderr) + warning_msg = f''' + Warning: Could not completely solve dependencies, generating but might have some errors + Faulty headers: {[h.path.name for h in remainder]}''' + logging.warning(warning_msg) + print(warning_msg, file=sys.stderr) result.extend(remainder) else: add_level(result, new_remainder, set(new_dependencies)) diff --git a/modules/python/generator/visp_python_bindgen/methods.py b/modules/python/generator/visp_python_bindgen/methods.py index e7b11bdfcc..62a555d47f 100644 --- a/modules/python/generator/visp_python_bindgen/methods.py +++ b/modules/python/generator/visp_python_bindgen/methods.py @@ -33,6 +33,7 @@ # ############################################################################# +import logging from typing import Any, Callable, List, Optional, Tuple, Dict from enum import Enum from dataclasses import dataclass @@ -262,7 +263,7 @@ def define_method(method: types.Method, method_config: Dict, is_class_method, sp True, True) method_doc = header.documentation_holder.get_documentation_for_method(bound_object.cpp_no_template_name, method_doc_signature, {}, specs, input_param_names, output_param_names) if method_doc is None: - print(f'Could not find documentation for {bound_object.cpp_name}::{method_name}!') + logging.warning(f'Could not find documentation for {bound_object.cpp_name}::{method_name}!') else: py_arg_strs = [method_doc.documentation] + py_arg_strs diff --git a/modules/python/generator/visp_python_bindgen/submodule.py b/modules/python/generator/visp_python_bindgen/submodule.py index 42ae5dc2d9..fa4feb4cb6 100644 --- a/modules/python/generator/visp_python_bindgen/submodule.py +++ b/modules/python/generator/visp_python_bindgen/submodule.py @@ -151,7 +151,7 @@ def generate(self) -> None: with open(self.submodule_file_path, 'w') as submodule_file: submodule_file.write(format_str) - logs_path = self.submodule_file_path.parent / 'logs' + logs_path = self.submodule_file_path.parent.parent / 'logs' logs_path.mkdir(exist_ok=True) self.report.write(logs_path / f'{self.name}_log.json') diff --git a/modules/python/stubs/CMakeLists.txt b/modules/python/stubs/CMakeLists.txt index 81f42c0994..2a344c5a02 100644 --- a/modules/python/stubs/CMakeLists.txt +++ b/modules/python/stubs/CMakeLists.txt @@ -41,7 +41,7 @@ add_custom_target( visp_python_bindings_stubs COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_CURRENT_BINARY_DIR}/visp-stubs" COMMAND ${PYTHON3_EXECUTABLE} -m pip install ${_pip_args} pybind11-stubgen COMMAND ${PYTHON3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/run_stub_generator.py --output-root ${CMAKE_CURRENT_BINARY_DIR} - COMMAND ${PYTHON3_EXECUTABLE} -m pip install ${_pip_args} -v "${CMAKE_CURRENT_BINARY_DIR}" - + COMMAND ${PYTHON3_EXECUTABLE} -m pip install ${_pip_args} "${CMAKE_CURRENT_BINARY_DIR}" + COMMENT "Generating Python stubs with pybind11-stubgen..." DEPENDS visp_python_bindings_install ) From 327ed0a507849b3c7496026487f1c647338c1cd7 Mon Sep 17 00:00:00 2001 From: Fabien Spindler Date: Tue, 28 Nov 2023 17:58:10 +0100 Subject: [PATCH 129/169] Update doxygen config file with doxygen 1.9.8 --- doc/config-doxygen.in | 817 ++++++++++++++++++++++++++++-------------- 1 file changed, 543 insertions(+), 274 deletions(-) diff --git a/doc/config-doxygen.in b/doc/config-doxygen.in index d0bdb2bdc8..6d65f7d208 100644 --- a/doc/config-doxygen.in +++ b/doc/config-doxygen.in @@ -1,4 +1,4 @@ -# Doxyfile 1.8.17 +# Doxyfile 1.9.8 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project. @@ -12,6 +12,16 @@ # For lists, items can also be appended using: # TAG += value [value, ...] # Values that contain spaces should be placed between quotes (\" \"). +# +# Note: +# +# Use doxygen to compare the used configuration file with the template +# configuration file: +# doxygen -x [configFile] +# Use doxygen to compare the used configuration file with the template +# configuration file without replacing the environment variables or CMake type +# replacement variables: +# doxygen -x_noenv [configFile] #--------------------------------------------------------------------------- # Project related configuration options @@ -51,7 +61,7 @@ PROJECT_BRIEF = # pixels and the maximum width should not exceed 200 pixels. Doxygen will copy # the logo to the output directory. -PROJECT_LOGO = "@VISP_SOURCE_DIR@/doc/image/logo/img-logo-visp.png" +PROJECT_LOGO = @VISP_SOURCE_DIR@/doc/image/logo/img-logo-visp.png # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path # into which the generated documentation will be written. If a relative path is @@ -60,16 +70,28 @@ PROJECT_LOGO = "@VISP_SOURCE_DIR@/doc/image/logo/img-logo-visp.png" OUTPUT_DIRECTORY = doc -# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub- -# directories (in 2 levels) under the output directory of each output format and -# will distribute the generated files over these directories. Enabling this +# If the CREATE_SUBDIRS tag is set to YES then doxygen will create up to 4096 +# sub-directories (in 2 levels) under the output directory of each output format +# and will distribute the generated files over these directories. Enabling this # option can be useful when feeding doxygen a huge amount of source files, where # putting all generated files in the same directory would otherwise causes -# performance problems for the file system. +# performance problems for the file system. Adapt CREATE_SUBDIRS_LEVEL to +# control the number of sub-directories. # The default value is: NO. CREATE_SUBDIRS = NO +# Controls the number of sub-directories that will be created when +# CREATE_SUBDIRS tag is set to YES. Level 0 represents 16 directories, and every +# level increment doubles the number of directories, resulting in 4096 +# directories at level 8 which is the default and also the maximum value. The +# sub-directories are organized in 2 levels, the first level always has a fixed +# number of 16 directories. +# Minimum value: 0, maximum value: 8, default value: 8. +# This tag requires that the tag CREATE_SUBDIRS is set to YES. + +CREATE_SUBDIRS_LEVEL = 8 + # If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII # characters to appear in the names of generated files. If set to NO, non-ASCII # characters will be escaped, for example _xE3_x81_x84 will be used for Unicode @@ -81,26 +103,18 @@ ALLOW_UNICODE_NAMES = NO # The OUTPUT_LANGUAGE tag is used to specify the language in which all # documentation generated by doxygen is written. Doxygen will use this # information to generate all constant output in the proper language. -# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese, -# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States), -# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian, -# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages), -# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian, -# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian, -# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish, -# Ukrainian and Vietnamese. +# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Bulgarian, +# Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish, Dutch, English +# (United States), Esperanto, Farsi (Persian), Finnish, French, German, Greek, +# Hindi, Hungarian, Indonesian, Italian, Japanese, Japanese-en (Japanese with +# English messages), Korean, Korean-en (Korean with English messages), Latvian, +# Lithuanian, Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, +# Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, +# Swedish, Turkish, Ukrainian and Vietnamese. # The default value is: English. OUTPUT_LANGUAGE = English -# The OUTPUT_TEXT_DIRECTION tag is used to specify the direction in which all -# documentation generated by doxygen is written. Doxygen will use this -# information to generate all generated output in the proper direction. -# Possible values are: None, LTR, RTL and Context. -# The default value is: None. - -OUTPUT_TEXT_DIRECTION = None - # If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member # descriptions after the members that are listed in the file and class # documentation (similar to Javadoc). Set to NO to disable this. @@ -171,7 +185,6 @@ STRIP_FROM_PATH = STRIP_FROM_INC_PATH = @DOXYGEN_STRIP_FROM_INC_PATH@ - # If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but # less readable) file names. This can be useful is your file systems doesn't # support long names like on DOS, Mac, or CD-ROM. @@ -218,6 +231,14 @@ QT_AUTOBRIEF = NO MULTILINE_CPP_IS_BRIEF = NO +# By default Python docstrings are displayed as preformatted text and doxygen's +# special commands cannot be used. By setting PYTHON_DOCSTRING to NO the +# doxygen's special commands can be used and the contents of the docstring +# documentation blocks is shown as doxygen documentation. +# The default value is: YES. + +PYTHON_DOCSTRING = YES + # If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the # documentation from any documented member that it re-implements. # The default value is: YES. @@ -241,25 +262,19 @@ TAB_SIZE = 4 # the documentation. An alias has the form: # name=value # For example adding -# "sideeffect=@par Side Effects:\n" +# "sideeffect=@par Side Effects:^^" # will allow you to put the command \sideeffect (or @sideeffect) in the # documentation, which will result in a user-defined paragraph with heading -# "Side Effects:". You can put \n's in the value part of an alias to insert -# newlines (in the resulting output). You can put ^^ in the value part of an -# alias to insert a newline as if a physical newline was in the original file. -# When you need a literal { or } or , in the value part of an alias you have to -# escape them by means of a backslash (\), this can lead to conflicts with the -# commands \{ and \} for these it is advised to use the version @{ and @} or use -# a double escape (\\{ and \\}) +# "Side Effects:". Note that you cannot put \n's in the value part of an alias +# to insert newlines (in the resulting output). You can put ^^ in the value part +# of an alias to insert a newline as if a physical newline was in the original +# file. When you need a literal { or } or , in the value part of an alias you +# have to escape them by means of a backslash (\), this can lead to conflicts +# with the commands \{ and \} for these it is advised to use the version @{ and +# @} or use a double escape (\\{ and \\}) ALIASES = -# This tag can be used to specify a number of word-keyword mappings (TCL only). -# A mapping has the form "name=value". For example adding "class=itcl::class" -# will allow you to use the command class in the itcl::class meaning. - -TCL_SUBST = - # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources # only. Doxygen will then generate output that is more tailored for C. For # instance, some of the names that are used will be different. The list of all @@ -301,18 +316,21 @@ OPTIMIZE_OUTPUT_SLICE = NO # extension. Doxygen has a built-in mapping, but you can override or extend it # using this tag. The format is ext=language, where ext is a file extension, and # language is one of the parsers supported by doxygen: IDL, Java, JavaScript, -# Csharp (C#), C, C++, D, PHP, md (Markdown), Objective-C, Python, Slice, -# Fortran (fixed format Fortran: FortranFixed, free formatted Fortran: +# Csharp (C#), C, C++, Lex, D, PHP, md (Markdown), Objective-C, Python, Slice, +# VHDL, Fortran (fixed format Fortran: FortranFixed, free formatted Fortran: # FortranFree, unknown formatted Fortran: Fortran. In the later case the parser # tries to guess whether the code is fixed or free formatted code, this is the -# default for Fortran type files), VHDL, tcl. For instance to make doxygen treat -# .inc files as Fortran files (default is PHP), and .f files as C (default is -# Fortran), use: inc=Fortran f=C. +# default for Fortran type files). For instance to make doxygen treat .inc files +# as Fortran files (default is PHP), and .f files as C (default is Fortran), +# use: inc=Fortran f=C. # # Note: For files without extension you can use no_extension as a placeholder. # # Note that for custom extensions you also need to set FILE_PATTERNS otherwise -# the files are not read by doxygen. +# the files are not read by doxygen. When specifying no_extension you should add +# * to the FILE_PATTERNS. +# +# Note see also the list of default file extension mappings. EXTENSION_MAPPING = json=JavaScript @@ -335,6 +353,17 @@ MARKDOWN_SUPPORT = YES TOC_INCLUDE_HEADINGS = 0 +# The MARKDOWN_ID_STYLE tag can be used to specify the algorithm used to +# generate identifiers for the Markdown headings. Note: Every identifier is +# unique. +# Possible values are: DOXYGEN use a fixed 'autotoc_md' string followed by a +# sequence number starting at 0 and GITHUB use the lower case version of title +# with any whitespace replaced by '-' and punctuation characters removed. +# The default value is: DOXYGEN. +# This tag requires that the tag MARKDOWN_SUPPORT is set to YES. + +MARKDOWN_ID_STYLE = DOXYGEN + # When enabled doxygen tries to link words that correspond to documented # classes, or namespaces to their corresponding documentation. Such a link can # be prevented in individual cases by putting a % sign in front of the word or @@ -446,6 +475,27 @@ TYPEDEF_HIDES_STRUCT = NO LOOKUP_CACHE_SIZE = 1 +# The NUM_PROC_THREADS specifies the number of threads doxygen is allowed to use +# during processing. When set to 0 doxygen will based this on the number of +# cores available in the system. You can set it explicitly to a value larger +# than 0 to get more control over the balance between CPU load and processing +# speed. At this moment only the input processing can be done using multiple +# threads. Since this is still an experimental feature the default is set to 1, +# which effectively disables parallel processing. Please report any issues you +# encounter. Generating dot graphs in parallel is controlled by the +# DOT_NUM_THREADS setting. +# Minimum value: 0, maximum value: 32, default value: 1. + +NUM_PROC_THREADS = 1 + +# If the TIMESTAMP tag is set different from NO then each generated page will +# contain the date or date and time when the page was generated. Setting this to +# NO can help when comparing the output of multiple runs. +# Possible values are: YES, NO, DATETIME and DATE. +# The default value is: NO. + +TIMESTAMP = NO + #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- @@ -509,6 +559,13 @@ EXTRACT_LOCAL_METHODS = NO EXTRACT_ANON_NSPACES = NO +# If this flag is set to YES, the name of an unnamed parameter in a declaration +# will be determined by the corresponding definition. By default unnamed +# parameters remain unnamed in the output. +# The default value is: YES. + +RESOLVE_UNNAMED_PARAMS = YES + # If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all # undocumented members inside documented classes or files. If set to NO these # members will be included in the various overviews, but no documentation @@ -520,7 +577,8 @@ HIDE_UNDOC_MEMBERS = NO # If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all # undocumented classes that are normally visible in the class hierarchy. If set # to NO, these classes will be included in the various overviews. This option -# has no effect if EXTRACT_ALL is enabled. +# will also hide undocumented C++ concepts if enabled. This option has no effect +# if EXTRACT_ALL is enabled. # The default value is: NO. HIDE_UNDOC_CLASSES = NO @@ -546,12 +604,20 @@ HIDE_IN_BODY_DOCS = NO INTERNAL_DOCS = NO -# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file -# names in lower-case letters. If set to YES, upper-case letters are also -# allowed. This is useful if you have classes or files whose names only differ -# in case and if your file system supports case sensitive file names. Windows -# (including Cygwin) ands Mac users are advised to set this option to NO. -# The default value is: system dependent. +# With the correct setting of option CASE_SENSE_NAMES doxygen will better be +# able to match the capabilities of the underlying filesystem. In case the +# filesystem is case sensitive (i.e. it supports files in the same directory +# whose names only differ in casing), the option must be set to YES to properly +# deal with such files in case they appear in the input. For filesystems that +# are not case sensitive the option should be set to NO to properly deal with +# output files written for symbols that only differ in casing, such as for two +# classes, one named CLASS and the other named Class, and to also support +# references to files without having to specify the exact matching casing. On +# Windows (including Cygwin) and MacOS, users should typically set this option +# to NO, whereas on Linux or other Unix flavors it should typically be set to +# YES. +# Possible values are: SYSTEM, NO and YES. +# The default value is: SYSTEM. CASE_SENSE_NAMES = YES @@ -569,6 +635,12 @@ HIDE_SCOPE_NAMES = NO HIDE_COMPOUND_REFERENCE= NO +# If the SHOW_HEADERFILE tag is set to YES then the documentation for a class +# will show which file needs to be included to use the class. +# The default value is: YES. + +SHOW_HEADERFILE = YES + # If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of # the files that are included by a file in the documentation of that file. # The default value is: YES. @@ -726,7 +798,8 @@ FILE_VERSION_FILTER = # output files in an output format independent way. To create the layout file # that represents doxygen's defaults, run doxygen with the -l option. You can # optionally specify a file name after the option, if omitted DoxygenLayout.xml -# will be used as the name of the layout file. +# will be used as the name of the layout file. See also section "Changing the +# layout of pages" for information. # # Note that if you run doxygen from a directory containing a file called # DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE @@ -772,24 +845,50 @@ WARNINGS = YES WARN_IF_UNDOCUMENTED = YES # If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for -# potential errors in the documentation, such as not documenting some parameters -# in a documented function, or documenting parameters that don't exist or using -# markup commands wrongly. +# potential errors in the documentation, such as documenting some parameters in +# a documented function twice, or documenting parameters that don't exist or +# using markup commands wrongly. # The default value is: YES. WARN_IF_DOC_ERROR = YES +# If WARN_IF_INCOMPLETE_DOC is set to YES, doxygen will warn about incomplete +# function parameter documentation. If set to NO, doxygen will accept that some +# parameters have no documentation without warning. +# The default value is: YES. + +WARN_IF_INCOMPLETE_DOC = YES + # This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that # are documented, but have no documentation for their parameters or return -# value. If set to NO, doxygen will only warn about wrong or incomplete -# parameter documentation, but not about the absence of documentation. If -# EXTRACT_ALL is set to YES then this flag will automatically be disabled. +# value. If set to NO, doxygen will only warn about wrong parameter +# documentation, but not about the absence of documentation. If EXTRACT_ALL is +# set to YES then this flag will automatically be disabled. See also +# WARN_IF_INCOMPLETE_DOC # The default value is: NO. WARN_NO_PARAMDOC = NO +# If WARN_IF_UNDOC_ENUM_VAL option is set to YES, doxygen will warn about +# undocumented enumeration values. If set to NO, doxygen will accept +# undocumented enumeration values. If EXTRACT_ALL is set to YES then this flag +# will automatically be disabled. +# The default value is: NO. + +WARN_IF_UNDOC_ENUM_VAL = NO + # If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when -# a warning is encountered. +# a warning is encountered. If the WARN_AS_ERROR tag is set to FAIL_ON_WARNINGS +# then doxygen will continue running as if WARN_AS_ERROR tag is set to NO, but +# at the end of the doxygen process doxygen will return with a non-zero status. +# If the WARN_AS_ERROR tag is set to FAIL_ON_WARNINGS_PRINT then doxygen behaves +# like FAIL_ON_WARNINGS but in case no WARN_LOGFILE is defined doxygen will not +# write the warning messages in between other messages but write them at the end +# of a run, in case a WARN_LOGFILE is defined the warning messages will be +# besides being in the defined file also be shown at the end of a run, unless +# the WARN_LOGFILE is defined as - i.e. standard output (stdout) in that case +# the behavior will remain as with the setting FAIL_ON_WARNINGS. +# Possible values are: NO, YES, FAIL_ON_WARNINGS and FAIL_ON_WARNINGS_PRINT. # The default value is: NO. WARN_AS_ERROR = NO @@ -800,13 +899,27 @@ WARN_AS_ERROR = NO # and the warning text. Optionally the format may contain $version, which will # be replaced by the version of the file (if it could be obtained via # FILE_VERSION_FILTER) +# See also: WARN_LINE_FORMAT # The default value is: $file:$line: $text. WARN_FORMAT = "$file:$line: $text" +# In the $text part of the WARN_FORMAT command it is possible that a reference +# to a more specific place is given. To make it easier to jump to this place +# (outside of doxygen) the user can define a custom "cut" / "paste" string. +# Example: +# WARN_LINE_FORMAT = "'vi $file +$line'" +# See also: WARN_FORMAT +# The default value is: at line $line of file $file. + +WARN_LINE_FORMAT = "at line $line of file $file" + # The WARN_LOGFILE tag can be used to specify a file to which warning and error # messages should be written. If left blank the output is written to standard -# error (stderr). +# error (stderr). In case the file specified cannot be opened for writing the +# warning and error messages are written to standard error. When as file - is +# specified the warning and error messages are written to standard output +# (stdout). WARN_LOGFILE = warning.log @@ -825,12 +938,23 @@ INPUT = @DOXYGEN_INPUTS@ # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses # libiconv (or the iconv built into libc) for the transcoding. See the libiconv -# documentation (see: https://www.gnu.org/software/libiconv/) for the list of -# possible encodings. +# documentation (see: +# https://www.gnu.org/software/libiconv/) for the list of possible encodings. +# See also: INPUT_FILE_ENCODING # The default value is: UTF-8. INPUT_ENCODING = UTF-8 +# This tag can be used to specify the character encoding of the source files +# that doxygen parses The INPUT_FILE_ENCODING tag can be used to specify +# character encoding on a per file pattern basis. Doxygen will compare the file +# name with each pattern and apply the encoding instead of the default +# INPUT_ENCODING) if there is a match. The character encodings are a list of the +# form: pattern=encoding (like *.php=ISO-8859-1). See cfg_input_encoding +# "INPUT_ENCODING" for further information on supported encodings. + +INPUT_FILE_ENCODING = + # If the value of the INPUT tag contains directories, you can use the # FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and # *.h) to filter out the source-files in the directories. @@ -839,13 +963,15 @@ INPUT_ENCODING = UTF-8 # need to set EXTENSION_MAPPING for the extension otherwise the files are not # read by doxygen. # -# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp, -# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, -# *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, -# *.m, *.markdown, *.md, *.mm, *.dox (to be provided as doxygen C comment), -# *.doc (to be provided as doxygen C comment), *.txt (to be provided as doxygen -# C comment), *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, *.f, *.for, *.tcl, *.vhd, -# *.vhdl, *.ucf, *.qsf and *.ice. +# Note the list of default checked file patterns might differ from the list of +# default file extension mappings. +# +# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cxxm, +# *.cpp, *.cppm, *.c++, *.c++m, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, +# *.ddl, *.odl, *.h, *.hh, *.hxx, *.hpp, *.h++, *.ixx, *.l, *.cs, *.d, *.php, +# *.php4, *.php5, *.phtml, *.inc, *.m, *.markdown, *.md, *.mm, *.dox (to be +# provided as doxygen C comment), *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, +# *.f18, *.f, *.for, *.vhd, *.vhdl, *.ucf, *.qsf and *.ice. FILE_PATTERNS = *.h \ *.cpp \ @@ -895,10 +1021,7 @@ EXCLUDE_PATTERNS = *_impl.h \ # (namespaces, classes, functions, etc.) that should be excluded from the # output. The symbol name can be a fully qualified name, a word, or if the # wildcard * is used, a substring. Examples: ANamespace, AClass, -# AClass::ANamespace, ANamespace::*Test -# -# Note that the wildcards are matched against the file with absolute path, so to -# exclude all test directories use the pattern */test/* +# ANamespace::AClass, ANamespace::*Test EXCLUDE_SYMBOLS = @@ -910,8 +1033,7 @@ EXAMPLE_PATH = "@VISP_SOURCE_DIR@/example" \ "@VISP_SOURCE_DIR@/tutorial" \ "@VISP_SOURCE_DIR@/demo" \ "@VISP_SOURCE_DIR@/modules" \ - "@VISP_SOURCE_DIR@/script" \ - + "@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 @@ -948,6 +1070,11 @@ IMAGE_PATH = @DOXYGEN_IMAGE_PATH@ # code is scanned, but not when the output code is generated. If lines are added # or removed, the anchors will not be placed correctly. # +# Note that doxygen will use the data processed and written to standard output +# for further processing, therefore nothing else, like debug statements or used +# commands (so in case of a Windows batch file always use @echo OFF), should be +# written to standard output. +# # Note that for custom extensions or not directly supported extensions you also # need to set EXTENSION_MAPPING for the extension otherwise the files are not # properly processed by doxygen. @@ -989,6 +1116,15 @@ FILTER_SOURCE_PATTERNS = USE_MDFILE_AS_MAINPAGE = +# The Fortran standard specifies that for fixed formatted Fortran code all +# characters from position 72 are to be considered as comment. A common +# extension is to allow longer lines before the automatic comment starts. The +# setting FORTRAN_COMMENT_AFTER will also make it possible that longer lines can +# be processed before the automatic comment starts. +# Minimum value: 7, maximum value: 10000, default value: 72. + +FORTRAN_COMMENT_AFTER = 72 + #--------------------------------------------------------------------------- # Configuration options related to source browsing #--------------------------------------------------------------------------- @@ -1086,17 +1222,11 @@ VERBATIM_HEADERS = YES ALPHABETICAL_INDEX = YES -# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in -# which the alphabetical index list will be split. -# Minimum value: 1, maximum value: 20, default value: 5. -# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. - -COLS_IN_ALPHA_INDEX = 4 - -# In case all classes in a project start with a common prefix, all classes will -# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag -# can be used to specify a prefix (or a list of prefixes) that should be ignored -# while generating the index headers. +# The IGNORE_PREFIX tag can be used to specify a prefix (or a list of prefixes) +# that should be ignored while generating the index headers. The IGNORE_PREFIX +# tag works for classes, function and member names. The entity will be placed in +# the alphabetical list under the first letter of the entity name that remains +# after removing the prefix. # This tag requires that the tag ALPHABETICAL_INDEX is set to YES. IGNORE_PREFIX = vp @@ -1175,7 +1305,12 @@ HTML_STYLESHEET = # Doxygen will copy the style sheet files to the output directory. # Note: The order of the extra style sheet files is of importance (e.g. the last # style sheet in the list overrules the setting of the previous ones in the -# list). For an example see the documentation. +# list). +# Note: Since the styling of scrollbars can currently not be overruled in +# Webkit/Chromium, the styling will be left out of the default doxygen.css if +# one or more extra stylesheets have been specified. So if scrollbar +# customization is desired it has to be added explicitly. For an example see the +# documentation. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_EXTRA_STYLESHEET = @@ -1190,9 +1325,22 @@ HTML_EXTRA_STYLESHEET = HTML_EXTRA_FILES = +# The HTML_COLORSTYLE tag can be used to specify if the generated HTML output +# should be rendered with a dark or light theme. +# Possible values are: LIGHT always generate light mode output, DARK always +# generate dark mode output, AUTO_LIGHT automatically set the mode according to +# the user preference, use light mode if no preference is set (the default), +# AUTO_DARK automatically set the mode according to the user preference, use +# dark mode if no preference is set and TOGGLE allow to user to switch between +# light and dark mode via a button. +# The default value is: AUTO_LIGHT. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE = AUTO_LIGHT + # The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen # will adjust the colors in the style sheet and background images according to -# this color. Hue is specified as an angle on a colorwheel, see +# this color. Hue is specified as an angle on a color-wheel, see # https://en.wikipedia.org/wiki/Hue for more information. For instance the value # 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 # purple, and 360 is red again. @@ -1202,7 +1350,7 @@ HTML_EXTRA_FILES = HTML_COLORSTYLE_HUE = 220 # The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors -# in the HTML output. For a value of 0 the output will use grayscales only. A +# in the HTML output. For a value of 0 the output will use gray-scales only. A # value of 255 will produce the most vivid colors. # Minimum value: 0, maximum value: 255, default value: 100. # This tag requires that the tag GENERATE_HTML is set to YES. @@ -1220,15 +1368,6 @@ HTML_COLORSTYLE_SAT = 100 HTML_COLORSTYLE_GAMMA = 80 -# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML -# page will contain the date and time when the page was generated. Setting this -# to YES can help to show when doxygen was last run and thus if the -# documentation is up to date. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_TIMESTAMP = NO - # If the HTML_DYNAMIC_MENUS tag is set to YES then the generated HTML # documentation will contain a main index with vertical navigation menus that # are dynamically created via JavaScript. If disabled, the navigation index will @@ -1248,6 +1387,13 @@ HTML_DYNAMIC_MENUS = YES HTML_DYNAMIC_SECTIONS = YES +# If the HTML_CODE_FOLDING tag is set to YES then classes and functions can be +# dynamically folded and expanded in the generated HTML source code. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_CODE_FOLDING = YES + # With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries # shown in the various tree structured indices initially; the user can expand # and collapse entries dynamically later on. Doxygen will expand the tree to @@ -1263,10 +1409,11 @@ HTML_INDEX_NUM_ENTRIES = 100 # If the GENERATE_DOCSET tag is set to YES, additional index files will be # generated that can be used as input for Apple's Xcode 3 integrated development -# environment (see: https://developer.apple.com/xcode/), introduced with OSX -# 10.5 (Leopard). To create a documentation set, doxygen will generate a -# Makefile in the HTML output directory. Running make will produce the docset in -# that directory and running make install will install the docset in +# environment (see: +# https://developer.apple.com/xcode/), introduced with OSX 10.5 (Leopard). To +# create a documentation set, doxygen will generate a Makefile in the HTML +# output directory. Running make will produce the docset in that directory and +# running make install will install the docset in # ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at # startup. See https://developer.apple.com/library/archive/featuredarticles/Doxy # genXcode/_index.html for more information. @@ -1283,6 +1430,13 @@ GENERATE_DOCSET = NO DOCSET_FEEDNAME = "Doxygen generated docs" +# This tag determines the URL of the docset feed. A documentation feed provides +# an umbrella under which multiple documentation sets from a single provider +# (such as a company or product suite) can be grouped. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_FEEDURL = + # This tag specifies a string that should uniquely identify the documentation # set bundle. This should be a reverse domain-name style string, e.g. # com.mycompany.MyDocSet. Doxygen will append .docset to the name. @@ -1308,8 +1462,12 @@ DOCSET_PUBLISHER_NAME = Publisher # If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three # additional HTML index files: index.hhp, index.hhc, and index.hhk. The # index.hhp is a project file that can be read by Microsoft's HTML Help Workshop -# (see: https://www.microsoft.com/en-us/download/details.aspx?id=21138) on -# Windows. +# on Windows. In the beginning of 2021 Microsoft took the original page, with +# a.o. the download links, offline the HTML help workshop was already many years +# in maintenance mode). You can download the HTML help workshop from the web +# archives at Installation executable (see: +# http://web.archive.org/web/20160201063255/http://download.microsoft.com/downlo +# ad/0/A/9/0A939EF6-E31C-430F-A3DF-DFAE7960D564/htmlhelp.exe). # # The HTML Help Workshop contains a compiler that can convert all HTML output # generated by doxygen into a single compiled HTML file (.chm). Compiled HTML @@ -1339,7 +1497,7 @@ CHM_FILE = HHC_LOCATION = # The GENERATE_CHI flag controls if a separate .chi index file is generated -# (YES) or that it should be included in the master .chm file (NO). +# (YES) or that it should be included in the main .chm file (NO). # The default value is: NO. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. @@ -1366,6 +1524,16 @@ BINARY_TOC = NO TOC_EXPAND = NO +# The SITEMAP_URL tag is used to specify the full URL of the place where the +# generated documentation will be placed on the server by the user during the +# deployment of the documentation. The generated sitemap is called sitemap.xml +# and placed on the directory specified by HTML_OUTPUT. In case no SITEMAP_URL +# is specified no sitemap is generated. For information about the sitemap +# protocol see https://www.sitemaps.org +# This tag requires that the tag GENERATE_HTML is set to YES. + +SITEMAP_URL = + # If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and # QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that # can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help @@ -1384,7 +1552,8 @@ QCH_FILE = # The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help # Project output. For more information please see Qt Help Project / Namespace -# (see: https://doc.qt.io/archives/qt-4.8/qthelpproject.html#namespace). +# (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#namespace). # The default value is: org.doxygen.Project. # This tag requires that the tag GENERATE_QHP is set to YES. @@ -1392,8 +1561,8 @@ QHP_NAMESPACE = # The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt # Help Project output. For more information please see Qt Help Project / Virtual -# Folders (see: https://doc.qt.io/archives/qt-4.8/qthelpproject.html#virtual- -# folders). +# Folders (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#virtual-folders). # The default value is: doc. # This tag requires that the tag GENERATE_QHP is set to YES. @@ -1401,16 +1570,16 @@ QHP_VIRTUAL_FOLDER = doc # If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom # filter to add. For more information please see Qt Help Project / Custom -# Filters (see: https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom- -# filters). +# Filters (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-filters). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_CUST_FILTER_NAME = # The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the # custom filter to add. For more information please see Qt Help Project / Custom -# Filters (see: https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom- -# filters). +# Filters (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-filters). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_CUST_FILTER_ATTRS = @@ -1422,9 +1591,9 @@ QHP_CUST_FILTER_ATTRS = QHP_SECT_FILTER_ATTRS = -# The QHG_LOCATION tag can be used to specify the location of Qt's -# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the -# generated .qhp file. +# The QHG_LOCATION tag can be used to specify the location (absolute path +# including file name) of Qt's qhelpgenerator. If non-empty doxygen will try to +# run qhelpgenerator on the generated .qhp file. # This tag requires that the tag GENERATE_QHP is set to YES. QHG_LOCATION = @@ -1467,16 +1636,28 @@ DISABLE_INDEX = NO # to work a browser that supports JavaScript, DHTML, CSS and frames is required # (i.e. any modern browser). Windows users are probably better off using the # HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can -# further fine-tune the look of the index. As an example, the default style -# sheet generated by doxygen has an example that shows how to put an image at -# the root of the tree instead of the PROJECT_NAME. Since the tree basically has -# the same information as the tab index, you could consider setting -# DISABLE_INDEX to YES when enabling this option. +# further fine tune the look of the index (see "Fine-tuning the output"). As an +# example, the default style sheet generated by doxygen has an example that +# shows how to put an image at the root of the tree instead of the PROJECT_NAME. +# Since the tree basically has the same information as the tab index, you could +# consider setting DISABLE_INDEX to YES when enabling this option. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. GENERATE_TREEVIEW = YES +# When both GENERATE_TREEVIEW and DISABLE_INDEX are set to YES, then the +# FULL_SIDEBAR option determines if the side bar is limited to only the treeview +# area (value NO) or if it should extend to the full height of the window (value +# YES). Setting this to YES gives a layout similar to +# https://docs.readthedocs.io with more room for contents, but less room for the +# project logo, title, and description. If either GENERATE_TREEVIEW or +# DISABLE_INDEX is set to NO, this option has no effect. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FULL_SIDEBAR = NO + # The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that # doxygen will group on one line in the generated HTML documentation. # @@ -1501,6 +1682,24 @@ TREEVIEW_WIDTH = 250 EXT_LINKS_IN_WINDOW = NO +# If the OBFUSCATE_EMAILS tag is set to YES, doxygen will obfuscate email +# addresses. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +OBFUSCATE_EMAILS = YES + +# If the HTML_FORMULA_FORMAT option is set to svg, doxygen will use the pdf2svg +# tool (see https://github.com/dawbarton/pdf2svg) or inkscape (see +# https://inkscape.org) to generate formulas as SVG images instead of PNGs for +# the HTML output. These images will generally look nicer at scaled resolutions. +# Possible values are: png (the default) and svg (looks nicer but requires the +# pdf2svg or inkscape tool). +# The default value is: png. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FORMULA_FORMAT = png + # Use this tag to change the font size of LaTeX formulas included as images in # the HTML documentation. When you change the font size after a successful # doxygen run you need to manually remove any form_*.png images from the HTML @@ -1510,17 +1709,6 @@ EXT_LINKS_IN_WINDOW = NO FORMULA_FONTSIZE = 10 -# Use the FORMULA_TRANSPARENT tag to determine whether or not the images -# generated for formulas are transparent PNGs. Transparent PNGs are not -# supported properly for IE 6.0, but are supported on all modern browsers. -# -# Note that when changing this option you need to delete any form_*.png files in -# the HTML output directory before the changes have effect. -# The default value is: YES. -# This tag requires that the tag GENERATE_HTML is set to YES. - -FORMULA_TRANSPARENT = YES - # The FORMULA_MACROFILE can contain LaTeX \newcommand and \renewcommand commands # to create new LaTeX commands to be used in formulas as building blocks. See # the section "Including formulas" for details. @@ -1538,11 +1726,29 @@ FORMULA_MACROFILE = USE_MATHJAX = @DOXYGEN_USE_MATHJAX@ +# With MATHJAX_VERSION it is possible to specify the MathJax version to be used. +# Note that the different versions of MathJax have different requirements with +# regards to the different settings, so it is possible that also other MathJax +# settings have to be changed when switching between the different MathJax +# versions. +# Possible values are: MathJax_2 and MathJax_3. +# The default value is: MathJax_2. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_VERSION = MathJax_2 + # When MathJax is enabled you can set the default output format to be used for -# the MathJax output. See the MathJax site (see: -# http://docs.mathjax.org/en/latest/output.html) for more details. +# the MathJax output. For more details about the output format see MathJax +# version 2 (see: +# http://docs.mathjax.org/en/v2.7-latest/output.html) and MathJax version 3 +# (see: +# http://docs.mathjax.org/en/latest/web/components/output.html). # Possible values are: HTML-CSS (which is slower, but has the best -# compatibility), NativeMML (i.e. MathML) and SVG. +# compatibility. This is the name for Mathjax version 2, for MathJax version 3 +# this will be translated into chtml), NativeMML (i.e. MathML. Only supported +# for NathJax 2. For MathJax version 3 chtml will be used instead.), chtml (This +# is the name for Mathjax version 3, for MathJax version 2 this will be +# translated into HTML-CSS) and SVG. # The default value is: HTML-CSS. # This tag requires that the tag USE_MATHJAX is set to YES. @@ -1555,22 +1761,29 @@ MATHJAX_FORMAT = HTML-CSS # MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax # Content Delivery Network so you can quickly see the result without installing # MathJax. However, it is strongly recommended to install a local copy of -# MathJax from https://www.mathjax.org before deployment. -# The default value is: https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/. +# MathJax from https://www.mathjax.org before deployment. The default value is: +# - in case of MathJax version 2: https://cdn.jsdelivr.net/npm/mathjax@2 +# - in case of MathJax version 3: https://cdn.jsdelivr.net/npm/mathjax@3 # This tag requires that the tag USE_MATHJAX is set to YES. MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest # The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax # extension names that should be enabled during MathJax rendering. For example +# for MathJax version 2 (see +# https://docs.mathjax.org/en/v2.7-latest/tex.html#tex-and-latex-extensions): # MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols +# For example for MathJax version 3 (see +# http://docs.mathjax.org/en/latest/input/tex/extensions/index.html): +# MATHJAX_EXTENSIONS = ams # This tag requires that the tag USE_MATHJAX is set to YES. MATHJAX_EXTENSIONS = # The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces # of code that will be used on startup of the MathJax code. See the MathJax site -# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an +# (see: +# http://docs.mathjax.org/en/v2.7-latest/output.html) for more details. For an # example see the documentation. # This tag requires that the tag USE_MATHJAX is set to YES. @@ -1617,7 +1830,8 @@ SERVER_BASED_SEARCH = NO # # Doxygen ships with an example indexer (doxyindexer) and search engine # (doxysearch.cgi) which are based on the open source search engine library -# Xapian (see: https://xapian.org/). +# Xapian (see: +# https://xapian.org/). # # See the section "External Indexing and Searching" for details. # The default value is: NO. @@ -1630,8 +1844,9 @@ EXTERNAL_SEARCH = NO # # Doxygen ships with an example indexer (doxyindexer) and search engine # (doxysearch.cgi) which are based on the open source search engine library -# Xapian (see: https://xapian.org/). See the section "External Indexing and -# Searching" for details. +# Xapian (see: +# https://xapian.org/). See the section "External Indexing and Searching" for +# details. # This tag requires that the tag SEARCHENGINE is set to YES. SEARCHENGINE_URL = @@ -1689,7 +1904,7 @@ LATEX_OUTPUT = latex # the output language. # This tag requires that the tag GENERATE_LATEX is set to YES. -LATEX_CMD_NAME = "@LATEX_COMPILER@" +LATEX_CMD_NAME = @LATEX_COMPILER@ # The MAKEINDEX_CMD_NAME tag can be used to specify the command name to generate # index for LaTeX. @@ -1699,7 +1914,7 @@ LATEX_CMD_NAME = "@LATEX_COMPILER@" # The default file is: makeindex. # This tag requires that the tag GENERATE_LATEX is set to YES. -MAKEINDEX_CMD_NAME = "@MAKEINDEX_COMPILER@" +MAKEINDEX_CMD_NAME = @MAKEINDEX_COMPILER@ # The LATEX_MAKEINDEX_CMD tag can be used to specify the command name to # generate index for LaTeX. In case there is no backslash (\) as first character @@ -1742,29 +1957,31 @@ EXTRA_PACKAGES = amsmath \ xr \ amsfonts -# The LATEX_HEADER tag can be used to specify a personal LaTeX header for the -# generated LaTeX document. The header should contain everything until the first -# chapter. If it is left blank doxygen will generate a standard header. See -# section "Doxygen usage" for information on how to let doxygen write the -# default header to a separate file. +# The LATEX_HEADER tag can be used to specify a user-defined LaTeX header for +# the generated LaTeX document. The header should contain everything until the +# first chapter. If it is left blank doxygen will generate a standard header. It +# is highly recommended to start with a default header using +# doxygen -w latex new_header.tex new_footer.tex new_stylesheet.sty +# and then modify the file new_header.tex. See also section "Doxygen usage" for +# information on how to generate the default header that doxygen normally uses. # -# Note: Only use a user-defined header if you know what you are doing! The -# following commands have a special meaning inside the header: $title, -# $datetime, $date, $doxygenversion, $projectname, $projectnumber, -# $projectbrief, $projectlogo. Doxygen will replace $title with the empty -# string, for the replacement values of the other commands the user is referred -# to HTML_HEADER. +# Note: Only use a user-defined header if you know what you are doing! +# Note: The header is subject to change so you typically have to regenerate the +# default header when upgrading to a newer version of doxygen. The following +# commands have a special meaning inside the header (and footer): For a +# description of the possible markers and block names see the documentation. # This tag requires that the tag GENERATE_LATEX is set to YES. LATEX_HEADER = -# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for the -# generated LaTeX document. The footer should contain everything after the last -# chapter. If it is left blank doxygen will generate a standard footer. See +# The LATEX_FOOTER tag can be used to specify a user-defined LaTeX footer for +# the generated LaTeX document. The footer should contain everything after the +# last chapter. If it is left blank doxygen will generate a standard footer. See # LATEX_HEADER for more information on how to generate a default footer and what -# special commands can be used inside the footer. -# -# Note: Only use a user-defined footer if you know what you are doing! +# special commands can be used inside the footer. See also section "Doxygen +# usage" for information on how to generate the default footer that doxygen +# normally uses. Note: Only use a user-defined footer if you know what you are +# doing! # This tag requires that the tag GENERATE_LATEX is set to YES. LATEX_FOOTER = @@ -1797,18 +2014,26 @@ LATEX_EXTRA_FILES = PDF_HYPERLINKS = NO -# If the USE_PDFLATEX tag is set to YES, doxygen will use pdflatex to generate -# the PDF file directly from the LaTeX files. Set this option to YES, to get a -# higher quality PDF documentation. +# If the USE_PDFLATEX tag is set to YES, doxygen will use the engine as +# specified with LATEX_CMD_NAME to generate the PDF file directly from the LaTeX +# files. Set this option to YES, to get a higher quality PDF documentation. +# +# See also section LATEX_CMD_NAME for selecting the engine. # The default value is: YES. # This tag requires that the tag GENERATE_LATEX is set to YES. USE_PDFLATEX = NO -# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \batchmode -# command to the generated LaTeX files. This will instruct LaTeX to keep running -# if errors occur, instead of asking the user for help. This option is also used -# when generating formulas in HTML. +# The LATEX_BATCHMODE tag signals the behavior of LaTeX in case of an error. +# Possible values are: NO same as ERROR_STOP, YES same as BATCH, BATCH In batch +# mode nothing is printed on the terminal, errors are scrolled as if is +# hit at every error; missing files that TeX tries to input or request from +# keyboard input (\read on a not open input stream) cause the job to abort, +# NON_STOP In nonstop mode the diagnostic message will appear on the terminal, +# but there is no possibility of user interaction just like in batch mode, +# SCROLL In scroll mode, TeX will stop only for missing files to input or if +# keyboard input is necessary and ERROR_STOP In errorstop mode, TeX will stop at +# each error, asking for user intervention. # The default value is: NO. # This tag requires that the tag GENERATE_LATEX is set to YES. @@ -1821,16 +2046,6 @@ LATEX_BATCHMODE = NO LATEX_HIDE_INDICES = NO -# If the LATEX_SOURCE_CODE tag is set to YES then doxygen will include source -# code with syntax highlighting in the LaTeX output. -# -# Note that which sources are shown also depends on other settings such as -# SOURCE_BROWSER. -# The default value is: NO. -# This tag requires that the tag GENERATE_LATEX is set to YES. - -LATEX_SOURCE_CODE = NO - # The LATEX_BIB_STYLE tag can be used to specify the style to use for the # bibliography, e.g. plainnat, or ieeetr. See # https://en.wikipedia.org/wiki/BibTeX and \cite for more info. @@ -1839,14 +2054,6 @@ LATEX_SOURCE_CODE = NO LATEX_BIB_STYLE = plain -# If the LATEX_TIMESTAMP tag is set to YES then the footer of each generated -# page will contain the date and time when the page was generated. Setting this -# to NO can help when comparing the output of multiple runs. -# The default value is: NO. -# This tag requires that the tag GENERATE_LATEX is set to YES. - -LATEX_TIMESTAMP = NO - # The LATEX_EMOJI_DIRECTORY tag is used to specify the (relative or absolute) # path from which the emoji images will be read. If a relative path is entered, # it will be relative to the LATEX_OUTPUT directory. If left blank the @@ -1911,16 +2118,6 @@ RTF_STYLESHEET_FILE = RTF_EXTENSIONS_FILE = -# If the RTF_SOURCE_CODE tag is set to YES then doxygen will include source code -# with syntax highlighting in the RTF output. -# -# Note that which sources are shown also depends on other settings such as -# SOURCE_BROWSER. -# The default value is: NO. -# This tag requires that the tag GENERATE_RTF is set to YES. - -RTF_SOURCE_CODE = NO - #--------------------------------------------------------------------------- # Configuration options related to the man page output #--------------------------------------------------------------------------- @@ -2017,27 +2214,44 @@ GENERATE_DOCBOOK = NO DOCBOOK_OUTPUT = docbook -# If the DOCBOOK_PROGRAMLISTING tag is set to YES, doxygen will include the -# program listings (including syntax highlighting and cross-referencing -# information) to the DOCBOOK output. Note that enabling this will significantly -# increase the size of the DOCBOOK output. -# The default value is: NO. -# This tag requires that the tag GENERATE_DOCBOOK is set to YES. - -DOCBOOK_PROGRAMLISTING = NO - #--------------------------------------------------------------------------- # Configuration options for the AutoGen Definitions output #--------------------------------------------------------------------------- # If the GENERATE_AUTOGEN_DEF tag is set to YES, doxygen will generate an -# AutoGen Definitions (see http://autogen.sourceforge.net/) file that captures +# AutoGen Definitions (see https://autogen.sourceforge.net/) file that captures # the structure of the code including all documentation. Note that this feature # is still experimental and incomplete at the moment. # The default value is: NO. GENERATE_AUTOGEN_DEF = NO +#--------------------------------------------------------------------------- +# Configuration options related to Sqlite3 output +#--------------------------------------------------------------------------- + +# If the GENERATE_SQLITE3 tag is set to YES doxygen will generate a Sqlite3 +# database with symbols found by doxygen stored in tables. +# The default value is: NO. + +GENERATE_SQLITE3 = NO + +# The SQLITE3_OUTPUT tag is used to specify where the Sqlite3 database will be +# put. If a relative path is entered the value of OUTPUT_DIRECTORY will be put +# in front of it. +# The default directory is: sqlite3. +# This tag requires that the tag GENERATE_SQLITE3 is set to YES. + +SQLITE3_OUTPUT = sqlite3 + +# The SQLITE3_OVERWRITE_DB tag is set to YES, the existing doxygen_sqlite3.db +# database file will be recreated with each doxygen run. If set to NO, doxygen +# will warn if an a database file is already found and not modify it. +# The default value is: YES. +# This tag requires that the tag GENERATE_SQLITE3 is set to YES. + +SQLITE3_RECREATE_DB = YES + #--------------------------------------------------------------------------- # Configuration options related to the Perl module output #--------------------------------------------------------------------------- @@ -2112,7 +2326,8 @@ SEARCH_INCLUDES = YES # The INCLUDE_PATH tag can be used to specify one or more directories that # contain include files that are not input files but should be processed by the -# preprocessor. +# preprocessor. Note that the INCLUDE_PATH is not recursive, so the setting of +# RECURSIVE has no effect here. # This tag requires that the tag SEARCH_INCLUDES is set to YES. INCLUDE_PATH = "@VISP_BINARY_DIR@/modules/core" @@ -2297,15 +2512,15 @@ TAGFILES = GENERATE_TAGFILE = -# If the ALLEXTERNALS tag is set to YES, all external class will be listed in -# the class index. If set to NO, only the inherited external classes will be -# listed. +# If the ALLEXTERNALS tag is set to YES, all external classes and namespaces +# will be listed in the class and namespace index. If set to NO, only the +# inherited external classes will be listed. # The default value is: NO. ALLEXTERNALS = NO # If the EXTERNAL_GROUPS tag is set to YES, all external groups will be listed -# in the modules index. If set to NO, only the current project's groups will be +# in the topic index. If set to NO, only the current project's groups will be # listed. # The default value is: YES. @@ -2319,25 +2534,9 @@ EXTERNAL_GROUPS = YES EXTERNAL_PAGES = YES #--------------------------------------------------------------------------- -# Configuration options related to the dot tool +# Configuration options related to diagram generator tools #--------------------------------------------------------------------------- -# If the CLASS_DIAGRAMS tag is set to YES, doxygen will generate a class diagram -# (in HTML and LaTeX) for classes with base or super classes. Setting the tag to -# NO turns the diagrams off. Note that this option also works with HAVE_DOT -# disabled, but it is recommended to install and use dot, since it yields more -# powerful graphs. -# The default value is: YES. - -CLASS_DIAGRAMS = YES - -# You can include diagrams made with dia in doxygen documentation. Doxygen will -# then run dia to produce the diagram and insert it in the documentation. The -# DIA_PATH tag allows you to specify the directory where the dia binary resides. -# If left empty dia is assumed to be found in the default search path. - -DIA_PATH = - # If set to YES the inheritance and collaboration graphs will hide inheritance # and usage relations if the target is undocumented or is not a class. # The default value is: YES. @@ -2346,7 +2545,7 @@ HIDE_UNDOC_RELATIONS = YES # If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is # available from the path. This tool is part of Graphviz (see: -# http://www.graphviz.org/), a graph visualization toolkit from AT&T and Lucent +# https://www.graphviz.org/), a graph visualization toolkit from AT&T and Lucent # Bell Labs. The other options in this section have no effect if this option is # set to NO # The default value is: NO. @@ -2363,49 +2562,73 @@ HAVE_DOT = NO DOT_NUM_THREADS = 0 -# When you want a differently looking font in the dot files that doxygen -# generates you can specify the font name using DOT_FONTNAME. You need to make -# sure dot is able to find the font, which can be done by putting it in a -# standard location or by setting the DOTFONTPATH environment variable or by -# setting DOT_FONTPATH to the directory containing the font. -# The default value is: Helvetica. +# DOT_COMMON_ATTR is common attributes for nodes, edges and labels of +# subgraphs. When you want a differently looking font in the dot files that +# doxygen generates you can specify fontname, fontcolor and fontsize attributes. +# For details please see Node, +# Edge and Graph Attributes specification You need to make sure dot is able +# to find the font, which can be done by putting it in a standard location or by +# setting the DOTFONTPATH environment variable or by setting DOT_FONTPATH to the +# directory containing the font. Default graphviz fontsize is 14. +# The default value is: fontname=Helvetica,fontsize=10. +# This tag requires that the tag HAVE_DOT is set to YES. + +DOT_COMMON_ATTR = "fontname=Helvetica,fontsize=10" + +# DOT_EDGE_ATTR is concatenated with DOT_COMMON_ATTR. For elegant style you can +# add 'arrowhead=open, arrowtail=open, arrowsize=0.5'. Complete documentation about +# arrows shapes. +# The default value is: labelfontname=Helvetica,labelfontsize=10. # This tag requires that the tag HAVE_DOT is set to YES. -DOT_FONTNAME = +DOT_EDGE_ATTR = "labelfontname=Helvetica,labelfontsize=10" -# The DOT_FONTSIZE tag can be used to set the size (in points) of the font of -# dot graphs. -# Minimum value: 4, maximum value: 24, default value: 10. +# DOT_NODE_ATTR is concatenated with DOT_COMMON_ATTR. For view without boxes +# around nodes set 'shape=plain' or 'shape=plaintext' Shapes specification +# The default value is: shape=box,height=0.2,width=0.4. # This tag requires that the tag HAVE_DOT is set to YES. -DOT_FONTSIZE = 10 +DOT_NODE_ATTR = "shape=box,height=0.2,width=0.4" -# By default doxygen will tell dot to use the default font as specified with -# DOT_FONTNAME. If you specify a different font using DOT_FONTNAME you can set -# the path where dot can find it using this tag. +# You can set the path where dot can find font specified with fontname in +# DOT_COMMON_ATTR and others dot attributes. # This tag requires that the tag HAVE_DOT is set to YES. DOT_FONTPATH = -# If the CLASS_GRAPH tag is set to YES then doxygen will generate a graph for -# each documented class showing the direct and indirect inheritance relations. -# Setting this tag to YES will force the CLASS_DIAGRAMS tag to NO. +# If the CLASS_GRAPH tag is set to YES or GRAPH or BUILTIN then doxygen will +# generate a graph for each documented class showing the direct and indirect +# inheritance relations. In case the CLASS_GRAPH tag is set to YES or GRAPH and +# HAVE_DOT is enabled as well, then dot will be used to draw the graph. In case +# the CLASS_GRAPH tag is set to YES and HAVE_DOT is disabled or if the +# CLASS_GRAPH tag is set to BUILTIN, then the built-in generator will be used. +# If the CLASS_GRAPH tag is set to TEXT the direct and indirect inheritance +# relations will be shown as texts / links. +# Possible values are: NO, YES, TEXT, GRAPH and BUILTIN. # The default value is: YES. -# This tag requires that the tag HAVE_DOT is set to YES. CLASS_GRAPH = YES # If the COLLABORATION_GRAPH tag is set to YES then doxygen will generate a # graph for each documented class showing the direct and indirect implementation # dependencies (inheritance, containment, and class references variables) of the -# class with other documented classes. +# class with other documented classes. Explicit enabling a collaboration graph, +# when COLLABORATION_GRAPH is set to NO, can be accomplished by means of the +# command \collaborationgraph. Disabling a collaboration graph can be +# accomplished by means of the command \hidecollaborationgraph. # The default value is: YES. # This tag requires that the tag HAVE_DOT is set to YES. COLLABORATION_GRAPH = YES # If the GROUP_GRAPHS tag is set to YES then doxygen will generate a graph for -# groups, showing the direct groups dependencies. +# groups, showing the direct groups dependencies. Explicit enabling a group +# dependency graph, when GROUP_GRAPHS is set to NO, can be accomplished by means +# of the command \groupgraph. Disabling a directory graph can be accomplished by +# means of the command \hidegroupgraph. See also the chapter Grouping in the +# manual. # The default value is: YES. # This tag requires that the tag HAVE_DOT is set to YES. @@ -2428,10 +2651,32 @@ UML_LOOK = NO # but if the number exceeds 15, the total amount of fields shown is limited to # 10. # Minimum value: 0, maximum value: 100, default value: 10. -# This tag requires that the tag HAVE_DOT is set to YES. +# This tag requires that the tag UML_LOOK is set to YES. UML_LIMIT_NUM_FIELDS = 10 +# If the DOT_UML_DETAILS tag is set to NO, doxygen will show attributes and +# methods without types and arguments in the UML graphs. If the DOT_UML_DETAILS +# tag is set to YES, doxygen will add type and arguments for attributes and +# methods in the UML graphs. If the DOT_UML_DETAILS tag is set to NONE, doxygen +# will not generate fields with class member information in the UML graphs. The +# class diagrams will look similar to the default class diagrams but using UML +# notation for the relationships. +# Possible values are: NO, YES and NONE. +# The default value is: NO. +# This tag requires that the tag UML_LOOK is set to YES. + +DOT_UML_DETAILS = NO + +# The DOT_WRAP_THRESHOLD tag can be used to set the maximum number of characters +# to display on a single line. If the actual line length exceeds this threshold +# significantly it will wrapped across multiple lines. Some heuristics are apply +# to avoid ugly line breaks. +# Minimum value: 0, maximum value: 1000, default value: 17. +# This tag requires that the tag HAVE_DOT is set to YES. + +DOT_WRAP_THRESHOLD = 17 + # If the TEMPLATE_RELATIONS tag is set to YES then the inheritance and # collaboration graphs will show the relations between templates and their # instances. @@ -2443,7 +2688,9 @@ TEMPLATE_RELATIONS = YES # If the INCLUDE_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are set to # YES then doxygen will generate a graph for each documented file showing the # direct and indirect include dependencies of the file with other documented -# files. +# files. Explicit enabling an include graph, when INCLUDE_GRAPH is is set to NO, +# can be accomplished by means of the command \includegraph. Disabling an +# include graph can be accomplished by means of the command \hideincludegraph. # The default value is: YES. # This tag requires that the tag HAVE_DOT is set to YES. @@ -2452,7 +2699,10 @@ INCLUDE_GRAPH = YES # If the INCLUDED_BY_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are # set to YES then doxygen will generate a graph for each documented file showing # the direct and indirect include dependencies of the file with other documented -# files. +# files. Explicit enabling an included by graph, when INCLUDED_BY_GRAPH is set +# to NO, can be accomplished by means of the command \includedbygraph. Disabling +# an included by graph can be accomplished by means of the command +# \hideincludedbygraph. # The default value is: YES. # This tag requires that the tag HAVE_DOT is set to YES. @@ -2492,16 +2742,26 @@ GRAPHICAL_HIERARCHY = YES # If the DIRECTORY_GRAPH tag is set to YES then doxygen will show the # dependencies a directory has on other directories in a graphical way. The # dependency relations are determined by the #include relations between the -# files in the directories. +# files in the directories. Explicit enabling a directory graph, when +# DIRECTORY_GRAPH is set to NO, can be accomplished by means of the command +# \directorygraph. Disabling a directory graph can be accomplished by means of +# the command \hidedirectorygraph. # The default value is: YES. # This tag requires that the tag HAVE_DOT is set to YES. DIRECTORY_GRAPH = YES +# The DIR_GRAPH_MAX_DEPTH tag can be used to limit the maximum number of levels +# of child directories generated in directory dependency graphs by dot. +# Minimum value: 1, maximum value: 25, default value: 1. +# This tag requires that the tag DIRECTORY_GRAPH is set to YES. + +DIR_GRAPH_MAX_DEPTH = 1 + # The DOT_IMAGE_FORMAT tag can be used to set the image format of the images # generated by dot. For an explanation of the image formats see the section # output formats in the documentation of the dot tool (Graphviz (see: -# http://www.graphviz.org/)). +# https://www.graphviz.org/)). # Note: If you choose svg you need to set HTML_FILE_EXTENSION to xhtml in order # to make the SVG files visible in IE 9+ (other browsers do not have this # requirement). @@ -2529,7 +2789,7 @@ INTERACTIVE_SVG = NO # found. If left blank, it is assumed the dot tool can be found in the path. # This tag requires that the tag HAVE_DOT is set to YES. -DOT_PATH = "@DOXYGEN_DOT_EXECUTABLE_PATH@" +DOT_PATH = @DOXYGEN_DOT_EXECUTABLE_PATH@ # The DOTFILE_DIRS tag can be used to specify one or more directories that # contain dot files that are included in the documentation (see the \dotfile @@ -2538,11 +2798,12 @@ DOT_PATH = "@DOXYGEN_DOT_EXECUTABLE_PATH@" DOTFILE_DIRS = -# The MSCFILE_DIRS tag can be used to specify one or more directories that -# contain msc files that are included in the documentation (see the \mscfile -# command). +# You can include diagrams made with dia in doxygen documentation. Doxygen will +# then run dia to produce the diagram and insert it in the documentation. The +# DIA_PATH tag allows you to specify the directory where the dia binary resides. +# If left empty dia is assumed to be found in the default search path. -MSCFILE_DIRS = +DIA_PATH = # The DIAFILE_DIRS tag can be used to specify one or more directories that # contain dia files that are included in the documentation (see the \diafile @@ -2551,10 +2812,10 @@ MSCFILE_DIRS = DIAFILE_DIRS = # When using plantuml, the PLANTUML_JAR_PATH tag should be used to specify the -# path where java can find the plantuml.jar file. If left blank, it is assumed -# PlantUML is not used or called during a preprocessing step. Doxygen will -# generate a warning when it encounters a \startuml command in this case and -# will not generate output for the diagram. +# path where java can find the plantuml.jar file or to the filename of jar file +# to be used. If left blank, it is assumed PlantUML is not used or called during +# a preprocessing step. Doxygen will generate a warning when it encounters a +# \startuml command in this case and will not generate output for the diagram. PLANTUML_JAR_PATH = @@ -2592,18 +2853,6 @@ DOT_GRAPH_MAX_NODES = 150 MAX_DOT_GRAPH_DEPTH = 0 -# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent -# background. This is disabled by default, because dot on Windows does not seem -# to support this out of the box. -# -# Warning: Depending on the platform used, enabling this option may lead to -# badly anti-aliased labels on the edges of a graph (i.e. they become hard to -# read). -# The default value is: NO. -# This tag requires that the tag HAVE_DOT is set to YES. - -DOT_TRANSPARENT = NO - # Set the DOT_MULTI_TARGETS tag to YES to allow dot to generate multiple output # files in one run (i.e. multiple -o and -T options on the command line). This # makes dot run faster, but since only newer versions of dot (>1.8.10) support @@ -2616,14 +2865,34 @@ DOT_MULTI_TARGETS = YES # If the GENERATE_LEGEND tag is set to YES doxygen will generate a legend page # explaining the meaning of the various boxes and arrows in the dot generated # graphs. +# Note: This tag requires that UML_LOOK isn't set, i.e. the doxygen internal +# graphical representation for inheritance and collaboration diagrams is used. # The default value is: YES. # This tag requires that the tag HAVE_DOT is set to YES. GENERATE_LEGEND = YES -# If the DOT_CLEANUP tag is set to YES, doxygen will remove the intermediate dot +# If the DOT_CLEANUP tag is set to YES, doxygen will remove the intermediate # files that are used to generate the various graphs. +# +# Note: This setting is not only used for dot files but also for msc temporary +# files. # The default value is: YES. -# This tag requires that the tag HAVE_DOT is set to YES. DOT_CLEANUP = YES + +# You can define message sequence charts within doxygen comments using the \msc +# command. If the MSCGEN_TOOL tag is left empty (the default), then doxygen will +# use a built-in version of mscgen tool to produce the charts. Alternatively, +# the MSCGEN_TOOL tag can also specify the name an external tool. For instance, +# specifying prog as the value, doxygen will call the tool as prog -T +# -o . The external tool should support +# output file formats "png", "eps", "svg", and "ismap". + +MSCGEN_TOOL = + +# The MSCFILE_DIRS tag can be used to specify one or more directories that +# contain msc files that are included in the documentation (see the \mscfile +# command). + +MSCFILE_DIRS = From da8f55ad9fe7ff1fc7d19cacec5cc6ec9c0fe2c2 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Tue, 28 Nov 2023 18:06:44 +0100 Subject: [PATCH 130/169] fix C++ compilation warnings --- modules/python/bindings/include/core/arrays.hpp | 16 ++++++++-------- .../generator/visp_python_bindgen/doc_parser.py | 2 ++ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/modules/python/bindings/include/core/arrays.hpp b/modules/python/bindings/include/core/arrays.hpp index e54be92cd8..4e776ceff5 100644 --- a/modules/python/bindings/include/core/arrays.hpp +++ b/modules/python/bindings/include/core/arrays.hpp @@ -95,7 +95,7 @@ void define_get_item_2d_array(PyClass &pyClass) { pyClass.def("__getitem__", [](const Class &self, std::pair pair) -> Item { int i = pair.first, j = pair.second; - const unsigned int rows = self.getRows(), cols = self.getCols(); + const int rows = (int)self.getRows(), cols = (int)self.getCols(); if (abs(i) > rows || abs(j) > cols) { std::stringstream ss; ss << "Invalid indexing into a 2D array: got indices " << shape_to_string({ i, j }) @@ -111,7 +111,7 @@ void define_get_item_2d_array(PyClass &pyClass) return self[i][j]; }); pyClass.def("__getitem__", [](const Class &self, int i) -> np_array_cf { - const unsigned int rows = self.getRows(); + const int rows = (int)self.getRows(); if (abs(i) > rows) { std::stringstream ss; ss << "Invalid indexing into a 2D array: got row index " << shape_to_string({ i }) @@ -157,7 +157,7 @@ void bindings_vpArray2D(py::class_> &pyArray2D) vpArray2D result(shape[0], shape[1]); copy_data_from_np(np_array, result.data); return result; - }), R"doc( + }), R"doc( Construct a 2D ViSP array by **copying** a 2D numpy array. :param np_array: The numpy array to copy. @@ -181,7 +181,7 @@ void bindings_vpMatrix(py::class_> &pyMatrix) vpMatrix result(shape[0], shape[1]); copy_data_from_np(np_array, result.data); return result; - }), R"doc( + }), R"doc( Construct a matrix by **copying** a 2D numpy array. :param np_array: The numpy array to copy. @@ -205,7 +205,7 @@ void bindings_vpColVector(py::class_> &pyColVecto vpColVector result(shape[0]); copy_data_from_np(np_array, result.data); return result; - }), R"doc( + }), R"doc( Construct a column vector by **copying** a 1D numpy array. :param np_array: The numpy 1D array to copy. @@ -225,7 +225,7 @@ void bindings_vpRowVector(py::class_> &pyRowVecto vpRowVector result(shape[0]); copy_data_from_np(np_array, result.data); return result; - }), R"doc( + }), R"doc( Construct a row vector by **copying** a 1D numpy array. :param np_array: The numpy 1D array to copy. @@ -249,7 +249,7 @@ void bindings_vpRotationMatrix(py::class_> & throw std::runtime_error("Input numpy array is not a valid rotation matrix"); } return result; - }), R"doc( + }), R"doc( Construct a rotation matrix by **copying** a 2D numpy array. This numpy array should be of dimensions :math:`3 \times 3` and be a valid rotation matrix. If it is not a rotation matrix, an exception will be raised. @@ -276,7 +276,7 @@ void bindings_vpHomogeneousMatrix(py::class_ Optional def to_cstring(s: str) -> str: s = s.replace('\t', ' ') s = re.sub('\n\n\n+', '\n\n', s) + s = re.sub('\\\\ +', '\\\\', s) + return f'''R"doc( {s} )doc"''' From 96e0713bbe40e49fde0433aec6bc3b9c692d7864 Mon Sep 17 00:00:00 2001 From: Fabien Spindler Date: Wed, 29 Nov 2023 08:39:37 +0100 Subject: [PATCH 131/169] Fix doxygen warning by changing PAPER_TYPE: warning: argument 'a4wide' for option PAPER_TYPE is not a valid enum value Using the default: a4 --- doc/config-doxygen.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/config-doxygen.in b/doc/config-doxygen.in index 6d65f7d208..ab7ac43a11 100644 --- a/doc/config-doxygen.in +++ b/doc/config-doxygen.in @@ -1941,7 +1941,7 @@ COMPACT_LATEX = NO # The default value is: a4. # This tag requires that the tag GENERATE_LATEX is set to YES. -PAPER_TYPE = a4wide +PAPER_TYPE = a4 # The EXTRA_PACKAGES tag can be used to specify one or more LaTeX package names # that should be included in the LaTeX output. The package can be specified just From 8846f972c46a62facec6bc4ffd1753fbd538d1df Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Wed, 29 Nov 2023 16:05:20 +0100 Subject: [PATCH 132/169] Add more logging to preprocessing step --- .../generator/visp_python_bindgen/generator_config.py | 9 ++++++--- modules/python/generator/visp_python_bindgen/header.py | 6 +++++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/modules/python/generator/visp_python_bindgen/generator_config.py b/modules/python/generator/visp_python_bindgen/generator_config.py index 24a8786d9d..e20351b93d 100644 --- a/modules/python/generator/visp_python_bindgen/generator_config.py +++ b/modules/python/generator/visp_python_bindgen/generator_config.py @@ -32,7 +32,7 @@ # ViSP Python bindings generator # ############################################################################# - +import logging from typing import Dict, Final, List, Optional import re from pathlib import Path @@ -124,10 +124,10 @@ class GeneratorConfig(object): 'VISP_BUILD_DEPRECATED_FUNCTIONS', # Do not bind deprecated functions 'VISP_RUBIK_REGULAR_FONT_RESOURCES' ], - include_directories=[], # Populate through the main configuration file + include_directories=[], # Populated through the main configuration file passthrough_includes_regex="^.*$", # Never output the result of other includes. line_directive=None, - other_args=["--passthru-unfound-includes"] #"--passthru-comments" + other_args=['--passthru-unfound-includes'] #"--passthru-comments" ) xml_doc_path: Optional[Path] = None @@ -159,6 +159,7 @@ def update_from_main_config_file(path: Path) -> None: assert path.exists() with open(path, 'r') as main_config_file: main_config = json.load(main_config_file) + logging.info('Updating the generator config from dict: ', main_config) GeneratorConfig.pcpp_config.include_directories = main_config['include_dirs'] defines = main_config.get('defines') @@ -178,4 +179,6 @@ def update_from_main_config_file(path: Path) -> None: # Include only headers that are in the VISP source directory headers = list(filter(lambda h: source_dir in h.parents, headers)) + headers_log_str = '\n\t'.join([str(header) for header in headers]) + logging.info(f'Module {module_name} headers: \n\t{headers_log_str}') GeneratorConfig.module_data.append(ModuleInputData(module_name, headers, deps)) diff --git a/modules/python/generator/visp_python_bindgen/header.py b/modules/python/generator/visp_python_bindgen/header.py index 631ad434fe..1edce4a977 100644 --- a/modules/python/generator/visp_python_bindgen/header.py +++ b/modules/python/generator/visp_python_bindgen/header.py @@ -116,6 +116,7 @@ def preprocess(self) -> None: self.documentation_holder_path = DocumentationData.get_xml_path_if_exists(name_cpp_no_template, DocumentationObjectKind.Class) def run_preprocessor(self): + logging.info(f'Preprocessing header {self.path.name}') tmp_dir = self.submodule.submodule_file_path.parent / "tmp" tmp_dir.mkdir(exist_ok=True) tmp_file_path = tmp_dir / (self.path.name + '.in') @@ -148,6 +149,8 @@ def run_preprocessor(self): argv = [''] + GeneratorConfig.pcpp_config.to_pcpp_args_list() argv += ['-o', f'{preprocessor_output_path}', str(tmp_file_path.absolute())] + argv_str = ", ".join(argv) + logging.info(f'Preprocessor arguments:\n{argv_str}') pcpp.CmdPreprocessor(argv) preprocessed_header_content = None @@ -212,7 +215,7 @@ def parse_sub_namespace(self, bindings_container: BindingsContainer, ns: Namespa rejection_strs.append(f'\t{rejected_function.signature} was rejected! Reason: {rejected_function.rejection_reason}') if len(rejection_strs) > 0: logging.warning(f'Rejected function in namespace: {ns.name}') - logging.warning('\n'.join(rejection_strs)) + logging.warning('\n' + '\n'.join(rejection_strs)) bound_object = BoundObjectNames('submodule', self.submodule.name, namespace_prefix, namespace_prefix) defs = [] @@ -221,6 +224,7 @@ def parse_sub_namespace(self, bindings_container: BindingsContainer, ns: Namespa bindings_container.add_bindings(SingleObjectBindings(bound_object, None, defs, GenerationObjectType.Namespace)) for sub_ns in ns.namespaces: + logging.info(f'Parsing subnamespace {namespace_prefix + sub_ns}') self.parse_sub_namespace(bindings_container, ns.namespaces[sub_ns], namespace_prefix + sub_ns + '::', False) def generate_class(self, bindings_container: BindingsContainer, cls: ClassScope, header_env: HeaderEnvironment) -> SingleObjectBindings: From 49c44e201178f5a2f968de05c3bc74e9ea352ab9 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Wed, 29 Nov 2023 17:14:10 +0100 Subject: [PATCH 133/169] Disable multithreading to fix the different and undesired behaviour on mac --- .../visp_python_bindgen/generator.py | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/modules/python/generator/visp_python_bindgen/generator.py b/modules/python/generator/visp_python_bindgen/generator.py index ab3bf198b1..6d37d85fe7 100644 --- a/modules/python/generator/visp_python_bindgen/generator.py +++ b/modules/python/generator/visp_python_bindgen/generator.py @@ -96,15 +96,22 @@ def generate_module(generate_path: Path, config_path: Path) -> None: for submodule in submodules: all_headers.extend(submodule.headers) - # Parallel processing of headers to speedup this step from tqdm import tqdm - with Pool() as pool: - new_all_headers = [] - for result in list(tqdm(pool.imap(header_preprocess, all_headers), total=len(all_headers), file=sys.stderr)): - if result is None: - raise RuntimeError('There was an exception when processing headers: You should either ignore the faulty header/class, or fix the generator code!') - new_all_headers.append(result) - + # Parallel processing of headers to speedup this step + # This parallel implementation is disabled, + # since the behaviour on Mac is different and leads to preprocessing not finding vpConfig.h and others + # Reverting to a single process version fixes the issue + # with Pool() as pool: + # new_all_headers = [] + # for result in list(tqdm(pool.imap(header_preprocess, all_headers), total=len(all_headers), file=sys.stderr)): + # if result is None: + # raise RuntimeError('There was an exception when processing headers: You should either ignore the faulty header/class, or fix the generator code!') + # new_all_headers.append(result) + new_all_headers = [] + for result in list(tqdm(map(header_preprocess, all_headers), total=len(all_headers), file=sys.stderr, unit="hdr")): + if result is None: + raise RuntimeError('There was an exception when processing headers: You should either ignore the faulty header/class, or fix the generator code!') + new_all_headers.append(result) # Sort headers according to the dependencies. This is done across all modules. # TODO: sort module generation order. For now this works but it's fairly brittle new_all_headers = sort_headers(new_all_headers) From 9aa457a9bc6372193cca5d9d2c054c575945ee9a Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Wed, 29 Nov 2023 17:41:53 +0100 Subject: [PATCH 134/169] Add getitem for images --- modules/python/CMakeLists.txt | 1 + .../python/bindings/include/core/images.hpp | 86 ++++++++++++++++--- .../visp_python_bindgen/generator.py | 2 + 3 files changed, 78 insertions(+), 11 deletions(-) diff --git a/modules/python/CMakeLists.txt b/modules/python/CMakeLists.txt index 75d2d194da..3c7c9a39bd 100644 --- a/modules/python/CMakeLists.txt +++ b/modules/python/CMakeLists.txt @@ -89,6 +89,7 @@ set(bindings_dependencies ${json_config_file_path} ${config_files} ${python_sources} ${pip_files} ) + # If we have doxygen, we should first generate the XML documentation # so that the binding stubs and doc is as complete as possible if(DOXYGEN_FOUND) diff --git a/modules/python/bindings/include/core/images.hpp b/modules/python/bindings/include/core/images.hpp index 83dabaefb6..250e7e9b4b 100644 --- a/modules/python/bindings/include/core/images.hpp +++ b/modules/python/bindings/include/core/images.hpp @@ -36,6 +36,61 @@ #include #include +#include +#include +#include + +namespace +{ +const char *numpy_fn_doc_image = R"doc( + Numpy view of the underlying image data. + This numpy view can be used to directly modify the array. +)doc"; +} + +/* + * Image 2D indexing + */ +template +void define_get_item_2d_image(py::class_> &pyClass) +{ + pyClass.def("__getitem__", [](const vpImage &self, std::pair pair) -> T { + int i = pair.first, j = pair.second; + const int rows = (int)self.getHeight(), cols = (int)self.getRows(); + if (abs(i) > rows || abs(j) > cols) { + std::stringstream ss; + ss << "Invalid indexing into a 2D image: got indices " << shape_to_string({ i, j }) + << " but image has dimensions " << shape_to_string({ rows, cols }); + throw std::runtime_error(ss.str()); + } + if (i < 0) { + i = rows + i; + } + if (j < 0) { + j = cols + j; + } + return self[i][j]; + }); + pyClass.def("__getitem__", [](const vpImage &self, int i) -> np_array_cf { + const int rows = (int)self.getRows(); + if (abs(i) > rows) { + std::stringstream ss; + ss << "Invalid indexing into a 2D image: got row index " << shape_to_string({ i }) + << " but array has " << rows << " rows"; + throw std::runtime_error(ss.str()); + } + if (i < 0) { + i = rows + i; + } + return (py::cast(self).template cast >())[py::cast(i)].template cast>(); + }); + pyClass.def("__getitem__", [](const vpImage &self, py::slice slice) -> py::array_t { + return (py::cast(self).template cast >())[slice].template cast>(); + }); + pyClass.def("__getitem__", [](const vpImage &self, py::tuple tuple) { + return (py::cast(self).template cast >())[tuple].template cast>(); + }); +} /* * vpImage @@ -49,9 +104,9 @@ bindings_vpImage(py::class_> &pyImage) }); pyImage.def("numpy", [](vpImage &self) -> np_array_cf { return py::cast(self).template cast>(); - }, numpy_fn_doc_writable); + }, numpy_fn_doc_image); - pyImage.def(py::init([](np_array_cf np_array) { + pyImage.def(py::init([](np_array_cf &np_array) { verify_array_shape_and_dims(np_array, 2, "ViSP Image"); const std::vector shape = np_array.request().shape; vpImage result(shape[0], shape[1]); @@ -63,28 +118,31 @@ Construct an image by **copying** a 2D numpy array. :param np_array: The numpy array to copy. )doc", py::arg("np_array")); + + define_get_item_2d_image(pyImage); } template typename std::enable_if::value, void>::type bindings_vpImage(py::class_> &pyImage) { - static_assert(sizeof(T) == 4 * sizeof(unsigned char)); + using NpRep = unsigned char; + static_assert(sizeof(T) == 4 * sizeof(NpRep)); pyImage.def_buffer([](vpImage &image) -> py::buffer_info { - return make_array_buffer(reinterpret_cast(image.bitmap), { image.getHeight(), image.getWidth(), 4 }, false); + return make_array_buffer(reinterpret_cast(image.bitmap), { image.getHeight(), image.getWidth(), 4 }, false); }); - pyImage.def("numpy", [](vpImage &self) -> np_array_cf { - return py::cast(self).template cast>(); - }, numpy_fn_doc_writable); + pyImage.def("numpy", [](vpImage &self) -> np_array_cf { + return py::cast(self).template cast>(); + }, numpy_fn_doc_image); - pyImage.def(py::init([](np_array_cf np_array) { + pyImage.def(py::init([](np_array_cf &np_array) { verify_array_shape_and_dims(np_array, 3, "ViSP RGBa image"); const std::vector shape = np_array.request().shape; if (shape[2] != 4) { throw std::runtime_error("Tried to copy a 3D numpy array that does not have 4 elements per pixel into a ViSP RGBA image"); } vpImage result(shape[0], shape[1]); - copy_data_from_np(np_array, (unsigned char *)result.bitmap); + copy_data_from_np(np_array, (NpRep *)result.bitmap); return result; }), R"doc( Construct an image by **copying** a 3D numpy array. this numpy array should be of the form :math:`H \times W \times 4` @@ -93,16 +151,22 @@ where the 4 denotes the red, green, blue and alpha components of the image. :param np_array: The numpy array to copy. )doc", py::arg("np_array")); + define_get_item_2d_image(pyImage); } template typename std::enable_if::value, void>::type bindings_vpImage(py::class_> &pyImage) { - static_assert(sizeof(T) == 3 * sizeof(float)); + using NpRep = float; + static_assert(sizeof(T) == 3 * sizeof(NpRep)); pyImage.def_buffer([](vpImage &image) -> py::buffer_info { - return make_array_buffer(reinterpret_cast(image.bitmap), { image.getHeight(), image.getWidth(), 3 }, false); + return make_array_buffer(reinterpret_cast(image.bitmap), { image.getHeight(), image.getWidth(), 3 }, false); }); + pyImage.def("numpy", [](vpImage &self) -> np_array_cf { + return py::cast(self).template cast>(); + }, numpy_fn_doc_image); + define_get_item_2d_image(pyImage); } #endif diff --git a/modules/python/generator/visp_python_bindgen/generator.py b/modules/python/generator/visp_python_bindgen/generator.py index 6d37d85fe7..51216b27eb 100644 --- a/modules/python/generator/visp_python_bindgen/generator.py +++ b/modules/python/generator/visp_python_bindgen/generator.py @@ -107,11 +107,13 @@ def generate_module(generate_path: Path, config_path: Path) -> None: # if result is None: # raise RuntimeError('There was an exception when processing headers: You should either ignore the faulty header/class, or fix the generator code!') # new_all_headers.append(result) + new_all_headers = [] for result in list(tqdm(map(header_preprocess, all_headers), total=len(all_headers), file=sys.stderr, unit="hdr")): if result is None: raise RuntimeError('There was an exception when processing headers: You should either ignore the faulty header/class, or fix the generator code!') new_all_headers.append(result) + # Sort headers according to the dependencies. This is done across all modules. # TODO: sort module generation order. For now this works but it's fairly brittle new_all_headers = sort_headers(new_all_headers) From 23605621264d7f8de749522e471c70acc2dc66f9 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Wed, 29 Nov 2023 19:57:42 +0100 Subject: [PATCH 135/169] testing image indexing --- .../python/bindings/include/core/arrays.hpp | 4 +- .../python/bindings/include/core/images.hpp | 4 +- .../{test_numpy.py => test_numpy_array.py} | 0 modules/python/test/test_numpy_image.py | 116 ++++++++++++++++++ 4 files changed, 120 insertions(+), 4 deletions(-) rename modules/python/test/{test_numpy.py => test_numpy_array.py} (100%) create mode 100644 modules/python/test/test_numpy_image.py diff --git a/modules/python/bindings/include/core/arrays.hpp b/modules/python/bindings/include/core/arrays.hpp index 4e776ceff5..52dd774144 100644 --- a/modules/python/bindings/include/core/arrays.hpp +++ b/modules/python/bindings/include/core/arrays.hpp @@ -96,7 +96,7 @@ void define_get_item_2d_array(PyClass &pyClass) pyClass.def("__getitem__", [](const Class &self, std::pair pair) -> Item { int i = pair.first, j = pair.second; const int rows = (int)self.getRows(), cols = (int)self.getCols(); - if (abs(i) > rows || abs(j) > cols) { + if (i >= rows || j >= cols || i < -rows || j < -cols) { std::stringstream ss; ss << "Invalid indexing into a 2D array: got indices " << shape_to_string({ i, j }) << " but array has dimensions " << shape_to_string({ rows, cols }); @@ -112,7 +112,7 @@ void define_get_item_2d_array(PyClass &pyClass) }); pyClass.def("__getitem__", [](const Class &self, int i) -> np_array_cf { const int rows = (int)self.getRows(); - if (abs(i) > rows) { + if (i >= rows || i < -rows) { std::stringstream ss; ss << "Invalid indexing into a 2D array: got row index " << shape_to_string({ i }) << " but array has " << rows << " rows"; diff --git a/modules/python/bindings/include/core/images.hpp b/modules/python/bindings/include/core/images.hpp index 250e7e9b4b..9db16e5648 100644 --- a/modules/python/bindings/include/core/images.hpp +++ b/modules/python/bindings/include/core/images.hpp @@ -57,7 +57,7 @@ void define_get_item_2d_image(py::class_> &pyClass) pyClass.def("__getitem__", [](const vpImage &self, std::pair pair) -> T { int i = pair.first, j = pair.second; const int rows = (int)self.getHeight(), cols = (int)self.getRows(); - if (abs(i) > rows || abs(j) > cols) { + if (i >= rows || j >= cols || i < -rows || j < -cols) { std::stringstream ss; ss << "Invalid indexing into a 2D image: got indices " << shape_to_string({ i, j }) << " but image has dimensions " << shape_to_string({ rows, cols }); @@ -73,7 +73,7 @@ void define_get_item_2d_image(py::class_> &pyClass) }); pyClass.def("__getitem__", [](const vpImage &self, int i) -> np_array_cf { const int rows = (int)self.getRows(); - if (abs(i) > rows) { + if (i >= rows || i < -rows) { std::stringstream ss; ss << "Invalid indexing into a 2D image: got row index " << shape_to_string({ i }) << " but array has " << rows << " rows"; diff --git a/modules/python/test/test_numpy.py b/modules/python/test/test_numpy_array.py similarity index 100% rename from modules/python/test/test_numpy.py rename to modules/python/test/test_numpy_array.py diff --git a/modules/python/test/test_numpy_image.py b/modules/python/test/test_numpy_image.py new file mode 100644 index 0000000000..aad7fdcf8f --- /dev/null +++ b/modules/python/test/test_numpy_image.py @@ -0,0 +1,116 @@ +############################################################################# +# +# 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: +# ViSP Python bindings test +# +############################################################################# + +from typing import Any, List, Dict +from visp.core import ImageGray, ImageRGBA, ImageRGBf, RGBa, RGBf + +import numpy as np +import pytest + +def get_data_dicts() -> List[Dict[str, Any]]: + h, w = 20, 20 + return [ + { + 'instance': ImageGray(h, w, 0), + 'base_value': 0, + 'value': 255, + 'np_value': 255, + 'shape': (h, w), + 'dtype': np.uint8 + }, + { + 'instance': ImageRGBA(h, w, RGBa(0, 50, 75, 255)), + 'base_value': RGBa(0, 50, 75, 255), + 'value': RGBa(255, 128, 0, 100), + 'np_value': np.asarray([255, 128, 0, 100], dtype=np.uint8), + 'shape': (h, w, 4), + 'dtype': np.uint8 + }, + { + 'instance': ImageRGBf(h, w, RGBf(0.0, 0.0, 0.0)), + 'base_value': RGBf(0.0, 0.0, 0.0), + 'value': RGBf(255, 0, 0), + 'np_value': np.asarray([255, 0, 0], dtype=np.float32), + 'shape': (h, w, 3), + 'dtype': np.float32 + + }, + + ] + + +def test_np_array_shape_type(): + ''' + Tests buffer definition, shape and dtype + ''' + for test_dict in get_data_dicts(): + np_array = np.array(test_dict['instance'], copy=False) + assert np_array.shape == test_dict['shape'] + assert np_array.dtype == test_dict['dtype'] + +def test_np_array_shape_type_numpy_fn(): + ''' + Tests converting to a numpy array by calling our defined function + ''' + for test_dict in get_data_dicts(): + np_array = test_dict['instance'].numpy() + assert np_array.shape == test_dict['shape'] + assert np_array.dtype == test_dict['dtype'] + +def test_np_array_replace_value(): + ''' + Tests 2D pixel indexing and correspondance between visp pixel reps and numpy reps + ''' + for test_dict in get_data_dicts(): + vp_image = test_dict['instance'] + np_array = np.array(vp_image, copy=False) + np_array[::2, ::2] = test_dict['np_value'] + for i in range(vp_image.getHeight()): + for j in range(vp_image.getWidth()): + if i % 2 == 0 and j % 2 == 0: + assert vp_image[i, j] == test_dict['value'] + assert vp_image[-i, -j] == test_dict['value'] + else: + assert vp_image[i, j] == test_dict['base_value'] + assert vp_image[-i, -j] == test_dict['base_value'] + + with pytest.raises(RuntimeError): + vp_image[vp_image.getHeight()] + with pytest.raises(RuntimeError): + vp_image[0, vp_image.getWidth()] + with pytest.raises(RuntimeError): + vp_image[-vp_image.getHeight() - 1] + with pytest.raises(RuntimeError): + vp_image[0, -vp_image.getWidth() - 1] From 3d0871608f92cbc96fdc628bd21dc3ca4a54af24 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Thu, 30 Nov 2023 13:24:45 +0100 Subject: [PATCH 136/169] Fix default arguments for unsigned ints such as vpServo::addTask --- .../python/generator/visp_python_bindgen/generator_config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/python/generator/visp_python_bindgen/generator_config.py b/modules/python/generator/visp_python_bindgen/generator_config.py index e20351b93d..67b15576dc 100644 --- a/modules/python/generator/visp_python_bindgen/generator_config.py +++ b/modules/python/generator/visp_python_bindgen/generator_config.py @@ -80,7 +80,7 @@ def to_pcpp_args_list(self) -> List[str]: This only encompasses raw types ''' IMMUTABLE_TYPES_REGEXS = [ - '^(float|double|u?int\d+_t|unsigned|char|long|long\wlong|bool)$', + '^(float|double|u?int\d+_t|unsigned|unsigned int|size_t|ssize_t|char|long|long\wlong|bool)$', '^std::string$' ] From 53ec73dd1a33657e909ddbeac721657c1a6a7aed Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Thu, 30 Nov 2023 15:35:31 +0100 Subject: [PATCH 137/169] Add 1D indexing for col/row/translation vector, correct np representation for translationVector --- .../python/bindings/include/core/arrays.hpp | 145 +++++++++++++----- modules/python/config/core.json | 1 + 2 files changed, 104 insertions(+), 42 deletions(-) diff --git a/modules/python/bindings/include/core/arrays.hpp b/modules/python/bindings/include/core/arrays.hpp index 52dd774144..20274f2e22 100644 --- a/modules/python/bindings/include/core/arrays.hpp +++ b/modules/python/bindings/include/core/arrays.hpp @@ -77,6 +77,11 @@ py::buffer_info get_buffer_info(vpRowVector &array) return make_array_buffer(array.data, { array.getCols() }, false); } template<> +py::buffer_info get_buffer_info(vpTranslationVector &array) +{ + return make_array_buffer(array.data, { 3 }, false); +} +template<> py::buffer_info get_buffer_info(vpRotationMatrix &array) { return make_array_buffer(array.data, { array.getRows(), array.getCols() }, true); @@ -123,7 +128,7 @@ void define_get_item_2d_array(PyClass &pyClass) } return (py::cast(self).template cast >())[py::cast(i)].template cast>(); }); - pyClass.def("__getitem__", [](const Class &self, py::slice slice) -> np_array_cf { + pyClass.def("__getitem__", [](const Class &self, py::slice slice) -> py::array_t { return (py::cast(self).template cast >())[slice].template cast>(); }); pyClass.def("__getitem__", [](const Class &self, py::tuple tuple) { @@ -131,6 +136,31 @@ void define_get_item_2d_array(PyClass &pyClass) }); } +/* + * Array 2D indexing + */ +template +void define_get_item_1d_array(PyClass &pyClass) +{ + pyClass.def("__getitem__", [](const Class &self, int i) -> Item { + + const int elems = (int)self.getRows() * (int)self.getCols(); + if (i >= elems || i < -elems) { + std::stringstream ss; + ss << "Invalid indexing into a 1D array: got indices " << shape_to_string({ i }) + << " but array has dimensions " << shape_to_string({ elems }); + throw std::runtime_error(ss.str()); + } + if (i < 0) { + i = elems + i; + } + return self[i]; + }); + pyClass.def("__getitem__", [](const Class &self, py::slice slice) -> py::array_t { + return (py::cast(self).template cast >())[slice].template cast>(); + }); +} + const char *numpy_fn_doc_writable = R"doc( Numpy view of the underlying array data. This numpy view can be used to directly modify the array. @@ -191,47 +221,6 @@ Construct a matrix by **copying** a 2D numpy array. define_get_item_2d_array>, vpMatrix, double>(pyMatrix); } -void bindings_vpColVector(py::class_> &pyColVector) -{ - pyColVector.def_buffer(&get_buffer_info); - - pyColVector.def("numpy", [](vpColVector &self) -> np_array_cf { - return py::cast(self).cast>(); - }, numpy_fn_doc_writable); - - pyColVector.def(py::init([](np_array_cf np_array) { - verify_array_shape_and_dims(np_array, 1, "ViSP column vector"); - const std::vector shape = np_array.request().shape; - vpColVector result(shape[0]); - copy_data_from_np(np_array, result.data); - return result; - }), R"doc( -Construct a column vector by **copying** a 1D numpy array. - -:param np_array: The numpy 1D array to copy. - -)doc", py::arg("np_array")); -} - -void bindings_vpRowVector(py::class_> &pyRowVector) -{ - pyRowVector.def_buffer(&get_buffer_info); - pyRowVector.def("numpy", [](vpRowVector &self) -> np_array_cf { - return np_array_cf(get_buffer_info(self), py::cast(self)); - }, numpy_fn_doc_writable); - pyRowVector.def(py::init([](np_array_cf np_array) { - verify_array_shape_and_dims(np_array, 1, "ViSP row vector"); - const std::vector shape = np_array.request().shape; - vpRowVector result(shape[0]); - copy_data_from_np(np_array, result.data); - return result; - }), R"doc( -Construct a row vector by **copying** a 1D numpy array. - -:param np_array: The numpy 1D array to copy. - -)doc", py::arg("np_array")); -} void bindings_vpRotationMatrix(py::class_> &pyRotationMatrix) { @@ -287,4 +276,76 @@ If it is not a homogeneous matrix, an exception will be raised. define_get_item_2d_array>, vpHomogeneousMatrix, double>(pyHomogeneousMatrix); } + + +void bindings_vpTranslationVector(py::class_> &pyTranslationVector) +{ + pyTranslationVector.def_buffer(&get_buffer_info); + + pyTranslationVector.def("numpy", [](vpTranslationVector &self) -> np_array_cf { + return py::cast(self).cast>(); + }, numpy_fn_doc_writable); + + pyTranslationVector.def(py::init([](np_array_cf np_array) { + verify_array_shape_and_dims(np_array, { 3 }, "ViSP translation vector"); + const std::vector shape = np_array.request().shape; + vpTranslationVector result; + copy_data_from_np(np_array, result.data); + return result; + }), R"doc( +Construct a Translation vector by **copying** a 1D numpy array of size 3. + +:param np_array: The numpy 1D array to copy. + +)doc", py::arg("np_array")); + define_get_item_1d_array>, vpTranslationVector, double>(pyTranslationVector); +} + + +void bindings_vpColVector(py::class_> &pyColVector) +{ + pyColVector.def_buffer(&get_buffer_info); + + pyColVector.def("numpy", [](vpColVector &self) -> np_array_cf { + return py::cast(self).cast>(); + }, numpy_fn_doc_writable); + + pyColVector.def(py::init([](np_array_cf np_array) { + verify_array_shape_and_dims(np_array, 1, "ViSP column vector"); + const std::vector shape = np_array.request().shape; + vpColVector result(shape[0]); + copy_data_from_np(np_array, result.data); + return result; + }), R"doc( +Construct a column vector by **copying** a 1D numpy array. + +:param np_array: The numpy 1D array to copy. + +)doc", py::arg("np_array")); + define_get_item_1d_array>, vpColVector, double>(pyColVector); + +} + +void bindings_vpRowVector(py::class_> &pyRowVector) +{ + pyRowVector.def_buffer(&get_buffer_info); + pyRowVector.def("numpy", [](vpRowVector &self) -> np_array_cf { + return np_array_cf(get_buffer_info(self), py::cast(self)); + }, numpy_fn_doc_writable); + pyRowVector.def(py::init([](np_array_cf np_array) { + verify_array_shape_and_dims(np_array, 1, "ViSP row vector"); + const std::vector shape = np_array.request().shape; + vpRowVector result(shape[0]); + copy_data_from_np(np_array, result.data); + return result; + }), R"doc( +Construct a row vector by **copying** a 1D numpy array. + +:param np_array: The numpy 1D array to copy. + +)doc", py::arg("np_array")); + define_get_item_1d_array>, vpRowVector, double>(pyRowVector); +} + + #endif diff --git a/modules/python/config/core.json b/modules/python/config/core.json index 2b781d25b3..62059157bc 100644 --- a/modules/python/config/core.json +++ b/modules/python/config/core.json @@ -94,6 +94,7 @@ ] }, "vpTranslationVector": { + "additional_bindings": "bindings_vpTranslationVector", "methods": [ { From e3384994916328e41cceeb1a53c7762019355420 Mon Sep 17 00:00:00 2001 From: Fabien Spindler Date: Fri, 1 Dec 2023 09:21:29 +0100 Subject: [PATCH 138/169] Fix warning detected when building python bindings on macos --- modules/core/include/visp3/core/vpFrameGrabber.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/core/include/visp3/core/vpFrameGrabber.h b/modules/core/include/visp3/core/vpFrameGrabber.h index 91ab6fd7c6..0648906be2 100644 --- a/modules/core/include/visp3/core/vpFrameGrabber.h +++ b/modules/core/include/visp3/core/vpFrameGrabber.h @@ -110,7 +110,7 @@ class VISP_EXPORT vpFrameGrabber public: vpFrameGrabber() : init(false), height(0), width(0) { }; - + virtual ~vpFrameGrabber() = default; virtual void open(vpImage &I) = 0; virtual void open(vpImage &I) = 0; From 9c8806bf47e42753a2bd513412a176e383f96185 Mon Sep 17 00:00:00 2001 From: Fabien Spindler Date: Fri, 1 Dec 2023 09:22:26 +0100 Subject: [PATCH 139/169] Introduce OBVS and PBVS python bindings examples --- modules/python/examples/ibvs-four-points.py | 310 ++++++++++++++++++++ modules/python/examples/pbvs-four-points.py | 298 +++++++++++++++++++ 2 files changed, 608 insertions(+) create mode 100644 modules/python/examples/ibvs-four-points.py create mode 100644 modules/python/examples/pbvs-four-points.py diff --git a/modules/python/examples/ibvs-four-points.py b/modules/python/examples/ibvs-four-points.py new file mode 100644 index 0000000000..aa73828db7 --- /dev/null +++ b/modules/python/examples/ibvs-four-points.py @@ -0,0 +1,310 @@ +############################################################################# +# +# 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: +# ViSP Python example to simulate an image-based visual servo on four 2D points +# +############################################################################# + +import numpy as np +import argparse +import sys + +# For plots +import matplotlib.pyplot as plt +import os + +# Use latex in plot legends and labels +plt.rc('text', usetex=True) +plt.rc('text.latex', preamble=r'\usepackage{amsmath}') + +# ViSp Python bindings +from visp.core import ExponentialMap +from visp.core import HomogeneousMatrix +from visp.core import Math +from visp.core import Point +from visp.core import RotationMatrix +from visp.core import ThetaUVector +from visp.core import TranslationVector + +from visp.visual_features import FeatureBuilder +from visp.visual_features import FeaturePoint + +from visp.vs import Servo + +class PlotIbvs: + def __init__(self, e, norm_e, v, x, xd, c_T_w, plot_log_scale): + self.vector_e = e + self.vector_ne = norm_e + self.vector_v = v + self.vector_x = x + self.vector_xd = xd + self.vector_w_t_c = c_T_w.inverse().getTranslationVector() + self.plot_log_scale = plot_log_scale + + def stack(self, e, norm_e, v, x, xd, c_T_w): + self.vector_e = np.vstack((self.vector_e, e)) + self.vector_ne = np.vstack((self.vector_ne, norm_e)) + self.vector_v = np.vstack((self.vector_v, v)) + self.vector_x = np.vstack((self.vector_x, x)) + self.vector_w_t_c = np.vstack((self.vector_w_t_c, c_T_w.inverse().getTranslationVector())) + + def display(self, fig_filename): + plt.figure(figsize=(10,10)) + + plot_e = plt.subplot(2, 2, 1) + plot_v = plt.subplot(2, 2, 2) + plot_ne = plt.subplot(2, 2, 3) + plot_x = plt.subplot(2, 2, 4) + + plot_e.set_title('error') + plot_v.set_title('camera velocity') + plot_x.set_title('point trajectory in the image plane') + + if self.plot_log_scale: + plot_ne.set_title('log(norm error)') + plot_ne.plot(np.log(self.vector_ne)) + else: + plot_ne.set_title('norm error') + plot_ne.plot(self.vector_ne) + + plot_ne.grid(True) + plot_e.grid(True) + plot_v.grid(True) + plot_x.grid(True) + + plot_e.plot(self.vector_e) + plot_e.legend(['$x_1$','$y_1$','$x_2$','$y_2$','$x_3$','$y_3$','$x_4$','$y_4$',]) + + for i in range(self.vector_v.shape[1]): # Should be 6 + plot_v.plot(self.vector_v[:,i]) + plot_v.legend(['$v_x$','$v_y$','$v_z$','$\omega_x$','$\omega_y$','$\omega_z$']) + + for i in range(self.vector_x.shape[1]): + pts = np.asarray([[p.get_x(), p.get_y()] for p in self.vector_x[:, i]]) + plot_x.plot(pts[:, 0], pts[:, 1]) + plot_x.legend(['$x_1$','$x_2$','$x_3$','$x_4$']) + + for i in range(self.vector_x.shape[1] ): + plot_x.plot(self.vector_xd[i].get_x(), self.vector_xd[i].get_y(),'o') + + # Create output folder it it doesn't exist + output_folder = os.path.dirname(fig_filename) + if not os.path.exists(output_folder): + os.makedirs(output_folder) + print("Create output folder: ", output_folder) + + print(f"Figure is saved in {fig_filename}") + plt.savefig(fig_filename) + + # Plot 3D camera trajectory + plot_traj = plt.figure().add_subplot(projection='3d') + plot_traj.scatter(self.vector_w_t_c[0][0], self.vector_w_t_c[0][1], self.vector_w_t_c[0][2], marker='x', c='r', label='Initial position') + # Hack to ensure that the scale is at minimum between -0.5 and 0.5 along X and Y axis + min_s = np.min(self.vector_w_t_c, axis=0) + max_s = np.max(self.vector_w_t_c, axis=0) + for i in range(len(min_s)): + if (max_s[i] - min_s[i]) < 1.: + max_s[i] += 0.5 + min_s[i] -= 0.5 + plot_traj.axis(xmin=min_s[0], xmax=max_s[0]) + plot_traj.axis(ymin=min_s[1], ymax=max_s[1]) + + plot_traj.plot(self.vector_w_t_c[:, 0], self.vector_w_t_c[:, 1], zs=self.vector_w_t_c[:, 2], label='Camera trajectory') + plot_traj.set_title('Camera trajectory w_t_c in world space') + plot_traj.legend() + filename = os.path.splitext(fig_filename)[0] + "-traj-w_t_c.png" + print(f"Figure is saved in {filename}") + plt.savefig(filename) + + plt.show() + +if __name__ == '__main__': + parser = argparse.ArgumentParser(description='The script corresponding to TP 4, IBVS on 4 points.') + parser.add_argument('--initial-position', type=int, default=2, dest='initial_position', help='Initial position selection (value 1, 2, or 3)') + parser.add_argument('--interaction', type=str, default="current", dest='interaction_matrix_type', help='Interaction matrix type (value \"current\" or \"desired\")') + parser.add_argument('--plot-log-scale', action='store_true', help='Plot norm of the error using a logarithmic scale') + parser.add_argument('--no-plot', action='store_true', help='Disable plots') + + args, unknown_args = parser.parse_known_args() + if unknown_args: + print("The following args are not recognized and will not be used: %s" % unknown_args) + sys.exit() + + print(f"Use initial position {args.initial_position}") + + # Position of the reference in the camera frame + c_T_w = HomogeneousMatrix() + + if args.initial_position == 1: + # - CASE 1 + thetau = ThetaUVector(0.0, 0.0, 0.0) + c_R_w = RotationMatrix(thetau) + c_t_w = TranslationVector(0.0, 0.0, 1.3) + c_T_w.insert(c_R_w) + c_T_w.insert(c_t_w) + elif args.initial_position == 2: + # - CASE 2 + thetau = ThetaUVector(Math.rad(10), Math.rad(20), Math.rad(30)) + c_R_w = RotationMatrix(thetau) + c_t_w = TranslationVector(-0.2, -0.1, 1.3) + c_T_w.insert(c_R_w) + c_T_w.insert(c_t_w) + elif args.initial_position == 3: + # - CASE 3 : 90 rotation along Z axis + thetau = ThetaUVector(0.0, 0.0, Math.rad(90)) + c_R_w = RotationMatrix(thetau) + c_t_w = TranslationVector(0.0, 0.0, 1.0) + c_T_w.insert(c_R_w) + c_T_w.insert(c_t_w) + else: + raise ValueError(f"Wrong initial position value. Values are 1, 2 or 3") + + # Position of the desired camera in the world reference frame + cd_T_w = HomogeneousMatrix() + thetau = ThetaUVector(0, 0, 0) + cd_R_w = RotationMatrix(thetau) + cd_t_w = TranslationVector(0.0, 0.0, 1.0) + cd_T_w.insert(cd_R_w) + cd_T_w.insert(cd_t_w) + + # 3D point in the reference frame in homogeneous coordinates + wX = [] + wX.append(Point(-0.1, 0.1, 0.0)) + wX.append(Point( 0.1, 0.1, 0.0)) + wX.append(Point( 0.1, -0.1, 0.0)) + wX.append(Point(-0.1, -0.1, 0.0)) + + # Creation of the current and desired features vectors respectively in x and xd + x = [FeaturePoint(), FeaturePoint(), FeaturePoint(),FeaturePoint()] # Initialize current visual feature + xd = [FeaturePoint(), FeaturePoint(), FeaturePoint(), FeaturePoint()] # Initialize desired visual feature + + # Create the visual servo task + task = Servo() + task.setServo(Servo.EYEINHAND_CAMERA) + task.setLambda(0.1) # Set the constant gain + + # For each point + for i in range(len(wX)): + # Create current visual feature + wX[i].track(c_T_w) + FeatureBuilder.create(x[i], wX[i]) + + print(f"Visual features at initial position for point {i}:") + print(f" wX[{i}]: {wX[i].get_oX()} {wX[i].get_oY()} {wX[i].get_oZ()}") + print(f" cX[{i}]: {wX[i].get_X()} {wX[i].get_Y()} {wX[i].get_Z()}") + print(f" x[{i}]: {x[i].get_x()} {x[i].get_y()} {x[i].get_Z()}") + + # Create desired visual feature + wX[i].track(cd_T_w) + FeatureBuilder.create(xd[i], wX[i]) + + print(f"Visual features at desired position for point {i}:") + print(f"cdX[{i}]: {wX[i].get_X()} {wX[i].get_Y()} {wX[i].get_Z()}") + print(f"xd[{i}]: {xd[i].get_x()} {xd[i].get_y()} {xd[i].get_Z()}") + + # Add current and desired features to the visual servo task + task.addFeature(x[i], xd[i]) + + iter = 0 + + # Control loop + while (iter == 0 or norm_e > 0.0001): + print(f"---- Visual servoing iteration {iter} ----") + # Considered vars: + # e: error vector + # norm_e: norm of the error vector + # v: velocity to apply to the camera + # x: current visual feature vector + # xd: desired visual feature vector + # c_T_w: current position of the camera in the world frame + if args.interaction_matrix_type == "current": + # Set interaction matrix type + task.setInteractionMatrixType(Servo.CURRENT, Servo.PSEUDO_INVERSE) + # Update visual features in x for each point + for i in range(len(wX)): + # Update current visual feature + wX[i].track(c_T_w); + FeatureBuilder.create(x[i], wX[i]) + elif args.interaction_matrix_type == "desired": + # Set interaction matrix type + task.setInteractionMatrixType(Servo.DESIRED, Servo.PSEUDO_INVERSE) + # Update visual features in xd + for i in range(len(wX)): + # Update current visual feature + wX[i].track(c_T_w); + FeatureBuilder.create(x[i], wX[i]) + # Update desired visual feature + wX[i].track(cd_T_w); + FeatureBuilder.create(xd[i], wX[i]) + else: + raise ValueError(f"Wrong interaction matrix type. Values are \"current\" or \"desired\"") + + # Compute the control law + v = task.computeControlLaw() + e = task.getError() + norm_e = e.frobeniusNorm() + Lx = task.getInteractionMatrix() + + xplot = [] + + if not args.no_plot: + for f in x: + p = FeaturePoint() + p.buildFrom(f.get_x(), f.get_y(), f.get_Z()) + xplot.append(p) + + if iter == 0: + plot = PlotIbvs(e, norm_e, v, xplot, xd, c_T_w, args.plot_log_scale) + else: + plot.stack(e, norm_e, v, xplot, xd, c_T_w) + + # Compute camera displacement after applying the velocity for delta_t seconds. + c_T_c_delta_t = ExponentialMap.direct(v, 0.040) + + # Compute the new position of the camera + c_T_w = c_T_c_delta_t.inverse() * c_T_w + + print(f"e: \n{e}") + print(f"norm e: \n{norm_e}") + print(f"Lx: \n{Lx}") + print(f"v: \n{v}") + print(f"c_T_w: \n{c_T_w}") + + # Increment iteration counter + iter += 1 + + print(f"\nConvergence achieved in {iter} iterations") + + if not args.no_plot: + # Display the servo behavior + plot.display("results/fig-ibvs-four-points-initial-position-" + str(args.initial_position) + ".png") + + print("Kill the figure to quit...") diff --git a/modules/python/examples/pbvs-four-points.py b/modules/python/examples/pbvs-four-points.py new file mode 100644 index 0000000000..0a06bb979d --- /dev/null +++ b/modules/python/examples/pbvs-four-points.py @@ -0,0 +1,298 @@ +############################################################################# +# +# 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: +# ViSP Python example to simulate a position-based visual servo on four 2D points +# +############################################################################# + +import numpy as np +import argparse +import sys + +# For plots +import matplotlib.pyplot as plt +import os + +# Use latex in plot legends and labels +plt.rc('text', usetex=True) +plt.rc('text.latex', preamble=r'\usepackage{amsmath}') + +# ViSp Python bindings +from visp.core import ExponentialMap +from visp.core import HomogeneousMatrix +from visp.core import Math +from visp.core import Point +from visp.core import RotationMatrix +from visp.core import ThetaUVector +from visp.core import TranslationVector + +from visp.visual_features import FeatureTranslation +from visp.visual_features import FeatureThetaU + +from visp.vs import Servo + +class PlotPbvs: + def __init__(self, e, norm_e, v, x, xd, c_T_w, plot_log_scale): + self.vector_e = e + self.vector_ne = norm_e + self.vector_v = v + self.vector_x = x + self.vector_xd = xd + self.vector_w_t_c = c_T_w.inverse().getTranslationVector() + self.plot_log_scale = plot_log_scale + + def stack(self, e, norm_e, v, x, xd, c_T_w): + self.vector_e = np.vstack((self.vector_e, e)) + self.vector_ne = np.vstack((self.vector_ne, norm_e)) + self.vector_v = np.vstack((self.vector_v, v)) + self.vector_x = np.vstack((self.vector_x, x)) + self.vector_w_t_c = np.vstack((self.vector_w_t_c, c_T_w.inverse().getTranslationVector())) + + def display(self, fig_filename): + plt.figure(figsize=(10,10)) + + plot_e = plt.subplot(2, 2, 1) + plot_v = plt.subplot(2, 2, 2) + plot_ne = plt.subplot(2, 2, 3) + plot_x = plt.subplot(2, 2, 4) + + plot_e.set_title('error') + plot_v.set_title('camera velocity') + plot_x.set_title('point trajectory in the image plane') + + if self.plot_log_scale: + plot_ne.set_title('log(norm error)') + plot_ne.plot(np.log(self.vector_ne)) + else: + plot_ne.set_title('norm error') + plot_ne.plot(self.vector_ne) + + plot_ne.grid(True) + plot_e.grid(True) + plot_v.grid(True) + plot_x.grid(True) + + plot_e.plot(self.vector_e) + plot_e.legend(['$x_1$','$y_1$','$x_2$','$y_2$','$x_3$','$y_3$','$x_4$','$y_4$',]) + + for i in range(self.vector_v.shape[1]): # Should be 6 + plot_v.plot(self.vector_v[:,i]) + plot_v.legend(['$v_x$','$v_y$','$v_z$','$\omega_x$','$\omega_y$','$\omega_z$']) + + for i in range(self.vector_x.shape[1] // 2): # Note: Use // to divide an int and return an int + plot_x.plot(self.vector_x[:,2*i], self.vector_x[:,2*i+1]) + plot_x.legend(['$x_1$','$x_2$','$x_3$','$x_4$']) + for i in range(self.vector_x.shape[1] // 2): # Note: Use // to divide an int and return an int + plot_x.plot(self.vector_xd[2*i], self.vector_xd[2*i+1],'o') + + # Create output folder it it doesn't exist + output_folder = os.path.dirname(fig_filename) + if not os.path.exists(output_folder): + os.makedirs(output_folder) + print("Create output folder: ", output_folder) + + print(f"Figure is saved in {fig_filename}") + plt.savefig(fig_filename) + + # Plot 3D camera trajectory + plot_traj = plt.figure().add_subplot(projection='3d') + plot_traj.scatter(self.vector_w_t_c[0][0], self.vector_w_t_c[0][1], self.vector_w_t_c[0][2], marker='x', c='r', label='Initial position') + # Hack to ensure that the scale is at minimum between -0.5 and 0.5 along X and Y axis + min_s = np.min(self.vector_w_t_c, axis=0) + max_s = np.max(self.vector_w_t_c, axis=0) + for i in range(len(min_s)): + if (max_s[i] - min_s[i]) < 1.: + max_s[i] += 0.5 + min_s[i] -= 0.5 + plot_traj.axis(xmin=min_s[0], xmax=max_s[0]) + plot_traj.axis(ymin=min_s[1], ymax=max_s[1]) + + plot_traj.plot(self.vector_w_t_c[:, 0], self.vector_w_t_c[:, 1], zs=self.vector_w_t_c[:, 2], label='Camera trajectory') + plot_traj.set_title('Camera trajectory w_t_c in world space') + plot_traj.legend() + filename = os.path.splitext(fig_filename)[0] + "-traj-w_t_c.png" + print(f"Figure is saved in {filename}") + plt.savefig(filename) + + plt.show() + +if __name__ == '__main__': + parser = argparse.ArgumentParser(description='The script corresponding to TP 4, IBVS on 4 points.') + parser.add_argument('--initial-position', type=int, default=2, dest='initial_position', help='Initial position selection (value 1, 2, 3 or 4)') + parser.add_argument('--interaction', type=str, default="current", dest='interaction_matrix_type', help='Interaction matrix type (value \"current\" or \"desired\")') + parser.add_argument('--plot-log-scale', action='store_true', help='Plot norm of the error using a logarithmic scale') + parser.add_argument('--no-plot', action='store_true', help='Disable plots') + + args, unknown_args = parser.parse_known_args() + if unknown_args: + print("The following args are not recognized and will not be used: %s" % unknown_args) + sys.exit() + + print(f"Use initial position {args.initial_position}") + + # Position of the reference in the camera frame + c_T_w = HomogeneousMatrix() + + if args.initial_position == 1: + # - CASE 1 + thetau = ThetaUVector(0.0, 0.0, 0.0) + c_R_w = RotationMatrix(thetau) + c_t_w = TranslationVector(0.0, 0.0, 1.3) + c_T_w.insert(c_R_w) + c_T_w.insert(c_t_w) + elif args.initial_position == 2: + # - CASE 2 + thetau = ThetaUVector(Math.rad(10), Math.rad(20), Math.rad(30)) + c_R_w = RotationMatrix(thetau) + c_t_w = TranslationVector(-0.2, -0.1, 1.3) + c_T_w.insert(c_R_w) + c_T_w.insert(c_t_w) + elif args.initial_position == 3: + # - CASE 3 : 90 rotation along Z axis + thetau = ThetaUVector(0.0, 0.0, Math.rad(90)) + c_R_w = RotationMatrix(thetau) + c_t_w = TranslationVector(0.0, 0.0, 1.0) + c_T_w.insert(c_R_w) + c_T_w.insert(c_t_w) + elif args.initial_position == 4: + # - CASE 4 : 180 rotation along Z axis + thetau = ThetaUVector(0.0, 0.0, Math.rad(180)) + c_R_w = RotationMatrix(thetau) + c_t_w = TranslationVector(0.0, 0.0, 1.0) + c_T_w.insert(c_R_w) + c_T_w.insert(c_t_w) + else: + raise ValueError(f"Wrong initial position value. Values are 1, 2, 3 or 4") + + # Position of the desired camera in the world reference frame + cd_T_w = HomogeneousMatrix() + thetau = ThetaUVector(0, 0, 0) + cd_R_w = RotationMatrix(thetau) + cd_t_w = TranslationVector(0.0, 0.0, 1.0) + cd_T_w.insert(cd_R_w) + cd_T_w.insert(cd_t_w) + + # 3D point in the reference frame in homogeneous coordinates + wX = [] + wX.append(Point(-0.1, 0.1, 0.0)) + wX.append(Point( 0.1, 0.1, 0.0)) + wX.append(Point( 0.1, -0.1, 0.0)) + wX.append(Point(-0.1, -0.1, 0.0)) + + # Begin just for point trajectory display, compute the coordinates of the points in the image plane + x = np.zeros(8) # Current coordinates of the points [x1,y1,x2,y2,x3,y3,x4,y4] + xd = np.zeros(8) # desired coordinates of the points [xd1,yd1,xd2,yd2,xd3,yd3,xd4,yd4] + # Update the coordinates of the 4 desired points + for i in range(len(wX)): + wX[i].track(cd_T_w) + xd[2*i:2*i+2] = [wX[i].get_x(), wX[i].get_y()] + # End just for point trajectory display + + # Creation of the current (t and tu) and desired (td and tud) features vectors + t = FeatureTranslation(FeatureTranslation.cdMc) + tu = FeatureThetaU(FeatureThetaU.cdRc) + td = FeatureTranslation(FeatureTranslation.cdMc) + tud = FeatureThetaU(FeatureThetaU.cdRc) + + # Create the visual servo task + task = Servo() + task.setServo(Servo.EYEINHAND_CAMERA) + task.setLambda(0.1) # Set the constant gain + task.addFeature(t, td) + task.addFeature(tu, tud) + + iter = 0 + + # Control loop + while (iter == 0 or norm_e > 0.0001): + print(f"---- Visual servoing iteration {iter} ----") + # Considered vars: + # e: error vector + # norm_e: norm of the error vector + # v: velocity to apply to the camera + # x: current visual feature vector + # xd: desired visual feature vector + # c_T_w: current position of the camera in the world frame + + # Compute current features + cd_T_c = cd_T_w * c_T_w.inverse() + t.buildFrom(cd_T_c) + tu.buildFrom(cd_T_c) + + # Begin just for point trajectory display, compute the coordinates of the points in the image plane + for i in range(len(wX)): + wX[i].track(c_T_w) + x[2*i:2*i+2] = [wX[i].get_x(), wX[i].get_y()] + # End just for point trajectory display + + if args.interaction_matrix_type == "current": + # Set interaction matrix type + task.setInteractionMatrixType(Servo.CURRENT, Servo.PSEUDO_INVERSE) + elif args.interaction_matrix_type == "desired": + # Set interaction matrix type + task.setInteractionMatrixType(Servo.DESIRED, Servo.PSEUDO_INVERSE) + else: + raise ValueError(f"Wrong interaction matrix type. Values are \"current\" or \"desired\"") + + # Compute the control law + v = task.computeControlLaw() + e = task.getError() + norm_e = e.frobeniusNorm() + Lx = task.getInteractionMatrix() + + if not args.no_plot: + if iter == 0: + plot = PlotPbvs(e, norm_e, v, x, xd, c_T_w, args.plot_log_scale) + else: + plot.stack(e, norm_e, v, x, xd, c_T_w) + + # Compute camera displacement after applying the velocity for delta_t seconds. + c_T_c_delta_t = ExponentialMap.direct(v, 0.040) + + # Compute the new position of the camera + c_T_w = c_T_c_delta_t.inverse() * c_T_w + + print(f"e: \n{e}") + print(f"norm e: \n{norm_e}") + print(f"Lx: \n{Lx}") + print(f"v: \n{v}") + print(f"c_T_w: \n{c_T_w}") + + # Increment iteration counter + iter += 1 + + print(f"\nConvergence achieved in {iter} iterations") + + if not args.no_plot: + # Display the servo behavior + plot.display("results/fig-pbvs-four-points-initial-position-" + str(args.initial_position) + ".png") + + print("Kill the figure to quit...") From d24edf38c3cf9b85e4482ae79b4c1f851e1dbd5d Mon Sep 17 00:00:00 2001 From: Fabien Spindler Date: Fri, 1 Dec 2023 09:24:07 +0100 Subject: [PATCH 140/169] Remove 'results' folder created by python examples from scm --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 4afe45317a..32d750fcd7 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ modules/java/\.idea/ .scannerwork build *.blend1 +**/results/** From cd51999e302ab7bcb94672eb10a4e5bc574d7fba Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Fri, 1 Dec 2023 13:13:25 +0100 Subject: [PATCH 141/169] fix braced initialization warning --- modules/python/bindings/include/core/arrays.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/python/bindings/include/core/arrays.hpp b/modules/python/bindings/include/core/arrays.hpp index 20274f2e22..13ad80777c 100644 --- a/modules/python/bindings/include/core/arrays.hpp +++ b/modules/python/bindings/include/core/arrays.hpp @@ -287,7 +287,8 @@ void bindings_vpTranslationVector(py::class_ np_array) { - verify_array_shape_and_dims(np_array, { 3 }, "ViSP translation vector"); + const std::vector required_shape = { 3 }; + verify_array_shape_and_dims(np_array, required_shape, "ViSP translation vector"); const std::vector shape = np_array.request().shape; vpTranslationVector result; copy_data_from_np(np_array, result.data); From 1d458f9e064f6555d5a753de161493281e44c0c9 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Fri, 1 Dec 2023 14:26:40 +0100 Subject: [PATCH 142/169] Update keep alive for numpy conversions in order to avoid potential double free --- .../python/bindings/include/core/arrays.hpp | 22 +++++++-------- .../include/core/image_conversions.hpp | 2 -- .../python/bindings/include/core/images.hpp | 28 +++++++++++++++---- 3 files changed, 34 insertions(+), 18 deletions(-) diff --git a/modules/python/bindings/include/core/arrays.hpp b/modules/python/bindings/include/core/arrays.hpp index 13ad80777c..7c862728c2 100644 --- a/modules/python/bindings/include/core/arrays.hpp +++ b/modules/python/bindings/include/core/arrays.hpp @@ -127,13 +127,13 @@ void define_get_item_2d_array(PyClass &pyClass) i = rows + i; } return (py::cast(self).template cast >())[py::cast(i)].template cast>(); - }); + }, py::keep_alive<0, 1>()); pyClass.def("__getitem__", [](const Class &self, py::slice slice) -> py::array_t { return (py::cast(self).template cast >())[slice].template cast>(); - }); + }, py::keep_alive<0, 1>()); pyClass.def("__getitem__", [](const Class &self, py::tuple tuple) { return (py::cast(self).template cast >())[tuple].template cast>(); - }); + }, py::keep_alive<0, 1>()); } /* @@ -158,7 +158,7 @@ void define_get_item_1d_array(PyClass &pyClass) }); pyClass.def("__getitem__", [](const Class &self, py::slice slice) -> py::array_t { return (py::cast(self).template cast >())[slice].template cast>(); - }); + }, py::keep_alive<0, 1>()); } const char *numpy_fn_doc_writable = R"doc( @@ -179,7 +179,7 @@ void bindings_vpArray2D(py::class_> &pyArray2D) pyArray2D.def("numpy", [](vpArray2D &self) -> np_array_cf { return py::cast(self).template cast >(); - }, numpy_fn_doc_writable); + }, numpy_fn_doc_writable, py::keep_alive<0, 1>()); pyArray2D.def(py::init([](np_array_cf &np_array) { verify_array_shape_and_dims(np_array, 2, "ViSP 2D array"); @@ -203,7 +203,7 @@ void bindings_vpMatrix(py::class_> &pyMatrix) pyMatrix.def("numpy", [](vpMatrix &self) -> np_array_cf { return py::cast(self).cast>(); - }, numpy_fn_doc_writable); + }, numpy_fn_doc_writable, py::keep_alive<0, 1>()); pyMatrix.def(py::init([](np_array_cf np_array) { verify_array_shape_and_dims(np_array, 2, "ViSP Matrix"); @@ -228,7 +228,7 @@ void bindings_vpRotationMatrix(py::class_> & pyRotationMatrix.def_buffer(&get_buffer_info); pyRotationMatrix.def("numpy", [](vpRotationMatrix &self) -> np_array_cf { return py::cast(self).cast>(); - }, numpy_fn_doc_nonwritable); + }, numpy_fn_doc_nonwritable, py::keep_alive<0, 1>()); pyRotationMatrix.def(py::init([](np_array_cf np_array) { verify_array_shape_and_dims(np_array, { 3, 3 }, "ViSP rotation matrix"); const std::vector shape = np_array.request().shape; @@ -254,7 +254,7 @@ void bindings_vpHomogeneousMatrix(py::class_); pyHomogeneousMatrix.def("numpy", [](vpHomogeneousMatrix &self) -> np_array_cf { return py::cast(self).cast>(); - }, numpy_fn_doc_nonwritable); + }, numpy_fn_doc_nonwritable, py::keep_alive<0, 1>()); pyHomogeneousMatrix.def(py::init([](np_array_cf np_array) { verify_array_shape_and_dims(np_array, { 4, 4 }, "ViSP homogeneous matrix"); @@ -284,7 +284,7 @@ void bindings_vpTranslationVector(py::class_ np_array_cf { return py::cast(self).cast>(); - }, numpy_fn_doc_writable); + }, numpy_fn_doc_writable, py::keep_alive<0, 1>()); pyTranslationVector.def(py::init([](np_array_cf np_array) { const std::vector required_shape = { 3 }; @@ -309,7 +309,7 @@ void bindings_vpColVector(py::class_> &pyColVecto pyColVector.def("numpy", [](vpColVector &self) -> np_array_cf { return py::cast(self).cast>(); - }, numpy_fn_doc_writable); + }, numpy_fn_doc_writable, py::keep_alive<0, 1>()); pyColVector.def(py::init([](np_array_cf np_array) { verify_array_shape_and_dims(np_array, 1, "ViSP column vector"); @@ -332,7 +332,7 @@ void bindings_vpRowVector(py::class_> &pyRowVecto pyRowVector.def_buffer(&get_buffer_info); pyRowVector.def("numpy", [](vpRowVector &self) -> np_array_cf { return np_array_cf(get_buffer_info(self), py::cast(self)); - }, numpy_fn_doc_writable); + }, numpy_fn_doc_writable, py::keep_alive<0, 1>()); pyRowVector.def(py::init([](np_array_cf np_array) { verify_array_shape_and_dims(np_array, 1, "ViSP row vector"); const std::vector shape = np_array.request().shape; diff --git a/modules/python/bindings/include/core/image_conversions.hpp b/modules/python/bindings/include/core/image_conversions.hpp index 85bf4b133d..68099d9d15 100644 --- a/modules/python/bindings/include/core/image_conversions.hpp +++ b/modules/python/bindings/include/core/image_conversions.hpp @@ -237,8 +237,6 @@ void bindings_vpImageConvert(py::class_ &pyImageConvert) conversion.add_conversion_binding(pyImageConvert); } } - - } #endif diff --git a/modules/python/bindings/include/core/images.hpp b/modules/python/bindings/include/core/images.hpp index 9db16e5648..8d09c3d491 100644 --- a/modules/python/bindings/include/core/images.hpp +++ b/modules/python/bindings/include/core/images.hpp @@ -86,10 +86,10 @@ void define_get_item_2d_image(py::class_> &pyClass) }); pyClass.def("__getitem__", [](const vpImage &self, py::slice slice) -> py::array_t { return (py::cast(self).template cast >())[slice].template cast>(); - }); + }, py::keep_alive<0, 1>()); pyClass.def("__getitem__", [](const vpImage &self, py::tuple tuple) { return (py::cast(self).template cast >())[tuple].template cast>(); - }); + }, py::keep_alive<0, 1>()); } /* @@ -104,7 +104,7 @@ bindings_vpImage(py::class_> &pyImage) }); pyImage.def("numpy", [](vpImage &self) -> np_array_cf { return py::cast(self).template cast>(); - }, numpy_fn_doc_image); + }, numpy_fn_doc_image, py::keep_alive<0, 1>()); pyImage.def(py::init([](np_array_cf &np_array) { verify_array_shape_and_dims(np_array, 2, "ViSP Image"); @@ -133,7 +133,7 @@ bindings_vpImage(py::class_> &pyImage) }); pyImage.def("numpy", [](vpImage &self) -> np_array_cf { return py::cast(self).template cast>(); - }, numpy_fn_doc_image); + }, numpy_fn_doc_image, py::keep_alive<0, 1>()); pyImage.def(py::init([](np_array_cf &np_array) { verify_array_shape_and_dims(np_array, 3, "ViSP RGBa image"); @@ -163,9 +163,27 @@ bindings_vpImage(py::class_> &pyImage) pyImage.def_buffer([](vpImage &image) -> py::buffer_info { return make_array_buffer(reinterpret_cast(image.bitmap), { image.getHeight(), image.getWidth(), 3 }, false); }); + pyImage.def("numpy", [](vpImage &self) -> np_array_cf { return py::cast(self).template cast>(); - }, numpy_fn_doc_image); + }, numpy_fn_doc_image, py::keep_alive<0, 1>()); + + pyImage.def(py::init([](np_array_cf &np_array) { + verify_array_shape_and_dims(np_array, 3, "ViSP RGBa image"); + const std::vector shape = np_array.request().shape; + if (shape[2] != 3) { + throw std::runtime_error("Tried to copy a 3D numpy array that does not have 3 elements per pixel into a ViSP RGBf image"); + } + vpImage result(shape[0], shape[1]); + copy_data_from_np(np_array, (NpRep *)result.bitmap); + return result; + }), R"doc( +Construct an image by **copying** a 3D numpy array. this numpy array should be of the form :math:`H \times W \times 3` +where the 3 denotes the red, green and blue components of the image. + +:param np_array: The numpy array to copy. + +)doc", py::arg("np_array")); define_get_item_2d_image(pyImage); } From ff27e0ee11001de4e2b81461ece04d300e55c5c6 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Fri, 1 Dec 2023 14:31:51 +0100 Subject: [PATCH 143/169] Rename ImageRGBA to ImageRGBa --- modules/python/config/core.json | 2 +- modules/python/examples/realsense_mbt.py | 4 ++-- modules/python/test/test_numpy_image.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/python/config/core.json b/modules/python/config/core.json index 62059157bc..6d86ecdd7f 100644 --- a/modules/python/config/core.json +++ b/modules/python/config/core.json @@ -76,7 +76,7 @@ "arguments": ["uint16_t"] }, { - "python_name": "ImageRGBA", + "python_name": "ImageRGBa", "arguments": ["vpRGBa"] }, { diff --git a/modules/python/examples/realsense_mbt.py b/modules/python/examples/realsense_mbt.py index a501a86564..3c4a17ab00 100644 --- a/modules/python/examples/realsense_mbt.py +++ b/modules/python/examples/realsense_mbt.py @@ -44,7 +44,7 @@ from visp.core import XmlParserCamera, CameraParameters, ColVector, HomogeneousMatrix, Display, ImageConvert -from visp.core import ImageGray, ImageUInt16, ImageRGBA +from visp.core import ImageGray, ImageUInt16, ImageRGBa from visp.io import ImageIo from visp.mbt import MbGenericTracker, MbTracker from visp.gui import DisplayOpenCV @@ -98,7 +98,7 @@ def read_data(cam_depth: CameraParameters | None, I: ImageGray, pipe: rs.pipelin frames = pipe.wait_for_frames() I_np = np.asanyarray(frames.get_color_frame().as_frame().get_data()) I_np = np.concatenate((I_np, np.ones_like(I_np[..., 0:1], dtype=np.uint8)), axis=-1) - I_rgba = ImageRGBA(I_np) + I_rgba = ImageRGBa(I_np) ImageConvert.convert(I_rgba, I, 0) I_depth_raw = None point_cloud = None diff --git a/modules/python/test/test_numpy_image.py b/modules/python/test/test_numpy_image.py index aad7fdcf8f..3dc2eff451 100644 --- a/modules/python/test/test_numpy_image.py +++ b/modules/python/test/test_numpy_image.py @@ -34,7 +34,7 @@ ############################################################################# from typing import Any, List, Dict -from visp.core import ImageGray, ImageRGBA, ImageRGBf, RGBa, RGBf +from visp.core import ImageGray, ImageRGBa, ImageRGBf, RGBa, RGBf import numpy as np import pytest @@ -51,7 +51,7 @@ def get_data_dicts() -> List[Dict[str, Any]]: 'dtype': np.uint8 }, { - 'instance': ImageRGBA(h, w, RGBa(0, 50, 75, 255)), + 'instance': ImageRGBa(h, w, RGBa(0, 50, 75, 255)), 'base_value': RGBa(0, 50, 75, 255), 'value': RGBa(255, 128, 0, 100), 'np_value': np.asarray([255, 128, 0, 100], dtype=np.uint8), From bab9abafad6f8a4d62044ce81bdc27e61d925870 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Fri, 1 Dec 2023 15:32:32 +0100 Subject: [PATCH 144/169] Rename MBT examples, cleanup arguments --- .../{realsense_mbt.py => realsense-mbt.py} | 24 ++++++++----------- ...etic_data_mbt.py => synthetic-data-mbt.py} | 8 +++---- 2 files changed, 14 insertions(+), 18 deletions(-) rename modules/python/examples/{realsense_mbt.py => realsense-mbt.py} (90%) rename modules/python/examples/{synthetic_data_mbt.py => synthetic-data-mbt.py} (96%) diff --git a/modules/python/examples/realsense_mbt.py b/modules/python/examples/realsense-mbt.py similarity index 90% rename from modules/python/examples/realsense_mbt.py rename to modules/python/examples/realsense-mbt.py index 3c4a17ab00..7c58c0ed47 100644 --- a/modules/python/examples/realsense_mbt.py +++ b/modules/python/examples/realsense-mbt.py @@ -43,21 +43,19 @@ faulthandler.enable() -from visp.core import XmlParserCamera, CameraParameters, ColVector, HomogeneousMatrix, Display, ImageConvert +from visp.core import CameraParameters, HomogeneousMatrix +from visp.core import Color, Display, ImageConvert from visp.core import ImageGray, ImageUInt16, ImageRGBa from visp.io import ImageIo -from visp.mbt import MbGenericTracker, MbTracker +from visp.mbt import MbGenericTracker from visp.gui import DisplayOpenCV -from visp.core import Color -from visp.core import PixelMeterConversion - import pyrealsense2 as rs try: import cv2 except: - print('Could not import opencv python! make sure that it is installed as it is required') + print('Could not import opencv-python! make sure that it is installed as it is required') import sys sys.exit(1) @@ -79,7 +77,7 @@ def __init__(self, data_root: Path): data_path = data_root / 'data' assert data_path.exists() self.extrinsic_file = str(data_path / 'depth_M_color.txt') - # self.ground_truth = str(data_root / 'data' / 'depth_M_color.txt') + @dataclass class FrameData: @@ -117,14 +115,12 @@ def cam_from_rs_profile(profile) -> Tuple[CameraParameters, int, int]: if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument('--data-root', type=str, required=True, - help='Path to the folder containing all the data for the MBT example') + help='Path to the folder containing all the data for the MBT example.') parser.add_argument('--object-name', type=str, required=True, - help='Name of the object to track') - parser.add_argument('--display-ground-truth', action='store_true') - parser.add_argument('--disable-klt', action='store_true') - parser.add_argument('--disable-depth', action='store_true') - parser.add_argument('--step-by-step', action='store_true') - parser.add_argument('--init-ground-truth', action='store_true') + help='Name of the object to track.') + parser.add_argument('--disable-klt', action='store_true', help='Disable KLT features for tracking.') + parser.add_argument('--disable-depth', action='store_true', help='Do not use depth to perform tracking.') + parser.add_argument('--step-by-step', action='store_true', help='Perform tracking frame by frame. Go to the next frame by clicking.') args = parser.parse_args() diff --git a/modules/python/examples/synthetic_data_mbt.py b/modules/python/examples/synthetic-data-mbt.py similarity index 96% rename from modules/python/examples/synthetic_data_mbt.py rename to modules/python/examples/synthetic-data-mbt.py index 0d49bfcbfa..4929afa721 100644 --- a/modules/python/examples/synthetic_data_mbt.py +++ b/modules/python/examples/synthetic-data-mbt.py @@ -162,10 +162,9 @@ def parse_camera_file(exp_config: MBTConfig, is_color: bool) -> CameraParameters parser = argparse.ArgumentParser() parser.add_argument('--data-root', type=str, required=True, help='Path to the folder containing all the data for the synthetic MBT example') - parser.add_argument('--display-ground-truth', action='store_true') - parser.add_argument('--disable-klt', action='store_true') - parser.add_argument('--disable-depth', action='store_true') - parser.add_argument('--step-by-step', action='store_true') + parser.add_argument('--disable-klt', action='store_true', help='Disable KLT features for tracking.') + parser.add_argument('--disable-depth', action='store_true', help='Do not use depth to perform tracking.') + parser.add_argument('--step-by-step', action='store_true', help='Perform tracking frame by frame. Go to the next frame by clicking.') parser.add_argument('--init-ground-truth', action='store_true') args = parser.parse_args() @@ -222,6 +221,7 @@ def parse_camera_file(exp_config: MBTConfig, is_color: bool) -> CameraParameters tracker.initFromPose(I, frame_data.cMo_ground_truth) else: tracker.initClick(I, str(mbt_model.init_file)) + start_time = time.time() for frame_data in data_generator: if frame_data.I_depth is not None: From 06000e24b45caad07bfad310c8bcf4f142bb7ccf Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Fri, 1 Dec 2023 15:33:56 +0100 Subject: [PATCH 145/169] Remove practicals reimplems from examples --- modules/python/examples/repro_tp1.py | 154 -------------------- modules/python/examples/repro_tp2.py | 130 ----------------- modules/python/examples/repro_tp3.py | 209 --------------------------- 3 files changed, 493 deletions(-) delete mode 100644 modules/python/examples/repro_tp1.py delete mode 100644 modules/python/examples/repro_tp2.py delete mode 100644 modules/python/examples/repro_tp3.py diff --git a/modules/python/examples/repro_tp1.py b/modules/python/examples/repro_tp1.py deleted file mode 100644 index 4f54caa109..0000000000 --- a/modules/python/examples/repro_tp1.py +++ /dev/null @@ -1,154 +0,0 @@ -############################################################################# -# -# 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: -# ViSP Python bindings example -# -############################################################################# - -import argparse -import numpy as np - -from matplotlib import pyplot as plt -from matplotlib import image -from pathlib import Path - -from visp.core import CameraParameters, HomogeneousMatrix, TranslationVector, ThetaUVector, ImagePoint -from visp.core import ImageGray -from visp.io import ImageIo - -if __name__ == '__main__': - parser = argparse.ArgumentParser(description='The script corresponding to TP 1.') - parser.add_argument('--use-case', type=int, default=1, dest='use_case', help='Use case value 1, 2 or 3') - parser.add_argument('--data', type=str, required=True, help='Path to data') - - args, unknown_args = parser.parse_known_args() - if unknown_args: - print("The following args are not recognized and will not be used: %s" % unknown_args) - - data_path = Path(args.data) - assert data_path.exists() - print("Use case %s" % args.use_case) - assert 0 < args.use_case < 4, 'use case should be between 1 and 3' - - # Position of the reference in the camera 2 frame - translation = TranslationVector(0, 0, 2) - thetau = ThetaUVector(0, 0, 0) - c2Tw = HomogeneousMatrix(translation, thetau) - print(f'c2Tw = \n{c2Tw}') - - print('-----------------') - c1_cases = [ - HomogeneousMatrix(TranslationVector(-0.1, 0, 2), ThetaUVector(0, 0, 0)), - HomogeneousMatrix(TranslationVector(0, 0, 1.8), ThetaUVector(0, 0, 0)), - HomogeneousMatrix(TranslationVector(0.1, 0, 1.9), ThetaUVector(*[np.radians(5) for _ in range(3)])) - ] - c1Tw = c1_cases[args.use_case - 1] - # Position of the reference in the camera 1 frame - print(f'c1Tw = \n{c1Tw}') - - print('-----------------') - cam = CameraParameters(800, 800, 200, 150) - K = cam.get_K() - - print(f"cam = \n{cam}\nK =\n {K}") - print('-----------------') - x2 = np.array([ - [273, 166, 1], - [112, 84, 1], - [ 90, 196, 1], - [321, 123, 1], - [206, 7, 1] - ]) - plt.figure() - plt.ion() - - #image1 = image.imread(f"data/I1{args.use_case}.png") - image1, image2 = ImageGray(), ImageGray() - ImageIo.read(image1, str(data_path / f'tp1-I1{args.use_case}.png'), ImageIo.ImageIoBackendType.IO_DEFAULT_BACKEND) - ImageIo.read(image2, str(data_path / f'tp1-I2.png'), ImageIo.ImageIoBackendType.IO_DEFAULT_BACKEND) - - plt1 = plt.subplot(2,1,1) - plt2 = plt.subplot(2,1,2) - - color = ['r','y','b','g','c','m','y','k'] - - # Get image size - img_rows = image1.getHeight() - img_cols = image1.getWidth() - print(f"Image size: {img_rows} x {img_cols}") - - # Calculate the geometric location of a point x1 as a function of x2 - wTc2 = c2Tw.inverse() - c1Tc2: HomogeneousMatrix = c1Tw * wTc2 - print(f'c1Tc2 = \n {c1Tc2}') - - # Option 1: access numpy - # c1tc2 = c1Tc2[:3,3:] - # c1Rc2 = c1Tc2[:3,:3] - - c1tc2 = c1Tc2.getTranslationVector() - c1Rc2 = c1Tc2.getRotationMatrix() - - Kinv = cam.get_K_inverse() - - A = c1tc2.skew() * c1Rc2 * Kinv - print("A=", A) - print("Kinv=", Kinv) - - Kinvtranspose = Kinv.transpose() - print("Kinv.t=", Kinvtranspose) - - # Compute fundamental matrix F - F = np.matmul(Kinvtranspose, A) - print("F=", F) - - for i in range(len(x2)): - plt2.plot(x2[i][0], x2[i][1], color[i]+'o') - - # Calculate the geometric location of a point x1 as a function of x2 - De1 = np.matmul(F, x2[i]) - - print(De1) - - # Draw geometric location in image 1 - x = np.array([0, img_cols]) - y = np.array([-De1[2]/De1[1],(-De1[2]-img_cols*De1[0])/De1[1]]) - - print('x = ',x) - print('y = ',y) - - plt1.plot(x, y, color=color[i], linewidth=1) - - plt1.imshow(image1, cmap='gray') - plt2.imshow(image2, cmap='gray') - - plt.waitforbuttonpress() - plt.show() diff --git a/modules/python/examples/repro_tp2.py b/modules/python/examples/repro_tp2.py deleted file mode 100644 index 3332273382..0000000000 --- a/modules/python/examples/repro_tp2.py +++ /dev/null @@ -1,130 +0,0 @@ -############################################################################# -# -# 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: -# ViSP Python bindings example -# -############################################################################# - -import argparse -import numpy as np - -from matplotlib import pyplot as plt -from matplotlib import image -from pathlib import Path - -from visp.core import CameraParameters, HomogeneousMatrix, TranslationVector, ThetaUVector, ImagePoint, Matrix -from visp.core import ImageGray, ImageTools -from visp.vision import Homography -from visp.io import ImageIo - -if __name__ == '__main__': - parser = argparse.ArgumentParser(description='The script corresponding to TP 2.') - parser.add_argument('--data', type=str, required=True, help='Path to data') - args = parser.parse_args() - data_path = Path(args.data) - assert data_path.exists() - image1, image2 = ImageGray(), ImageGray() - ImageIo.read(image1, str(data_path / 'tp2-I1.jpg'), ImageIo.ImageIoBackendType.IO_DEFAULT_BACKEND) - ImageIo.read(image2, str(data_path / 'tp2-I2.jpg'), ImageIo.ImageIoBackendType.IO_DEFAULT_BACKEND) - - # Pretty print of numpy arrays - np.set_printoptions(precision=7, suppress=True) - - plt.figure(figsize=(15,15)) - plt.ion() - - plt1 = plt.subplot(2,2,1) - plt2 = plt.subplot(2,2,2) - plt3 = plt.subplot(2,2,4) - - plt1.imshow(image1, cmap='gray') - plt2.imshow(image2, cmap='gray') - - # Coordinates of the 5 points in image 1 - u1 = np.array([ 135.0517282, 464.3374805, 432.1843943, 49.75437317, 298.9792208]) - v1 = np.array([44.30715709, 185.9258178, 422.7760738, 339.1144011, 236.5545455]) - - # Coordinates of the 5 points in image 2 - u2 = np.array([ 122.9683498, 453.4691964, 521.5894161, 199.0225322, 336.3672109]) - v2 = np.array([ 126.6271928, 61.28444847, 278.4105839, 388.944206, 198.3472826 ]) - - color = ['r','y','b','g','c','m','y','k'] - - for i in range(len(u1)): - plt1.plot(u1[i], v1[i],color[i]+'o') - plt2.plot(u2[i], v2[i],color[i]+'o') - - plt1.text(u1[i]+10, v1[i]-10, i, color=color[i]) - plt2.text(u2[i]+10, v2[i]-10, i, color=color[i]) - - # Compute matrix c2Hc1 such as x2 = c2Hc1 * x1 - c2Hc1 = Homography() - Homography.DLT(u1, v1, u2, v2, c2Hc1, False) - - print("c2Hc1= \n", c2Hc1) - - residual = 0 - for i in range(len(u1)): - print('point ', i) - x1 = np.array([u1[i], v1[i], 1]) - x2 = np.matmul(c2Hc1, x1) - x2 = x2/x2[2] - print("x2 = ", x2) - - error = np.linalg.norm(np.array([u2[i], v2[i], 1]) - x2) - print("Error for point ", i, ":", error) - - residual += error*error - - plt2.plot(u2[i], v2[i],color[i+1]+'+') - plt2.add_artist(plt.Circle((u2[i], v2[i]), error*100, fill=False, color=color[i+1])) - - residual = np.sqrt(residual / len(u1)) - print("Mean residual: ", residual) - - h, w = image1.getRows(), image1.getCols() - - hbl = (int)(1.5*h) - wbl = (int)(1.5*w) - blendedImage = ImageGray(height=hbl, width=wbl, value=0) - - ImageTools.warpImage(image1, Matrix(c2Hc1), blendedImage, ImageTools.ImageInterpolationType.INTERPOLATION_LINEAR, False, True) - - plt3.imshow(blendedImage, cmap='gray') - - plt.waitforbuttonpress() - plt.show() - - # Final homography matrix H21 should be - # c2Hc1= - # [[-0.0040643 -0.0031677 -0.0435478] - # [ 0.0034882 -0.0051718 -0.9989996] - # [ 0.000002 -0.0000017 -0.0061552]] diff --git a/modules/python/examples/repro_tp3.py b/modules/python/examples/repro_tp3.py deleted file mode 100644 index d0b977f4b0..0000000000 --- a/modules/python/examples/repro_tp3.py +++ /dev/null @@ -1,209 +0,0 @@ -############################################################################# -# -# 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: -# ViSP Python bindings example -# -############################################################################# - -import argparse -import numpy as np - -from matplotlib import pyplot as plt -from matplotlib import image -from pathlib import Path - -from visp.core import ColVector, ImagePoint, Matrix, Point -from visp.core import ImageGray, ImageTools -from visp.vision import Homography -from visp.io import ImageIo - -if __name__ == '__main__': - parser = argparse.ArgumentParser(description='The script corresponding to TP 2.') - parser.add_argument('--data', type=str, required=True, help='Path to data') - args = parser.parse_args() - data_path = Path(args.data) - assert data_path.exists() - image1, image2 = ImageGray(), ImageGray() - ImageIo.read(image1, str(data_path / 'tp3-I1.jpg'), ImageIo.ImageIoBackendType.IO_DEFAULT_BACKEND) - ImageIo.read(image2, str(data_path / 'tp3-I2.jpg'), ImageIo.ImageIoBackendType.IO_DEFAULT_BACKEND) - # Pretty print of numpy arrays - np.set_printoptions(precision=7, suppress=True) - - plt.figure(figsize=(15,15)) - plt.ion() - - plt1 = plt.subplot(2, 2, 1) # Image 1 - plt2 = plt.subplot(2, 2, 2) # Image 2 - plt3 = plt.subplot(212) # Image 1 besides Image 2 - - plt1.imshow(image1, cmap='gray') - plt2.imshow(image2, cmap='gray') - - # Transparent use of a visp image in a numpy function! - imageAppariement = np.hstack((image1, image2)) - plt3.imshow(imageAppariement, interpolation='bilinear', cmap='gray') - - # Matrix of coordinates of the points in image - # (u1,v1) are in image1 and (u2,v2) in image2 - point = np.array( - [ # u1, v1, u2, v2 - [117.5130997, 62.34123611, 202.841095, 36.29648209], - [84.06044006, 67.55551147, 169.5350189, 26.80556679], - [80.27194214, 111.0672302, 147.9641113, 64.5475769], - [342.6855164, 199.8661346, 63.4621048, 68.28819275], - [302.6676636, 226.6687317, 300.4017639, 263.6835022], - [101.5870972, 63.0242424, 187.8421478, 29.56011963], - [153.4119415, 91.05652618, 222.968277, 77.2434845], - [190.6780548, 110.7231598, 247.8312683, 110.4263763], - [302.8087463, 133.9337616, 339.9194641, 178.880661], - [162.7279968, 276.4970398, 152.7050171, 248.9367065], - [151.0850067, 36.12360764, 244.672287, 25.44586563], - [171.7740173, 53.67162704, 256.0083618, 49.99362183], - [116.7895355, 74.19098663, 196.8202972, 45.97808456], - [104.2023163, 83.85998535, 181.4200439, 50.26084518], - [84.71365356, 190.8507233, 300.4017639, 263.6835022], - [138.8526764, 273.5761719, 131.6974182, 236.8515778], - [167.2081451, 96.59983063, 233.1238556, 88.96112061], - ] - ) - - # Plot corresponding points - # u1 = point[:,0] - # v1 = point[:,1] - # u2 = point[:,2] - # v2 = point[:,3] - # ViSP Image point format - ip1 = [ - ImagePoint(vv1, uu1) for vv1, uu1 in zip(point[:, 1], point[:, 0]) - ] - ip2 = [ - ImagePoint(vv2, uu2) for vv2, uu2 in zip(point[:, 3], point[:, 2]) - ] - u1s, v1s = np.asarray([p1.get_u() for p1 in ip1]), np.asarray([p1.get_v() for p1 in ip1]) - u2s, v2s = np.asarray([p2.get_u() for p2 in ip2]), np.asarray([p2.get_v() for p2 in ip2]) - - - print(f'Points in image 1: {ip1}') - print(f'Points in image 2: {ip2}') - - # Get image size - img_rows = image1.getHeight() - img_cols = image1.getWidth() - print("Image size:", img_cols, "x", img_rows) - - # Total number of points - nbPoints = len(ip1) - plt1.plot(u1s, v1s, 'r+') - plt2.plot(u2s, v2s, 'r+') - - # Plot lines between matches - for i, (p1, p2) in enumerate(zip(ip1, ip2)): - u1, v1 = p1.get_u(), p1.get_v() - u2, v2 = p2.get_u(), p2.get_v() - x = np.array([u1, u2 + img_cols]) - y = np.array([v1, v2]) - x = np.array([u1, u2 + img_cols]) - y = np.array([v1, v2]) - plt3.plot(x, y, linewidth=1) - - plt1.text(u1+3, v1-3, i, color='red') - plt2.text(u2+3, v2-3, i, color='red') - plt3.text(u1+3, v1-3, i, color='red') - plt3.text(u2+img_cols-3, v2-3, i, color='red') - - # Compute homography c2Hc1 such as x2 = c2Hc1 * x1 without RANSAC - c2Hc1 = Homography() - Homography.DLT(u1s, v1s, u2s, v2s, c2Hc1, False) - - print("c2Hc1= \n", c2Hc1) - - for i in range(nbPoints): - print('point',i) - x1 = ColVector(np.array([u1s[i], v1s[i], 1])) - x2 = c2Hc1 * x1 - x2 = x2/x2[2] - print(type(x2)) - print("x2 = ", x2) - error = (x2 - ColVector([u2s[i], v2s[i], 1])).frobeniusNorm() - print("error = ", error) - - plt2.plot(u2s[i], v2s[i],'+') - plt2.add_artist(plt.Circle((u2s[i], v2s[i]), error, fill=False, color='g')) - - print("Use a mouse click to continue..") - plt.waitforbuttonpress() - - # Erase image 2 and circle drawings - plt2.cla() - plt2.imshow(image2, cmap='gray') - - # Threshold to detect outliers - seuilOutlier = 10 - - indexInliers = np.zeros(nbPoints) - inliers = [False for _ in range(len(u1s))] - residual = 0.0 # TODO: this should be returned - succeeded, inliers, residual = Homography.ransac(u1s, v1s, u2s, v2s, c2Hc1, [], 0.0, 15, seuilOutlier, False) - # Ideally we have: - # succeeded, c2Hc1, inliers, residual = Homography.ransac(u1, v1, u2, v2, 12, seuilOutlier, False) - # Could automatically generate - # succeeded, c2Hc1, inliers, redisual = Homography.ransac(u1, v1, u2, v2, c2Hc1, inliers, residual, 12, seuilOutlier, False) - - print('Inliers = ', inliers) - print('Residual = ', residual) - # Compute the homography with all inliers - u1r = u1s[inliers] - v1r = v1s[inliers] - u2r = u2s[inliers] - v2r = v2s[inliers] - - print('Inliers = ', u1r, v1r, u2r, v2r) - - # Compute the error for all the points - for j in range(nbPoints): - # Compute the position of (u2',v2') function of (u1,v1) - x1 = np.array([u1s[j], v1s[j], 1]) - x2 = np.matmul(c2Hc1,x1) - x2 = x2/x2[2] - - # Compute the error between (u2',v2') and (u2,v2) - error = np.linalg.norm(np.array([u2s[j], v2s[j], 1]) - x2) - print("error[",j,"] = ", error) - - if error < seuilOutlier: - plt2.plot(x2[0], x2[1],'g+') - plt2.add_artist(plt.Circle((x2[0], x2[1]), error*10, fill=False, color='g')) - else: - plt2.plot(x2[0], x2[1],'r+') - plt2.add_artist(plt.Circle((x2[0], x2[1]), error, fill=False, color='r')) - - plt.waitforbuttonpress() - plt.show() From d4b8aef7b0db0f631b3a355a88890bca42c9cf80 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Fri, 1 Dec 2023 16:01:11 +0100 Subject: [PATCH 146/169] Rename python doc target to visp_python_bindings_doc, move html generation location to global doc folder --- modules/python/CMakeLists.txt | 2 +- modules/python/{docs => doc}/CMakeLists.txt | 14 +- modules/python/doc/_autosummary/visp.ar.rst | 23 +++ .../python/doc/_autosummary/visp.blob.Dot.rst | 94 ++++++++++ .../doc/_autosummary/visp.blob.Dot2.rst | 103 +++++++++++ modules/python/doc/_autosummary/visp.blob.rst | 33 ++++ .../_autosummary/visp.core.ArrayDouble2D.rst | 68 +++++++ .../doc/_autosummary/visp.core.BSpline.rst | 69 +++++++ .../visp.core.CameraParameters.rst | 84 +++++++++ .../visp.core.CannyEdgeDetection.rst | 56 ++++++ .../doc/_autosummary/visp.core.Chrono.rst | 53 ++++++ .../doc/_autosummary/visp.core.Circle.rst | 91 +++++++++ .../doc/_autosummary/visp.core.Client.rst | 76 ++++++++ .../doc/_autosummary/visp.core.ColVector.rst | 104 +++++++++++ .../doc/_autosummary/visp.core.Color.rst | 106 +++++++++++ .../visp.core.ColorDepthConversion.rst | 49 +++++ .../doc/_autosummary/visp.core.Colormap.rst | 76 ++++++++ .../doc/_autosummary/visp.core.Convert.rst | 50 +++++ .../doc/_autosummary/visp.core.Cylinder.rst | 93 ++++++++++ .../doc/_autosummary/visp.core.Display.rst | 101 ++++++++++ .../_autosummary/visp.core.ExponentialMap.rst | 50 +++++ .../_autosummary/visp.core.FeatureDisplay.rst | 52 ++++++ .../doc/_autosummary/visp.core.Font.rst | 59 ++++++ .../visp.core.ForceTwistMatrix.rst | 67 +++++++ .../visp.core.ForwardProjection.rst | 70 +++++++ .../_autosummary/visp.core.FrameGrabber.rst | 56 ++++++ .../doc/_autosummary/visp.core.GaussRand.rst | 50 +++++ .../_autosummary/visp.core.GaussianFilter.rst | 49 +++++ .../doc/_autosummary/visp.core.Hinkley.rst | 68 +++++++ .../doc/_autosummary/visp.core.Histogram.rst | 59 ++++++ .../_autosummary/visp.core.HistogramPeak.rst | 56 ++++++ .../_autosummary/visp.core.HistogramValey.rst | 56 ++++++ .../visp.core.HomogeneousMatrix.rst | 88 +++++++++ .../_autosummary/visp.core.ImageCircle.rst | 56 ++++++ .../_autosummary/visp.core.ImageConvert.rst | 80 ++++++++ .../_autosummary/visp.core.ImageDouble.rst | 76 ++++++++ .../doc/_autosummary/visp.core.ImageDraw.rst | 58 ++++++ .../_autosummary/visp.core.ImageFilter.rst | 75 ++++++++ .../doc/_autosummary/visp.core.ImageFloat.rst | 76 ++++++++ .../doc/_autosummary/visp.core.ImageGray.rst | 76 ++++++++ .../visp.core.ImageMorphology.rst | 55 ++++++ .../doc/_autosummary/visp.core.ImagePoint.rst | 69 +++++++ .../doc/_autosummary/visp.core.ImageRGBA.rst | 75 ++++++++ .../doc/_autosummary/visp.core.ImageRGBa.rst | 76 ++++++++ .../doc/_autosummary/visp.core.ImageRGBf.rst | 76 ++++++++ .../doc/_autosummary/visp.core.ImageTools.rst | 72 +++++++ .../_autosummary/visp.core.ImageUInt16.rst | 76 ++++++++ .../doc/_autosummary/visp.core.IoTools.rst | 91 +++++++++ .../_autosummary/visp.core.KalmanFilter.rst | 71 +++++++ .../doc/_autosummary/visp.core.LinProg.rst | 56 ++++++ .../doc/_autosummary/visp.core.Line.rst | 82 ++++++++ ...p.core.LinearKalmanFilterInstantiation.rst | 91 +++++++++ .../doc/_autosummary/visp.core.Math.rst | 77 ++++++++ .../doc/_autosummary/visp.core.Matrix.rst | 157 ++++++++++++++++ .../visp.core.MeterPixelConversion.rst | 52 ++++++ .../doc/_autosummary/visp.core.Moment.rst | 54 ++++++ .../_autosummary/visp.core.MomentAlpha.rst | 58 ++++++ .../doc/_autosummary/visp.core.MomentArea.rst | 56 ++++++ .../visp.core.MomentAreaNormalized.rst | 60 ++++++ .../_autosummary/visp.core.MomentBasic.rst | 56 ++++++ .../visp.core.MomentCInvariant.rst | 82 ++++++++ .../_autosummary/visp.core.MomentCentered.rst | 57 ++++++ .../_autosummary/visp.core.MomentCommon.rst | 54 ++++++ .../_autosummary/visp.core.MomentDatabase.rst | 52 ++++++ .../visp.core.MomentGravityCenter.rst | 58 ++++++ ...isp.core.MomentGravityCenterNormalized.rst | 58 ++++++ .../_autosummary/visp.core.MomentObject.rst | 69 +++++++ .../_autosummary/visp.core.MouseButton.rst | 57 ++++++ .../doc/_autosummary/visp.core.Munkres.rst | 48 +++++ .../doc/_autosummary/visp.core.Mutex.rst | 50 +++++ .../doc/_autosummary/visp.core.Network.rst | 69 +++++++ .../visp.core.PixelMeterConversion.rst | 53 ++++++ .../doc/_autosummary/visp.core.Plane.rst | 74 ++++++++ .../doc/_autosummary/visp.core.Point.rst | 102 ++++++++++ .../doc/_autosummary/visp.core.Polygon.rst | 65 +++++++ .../doc/_autosummary/visp.core.Polygon3D.rst | 89 +++++++++ .../doc/_autosummary/visp.core.PoseVector.rst | 78 ++++++++ .../doc/_autosummary/visp.core.QuadProg.rst | 55 ++++++ .../visp.core.QuaternionVector.rst | 84 +++++++++ .../doc/_autosummary/visp.core.RGBa.rst | 67 +++++++ .../doc/_autosummary/visp.core.RGBf.rst | 65 +++++++ .../doc/_autosummary/visp.core.Rect.rst | 78 ++++++++ .../_autosummary/visp.core.RectOriented.rst | 61 ++++++ .../doc/_autosummary/visp.core.Request.rst | 53 ++++++ .../doc/_autosummary/visp.core.Robust.rst | 60 ++++++ .../_autosummary/visp.core.RotationMatrix.rst | 75 ++++++++ .../_autosummary/visp.core.RotationVector.rst | 66 +++++++ .../doc/_autosummary/visp.core.RowVector.rst | 97 ++++++++++ .../doc/_autosummary/visp.core.RxyzVector.rst | 66 +++++++ .../doc/_autosummary/visp.core.RzyxVector.rst | 66 +++++++ .../doc/_autosummary/visp.core.RzyzVector.rst | 66 +++++++ .../doc/_autosummary/visp.core.Scale.rst | 53 ++++++ .../doc/_autosummary/visp.core.Serial.rst | 82 ++++++++ .../doc/_autosummary/visp.core.Server.rst | 75 ++++++++ .../doc/_autosummary/visp.core.Sphere.rst | 87 +++++++++ .../_autosummary/visp.core.SubColVector.rst | 92 +++++++++ .../doc/_autosummary/visp.core.SubMatrix.rst | 150 +++++++++++++++ .../_autosummary/visp.core.SubRowVector.rst | 85 +++++++++ .../_autosummary/visp.core.ThetaUVector.rst | 70 +++++++ .../doc/_autosummary/visp.core.Thread.rst | 52 ++++++ .../doc/_autosummary/visp.core.Tracker.rst | 58 ++++++ .../visp.core.TranslationVector.rst | 79 ++++++++ .../doc/_autosummary/visp.core.Triangle.rst | 52 ++++++ .../doc/_autosummary/visp.core.UDPClient.rst | 51 +++++ .../doc/_autosummary/visp.core.UDPServer.rst | 50 +++++ .../doc/_autosummary/visp.core.UniRand.rst | 51 +++++ .../visp.core.VelocityTwistMatrix.rst | 69 +++++++ .../doc/_autosummary/visp.core.XmlParser.rst | 53 ++++++ .../visp.core.XmlParserCamera.rst | 68 +++++++ .../visp.core.XmlParserHomogeneousMatrix.rst | 60 ++++++ .../visp.core.XmlParserRectOriented.rst | 59 ++++++ modules/python/doc/_autosummary/visp.core.rst | 167 +++++++++++++++++ .../visp.detection.DetectorAprilTag.rst | 92 +++++++++ .../visp.detection.DetectorBase.rst | 54 ++++++ .../visp.detection.DetectorDNNOpenCV.rst | 83 +++++++++ .../visp.detection.DetectorFace.rst | 56 ++++++ .../visp.detection.DetectorQRCode.rst | 55 ++++++ .../doc/_autosummary/visp.detection.rst | 36 ++++ .../visp.dnn_tracker.MegaPose.rst | 72 +++++++ .../visp.dnn_tracker.MegaPoseEstimate.rst | 56 ++++++ .../visp.dnn_tracker.MegaPoseTracker.rst | 51 +++++ .../doc/_autosummary/visp.dnn_tracker.rst | 34 ++++ .../visp.gui.ColorBlindFriendlyPalette.rst | 70 +++++++ .../_autosummary/visp.gui.DisplayOpenCV.rst | 118 ++++++++++++ .../doc/_autosummary/visp.gui.DisplayX.rst | 119 ++++++++++++ .../python/doc/_autosummary/visp.gui.Plot.rst | 72 +++++++ .../visp.gui.ProjectionDisplay.rst | 55 ++++++ modules/python/doc/_autosummary/visp.gui.rst | 36 ++++ .../visp.imgproc.AutoThresholdMethod.rst | 82 ++++++++ .../visp.imgproc.CircleHoughTransform.rst | 81 ++++++++ .../visp.imgproc.ContourRetrievalType.rst | 79 ++++++++ .../_autosummary/visp.imgproc.ContourType.rst | 78 ++++++++ .../visp.imgproc.DirectionType.rst | 85 +++++++++ .../visp.imgproc.RETINEX_LEVEL.rst | 79 ++++++++ .../python/doc/_autosummary/visp.imgproc.rst | 58 ++++++ .../doc/_autosummary/visp.io.DiskGrabber.rst | 69 +++++++ .../doc/_autosummary/visp.io.ImageIo.rst | 74 ++++++++ .../doc/_autosummary/visp.io.Keyboard.rst | 50 +++++ .../doc/_autosummary/visp.io.ParallelPort.rst | 50 +++++ .../doc/_autosummary/visp.io.VideoReader.rst | 74 ++++++++ .../doc/_autosummary/visp.io.VideoWriter.rst | 59 ++++++ modules/python/doc/_autosummary/visp.io.rst | 37 ++++ .../doc/_autosummary/visp.klt.KltOpencv.rst | 78 ++++++++ modules/python/doc/_autosummary/visp.klt.rst | 32 ++++ .../visp.mbt.MbDepthDenseTracker.rst | 127 +++++++++++++ .../visp.mbt.MbDepthNormalTracker.rst | 129 +++++++++++++ .../visp.mbt.MbEdgeKltTracker.rst | 151 +++++++++++++++ .../_autosummary/visp.mbt.MbEdgeTracker.rst | 130 +++++++++++++ .../visp.mbt.MbGenericTracker.rst | 175 ++++++++++++++++++ .../_autosummary/visp.mbt.MbKltTracker.rst | 140 ++++++++++++++ .../doc/_autosummary/visp.mbt.MbTracker.rst | 108 +++++++++++ .../visp.mbt.MbtDistanceCircle.rst | 81 ++++++++ .../visp.mbt.MbtDistanceCylinder.rst | 85 +++++++++ .../visp.mbt.MbtDistanceKltCylinder.rst | 75 ++++++++ .../visp.mbt.MbtDistanceKltPoints.rst | 72 +++++++ .../_autosummary/visp.mbt.MbtDistanceLine.rst | 88 +++++++++ .../visp.mbt.MbtFaceDepthDense.rst | 79 ++++++++ .../visp.mbt.MbtFaceDepthNormal.rst | 81 ++++++++ .../doc/_autosummary/visp.mbt.MbtPolygon.rst | 124 +++++++++++++ .../visp.mbt.MbtXmlGenericParser.rst | 114 ++++++++++++ modules/python/doc/_autosummary/visp.mbt.rst | 47 +++++ .../python/doc/_autosummary/visp.me.Me.rst | 86 +++++++++ .../doc/_autosummary/visp.me.MeEllipse.rst | 90 +++++++++ .../doc/_autosummary/visp.me.MeLine.rst | 94 ++++++++++ .../doc/_autosummary/visp.me.MeNurbs.rst | 89 +++++++++ .../doc/_autosummary/visp.me.MeSite.rst | 90 +++++++++ .../doc/_autosummary/visp.me.MeTracker.rst | 76 ++++++++ .../python/doc/_autosummary/visp.me.Nurbs.rst | 84 +++++++++ modules/python/doc/_autosummary/visp.me.rst | 38 ++++ .../doc/_autosummary/visp.robot.Afma4.rst | 67 +++++++ .../doc/_autosummary/visp.robot.Afma6.rst | 86 +++++++++ .../doc/_autosummary/visp.robot.Biclops.rst | 72 +++++++ .../visp.robot.ImageSimulator.rst | 66 +++++++ .../doc/_autosummary/visp.robot.Pioneer.rst | 53 ++++++ .../_autosummary/visp.robot.PioneerPan.rst | 53 ++++++ .../doc/_autosummary/visp.robot.Pololu.rst | 67 +++++++ .../doc/_autosummary/visp.robot.Ptu46.rst | 63 +++++++ .../doc/_autosummary/visp.robot.QbDevice.rst | 51 +++++ .../_autosummary/visp.robot.QbSoftHand.rst | 54 ++++++ .../visp.robot.ReflexTakktile2.rst | 67 +++++++ .../doc/_autosummary/visp.robot.RingLight.rst | 51 +++++ .../doc/_autosummary/visp.robot.Robot.rst | 75 ++++++++ .../visp.robot.RobotPololuPtu.rst | 97 ++++++++++ .../visp.robot.RobotSimulator.rst | 91 +++++++++ .../_autosummary/visp.robot.RobotTemplate.rst | 96 ++++++++++ .../visp.robot.RobotWireFrameSimulator.rst | 110 +++++++++++ .../doc/_autosummary/visp.robot.Servolens.rst | 74 ++++++++ .../visp.robot.SimulatorAfma6.rst | 175 ++++++++++++++++++ .../visp.robot.SimulatorCamera.rst | 95 ++++++++++ .../visp.robot.SimulatorPioneer.rst | 97 ++++++++++ .../visp.robot.SimulatorPioneerPan.rst | 97 ++++++++++ .../visp.robot.SimulatorViper850.rst | 175 ++++++++++++++++++ .../doc/_autosummary/visp.robot.Unicycle.rst | 53 ++++++ .../doc/_autosummary/visp.robot.Viper.rst | 73 ++++++++ .../doc/_autosummary/visp.robot.Viper650.rst | 88 +++++++++ .../doc/_autosummary/visp.robot.Viper850.rst | 88 +++++++++ .../visp.robot.WireFrameSimulator.rst | 103 +++++++++++ .../python/doc/_autosummary/visp.robot.rst | 59 ++++++ .../visp.sensor.ForceTorqueAtiNetFTSensor.rst | 64 +++++++ .../_autosummary/visp.sensor.LaserScan.rst | 60 ++++++ .../_autosummary/visp.sensor.LaserScanner.rst | 50 +++++ .../doc/_autosummary/visp.sensor.Mocap.rst | 50 +++++ .../_autosummary/visp.sensor.RealSense2.rst | 62 +++++++ .../_autosummary/visp.sensor.ScanPoint.rst | 56 ++++++ .../_autosummary/visp.sensor.SickLDMRS.rst | 58 ++++++ .../_autosummary/visp.sensor.V4l2Grabber.rst | 90 +++++++++ .../python/doc/_autosummary/visp.sensor.rst | 40 ++++ .../_autosummary/visp.tt.TemplateTracker.rst | 78 ++++++++ .../visp.tt.TemplateTrackerDPoint.rst | 55 ++++++ .../visp.tt.TemplateTrackerPoint.rst | 58 ++++++ .../visp.tt.TemplateTrackerPointCompo.rst | 48 +++++ .../visp.tt.TemplateTrackerSSD.rst | 79 ++++++++ .../visp.tt.TemplateTrackerSSDESM.rst | 79 ++++++++ ...tt.TemplateTrackerSSDForwardAdditional.rst | 89 +++++++++ ...TemplateTrackerSSDForwardCompositional.rst | 79 ++++++++ ...TemplateTrackerSSDInverseCompositional.rst | 80 ++++++++ .../visp.tt.TemplateTrackerTriangle.rst | 59 ++++++ .../visp.tt.TemplateTrackerWarp.rst | 53 ++++++ .../visp.tt.TemplateTrackerWarpAffine.rst | 61 ++++++ .../visp.tt.TemplateTrackerWarpHomography.rst | 64 +++++++ ...sp.tt.TemplateTrackerWarpHomographySL3.rst | 63 +++++++ .../visp.tt.TemplateTrackerWarpRT.rst | 61 ++++++ .../visp.tt.TemplateTrackerWarpSRT.rst | 61 ++++++ ...visp.tt.TemplateTrackerWarpTranslation.rst | 61 ++++++ .../visp.tt.TemplateTrackerZNCC.rst | 78 ++++++++ ...t.TemplateTrackerZNCCForwardAdditional.rst | 78 ++++++++ ...emplateTrackerZNCCInverseCompositional.rst | 78 ++++++++ .../visp.tt.TemplateTrackerZPoint.rst | 55 ++++++ .../visp.tt.TemplateTrackerZone.rst | 66 +++++++ modules/python/doc/_autosummary/visp.tt.rst | 53 ++++++ .../visp.tt_mi.TemplateTrackerMI.rst | 103 +++++++++++ .../visp.tt_mi.TemplateTrackerMIESM.rst | 122 ++++++++++++ ..._mi.TemplateTrackerMIForwardAdditional.rst | 122 ++++++++++++ ....TemplateTrackerMIForwardCompositional.rst | 117 ++++++++++++ ....TemplateTrackerMIInverseCompositional.rst | 124 +++++++++++++ .../python/doc/_autosummary/visp.tt_mi.rst | 36 ++++ .../visp.vision.BasicKeyPoint.rst | 57 ++++++ .../_autosummary/visp.vision.Calibration.rst | 84 +++++++++ .../visp.vision.HandEyeCalibration.rst | 49 +++++ .../_autosummary/visp.vision.Homography.rst | 81 ++++++++ .../doc/_autosummary/visp.vision.KeyPoint.rst | 161 ++++++++++++++++ .../visp.vision.PlaneEstimation.rst | 49 +++++ .../doc/_autosummary/visp.vision.Pose.rst | 105 +++++++++++ .../visp.vision.XmlConfigParserKeyPoint.rst | 72 +++++++ .../python/doc/_autosummary/visp.vision.rst | 46 +++++ .../visp.visual_features.BasicFeature.rst | 64 +++++++ .../visp.visual_features.FeatureBuilder.rst | 49 +++++ .../visp.visual_features.FeatureDepth.rst | 83 +++++++++ .../visp.visual_features.FeatureEllipse.rst | 89 +++++++++ .../visp.visual_features.FeatureLine.rst | 80 ++++++++ .../visp.visual_features.FeatureLuminance.rst | 78 ++++++++ .../visp.visual_features.FeatureMoment.rst | 78 ++++++++ ...isp.visual_features.FeatureMomentAlpha.rst | 79 ++++++++ ...visp.visual_features.FeatureMomentArea.rst | 79 ++++++++ ...l_features.FeatureMomentAreaNormalized.rst | 79 ++++++++ ...isp.visual_features.FeatureMomentBasic.rst | 79 ++++++++ ...isual_features.FeatureMomentCInvariant.rst | 95 ++++++++++ ....visual_features.FeatureMomentCentered.rst | 80 ++++++++ ...sp.visual_features.FeatureMomentCommon.rst | 58 ++++++ ....visual_features.FeatureMomentDatabase.rst | 50 +++++ ...al_features.FeatureMomentGravityCenter.rst | 81 ++++++++ ...s.FeatureMomentGravityCenterNormalized.rst | 81 ++++++++ .../visp.visual_features.FeaturePoint.rst | 85 +++++++++ .../visp.visual_features.FeaturePoint3D.rst | 84 +++++++++ ...visp.visual_features.FeaturePointPolar.rst | 83 +++++++++ .../visp.visual_features.FeatureSegment.rst | 92 +++++++++ .../visp.visual_features.FeatureThetaU.rst | 90 +++++++++ ...isp.visual_features.FeatureTranslation.rst | 88 +++++++++ ....visual_features.FeatureVanishingPoint.rst | 90 +++++++++ .../visp.visual_features.GenericFeature.rst | 77 ++++++++ ...p.visual_features.MomentGenericFeature.rst | 79 ++++++++ .../doc/_autosummary/visp.visual_features.rst | 57 ++++++ .../doc/_autosummary/visp.vs.AdaptiveGain.rst | 66 +++++++ .../python/doc/_autosummary/visp.vs.Servo.rst | 131 +++++++++++++ .../doc/_autosummary/visp.vs.ServoData.rst | 53 ++++++ .../doc/_autosummary/visp.vs.ServoDisplay.rst | 49 +++++ modules/python/doc/_autosummary/visp.vs.rst | 35 ++++ .../_templates/custom-class-template.rst | 0 .../_templates/custom-module-template.rst | 0 modules/python/doc/api.rst | 28 +++ modules/python/{docs => doc}/api.rst.in | 0 modules/python/{docs => doc}/conf.py.in | 0 modules/python/{docs => doc}/index.rst | 0 modules/python/{docs => doc}/requirements.txt | 0 modules/python/{docs => doc}/todos.rst | 0 285 files changed, 20548 insertions(+), 7 deletions(-) rename modules/python/{docs => doc}/CMakeLists.txt (87%) create mode 100644 modules/python/doc/_autosummary/visp.ar.rst create mode 100644 modules/python/doc/_autosummary/visp.blob.Dot.rst create mode 100644 modules/python/doc/_autosummary/visp.blob.Dot2.rst create mode 100644 modules/python/doc/_autosummary/visp.blob.rst create mode 100644 modules/python/doc/_autosummary/visp.core.ArrayDouble2D.rst create mode 100644 modules/python/doc/_autosummary/visp.core.BSpline.rst create mode 100644 modules/python/doc/_autosummary/visp.core.CameraParameters.rst create mode 100644 modules/python/doc/_autosummary/visp.core.CannyEdgeDetection.rst create mode 100644 modules/python/doc/_autosummary/visp.core.Chrono.rst create mode 100644 modules/python/doc/_autosummary/visp.core.Circle.rst create mode 100644 modules/python/doc/_autosummary/visp.core.Client.rst create mode 100644 modules/python/doc/_autosummary/visp.core.ColVector.rst create mode 100644 modules/python/doc/_autosummary/visp.core.Color.rst create mode 100644 modules/python/doc/_autosummary/visp.core.ColorDepthConversion.rst create mode 100644 modules/python/doc/_autosummary/visp.core.Colormap.rst create mode 100644 modules/python/doc/_autosummary/visp.core.Convert.rst create mode 100644 modules/python/doc/_autosummary/visp.core.Cylinder.rst create mode 100644 modules/python/doc/_autosummary/visp.core.Display.rst create mode 100644 modules/python/doc/_autosummary/visp.core.ExponentialMap.rst create mode 100644 modules/python/doc/_autosummary/visp.core.FeatureDisplay.rst create mode 100644 modules/python/doc/_autosummary/visp.core.Font.rst create mode 100644 modules/python/doc/_autosummary/visp.core.ForceTwistMatrix.rst create mode 100644 modules/python/doc/_autosummary/visp.core.ForwardProjection.rst create mode 100644 modules/python/doc/_autosummary/visp.core.FrameGrabber.rst create mode 100644 modules/python/doc/_autosummary/visp.core.GaussRand.rst create mode 100644 modules/python/doc/_autosummary/visp.core.GaussianFilter.rst create mode 100644 modules/python/doc/_autosummary/visp.core.Hinkley.rst create mode 100644 modules/python/doc/_autosummary/visp.core.Histogram.rst create mode 100644 modules/python/doc/_autosummary/visp.core.HistogramPeak.rst create mode 100644 modules/python/doc/_autosummary/visp.core.HistogramValey.rst create mode 100644 modules/python/doc/_autosummary/visp.core.HomogeneousMatrix.rst create mode 100644 modules/python/doc/_autosummary/visp.core.ImageCircle.rst create mode 100644 modules/python/doc/_autosummary/visp.core.ImageConvert.rst create mode 100644 modules/python/doc/_autosummary/visp.core.ImageDouble.rst create mode 100644 modules/python/doc/_autosummary/visp.core.ImageDraw.rst create mode 100644 modules/python/doc/_autosummary/visp.core.ImageFilter.rst create mode 100644 modules/python/doc/_autosummary/visp.core.ImageFloat.rst create mode 100644 modules/python/doc/_autosummary/visp.core.ImageGray.rst create mode 100644 modules/python/doc/_autosummary/visp.core.ImageMorphology.rst create mode 100644 modules/python/doc/_autosummary/visp.core.ImagePoint.rst create mode 100644 modules/python/doc/_autosummary/visp.core.ImageRGBA.rst create mode 100644 modules/python/doc/_autosummary/visp.core.ImageRGBa.rst create mode 100644 modules/python/doc/_autosummary/visp.core.ImageRGBf.rst create mode 100644 modules/python/doc/_autosummary/visp.core.ImageTools.rst create mode 100644 modules/python/doc/_autosummary/visp.core.ImageUInt16.rst create mode 100644 modules/python/doc/_autosummary/visp.core.IoTools.rst create mode 100644 modules/python/doc/_autosummary/visp.core.KalmanFilter.rst create mode 100644 modules/python/doc/_autosummary/visp.core.LinProg.rst create mode 100644 modules/python/doc/_autosummary/visp.core.Line.rst create mode 100644 modules/python/doc/_autosummary/visp.core.LinearKalmanFilterInstantiation.rst create mode 100644 modules/python/doc/_autosummary/visp.core.Math.rst create mode 100644 modules/python/doc/_autosummary/visp.core.Matrix.rst create mode 100644 modules/python/doc/_autosummary/visp.core.MeterPixelConversion.rst create mode 100644 modules/python/doc/_autosummary/visp.core.Moment.rst create mode 100644 modules/python/doc/_autosummary/visp.core.MomentAlpha.rst create mode 100644 modules/python/doc/_autosummary/visp.core.MomentArea.rst create mode 100644 modules/python/doc/_autosummary/visp.core.MomentAreaNormalized.rst create mode 100644 modules/python/doc/_autosummary/visp.core.MomentBasic.rst create mode 100644 modules/python/doc/_autosummary/visp.core.MomentCInvariant.rst create mode 100644 modules/python/doc/_autosummary/visp.core.MomentCentered.rst create mode 100644 modules/python/doc/_autosummary/visp.core.MomentCommon.rst create mode 100644 modules/python/doc/_autosummary/visp.core.MomentDatabase.rst create mode 100644 modules/python/doc/_autosummary/visp.core.MomentGravityCenter.rst create mode 100644 modules/python/doc/_autosummary/visp.core.MomentGravityCenterNormalized.rst create mode 100644 modules/python/doc/_autosummary/visp.core.MomentObject.rst create mode 100644 modules/python/doc/_autosummary/visp.core.MouseButton.rst create mode 100644 modules/python/doc/_autosummary/visp.core.Munkres.rst create mode 100644 modules/python/doc/_autosummary/visp.core.Mutex.rst create mode 100644 modules/python/doc/_autosummary/visp.core.Network.rst create mode 100644 modules/python/doc/_autosummary/visp.core.PixelMeterConversion.rst create mode 100644 modules/python/doc/_autosummary/visp.core.Plane.rst create mode 100644 modules/python/doc/_autosummary/visp.core.Point.rst create mode 100644 modules/python/doc/_autosummary/visp.core.Polygon.rst create mode 100644 modules/python/doc/_autosummary/visp.core.Polygon3D.rst create mode 100644 modules/python/doc/_autosummary/visp.core.PoseVector.rst create mode 100644 modules/python/doc/_autosummary/visp.core.QuadProg.rst create mode 100644 modules/python/doc/_autosummary/visp.core.QuaternionVector.rst create mode 100644 modules/python/doc/_autosummary/visp.core.RGBa.rst create mode 100644 modules/python/doc/_autosummary/visp.core.RGBf.rst create mode 100644 modules/python/doc/_autosummary/visp.core.Rect.rst create mode 100644 modules/python/doc/_autosummary/visp.core.RectOriented.rst create mode 100644 modules/python/doc/_autosummary/visp.core.Request.rst create mode 100644 modules/python/doc/_autosummary/visp.core.Robust.rst create mode 100644 modules/python/doc/_autosummary/visp.core.RotationMatrix.rst create mode 100644 modules/python/doc/_autosummary/visp.core.RotationVector.rst create mode 100644 modules/python/doc/_autosummary/visp.core.RowVector.rst create mode 100644 modules/python/doc/_autosummary/visp.core.RxyzVector.rst create mode 100644 modules/python/doc/_autosummary/visp.core.RzyxVector.rst create mode 100644 modules/python/doc/_autosummary/visp.core.RzyzVector.rst create mode 100644 modules/python/doc/_autosummary/visp.core.Scale.rst create mode 100644 modules/python/doc/_autosummary/visp.core.Serial.rst create mode 100644 modules/python/doc/_autosummary/visp.core.Server.rst create mode 100644 modules/python/doc/_autosummary/visp.core.Sphere.rst create mode 100644 modules/python/doc/_autosummary/visp.core.SubColVector.rst create mode 100644 modules/python/doc/_autosummary/visp.core.SubMatrix.rst create mode 100644 modules/python/doc/_autosummary/visp.core.SubRowVector.rst create mode 100644 modules/python/doc/_autosummary/visp.core.ThetaUVector.rst create mode 100644 modules/python/doc/_autosummary/visp.core.Thread.rst create mode 100644 modules/python/doc/_autosummary/visp.core.Tracker.rst create mode 100644 modules/python/doc/_autosummary/visp.core.TranslationVector.rst create mode 100644 modules/python/doc/_autosummary/visp.core.Triangle.rst create mode 100644 modules/python/doc/_autosummary/visp.core.UDPClient.rst create mode 100644 modules/python/doc/_autosummary/visp.core.UDPServer.rst create mode 100644 modules/python/doc/_autosummary/visp.core.UniRand.rst create mode 100644 modules/python/doc/_autosummary/visp.core.VelocityTwistMatrix.rst create mode 100644 modules/python/doc/_autosummary/visp.core.XmlParser.rst create mode 100644 modules/python/doc/_autosummary/visp.core.XmlParserCamera.rst create mode 100644 modules/python/doc/_autosummary/visp.core.XmlParserHomogeneousMatrix.rst create mode 100644 modules/python/doc/_autosummary/visp.core.XmlParserRectOriented.rst create mode 100644 modules/python/doc/_autosummary/visp.core.rst create mode 100644 modules/python/doc/_autosummary/visp.detection.DetectorAprilTag.rst create mode 100644 modules/python/doc/_autosummary/visp.detection.DetectorBase.rst create mode 100644 modules/python/doc/_autosummary/visp.detection.DetectorDNNOpenCV.rst create mode 100644 modules/python/doc/_autosummary/visp.detection.DetectorFace.rst create mode 100644 modules/python/doc/_autosummary/visp.detection.DetectorQRCode.rst create mode 100644 modules/python/doc/_autosummary/visp.detection.rst create mode 100644 modules/python/doc/_autosummary/visp.dnn_tracker.MegaPose.rst create mode 100644 modules/python/doc/_autosummary/visp.dnn_tracker.MegaPoseEstimate.rst create mode 100644 modules/python/doc/_autosummary/visp.dnn_tracker.MegaPoseTracker.rst create mode 100644 modules/python/doc/_autosummary/visp.dnn_tracker.rst create mode 100644 modules/python/doc/_autosummary/visp.gui.ColorBlindFriendlyPalette.rst create mode 100644 modules/python/doc/_autosummary/visp.gui.DisplayOpenCV.rst create mode 100644 modules/python/doc/_autosummary/visp.gui.DisplayX.rst create mode 100644 modules/python/doc/_autosummary/visp.gui.Plot.rst create mode 100644 modules/python/doc/_autosummary/visp.gui.ProjectionDisplay.rst create mode 100644 modules/python/doc/_autosummary/visp.gui.rst create mode 100644 modules/python/doc/_autosummary/visp.imgproc.AutoThresholdMethod.rst create mode 100644 modules/python/doc/_autosummary/visp.imgproc.CircleHoughTransform.rst create mode 100644 modules/python/doc/_autosummary/visp.imgproc.ContourRetrievalType.rst create mode 100644 modules/python/doc/_autosummary/visp.imgproc.ContourType.rst create mode 100644 modules/python/doc/_autosummary/visp.imgproc.DirectionType.rst create mode 100644 modules/python/doc/_autosummary/visp.imgproc.RETINEX_LEVEL.rst create mode 100644 modules/python/doc/_autosummary/visp.imgproc.rst create mode 100644 modules/python/doc/_autosummary/visp.io.DiskGrabber.rst create mode 100644 modules/python/doc/_autosummary/visp.io.ImageIo.rst create mode 100644 modules/python/doc/_autosummary/visp.io.Keyboard.rst create mode 100644 modules/python/doc/_autosummary/visp.io.ParallelPort.rst create mode 100644 modules/python/doc/_autosummary/visp.io.VideoReader.rst create mode 100644 modules/python/doc/_autosummary/visp.io.VideoWriter.rst create mode 100644 modules/python/doc/_autosummary/visp.io.rst create mode 100644 modules/python/doc/_autosummary/visp.klt.KltOpencv.rst create mode 100644 modules/python/doc/_autosummary/visp.klt.rst create mode 100644 modules/python/doc/_autosummary/visp.mbt.MbDepthDenseTracker.rst create mode 100644 modules/python/doc/_autosummary/visp.mbt.MbDepthNormalTracker.rst create mode 100644 modules/python/doc/_autosummary/visp.mbt.MbEdgeKltTracker.rst create mode 100644 modules/python/doc/_autosummary/visp.mbt.MbEdgeTracker.rst create mode 100644 modules/python/doc/_autosummary/visp.mbt.MbGenericTracker.rst create mode 100644 modules/python/doc/_autosummary/visp.mbt.MbKltTracker.rst create mode 100644 modules/python/doc/_autosummary/visp.mbt.MbTracker.rst create mode 100644 modules/python/doc/_autosummary/visp.mbt.MbtDistanceCircle.rst create mode 100644 modules/python/doc/_autosummary/visp.mbt.MbtDistanceCylinder.rst create mode 100644 modules/python/doc/_autosummary/visp.mbt.MbtDistanceKltCylinder.rst create mode 100644 modules/python/doc/_autosummary/visp.mbt.MbtDistanceKltPoints.rst create mode 100644 modules/python/doc/_autosummary/visp.mbt.MbtDistanceLine.rst create mode 100644 modules/python/doc/_autosummary/visp.mbt.MbtFaceDepthDense.rst create mode 100644 modules/python/doc/_autosummary/visp.mbt.MbtFaceDepthNormal.rst create mode 100644 modules/python/doc/_autosummary/visp.mbt.MbtPolygon.rst create mode 100644 modules/python/doc/_autosummary/visp.mbt.MbtXmlGenericParser.rst create mode 100644 modules/python/doc/_autosummary/visp.mbt.rst create mode 100644 modules/python/doc/_autosummary/visp.me.Me.rst create mode 100644 modules/python/doc/_autosummary/visp.me.MeEllipse.rst create mode 100644 modules/python/doc/_autosummary/visp.me.MeLine.rst create mode 100644 modules/python/doc/_autosummary/visp.me.MeNurbs.rst create mode 100644 modules/python/doc/_autosummary/visp.me.MeSite.rst create mode 100644 modules/python/doc/_autosummary/visp.me.MeTracker.rst create mode 100644 modules/python/doc/_autosummary/visp.me.Nurbs.rst create mode 100644 modules/python/doc/_autosummary/visp.me.rst create mode 100644 modules/python/doc/_autosummary/visp.robot.Afma4.rst create mode 100644 modules/python/doc/_autosummary/visp.robot.Afma6.rst create mode 100644 modules/python/doc/_autosummary/visp.robot.Biclops.rst create mode 100644 modules/python/doc/_autosummary/visp.robot.ImageSimulator.rst create mode 100644 modules/python/doc/_autosummary/visp.robot.Pioneer.rst create mode 100644 modules/python/doc/_autosummary/visp.robot.PioneerPan.rst create mode 100644 modules/python/doc/_autosummary/visp.robot.Pololu.rst create mode 100644 modules/python/doc/_autosummary/visp.robot.Ptu46.rst create mode 100644 modules/python/doc/_autosummary/visp.robot.QbDevice.rst create mode 100644 modules/python/doc/_autosummary/visp.robot.QbSoftHand.rst create mode 100644 modules/python/doc/_autosummary/visp.robot.ReflexTakktile2.rst create mode 100644 modules/python/doc/_autosummary/visp.robot.RingLight.rst create mode 100644 modules/python/doc/_autosummary/visp.robot.Robot.rst create mode 100644 modules/python/doc/_autosummary/visp.robot.RobotPololuPtu.rst create mode 100644 modules/python/doc/_autosummary/visp.robot.RobotSimulator.rst create mode 100644 modules/python/doc/_autosummary/visp.robot.RobotTemplate.rst create mode 100644 modules/python/doc/_autosummary/visp.robot.RobotWireFrameSimulator.rst create mode 100644 modules/python/doc/_autosummary/visp.robot.Servolens.rst create mode 100644 modules/python/doc/_autosummary/visp.robot.SimulatorAfma6.rst create mode 100644 modules/python/doc/_autosummary/visp.robot.SimulatorCamera.rst create mode 100644 modules/python/doc/_autosummary/visp.robot.SimulatorPioneer.rst create mode 100644 modules/python/doc/_autosummary/visp.robot.SimulatorPioneerPan.rst create mode 100644 modules/python/doc/_autosummary/visp.robot.SimulatorViper850.rst create mode 100644 modules/python/doc/_autosummary/visp.robot.Unicycle.rst create mode 100644 modules/python/doc/_autosummary/visp.robot.Viper.rst create mode 100644 modules/python/doc/_autosummary/visp.robot.Viper650.rst create mode 100644 modules/python/doc/_autosummary/visp.robot.Viper850.rst create mode 100644 modules/python/doc/_autosummary/visp.robot.WireFrameSimulator.rst create mode 100644 modules/python/doc/_autosummary/visp.robot.rst create mode 100644 modules/python/doc/_autosummary/visp.sensor.ForceTorqueAtiNetFTSensor.rst create mode 100644 modules/python/doc/_autosummary/visp.sensor.LaserScan.rst create mode 100644 modules/python/doc/_autosummary/visp.sensor.LaserScanner.rst create mode 100644 modules/python/doc/_autosummary/visp.sensor.Mocap.rst create mode 100644 modules/python/doc/_autosummary/visp.sensor.RealSense2.rst create mode 100644 modules/python/doc/_autosummary/visp.sensor.ScanPoint.rst create mode 100644 modules/python/doc/_autosummary/visp.sensor.SickLDMRS.rst create mode 100644 modules/python/doc/_autosummary/visp.sensor.V4l2Grabber.rst create mode 100644 modules/python/doc/_autosummary/visp.sensor.rst create mode 100644 modules/python/doc/_autosummary/visp.tt.TemplateTracker.rst create mode 100644 modules/python/doc/_autosummary/visp.tt.TemplateTrackerDPoint.rst create mode 100644 modules/python/doc/_autosummary/visp.tt.TemplateTrackerPoint.rst create mode 100644 modules/python/doc/_autosummary/visp.tt.TemplateTrackerPointCompo.rst create mode 100644 modules/python/doc/_autosummary/visp.tt.TemplateTrackerSSD.rst create mode 100644 modules/python/doc/_autosummary/visp.tt.TemplateTrackerSSDESM.rst create mode 100644 modules/python/doc/_autosummary/visp.tt.TemplateTrackerSSDForwardAdditional.rst create mode 100644 modules/python/doc/_autosummary/visp.tt.TemplateTrackerSSDForwardCompositional.rst create mode 100644 modules/python/doc/_autosummary/visp.tt.TemplateTrackerSSDInverseCompositional.rst create mode 100644 modules/python/doc/_autosummary/visp.tt.TemplateTrackerTriangle.rst create mode 100644 modules/python/doc/_autosummary/visp.tt.TemplateTrackerWarp.rst create mode 100644 modules/python/doc/_autosummary/visp.tt.TemplateTrackerWarpAffine.rst create mode 100644 modules/python/doc/_autosummary/visp.tt.TemplateTrackerWarpHomography.rst create mode 100644 modules/python/doc/_autosummary/visp.tt.TemplateTrackerWarpHomographySL3.rst create mode 100644 modules/python/doc/_autosummary/visp.tt.TemplateTrackerWarpRT.rst create mode 100644 modules/python/doc/_autosummary/visp.tt.TemplateTrackerWarpSRT.rst create mode 100644 modules/python/doc/_autosummary/visp.tt.TemplateTrackerWarpTranslation.rst create mode 100644 modules/python/doc/_autosummary/visp.tt.TemplateTrackerZNCC.rst create mode 100644 modules/python/doc/_autosummary/visp.tt.TemplateTrackerZNCCForwardAdditional.rst create mode 100644 modules/python/doc/_autosummary/visp.tt.TemplateTrackerZNCCInverseCompositional.rst create mode 100644 modules/python/doc/_autosummary/visp.tt.TemplateTrackerZPoint.rst create mode 100644 modules/python/doc/_autosummary/visp.tt.TemplateTrackerZone.rst create mode 100644 modules/python/doc/_autosummary/visp.tt.rst create mode 100644 modules/python/doc/_autosummary/visp.tt_mi.TemplateTrackerMI.rst create mode 100644 modules/python/doc/_autosummary/visp.tt_mi.TemplateTrackerMIESM.rst create mode 100644 modules/python/doc/_autosummary/visp.tt_mi.TemplateTrackerMIForwardAdditional.rst create mode 100644 modules/python/doc/_autosummary/visp.tt_mi.TemplateTrackerMIForwardCompositional.rst create mode 100644 modules/python/doc/_autosummary/visp.tt_mi.TemplateTrackerMIInverseCompositional.rst create mode 100644 modules/python/doc/_autosummary/visp.tt_mi.rst create mode 100644 modules/python/doc/_autosummary/visp.vision.BasicKeyPoint.rst create mode 100644 modules/python/doc/_autosummary/visp.vision.Calibration.rst create mode 100644 modules/python/doc/_autosummary/visp.vision.HandEyeCalibration.rst create mode 100644 modules/python/doc/_autosummary/visp.vision.Homography.rst create mode 100644 modules/python/doc/_autosummary/visp.vision.KeyPoint.rst create mode 100644 modules/python/doc/_autosummary/visp.vision.PlaneEstimation.rst create mode 100644 modules/python/doc/_autosummary/visp.vision.Pose.rst create mode 100644 modules/python/doc/_autosummary/visp.vision.XmlConfigParserKeyPoint.rst create mode 100644 modules/python/doc/_autosummary/visp.vision.rst create mode 100644 modules/python/doc/_autosummary/visp.visual_features.BasicFeature.rst create mode 100644 modules/python/doc/_autosummary/visp.visual_features.FeatureBuilder.rst create mode 100644 modules/python/doc/_autosummary/visp.visual_features.FeatureDepth.rst create mode 100644 modules/python/doc/_autosummary/visp.visual_features.FeatureEllipse.rst create mode 100644 modules/python/doc/_autosummary/visp.visual_features.FeatureLine.rst create mode 100644 modules/python/doc/_autosummary/visp.visual_features.FeatureLuminance.rst create mode 100644 modules/python/doc/_autosummary/visp.visual_features.FeatureMoment.rst create mode 100644 modules/python/doc/_autosummary/visp.visual_features.FeatureMomentAlpha.rst create mode 100644 modules/python/doc/_autosummary/visp.visual_features.FeatureMomentArea.rst create mode 100644 modules/python/doc/_autosummary/visp.visual_features.FeatureMomentAreaNormalized.rst create mode 100644 modules/python/doc/_autosummary/visp.visual_features.FeatureMomentBasic.rst create mode 100644 modules/python/doc/_autosummary/visp.visual_features.FeatureMomentCInvariant.rst create mode 100644 modules/python/doc/_autosummary/visp.visual_features.FeatureMomentCentered.rst create mode 100644 modules/python/doc/_autosummary/visp.visual_features.FeatureMomentCommon.rst create mode 100644 modules/python/doc/_autosummary/visp.visual_features.FeatureMomentDatabase.rst create mode 100644 modules/python/doc/_autosummary/visp.visual_features.FeatureMomentGravityCenter.rst create mode 100644 modules/python/doc/_autosummary/visp.visual_features.FeatureMomentGravityCenterNormalized.rst create mode 100644 modules/python/doc/_autosummary/visp.visual_features.FeaturePoint.rst create mode 100644 modules/python/doc/_autosummary/visp.visual_features.FeaturePoint3D.rst create mode 100644 modules/python/doc/_autosummary/visp.visual_features.FeaturePointPolar.rst create mode 100644 modules/python/doc/_autosummary/visp.visual_features.FeatureSegment.rst create mode 100644 modules/python/doc/_autosummary/visp.visual_features.FeatureThetaU.rst create mode 100644 modules/python/doc/_autosummary/visp.visual_features.FeatureTranslation.rst create mode 100644 modules/python/doc/_autosummary/visp.visual_features.FeatureVanishingPoint.rst create mode 100644 modules/python/doc/_autosummary/visp.visual_features.GenericFeature.rst create mode 100644 modules/python/doc/_autosummary/visp.visual_features.MomentGenericFeature.rst create mode 100644 modules/python/doc/_autosummary/visp.visual_features.rst create mode 100644 modules/python/doc/_autosummary/visp.vs.AdaptiveGain.rst create mode 100644 modules/python/doc/_autosummary/visp.vs.Servo.rst create mode 100644 modules/python/doc/_autosummary/visp.vs.ServoData.rst create mode 100644 modules/python/doc/_autosummary/visp.vs.ServoDisplay.rst create mode 100644 modules/python/doc/_autosummary/visp.vs.rst rename modules/python/{docs => doc}/_templates/custom-class-template.rst (100%) rename modules/python/{docs => doc}/_templates/custom-module-template.rst (100%) create mode 100644 modules/python/doc/api.rst rename modules/python/{docs => doc}/api.rst.in (100%) rename modules/python/{docs => doc}/conf.py.in (100%) rename modules/python/{docs => doc}/index.rst (100%) rename modules/python/{docs => doc}/requirements.txt (100%) rename modules/python/{docs => doc}/todos.rst (100%) diff --git a/modules/python/CMakeLists.txt b/modules/python/CMakeLists.txt index 3c7c9a39bd..a9dd7781b5 100644 --- a/modules/python/CMakeLists.txt +++ b/modules/python/CMakeLists.txt @@ -117,7 +117,7 @@ add_subdirectory(stubs) # Step 5: Build documentation if(BUILD_PYTHON_BINDINGS_DOC) - add_subdirectory(docs) + add_subdirectory(doc) endif() # Global target: compile and install the Python bindings diff --git a/modules/python/docs/CMakeLists.txt b/modules/python/doc/CMakeLists.txt similarity index 87% rename from modules/python/docs/CMakeLists.txt rename to modules/python/doc/CMakeLists.txt index 2c5716f56c..3854633073 100644 --- a/modules/python/docs/CMakeLists.txt +++ b/modules/python/doc/CMakeLists.txt @@ -1,4 +1,4 @@ -list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake") + # configured documentation tools and intermediate build results set(BINARY_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/_build") @@ -7,7 +7,7 @@ set(BINARY_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/_build") set(SPHINX_CACHE_DIR "${CMAKE_CURRENT_BINARY_DIR}/_doctrees") # HTML output directory -set(SPHINX_HTML_DIR "${CMAKE_CURRENT_BINARY_DIR}/html") +set(SPHINX_HTML_DIR "${VISP_DOC_DIR}/python") ############################################################################# # @@ -61,9 +61,10 @@ endforeach() configure_file( "${CMAKE_CURRENT_SOURCE_DIR}/api.rst.in" "${CMAKE_CURRENT_SOURCE_DIR}/api.rst" - @ONLY) + @ONLY +) -add_custom_target(visp_python_bindings_docs +add_custom_target(visp_python_bindings_doc COMMAND ${PYTHON3_EXECUTABLE} -m pip install -r "${CMAKE_CURRENT_SOURCE_DIR}/requirements.txt" COMMAND sphinx-build -q -b html @@ -71,6 +72,7 @@ add_custom_target(visp_python_bindings_docs -d "${SPHINX_CACHE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}" "${SPHINX_HTML_DIR}" - COMMENT "Building HTML documentation for ViSP Python doc with Sphinx") + COMMENT "Building Sphinx HTML documentation for ViSP's Python bindings" +) -add_dependencies(visp_python_bindings_docs visp_python_bindings_install) +add_dependencies(visp_python_bindings_doc visp_python_bindings_install) diff --git a/modules/python/doc/_autosummary/visp.ar.rst b/modules/python/doc/_autosummary/visp.ar.rst new file mode 100644 index 0000000000..38b0ff1cf7 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.ar.rst @@ -0,0 +1,23 @@ +ar +== + +.. automodule:: visp.ar + + + + + + + + + + + + + + + + + + + diff --git a/modules/python/doc/_autosummary/visp.blob.Dot.rst b/modules/python/doc/_autosummary/visp.blob.Dot.rst new file mode 100644 index 0000000000..2741ae5266 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.blob.Dot.rst @@ -0,0 +1,94 @@ +Dot +=== + +.. currentmodule:: visp.blob + +.. autoclass:: Dot + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~Dot.display + ~Dot.displayDot + ~Dot.getArea + ~Dot.getBBox + ~Dot.getCog + ~Dot.getConnexities + ~Dot.getEdges + ~Dot.getGamma + ~Dot.getGrayLevelPrecision + ~Dot.getHeight + ~Dot.getMaxDotSize + ~Dot.getMeanGrayLevel + ~Dot.getPolygon + ~Dot.getWidth + ~Dot.get_nij + ~Dot.initTracking + ~Dot.print + ~Dot.setCog + ~Dot.setComputeMoments + ~Dot.setConnexity + ~Dot.setGraphics + ~Dot.setGraphicsThickness + ~Dot.setGrayLevelMax + ~Dot.setGrayLevelMin + ~Dot.setGrayLevelPrecision + ~Dot.setMaxDotSize + ~Dot.track + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~Dot.cPAvailable + ~Dot.get_cP + ~Dot.get_p + ~Dot.cP + ~Dot.p + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~Dot.__doc__ + ~Dot.__eq__ + ~Dot.__hash__ + ~Dot.__init__ + ~Dot.__module__ + ~Dot.__ne__ + ~Dot.__repr__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~Dot.CONNEXITY_4 + ~Dot.CONNEXITY_8 + ~Dot.cP + ~Dot.cPAvailable + ~Dot.p + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.blob.Dot2.rst b/modules/python/doc/_autosummary/visp.blob.Dot2.rst new file mode 100644 index 0000000000..b2139fc816 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.blob.Dot2.rst @@ -0,0 +1,103 @@ +Dot2 +==== + +.. currentmodule:: visp.blob + +.. autoclass:: Dot2 + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~Dot2.defineDots + ~Dot2.display + ~Dot2.displayDot + ~Dot2.getArea + ~Dot2.getBBox + ~Dot2.getCog + ~Dot2.getDistance + ~Dot2.getEdges + ~Dot2.getEllipsoidBadPointsPercentage + ~Dot2.getEllipsoidShapePrecision + ~Dot2.getFreemanChain + ~Dot2.getGamma + ~Dot2.getGrayLevelMax + ~Dot2.getGrayLevelMin + ~Dot2.getGrayLevelPrecision + ~Dot2.getHeight + ~Dot2.getMaxSizeSearchDistancePrecision + ~Dot2.getMeanGrayLevel + ~Dot2.getPolygon + ~Dot2.getSizePrecision + ~Dot2.getWidth + ~Dot2.get_nij + ~Dot2.initTracking + ~Dot2.print + ~Dot2.searchDotsInArea + ~Dot2.setArea + ~Dot2.setCog + ~Dot2.setComputeMoments + ~Dot2.setEllipsoidBadPointsPercentage + ~Dot2.setEllipsoidShapePrecision + ~Dot2.setGraphics + ~Dot2.setGraphicsThickness + ~Dot2.setGrayLevelMax + ~Dot2.setGrayLevelMin + ~Dot2.setGrayLevelPrecision + ~Dot2.setHeight + ~Dot2.setMaxSizeSearchDistancePrecision + ~Dot2.setSizePrecision + ~Dot2.setWidth + ~Dot2.track + ~Dot2.trackAndDisplay + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~Dot2.cPAvailable + ~Dot2.get_cP + ~Dot2.get_p + ~Dot2.cP + ~Dot2.p + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~Dot2.__doc__ + ~Dot2.__init__ + ~Dot2.__module__ + ~Dot2.__repr__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~Dot2.cP + ~Dot2.cPAvailable + ~Dot2.p + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.blob.rst b/modules/python/doc/_autosummary/visp.blob.rst new file mode 100644 index 0000000000..f7c0c5a1e4 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.blob.rst @@ -0,0 +1,33 @@ +blob +==== + +.. automodule:: visp.blob + + + + + + + + + + + + .. rubric:: Classes + + .. autosummary:: + :toctree: + :template: custom-class-template.rst + :nosignatures: + + Dot + Dot2 + + + + + + + + + diff --git a/modules/python/doc/_autosummary/visp.core.ArrayDouble2D.rst b/modules/python/doc/_autosummary/visp.core.ArrayDouble2D.rst new file mode 100644 index 0000000000..e0c9871ba5 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.ArrayDouble2D.rst @@ -0,0 +1,68 @@ +ArrayDouble2D +============= + +.. currentmodule:: visp.core + +.. autoclass:: ArrayDouble2D + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~ArrayDouble2D.conv2 + ~ArrayDouble2D.getCols + ~ArrayDouble2D.getMaxValue + ~ArrayDouble2D.getMinValue + ~ArrayDouble2D.getRows + ~ArrayDouble2D.hadamard + ~ArrayDouble2D.insert + ~ArrayDouble2D.insertStatic + ~ArrayDouble2D.numpy + ~ArrayDouble2D.reshape + ~ArrayDouble2D.resize + ~ArrayDouble2D.save + ~ArrayDouble2D.saveYAML + ~ArrayDouble2D.size + ~ArrayDouble2D.t + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~ArrayDouble2D.__doc__ + ~ArrayDouble2D.__eq__ + ~ArrayDouble2D.__getitem__ + ~ArrayDouble2D.__hash__ + ~ArrayDouble2D.__init__ + ~ArrayDouble2D.__module__ + ~ArrayDouble2D.__ne__ + ~ArrayDouble2D.__repr__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.BSpline.rst b/modules/python/doc/_autosummary/visp.core.BSpline.rst new file mode 100644 index 0000000000..b35ca21688 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.BSpline.rst @@ -0,0 +1,69 @@ +BSpline +======= + +.. currentmodule:: visp.core + +.. autoclass:: BSpline + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~BSpline.computeCurvePoint + ~BSpline.computeCurvePointFromSpline + ~BSpline.findSpan + ~BSpline.findSpanFromSpline + ~BSpline.get_controlPoints + ~BSpline.get_crossingPoints + ~BSpline.get_knots + ~BSpline.get_p + ~BSpline.set_controlPoints + ~BSpline.set_crossingPoints + ~BSpline.set_knots + ~BSpline.set_p + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~BSpline.__doc__ + ~BSpline.__init__ + ~BSpline.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~BSpline.controlPoints + ~BSpline.crossingPoints + ~BSpline.knots + ~BSpline.p + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.CameraParameters.rst b/modules/python/doc/_autosummary/visp.core.CameraParameters.rst new file mode 100644 index 0000000000..4c0def9c89 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.CameraParameters.rst @@ -0,0 +1,84 @@ +CameraParameters +================ + +.. currentmodule:: visp.core + +.. autoclass:: CameraParameters + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~CameraParameters.computeFov + ~CameraParameters.getFovNormals + ~CameraParameters.getHorizontalFovAngle + ~CameraParameters.getKannalaBrandtDistortionCoefficients + ~CameraParameters.getVerticalFovAngle + ~CameraParameters.get_K + ~CameraParameters.get_K_inverse + ~CameraParameters.get_kdu + ~CameraParameters.get_kud + ~CameraParameters.get_projModel + ~CameraParameters.get_px + ~CameraParameters.get_px_inverse + ~CameraParameters.get_py + ~CameraParameters.get_py_inverse + ~CameraParameters.get_u0 + ~CameraParameters.get_v0 + ~CameraParameters.init + ~CameraParameters.initFromCalibrationMatrix + ~CameraParameters.initFromFov + ~CameraParameters.initPersProjWithDistortion + ~CameraParameters.initPersProjWithoutDistortion + ~CameraParameters.initProjWithKannalaBrandtDistortion + ~CameraParameters.isFovComputed + ~CameraParameters.printParameters + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~CameraParameters.__doc__ + ~CameraParameters.__eq__ + ~CameraParameters.__hash__ + ~CameraParameters.__init__ + ~CameraParameters.__module__ + ~CameraParameters.__ne__ + ~CameraParameters.__repr__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~CameraParameters.ProjWithKannalaBrandtDistortion + ~CameraParameters.perspectiveProjWithDistortion + ~CameraParameters.perspectiveProjWithoutDistortion + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.CannyEdgeDetection.rst b/modules/python/doc/_autosummary/visp.core.CannyEdgeDetection.rst new file mode 100644 index 0000000000..6de99db92c --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.CannyEdgeDetection.rst @@ -0,0 +1,56 @@ +CannyEdgeDetection +================== + +.. currentmodule:: visp.core + +.. autoclass:: CannyEdgeDetection + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~CannyEdgeDetection.detect + ~CannyEdgeDetection.initFromJSON + ~CannyEdgeDetection.setCannyThresholds + ~CannyEdgeDetection.setCannyThresholdsRatio + ~CannyEdgeDetection.setFilteringAndGradientType + ~CannyEdgeDetection.setGaussianFilterParameters + ~CannyEdgeDetection.setGradientFilterAperture + ~CannyEdgeDetection.setGradients + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~CannyEdgeDetection.__doc__ + ~CannyEdgeDetection.__init__ + ~CannyEdgeDetection.__module__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.Chrono.rst b/modules/python/doc/_autosummary/visp.core.Chrono.rst new file mode 100644 index 0000000000..7474ecb162 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.Chrono.rst @@ -0,0 +1,53 @@ +Chrono +====== + +.. currentmodule:: visp.core + +.. autoclass:: Chrono + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~Chrono.getDurationMicros + ~Chrono.getDurationMs + ~Chrono.getDurationSeconds + ~Chrono.start + ~Chrono.stop + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~Chrono.__doc__ + ~Chrono.__init__ + ~Chrono.__module__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.Circle.rst b/modules/python/doc/_autosummary/visp.core.Circle.rst new file mode 100644 index 0000000000..d0db87396c --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.Circle.rst @@ -0,0 +1,91 @@ +Circle +====== + +.. currentmodule:: visp.core + +.. autoclass:: Circle + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~Circle.changeFrame + ~Circle.computeIntersectionPoint + ~Circle.display + ~Circle.getA + ~Circle.getB + ~Circle.getC + ~Circle.getR + ~Circle.getX + ~Circle.getY + ~Circle.getZ + ~Circle.get_n02 + ~Circle.get_n11 + ~Circle.get_n20 + ~Circle.get_x + ~Circle.get_y + ~Circle.projection + ~Circle.setWorldCoordinates + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~Circle.cPAvailable + ~Circle.user + ~Circle.track + ~Circle.getDeallocate + ~Circle.get_cP + ~Circle.project + ~Circle.ForwardProjectionDeallocatorType + ~Circle.print + ~Circle.get_p + ~Circle.setDeallocate + ~Circle.cP + ~Circle.vpDisplayForwardProjection + ~Circle.p + ~Circle.get_oP + ~Circle.oP + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~Circle.__doc__ + ~Circle.__init__ + ~Circle.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~Circle.cP + ~Circle.cPAvailable + ~Circle.oP + ~Circle.p + ~Circle.user + ~Circle.vpDisplayForwardProjection + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.Client.rst b/modules/python/doc/_autosummary/visp.core.Client.rst new file mode 100644 index 0000000000..c5c1c97aa4 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.Client.rst @@ -0,0 +1,76 @@ +Client +====== + +.. currentmodule:: visp.core + +.. autoclass:: Client + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~Client.connectToHostname + ~Client.connectToIP + ~Client.deconnect + ~Client.getNumberOfAttempts + ~Client.getNumberOfServers + ~Client.print + ~Client.setNumberOfAttempts + ~Client.stop + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~Client.removeDecodingRequest + ~Client.setMaxSizeReceivedMessage + ~Client.receiveRequestFrom + ~Client.receiveAndDecodeRequestFrom + ~Client.setTimeoutUSec + ~Client.getRequestIdFromIndex + ~Client.receiveRequest + ~Client.setVerbose + ~Client.sendRequestTo + ~Client.receiveAndDecodeRequestOnce + ~Client.receiveRequestOnceFrom + ~Client.sendRequest + ~Client.getReceptorIndex + ~Client.setTimeoutSec + ~Client.getMaxSizeReceivedMessage + ~Client.sendAndEncodeRequest + ~Client.receiveAndDecodeRequest + ~Client.receiveRequestOnce + ~Client.sendAndEncodeRequestTo + ~Client.receiveAndDecodeRequestOnceFrom + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~Client.__doc__ + ~Client.__init__ + ~Client.__module__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.ColVector.rst b/modules/python/doc/_autosummary/visp.core.ColVector.rst new file mode 100644 index 0000000000..0888cf9a41 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.ColVector.rst @@ -0,0 +1,104 @@ +ColVector +========= + +.. currentmodule:: visp.core + +.. autoclass:: ColVector + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~ColVector.clear + ~ColVector.cppPrint + ~ColVector.cross + ~ColVector.crossProd + ~ColVector.csvPrint + ~ColVector.deg2rad + ~ColVector.dotProd + ~ColVector.extract + ~ColVector.frobeniusNorm + ~ColVector.hadamard + ~ColVector.infinityNorm + ~ColVector.init + ~ColVector.insert + ~ColVector.invSort + ~ColVector.maplePrint + ~ColVector.matlabPrint + ~ColVector.mean + ~ColVector.median + ~ColVector.normalize + ~ColVector.numpy + ~ColVector.print + ~ColVector.rad2deg + ~ColVector.reshape + ~ColVector.resize + ~ColVector.skew + ~ColVector.sort + ~ColVector.stack + ~ColVector.stackVectors + ~ColVector.stdev + ~ColVector.sum + ~ColVector.sumSquare + ~ColVector.t + ~ColVector.toStdVector + ~ColVector.transpose + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~ColVector.insertStatic + ~ColVector.getMaxValue + ~ColVector.save + ~ColVector.size + ~ColVector.getCols + ~ColVector.getMinValue + ~ColVector.conv2 + ~ColVector.saveYAML + ~ColVector.getRows + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~ColVector.__add__ + ~ColVector.__doc__ + ~ColVector.__eq__ + ~ColVector.__getitem__ + ~ColVector.__hash__ + ~ColVector.__iadd__ + ~ColVector.__imul__ + ~ColVector.__init__ + ~ColVector.__isub__ + ~ColVector.__itruediv__ + ~ColVector.__module__ + ~ColVector.__mul__ + ~ColVector.__ne__ + ~ColVector.__neg__ + ~ColVector.__sub__ + ~ColVector.__truediv__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.Color.rst b/modules/python/doc/_autosummary/visp.core.Color.rst new file mode 100644 index 0000000000..65d17226e0 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.Color.rst @@ -0,0 +1,106 @@ +Color +===== + +.. currentmodule:: visp.core + +.. autoclass:: Color + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~Color.getColor + ~Color.setColor + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~Color.A + ~Color.R + ~Color.AlphaDefault + ~Color.alpha_default + ~Color.G + ~Color.B + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~Color.__doc__ + ~Color.__init__ + ~Color.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~Color.A + ~Color.B + ~Color.G + ~Color.R + ~Color.alpha_default + ~Color.black + ~Color.blue + ~Color.cyan + ~Color.darkBlue + ~Color.darkGray + ~Color.darkGreen + ~Color.darkRed + ~Color.gray + ~Color.green + ~Color.id + ~Color.id_black + ~Color.id_blue + ~Color.id_cyan + ~Color.id_darkBlue + ~Color.id_darkGray + ~Color.id_darkGreen + ~Color.id_darkRed + ~Color.id_gray + ~Color.id_green + ~Color.id_lightBlue + ~Color.id_lightGray + ~Color.id_lightGreen + ~Color.id_lightRed + ~Color.id_orange + ~Color.id_purple + ~Color.id_red + ~Color.id_unknown + ~Color.id_white + ~Color.id_yellow + ~Color.lightBlue + ~Color.lightGray + ~Color.lightGreen + ~Color.lightRed + ~Color.nbColors + ~Color.none + ~Color.orange + ~Color.purple + ~Color.red + ~Color.white + ~Color.yellow + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.ColorDepthConversion.rst b/modules/python/doc/_autosummary/visp.core.ColorDepthConversion.rst new file mode 100644 index 0000000000..629c3baa20 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.ColorDepthConversion.rst @@ -0,0 +1,49 @@ +ColorDepthConversion +==================== + +.. currentmodule:: visp.core + +.. autoclass:: ColorDepthConversion + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~ColorDepthConversion.projectColorToDepth + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~ColorDepthConversion.__doc__ + ~ColorDepthConversion.__init__ + ~ColorDepthConversion.__module__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.Colormap.rst b/modules/python/doc/_autosummary/visp.core.Colormap.rst new file mode 100644 index 0000000000..c6effccde4 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.Colormap.rst @@ -0,0 +1,76 @@ +Colormap +======== + +.. currentmodule:: visp.core + +.. autoclass:: Colormap + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~Colormap.convert + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~Colormap.__doc__ + ~Colormap.__init__ + ~Colormap.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~Colormap.COLORMAP_AUTUMN + ~Colormap.COLORMAP_CIVIDIS + ~Colormap.COLORMAP_COOL + ~Colormap.COLORMAP_GIST_EARTH + ~Colormap.COLORMAP_GNUPLOT + ~Colormap.COLORMAP_GNUPLOT2 + ~Colormap.COLORMAP_HOT + ~Colormap.COLORMAP_HSV + ~Colormap.COLORMAP_INFERNO + ~Colormap.COLORMAP_JET + ~Colormap.COLORMAP_MAGMA + ~Colormap.COLORMAP_OCEAN + ~Colormap.COLORMAP_PLASMA + ~Colormap.COLORMAP_RAINBOW + ~Colormap.COLORMAP_SPRING + ~Colormap.COLORMAP_SUMMER + ~Colormap.COLORMAP_TERRAIN + ~Colormap.COLORMAP_TURBO + ~Colormap.COLORMAP_TWILIGHT + ~Colormap.COLORMAP_TWILIGHT_SHIFTED + ~Colormap.COLORMAP_VIRIDIS + ~Colormap.COLORMAP_WINTER + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.Convert.rst b/modules/python/doc/_autosummary/visp.core.Convert.rst new file mode 100644 index 0000000000..2a7f3efed4 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.Convert.rst @@ -0,0 +1,50 @@ +Convert +======= + +.. currentmodule:: visp.core + +.. autoclass:: Convert + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~Convert.convertFromOpenCV + ~Convert.convertToOpenCV + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~Convert.__doc__ + ~Convert.__init__ + ~Convert.__module__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.Cylinder.rst b/modules/python/doc/_autosummary/visp.core.Cylinder.rst new file mode 100644 index 0000000000..9fd8ed05fe --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.Cylinder.rst @@ -0,0 +1,93 @@ +Cylinder +======== + +.. currentmodule:: visp.core + +.. autoclass:: Cylinder + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~Cylinder.changeFrame + ~Cylinder.computeZ + ~Cylinder.display + ~Cylinder.getA + ~Cylinder.getB + ~Cylinder.getC + ~Cylinder.getR + ~Cylinder.getRho1 + ~Cylinder.getRho2 + ~Cylinder.getTheta1 + ~Cylinder.getTheta2 + ~Cylinder.getX + ~Cylinder.getY + ~Cylinder.getZ + ~Cylinder.init + ~Cylinder.projection + ~Cylinder.setWorldCoordinates + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~Cylinder.cPAvailable + ~Cylinder.user + ~Cylinder.track + ~Cylinder.getDeallocate + ~Cylinder.get_cP + ~Cylinder.project + ~Cylinder.ForwardProjectionDeallocatorType + ~Cylinder.print + ~Cylinder.get_p + ~Cylinder.setDeallocate + ~Cylinder.cP + ~Cylinder.vpDisplayForwardProjection + ~Cylinder.p + ~Cylinder.get_oP + ~Cylinder.oP + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~Cylinder.__doc__ + ~Cylinder.__init__ + ~Cylinder.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~Cylinder.cP + ~Cylinder.cPAvailable + ~Cylinder.line1 + ~Cylinder.line2 + ~Cylinder.oP + ~Cylinder.p + ~Cylinder.user + ~Cylinder.vpDisplayForwardProjection + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.Display.rst b/modules/python/doc/_autosummary/visp.core.Display.rst new file mode 100644 index 0000000000..d329ccf909 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.Display.rst @@ -0,0 +1,101 @@ +Display +======= + +.. currentmodule:: visp.core + +.. autoclass:: Display + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~Display.close + ~Display.computeAutoScale + ~Display.display + ~Display.displayArrow + ~Display.displayCamera + ~Display.displayCircleStatic + ~Display.displayCross + ~Display.displayDotLine + ~Display.displayEllipse + ~Display.displayFrame + ~Display.displayLine + ~Display.displayPoint + ~Display.displayPolygon + ~Display.displayROI + ~Display.displayRectangle + ~Display.displayText + ~Display.flush + ~Display.flushROI + ~Display.getClick + ~Display.getClickUp + ~Display.getDownScalingFactor + ~Display.getHeight + ~Display.getImage + ~Display.getImageDownScalingFactor + ~Display.getKeyboardEvent + ~Display.getPointerMotionEvent + ~Display.getPointerPosition + ~Display.getWidth + ~Display.getWindowXPosition + ~Display.getWindowYPosition + ~Display.isInitialised + ~Display.setBackground + ~Display.setDownScalingFactor + ~Display.setFont + ~Display.setTitle + ~Display.setWindowPosition + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~Display.__doc__ + ~Display.__init__ + ~Display.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~Display.SCALE_1 + ~Display.SCALE_10 + ~Display.SCALE_2 + ~Display.SCALE_3 + ~Display.SCALE_4 + ~Display.SCALE_5 + ~Display.SCALE_6 + ~Display.SCALE_7 + ~Display.SCALE_8 + ~Display.SCALE_9 + ~Display.SCALE_AUTO + ~Display.SCALE_DEFAULT + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.ExponentialMap.rst b/modules/python/doc/_autosummary/visp.core.ExponentialMap.rst new file mode 100644 index 0000000000..c06de1655a --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.ExponentialMap.rst @@ -0,0 +1,50 @@ +ExponentialMap +============== + +.. currentmodule:: visp.core + +.. autoclass:: ExponentialMap + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~ExponentialMap.direct + ~ExponentialMap.inverse + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~ExponentialMap.__doc__ + ~ExponentialMap.__init__ + ~ExponentialMap.__module__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.FeatureDisplay.rst b/modules/python/doc/_autosummary/visp.core.FeatureDisplay.rst new file mode 100644 index 0000000000..cd0695a1d1 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.FeatureDisplay.rst @@ -0,0 +1,52 @@ +FeatureDisplay +============== + +.. currentmodule:: visp.core + +.. autoclass:: FeatureDisplay + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~FeatureDisplay.displayCylinder + ~FeatureDisplay.displayEllipse + ~FeatureDisplay.displayLine + ~FeatureDisplay.displayPoint + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~FeatureDisplay.__doc__ + ~FeatureDisplay.__init__ + ~FeatureDisplay.__module__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.Font.rst b/modules/python/doc/_autosummary/visp.core.Font.rst new file mode 100644 index 0000000000..cfb06f599c --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.Font.rst @@ -0,0 +1,59 @@ +Font +==== + +.. currentmodule:: visp.core + +.. autoclass:: Font + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~Font.drawText + ~Font.getHeight + ~Font.getMeasure + ~Font.setHeight + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~Font.__doc__ + ~Font.__init__ + ~Font.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~Font.GENERIC_MONOSPACE + ~Font.TRUETYPE_FILE + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.ForceTwistMatrix.rst b/modules/python/doc/_autosummary/visp.core.ForceTwistMatrix.rst new file mode 100644 index 0000000000..695d247e74 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.ForceTwistMatrix.rst @@ -0,0 +1,67 @@ +ForceTwistMatrix +================ + +.. currentmodule:: visp.core + +.. autoclass:: ForceTwistMatrix + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~ForceTwistMatrix.buildFrom + ~ForceTwistMatrix.eye + ~ForceTwistMatrix.print + ~ForceTwistMatrix.resize + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~ForceTwistMatrix.insertStatic + ~ForceTwistMatrix.getMaxValue + ~ForceTwistMatrix.t + ~ForceTwistMatrix.save + ~ForceTwistMatrix.size + ~ForceTwistMatrix.hadamard + ~ForceTwistMatrix.insert + ~ForceTwistMatrix.getCols + ~ForceTwistMatrix.getMinValue + ~ForceTwistMatrix.numpy + ~ForceTwistMatrix.reshape + ~ForceTwistMatrix.conv2 + ~ForceTwistMatrix.saveYAML + ~ForceTwistMatrix.getRows + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~ForceTwistMatrix.__doc__ + ~ForceTwistMatrix.__init__ + ~ForceTwistMatrix.__module__ + ~ForceTwistMatrix.__mul__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.ForwardProjection.rst b/modules/python/doc/_autosummary/visp.core.ForwardProjection.rst new file mode 100644 index 0000000000..a19dd2b4aa --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.ForwardProjection.rst @@ -0,0 +1,70 @@ +ForwardProjection +================= + +.. currentmodule:: visp.core + +.. autoclass:: ForwardProjection + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~ForwardProjection.getDeallocate + ~ForwardProjection.get_oP + ~ForwardProjection.print + ~ForwardProjection.project + ~ForwardProjection.setDeallocate + ~ForwardProjection.track + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~ForwardProjection.cPAvailable + ~ForwardProjection.get_cP + ~ForwardProjection.get_p + ~ForwardProjection.cP + ~ForwardProjection.p + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~ForwardProjection.__doc__ + ~ForwardProjection.__init__ + ~ForwardProjection.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~ForwardProjection.cP + ~ForwardProjection.cPAvailable + ~ForwardProjection.oP + ~ForwardProjection.p + ~ForwardProjection.user + ~ForwardProjection.vpDisplayForwardProjection + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.FrameGrabber.rst b/modules/python/doc/_autosummary/visp.core.FrameGrabber.rst new file mode 100644 index 0000000000..bfbc8410ca --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.FrameGrabber.rst @@ -0,0 +1,56 @@ +FrameGrabber +============ + +.. currentmodule:: visp.core + +.. autoclass:: FrameGrabber + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~FrameGrabber.getHeight + ~FrameGrabber.getWidth + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~FrameGrabber.__doc__ + ~FrameGrabber.__init__ + ~FrameGrabber.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~FrameGrabber.init + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.GaussRand.rst b/modules/python/doc/_autosummary/visp.core.GaussRand.rst new file mode 100644 index 0000000000..13c3d21281 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.GaussRand.rst @@ -0,0 +1,50 @@ +GaussRand +========= + +.. currentmodule:: visp.core + +.. autoclass:: GaussRand + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~GaussRand.seed + ~GaussRand.setSigmaMean + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~GaussRand.__doc__ + ~GaussRand.__init__ + ~GaussRand.__module__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.GaussianFilter.rst b/modules/python/doc/_autosummary/visp.core.GaussianFilter.rst new file mode 100644 index 0000000000..6076679d7c --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.GaussianFilter.rst @@ -0,0 +1,49 @@ +GaussianFilter +============== + +.. currentmodule:: visp.core + +.. autoclass:: GaussianFilter + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~GaussianFilter.apply + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~GaussianFilter.__doc__ + ~GaussianFilter.__init__ + ~GaussianFilter.__module__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.Hinkley.rst b/modules/python/doc/_autosummary/visp.core.Hinkley.rst new file mode 100644 index 0000000000..62a29de67a --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.Hinkley.rst @@ -0,0 +1,68 @@ +Hinkley +======= + +.. currentmodule:: visp.core + +.. autoclass:: Hinkley + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~Hinkley.getMean + ~Hinkley.getMk + ~Hinkley.getNk + ~Hinkley.getSk + ~Hinkley.getTk + ~Hinkley.init + ~Hinkley.print + ~Hinkley.setAlpha + ~Hinkley.setDelta + ~Hinkley.testDownUpwardJump + ~Hinkley.testDownwardJump + ~Hinkley.testUpwardJump + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~Hinkley.__doc__ + ~Hinkley.__init__ + ~Hinkley.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~Hinkley.downwardJump + ~Hinkley.noJump + ~Hinkley.upwardJump + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.Histogram.rst b/modules/python/doc/_autosummary/visp.core.Histogram.rst new file mode 100644 index 0000000000..4e9025fef7 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.Histogram.rst @@ -0,0 +1,59 @@ +Histogram +========= + +.. currentmodule:: visp.core + +.. autoclass:: Histogram + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~Histogram.calculate + ~Histogram.display + ~Histogram.equalize + ~Histogram.get + ~Histogram.getPeaks + ~Histogram.getSize + ~Histogram.getValey + ~Histogram.set + ~Histogram.smooth + ~Histogram.sort + ~Histogram.write + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~Histogram.__doc__ + ~Histogram.__init__ + ~Histogram.__module__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.HistogramPeak.rst b/modules/python/doc/_autosummary/visp.core.HistogramPeak.rst new file mode 100644 index 0000000000..0e0c5f67af --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.HistogramPeak.rst @@ -0,0 +1,56 @@ +HistogramPeak +============= + +.. currentmodule:: visp.core + +.. autoclass:: HistogramPeak + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~HistogramPeak.getLevel + ~HistogramPeak.getValue + ~HistogramPeak.set + ~HistogramPeak.setLevel + ~HistogramPeak.setValue + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~HistogramPeak.__doc__ + ~HistogramPeak.__eq__ + ~HistogramPeak.__hash__ + ~HistogramPeak.__init__ + ~HistogramPeak.__module__ + ~HistogramPeak.__repr__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.HistogramValey.rst b/modules/python/doc/_autosummary/visp.core.HistogramValey.rst new file mode 100644 index 0000000000..c54c54c08a --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.HistogramValey.rst @@ -0,0 +1,56 @@ +HistogramValey +============== + +.. currentmodule:: visp.core + +.. autoclass:: HistogramValey + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~HistogramValey.getLevel + ~HistogramValey.getValue + ~HistogramValey.set + ~HistogramValey.setLevel + ~HistogramValey.setValue + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~HistogramValey.__doc__ + ~HistogramValey.__eq__ + ~HistogramValey.__hash__ + ~HistogramValey.__init__ + ~HistogramValey.__module__ + ~HistogramValey.__repr__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.HomogeneousMatrix.rst b/modules/python/doc/_autosummary/visp.core.HomogeneousMatrix.rst new file mode 100644 index 0000000000..30e32123e5 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.HomogeneousMatrix.rst @@ -0,0 +1,88 @@ +HomogeneousMatrix +================= + +.. currentmodule:: visp.core + +.. autoclass:: HomogeneousMatrix + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~HomogeneousMatrix.buildFrom + ~HomogeneousMatrix.compute3d3dTransformation + ~HomogeneousMatrix.convert + ~HomogeneousMatrix.extract + ~HomogeneousMatrix.eye + ~HomogeneousMatrix.getCol + ~HomogeneousMatrix.getRotationMatrix + ~HomogeneousMatrix.getThetaUVector + ~HomogeneousMatrix.getTranslationVector + ~HomogeneousMatrix.insert + ~HomogeneousMatrix.inverse + ~HomogeneousMatrix.isAnHomogeneousMatrix + ~HomogeneousMatrix.isValid + ~HomogeneousMatrix.load + ~HomogeneousMatrix.mean + ~HomogeneousMatrix.numpy + ~HomogeneousMatrix.orthogonalizeRotation + ~HomogeneousMatrix.print + ~HomogeneousMatrix.resize + ~HomogeneousMatrix.save + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~HomogeneousMatrix.insertStatic + ~HomogeneousMatrix.getMaxValue + ~HomogeneousMatrix.t + ~HomogeneousMatrix.size + ~HomogeneousMatrix.hadamard + ~HomogeneousMatrix.getCols + ~HomogeneousMatrix.getMinValue + ~HomogeneousMatrix.reshape + ~HomogeneousMatrix.conv2 + ~HomogeneousMatrix.saveYAML + ~HomogeneousMatrix.getRows + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~HomogeneousMatrix.__doc__ + ~HomogeneousMatrix.__getitem__ + ~HomogeneousMatrix.__imul__ + ~HomogeneousMatrix.__init__ + ~HomogeneousMatrix.__module__ + ~HomogeneousMatrix.__mul__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~HomogeneousMatrix.jsonTypeName + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.ImageCircle.rst b/modules/python/doc/_autosummary/visp.core.ImageCircle.rst new file mode 100644 index 0000000000..6aec114851 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.ImageCircle.rst @@ -0,0 +1,56 @@ +ImageCircle +=========== + +.. currentmodule:: visp.core + +.. autoclass:: ImageCircle + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~ImageCircle.computeAngularCoverageInRoI + ~ImageCircle.computeArcLengthInRoI + ~ImageCircle.getBBox + ~ImageCircle.getCenter + ~ImageCircle.getRadius + ~ImageCircle.get_n02 + ~ImageCircle.get_n11 + ~ImageCircle.get_n20 + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~ImageCircle.__doc__ + ~ImageCircle.__init__ + ~ImageCircle.__module__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.ImageConvert.rst b/modules/python/doc/_autosummary/visp.core.ImageConvert.rst new file mode 100644 index 0000000000..6e4798b52c --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.ImageConvert.rst @@ -0,0 +1,80 @@ +ImageConvert +============ + +.. currentmodule:: visp.core + +.. autoclass:: ImageConvert + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~ImageConvert.GreyToRGB + ~ImageConvert.GreyToRGBa + ~ImageConvert.RGBToGrey + ~ImageConvert.RGBToRGBa + ~ImageConvert.RGBaToRGB + ~ImageConvert.YCbCrToGrey + ~ImageConvert.YCbCrToRGB + ~ImageConvert.YCbCrToRGBa + ~ImageConvert.YCrCbToRGB + ~ImageConvert.YCrCbToRGBa + ~ImageConvert.YUV411ToGrey + ~ImageConvert.YUV411ToRGB + ~ImageConvert.YUV411ToRGBa + ~ImageConvert.YUV420ToGrey + ~ImageConvert.YUV420ToRGB + ~ImageConvert.YUV420ToRGBa + ~ImageConvert.YUV422ToGrey + ~ImageConvert.YUV422ToRGB + ~ImageConvert.YUV422ToRGBa + ~ImageConvert.YUV444ToGrey + ~ImageConvert.YUV444ToRGB + ~ImageConvert.YUV444ToRGBa + ~ImageConvert.YUVToRGB + ~ImageConvert.YUYVToGrey + ~ImageConvert.YUYVToRGB + ~ImageConvert.YUYVToRGBa + ~ImageConvert.YV12ToRGB + ~ImageConvert.YV12ToRGBa + ~ImageConvert.YVU9ToRGB + ~ImageConvert.YVU9ToRGBa + ~ImageConvert.convert + ~ImageConvert.createDepthHistogram + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~ImageConvert.__doc__ + ~ImageConvert.__init__ + ~ImageConvert.__module__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.ImageDouble.rst b/modules/python/doc/_autosummary/visp.core.ImageDouble.rst new file mode 100644 index 0000000000..aef488b13e --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.ImageDouble.rst @@ -0,0 +1,76 @@ +ImageDouble +=========== + +.. currentmodule:: visp.core + +.. autoclass:: ImageDouble + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~ImageDouble.destroy + ~ImageDouble.doubleSizeImage + ~ImageDouble.getCols + ~ImageDouble.getHeight + ~ImageDouble.getMaxValue + ~ImageDouble.getMeanValue + ~ImageDouble.getMinMaxValue + ~ImageDouble.getMinValue + ~ImageDouble.getNumberOfPixel + ~ImageDouble.getRows + ~ImageDouble.getSize + ~ImageDouble.getSum + ~ImageDouble.getValue + ~ImageDouble.getWidth + ~ImageDouble.halfSizeImage + ~ImageDouble.init + ~ImageDouble.insert + ~ImageDouble.numpy + ~ImageDouble.quarterSizeImage + ~ImageDouble.resize + ~ImageDouble.sub + ~ImageDouble.subsample + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~ImageDouble.__doc__ + ~ImageDouble.__eq__ + ~ImageDouble.__getitem__ + ~ImageDouble.__hash__ + ~ImageDouble.__init__ + ~ImageDouble.__module__ + ~ImageDouble.__ne__ + ~ImageDouble.__repr__ + ~ImageDouble.__sub__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.ImageDraw.rst b/modules/python/doc/_autosummary/visp.core.ImageDraw.rst new file mode 100644 index 0000000000..0279095bdb --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.ImageDraw.rst @@ -0,0 +1,58 @@ +ImageDraw +========= + +.. currentmodule:: visp.core + +.. autoclass:: ImageDraw + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~ImageDraw.drawArrow + ~ImageDraw.drawCircle + ~ImageDraw.drawCross + ~ImageDraw.drawDottedLine + ~ImageDraw.drawEllipse + ~ImageDraw.drawFrame + ~ImageDraw.drawLine + ~ImageDraw.drawPoint + ~ImageDraw.drawPolygon + ~ImageDraw.drawRectangle + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~ImageDraw.__doc__ + ~ImageDraw.__init__ + ~ImageDraw.__module__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.ImageFilter.rst b/modules/python/doc/_autosummary/visp.core.ImageFilter.rst new file mode 100644 index 0000000000..89db29236b --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.ImageFilter.rst @@ -0,0 +1,75 @@ +ImageFilter +=========== + +.. currentmodule:: visp.core + +.. autoclass:: ImageFilter + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~ImageFilter.canny + ~ImageFilter.computePartialDerivatives + ~ImageFilter.filterGaussXPyramidal + ~ImageFilter.filterGaussYPyramidal + ~ImageFilter.gaussianBlur + ~ImageFilter.getGaussPyramidal + ~ImageFilter.getGaussXPyramidal + ~ImageFilter.getGaussYPyramidal + ~ImageFilter.median + ~ImageFilter.sepFilter + ~ImageFilter.vpCannyBackendTypeFromString + ~ImageFilter.vpCannyBackendTypeList + ~ImageFilter.vpCannyBackendTypeToString + ~ImageFilter.vpCannyFilteringAndGradientTypeFromString + ~ImageFilter.vpCannyFilteringAndGradientTypeList + ~ImageFilter.vpCannyFilteringAndGradientTypeToString + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~ImageFilter.__doc__ + ~ImageFilter.__init__ + ~ImageFilter.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~ImageFilter.CANNY_COUNT_BACKEND + ~ImageFilter.CANNY_COUNT_FILTERING + ~ImageFilter.CANNY_GBLUR_SCHARR_FILTERING + ~ImageFilter.CANNY_GBLUR_SOBEL_FILTERING + ~ImageFilter.CANNY_OPENCV_BACKEND + ~ImageFilter.CANNY_VISP_BACKEND + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.ImageFloat.rst b/modules/python/doc/_autosummary/visp.core.ImageFloat.rst new file mode 100644 index 0000000000..36b34dba16 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.ImageFloat.rst @@ -0,0 +1,76 @@ +ImageFloat +========== + +.. currentmodule:: visp.core + +.. autoclass:: ImageFloat + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~ImageFloat.destroy + ~ImageFloat.doubleSizeImage + ~ImageFloat.getCols + ~ImageFloat.getHeight + ~ImageFloat.getMaxValue + ~ImageFloat.getMeanValue + ~ImageFloat.getMinMaxValue + ~ImageFloat.getMinValue + ~ImageFloat.getNumberOfPixel + ~ImageFloat.getRows + ~ImageFloat.getSize + ~ImageFloat.getSum + ~ImageFloat.getValue + ~ImageFloat.getWidth + ~ImageFloat.halfSizeImage + ~ImageFloat.init + ~ImageFloat.insert + ~ImageFloat.numpy + ~ImageFloat.quarterSizeImage + ~ImageFloat.resize + ~ImageFloat.sub + ~ImageFloat.subsample + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~ImageFloat.__doc__ + ~ImageFloat.__eq__ + ~ImageFloat.__getitem__ + ~ImageFloat.__hash__ + ~ImageFloat.__init__ + ~ImageFloat.__module__ + ~ImageFloat.__ne__ + ~ImageFloat.__repr__ + ~ImageFloat.__sub__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.ImageGray.rst b/modules/python/doc/_autosummary/visp.core.ImageGray.rst new file mode 100644 index 0000000000..df042a3a80 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.ImageGray.rst @@ -0,0 +1,76 @@ +ImageGray +========= + +.. currentmodule:: visp.core + +.. autoclass:: ImageGray + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~ImageGray.destroy + ~ImageGray.doubleSizeImage + ~ImageGray.getCols + ~ImageGray.getHeight + ~ImageGray.getMaxValue + ~ImageGray.getMeanValue + ~ImageGray.getMinMaxValue + ~ImageGray.getMinValue + ~ImageGray.getNumberOfPixel + ~ImageGray.getRows + ~ImageGray.getSize + ~ImageGray.getSum + ~ImageGray.getValue + ~ImageGray.getWidth + ~ImageGray.halfSizeImage + ~ImageGray.init + ~ImageGray.insert + ~ImageGray.numpy + ~ImageGray.quarterSizeImage + ~ImageGray.resize + ~ImageGray.sub + ~ImageGray.subsample + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~ImageGray.__doc__ + ~ImageGray.__eq__ + ~ImageGray.__getitem__ + ~ImageGray.__hash__ + ~ImageGray.__init__ + ~ImageGray.__module__ + ~ImageGray.__ne__ + ~ImageGray.__repr__ + ~ImageGray.__sub__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.ImageMorphology.rst b/modules/python/doc/_autosummary/visp.core.ImageMorphology.rst new file mode 100644 index 0000000000..5f19ed844c --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.ImageMorphology.rst @@ -0,0 +1,55 @@ +ImageMorphology +=============== + +.. currentmodule:: visp.core + +.. autoclass:: ImageMorphology + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~ImageMorphology.__doc__ + ~ImageMorphology.__init__ + ~ImageMorphology.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~ImageMorphology.CONNEXITY_4 + ~ImageMorphology.CONNEXITY_8 + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.ImagePoint.rst b/modules/python/doc/_autosummary/visp.core.ImagePoint.rst new file mode 100644 index 0000000000..a7da364786 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.ImagePoint.rst @@ -0,0 +1,69 @@ +ImagePoint +========== + +.. currentmodule:: visp.core + +.. autoclass:: ImagePoint + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~ImagePoint.distance + ~ImagePoint.getBBox + ~ImagePoint.get_i + ~ImagePoint.get_j + ~ImagePoint.get_u + ~ImagePoint.get_v + ~ImagePoint.inRectangle + ~ImagePoint.inSegment + ~ImagePoint.nextInSegment + ~ImagePoint.set_i + ~ImagePoint.set_ij + ~ImagePoint.set_j + ~ImagePoint.set_u + ~ImagePoint.set_uv + ~ImagePoint.set_v + ~ImagePoint.sqrDistance + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~ImagePoint.__doc__ + ~ImagePoint.__iadd__ + ~ImagePoint.__imul__ + ~ImagePoint.__init__ + ~ImagePoint.__isub__ + ~ImagePoint.__itruediv__ + ~ImagePoint.__module__ + ~ImagePoint.__repr__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.ImageRGBA.rst b/modules/python/doc/_autosummary/visp.core.ImageRGBA.rst new file mode 100644 index 0000000000..b0e24f398b --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.ImageRGBA.rst @@ -0,0 +1,75 @@ +ImageRGBA +========= + +.. currentmodule:: visp.core + +.. autoclass:: ImageRGBA + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~ImageRGBA.destroy + ~ImageRGBA.doubleSizeImage + ~ImageRGBA.getCols + ~ImageRGBA.getHeight + ~ImageRGBA.getMaxValue + ~ImageRGBA.getMeanValue + ~ImageRGBA.getMinMaxValue + ~ImageRGBA.getMinValue + ~ImageRGBA.getNumberOfPixel + ~ImageRGBA.getRows + ~ImageRGBA.getSize + ~ImageRGBA.getSum + ~ImageRGBA.getValue + ~ImageRGBA.getWidth + ~ImageRGBA.halfSizeImage + ~ImageRGBA.init + ~ImageRGBA.insert + ~ImageRGBA.numpy + ~ImageRGBA.quarterSizeImage + ~ImageRGBA.resize + ~ImageRGBA.sub + ~ImageRGBA.subsample + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~ImageRGBA.__doc__ + ~ImageRGBA.__eq__ + ~ImageRGBA.__hash__ + ~ImageRGBA.__init__ + ~ImageRGBA.__module__ + ~ImageRGBA.__ne__ + ~ImageRGBA.__repr__ + ~ImageRGBA.__sub__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.ImageRGBa.rst b/modules/python/doc/_autosummary/visp.core.ImageRGBa.rst new file mode 100644 index 0000000000..3e81686afb --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.ImageRGBa.rst @@ -0,0 +1,76 @@ +ImageRGBa +========= + +.. currentmodule:: visp.core + +.. autoclass:: ImageRGBa + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~ImageRGBa.destroy + ~ImageRGBa.doubleSizeImage + ~ImageRGBa.getCols + ~ImageRGBa.getHeight + ~ImageRGBa.getMaxValue + ~ImageRGBa.getMeanValue + ~ImageRGBa.getMinMaxValue + ~ImageRGBa.getMinValue + ~ImageRGBa.getNumberOfPixel + ~ImageRGBa.getRows + ~ImageRGBa.getSize + ~ImageRGBa.getSum + ~ImageRGBa.getValue + ~ImageRGBa.getWidth + ~ImageRGBa.halfSizeImage + ~ImageRGBa.init + ~ImageRGBa.insert + ~ImageRGBa.numpy + ~ImageRGBa.quarterSizeImage + ~ImageRGBa.resize + ~ImageRGBa.sub + ~ImageRGBa.subsample + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~ImageRGBa.__doc__ + ~ImageRGBa.__eq__ + ~ImageRGBa.__getitem__ + ~ImageRGBa.__hash__ + ~ImageRGBa.__init__ + ~ImageRGBa.__module__ + ~ImageRGBa.__ne__ + ~ImageRGBa.__repr__ + ~ImageRGBa.__sub__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.ImageRGBf.rst b/modules/python/doc/_autosummary/visp.core.ImageRGBf.rst new file mode 100644 index 0000000000..6aeb07cc71 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.ImageRGBf.rst @@ -0,0 +1,76 @@ +ImageRGBf +========= + +.. currentmodule:: visp.core + +.. autoclass:: ImageRGBf + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~ImageRGBf.destroy + ~ImageRGBf.doubleSizeImage + ~ImageRGBf.getCols + ~ImageRGBf.getHeight + ~ImageRGBf.getMaxValue + ~ImageRGBf.getMeanValue + ~ImageRGBf.getMinMaxValue + ~ImageRGBf.getMinValue + ~ImageRGBf.getNumberOfPixel + ~ImageRGBf.getRows + ~ImageRGBf.getSize + ~ImageRGBf.getSum + ~ImageRGBf.getValue + ~ImageRGBf.getWidth + ~ImageRGBf.halfSizeImage + ~ImageRGBf.init + ~ImageRGBf.insert + ~ImageRGBf.numpy + ~ImageRGBf.quarterSizeImage + ~ImageRGBf.resize + ~ImageRGBf.sub + ~ImageRGBf.subsample + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~ImageRGBf.__doc__ + ~ImageRGBf.__eq__ + ~ImageRGBf.__getitem__ + ~ImageRGBf.__hash__ + ~ImageRGBf.__init__ + ~ImageRGBf.__module__ + ~ImageRGBf.__ne__ + ~ImageRGBf.__repr__ + ~ImageRGBf.__sub__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.ImageTools.rst b/modules/python/doc/_autosummary/visp.core.ImageTools.rst new file mode 100644 index 0000000000..f501db1bbd --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.ImageTools.rst @@ -0,0 +1,72 @@ +ImageTools +========== + +.. currentmodule:: visp.core + +.. autoclass:: ImageTools + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~ImageTools.changeLUT + ~ImageTools.columnMean + ~ImageTools.extract + ~ImageTools.imageAdd + ~ImageTools.imageDifference + ~ImageTools.imageDifferenceAbsolute + ~ImageTools.imageSubtract + ~ImageTools.initUndistortMap + ~ImageTools.integralImage + ~ImageTools.interpolate + ~ImageTools.normalize + ~ImageTools.normalizedCorrelation + ~ImageTools.remap + ~ImageTools.templateMatching + ~ImageTools.warpImage + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~ImageTools.__doc__ + ~ImageTools.__init__ + ~ImageTools.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~ImageTools.INTERPOLATION_AREA + ~ImageTools.INTERPOLATION_CUBIC + ~ImageTools.INTERPOLATION_LINEAR + ~ImageTools.INTERPOLATION_NEAREST + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.ImageUInt16.rst b/modules/python/doc/_autosummary/visp.core.ImageUInt16.rst new file mode 100644 index 0000000000..9c52a9b74b --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.ImageUInt16.rst @@ -0,0 +1,76 @@ +ImageUInt16 +=========== + +.. currentmodule:: visp.core + +.. autoclass:: ImageUInt16 + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~ImageUInt16.destroy + ~ImageUInt16.doubleSizeImage + ~ImageUInt16.getCols + ~ImageUInt16.getHeight + ~ImageUInt16.getMaxValue + ~ImageUInt16.getMeanValue + ~ImageUInt16.getMinMaxValue + ~ImageUInt16.getMinValue + ~ImageUInt16.getNumberOfPixel + ~ImageUInt16.getRows + ~ImageUInt16.getSize + ~ImageUInt16.getSum + ~ImageUInt16.getValue + ~ImageUInt16.getWidth + ~ImageUInt16.halfSizeImage + ~ImageUInt16.init + ~ImageUInt16.insert + ~ImageUInt16.numpy + ~ImageUInt16.quarterSizeImage + ~ImageUInt16.resize + ~ImageUInt16.sub + ~ImageUInt16.subsample + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~ImageUInt16.__doc__ + ~ImageUInt16.__eq__ + ~ImageUInt16.__getitem__ + ~ImageUInt16.__hash__ + ~ImageUInt16.__init__ + ~ImageUInt16.__module__ + ~ImageUInt16.__ne__ + ~ImageUInt16.__repr__ + ~ImageUInt16.__sub__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.IoTools.rst b/modules/python/doc/_autosummary/visp.core.IoTools.rst new file mode 100644 index 0000000000..9eb06b35ff --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.IoTools.rst @@ -0,0 +1,91 @@ +IoTools +======= + +.. currentmodule:: visp.core + +.. autoclass:: IoTools + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~IoTools.addNameElement + ~IoTools.checkDirectory + ~IoTools.checkFifo + ~IoTools.checkFilename + ~IoTools.copy + ~IoTools.createBaseNamePath + ~IoTools.createFilePath + ~IoTools.getAbsolutePathname + ~IoTools.getBaseName + ~IoTools.getBuildInformation + ~IoTools.getDirFiles + ~IoTools.getFileExtension + ~IoTools.getFullName + ~IoTools.getIndex + ~IoTools.getName + ~IoTools.getNameWE + ~IoTools.getParent + ~IoTools.getTempPath + ~IoTools.getUserName + ~IoTools.getVersion + ~IoTools.getViSPImagesDataPath + ~IoTools.getenv + ~IoTools.isAbsolutePathname + ~IoTools.isSamePathname + ~IoTools.loadConfigFile + ~IoTools.makeDirectory + ~IoTools.makeFifo + ~IoTools.makeTempDirectory + ~IoTools.parseBoolean + ~IoTools.path + ~IoTools.readBinaryValueLE + ~IoTools.readConfigVar + ~IoTools.remove + ~IoTools.rename + ~IoTools.saveConfigFile + ~IoTools.setBaseDir + ~IoTools.setBaseName + ~IoTools.splitChain + ~IoTools.splitDrive + ~IoTools.toLowerCase + ~IoTools.toUpperCase + ~IoTools.trim + ~IoTools.writeBinaryValueLE + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~IoTools.__doc__ + ~IoTools.__init__ + ~IoTools.__module__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.KalmanFilter.rst b/modules/python/doc/_autosummary/visp.core.KalmanFilter.rst new file mode 100644 index 0000000000..a75f91b938 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.KalmanFilter.rst @@ -0,0 +1,71 @@ +KalmanFilter +============ + +.. currentmodule:: visp.core + +.. autoclass:: KalmanFilter + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~KalmanFilter.filtering + ~KalmanFilter.getIteration + ~KalmanFilter.getMeasureSize + ~KalmanFilter.getNumberOfSignal + ~KalmanFilter.getStateSize + ~KalmanFilter.init + ~KalmanFilter.prediction + ~KalmanFilter.setNumberOfSignal + ~KalmanFilter.verbose + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~KalmanFilter.__doc__ + ~KalmanFilter.__init__ + ~KalmanFilter.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~KalmanFilter.F + ~KalmanFilter.H + ~KalmanFilter.Pest + ~KalmanFilter.Ppre + ~KalmanFilter.Q + ~KalmanFilter.R + ~KalmanFilter.Xest + ~KalmanFilter.Xpre + ~KalmanFilter.dt + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.LinProg.rst b/modules/python/doc/_autosummary/visp.core.LinProg.rst new file mode 100644 index 0000000000..8d0ac1951b --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.LinProg.rst @@ -0,0 +1,56 @@ +LinProg +======= + +.. currentmodule:: visp.core + +.. autoclass:: LinProg + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~LinProg.allClose + ~LinProg.allGreater + ~LinProg.allLesser + ~LinProg.allZero + ~LinProg.colReduction + ~LinProg.rowReduction + ~LinProg.simplex + ~LinProg.solveLP + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~LinProg.__doc__ + ~LinProg.__init__ + ~LinProg.__module__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.Line.rst b/modules/python/doc/_autosummary/visp.core.Line.rst new file mode 100644 index 0000000000..ac53dba8aa --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.Line.rst @@ -0,0 +1,82 @@ +Line +==== + +.. currentmodule:: visp.core + +.. autoclass:: Line + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~Line.changeFrame + ~Line.display + ~Line.getRho + ~Line.getTheta + ~Line.projection + ~Line.setRho + ~Line.setTheta + ~Line.setWorldCoordinates + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~Line.cPAvailable + ~Line.user + ~Line.track + ~Line.getDeallocate + ~Line.get_cP + ~Line.project + ~Line.ForwardProjectionDeallocatorType + ~Line.print + ~Line.get_p + ~Line.setDeallocate + ~Line.cP + ~Line.vpDisplayForwardProjection + ~Line.p + ~Line.get_oP + ~Line.oP + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~Line.__doc__ + ~Line.__init__ + ~Line.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~Line.cP + ~Line.cPAvailable + ~Line.oP + ~Line.p + ~Line.user + ~Line.vpDisplayForwardProjection + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.LinearKalmanFilterInstantiation.rst b/modules/python/doc/_autosummary/visp.core.LinearKalmanFilterInstantiation.rst new file mode 100644 index 0000000000..a6acca38d0 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.LinearKalmanFilterInstantiation.rst @@ -0,0 +1,91 @@ +LinearKalmanFilterInstantiation +=============================== + +.. currentmodule:: visp.core + +.. autoclass:: LinearKalmanFilterInstantiation + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~LinearKalmanFilterInstantiation.filter + ~LinearKalmanFilterInstantiation.getStateModel + ~LinearKalmanFilterInstantiation.initFilter + ~LinearKalmanFilterInstantiation.initStateConstAccWithColoredNoise_MeasureVel + ~LinearKalmanFilterInstantiation.initStateConstVelWithColoredNoise_MeasureVel + ~LinearKalmanFilterInstantiation.initStateConstVel_MeasurePos + ~LinearKalmanFilterInstantiation.setStateModel + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~LinearKalmanFilterInstantiation.getIteration + ~LinearKalmanFilterInstantiation.getStateSize + ~LinearKalmanFilterInstantiation.R + ~LinearKalmanFilterInstantiation.Xpre + ~LinearKalmanFilterInstantiation.dt + ~LinearKalmanFilterInstantiation.Q + ~LinearKalmanFilterInstantiation.Pest + ~LinearKalmanFilterInstantiation.Ppre + ~LinearKalmanFilterInstantiation.setNumberOfSignal + ~LinearKalmanFilterInstantiation.prediction + ~LinearKalmanFilterInstantiation.Xest + ~LinearKalmanFilterInstantiation.verbose + ~LinearKalmanFilterInstantiation.getNumberOfSignal + ~LinearKalmanFilterInstantiation.F + ~LinearKalmanFilterInstantiation.H + ~LinearKalmanFilterInstantiation.getMeasureSize + ~LinearKalmanFilterInstantiation.init + ~LinearKalmanFilterInstantiation.filtering + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~LinearKalmanFilterInstantiation.__doc__ + ~LinearKalmanFilterInstantiation.__init__ + ~LinearKalmanFilterInstantiation.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~LinearKalmanFilterInstantiation.F + ~LinearKalmanFilterInstantiation.H + ~LinearKalmanFilterInstantiation.Pest + ~LinearKalmanFilterInstantiation.Ppre + ~LinearKalmanFilterInstantiation.Q + ~LinearKalmanFilterInstantiation.R + ~LinearKalmanFilterInstantiation.Xest + ~LinearKalmanFilterInstantiation.Xpre + ~LinearKalmanFilterInstantiation.dt + ~LinearKalmanFilterInstantiation.stateConstAccWithColoredNoise_MeasureVel + ~LinearKalmanFilterInstantiation.stateConstVelWithColoredNoise_MeasureVel + ~LinearKalmanFilterInstantiation.stateConstVel_MeasurePos + ~LinearKalmanFilterInstantiation.unknown + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.Math.rst b/modules/python/doc/_autosummary/visp.core.Math.rst new file mode 100644 index 0000000000..9c19b81de2 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.Math.rst @@ -0,0 +1,77 @@ +Math +==== + +.. currentmodule:: visp.core + +.. autoclass:: Math + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~Math.comb + ~Math.computeRegularPointsOnSphere + ~Math.deg + ~Math.enu2ecef + ~Math.enu2ned + ~Math.equal + ~Math.fact + ~Math.getAngleBetweenMinPiAndPi + ~Math.getMean + ~Math.getMedian + ~Math.getStdev + ~Math.greater + ~Math.isFinite + ~Math.isInf + ~Math.isNaN + ~Math.isNumber + ~Math.lineFitting + ~Math.lookAt + ~Math.mcosc + ~Math.modulo + ~Math.msinc + ~Math.ned2ecef + ~Math.nul + ~Math.rad + ~Math.round + ~Math.sigmoid + ~Math.sign + ~Math.sinc + ~Math.sqr + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~Math.__doc__ + ~Math.__init__ + ~Math.__module__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.Matrix.rst b/modules/python/doc/_autosummary/visp.core.Matrix.rst new file mode 100644 index 0000000000..b2c4883612 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.Matrix.rst @@ -0,0 +1,157 @@ +Matrix +====== + +.. currentmodule:: visp.core + +.. autoclass:: Matrix + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~Matrix.AAt + ~Matrix.AtA + ~Matrix.add2Matrices + ~Matrix.add2WeightedMatrices + ~Matrix.clear + ~Matrix.computeCovarianceMatrix + ~Matrix.computeCovarianceMatrixVVS + ~Matrix.computeHLM + ~Matrix.cond + ~Matrix.cppPrint + ~Matrix.createDiagonalMatrix + ~Matrix.csvPrint + ~Matrix.det + ~Matrix.detByLU + ~Matrix.detByLUEigen3 + ~Matrix.detByLULapack + ~Matrix.detByLUOpenCV + ~Matrix.diag + ~Matrix.eigenValues + ~Matrix.expm + ~Matrix.extract + ~Matrix.eye + ~Matrix.frobeniusNorm + ~Matrix.getCol + ~Matrix.getDiag + ~Matrix.getLapackMatrixMinSize + ~Matrix.getRow + ~Matrix.hadamard + ~Matrix.inducedL2Norm + ~Matrix.infinityNorm + ~Matrix.init + ~Matrix.insert + ~Matrix.insertMatrixInMatrix + ~Matrix.inverseByCholesky + ~Matrix.inverseByCholeskyLapack + ~Matrix.inverseByCholeskyOpenCV + ~Matrix.inverseByLU + ~Matrix.inverseByLUEigen3 + ~Matrix.inverseByLULapack + ~Matrix.inverseByLUOpenCV + ~Matrix.inverseByQR + ~Matrix.inverseByQRLapack + ~Matrix.inverseTriangular + ~Matrix.juxtaposeMatrices + ~Matrix.kernel + ~Matrix.kron + ~Matrix.kronStatic + ~Matrix.maplePrint + ~Matrix.matlabPrint + ~Matrix.mult2Matrices + ~Matrix.multMatrixVector + ~Matrix.negateMatrix + ~Matrix.nullSpace + ~Matrix.numpy + ~Matrix.print + ~Matrix.printSize + ~Matrix.pseudoInverse + ~Matrix.pseudoInverseEigen3 + ~Matrix.pseudoInverseLapack + ~Matrix.pseudoInverseOpenCV + ~Matrix.qr + ~Matrix.qrPivot + ~Matrix.saveMatrix + ~Matrix.saveMatrixYAML + ~Matrix.setLapackMatrixMinSize + ~Matrix.solveByQR + ~Matrix.solveBySVD + ~Matrix.stack + ~Matrix.stackColumn + ~Matrix.stackColumns + ~Matrix.stackMatrices + ~Matrix.stackRow + ~Matrix.stackRows + ~Matrix.sub2Matrices + ~Matrix.sum + ~Matrix.sumSquare + ~Matrix.svd + ~Matrix.svdEigen3 + ~Matrix.svdLapack + ~Matrix.svdOpenCV + ~Matrix.t + ~Matrix.transpose + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~Matrix.insertStatic + ~Matrix.getMaxValue + ~Matrix.save + ~Matrix.size + ~Matrix.getCols + ~Matrix.getMinValue + ~Matrix.reshape + ~Matrix.resize + ~Matrix.conv2 + ~Matrix.saveYAML + ~Matrix.getRows + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~Matrix.__add__ + ~Matrix.__doc__ + ~Matrix.__getitem__ + ~Matrix.__iadd__ + ~Matrix.__imul__ + ~Matrix.__init__ + ~Matrix.__isub__ + ~Matrix.__itruediv__ + ~Matrix.__module__ + ~Matrix.__mul__ + ~Matrix.__neg__ + ~Matrix.__sub__ + ~Matrix.__truediv__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~Matrix.LU_DECOMPOSITION + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.MeterPixelConversion.rst b/modules/python/doc/_autosummary/visp.core.MeterPixelConversion.rst new file mode 100644 index 0000000000..61d694433c --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.MeterPixelConversion.rst @@ -0,0 +1,52 @@ +MeterPixelConversion +==================== + +.. currentmodule:: visp.core + +.. autoclass:: MeterPixelConversion + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~MeterPixelConversion.convertEllipse + ~MeterPixelConversion.convertLine + ~MeterPixelConversion.convertPoint + ~MeterPixelConversion.convertPoints + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~MeterPixelConversion.__doc__ + ~MeterPixelConversion.__init__ + ~MeterPixelConversion.__module__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.Moment.rst b/modules/python/doc/_autosummary/visp.core.Moment.rst new file mode 100644 index 0000000000..72d19bea1a --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.Moment.rst @@ -0,0 +1,54 @@ +Moment +====== + +.. currentmodule:: visp.core + +.. autoclass:: Moment + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~Moment.get + ~Moment.getObject + ~Moment.linkTo + ~Moment.printDependencies + ~Moment.update + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~Moment.__doc__ + ~Moment.__init__ + ~Moment.__module__ + ~Moment.__repr__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.MomentAlpha.rst b/modules/python/doc/_autosummary/visp.core.MomentAlpha.rst new file mode 100644 index 0000000000..8ad5baeeac --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.MomentAlpha.rst @@ -0,0 +1,58 @@ +MomentAlpha +=========== + +.. currentmodule:: visp.core + +.. autoclass:: MomentAlpha + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~MomentAlpha.compute + ~MomentAlpha.get + ~MomentAlpha.is_ref + ~MomentAlpha.is_symmetric + ~MomentAlpha.name + ~MomentAlpha.printDependencies + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~MomentAlpha.update + ~MomentAlpha.linkTo + ~MomentAlpha.getObject + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~MomentAlpha.__doc__ + ~MomentAlpha.__init__ + ~MomentAlpha.__module__ + ~MomentAlpha.__repr__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.MomentArea.rst b/modules/python/doc/_autosummary/visp.core.MomentArea.rst new file mode 100644 index 0000000000..7f5b66463d --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.MomentArea.rst @@ -0,0 +1,56 @@ +MomentArea +========== + +.. currentmodule:: visp.core + +.. autoclass:: MomentArea + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~MomentArea.compute + ~MomentArea.name + ~MomentArea.printDependencies + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~MomentArea.update + ~MomentArea.linkTo + ~MomentArea.get + ~MomentArea.getObject + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~MomentArea.__doc__ + ~MomentArea.__init__ + ~MomentArea.__module__ + ~MomentArea.__repr__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.MomentAreaNormalized.rst b/modules/python/doc/_autosummary/visp.core.MomentAreaNormalized.rst new file mode 100644 index 0000000000..5f3a851777 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.MomentAreaNormalized.rst @@ -0,0 +1,60 @@ +MomentAreaNormalized +==================== + +.. currentmodule:: visp.core + +.. autoclass:: MomentAreaNormalized + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~MomentAreaNormalized.compute + ~MomentAreaNormalized.getDesiredArea + ~MomentAreaNormalized.getDesiredDepth + ~MomentAreaNormalized.name + ~MomentAreaNormalized.printDependencies + ~MomentAreaNormalized.setDesiredArea + ~MomentAreaNormalized.setDesiredDepth + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~MomentAreaNormalized.update + ~MomentAreaNormalized.linkTo + ~MomentAreaNormalized.get + ~MomentAreaNormalized.getObject + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~MomentAreaNormalized.__doc__ + ~MomentAreaNormalized.__init__ + ~MomentAreaNormalized.__module__ + ~MomentAreaNormalized.__repr__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.MomentBasic.rst b/modules/python/doc/_autosummary/visp.core.MomentBasic.rst new file mode 100644 index 0000000000..0042ea2a28 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.MomentBasic.rst @@ -0,0 +1,56 @@ +MomentBasic +=========== + +.. currentmodule:: visp.core + +.. autoclass:: MomentBasic + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~MomentBasic.compute + ~MomentBasic.get + ~MomentBasic.name + ~MomentBasic.printDependencies + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~MomentBasic.update + ~MomentBasic.linkTo + ~MomentBasic.getObject + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~MomentBasic.__doc__ + ~MomentBasic.__init__ + ~MomentBasic.__module__ + ~MomentBasic.__repr__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.MomentCInvariant.rst b/modules/python/doc/_autosummary/visp.core.MomentCInvariant.rst new file mode 100644 index 0000000000..7018be8691 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.MomentCInvariant.rst @@ -0,0 +1,82 @@ +MomentCInvariant +================ + +.. currentmodule:: visp.core + +.. autoclass:: MomentCInvariant + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~MomentCInvariant.C1 + ~MomentCInvariant.C10 + ~MomentCInvariant.C2 + ~MomentCInvariant.C3 + ~MomentCInvariant.C4 + ~MomentCInvariant.C5 + ~MomentCInvariant.C6 + ~MomentCInvariant.C7 + ~MomentCInvariant.C8 + ~MomentCInvariant.C9 + ~MomentCInvariant.Px + ~MomentCInvariant.Py + ~MomentCInvariant.Sx + ~MomentCInvariant.Sy + ~MomentCInvariant.compute + ~MomentCInvariant.get + ~MomentCInvariant.getC + ~MomentCInvariant.getCN + ~MomentCInvariant.getI + ~MomentCInvariant.getII + ~MomentCInvariant.getIn1 + ~MomentCInvariant.getK + ~MomentCInvariant.getMomentVector + ~MomentCInvariant.getS + ~MomentCInvariant.getSN + ~MomentCInvariant.isSxSyfromNormalizedMoments + ~MomentCInvariant.name + ~MomentCInvariant.printI + ~MomentCInvariant.printInvariants + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~MomentCInvariant.update + ~MomentCInvariant.linkTo + ~MomentCInvariant.printDependencies + ~MomentCInvariant.getObject + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~MomentCInvariant.__doc__ + ~MomentCInvariant.__init__ + ~MomentCInvariant.__module__ + ~MomentCInvariant.__repr__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.MomentCentered.rst b/modules/python/doc/_autosummary/visp.core.MomentCentered.rst new file mode 100644 index 0000000000..501658c49c --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.MomentCentered.rst @@ -0,0 +1,57 @@ +MomentCentered +============== + +.. currentmodule:: visp.core + +.. autoclass:: MomentCentered + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~MomentCentered.compute + ~MomentCentered.get + ~MomentCentered.name + ~MomentCentered.printDependencies + ~MomentCentered.printWithIndices + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~MomentCentered.update + ~MomentCentered.linkTo + ~MomentCentered.getObject + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~MomentCentered.__doc__ + ~MomentCentered.__init__ + ~MomentCentered.__module__ + ~MomentCentered.__repr__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.MomentCommon.rst b/modules/python/doc/_autosummary/visp.core.MomentCommon.rst new file mode 100644 index 0000000000..c20225bfe6 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.MomentCommon.rst @@ -0,0 +1,54 @@ +MomentCommon +============ + +.. currentmodule:: visp.core + +.. autoclass:: MomentCommon + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~MomentCommon.getAlpha + ~MomentCommon.getMu3 + ~MomentCommon.getSurface + ~MomentCommon.updateAll + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~MomentCommon.get + ~MomentCommon.get_first + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~MomentCommon.__doc__ + ~MomentCommon.__init__ + ~MomentCommon.__module__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.MomentDatabase.rst b/modules/python/doc/_autosummary/visp.core.MomentDatabase.rst new file mode 100644 index 0000000000..1754853e73 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.MomentDatabase.rst @@ -0,0 +1,52 @@ +MomentDatabase +============== + +.. currentmodule:: visp.core + +.. autoclass:: MomentDatabase + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~MomentDatabase.get + ~MomentDatabase.get_first + ~MomentDatabase.updateAll + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~MomentDatabase.__doc__ + ~MomentDatabase.__init__ + ~MomentDatabase.__module__ + ~MomentDatabase.__repr__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.MomentGravityCenter.rst b/modules/python/doc/_autosummary/visp.core.MomentGravityCenter.rst new file mode 100644 index 0000000000..38a180a958 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.MomentGravityCenter.rst @@ -0,0 +1,58 @@ +MomentGravityCenter +=================== + +.. currentmodule:: visp.core + +.. autoclass:: MomentGravityCenter + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~MomentGravityCenter.compute + ~MomentGravityCenter.get + ~MomentGravityCenter.getXg + ~MomentGravityCenter.getYg + ~MomentGravityCenter.name + ~MomentGravityCenter.printDependencies + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~MomentGravityCenter.update + ~MomentGravityCenter.linkTo + ~MomentGravityCenter.getObject + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~MomentGravityCenter.__doc__ + ~MomentGravityCenter.__init__ + ~MomentGravityCenter.__module__ + ~MomentGravityCenter.__repr__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.MomentGravityCenterNormalized.rst b/modules/python/doc/_autosummary/visp.core.MomentGravityCenterNormalized.rst new file mode 100644 index 0000000000..db65be838f --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.MomentGravityCenterNormalized.rst @@ -0,0 +1,58 @@ +MomentGravityCenterNormalized +============================= + +.. currentmodule:: visp.core + +.. autoclass:: MomentGravityCenterNormalized + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~MomentGravityCenterNormalized.compute + ~MomentGravityCenterNormalized.name + ~MomentGravityCenterNormalized.printDependencies + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~MomentGravityCenterNormalized.getXg + ~MomentGravityCenterNormalized.update + ~MomentGravityCenterNormalized.linkTo + ~MomentGravityCenterNormalized.getYg + ~MomentGravityCenterNormalized.get + ~MomentGravityCenterNormalized.getObject + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~MomentGravityCenterNormalized.__doc__ + ~MomentGravityCenterNormalized.__init__ + ~MomentGravityCenterNormalized.__module__ + ~MomentGravityCenterNormalized.__repr__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.MomentObject.rst b/modules/python/doc/_autosummary/visp.core.MomentObject.rst new file mode 100644 index 0000000000..8dd949ccdb --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.MomentObject.rst @@ -0,0 +1,69 @@ +MomentObject +============ + +.. currentmodule:: visp.core + +.. autoclass:: MomentObject + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~MomentObject.convertTovpMatrix + ~MomentObject.fromImage + ~MomentObject.fromVector + ~MomentObject.get + ~MomentObject.getOrder + ~MomentObject.getType + ~MomentObject.init + ~MomentObject.printWithIndices + ~MomentObject.setType + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~MomentObject.__doc__ + ~MomentObject.__init__ + ~MomentObject.__module__ + ~MomentObject.__repr__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~MomentObject.BLACK + ~MomentObject.DENSE_FULL_OBJECT + ~MomentObject.DENSE_POLYGON + ~MomentObject.DISCRETE + ~MomentObject.WHITE + ~MomentObject.flg_normalize_intensity + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.MouseButton.rst b/modules/python/doc/_autosummary/visp.core.MouseButton.rst new file mode 100644 index 0000000000..cd33da700c --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.MouseButton.rst @@ -0,0 +1,57 @@ +MouseButton +=========== + +.. currentmodule:: visp.core + +.. autoclass:: MouseButton + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~MouseButton.__doc__ + ~MouseButton.__init__ + ~MouseButton.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~MouseButton.button1 + ~MouseButton.button2 + ~MouseButton.button3 + ~MouseButton.none + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.Munkres.rst b/modules/python/doc/_autosummary/visp.core.Munkres.rst new file mode 100644 index 0000000000..9d4acf0221 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.Munkres.rst @@ -0,0 +1,48 @@ +Munkres +======= + +.. currentmodule:: visp.core + +.. autoclass:: Munkres + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~Munkres.__doc__ + ~Munkres.__init__ + ~Munkres.__module__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.Mutex.rst b/modules/python/doc/_autosummary/visp.core.Mutex.rst new file mode 100644 index 0000000000..a53d088516 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.Mutex.rst @@ -0,0 +1,50 @@ +Mutex +===== + +.. currentmodule:: visp.core + +.. autoclass:: Mutex + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~Mutex.lock + ~Mutex.unlock + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~Mutex.__doc__ + ~Mutex.__init__ + ~Mutex.__module__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.Network.rst b/modules/python/doc/_autosummary/visp.core.Network.rst new file mode 100644 index 0000000000..895da04502 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.Network.rst @@ -0,0 +1,69 @@ +Network +======= + +.. currentmodule:: visp.core + +.. autoclass:: Network + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~Network.getMaxSizeReceivedMessage + ~Network.getReceptorIndex + ~Network.getRequestIdFromIndex + ~Network.print + ~Network.receiveAndDecodeRequest + ~Network.receiveAndDecodeRequestFrom + ~Network.receiveAndDecodeRequestOnce + ~Network.receiveAndDecodeRequestOnceFrom + ~Network.receiveRequest + ~Network.receiveRequestFrom + ~Network.receiveRequestOnce + ~Network.receiveRequestOnceFrom + ~Network.removeDecodingRequest + ~Network.sendAndEncodeRequest + ~Network.sendAndEncodeRequestTo + ~Network.sendRequest + ~Network.sendRequestTo + ~Network.setMaxSizeReceivedMessage + ~Network.setTimeoutSec + ~Network.setTimeoutUSec + ~Network.setVerbose + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~Network.__doc__ + ~Network.__init__ + ~Network.__module__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.PixelMeterConversion.rst b/modules/python/doc/_autosummary/visp.core.PixelMeterConversion.rst new file mode 100644 index 0000000000..e9547e7c25 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.PixelMeterConversion.rst @@ -0,0 +1,53 @@ +PixelMeterConversion +==================== + +.. currentmodule:: visp.core + +.. autoclass:: PixelMeterConversion + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~PixelMeterConversion.convertEllipse + ~PixelMeterConversion.convertLine + ~PixelMeterConversion.convertMoment + ~PixelMeterConversion.convertPoint + ~PixelMeterConversion.convertPoints + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~PixelMeterConversion.__doc__ + ~PixelMeterConversion.__init__ + ~PixelMeterConversion.__module__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.Plane.rst b/modules/python/doc/_autosummary/visp.core.Plane.rst new file mode 100644 index 0000000000..773527022d --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.Plane.rst @@ -0,0 +1,74 @@ +Plane +===== + +.. currentmodule:: visp.core + +.. autoclass:: Plane + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~Plane.abcd + ~Plane.changeFrame + ~Plane.computeZ + ~Plane.getA + ~Plane.getABCD + ~Plane.getB + ~Plane.getC + ~Plane.getD + ~Plane.getIntersection + ~Plane.getNormal + ~Plane.init + ~Plane.projectionPointOnPlan + ~Plane.rayIntersection + ~Plane.setA + ~Plane.setABCD + ~Plane.setB + ~Plane.setC + ~Plane.setD + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~Plane.__doc__ + ~Plane.__init__ + ~Plane.__module__ + ~Plane.__repr__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~Plane.camera_frame + ~Plane.object_frame + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.Point.rst b/modules/python/doc/_autosummary/visp.core.Point.rst new file mode 100644 index 0000000000..d694520169 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.Point.rst @@ -0,0 +1,102 @@ +Point +===== + +.. currentmodule:: visp.core + +.. autoclass:: Point + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~Point.changeFrame + ~Point.display + ~Point.getWorldCoordinates + ~Point.get_W + ~Point.get_X + ~Point.get_Y + ~Point.get_Z + ~Point.get_oW + ~Point.get_oX + ~Point.get_oY + ~Point.get_oZ + ~Point.get_w + ~Point.get_x + ~Point.get_y + ~Point.projection + ~Point.setWorldCoordinates + ~Point.set_W + ~Point.set_X + ~Point.set_Y + ~Point.set_Z + ~Point.set_oW + ~Point.set_oX + ~Point.set_oY + ~Point.set_oZ + ~Point.set_w + ~Point.set_x + ~Point.set_y + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~Point.cPAvailable + ~Point.user + ~Point.track + ~Point.getDeallocate + ~Point.get_cP + ~Point.project + ~Point.ForwardProjectionDeallocatorType + ~Point.print + ~Point.get_p + ~Point.setDeallocate + ~Point.cP + ~Point.vpDisplayForwardProjection + ~Point.p + ~Point.get_oP + ~Point.oP + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~Point.__doc__ + ~Point.__init__ + ~Point.__module__ + ~Point.__repr__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~Point.cP + ~Point.cPAvailable + ~Point.oP + ~Point.p + ~Point.user + ~Point.vpDisplayForwardProjection + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.Polygon.rst b/modules/python/doc/_autosummary/visp.core.Polygon.rst new file mode 100644 index 0000000000..671fbeab84 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.Polygon.rst @@ -0,0 +1,65 @@ +Polygon +======= + +.. currentmodule:: visp.core + +.. autoclass:: Polygon + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~Polygon.buildFrom + ~Polygon.display + ~Polygon.getArea + ~Polygon.getBoundingBox + ~Polygon.getCenter + ~Polygon.getCorners + ~Polygon.getSize + ~Polygon.initClick + ~Polygon.isInside + ~Polygon.isInsideFromPoints + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~Polygon.__doc__ + ~Polygon.__init__ + ~Polygon.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~Polygon.PnPolyRayCasting + ~Polygon.PnPolySegmentIntersection + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.Polygon3D.rst b/modules/python/doc/_autosummary/visp.core.Polygon3D.rst new file mode 100644 index 0000000000..e2c250c2bc --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.Polygon3D.rst @@ -0,0 +1,89 @@ +Polygon3D +========= + +.. currentmodule:: visp.core + +.. autoclass:: Polygon3D + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~Polygon3D.addPoint + ~Polygon3D.changeFrame + ~Polygon3D.computePolygonClipped + ~Polygon3D.getClippedPolygon + ~Polygon3D.getClipping + ~Polygon3D.getFarClippingDistance + ~Polygon3D.getMinMaxRoi + ~Polygon3D.getNbCornerInsideImage + ~Polygon3D.getNbCornerInsidePrevImage + ~Polygon3D.getNbPoint + ~Polygon3D.getNearClippingDistance + ~Polygon3D.getPoint + ~Polygon3D.getPolygonClipped + ~Polygon3D.getPolygonClippedWithInfo + ~Polygon3D.getRoi + ~Polygon3D.getRoiClipped + ~Polygon3D.roiInsideImage + ~Polygon3D.setClipping + ~Polygon3D.setFarClippingDistance + ~Polygon3D.setNbPoint + ~Polygon3D.setNearClippingDistance + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~Polygon3D.__doc__ + ~Polygon3D.__init__ + ~Polygon3D.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~Polygon3D.ALL_CLIPPING + ~Polygon3D.DOWN_CLIPPING + ~Polygon3D.FAR_CLIPPING + ~Polygon3D.FOV_CLIPPING + ~Polygon3D.LEFT_CLIPPING + ~Polygon3D.NEAR_CLIPPING + ~Polygon3D.NO_CLIPPING + ~Polygon3D.RIGHT_CLIPPING + ~Polygon3D.UP_CLIPPING + ~Polygon3D.clippingFlag + ~Polygon3D.distFarClip + ~Polygon3D.distNearClip + ~Polygon3D.nbCornersInsidePrev + ~Polygon3D.nbpt + ~Polygon3D.polyClipped + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.PoseVector.rst b/modules/python/doc/_autosummary/visp.core.PoseVector.rst new file mode 100644 index 0000000000..da0a7aec47 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.PoseVector.rst @@ -0,0 +1,78 @@ +PoseVector +========== + +.. currentmodule:: visp.core + +.. autoclass:: PoseVector + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~PoseVector.buildFrom + ~PoseVector.extract + ~PoseVector.getRotationMatrix + ~PoseVector.getThetaUVector + ~PoseVector.getTranslationVector + ~PoseVector.load + ~PoseVector.print + ~PoseVector.resize + ~PoseVector.save + ~PoseVector.set + ~PoseVector.t + ~PoseVector.toStdVector + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~PoseVector.insertStatic + ~PoseVector.getMaxValue + ~PoseVector.size + ~PoseVector.hadamard + ~PoseVector.insert + ~PoseVector.getCols + ~PoseVector.getMinValue + ~PoseVector.numpy + ~PoseVector.reshape + ~PoseVector.conv2 + ~PoseVector.saveYAML + ~PoseVector.getRows + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~PoseVector.__doc__ + ~PoseVector.__init__ + ~PoseVector.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~PoseVector.jsonTypeName + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.QuadProg.rst b/modules/python/doc/_autosummary/visp.core.QuadProg.rst new file mode 100644 index 0000000000..00ad768e7a --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.QuadProg.rst @@ -0,0 +1,55 @@ +QuadProg +======== + +.. currentmodule:: visp.core + +.. autoclass:: QuadProg + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~QuadProg.fromCanonicalCost + ~QuadProg.resetActiveSet + ~QuadProg.setEqualityConstraint + ~QuadProg.solveQP + ~QuadProg.solveQPe + ~QuadProg.solveQPeStatic + ~QuadProg.solveQPi + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~QuadProg.__doc__ + ~QuadProg.__init__ + ~QuadProg.__module__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.QuaternionVector.rst b/modules/python/doc/_autosummary/visp.core.QuaternionVector.rst new file mode 100644 index 0000000000..bfe31396f7 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.QuaternionVector.rst @@ -0,0 +1,84 @@ +QuaternionVector +================ + +.. currentmodule:: visp.core + +.. autoclass:: QuaternionVector + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~QuaternionVector.buildFrom + ~QuaternionVector.conjugate + ~QuaternionVector.dot + ~QuaternionVector.inverse + ~QuaternionVector.lerp + ~QuaternionVector.magnitude + ~QuaternionVector.nlerp + ~QuaternionVector.normalize + ~QuaternionVector.set + ~QuaternionVector.slerp + ~QuaternionVector.w + ~QuaternionVector.x + ~QuaternionVector.y + ~QuaternionVector.z + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~QuaternionVector.insertStatic + ~QuaternionVector.getMaxValue + ~QuaternionVector.sumSquare + ~QuaternionVector.t + ~QuaternionVector.save + ~QuaternionVector.size + ~QuaternionVector.hadamard + ~QuaternionVector.insert + ~QuaternionVector.getCols + ~QuaternionVector.getMinValue + ~QuaternionVector.numpy + ~QuaternionVector.reshape + ~QuaternionVector.resize + ~QuaternionVector.conv2 + ~QuaternionVector.toStdVector + ~QuaternionVector.saveYAML + ~QuaternionVector.getRows + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~QuaternionVector.__add__ + ~QuaternionVector.__doc__ + ~QuaternionVector.__init__ + ~QuaternionVector.__module__ + ~QuaternionVector.__mul__ + ~QuaternionVector.__neg__ + ~QuaternionVector.__sub__ + ~QuaternionVector.__truediv__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.RGBa.rst b/modules/python/doc/_autosummary/visp.core.RGBa.rst new file mode 100644 index 0000000000..c43ef4470f --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.RGBa.rst @@ -0,0 +1,67 @@ +RGBa +==== + +.. currentmodule:: visp.core + +.. autoclass:: RGBa + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~RGBa.__add__ + ~RGBa.__doc__ + ~RGBa.__eq__ + ~RGBa.__gt__ + ~RGBa.__hash__ + ~RGBa.__init__ + ~RGBa.__lt__ + ~RGBa.__module__ + ~RGBa.__mul__ + ~RGBa.__ne__ + ~RGBa.__repr__ + ~RGBa.__sub__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~RGBa.A + ~RGBa.B + ~RGBa.G + ~RGBa.R + ~RGBa.alpha_default + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.RGBf.rst b/modules/python/doc/_autosummary/visp.core.RGBf.rst new file mode 100644 index 0000000000..9799663a35 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.RGBf.rst @@ -0,0 +1,65 @@ +RGBf +==== + +.. currentmodule:: visp.core + +.. autoclass:: RGBf + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~RGBf.__add__ + ~RGBf.__doc__ + ~RGBf.__eq__ + ~RGBf.__gt__ + ~RGBf.__hash__ + ~RGBf.__init__ + ~RGBf.__lt__ + ~RGBf.__module__ + ~RGBf.__mul__ + ~RGBf.__ne__ + ~RGBf.__repr__ + ~RGBf.__sub__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~RGBf.B + ~RGBf.G + ~RGBf.R + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.Rect.rst b/modules/python/doc/_autosummary/visp.core.Rect.rst new file mode 100644 index 0000000000..0d27a830a7 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.Rect.rst @@ -0,0 +1,78 @@ +Rect +==== + +.. currentmodule:: visp.core + +.. autoclass:: Rect + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~Rect.getArea + ~Rect.getBottom + ~Rect.getBottomLeft + ~Rect.getBottomRight + ~Rect.getCenter + ~Rect.getHeight + ~Rect.getLeft + ~Rect.getRight + ~Rect.getSize + ~Rect.getTop + ~Rect.getTopLeft + ~Rect.getTopRight + ~Rect.getWidth + ~Rect.isInside + ~Rect.moveCenter + ~Rect.set + ~Rect.setBottom + ~Rect.setBottomRight + ~Rect.setHeight + ~Rect.setLeft + ~Rect.setRect + ~Rect.setRight + ~Rect.setTop + ~Rect.setTopLeft + ~Rect.setWidth + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~Rect.__and__ + ~Rect.__doc__ + ~Rect.__eq__ + ~Rect.__hash__ + ~Rect.__init__ + ~Rect.__module__ + ~Rect.__ne__ + ~Rect.__repr__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.RectOriented.rst b/modules/python/doc/_autosummary/visp.core.RectOriented.rst new file mode 100644 index 0000000000..bfa8c2a631 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.RectOriented.rst @@ -0,0 +1,61 @@ +RectOriented +============ + +.. currentmodule:: visp.core + +.. autoclass:: RectOriented + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~RectOriented.getBottomLeft + ~RectOriented.getBottomRight + ~RectOriented.getCenter + ~RectOriented.getHeight + ~RectOriented.getOrientation + ~RectOriented.getTopLeft + ~RectOriented.getTopRight + ~RectOriented.getWidth + ~RectOriented.isInside + ~RectOriented.setCenter + ~RectOriented.setOrientation + ~RectOriented.setPoints + ~RectOriented.setSize + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~RectOriented.__doc__ + ~RectOriented.__init__ + ~RectOriented.__module__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.Request.rst b/modules/python/doc/_autosummary/visp.core.Request.rst new file mode 100644 index 0000000000..04013603fe --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.Request.rst @@ -0,0 +1,53 @@ +Request +======= + +.. currentmodule:: visp.core + +.. autoclass:: Request + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~Request.addParameter + ~Request.clear + ~Request.getId + ~Request.setId + ~Request.size + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~Request.__doc__ + ~Request.__init__ + ~Request.__module__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.Robust.rst b/modules/python/doc/_autosummary/visp.core.Robust.rst new file mode 100644 index 0000000000..07ad9a2a09 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.Robust.rst @@ -0,0 +1,60 @@ +Robust +====== + +.. currentmodule:: visp.core + +.. autoclass:: Robust + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~Robust.MEstimator + ~Robust.getMedianAbsoluteDeviation + ~Robust.getMinMedianAbsoluteDeviation + ~Robust.setMinMedianAbsoluteDeviation + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~Robust.__doc__ + ~Robust.__init__ + ~Robust.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~Robust.CAUCHY + ~Robust.HUBER + ~Robust.TUKEY + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.RotationMatrix.rst b/modules/python/doc/_autosummary/visp.core.RotationMatrix.rst new file mode 100644 index 0000000000..0ec3b793f1 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.RotationMatrix.rst @@ -0,0 +1,75 @@ +RotationMatrix +============== + +.. currentmodule:: visp.core + +.. autoclass:: RotationMatrix + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~RotationMatrix.buildFrom + ~RotationMatrix.eye + ~RotationMatrix.getCol + ~RotationMatrix.getThetaUVector + ~RotationMatrix.inverse + ~RotationMatrix.isARotationMatrix + ~RotationMatrix.mean + ~RotationMatrix.numpy + ~RotationMatrix.orthogonalize + ~RotationMatrix.printVector + ~RotationMatrix.resize + ~RotationMatrix.t + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~RotationMatrix.insertStatic + ~RotationMatrix.getMaxValue + ~RotationMatrix.save + ~RotationMatrix.size + ~RotationMatrix.hadamard + ~RotationMatrix.insert + ~RotationMatrix.getCols + ~RotationMatrix.getMinValue + ~RotationMatrix.reshape + ~RotationMatrix.conv2 + ~RotationMatrix.saveYAML + ~RotationMatrix.getRows + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~RotationMatrix.__doc__ + ~RotationMatrix.__getitem__ + ~RotationMatrix.__imul__ + ~RotationMatrix.__init__ + ~RotationMatrix.__module__ + ~RotationMatrix.__mul__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.RotationVector.rst b/modules/python/doc/_autosummary/visp.core.RotationVector.rst new file mode 100644 index 0000000000..10daa4c18a --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.RotationVector.rst @@ -0,0 +1,66 @@ +RotationVector +============== + +.. currentmodule:: visp.core + +.. autoclass:: RotationVector + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~RotationVector.sumSquare + ~RotationVector.t + ~RotationVector.toStdVector + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~RotationVector.insertStatic + ~RotationVector.getMaxValue + ~RotationVector.save + ~RotationVector.size + ~RotationVector.hadamard + ~RotationVector.insert + ~RotationVector.getCols + ~RotationVector.getMinValue + ~RotationVector.numpy + ~RotationVector.reshape + ~RotationVector.resize + ~RotationVector.conv2 + ~RotationVector.saveYAML + ~RotationVector.getRows + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~RotationVector.__doc__ + ~RotationVector.__init__ + ~RotationVector.__module__ + ~RotationVector.__mul__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.RowVector.rst b/modules/python/doc/_autosummary/visp.core.RowVector.rst new file mode 100644 index 0000000000..ee48f9910a --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.RowVector.rst @@ -0,0 +1,97 @@ +RowVector +========= + +.. currentmodule:: visp.core + +.. autoclass:: RowVector + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~RowVector.clear + ~RowVector.cppPrint + ~RowVector.csvPrint + ~RowVector.deg2rad + ~RowVector.extract + ~RowVector.frobeniusNorm + ~RowVector.init + ~RowVector.insert + ~RowVector.maplePrint + ~RowVector.matlabPrint + ~RowVector.mean + ~RowVector.median + ~RowVector.normalize + ~RowVector.numpy + ~RowVector.print + ~RowVector.rad2deg + ~RowVector.reshape + ~RowVector.resize + ~RowVector.stack + ~RowVector.stackVectors + ~RowVector.stdev + ~RowVector.sum + ~RowVector.sumSquare + ~RowVector.t + ~RowVector.toStdVector + ~RowVector.transpose + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~RowVector.insertStatic + ~RowVector.getMaxValue + ~RowVector.save + ~RowVector.size + ~RowVector.hadamard + ~RowVector.getCols + ~RowVector.getMinValue + ~RowVector.conv2 + ~RowVector.saveYAML + ~RowVector.getRows + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~RowVector.__add__ + ~RowVector.__doc__ + ~RowVector.__eq__ + ~RowVector.__getitem__ + ~RowVector.__hash__ + ~RowVector.__iadd__ + ~RowVector.__imul__ + ~RowVector.__init__ + ~RowVector.__isub__ + ~RowVector.__itruediv__ + ~RowVector.__module__ + ~RowVector.__mul__ + ~RowVector.__ne__ + ~RowVector.__neg__ + ~RowVector.__sub__ + ~RowVector.__truediv__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.RxyzVector.rst b/modules/python/doc/_autosummary/visp.core.RxyzVector.rst new file mode 100644 index 0000000000..68735a0c51 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.RxyzVector.rst @@ -0,0 +1,66 @@ +RxyzVector +========== + +.. currentmodule:: visp.core + +.. autoclass:: RxyzVector + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~RxyzVector.buildFrom + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~RxyzVector.insertStatic + ~RxyzVector.getMaxValue + ~RxyzVector.sumSquare + ~RxyzVector.t + ~RxyzVector.save + ~RxyzVector.size + ~RxyzVector.hadamard + ~RxyzVector.insert + ~RxyzVector.getCols + ~RxyzVector.getMinValue + ~RxyzVector.numpy + ~RxyzVector.reshape + ~RxyzVector.resize + ~RxyzVector.conv2 + ~RxyzVector.toStdVector + ~RxyzVector.saveYAML + ~RxyzVector.getRows + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~RxyzVector.__doc__ + ~RxyzVector.__init__ + ~RxyzVector.__module__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.RzyxVector.rst b/modules/python/doc/_autosummary/visp.core.RzyxVector.rst new file mode 100644 index 0000000000..e38d68f3ed --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.RzyxVector.rst @@ -0,0 +1,66 @@ +RzyxVector +========== + +.. currentmodule:: visp.core + +.. autoclass:: RzyxVector + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~RzyxVector.buildFrom + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~RzyxVector.insertStatic + ~RzyxVector.getMaxValue + ~RzyxVector.sumSquare + ~RzyxVector.t + ~RzyxVector.save + ~RzyxVector.size + ~RzyxVector.hadamard + ~RzyxVector.insert + ~RzyxVector.getCols + ~RzyxVector.getMinValue + ~RzyxVector.numpy + ~RzyxVector.reshape + ~RzyxVector.resize + ~RzyxVector.conv2 + ~RzyxVector.toStdVector + ~RzyxVector.saveYAML + ~RzyxVector.getRows + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~RzyxVector.__doc__ + ~RzyxVector.__init__ + ~RzyxVector.__module__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.RzyzVector.rst b/modules/python/doc/_autosummary/visp.core.RzyzVector.rst new file mode 100644 index 0000000000..b325714cb8 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.RzyzVector.rst @@ -0,0 +1,66 @@ +RzyzVector +========== + +.. currentmodule:: visp.core + +.. autoclass:: RzyzVector + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~RzyzVector.buildFrom + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~RzyzVector.insertStatic + ~RzyzVector.getMaxValue + ~RzyzVector.sumSquare + ~RzyzVector.t + ~RzyzVector.save + ~RzyzVector.size + ~RzyzVector.hadamard + ~RzyzVector.insert + ~RzyzVector.getCols + ~RzyzVector.getMinValue + ~RzyzVector.numpy + ~RzyzVector.reshape + ~RzyzVector.resize + ~RzyzVector.conv2 + ~RzyzVector.toStdVector + ~RzyzVector.saveYAML + ~RzyzVector.getRows + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~RzyzVector.__doc__ + ~RzyzVector.__init__ + ~RzyzVector.__module__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.Scale.rst b/modules/python/doc/_autosummary/visp.core.Scale.rst new file mode 100644 index 0000000000..35fbdb0bba --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.Scale.rst @@ -0,0 +1,53 @@ +Scale +===== + +.. currentmodule:: visp.core + +.. autoclass:: Scale + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~Scale.KernelDensity + ~Scale.KernelDensityGradient + ~Scale.KernelDensityGradient_EPANECHNIKOV + ~Scale.KernelDensity_EPANECHNIKOV + ~Scale.MeanShift + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~Scale.__doc__ + ~Scale.__init__ + ~Scale.__module__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.Serial.rst b/modules/python/doc/_autosummary/visp.core.Serial.rst new file mode 100644 index 0000000000..80861ad766 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.Serial.rst @@ -0,0 +1,82 @@ +Serial +====== + +.. currentmodule:: visp.core + +.. autoclass:: Serial + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~Serial.available + ~Serial.close + ~Serial.getBaudrate + ~Serial.getBytesize + ~Serial.getFlowcontrol + ~Serial.getParity + ~Serial.getPort + ~Serial.getStopbits + ~Serial.open + ~Serial.readline + ~Serial.setBaudrate + ~Serial.setBytesize + ~Serial.setFlowcontrol + ~Serial.setParity + ~Serial.setPort + ~Serial.setStopbits + ~Serial.write + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~Serial.__doc__ + ~Serial.__init__ + ~Serial.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~Serial.eightbits + ~Serial.fivebits + ~Serial.flowcontrol_hardware + ~Serial.flowcontrol_none + ~Serial.flowcontrol_software + ~Serial.parity_even + ~Serial.parity_none + ~Serial.parity_odd + ~Serial.sevenbits + ~Serial.sixbits + ~Serial.stopbits_one + ~Serial.stopbits_two + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.Server.rst b/modules/python/doc/_autosummary/visp.core.Server.rst new file mode 100644 index 0000000000..fe0cea8531 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.Server.rst @@ -0,0 +1,75 @@ +Server +====== + +.. currentmodule:: visp.core + +.. autoclass:: Server + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~Server.checkForConnections + ~Server.getMaxNumberOfClients + ~Server.getNumberOfClients + ~Server.isStarted + ~Server.print + ~Server.setMaxNumberOfClients + ~Server.start + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~Server.removeDecodingRequest + ~Server.setMaxSizeReceivedMessage + ~Server.receiveRequestFrom + ~Server.receiveAndDecodeRequestFrom + ~Server.setTimeoutUSec + ~Server.getRequestIdFromIndex + ~Server.receiveRequest + ~Server.setVerbose + ~Server.sendRequestTo + ~Server.receiveAndDecodeRequestOnce + ~Server.receiveRequestOnceFrom + ~Server.sendRequest + ~Server.getReceptorIndex + ~Server.setTimeoutSec + ~Server.getMaxSizeReceivedMessage + ~Server.sendAndEncodeRequest + ~Server.receiveAndDecodeRequest + ~Server.receiveRequestOnce + ~Server.sendAndEncodeRequestTo + ~Server.receiveAndDecodeRequestOnceFrom + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~Server.__doc__ + ~Server.__init__ + ~Server.__module__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.Sphere.rst b/modules/python/doc/_autosummary/visp.core.Sphere.rst new file mode 100644 index 0000000000..3652186176 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.Sphere.rst @@ -0,0 +1,87 @@ +Sphere +====== + +.. currentmodule:: visp.core + +.. autoclass:: Sphere + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~Sphere.changeFrame + ~Sphere.display + ~Sphere.getR + ~Sphere.getX + ~Sphere.getY + ~Sphere.getZ + ~Sphere.get_n02 + ~Sphere.get_n11 + ~Sphere.get_n20 + ~Sphere.get_x + ~Sphere.get_y + ~Sphere.projection + ~Sphere.setWorldCoordinates + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~Sphere.cPAvailable + ~Sphere.user + ~Sphere.track + ~Sphere.getDeallocate + ~Sphere.get_cP + ~Sphere.project + ~Sphere.ForwardProjectionDeallocatorType + ~Sphere.print + ~Sphere.get_p + ~Sphere.setDeallocate + ~Sphere.cP + ~Sphere.vpDisplayForwardProjection + ~Sphere.p + ~Sphere.get_oP + ~Sphere.oP + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~Sphere.__doc__ + ~Sphere.__init__ + ~Sphere.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~Sphere.cP + ~Sphere.cPAvailable + ~Sphere.oP + ~Sphere.p + ~Sphere.user + ~Sphere.vpDisplayForwardProjection + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.SubColVector.rst b/modules/python/doc/_autosummary/visp.core.SubColVector.rst new file mode 100644 index 0000000000..4a36629e62 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.SubColVector.rst @@ -0,0 +1,92 @@ +SubColVector +============ + +.. currentmodule:: visp.core + +.. autoclass:: SubColVector + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~SubColVector.checkParentStatus + ~SubColVector.init + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~SubColVector.insertStatic + ~SubColVector.median + ~SubColVector.invSort + ~SubColVector.matlabPrint + ~SubColVector.sumSquare + ~SubColVector.transpose + ~SubColVector.t + ~SubColVector.deg2rad + ~SubColVector.size + ~SubColVector.rad2deg + ~SubColVector.insert + ~SubColVector.getCols + ~SubColVector.getMinValue + ~SubColVector.reshape + ~SubColVector.resize + ~SubColVector.toStdVector + ~SubColVector.crossProd + ~SubColVector.sort + ~SubColVector.skew + ~SubColVector.print + ~SubColVector.getRows + ~SubColVector.cppPrint + ~SubColVector.dotProd + ~SubColVector.stackVectors + ~SubColVector.getMaxValue + ~SubColVector.infinityNorm + ~SubColVector.frobeniusNorm + ~SubColVector.maplePrint + ~SubColVector.mean + ~SubColVector.cross + ~SubColVector.stdev + ~SubColVector.save + ~SubColVector.clear + ~SubColVector.hadamard + ~SubColVector.csvPrint + ~SubColVector.stack + ~SubColVector.numpy + ~SubColVector.conv2 + ~SubColVector.normalize + ~SubColVector.saveYAML + ~SubColVector.sum + ~SubColVector.extract + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~SubColVector.__doc__ + ~SubColVector.__init__ + ~SubColVector.__module__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.SubMatrix.rst b/modules/python/doc/_autosummary/visp.core.SubMatrix.rst new file mode 100644 index 0000000000..bea7c44ed1 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.SubMatrix.rst @@ -0,0 +1,150 @@ +SubMatrix +========= + +.. currentmodule:: visp.core + +.. autoclass:: SubMatrix + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~SubMatrix.checkParentStatus + ~SubMatrix.init + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~SubMatrix.det + ~SubMatrix.inverseByCholesky + ~SubMatrix.detByLUOpenCV + ~SubMatrix.matlabPrint + ~SubMatrix.sumSquare + ~SubMatrix.detByLU + ~SubMatrix.printSize + ~SubMatrix.t + ~SubMatrix.insertMatrixInMatrix + ~SubMatrix.pseudoInverseOpenCV + ~SubMatrix.getRow + ~SubMatrix.inducedL2Norm + ~SubMatrix.cond + ~SubMatrix.eye + ~SubMatrix.juxtaposeMatrices + ~SubMatrix.pseudoInverseEigen3 + ~SubMatrix.getCols + ~SubMatrix.getMinValue + ~SubMatrix.inverseTriangular + ~SubMatrix.multMatrixVector + ~SubMatrix.getCol + ~SubMatrix.resize + ~SubMatrix.inverseByCholeskyOpenCV + ~SubMatrix.getRows + ~SubMatrix.cppPrint + ~SubMatrix.stackMatrices + ~SubMatrix.computeCovarianceMatrix + ~SubMatrix.getMaxValue + ~SubMatrix.inverseByLUEigen3 + ~SubMatrix.frobeniusNorm + ~SubMatrix.maplePrint + ~SubMatrix.AAt + ~SubMatrix.clear + ~SubMatrix.sub2Matrices + ~SubMatrix.stack + ~SubMatrix.stackColumn + ~SubMatrix.qrPivot + ~SubMatrix.inverseByCholeskyLapack + ~SubMatrix.conv2 + ~SubMatrix.getDiag + ~SubMatrix.DetMethod + ~SubMatrix.stackRow + ~SubMatrix.negateMatrix + ~SubMatrix.stackColumns + ~SubMatrix.sum + ~SubMatrix.extract + ~SubMatrix.add2Matrices + ~SubMatrix.kronStatic + ~SubMatrix.insertStatic + ~SubMatrix.svdLapack + ~SubMatrix.qr + ~SubMatrix.AtA + ~SubMatrix.getLapackMatrixMinSize + ~SubMatrix.transpose + ~SubMatrix.setLapackMatrixMinSize + ~SubMatrix.inverseByLUOpenCV + ~SubMatrix.size + ~SubMatrix.inverseByLU + ~SubMatrix.insert + ~SubMatrix.inverseByQR + ~SubMatrix.kron + ~SubMatrix.solveByQR + ~SubMatrix.kernel + ~SubMatrix.reshape + ~SubMatrix.saveMatrixYAML + ~SubMatrix.print + ~SubMatrix.svd + ~SubMatrix.solveBySVD + ~SubMatrix.pseudoInverseLapack + ~SubMatrix.expm + ~SubMatrix.computeHLM + ~SubMatrix.pseudoInverse + ~SubMatrix.add2WeightedMatrices + ~SubMatrix.infinityNorm + ~SubMatrix.detByLULapack + ~SubMatrix.detByLUEigen3 + ~SubMatrix.saveMatrix + ~SubMatrix.LU_DECOMPOSITION + ~SubMatrix.nullSpace + ~SubMatrix.stackRows + ~SubMatrix.save + ~SubMatrix.svdOpenCV + ~SubMatrix.mult2Matrices + ~SubMatrix.hadamard + ~SubMatrix.csvPrint + ~SubMatrix.diag + ~SubMatrix.numpy + ~SubMatrix.svdEigen3 + ~SubMatrix.saveYAML + ~SubMatrix.eigenValues + ~SubMatrix.inverseByQRLapack + ~SubMatrix.inverseByLULapack + ~SubMatrix.computeCovarianceMatrixVVS + ~SubMatrix.createDiagonalMatrix + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~SubMatrix.__doc__ + ~SubMatrix.__init__ + ~SubMatrix.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~SubMatrix.LU_DECOMPOSITION + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.SubRowVector.rst b/modules/python/doc/_autosummary/visp.core.SubRowVector.rst new file mode 100644 index 0000000000..22e15c9509 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.SubRowVector.rst @@ -0,0 +1,85 @@ +SubRowVector +============ + +.. currentmodule:: visp.core + +.. autoclass:: SubRowVector + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~SubRowVector.checkParentStatus + ~SubRowVector.init + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~SubRowVector.insertStatic + ~SubRowVector.median + ~SubRowVector.matlabPrint + ~SubRowVector.sumSquare + ~SubRowVector.transpose + ~SubRowVector.t + ~SubRowVector.deg2rad + ~SubRowVector.size + ~SubRowVector.rad2deg + ~SubRowVector.insert + ~SubRowVector.getCols + ~SubRowVector.getMinValue + ~SubRowVector.reshape + ~SubRowVector.resize + ~SubRowVector.toStdVector + ~SubRowVector.print + ~SubRowVector.getRows + ~SubRowVector.cppPrint + ~SubRowVector.stackVectors + ~SubRowVector.getMaxValue + ~SubRowVector.frobeniusNorm + ~SubRowVector.maplePrint + ~SubRowVector.mean + ~SubRowVector.stdev + ~SubRowVector.save + ~SubRowVector.clear + ~SubRowVector.hadamard + ~SubRowVector.csvPrint + ~SubRowVector.stack + ~SubRowVector.numpy + ~SubRowVector.conv2 + ~SubRowVector.normalize + ~SubRowVector.saveYAML + ~SubRowVector.sum + ~SubRowVector.extract + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~SubRowVector.__doc__ + ~SubRowVector.__init__ + ~SubRowVector.__module__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.ThetaUVector.rst b/modules/python/doc/_autosummary/visp.core.ThetaUVector.rst new file mode 100644 index 0000000000..990c8cec8b --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.ThetaUVector.rst @@ -0,0 +1,70 @@ +ThetaUVector +============ + +.. currentmodule:: visp.core + +.. autoclass:: ThetaUVector + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~ThetaUVector.buildFrom + ~ThetaUVector.extract + ~ThetaUVector.getTheta + ~ThetaUVector.getU + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~ThetaUVector.insertStatic + ~ThetaUVector.getMaxValue + ~ThetaUVector.sumSquare + ~ThetaUVector.t + ~ThetaUVector.save + ~ThetaUVector.size + ~ThetaUVector.hadamard + ~ThetaUVector.insert + ~ThetaUVector.getCols + ~ThetaUVector.getMinValue + ~ThetaUVector.numpy + ~ThetaUVector.reshape + ~ThetaUVector.resize + ~ThetaUVector.conv2 + ~ThetaUVector.toStdVector + ~ThetaUVector.saveYAML + ~ThetaUVector.getRows + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~ThetaUVector.__doc__ + ~ThetaUVector.__init__ + ~ThetaUVector.__module__ + ~ThetaUVector.__mul__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.Thread.rst b/modules/python/doc/_autosummary/visp.core.Thread.rst new file mode 100644 index 0000000000..911b75b46f --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.Thread.rst @@ -0,0 +1,52 @@ +Thread +====== + +.. currentmodule:: visp.core + +.. autoclass:: Thread + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~Thread.create + ~Thread.getHandle + ~Thread.join + ~Thread.joinable + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~Thread.__doc__ + ~Thread.__init__ + ~Thread.__module__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.Tracker.rst b/modules/python/doc/_autosummary/visp.core.Tracker.rst new file mode 100644 index 0000000000..2de9d9d4dd --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.Tracker.rst @@ -0,0 +1,58 @@ +Tracker +======= + +.. currentmodule:: visp.core + +.. autoclass:: Tracker + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~Tracker.get_cP + ~Tracker.get_p + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~Tracker.__doc__ + ~Tracker.__init__ + ~Tracker.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~Tracker.cP + ~Tracker.cPAvailable + ~Tracker.p + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.TranslationVector.rst b/modules/python/doc/_autosummary/visp.core.TranslationVector.rst new file mode 100644 index 0000000000..e972d43038 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.TranslationVector.rst @@ -0,0 +1,79 @@ +TranslationVector +================= + +.. currentmodule:: visp.core + +.. autoclass:: TranslationVector + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~TranslationVector.buildFrom + ~TranslationVector.cross + ~TranslationVector.frobeniusNorm + ~TranslationVector.mean + ~TranslationVector.numpy + ~TranslationVector.resize + ~TranslationVector.set + ~TranslationVector.skew + ~TranslationVector.skewOf + ~TranslationVector.sumSquare + ~TranslationVector.t + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~TranslationVector.insertStatic + ~TranslationVector.getMaxValue + ~TranslationVector.save + ~TranslationVector.size + ~TranslationVector.hadamard + ~TranslationVector.insert + ~TranslationVector.getCols + ~TranslationVector.getMinValue + ~TranslationVector.reshape + ~TranslationVector.conv2 + ~TranslationVector.saveYAML + ~TranslationVector.getRows + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~TranslationVector.__add__ + ~TranslationVector.__doc__ + ~TranslationVector.__getitem__ + ~TranslationVector.__imul__ + ~TranslationVector.__init__ + ~TranslationVector.__itruediv__ + ~TranslationVector.__module__ + ~TranslationVector.__mul__ + ~TranslationVector.__neg__ + ~TranslationVector.__sub__ + ~TranslationVector.__truediv__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.Triangle.rst b/modules/python/doc/_autosummary/visp.core.Triangle.rst new file mode 100644 index 0000000000..9cedf40026 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.Triangle.rst @@ -0,0 +1,52 @@ +Triangle +======== + +.. currentmodule:: visp.core + +.. autoclass:: Triangle + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~Triangle.buildFrom + ~Triangle.getArea + ~Triangle.getTriangleApexes + ~Triangle.inTriangle + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~Triangle.__doc__ + ~Triangle.__init__ + ~Triangle.__module__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.UDPClient.rst b/modules/python/doc/_autosummary/visp.core.UDPClient.rst new file mode 100644 index 0000000000..babb16104a --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.UDPClient.rst @@ -0,0 +1,51 @@ +UDPClient +========= + +.. currentmodule:: visp.core + +.. autoclass:: UDPClient + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~UDPClient.init + ~UDPClient.receive + ~UDPClient.send + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~UDPClient.__doc__ + ~UDPClient.__init__ + ~UDPClient.__module__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.UDPServer.rst b/modules/python/doc/_autosummary/visp.core.UDPServer.rst new file mode 100644 index 0000000000..44f9989bd0 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.UDPServer.rst @@ -0,0 +1,50 @@ +UDPServer +========= + +.. currentmodule:: visp.core + +.. autoclass:: UDPServer + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~UDPServer.receive + ~UDPServer.send + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~UDPServer.__doc__ + ~UDPServer.__init__ + ~UDPServer.__module__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.UniRand.rst b/modules/python/doc/_autosummary/visp.core.UniRand.rst new file mode 100644 index 0000000000..a0e6ac6d9c --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.UniRand.rst @@ -0,0 +1,51 @@ +UniRand +======= + +.. currentmodule:: visp.core + +.. autoclass:: UniRand + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~UniRand.next + ~UniRand.setSeed + ~UniRand.uniform + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~UniRand.__doc__ + ~UniRand.__init__ + ~UniRand.__module__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.VelocityTwistMatrix.rst b/modules/python/doc/_autosummary/visp.core.VelocityTwistMatrix.rst new file mode 100644 index 0000000000..7e9634d9be --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.VelocityTwistMatrix.rst @@ -0,0 +1,69 @@ +VelocityTwistMatrix +=================== + +.. currentmodule:: visp.core + +.. autoclass:: VelocityTwistMatrix + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~VelocityTwistMatrix.buildFrom + ~VelocityTwistMatrix.extract + ~VelocityTwistMatrix.eye + ~VelocityTwistMatrix.inverse + ~VelocityTwistMatrix.print + ~VelocityTwistMatrix.resize + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~VelocityTwistMatrix.insertStatic + ~VelocityTwistMatrix.getMaxValue + ~VelocityTwistMatrix.t + ~VelocityTwistMatrix.save + ~VelocityTwistMatrix.size + ~VelocityTwistMatrix.hadamard + ~VelocityTwistMatrix.insert + ~VelocityTwistMatrix.getCols + ~VelocityTwistMatrix.getMinValue + ~VelocityTwistMatrix.numpy + ~VelocityTwistMatrix.reshape + ~VelocityTwistMatrix.conv2 + ~VelocityTwistMatrix.saveYAML + ~VelocityTwistMatrix.getRows + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~VelocityTwistMatrix.__doc__ + ~VelocityTwistMatrix.__init__ + ~VelocityTwistMatrix.__module__ + ~VelocityTwistMatrix.__mul__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.XmlParser.rst b/modules/python/doc/_autosummary/visp.core.XmlParser.rst new file mode 100644 index 0000000000..7e058e195e --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.XmlParser.rst @@ -0,0 +1,53 @@ +XmlParser +========= + +.. currentmodule:: visp.core + +.. autoclass:: XmlParser + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~XmlParser.cleanup + ~XmlParser.parse + ~XmlParser.save + ~XmlParser.setMainTag + ~XmlParser.setMap + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~XmlParser.__doc__ + ~XmlParser.__init__ + ~XmlParser.__module__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.XmlParserCamera.rst b/modules/python/doc/_autosummary/visp.core.XmlParserCamera.rst new file mode 100644 index 0000000000..656450d909 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.XmlParserCamera.rst @@ -0,0 +1,68 @@ +XmlParserCamera +=============== + +.. currentmodule:: visp.core + +.. autoclass:: XmlParserCamera + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~XmlParserCamera.getCameraName + ~XmlParserCamera.getCameraParameters + ~XmlParserCamera.getHeight + ~XmlParserCamera.getSubsampling_height + ~XmlParserCamera.getSubsampling_width + ~XmlParserCamera.getWidth + ~XmlParserCamera.parse + ~XmlParserCamera.save + ~XmlParserCamera.setCameraName + ~XmlParserCamera.setHeight + ~XmlParserCamera.setSubsampling_height + ~XmlParserCamera.setSubsampling_width + ~XmlParserCamera.setWidth + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~XmlParserCamera.__doc__ + ~XmlParserCamera.__init__ + ~XmlParserCamera.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~XmlParserCamera.SEQUENCE_ERROR + ~XmlParserCamera.SEQUENCE_OK + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.XmlParserHomogeneousMatrix.rst b/modules/python/doc/_autosummary/visp.core.XmlParserHomogeneousMatrix.rst new file mode 100644 index 0000000000..cdf628811b --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.XmlParserHomogeneousMatrix.rst @@ -0,0 +1,60 @@ +XmlParserHomogeneousMatrix +========================== + +.. currentmodule:: visp.core + +.. autoclass:: XmlParserHomogeneousMatrix + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~XmlParserHomogeneousMatrix.getHomogeneousMatrix + ~XmlParserHomogeneousMatrix.getHomogeneousMatrixName + ~XmlParserHomogeneousMatrix.parse + ~XmlParserHomogeneousMatrix.save + ~XmlParserHomogeneousMatrix.setHomogeneousMatrixName + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~XmlParserHomogeneousMatrix.__doc__ + ~XmlParserHomogeneousMatrix.__init__ + ~XmlParserHomogeneousMatrix.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~XmlParserHomogeneousMatrix.SEQUENCE_ERROR + ~XmlParserHomogeneousMatrix.SEQUENCE_OK + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.XmlParserRectOriented.rst b/modules/python/doc/_autosummary/visp.core.XmlParserRectOriented.rst new file mode 100644 index 0000000000..6c00c629ae --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.XmlParserRectOriented.rst @@ -0,0 +1,59 @@ +XmlParserRectOriented +===================== + +.. currentmodule:: visp.core + +.. autoclass:: XmlParserRectOriented + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~XmlParserRectOriented.getRectangle + ~XmlParserRectOriented.parse + ~XmlParserRectOriented.save + ~XmlParserRectOriented.setRectangle + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~XmlParserRectOriented.__doc__ + ~XmlParserRectOriented.__init__ + ~XmlParserRectOriented.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~XmlParserRectOriented.SEQUENCE_ERROR + ~XmlParserRectOriented.SEQUENCE_OK + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.rst b/modules/python/doc/_autosummary/visp.core.rst new file mode 100644 index 0000000000..3654e3972f --- /dev/null +++ b/modules/python/doc/_autosummary/visp.core.rst @@ -0,0 +1,167 @@ +core +==== + +.. automodule:: visp.core + + + + + + + + .. rubric:: Functions + + .. autosummary:: + :nosignatures: + + checkAVX + checkAVX2 + checkNeon + checkSSE2 + checkSSE3 + checkSSE41 + checkSSE42 + checkSSSE3 + clippingFlagsToJSON + eigen2visp + getCPUCacheL1 + getCPUCacheL2 + getCPUCacheL3 + getDateTime + getMinTimeForUsleepCall + measureTimeMicros + measureTimeMs + measureTimeSecond + printCPUInfo + sleepMs + swap16bits + swap32bits + swapDouble + swapFloat + visp2eigen + wait + + + + + + .. rubric:: Classes + + .. autosummary:: + :toctree: + :template: custom-class-template.rst + :nosignatures: + + ArrayDouble2D + BSpline + CameraParameters + CannyEdgeDetection + Chrono + Circle + Client + ColVector + Color + ColorDepthConversion + Colormap + Convert + Cylinder + Display + ExponentialMap + FeatureDisplay + Font + ForceTwistMatrix + ForwardProjection + FrameGrabber + GaussRand + GaussianFilter + Hinkley + Histogram + HistogramPeak + HistogramValey + HomogeneousMatrix + ImageCircle + ImageConvert + ImageDouble + ImageDraw + ImageFilter + ImageFloat + ImageGray + ImageMorphology + ImagePoint + ImageRGBa + ImageRGBf + ImageTools + ImageUInt16 + IoTools + KalmanFilter + LinProg + Line + LinearKalmanFilterInstantiation + Math + Matrix + MeterPixelConversion + Moment + MomentAlpha + MomentArea + MomentAreaNormalized + MomentBasic + MomentCInvariant + MomentCentered + MomentCommon + MomentDatabase + MomentGravityCenter + MomentGravityCenterNormalized + MomentObject + MouseButton + Munkres + Mutex + Network + PixelMeterConversion + Plane + Point + Polygon + Polygon3D + PoseVector + QuadProg + QuaternionVector + RGBa + RGBf + Rect + RectOriented + Request + Robust + RotationMatrix + RotationVector + RowVector + RxyzVector + RzyxVector + RzyzVector + Scale + Serial + Server + Sphere + SubColVector + SubMatrix + SubRowVector + ThetaUVector + Thread + Tracker + TranslationVector + Triangle + UDPClient + UDPServer + UniRand + VelocityTwistMatrix + XmlParser + XmlParserCamera + XmlParserHomogeneousMatrix + XmlParserRectOriented + + + + + + + + + diff --git a/modules/python/doc/_autosummary/visp.detection.DetectorAprilTag.rst b/modules/python/doc/_autosummary/visp.detection.DetectorAprilTag.rst new file mode 100644 index 0000000000..d682f1f23e --- /dev/null +++ b/modules/python/doc/_autosummary/visp.detection.DetectorAprilTag.rst @@ -0,0 +1,92 @@ +DetectorAprilTag +================ + +.. currentmodule:: visp.detection + +.. autoclass:: DetectorAprilTag + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~DetectorAprilTag.detect + ~DetectorAprilTag.displayFrames + ~DetectorAprilTag.displayTags + ~DetectorAprilTag.getPoseEstimationMethod + ~DetectorAprilTag.getTagsCorners + ~DetectorAprilTag.getTagsId + ~DetectorAprilTag.getTagsPoints3D + ~DetectorAprilTag.setAprilTagDecodeSharpening + ~DetectorAprilTag.setAprilTagFamily + ~DetectorAprilTag.setAprilTagNbThreads + ~DetectorAprilTag.setAprilTagPoseEstimationMethod + ~DetectorAprilTag.setAprilTagQuadDecimate + ~DetectorAprilTag.setAprilTagQuadSigma + ~DetectorAprilTag.setAprilTagRefineEdges + ~DetectorAprilTag.setDisplayTag + ~DetectorAprilTag.setZAlignedWithCameraAxis + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~DetectorAprilTag.getBBox + ~DetectorAprilTag.setTimeout + ~DetectorAprilTag.getPolygon + ~DetectorAprilTag.getCog + ~DetectorAprilTag.getMessage + ~DetectorAprilTag.getNbObjects + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~DetectorAprilTag.__doc__ + ~DetectorAprilTag.__init__ + ~DetectorAprilTag.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~DetectorAprilTag.BEST_RESIDUAL_VIRTUAL_VS + ~DetectorAprilTag.DEMENTHON_VIRTUAL_VS + ~DetectorAprilTag.HOMOGRAPHY + ~DetectorAprilTag.HOMOGRAPHY_ORTHOGONAL_ITERATION + ~DetectorAprilTag.HOMOGRAPHY_VIRTUAL_VS + ~DetectorAprilTag.LAGRANGE_VIRTUAL_VS + ~DetectorAprilTag.TAG_16h5 + ~DetectorAprilTag.TAG_25h7 + ~DetectorAprilTag.TAG_25h9 + ~DetectorAprilTag.TAG_36ARTOOLKIT + ~DetectorAprilTag.TAG_36h10 + ~DetectorAprilTag.TAG_36h11 + ~DetectorAprilTag.TAG_CIRCLE21h7 + ~DetectorAprilTag.TAG_CIRCLE49h12 + ~DetectorAprilTag.TAG_CUSTOM48h12 + ~DetectorAprilTag.TAG_STANDARD41h12 + ~DetectorAprilTag.TAG_STANDARD52h13 + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.detection.DetectorBase.rst b/modules/python/doc/_autosummary/visp.detection.DetectorBase.rst new file mode 100644 index 0000000000..e99417d715 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.detection.DetectorBase.rst @@ -0,0 +1,54 @@ +DetectorBase +============ + +.. currentmodule:: visp.detection + +.. autoclass:: DetectorBase + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~DetectorBase.getBBox + ~DetectorBase.getCog + ~DetectorBase.getMessage + ~DetectorBase.getNbObjects + ~DetectorBase.getPolygon + ~DetectorBase.setTimeout + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~DetectorBase.__doc__ + ~DetectorBase.__init__ + ~DetectorBase.__module__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.detection.DetectorDNNOpenCV.rst b/modules/python/doc/_autosummary/visp.detection.DetectorDNNOpenCV.rst new file mode 100644 index 0000000000..2d0f2f22e7 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.detection.DetectorDNNOpenCV.rst @@ -0,0 +1,83 @@ +DetectorDNNOpenCV +================= + +.. currentmodule:: visp.detection + +.. autoclass:: DetectorDNNOpenCV + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~DetectorDNNOpenCV.detect + ~DetectorDNNOpenCV.dnnResultsParsingTypeFromString + ~DetectorDNNOpenCV.dnnResultsParsingTypeToString + ~DetectorDNNOpenCV.getAvailableDnnResultsParsingTypes + ~DetectorDNNOpenCV.getNetConfig + ~DetectorDNNOpenCV.initFromJSON + ~DetectorDNNOpenCV.parseClassNamesFile + ~DetectorDNNOpenCV.readNet + ~DetectorDNNOpenCV.saveConfigurationInJSON + ~DetectorDNNOpenCV.setConfidenceThreshold + ~DetectorDNNOpenCV.setDetectionFilterSizeRatio + ~DetectorDNNOpenCV.setInputSize + ~DetectorDNNOpenCV.setMean + ~DetectorDNNOpenCV.setNMSThreshold + ~DetectorDNNOpenCV.setNetConfig + ~DetectorDNNOpenCV.setPreferableBackend + ~DetectorDNNOpenCV.setPreferableTarget + ~DetectorDNNOpenCV.setScaleFactor + ~DetectorDNNOpenCV.setSwapRB + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~DetectorDNNOpenCV.__doc__ + ~DetectorDNNOpenCV.__init__ + ~DetectorDNNOpenCV.__module__ + ~DetectorDNNOpenCV.__repr__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~DetectorDNNOpenCV.COUNT + ~DetectorDNNOpenCV.FASTER_RCNN + ~DetectorDNNOpenCV.RESNET_10 + ~DetectorDNNOpenCV.SSD_MOBILENET + ~DetectorDNNOpenCV.USER_SPECIFIED + ~DetectorDNNOpenCV.YOLO_V3 + ~DetectorDNNOpenCV.YOLO_V4 + ~DetectorDNNOpenCV.YOLO_V5 + ~DetectorDNNOpenCV.YOLO_V7 + ~DetectorDNNOpenCV.YOLO_V8 + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.detection.DetectorFace.rst b/modules/python/doc/_autosummary/visp.detection.DetectorFace.rst new file mode 100644 index 0000000000..9530a27822 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.detection.DetectorFace.rst @@ -0,0 +1,56 @@ +DetectorFace +============ + +.. currentmodule:: visp.detection + +.. autoclass:: DetectorFace + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~DetectorFace.detect + ~DetectorFace.setCascadeClassifierFile + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~DetectorFace.getBBox + ~DetectorFace.setTimeout + ~DetectorFace.getPolygon + ~DetectorFace.getCog + ~DetectorFace.getMessage + ~DetectorFace.getNbObjects + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~DetectorFace.__doc__ + ~DetectorFace.__init__ + ~DetectorFace.__module__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.detection.DetectorQRCode.rst b/modules/python/doc/_autosummary/visp.detection.DetectorQRCode.rst new file mode 100644 index 0000000000..b1da2c4a5b --- /dev/null +++ b/modules/python/doc/_autosummary/visp.detection.DetectorQRCode.rst @@ -0,0 +1,55 @@ +DetectorQRCode +============== + +.. currentmodule:: visp.detection + +.. autoclass:: DetectorQRCode + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~DetectorQRCode.detect + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~DetectorQRCode.getMessage + ~DetectorQRCode.getBBox + ~DetectorQRCode.setTimeout + ~DetectorQRCode.getNbObjects + ~DetectorQRCode.getPolygon + ~DetectorQRCode.getCog + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~DetectorQRCode.__doc__ + ~DetectorQRCode.__init__ + ~DetectorQRCode.__module__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.detection.rst b/modules/python/doc/_autosummary/visp.detection.rst new file mode 100644 index 0000000000..50de0fc566 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.detection.rst @@ -0,0 +1,36 @@ +detection +========= + +.. automodule:: visp.detection + + + + + + + + + + + + .. rubric:: Classes + + .. autosummary:: + :toctree: + :template: custom-class-template.rst + :nosignatures: + + DetectorAprilTag + DetectorBase + DetectorDNNOpenCV + DetectorFace + DetectorQRCode + + + + + + + + + diff --git a/modules/python/doc/_autosummary/visp.dnn_tracker.MegaPose.rst b/modules/python/doc/_autosummary/visp.dnn_tracker.MegaPose.rst new file mode 100644 index 0000000000..c01db6801c --- /dev/null +++ b/modules/python/doc/_autosummary/visp.dnn_tracker.MegaPose.rst @@ -0,0 +1,72 @@ +MegaPose +======== + +.. currentmodule:: visp.dnn_tracker + +.. autoclass:: MegaPose + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~MegaPose.getObjectNames + ~MegaPose.scorePoses + ~MegaPose.setCoarseNumSamples + ~MegaPose.setIntrinsics + ~MegaPose.viewObjects + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~MegaPose.__doc__ + ~MegaPose.__init__ + ~MegaPose.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~MegaPose.ERR + ~MegaPose.EXIT + ~MegaPose.GET_LIST_OBJECTS + ~MegaPose.GET_POSE + ~MegaPose.GET_SCORE + ~MegaPose.GET_VIZ + ~MegaPose.OK + ~MegaPose.RET_LIST_OBJECTS + ~MegaPose.RET_POSE + ~MegaPose.RET_SCORE + ~MegaPose.RET_VIZ + ~MegaPose.SET_INTR + ~MegaPose.SET_SO3_GRID_SIZE + ~MegaPose.UNKNOWN + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.dnn_tracker.MegaPoseEstimate.rst b/modules/python/doc/_autosummary/visp.dnn_tracker.MegaPoseEstimate.rst new file mode 100644 index 0000000000..f05f2a2890 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.dnn_tracker.MegaPoseEstimate.rst @@ -0,0 +1,56 @@ +MegaPoseEstimate +================ + +.. currentmodule:: visp.dnn_tracker + +.. autoclass:: MegaPoseEstimate + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~MegaPoseEstimate.__doc__ + ~MegaPoseEstimate.__init__ + ~MegaPoseEstimate.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~MegaPoseEstimate.boundingBox + ~MegaPoseEstimate.cTo + ~MegaPoseEstimate.score + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.dnn_tracker.MegaPoseTracker.rst b/modules/python/doc/_autosummary/visp.dnn_tracker.MegaPoseTracker.rst new file mode 100644 index 0000000000..602ebc981e --- /dev/null +++ b/modules/python/doc/_autosummary/visp.dnn_tracker.MegaPoseTracker.rst @@ -0,0 +1,51 @@ +MegaPoseTracker +=============== + +.. currentmodule:: visp.dnn_tracker + +.. autoclass:: MegaPoseTracker + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~MegaPoseTracker.init + ~MegaPoseTracker.track + ~MegaPoseTracker.updatePose + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~MegaPoseTracker.__doc__ + ~MegaPoseTracker.__init__ + ~MegaPoseTracker.__module__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.dnn_tracker.rst b/modules/python/doc/_autosummary/visp.dnn_tracker.rst new file mode 100644 index 0000000000..aff2ad80a4 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.dnn_tracker.rst @@ -0,0 +1,34 @@ +dnn\_tracker +============ + +.. automodule:: visp.dnn_tracker + + + + + + + + + + + + .. rubric:: Classes + + .. autosummary:: + :toctree: + :template: custom-class-template.rst + :nosignatures: + + MegaPose + MegaPoseEstimate + MegaPoseTracker + + + + + + + + + diff --git a/modules/python/doc/_autosummary/visp.gui.ColorBlindFriendlyPalette.rst b/modules/python/doc/_autosummary/visp.gui.ColorBlindFriendlyPalette.rst new file mode 100644 index 0000000000..47ec304d2c --- /dev/null +++ b/modules/python/doc/_autosummary/visp.gui.ColorBlindFriendlyPalette.rst @@ -0,0 +1,70 @@ +ColorBlindFriendlyPalette +========================= + +.. currentmodule:: visp.gui + +.. autoclass:: ColorBlindFriendlyPalette + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~ColorBlindFriendlyPalette.getAvailableColorsNames + ~ColorBlindFriendlyPalette.get_colorID + ~ColorBlindFriendlyPalette.set_fromString + ~ColorBlindFriendlyPalette.to_RGB + ~ColorBlindFriendlyPalette.to_colorRatio + ~ColorBlindFriendlyPalette.to_string + ~ColorBlindFriendlyPalette.to_vpColor + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~ColorBlindFriendlyPalette.__doc__ + ~ColorBlindFriendlyPalette.__init__ + ~ColorBlindFriendlyPalette.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~ColorBlindFriendlyPalette.Black + ~ColorBlindFriendlyPalette.Blue + ~ColorBlindFriendlyPalette.COUNT + ~ColorBlindFriendlyPalette.Green + ~ColorBlindFriendlyPalette.Orange + ~ColorBlindFriendlyPalette.Purple + ~ColorBlindFriendlyPalette.SkyBlue + ~ColorBlindFriendlyPalette.Vermillon + ~ColorBlindFriendlyPalette.Yellow + ~ColorBlindFriendlyPalette.s_paletteNames + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.gui.DisplayOpenCV.rst b/modules/python/doc/_autosummary/visp.gui.DisplayOpenCV.rst new file mode 100644 index 0000000000..6034c58466 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.gui.DisplayOpenCV.rst @@ -0,0 +1,118 @@ +DisplayOpenCV +============= + +.. currentmodule:: visp.gui + +.. autoclass:: DisplayOpenCV + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~DisplayOpenCV.getImage + ~DisplayOpenCV.getScreenHeight + ~DisplayOpenCV.getScreenSize + ~DisplayOpenCV.getScreenWidth + ~DisplayOpenCV.init + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~DisplayOpenCV.SCALE_6 + ~DisplayOpenCV.ScaleType + ~DisplayOpenCV.displayArrow + ~DisplayOpenCV.displayRectangle + ~DisplayOpenCV.getWindowYPosition + ~DisplayOpenCV.SCALE_AUTO + ~DisplayOpenCV.displayLine + ~DisplayOpenCV.display + ~DisplayOpenCV.SCALE_4 + ~DisplayOpenCV.displayText + ~DisplayOpenCV.close + ~DisplayOpenCV.getClickUp + ~DisplayOpenCV.setDownScalingFactor + ~DisplayOpenCV.setBackground + ~DisplayOpenCV.SCALE_3 + ~DisplayOpenCV.SCALE_9 + ~DisplayOpenCV.displayFrame + ~DisplayOpenCV.flush + ~DisplayOpenCV.displayCamera + ~DisplayOpenCV.displayPoint + ~DisplayOpenCV.displayPolygon + ~DisplayOpenCV.getWindowXPosition + ~DisplayOpenCV.flushROI + ~DisplayOpenCV.SCALE_2 + ~DisplayOpenCV.SCALE_1 + ~DisplayOpenCV.setFont + ~DisplayOpenCV.SCALE_7 + ~DisplayOpenCV.isInitialised + ~DisplayOpenCV.SCALE_DEFAULT + ~DisplayOpenCV.getDownScalingFactor + ~DisplayOpenCV.getPointerMotionEvent + ~DisplayOpenCV.getWidth + ~DisplayOpenCV.getHeight + ~DisplayOpenCV.SCALE_10 + ~DisplayOpenCV.computeAutoScale + ~DisplayOpenCV.getPointerPosition + ~DisplayOpenCV.setTitle + ~DisplayOpenCV.displayEllipse + ~DisplayOpenCV.getClick + ~DisplayOpenCV.displayCircleStatic + ~DisplayOpenCV.getKeyboardEvent + ~DisplayOpenCV.displayCross + ~DisplayOpenCV.displayDotLine + ~DisplayOpenCV.getImageDownScalingFactor + ~DisplayOpenCV.setWindowPosition + ~DisplayOpenCV.displayROI + ~DisplayOpenCV.SCALE_8 + ~DisplayOpenCV.SCALE_5 + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~DisplayOpenCV.__doc__ + ~DisplayOpenCV.__init__ + ~DisplayOpenCV.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~DisplayOpenCV.SCALE_1 + ~DisplayOpenCV.SCALE_10 + ~DisplayOpenCV.SCALE_2 + ~DisplayOpenCV.SCALE_3 + ~DisplayOpenCV.SCALE_4 + ~DisplayOpenCV.SCALE_5 + ~DisplayOpenCV.SCALE_6 + ~DisplayOpenCV.SCALE_7 + ~DisplayOpenCV.SCALE_8 + ~DisplayOpenCV.SCALE_9 + ~DisplayOpenCV.SCALE_AUTO + ~DisplayOpenCV.SCALE_DEFAULT + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.gui.DisplayX.rst b/modules/python/doc/_autosummary/visp.gui.DisplayX.rst new file mode 100644 index 0000000000..6f694f3348 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.gui.DisplayX.rst @@ -0,0 +1,119 @@ +DisplayX +======== + +.. currentmodule:: visp.gui + +.. autoclass:: DisplayX + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~DisplayX.getImage + ~DisplayX.getScreenDepth + ~DisplayX.getScreenHeight + ~DisplayX.getScreenSize + ~DisplayX.getScreenWidth + ~DisplayX.init + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~DisplayX.SCALE_6 + ~DisplayX.ScaleType + ~DisplayX.displayArrow + ~DisplayX.displayRectangle + ~DisplayX.getWindowYPosition + ~DisplayX.SCALE_AUTO + ~DisplayX.displayLine + ~DisplayX.display + ~DisplayX.SCALE_4 + ~DisplayX.displayText + ~DisplayX.close + ~DisplayX.getClickUp + ~DisplayX.setDownScalingFactor + ~DisplayX.setBackground + ~DisplayX.SCALE_3 + ~DisplayX.SCALE_9 + ~DisplayX.displayFrame + ~DisplayX.flush + ~DisplayX.displayCamera + ~DisplayX.displayPoint + ~DisplayX.displayPolygon + ~DisplayX.getWindowXPosition + ~DisplayX.flushROI + ~DisplayX.SCALE_2 + ~DisplayX.SCALE_1 + ~DisplayX.setFont + ~DisplayX.SCALE_7 + ~DisplayX.isInitialised + ~DisplayX.SCALE_DEFAULT + ~DisplayX.getDownScalingFactor + ~DisplayX.getPointerMotionEvent + ~DisplayX.getWidth + ~DisplayX.getHeight + ~DisplayX.SCALE_10 + ~DisplayX.computeAutoScale + ~DisplayX.getPointerPosition + ~DisplayX.setTitle + ~DisplayX.displayEllipse + ~DisplayX.getClick + ~DisplayX.displayCircleStatic + ~DisplayX.getKeyboardEvent + ~DisplayX.displayCross + ~DisplayX.displayDotLine + ~DisplayX.getImageDownScalingFactor + ~DisplayX.setWindowPosition + ~DisplayX.displayROI + ~DisplayX.SCALE_8 + ~DisplayX.SCALE_5 + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~DisplayX.__doc__ + ~DisplayX.__init__ + ~DisplayX.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~DisplayX.SCALE_1 + ~DisplayX.SCALE_10 + ~DisplayX.SCALE_2 + ~DisplayX.SCALE_3 + ~DisplayX.SCALE_4 + ~DisplayX.SCALE_5 + ~DisplayX.SCALE_6 + ~DisplayX.SCALE_7 + ~DisplayX.SCALE_8 + ~DisplayX.SCALE_9 + ~DisplayX.SCALE_AUTO + ~DisplayX.SCALE_DEFAULT + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.gui.Plot.rst b/modules/python/doc/_autosummary/visp.gui.Plot.rst new file mode 100644 index 0000000000..435185f4bd --- /dev/null +++ b/modules/python/doc/_autosummary/visp.gui.Plot.rst @@ -0,0 +1,72 @@ +Plot +==== + +.. currentmodule:: visp.gui + +.. autoclass:: Plot + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~Plot.getPixelValue + ~Plot.init + ~Plot.initGraph + ~Plot.initRange + ~Plot.navigate + ~Plot.plot + ~Plot.resetPointList + ~Plot.saveData + ~Plot.setColor + ~Plot.setFont + ~Plot.setGraphThickness + ~Plot.setGridThickness + ~Plot.setLegend + ~Plot.setThickness + ~Plot.setTitle + ~Plot.setUnitX + ~Plot.setUnitY + ~Plot.setUnitZ + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~Plot.__doc__ + ~Plot.__init__ + ~Plot.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~Plot.I + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.gui.ProjectionDisplay.rst b/modules/python/doc/_autosummary/visp.gui.ProjectionDisplay.rst new file mode 100644 index 0000000000..dcc643c4e1 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.gui.ProjectionDisplay.rst @@ -0,0 +1,55 @@ +ProjectionDisplay +================= + +.. currentmodule:: visp.gui + +.. autoclass:: ProjectionDisplay + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~ProjectionDisplay.close + ~ProjectionDisplay.display + ~ProjectionDisplay.displayCamera + ~ProjectionDisplay.externalView + ~ProjectionDisplay.init + ~ProjectionDisplay.insert + ~ProjectionDisplay.internalView + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~ProjectionDisplay.__doc__ + ~ProjectionDisplay.__init__ + ~ProjectionDisplay.__module__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.gui.rst b/modules/python/doc/_autosummary/visp.gui.rst new file mode 100644 index 0000000000..6aeaf8cd1a --- /dev/null +++ b/modules/python/doc/_autosummary/visp.gui.rst @@ -0,0 +1,36 @@ +gui +=== + +.. automodule:: visp.gui + + + + + + + + + + + + .. rubric:: Classes + + .. autosummary:: + :toctree: + :template: custom-class-template.rst + :nosignatures: + + ColorBlindFriendlyPalette + DisplayOpenCV + DisplayX + Plot + ProjectionDisplay + + + + + + + + + diff --git a/modules/python/doc/_autosummary/visp.imgproc.AutoThresholdMethod.rst b/modules/python/doc/_autosummary/visp.imgproc.AutoThresholdMethod.rst new file mode 100644 index 0000000000..8c959d559f --- /dev/null +++ b/modules/python/doc/_autosummary/visp.imgproc.AutoThresholdMethod.rst @@ -0,0 +1,82 @@ +AutoThresholdMethod +=================== + +.. currentmodule:: visp.imgproc + +.. autoclass:: AutoThresholdMethod + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~AutoThresholdMethod.__and__ + ~AutoThresholdMethod.__doc__ + ~AutoThresholdMethod.__eq__ + ~AutoThresholdMethod.__ge__ + ~AutoThresholdMethod.__getstate__ + ~AutoThresholdMethod.__gt__ + ~AutoThresholdMethod.__hash__ + ~AutoThresholdMethod.__index__ + ~AutoThresholdMethod.__init__ + ~AutoThresholdMethod.__int__ + ~AutoThresholdMethod.__invert__ + ~AutoThresholdMethod.__le__ + ~AutoThresholdMethod.__lt__ + ~AutoThresholdMethod.__members__ + ~AutoThresholdMethod.__module__ + ~AutoThresholdMethod.__ne__ + ~AutoThresholdMethod.__or__ + ~AutoThresholdMethod.__rand__ + ~AutoThresholdMethod.__repr__ + ~AutoThresholdMethod.__ror__ + ~AutoThresholdMethod.__rxor__ + ~AutoThresholdMethod.__setstate__ + ~AutoThresholdMethod.__str__ + ~AutoThresholdMethod.__xor__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~AutoThresholdMethod.AUTO_THRESHOLD_HUANG + ~AutoThresholdMethod.AUTO_THRESHOLD_INTERMODES + ~AutoThresholdMethod.AUTO_THRESHOLD_ISODATA + ~AutoThresholdMethod.AUTO_THRESHOLD_MEAN + ~AutoThresholdMethod.AUTO_THRESHOLD_OTSU + ~AutoThresholdMethod.AUTO_THRESHOLD_TRIANGLE + ~AutoThresholdMethod.name + ~AutoThresholdMethod.value + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.imgproc.CircleHoughTransform.rst b/modules/python/doc/_autosummary/visp.imgproc.CircleHoughTransform.rst new file mode 100644 index 0000000000..124c962e5b --- /dev/null +++ b/modules/python/doc/_autosummary/visp.imgproc.CircleHoughTransform.rst @@ -0,0 +1,81 @@ +CircleHoughTransform +==================== + +.. currentmodule:: visp.imgproc + +.. autoclass:: CircleHoughTransform + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~CircleHoughTransform.detect + ~CircleHoughTransform.getCannyThreshold + ~CircleHoughTransform.getCenterCandidatesList + ~CircleHoughTransform.getCenterCandidatesVotes + ~CircleHoughTransform.getCircleCandidates + ~CircleHoughTransform.getCircleCandidatesProbabilities + ~CircleHoughTransform.getCircleCenterMinDist + ~CircleHoughTransform.getCircleMaxRadius + ~CircleHoughTransform.getCircleMinRadius + ~CircleHoughTransform.getDetectionsProbabilities + ~CircleHoughTransform.getDetectionsVotes + ~CircleHoughTransform.getEdgeMap + ~CircleHoughTransform.getGradientX + ~CircleHoughTransform.getGradientY + ~CircleHoughTransform.init + ~CircleHoughTransform.initFromJSON + ~CircleHoughTransform.saveConfigurationInJSON + ~CircleHoughTransform.setCannyBackend + ~CircleHoughTransform.setCannyThreshold + ~CircleHoughTransform.setCannyThresholdRatio + ~CircleHoughTransform.setCenterComputationParameters + ~CircleHoughTransform.setCircleCenterBoundingBox + ~CircleHoughTransform.setCircleCenterMinDist + ~CircleHoughTransform.setCircleMaxRadius + ~CircleHoughTransform.setCircleMinRadius + ~CircleHoughTransform.setCirclePerfectness + ~CircleHoughTransform.setFilteringAndGradientType + ~CircleHoughTransform.setGaussianParameters + ~CircleHoughTransform.setGradientFilterAperture + ~CircleHoughTransform.setRadiusMergingThresholds + ~CircleHoughTransform.setRadiusRatioThreshold + ~CircleHoughTransform.toString + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~CircleHoughTransform.__doc__ + ~CircleHoughTransform.__init__ + ~CircleHoughTransform.__module__ + ~CircleHoughTransform.__repr__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.imgproc.ContourRetrievalType.rst b/modules/python/doc/_autosummary/visp.imgproc.ContourRetrievalType.rst new file mode 100644 index 0000000000..f946471b4b --- /dev/null +++ b/modules/python/doc/_autosummary/visp.imgproc.ContourRetrievalType.rst @@ -0,0 +1,79 @@ +ContourRetrievalType +==================== + +.. currentmodule:: visp.imgproc + +.. autoclass:: ContourRetrievalType + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~ContourRetrievalType.__and__ + ~ContourRetrievalType.__doc__ + ~ContourRetrievalType.__eq__ + ~ContourRetrievalType.__ge__ + ~ContourRetrievalType.__getstate__ + ~ContourRetrievalType.__gt__ + ~ContourRetrievalType.__hash__ + ~ContourRetrievalType.__index__ + ~ContourRetrievalType.__init__ + ~ContourRetrievalType.__int__ + ~ContourRetrievalType.__invert__ + ~ContourRetrievalType.__le__ + ~ContourRetrievalType.__lt__ + ~ContourRetrievalType.__members__ + ~ContourRetrievalType.__module__ + ~ContourRetrievalType.__ne__ + ~ContourRetrievalType.__or__ + ~ContourRetrievalType.__rand__ + ~ContourRetrievalType.__repr__ + ~ContourRetrievalType.__ror__ + ~ContourRetrievalType.__rxor__ + ~ContourRetrievalType.__setstate__ + ~ContourRetrievalType.__str__ + ~ContourRetrievalType.__xor__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~ContourRetrievalType.CONTOUR_RETR_EXTERNAL + ~ContourRetrievalType.CONTOUR_RETR_LIST + ~ContourRetrievalType.CONTOUR_RETR_TREE + ~ContourRetrievalType.name + ~ContourRetrievalType.value + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.imgproc.ContourType.rst b/modules/python/doc/_autosummary/visp.imgproc.ContourType.rst new file mode 100644 index 0000000000..fede860ef4 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.imgproc.ContourType.rst @@ -0,0 +1,78 @@ +ContourType +=========== + +.. currentmodule:: visp.imgproc + +.. autoclass:: ContourType + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~ContourType.__and__ + ~ContourType.__doc__ + ~ContourType.__eq__ + ~ContourType.__ge__ + ~ContourType.__getstate__ + ~ContourType.__gt__ + ~ContourType.__hash__ + ~ContourType.__index__ + ~ContourType.__init__ + ~ContourType.__int__ + ~ContourType.__invert__ + ~ContourType.__le__ + ~ContourType.__lt__ + ~ContourType.__members__ + ~ContourType.__module__ + ~ContourType.__ne__ + ~ContourType.__or__ + ~ContourType.__rand__ + ~ContourType.__repr__ + ~ContourType.__ror__ + ~ContourType.__rxor__ + ~ContourType.__setstate__ + ~ContourType.__str__ + ~ContourType.__xor__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~ContourType.CONTOUR_HOLE + ~ContourType.CONTOUR_OUTER + ~ContourType.name + ~ContourType.value + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.imgproc.DirectionType.rst b/modules/python/doc/_autosummary/visp.imgproc.DirectionType.rst new file mode 100644 index 0000000000..022775d712 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.imgproc.DirectionType.rst @@ -0,0 +1,85 @@ +DirectionType +============= + +.. currentmodule:: visp.imgproc + +.. autoclass:: DirectionType + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~DirectionType.__and__ + ~DirectionType.__doc__ + ~DirectionType.__eq__ + ~DirectionType.__ge__ + ~DirectionType.__getstate__ + ~DirectionType.__gt__ + ~DirectionType.__hash__ + ~DirectionType.__index__ + ~DirectionType.__init__ + ~DirectionType.__int__ + ~DirectionType.__invert__ + ~DirectionType.__le__ + ~DirectionType.__lt__ + ~DirectionType.__members__ + ~DirectionType.__module__ + ~DirectionType.__ne__ + ~DirectionType.__or__ + ~DirectionType.__rand__ + ~DirectionType.__repr__ + ~DirectionType.__ror__ + ~DirectionType.__rxor__ + ~DirectionType.__setstate__ + ~DirectionType.__str__ + ~DirectionType.__xor__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~DirectionType.EAST + ~DirectionType.LAST_DIRECTION + ~DirectionType.NORTH + ~DirectionType.NORTH_EAST + ~DirectionType.NORTH_WEST + ~DirectionType.SOUTH + ~DirectionType.SOUTH_EAST + ~DirectionType.SOUTH_WEST + ~DirectionType.WEST + ~DirectionType.name + ~DirectionType.value + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.imgproc.RETINEX_LEVEL.rst b/modules/python/doc/_autosummary/visp.imgproc.RETINEX_LEVEL.rst new file mode 100644 index 0000000000..537bf095f1 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.imgproc.RETINEX_LEVEL.rst @@ -0,0 +1,79 @@ +RETINEX\_LEVEL +============== + +.. currentmodule:: visp.imgproc + +.. autoclass:: RETINEX_LEVEL + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~RETINEX_LEVEL.__and__ + ~RETINEX_LEVEL.__doc__ + ~RETINEX_LEVEL.__eq__ + ~RETINEX_LEVEL.__ge__ + ~RETINEX_LEVEL.__getstate__ + ~RETINEX_LEVEL.__gt__ + ~RETINEX_LEVEL.__hash__ + ~RETINEX_LEVEL.__index__ + ~RETINEX_LEVEL.__init__ + ~RETINEX_LEVEL.__int__ + ~RETINEX_LEVEL.__invert__ + ~RETINEX_LEVEL.__le__ + ~RETINEX_LEVEL.__lt__ + ~RETINEX_LEVEL.__members__ + ~RETINEX_LEVEL.__module__ + ~RETINEX_LEVEL.__ne__ + ~RETINEX_LEVEL.__or__ + ~RETINEX_LEVEL.__rand__ + ~RETINEX_LEVEL.__repr__ + ~RETINEX_LEVEL.__ror__ + ~RETINEX_LEVEL.__rxor__ + ~RETINEX_LEVEL.__setstate__ + ~RETINEX_LEVEL.__str__ + ~RETINEX_LEVEL.__xor__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~RETINEX_LEVEL.RETINEX_HIGH + ~RETINEX_LEVEL.RETINEX_LOW + ~RETINEX_LEVEL.RETINEX_UNIFORM + ~RETINEX_LEVEL.name + ~RETINEX_LEVEL.value + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.imgproc.rst b/modules/python/doc/_autosummary/visp.imgproc.rst new file mode 100644 index 0000000000..465acfa3b2 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.imgproc.rst @@ -0,0 +1,58 @@ +imgproc +======= + +.. automodule:: visp.imgproc + + + + + + + + .. rubric:: Functions + + .. autosummary:: + :nosignatures: + + adjust + autoThreshold + clahe + connectedComponents + drawContours + equalizeHistogram + fillHoles + findContours + floodFill + gammaCorrection + reconstruct + retinex + stretchContrast + stretchContrastHSV + unsharpMask + + + + + + .. rubric:: Classes + + .. autosummary:: + :toctree: + :template: custom-class-template.rst + :nosignatures: + + AutoThresholdMethod + CircleHoughTransform + ContourRetrievalType + ContourType + DirectionType + RETINEX_LEVEL + + + + + + + + + diff --git a/modules/python/doc/_autosummary/visp.io.DiskGrabber.rst b/modules/python/doc/_autosummary/visp.io.DiskGrabber.rst new file mode 100644 index 0000000000..e3911f1a31 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.io.DiskGrabber.rst @@ -0,0 +1,69 @@ +DiskGrabber +=========== + +.. currentmodule:: visp.io + +.. autoclass:: DiskGrabber + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~DiskGrabber.acquire + ~DiskGrabber.close + ~DiskGrabber.getImageName + ~DiskGrabber.getImageNumber + ~DiskGrabber.open + ~DiskGrabber.setBaseName + ~DiskGrabber.setDirectory + ~DiskGrabber.setExtension + ~DiskGrabber.setGenericName + ~DiskGrabber.setImageNumber + ~DiskGrabber.setNumberOfZero + ~DiskGrabber.setStep + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~DiskGrabber.getWidth + ~DiskGrabber.getHeight + ~DiskGrabber.init + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~DiskGrabber.__doc__ + ~DiskGrabber.__init__ + ~DiskGrabber.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~DiskGrabber.init + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.io.ImageIo.rst b/modules/python/doc/_autosummary/visp.io.ImageIo.rst new file mode 100644 index 0000000000..9f4fbe64e8 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.io.ImageIo.rst @@ -0,0 +1,74 @@ +ImageIo +======= + +.. currentmodule:: visp.io + +.. autoclass:: ImageIo + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~ImageIo.read + ~ImageIo.readEXR + ~ImageIo.readJPEG + ~ImageIo.readPFM + ~ImageIo.readPFM_HDR + ~ImageIo.readPGM + ~ImageIo.readPNG + ~ImageIo.readPPM + ~ImageIo.write + ~ImageIo.writeEXR + ~ImageIo.writeJPEG + ~ImageIo.writePFM + ~ImageIo.writePFM_HDR + ~ImageIo.writePGM + ~ImageIo.writePNG + ~ImageIo.writePPM + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~ImageIo.__doc__ + ~ImageIo.__init__ + ~ImageIo.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~ImageIo.IO_DEFAULT_BACKEND + ~ImageIo.IO_OPENCV_BACKEND + ~ImageIo.IO_SIMDLIB_BACKEND + ~ImageIo.IO_STB_IMAGE_BACKEND + ~ImageIo.IO_SYSTEM_LIB_BACKEND + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.io.Keyboard.rst b/modules/python/doc/_autosummary/visp.io.Keyboard.rst new file mode 100644 index 0000000000..fe36c7eac1 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.io.Keyboard.rst @@ -0,0 +1,50 @@ +Keyboard +======== + +.. currentmodule:: visp.io + +.. autoclass:: Keyboard + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~Keyboard.getchar + ~Keyboard.kbhit + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~Keyboard.__doc__ + ~Keyboard.__init__ + ~Keyboard.__module__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.io.ParallelPort.rst b/modules/python/doc/_autosummary/visp.io.ParallelPort.rst new file mode 100644 index 0000000000..cd231252ad --- /dev/null +++ b/modules/python/doc/_autosummary/visp.io.ParallelPort.rst @@ -0,0 +1,50 @@ +ParallelPort +============ + +.. currentmodule:: visp.io + +.. autoclass:: ParallelPort + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~ParallelPort.getData + ~ParallelPort.sendData + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~ParallelPort.__doc__ + ~ParallelPort.__init__ + ~ParallelPort.__module__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.io.VideoReader.rst b/modules/python/doc/_autosummary/visp.io.VideoReader.rst new file mode 100644 index 0000000000..b8d5e2e972 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.io.VideoReader.rst @@ -0,0 +1,74 @@ +VideoReader +=========== + +.. currentmodule:: visp.io + +.. autoclass:: VideoReader + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~VideoReader.acquire + ~VideoReader.close + ~VideoReader.end + ~VideoReader.getFirstFrameIndex + ~VideoReader.getFrame + ~VideoReader.getFrameIndex + ~VideoReader.getFrameName + ~VideoReader.getFrameStep + ~VideoReader.getFramerate + ~VideoReader.getLastFrameIndex + ~VideoReader.isVideoFormat + ~VideoReader.open + ~VideoReader.resetFrameCounter + ~VideoReader.setFileName + ~VideoReader.setFirstFrameIndex + ~VideoReader.setFrameStep + ~VideoReader.setLastFrameIndex + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~VideoReader.getWidth + ~VideoReader.getHeight + ~VideoReader.init + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~VideoReader.__doc__ + ~VideoReader.__init__ + ~VideoReader.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~VideoReader.init + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.io.VideoWriter.rst b/modules/python/doc/_autosummary/visp.io.VideoWriter.rst new file mode 100644 index 0000000000..6e4d6b29bd --- /dev/null +++ b/modules/python/doc/_autosummary/visp.io.VideoWriter.rst @@ -0,0 +1,59 @@ +VideoWriter +=========== + +.. currentmodule:: visp.io + +.. autoclass:: VideoWriter + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~VideoWriter.close + ~VideoWriter.getCurrentFrameIndex + ~VideoWriter.getFrameName + ~VideoWriter.open + ~VideoWriter.resetFrameCounter + ~VideoWriter.saveFrame + ~VideoWriter.setCodec + ~VideoWriter.setFileName + ~VideoWriter.setFirstFrameIndex + ~VideoWriter.setFrameStep + ~VideoWriter.setFramerate + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~VideoWriter.__doc__ + ~VideoWriter.__init__ + ~VideoWriter.__module__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.io.rst b/modules/python/doc/_autosummary/visp.io.rst new file mode 100644 index 0000000000..79e0094ce9 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.io.rst @@ -0,0 +1,37 @@ +io +== + +.. automodule:: visp.io + + + + + + + + + + + + .. rubric:: Classes + + .. autosummary:: + :toctree: + :template: custom-class-template.rst + :nosignatures: + + DiskGrabber + ImageIo + Keyboard + ParallelPort + VideoReader + VideoWriter + + + + + + + + + diff --git a/modules/python/doc/_autosummary/visp.klt.KltOpencv.rst b/modules/python/doc/_autosummary/visp.klt.KltOpencv.rst new file mode 100644 index 0000000000..8462f93794 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.klt.KltOpencv.rst @@ -0,0 +1,78 @@ +KltOpencv +========= + +.. currentmodule:: visp.klt + +.. autoclass:: KltOpencv + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~KltOpencv.addFeature + ~KltOpencv.display + ~KltOpencv.displaySelf + ~KltOpencv.getBlockSize + ~KltOpencv.getFeature + ~KltOpencv.getFeatures + ~KltOpencv.getFeaturesId + ~KltOpencv.getHarrisFreeParameter + ~KltOpencv.getMaxFeatures + ~KltOpencv.getMinDistance + ~KltOpencv.getNbFeatures + ~KltOpencv.getNbPrevFeatures + ~KltOpencv.getPrevFeatures + ~KltOpencv.getPyramidLevels + ~KltOpencv.getQuality + ~KltOpencv.getWindowSize + ~KltOpencv.initTracking + ~KltOpencv.setBlockSize + ~KltOpencv.setHarrisFreeParameter + ~KltOpencv.setInitialGuess + ~KltOpencv.setMaxFeatures + ~KltOpencv.setMinDistance + ~KltOpencv.setMinEigThreshold + ~KltOpencv.setPyramidLevels + ~KltOpencv.setQuality + ~KltOpencv.setTrackerId + ~KltOpencv.setUseHarris + ~KltOpencv.setWindowSize + ~KltOpencv.suppressFeature + ~KltOpencv.track + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~KltOpencv.__doc__ + ~KltOpencv.__init__ + ~KltOpencv.__module__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.klt.rst b/modules/python/doc/_autosummary/visp.klt.rst new file mode 100644 index 0000000000..a697997229 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.klt.rst @@ -0,0 +1,32 @@ +klt +=== + +.. automodule:: visp.klt + + + + + + + + + + + + .. rubric:: Classes + + .. autosummary:: + :toctree: + :template: custom-class-template.rst + :nosignatures: + + KltOpencv + + + + + + + + + diff --git a/modules/python/doc/_autosummary/visp.mbt.MbDepthDenseTracker.rst b/modules/python/doc/_autosummary/visp.mbt.MbDepthDenseTracker.rst new file mode 100644 index 0000000000..49979c9c02 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.mbt.MbDepthDenseTracker.rst @@ -0,0 +1,127 @@ +MbDepthDenseTracker +=================== + +.. currentmodule:: visp.mbt + +.. autoclass:: MbDepthDenseTracker + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~MbDepthDenseTracker.display + ~MbDepthDenseTracker.getError + ~MbDepthDenseTracker.getModelForDisplay + ~MbDepthDenseTracker.getRobustWeights + ~MbDepthDenseTracker.init + ~MbDepthDenseTracker.loadConfigFile + ~MbDepthDenseTracker.reInitModel + ~MbDepthDenseTracker.resetTracker + ~MbDepthDenseTracker.setCameraParameters + ~MbDepthDenseTracker.setDepthDenseFilteringMaxDistance + ~MbDepthDenseTracker.setDepthDenseFilteringMethod + ~MbDepthDenseTracker.setDepthDenseFilteringMinDistance + ~MbDepthDenseTracker.setDepthDenseFilteringOccupancyRatio + ~MbDepthDenseTracker.setDepthDenseSamplingStep + ~MbDepthDenseTracker.setOgreVisibilityTest + ~MbDepthDenseTracker.setPose + ~MbDepthDenseTracker.setScanLineVisibilityTest + ~MbDepthDenseTracker.setUseDepthDenseTracking + ~MbDepthDenseTracker.testTracking + ~MbDepthDenseTracker.track + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~MbDepthDenseTracker.getEstimatedDoF + ~MbDepthDenseTracker.setCovarianceComputation + ~MbDepthDenseTracker.setLambda + ~MbDepthDenseTracker.setMinLineLengthThresh + ~MbDepthDenseTracker.setAngleAppear + ~MbDepthDenseTracker.setMinPolygonAreaThresh + ~MbDepthDenseTracker.getAngleAppear + ~MbDepthDenseTracker.setAngleDisappear + ~MbDepthDenseTracker.getNbPolygon + ~MbDepthDenseTracker.initFromPoints + ~MbDepthDenseTracker.setPoseSavingFilename + ~MbDepthDenseTracker.MbtOptimizationMethod + ~MbDepthDenseTracker.getClipping + ~MbDepthDenseTracker.getCameraParameters + ~MbDepthDenseTracker.setClipping + ~MbDepthDenseTracker.setProjectionErrorKernelSize + ~MbDepthDenseTracker.setProjectionErrorDisplayArrowThickness + ~MbDepthDenseTracker.setProjectionErrorDisplayArrowLength + ~MbDepthDenseTracker.setMask + ~MbDepthDenseTracker.getProjectionError + ~MbDepthDenseTracker.setDisplayFeatures + ~MbDepthDenseTracker.computeCurrentProjectionError + ~MbDepthDenseTracker.setEstimatedDoF + ~MbDepthDenseTracker.setProjectionErrorDisplay + ~MbDepthDenseTracker.getPolygonFaces + ~MbDepthDenseTracker.getInitialMu + ~MbDepthDenseTracker.setProjectionErrorMovingEdge + ~MbDepthDenseTracker.getMaxIter + ~MbDepthDenseTracker.getPose + ~MbDepthDenseTracker.getOptimizationMethod + ~MbDepthDenseTracker.setInitialMu + ~MbDepthDenseTracker.setProjectionErrorComputation + ~MbDepthDenseTracker.setMaxIter + ~MbDepthDenseTracker.setOptimizationMethod + ~MbDepthDenseTracker.initClick + ~MbDepthDenseTracker.setOgreShowConfigDialog + ~MbDepthDenseTracker.GAUSS_NEWTON_OPT + ~MbDepthDenseTracker.loadModel + ~MbDepthDenseTracker.getFarClippingDistance + ~MbDepthDenseTracker.getFaces + ~MbDepthDenseTracker.setLod + ~MbDepthDenseTracker.initFromPose + ~MbDepthDenseTracker.setFarClippingDistance + ~MbDepthDenseTracker.getAngleDisappear + ~MbDepthDenseTracker.setStopCriteriaEpsilon + ~MbDepthDenseTracker.getLambda + ~MbDepthDenseTracker.setNearClippingDistance + ~MbDepthDenseTracker.getCovarianceMatrix + ~MbDepthDenseTracker.getNearClippingDistance + ~MbDepthDenseTracker.LEVENBERG_MARQUARDT_OPT + ~MbDepthDenseTracker.getStopCriteriaEpsilon + ~MbDepthDenseTracker.savePose + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~MbDepthDenseTracker.__doc__ + ~MbDepthDenseTracker.__init__ + ~MbDepthDenseTracker.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~MbDepthDenseTracker.GAUSS_NEWTON_OPT + ~MbDepthDenseTracker.LEVENBERG_MARQUARDT_OPT + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.mbt.MbDepthNormalTracker.rst b/modules/python/doc/_autosummary/visp.mbt.MbDepthNormalTracker.rst new file mode 100644 index 0000000000..40bdd480cd --- /dev/null +++ b/modules/python/doc/_autosummary/visp.mbt.MbDepthNormalTracker.rst @@ -0,0 +1,129 @@ +MbDepthNormalTracker +==================== + +.. currentmodule:: visp.mbt + +.. autoclass:: MbDepthNormalTracker + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~MbDepthNormalTracker.display + ~MbDepthNormalTracker.getDepthFeatureEstimationMethod + ~MbDepthNormalTracker.getError + ~MbDepthNormalTracker.getModelForDisplay + ~MbDepthNormalTracker.getRobustWeights + ~MbDepthNormalTracker.init + ~MbDepthNormalTracker.loadConfigFile + ~MbDepthNormalTracker.reInitModel + ~MbDepthNormalTracker.resetTracker + ~MbDepthNormalTracker.setCameraParameters + ~MbDepthNormalTracker.setDepthNormalFaceCentroidMethod + ~MbDepthNormalTracker.setDepthNormalFeatureEstimationMethod + ~MbDepthNormalTracker.setDepthNormalPclPlaneEstimationMethod + ~MbDepthNormalTracker.setDepthNormalPclPlaneEstimationRansacMaxIter + ~MbDepthNormalTracker.setDepthNormalPclPlaneEstimationRansacThreshold + ~MbDepthNormalTracker.setDepthNormalSamplingStep + ~MbDepthNormalTracker.setOgreVisibilityTest + ~MbDepthNormalTracker.setPose + ~MbDepthNormalTracker.setScanLineVisibilityTest + ~MbDepthNormalTracker.setUseDepthNormalTracking + ~MbDepthNormalTracker.testTracking + ~MbDepthNormalTracker.track + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~MbDepthNormalTracker.getInitialMu + ~MbDepthNormalTracker.getEstimatedDoF + ~MbDepthNormalTracker.setLambda + ~MbDepthNormalTracker.setCovarianceComputation + ~MbDepthNormalTracker.setProjectionErrorMovingEdge + ~MbDepthNormalTracker.getMaxIter + ~MbDepthNormalTracker.setMinLineLengthThresh + ~MbDepthNormalTracker.getPose + ~MbDepthNormalTracker.getOptimizationMethod + ~MbDepthNormalTracker.setAngleAppear + ~MbDepthNormalTracker.setInitialMu + ~MbDepthNormalTracker.setMinPolygonAreaThresh + ~MbDepthNormalTracker.setProjectionErrorComputation + ~MbDepthNormalTracker.setMaxIter + ~MbDepthNormalTracker.getAngleAppear + ~MbDepthNormalTracker.setOptimizationMethod + ~MbDepthNormalTracker.initClick + ~MbDepthNormalTracker.setAngleDisappear + ~MbDepthNormalTracker.getNbPolygon + ~MbDepthNormalTracker.setOgreShowConfigDialog + ~MbDepthNormalTracker.initFromPoints + ~MbDepthNormalTracker.savePose + ~MbDepthNormalTracker.GAUSS_NEWTON_OPT + ~MbDepthNormalTracker.setPoseSavingFilename + ~MbDepthNormalTracker.MbtOptimizationMethod + ~MbDepthNormalTracker.getClipping + ~MbDepthNormalTracker.getCameraParameters + ~MbDepthNormalTracker.loadModel + ~MbDepthNormalTracker.setClipping + ~MbDepthNormalTracker.getFarClippingDistance + ~MbDepthNormalTracker.getFaces + ~MbDepthNormalTracker.setLod + ~MbDepthNormalTracker.initFromPose + ~MbDepthNormalTracker.setFarClippingDistance + ~MbDepthNormalTracker.setProjectionErrorKernelSize + ~MbDepthNormalTracker.getAngleDisappear + ~MbDepthNormalTracker.setStopCriteriaEpsilon + ~MbDepthNormalTracker.getLambda + ~MbDepthNormalTracker.setProjectionErrorDisplayArrowThickness + ~MbDepthNormalTracker.setNearClippingDistance + ~MbDepthNormalTracker.setProjectionErrorDisplayArrowLength + ~MbDepthNormalTracker.getCovarianceMatrix + ~MbDepthNormalTracker.getNearClippingDistance + ~MbDepthNormalTracker.setMask + ~MbDepthNormalTracker.getProjectionError + ~MbDepthNormalTracker.setDisplayFeatures + ~MbDepthNormalTracker.LEVENBERG_MARQUARDT_OPT + ~MbDepthNormalTracker.getStopCriteriaEpsilon + ~MbDepthNormalTracker.computeCurrentProjectionError + ~MbDepthNormalTracker.setEstimatedDoF + ~MbDepthNormalTracker.setProjectionErrorDisplay + ~MbDepthNormalTracker.getPolygonFaces + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~MbDepthNormalTracker.__doc__ + ~MbDepthNormalTracker.__init__ + ~MbDepthNormalTracker.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~MbDepthNormalTracker.GAUSS_NEWTON_OPT + ~MbDepthNormalTracker.LEVENBERG_MARQUARDT_OPT + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.mbt.MbEdgeKltTracker.rst b/modules/python/doc/_autosummary/visp.mbt.MbEdgeKltTracker.rst new file mode 100644 index 0000000000..670a855e32 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.mbt.MbEdgeKltTracker.rst @@ -0,0 +1,151 @@ +MbEdgeKltTracker +================ + +.. currentmodule:: visp.mbt + +.. autoclass:: MbEdgeKltTracker + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~MbEdgeKltTracker.display + ~MbEdgeKltTracker.getError + ~MbEdgeKltTracker.getModelForDisplay + ~MbEdgeKltTracker.getNearClippingDistance + ~MbEdgeKltTracker.getRobustWeights + ~MbEdgeKltTracker.loadConfigFile + ~MbEdgeKltTracker.reInitModel + ~MbEdgeKltTracker.resetTracker + ~MbEdgeKltTracker.setCameraParameters + ~MbEdgeKltTracker.setClipping + ~MbEdgeKltTracker.setFarClippingDistance + ~MbEdgeKltTracker.setNearClippingDistance + ~MbEdgeKltTracker.setOgreVisibilityTest + ~MbEdgeKltTracker.setPose + ~MbEdgeKltTracker.setProjectionErrorComputation + ~MbEdgeKltTracker.setScanLineVisibilityTest + ~MbEdgeKltTracker.testTracking + ~MbEdgeKltTracker.track + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~MbEdgeKltTracker.getEstimatedDoF + ~MbEdgeKltTracker.setCovarianceComputation + ~MbEdgeKltTracker.setLambda + ~MbEdgeKltTracker.setMovingEdge + ~MbEdgeKltTracker.setMinLineLengthThresh + ~MbEdgeKltTracker.addCircle + ~MbEdgeKltTracker.setAngleAppear + ~MbEdgeKltTracker.setMinPolygonAreaThresh + ~MbEdgeKltTracker.getLcylinder + ~MbEdgeKltTracker.getAngleAppear + ~MbEdgeKltTracker.getLline + ~MbEdgeKltTracker.setKltThresholdAcceptation + ~MbEdgeKltTracker.setThresholdAcceptation + ~MbEdgeKltTracker.setAngleDisappear + ~MbEdgeKltTracker.getNbPolygon + ~MbEdgeKltTracker.initFromPoints + ~MbEdgeKltTracker.setScales + ~MbEdgeKltTracker.getThresholdAcceptation + ~MbEdgeKltTracker.getFeaturesCircle + ~MbEdgeKltTracker.setPoseSavingFilename + ~MbEdgeKltTracker.MbtOptimizationMethod + ~MbEdgeKltTracker.getKltOpencv + ~MbEdgeKltTracker.getNbPoints + ~MbEdgeKltTracker.getFeaturesKltCylinder + ~MbEdgeKltTracker.getMaskBorder + ~MbEdgeKltTracker.getClipping + ~MbEdgeKltTracker.getKltPoints + ~MbEdgeKltTracker.getCameraParameters + ~MbEdgeKltTracker.setKltMaskBorder + ~MbEdgeKltTracker.setProjectionErrorKernelSize + ~MbEdgeKltTracker.setProjectionErrorDisplayArrowThickness + ~MbEdgeKltTracker.getKltImagePoints + ~MbEdgeKltTracker.setProjectionErrorDisplayArrowLength + ~MbEdgeKltTracker.getKltThresholdAcceptation + ~MbEdgeKltTracker.setMask + ~MbEdgeKltTracker.getProjectionError + ~MbEdgeKltTracker.setDisplayFeatures + ~MbEdgeKltTracker.getFeaturesKlt + ~MbEdgeKltTracker.computeCurrentProjectionError + ~MbEdgeKltTracker.getKltMaskBorder + ~MbEdgeKltTracker.setEstimatedDoF + ~MbEdgeKltTracker.setGoodMovingEdgesRatioThreshold + ~MbEdgeKltTracker.setProjectionErrorDisplay + ~MbEdgeKltTracker.getNbKltPoints + ~MbEdgeKltTracker.getPolygonFaces + ~MbEdgeKltTracker.getInitialMu + ~MbEdgeKltTracker.setProjectionErrorMovingEdge + ~MbEdgeKltTracker.getMaxIter + ~MbEdgeKltTracker.setKltOpencv + ~MbEdgeKltTracker.getPose + ~MbEdgeKltTracker.getOptimizationMethod + ~MbEdgeKltTracker.setInitialMu + ~MbEdgeKltTracker.setMaxIter + ~MbEdgeKltTracker.setOptimizationMethod + ~MbEdgeKltTracker.initClick + ~MbEdgeKltTracker.getMovingEdge + ~MbEdgeKltTracker.getGoodMovingEdgesRatioThreshold + ~MbEdgeKltTracker.setOgreShowConfigDialog + ~MbEdgeKltTracker.GAUSS_NEWTON_OPT + ~MbEdgeKltTracker.setUseKltTracking + ~MbEdgeKltTracker.getScales + ~MbEdgeKltTracker.setUseEdgeTracking + ~MbEdgeKltTracker.loadModel + ~MbEdgeKltTracker.getFarClippingDistance + ~MbEdgeKltTracker.getFaces + ~MbEdgeKltTracker.setLod + ~MbEdgeKltTracker.initFromPose + ~MbEdgeKltTracker.getAngleDisappear + ~MbEdgeKltTracker.setStopCriteriaEpsilon + ~MbEdgeKltTracker.getLambda + ~MbEdgeKltTracker.setMaskBorder + ~MbEdgeKltTracker.getKltImagePointsWithId + ~MbEdgeKltTracker.getCovarianceMatrix + ~MbEdgeKltTracker.LEVENBERG_MARQUARDT_OPT + ~MbEdgeKltTracker.getLcircle + ~MbEdgeKltTracker.getStopCriteriaEpsilon + ~MbEdgeKltTracker.getKltNbPoints + ~MbEdgeKltTracker.savePose + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~MbEdgeKltTracker.__doc__ + ~MbEdgeKltTracker.__init__ + ~MbEdgeKltTracker.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~MbEdgeKltTracker.GAUSS_NEWTON_OPT + ~MbEdgeKltTracker.LEVENBERG_MARQUARDT_OPT + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.mbt.MbEdgeTracker.rst b/modules/python/doc/_autosummary/visp.mbt.MbEdgeTracker.rst new file mode 100644 index 0000000000..4b42128a58 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.mbt.MbEdgeTracker.rst @@ -0,0 +1,130 @@ +MbEdgeTracker +============= + +.. currentmodule:: visp.mbt + +.. autoclass:: MbEdgeTracker + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~MbEdgeTracker.display + ~MbEdgeTracker.getError + ~MbEdgeTracker.getGoodMovingEdgesRatioThreshold + ~MbEdgeTracker.getLcircle + ~MbEdgeTracker.getLcylinder + ~MbEdgeTracker.getLline + ~MbEdgeTracker.getModelForDisplay + ~MbEdgeTracker.getMovingEdge + ~MbEdgeTracker.getNbPoints + ~MbEdgeTracker.getRobustWeights + ~MbEdgeTracker.getScales + ~MbEdgeTracker.loadConfigFile + ~MbEdgeTracker.reInitModel + ~MbEdgeTracker.resetTracker + ~MbEdgeTracker.setCameraParameters + ~MbEdgeTracker.setClipping + ~MbEdgeTracker.setFarClippingDistance + ~MbEdgeTracker.setGoodMovingEdgesRatioThreshold + ~MbEdgeTracker.setMovingEdge + ~MbEdgeTracker.setNearClippingDistance + ~MbEdgeTracker.setOgreVisibilityTest + ~MbEdgeTracker.setPose + ~MbEdgeTracker.setScales + ~MbEdgeTracker.setScanLineVisibilityTest + ~MbEdgeTracker.setUseEdgeTracking + ~MbEdgeTracker.track + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~MbEdgeTracker.getInitialMu + ~MbEdgeTracker.getEstimatedDoF + ~MbEdgeTracker.setLambda + ~MbEdgeTracker.setCovarianceComputation + ~MbEdgeTracker.setProjectionErrorMovingEdge + ~MbEdgeTracker.getMaxIter + ~MbEdgeTracker.setMinLineLengthThresh + ~MbEdgeTracker.getPose + ~MbEdgeTracker.getOptimizationMethod + ~MbEdgeTracker.setAngleAppear + ~MbEdgeTracker.setInitialMu + ~MbEdgeTracker.setMinPolygonAreaThresh + ~MbEdgeTracker.setProjectionErrorComputation + ~MbEdgeTracker.setMaxIter + ~MbEdgeTracker.getAngleAppear + ~MbEdgeTracker.setOptimizationMethod + ~MbEdgeTracker.initClick + ~MbEdgeTracker.setAngleDisappear + ~MbEdgeTracker.getNbPolygon + ~MbEdgeTracker.setOgreShowConfigDialog + ~MbEdgeTracker.initFromPoints + ~MbEdgeTracker.savePose + ~MbEdgeTracker.GAUSS_NEWTON_OPT + ~MbEdgeTracker.setPoseSavingFilename + ~MbEdgeTracker.MbtOptimizationMethod + ~MbEdgeTracker.getClipping + ~MbEdgeTracker.getCameraParameters + ~MbEdgeTracker.loadModel + ~MbEdgeTracker.getFarClippingDistance + ~MbEdgeTracker.getFaces + ~MbEdgeTracker.setLod + ~MbEdgeTracker.initFromPose + ~MbEdgeTracker.getAngleDisappear + ~MbEdgeTracker.setProjectionErrorKernelSize + ~MbEdgeTracker.setStopCriteriaEpsilon + ~MbEdgeTracker.getLambda + ~MbEdgeTracker.setProjectionErrorDisplayArrowThickness + ~MbEdgeTracker.setProjectionErrorDisplayArrowLength + ~MbEdgeTracker.getCovarianceMatrix + ~MbEdgeTracker.getNearClippingDistance + ~MbEdgeTracker.setMask + ~MbEdgeTracker.getProjectionError + ~MbEdgeTracker.setDisplayFeatures + ~MbEdgeTracker.LEVENBERG_MARQUARDT_OPT + ~MbEdgeTracker.getStopCriteriaEpsilon + ~MbEdgeTracker.computeCurrentProjectionError + ~MbEdgeTracker.setEstimatedDoF + ~MbEdgeTracker.setProjectionErrorDisplay + ~MbEdgeTracker.getPolygonFaces + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~MbEdgeTracker.__doc__ + ~MbEdgeTracker.__init__ + ~MbEdgeTracker.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~MbEdgeTracker.GAUSS_NEWTON_OPT + ~MbEdgeTracker.LEVENBERG_MARQUARDT_OPT + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.mbt.MbGenericTracker.rst b/modules/python/doc/_autosummary/visp.mbt.MbGenericTracker.rst new file mode 100644 index 0000000000..d85a201e14 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.mbt.MbGenericTracker.rst @@ -0,0 +1,175 @@ +MbGenericTracker +================ + +.. currentmodule:: visp.mbt + +.. autoclass:: MbGenericTracker + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~MbGenericTracker.computeCurrentProjectionError + ~MbGenericTracker.display + ~MbGenericTracker.getCameraNames + ~MbGenericTracker.getCameraParameters + ~MbGenericTracker.getCameraTrackerTypes + ~MbGenericTracker.getClipping + ~MbGenericTracker.getError + ~MbGenericTracker.getFaces + ~MbGenericTracker.getFeaturesCircle + ~MbGenericTracker.getFeaturesForDisplay + ~MbGenericTracker.getFeaturesKlt + ~MbGenericTracker.getFeaturesKltCylinder + ~MbGenericTracker.getGoodMovingEdgesRatioThreshold + ~MbGenericTracker.getKltImagePoints + ~MbGenericTracker.getKltImagePointsWithId + ~MbGenericTracker.getKltMaskBorder + ~MbGenericTracker.getKltNbPoints + ~MbGenericTracker.getKltOpencv + ~MbGenericTracker.getKltPoints + ~MbGenericTracker.getKltThresholdAcceptation + ~MbGenericTracker.getLcircle + ~MbGenericTracker.getLcylinder + ~MbGenericTracker.getLline + ~MbGenericTracker.getModelForDisplay + ~MbGenericTracker.getMovingEdge + ~MbGenericTracker.getNbFeaturesDepthDense + ~MbGenericTracker.getNbFeaturesDepthNormal + ~MbGenericTracker.getNbFeaturesEdge + ~MbGenericTracker.getNbFeaturesKlt + ~MbGenericTracker.getNbPoints + ~MbGenericTracker.getNbPolygon + ~MbGenericTracker.getPolygonFaces + ~MbGenericTracker.getPose + ~MbGenericTracker.getReferenceCameraName + ~MbGenericTracker.getRobustWeights + ~MbGenericTracker.getTrackerType + ~MbGenericTracker.init + ~MbGenericTracker.initClick + ~MbGenericTracker.initFromPoints + ~MbGenericTracker.initFromPose + ~MbGenericTracker.loadConfigFile + ~MbGenericTracker.loadModel + ~MbGenericTracker.reInitModel + ~MbGenericTracker.resetTracker + ~MbGenericTracker.saveConfigFile + ~MbGenericTracker.setAngleAppear + ~MbGenericTracker.setAngleDisappear + ~MbGenericTracker.setCameraParameters + ~MbGenericTracker.setCameraTransformationMatrix + ~MbGenericTracker.setClipping + ~MbGenericTracker.setDepthDenseFilteringMaxDistance + ~MbGenericTracker.setDepthDenseFilteringMethod + ~MbGenericTracker.setDepthDenseFilteringMinDistance + ~MbGenericTracker.setDepthDenseFilteringOccupancyRatio + ~MbGenericTracker.setDepthDenseSamplingStep + ~MbGenericTracker.setDepthNormalFaceCentroidMethod + ~MbGenericTracker.setDepthNormalFeatureEstimationMethod + ~MbGenericTracker.setDepthNormalPclPlaneEstimationMethod + ~MbGenericTracker.setDepthNormalPclPlaneEstimationRansacMaxIter + ~MbGenericTracker.setDepthNormalPclPlaneEstimationRansacThreshold + ~MbGenericTracker.setDepthNormalSamplingStep + ~MbGenericTracker.setDisplayFeatures + ~MbGenericTracker.setFarClippingDistance + ~MbGenericTracker.setFeatureFactors + ~MbGenericTracker.setGoodMovingEdgesRatioThreshold + ~MbGenericTracker.setKltMaskBorder + ~MbGenericTracker.setKltOpencv + ~MbGenericTracker.setKltThresholdAcceptation + ~MbGenericTracker.setLod + ~MbGenericTracker.setMask + ~MbGenericTracker.setMinLineLengthThresh + ~MbGenericTracker.setMinPolygonAreaThresh + ~MbGenericTracker.setMovingEdge + ~MbGenericTracker.setNearClippingDistance + ~MbGenericTracker.setOgreShowConfigDialog + ~MbGenericTracker.setOgreVisibilityTest + ~MbGenericTracker.setOptimizationMethod + ~MbGenericTracker.setPose + ~MbGenericTracker.setProjectionErrorComputation + ~MbGenericTracker.setProjectionErrorDisplay + ~MbGenericTracker.setProjectionErrorDisplayArrowLength + ~MbGenericTracker.setProjectionErrorDisplayArrowThickness + ~MbGenericTracker.setReferenceCameraName + ~MbGenericTracker.setScanLineVisibilityTest + ~MbGenericTracker.setTrackerType + ~MbGenericTracker.setUseDepthDenseTracking + ~MbGenericTracker.setUseDepthNormalTracking + ~MbGenericTracker.setUseEdgeTracking + ~MbGenericTracker.setUseKltTracking + ~MbGenericTracker.testTracking + ~MbGenericTracker.track + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~MbGenericTracker.getInitialMu + ~MbGenericTracker.getEstimatedDoF + ~MbGenericTracker.setLambda + ~MbGenericTracker.setCovarianceComputation + ~MbGenericTracker.setProjectionErrorMovingEdge + ~MbGenericTracker.getMaxIter + ~MbGenericTracker.getOptimizationMethod + ~MbGenericTracker.setInitialMu + ~MbGenericTracker.setMaxIter + ~MbGenericTracker.getAngleAppear + ~MbGenericTracker.GAUSS_NEWTON_OPT + ~MbGenericTracker.setPoseSavingFilename + ~MbGenericTracker.MbtOptimizationMethod + ~MbGenericTracker.getFarClippingDistance + ~MbGenericTracker.getAngleDisappear + ~MbGenericTracker.setStopCriteriaEpsilon + ~MbGenericTracker.setProjectionErrorKernelSize + ~MbGenericTracker.getLambda + ~MbGenericTracker.getCovarianceMatrix + ~MbGenericTracker.getNearClippingDistance + ~MbGenericTracker.getProjectionError + ~MbGenericTracker.LEVENBERG_MARQUARDT_OPT + ~MbGenericTracker.getStopCriteriaEpsilon + ~MbGenericTracker.setEstimatedDoF + ~MbGenericTracker.savePose + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~MbGenericTracker.__doc__ + ~MbGenericTracker.__init__ + ~MbGenericTracker.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~MbGenericTracker.DEPTH_DENSE_TRACKER + ~MbGenericTracker.DEPTH_NORMAL_TRACKER + ~MbGenericTracker.EDGE_TRACKER + ~MbGenericTracker.GAUSS_NEWTON_OPT + ~MbGenericTracker.KLT_TRACKER + ~MbGenericTracker.LEVENBERG_MARQUARDT_OPT + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.mbt.MbKltTracker.rst b/modules/python/doc/_autosummary/visp.mbt.MbKltTracker.rst new file mode 100644 index 0000000000..e6f776aac1 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.mbt.MbKltTracker.rst @@ -0,0 +1,140 @@ +MbKltTracker +============ + +.. currentmodule:: visp.mbt + +.. autoclass:: MbKltTracker + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~MbKltTracker.addCircle + ~MbKltTracker.display + ~MbKltTracker.getError + ~MbKltTracker.getFeaturesCircle + ~MbKltTracker.getFeaturesKlt + ~MbKltTracker.getFeaturesKltCylinder + ~MbKltTracker.getKltImagePoints + ~MbKltTracker.getKltImagePointsWithId + ~MbKltTracker.getKltMaskBorder + ~MbKltTracker.getKltNbPoints + ~MbKltTracker.getKltOpencv + ~MbKltTracker.getKltPoints + ~MbKltTracker.getKltThresholdAcceptation + ~MbKltTracker.getMaskBorder + ~MbKltTracker.getModelForDisplay + ~MbKltTracker.getNbKltPoints + ~MbKltTracker.getRobustWeights + ~MbKltTracker.getThresholdAcceptation + ~MbKltTracker.loadConfigFile + ~MbKltTracker.reInitModel + ~MbKltTracker.resetTracker + ~MbKltTracker.setCameraParameters + ~MbKltTracker.setKltMaskBorder + ~MbKltTracker.setKltOpencv + ~MbKltTracker.setKltThresholdAcceptation + ~MbKltTracker.setMaskBorder + ~MbKltTracker.setOgreVisibilityTest + ~MbKltTracker.setPose + ~MbKltTracker.setProjectionErrorComputation + ~MbKltTracker.setScanLineVisibilityTest + ~MbKltTracker.setThresholdAcceptation + ~MbKltTracker.setUseKltTracking + ~MbKltTracker.testTracking + ~MbKltTracker.track + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~MbKltTracker.getInitialMu + ~MbKltTracker.getEstimatedDoF + ~MbKltTracker.setLambda + ~MbKltTracker.setCovarianceComputation + ~MbKltTracker.setProjectionErrorMovingEdge + ~MbKltTracker.getMaxIter + ~MbKltTracker.setMinLineLengthThresh + ~MbKltTracker.getPose + ~MbKltTracker.getOptimizationMethod + ~MbKltTracker.setAngleAppear + ~MbKltTracker.setInitialMu + ~MbKltTracker.setMinPolygonAreaThresh + ~MbKltTracker.setMaxIter + ~MbKltTracker.getAngleAppear + ~MbKltTracker.setOptimizationMethod + ~MbKltTracker.initClick + ~MbKltTracker.setAngleDisappear + ~MbKltTracker.getNbPolygon + ~MbKltTracker.setOgreShowConfigDialog + ~MbKltTracker.initFromPoints + ~MbKltTracker.savePose + ~MbKltTracker.GAUSS_NEWTON_OPT + ~MbKltTracker.setPoseSavingFilename + ~MbKltTracker.MbtOptimizationMethod + ~MbKltTracker.getClipping + ~MbKltTracker.getCameraParameters + ~MbKltTracker.loadModel + ~MbKltTracker.setClipping + ~MbKltTracker.getFarClippingDistance + ~MbKltTracker.getFaces + ~MbKltTracker.setLod + ~MbKltTracker.initFromPose + ~MbKltTracker.setFarClippingDistance + ~MbKltTracker.setProjectionErrorKernelSize + ~MbKltTracker.getAngleDisappear + ~MbKltTracker.setStopCriteriaEpsilon + ~MbKltTracker.getLambda + ~MbKltTracker.setProjectionErrorDisplayArrowThickness + ~MbKltTracker.setNearClippingDistance + ~MbKltTracker.setProjectionErrorDisplayArrowLength + ~MbKltTracker.getCovarianceMatrix + ~MbKltTracker.getNearClippingDistance + ~MbKltTracker.setMask + ~MbKltTracker.getProjectionError + ~MbKltTracker.setDisplayFeatures + ~MbKltTracker.LEVENBERG_MARQUARDT_OPT + ~MbKltTracker.getStopCriteriaEpsilon + ~MbKltTracker.computeCurrentProjectionError + ~MbKltTracker.setEstimatedDoF + ~MbKltTracker.setProjectionErrorDisplay + ~MbKltTracker.getPolygonFaces + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~MbKltTracker.__doc__ + ~MbKltTracker.__init__ + ~MbKltTracker.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~MbKltTracker.GAUSS_NEWTON_OPT + ~MbKltTracker.LEVENBERG_MARQUARDT_OPT + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.mbt.MbTracker.rst b/modules/python/doc/_autosummary/visp.mbt.MbTracker.rst new file mode 100644 index 0000000000..f314187166 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.mbt.MbTracker.rst @@ -0,0 +1,108 @@ +MbTracker +========= + +.. currentmodule:: visp.mbt + +.. autoclass:: MbTracker + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~MbTracker.computeCurrentProjectionError + ~MbTracker.getAngleAppear + ~MbTracker.getAngleDisappear + ~MbTracker.getCameraParameters + ~MbTracker.getClipping + ~MbTracker.getCovarianceMatrix + ~MbTracker.getEstimatedDoF + ~MbTracker.getFaces + ~MbTracker.getFarClippingDistance + ~MbTracker.getInitialMu + ~MbTracker.getLambda + ~MbTracker.getMaxIter + ~MbTracker.getNbPolygon + ~MbTracker.getNearClippingDistance + ~MbTracker.getOptimizationMethod + ~MbTracker.getPolygonFaces + ~MbTracker.getPose + ~MbTracker.getProjectionError + ~MbTracker.getStopCriteriaEpsilon + ~MbTracker.initClick + ~MbTracker.initFromPoints + ~MbTracker.initFromPose + ~MbTracker.loadConfigFile + ~MbTracker.loadModel + ~MbTracker.savePose + ~MbTracker.setAngleAppear + ~MbTracker.setAngleDisappear + ~MbTracker.setCameraParameters + ~MbTracker.setClipping + ~MbTracker.setCovarianceComputation + ~MbTracker.setDisplayFeatures + ~MbTracker.setEstimatedDoF + ~MbTracker.setFarClippingDistance + ~MbTracker.setInitialMu + ~MbTracker.setLambda + ~MbTracker.setLod + ~MbTracker.setMask + ~MbTracker.setMaxIter + ~MbTracker.setMinLineLengthThresh + ~MbTracker.setMinPolygonAreaThresh + ~MbTracker.setNearClippingDistance + ~MbTracker.setOgreShowConfigDialog + ~MbTracker.setOgreVisibilityTest + ~MbTracker.setOptimizationMethod + ~MbTracker.setPoseSavingFilename + ~MbTracker.setProjectionErrorComputation + ~MbTracker.setProjectionErrorDisplay + ~MbTracker.setProjectionErrorDisplayArrowLength + ~MbTracker.setProjectionErrorDisplayArrowThickness + ~MbTracker.setProjectionErrorKernelSize + ~MbTracker.setProjectionErrorMovingEdge + ~MbTracker.setScanLineVisibilityTest + ~MbTracker.setStopCriteriaEpsilon + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~MbTracker.__doc__ + ~MbTracker.__init__ + ~MbTracker.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~MbTracker.GAUSS_NEWTON_OPT + ~MbTracker.LEVENBERG_MARQUARDT_OPT + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.mbt.MbtDistanceCircle.rst b/modules/python/doc/_autosummary/visp.mbt.MbtDistanceCircle.rst new file mode 100644 index 0000000000..7b194ee775 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.mbt.MbtDistanceCircle.rst @@ -0,0 +1,81 @@ +MbtDistanceCircle +================= + +.. currentmodule:: visp.mbt + +.. autoclass:: MbtDistanceCircle + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~MbtDistanceCircle.buildFrom + ~MbtDistanceCircle.computeInteractionMatrixError + ~MbtDistanceCircle.display + ~MbtDistanceCircle.displayMovingEdges + ~MbtDistanceCircle.getCameraParameters + ~MbtDistanceCircle.getFeaturesForDisplay + ~MbtDistanceCircle.getIndex + ~MbtDistanceCircle.getMeanWeight + ~MbtDistanceCircle.getModelForDisplay + ~MbtDistanceCircle.getName + ~MbtDistanceCircle.initInteractionMatrixError + ~MbtDistanceCircle.isTracked + ~MbtDistanceCircle.isVisible + ~MbtDistanceCircle.setCameraParameters + ~MbtDistanceCircle.setIndex + ~MbtDistanceCircle.setMeanWeight + ~MbtDistanceCircle.setName + ~MbtDistanceCircle.setTracked + ~MbtDistanceCircle.setVisible + ~MbtDistanceCircle.trackMovingEdge + ~MbtDistanceCircle.updateMovingEdge + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~MbtDistanceCircle.__doc__ + ~MbtDistanceCircle.__init__ + ~MbtDistanceCircle.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~MbtDistanceCircle.L + ~MbtDistanceCircle.Reinit + ~MbtDistanceCircle.error + ~MbtDistanceCircle.index_polygon + ~MbtDistanceCircle.isvisible + ~MbtDistanceCircle.nbFeature + ~MbtDistanceCircle.radius + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.mbt.MbtDistanceCylinder.rst b/modules/python/doc/_autosummary/visp.mbt.MbtDistanceCylinder.rst new file mode 100644 index 0000000000..0231516000 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.mbt.MbtDistanceCylinder.rst @@ -0,0 +1,85 @@ +MbtDistanceCylinder +=================== + +.. currentmodule:: visp.mbt + +.. autoclass:: MbtDistanceCylinder + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~MbtDistanceCylinder.buildFrom + ~MbtDistanceCylinder.computeInteractionMatrixError + ~MbtDistanceCylinder.display + ~MbtDistanceCylinder.displayMovingEdges + ~MbtDistanceCylinder.getCameraParameters + ~MbtDistanceCylinder.getFeaturesForDisplay + ~MbtDistanceCylinder.getIndex + ~MbtDistanceCylinder.getMeanWeight1 + ~MbtDistanceCylinder.getMeanWeight2 + ~MbtDistanceCylinder.getModelForDisplay + ~MbtDistanceCylinder.getName + ~MbtDistanceCylinder.initInteractionMatrixError + ~MbtDistanceCylinder.isTracked + ~MbtDistanceCylinder.isVisible + ~MbtDistanceCylinder.setCameraParameters + ~MbtDistanceCylinder.setIndex + ~MbtDistanceCylinder.setMeanWeight1 + ~MbtDistanceCylinder.setMeanWeight2 + ~MbtDistanceCylinder.setName + ~MbtDistanceCylinder.setTracked + ~MbtDistanceCylinder.setVisible + ~MbtDistanceCylinder.trackMovingEdge + ~MbtDistanceCylinder.updateMovingEdge + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~MbtDistanceCylinder.__doc__ + ~MbtDistanceCylinder.__init__ + ~MbtDistanceCylinder.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~MbtDistanceCylinder.L + ~MbtDistanceCylinder.Reinit + ~MbtDistanceCylinder.error + ~MbtDistanceCylinder.index_polygon + ~MbtDistanceCylinder.isvisible + ~MbtDistanceCylinder.nbFeature + ~MbtDistanceCylinder.nbFeaturel1 + ~MbtDistanceCylinder.nbFeaturel2 + ~MbtDistanceCylinder.radius + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.mbt.MbtDistanceKltCylinder.rst b/modules/python/doc/_autosummary/visp.mbt.MbtDistanceKltCylinder.rst new file mode 100644 index 0000000000..5e4f3644ae --- /dev/null +++ b/modules/python/doc/_autosummary/visp.mbt.MbtDistanceKltCylinder.rst @@ -0,0 +1,75 @@ +MbtDistanceKltCylinder +====================== + +.. currentmodule:: visp.mbt + +.. autoclass:: MbtDistanceKltCylinder + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~MbtDistanceKltCylinder.buildFrom + ~MbtDistanceKltCylinder.computeInteractionMatrixAndResidu + ~MbtDistanceKltCylinder.computeNbDetectedCurrent + ~MbtDistanceKltCylinder.display + ~MbtDistanceKltCylinder.displayPrimitive + ~MbtDistanceKltCylinder.getCameraParameters + ~MbtDistanceKltCylinder.getCurrentNumberPoints + ~MbtDistanceKltCylinder.getCurrentPoints + ~MbtDistanceKltCylinder.getCurrentPointsInd + ~MbtDistanceKltCylinder.getCylinder + ~MbtDistanceKltCylinder.getFeaturesForDisplay + ~MbtDistanceKltCylinder.getInitialNumberPoint + ~MbtDistanceKltCylinder.getModelForDisplay + ~MbtDistanceKltCylinder.hasEnoughPoints + ~MbtDistanceKltCylinder.init + ~MbtDistanceKltCylinder.isTracked + ~MbtDistanceKltCylinder.removeOutliers + ~MbtDistanceKltCylinder.setCameraParameters + ~MbtDistanceKltCylinder.setTracked + ~MbtDistanceKltCylinder.updateMask + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~MbtDistanceKltCylinder.__doc__ + ~MbtDistanceKltCylinder.__init__ + ~MbtDistanceKltCylinder.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~MbtDistanceKltCylinder.listIndicesCylinderBBox + ~MbtDistanceKltCylinder.useScanLine + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.mbt.MbtDistanceKltPoints.rst b/modules/python/doc/_autosummary/visp.mbt.MbtDistanceKltPoints.rst new file mode 100644 index 0000000000..f07bbf6583 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.mbt.MbtDistanceKltPoints.rst @@ -0,0 +1,72 @@ +MbtDistanceKltPoints +==================== + +.. currentmodule:: visp.mbt + +.. autoclass:: MbtDistanceKltPoints + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~MbtDistanceKltPoints.computeHomography + ~MbtDistanceKltPoints.computeInteractionMatrixAndResidu + ~MbtDistanceKltPoints.display + ~MbtDistanceKltPoints.displayPrimitive + ~MbtDistanceKltPoints.getCameraParameters + ~MbtDistanceKltPoints.getCurrentNormal + ~MbtDistanceKltPoints.getCurrentNumberPoints + ~MbtDistanceKltPoints.getCurrentPoints + ~MbtDistanceKltPoints.getCurrentPointsInd + ~MbtDistanceKltPoints.getFeaturesForDisplay + ~MbtDistanceKltPoints.getInitialNumberPoint + ~MbtDistanceKltPoints.getModelForDisplay + ~MbtDistanceKltPoints.hasEnoughPoints + ~MbtDistanceKltPoints.isTracked + ~MbtDistanceKltPoints.removeOutliers + ~MbtDistanceKltPoints.setCameraParameters + ~MbtDistanceKltPoints.setTracked + ~MbtDistanceKltPoints.updateMask + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~MbtDistanceKltPoints.__doc__ + ~MbtDistanceKltPoints.__init__ + ~MbtDistanceKltPoints.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~MbtDistanceKltPoints.useScanLine + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.mbt.MbtDistanceLine.rst b/modules/python/doc/_autosummary/visp.mbt.MbtDistanceLine.rst new file mode 100644 index 0000000000..32196e6ad5 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.mbt.MbtDistanceLine.rst @@ -0,0 +1,88 @@ +MbtDistanceLine +=============== + +.. currentmodule:: visp.mbt + +.. autoclass:: MbtDistanceLine + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~MbtDistanceLine.addPolygon + ~MbtDistanceLine.buildFrom + ~MbtDistanceLine.closeToImageBorder + ~MbtDistanceLine.computeInteractionMatrixError + ~MbtDistanceLine.display + ~MbtDistanceLine.displayMovingEdges + ~MbtDistanceLine.getCameraParameters + ~MbtDistanceLine.getFeaturesForDisplay + ~MbtDistanceLine.getIndex + ~MbtDistanceLine.getMeanWeight + ~MbtDistanceLine.getModelForDisplay + ~MbtDistanceLine.getName + ~MbtDistanceLine.getPolygon + ~MbtDistanceLine.initInteractionMatrixError + ~MbtDistanceLine.isTracked + ~MbtDistanceLine.isVisible + ~MbtDistanceLine.setCameraParameters + ~MbtDistanceLine.setIndex + ~MbtDistanceLine.setMeanWeight + ~MbtDistanceLine.setName + ~MbtDistanceLine.setTracked + ~MbtDistanceLine.setVisible + ~MbtDistanceLine.trackMovingEdge + ~MbtDistanceLine.updateMovingEdge + ~MbtDistanceLine.updateTracked + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~MbtDistanceLine.__doc__ + ~MbtDistanceLine.__init__ + ~MbtDistanceLine.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~MbtDistanceLine.L + ~MbtDistanceLine.Lindex_polygon + ~MbtDistanceLine.Lindex_polygon_tracked + ~MbtDistanceLine.Reinit + ~MbtDistanceLine.eline + ~MbtDistanceLine.error + ~MbtDistanceLine.isvisible + ~MbtDistanceLine.nbFeature + ~MbtDistanceLine.nbFeatureTotal + ~MbtDistanceLine.useScanLine + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.mbt.MbtFaceDepthDense.rst b/modules/python/doc/_autosummary/visp.mbt.MbtFaceDepthDense.rst new file mode 100644 index 0000000000..886acd2a2b --- /dev/null +++ b/modules/python/doc/_autosummary/visp.mbt.MbtFaceDepthDense.rst @@ -0,0 +1,79 @@ +MbtFaceDepthDense +================= + +.. currentmodule:: visp.mbt + +.. autoclass:: MbtFaceDepthDense + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~MbtFaceDepthDense.computeInteractionMatrixAndResidu + ~MbtFaceDepthDense.computeVisibility + ~MbtFaceDepthDense.computeVisibilityDisplay + ~MbtFaceDepthDense.display + ~MbtFaceDepthDense.displayFeature + ~MbtFaceDepthDense.getModelForDisplay + ~MbtFaceDepthDense.getNbFeatures + ~MbtFaceDepthDense.isTracked + ~MbtFaceDepthDense.isVisible + ~MbtFaceDepthDense.setCameraParameters + ~MbtFaceDepthDense.setDepthDenseFilteringMaxDistance + ~MbtFaceDepthDense.setDepthDenseFilteringMethod + ~MbtFaceDepthDense.setDepthDenseFilteringMinDistance + ~MbtFaceDepthDense.setDepthDenseFilteringOccupancyRatio + ~MbtFaceDepthDense.setScanLineVisibilityTest + ~MbtFaceDepthDense.setTracked + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~MbtFaceDepthDense.__doc__ + ~MbtFaceDepthDense.__init__ + ~MbtFaceDepthDense.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~MbtFaceDepthDense.DEPTH_OCCUPANCY_RATIO_FILTERING + ~MbtFaceDepthDense.MAX_DISTANCE_FILTERING + ~MbtFaceDepthDense.MIN_DISTANCE_FILTERING + ~MbtFaceDepthDense.NO_FILTERING + ~MbtFaceDepthDense.cam + ~MbtFaceDepthDense.clippingFlag + ~MbtFaceDepthDense.distFarClip + ~MbtFaceDepthDense.distNearClip + ~MbtFaceDepthDense.planeObject + ~MbtFaceDepthDense.useScanLine + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.mbt.MbtFaceDepthNormal.rst b/modules/python/doc/_autosummary/visp.mbt.MbtFaceDepthNormal.rst new file mode 100644 index 0000000000..4c1fd6266d --- /dev/null +++ b/modules/python/doc/_autosummary/visp.mbt.MbtFaceDepthNormal.rst @@ -0,0 +1,81 @@ +MbtFaceDepthNormal +================== + +.. currentmodule:: visp.mbt + +.. autoclass:: MbtFaceDepthNormal + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~MbtFaceDepthNormal.computeInteractionMatrix + ~MbtFaceDepthNormal.computeNormalVisibility + ~MbtFaceDepthNormal.computeVisibility + ~MbtFaceDepthNormal.computeVisibilityDisplay + ~MbtFaceDepthNormal.display + ~MbtFaceDepthNormal.displayFeature + ~MbtFaceDepthNormal.getFeaturesForDisplay + ~MbtFaceDepthNormal.getModelForDisplay + ~MbtFaceDepthNormal.isTracked + ~MbtFaceDepthNormal.isVisible + ~MbtFaceDepthNormal.setCameraParameters + ~MbtFaceDepthNormal.setFaceCentroidMethod + ~MbtFaceDepthNormal.setFeatureEstimationMethod + ~MbtFaceDepthNormal.setPclPlaneEstimationMethod + ~MbtFaceDepthNormal.setPclPlaneEstimationRansacMaxIter + ~MbtFaceDepthNormal.setPclPlaneEstimationRansacThreshold + ~MbtFaceDepthNormal.setScanLineVisibilityTest + ~MbtFaceDepthNormal.setTracked + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~MbtFaceDepthNormal.__doc__ + ~MbtFaceDepthNormal.__init__ + ~MbtFaceDepthNormal.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~MbtFaceDepthNormal.GEOMETRIC_CENTROID + ~MbtFaceDepthNormal.MEAN_CENTROID + ~MbtFaceDepthNormal.ROBUST_FEATURE_ESTIMATION + ~MbtFaceDepthNormal.ROBUST_SVD_PLANE_ESTIMATION + ~MbtFaceDepthNormal.cam + ~MbtFaceDepthNormal.clippingFlag + ~MbtFaceDepthNormal.distFarClip + ~MbtFaceDepthNormal.distNearClip + ~MbtFaceDepthNormal.planeObject + ~MbtFaceDepthNormal.useScanLine + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.mbt.MbtPolygon.rst b/modules/python/doc/_autosummary/visp.mbt.MbtPolygon.rst new file mode 100644 index 0000000000..ca0a1c5ceb --- /dev/null +++ b/modules/python/doc/_autosummary/visp.mbt.MbtPolygon.rst @@ -0,0 +1,124 @@ +MbtPolygon +========== + +.. currentmodule:: visp.mbt + +.. autoclass:: MbtPolygon + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~MbtPolygon.getIndex + ~MbtPolygon.getName + ~MbtPolygon.isAppearing + ~MbtPolygon.isPolygonOriented + ~MbtPolygon.isVisible + ~MbtPolygon.setIndex + ~MbtPolygon.setIsPolygonOriented + ~MbtPolygon.setLod + ~MbtPolygon.setMinLineLengthThresh + ~MbtPolygon.setMinPolygonAreaThresh + ~MbtPolygon.setName + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~MbtPolygon.LEFT_CLIPPING + ~MbtPolygon.clippingFlag + ~MbtPolygon.getNbCornerInsidePrevImage + ~MbtPolygon.getNbPoint + ~MbtPolygon.getRoiClipped + ~MbtPolygon.getPoint + ~MbtPolygon.getRoi + ~MbtPolygon.getNbCornerInsideImage + ~MbtPolygon.DOWN_CLIPPING + ~MbtPolygon.FOV_CLIPPING + ~MbtPolygon.UP_CLIPPING + ~MbtPolygon.getPolygonClipped + ~MbtPolygon.nbpt + ~MbtPolygon.NEAR_CLIPPING + ~MbtPolygon.getClippedPolygon + ~MbtPolygon.polyClipped + ~MbtPolygon.distFarClip + ~MbtPolygon.roiInsideImage + ~MbtPolygon.getClipping + ~MbtPolygon.setClipping + ~MbtPolygon.Polygon3DClippingType + ~MbtPolygon.getFarClippingDistance + ~MbtPolygon.getPolygonClippedWithInfo + ~MbtPolygon.setFarClippingDistance + ~MbtPolygon.setNearClippingDistance + ~MbtPolygon.addPoint + ~MbtPolygon.FAR_CLIPPING + ~MbtPolygon.ALL_CLIPPING + ~MbtPolygon.nbCornersInsidePrev + ~MbtPolygon.NO_CLIPPING + ~MbtPolygon.getNearClippingDistance + ~MbtPolygon.RIGHT_CLIPPING + ~MbtPolygon.distNearClip + ~MbtPolygon.getMinMaxRoi + ~MbtPolygon.changeFrame + ~MbtPolygon.computePolygonClipped + ~MbtPolygon.setNbPoint + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~MbtPolygon.__doc__ + ~MbtPolygon.__init__ + ~MbtPolygon.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~MbtPolygon.ALL_CLIPPING + ~MbtPolygon.DOWN_CLIPPING + ~MbtPolygon.FAR_CLIPPING + ~MbtPolygon.FOV_CLIPPING + ~MbtPolygon.LEFT_CLIPPING + ~MbtPolygon.NEAR_CLIPPING + ~MbtPolygon.NO_CLIPPING + ~MbtPolygon.RIGHT_CLIPPING + ~MbtPolygon.UP_CLIPPING + ~MbtPolygon.clippingFlag + ~MbtPolygon.distFarClip + ~MbtPolygon.distNearClip + ~MbtPolygon.hasOrientation + ~MbtPolygon.inLineLengthThresh + ~MbtPolygon.inPolygonAreaThresh + ~MbtPolygon.index + ~MbtPolygon.isappearing + ~MbtPolygon.isvisible + ~MbtPolygon.name + ~MbtPolygon.nbCornersInsidePrev + ~MbtPolygon.nbpt + ~MbtPolygon.polyClipped + ~MbtPolygon.useLod + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.mbt.MbtXmlGenericParser.rst b/modules/python/doc/_autosummary/visp.mbt.MbtXmlGenericParser.rst new file mode 100644 index 0000000000..0065acb675 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.mbt.MbtXmlGenericParser.rst @@ -0,0 +1,114 @@ +MbtXmlGenericParser +=================== + +.. currentmodule:: visp.mbt + +.. autoclass:: MbtXmlGenericParser + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~MbtXmlGenericParser.getAngleAppear + ~MbtXmlGenericParser.getAngleDisappear + ~MbtXmlGenericParser.getCameraParameters + ~MbtXmlGenericParser.getDepthDenseSamplingStepX + ~MbtXmlGenericParser.getDepthDenseSamplingStepY + ~MbtXmlGenericParser.getDepthNormalFeatureEstimationMethod + ~MbtXmlGenericParser.getDepthNormalPclPlaneEstimationMethod + ~MbtXmlGenericParser.getDepthNormalPclPlaneEstimationRansacMaxIter + ~MbtXmlGenericParser.getDepthNormalPclPlaneEstimationRansacThreshold + ~MbtXmlGenericParser.getDepthNormalSamplingStepX + ~MbtXmlGenericParser.getDepthNormalSamplingStepY + ~MbtXmlGenericParser.getEdgeMe + ~MbtXmlGenericParser.getFarClippingDistance + ~MbtXmlGenericParser.getFovClipping + ~MbtXmlGenericParser.getKltBlockSize + ~MbtXmlGenericParser.getKltHarrisParam + ~MbtXmlGenericParser.getKltMaskBorder + ~MbtXmlGenericParser.getKltMaxFeatures + ~MbtXmlGenericParser.getKltMinDistance + ~MbtXmlGenericParser.getKltPyramidLevels + ~MbtXmlGenericParser.getKltQuality + ~MbtXmlGenericParser.getKltWindowSize + ~MbtXmlGenericParser.getLodMinLineLengthThreshold + ~MbtXmlGenericParser.getLodMinPolygonAreaThreshold + ~MbtXmlGenericParser.getLodState + ~MbtXmlGenericParser.getNearClippingDistance + ~MbtXmlGenericParser.getProjectionErrorKernelSize + ~MbtXmlGenericParser.getProjectionErrorMe + ~MbtXmlGenericParser.hasFarClippingDistance + ~MbtXmlGenericParser.hasNearClippingDistance + ~MbtXmlGenericParser.parse + ~MbtXmlGenericParser.setAngleAppear + ~MbtXmlGenericParser.setAngleDisappear + ~MbtXmlGenericParser.setCameraParameters + ~MbtXmlGenericParser.setDepthDenseSamplingStepX + ~MbtXmlGenericParser.setDepthDenseSamplingStepY + ~MbtXmlGenericParser.setDepthNormalFeatureEstimationMethod + ~MbtXmlGenericParser.setDepthNormalPclPlaneEstimationMethod + ~MbtXmlGenericParser.setDepthNormalPclPlaneEstimationRansacMaxIter + ~MbtXmlGenericParser.setDepthNormalPclPlaneEstimationRansacThreshold + ~MbtXmlGenericParser.setDepthNormalSamplingStepX + ~MbtXmlGenericParser.setDepthNormalSamplingStepY + ~MbtXmlGenericParser.setEdgeMe + ~MbtXmlGenericParser.setFarClippingDistance + ~MbtXmlGenericParser.setKltBlockSize + ~MbtXmlGenericParser.setKltHarrisParam + ~MbtXmlGenericParser.setKltMaskBorder + ~MbtXmlGenericParser.setKltMaxFeatures + ~MbtXmlGenericParser.setKltMinDistance + ~MbtXmlGenericParser.setKltPyramidLevels + ~MbtXmlGenericParser.setKltQuality + ~MbtXmlGenericParser.setKltWindowSize + ~MbtXmlGenericParser.setNearClippingDistance + ~MbtXmlGenericParser.setProjectionErrorKernelSize + ~MbtXmlGenericParser.setProjectionErrorMe + ~MbtXmlGenericParser.setVerbose + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~MbtXmlGenericParser.__doc__ + ~MbtXmlGenericParser.__init__ + ~MbtXmlGenericParser.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~MbtXmlGenericParser.DEPTH_DENSE_PARSER + ~MbtXmlGenericParser.DEPTH_NORMAL_PARSER + ~MbtXmlGenericParser.EDGE_PARSER + ~MbtXmlGenericParser.KLT_PARSER + ~MbtXmlGenericParser.PROJECTION_ERROR_PARSER + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.mbt.rst b/modules/python/doc/_autosummary/visp.mbt.rst new file mode 100644 index 0000000000..733aa4e432 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.mbt.rst @@ -0,0 +1,47 @@ +mbt +=== + +.. automodule:: visp.mbt + + + + + + + + + + + + .. rubric:: Classes + + .. autosummary:: + :toctree: + :template: custom-class-template.rst + :nosignatures: + + MbDepthDenseTracker + MbDepthNormalTracker + MbEdgeKltTracker + MbEdgeTracker + MbGenericTracker + MbKltTracker + MbTracker + MbtDistanceCircle + MbtDistanceCylinder + MbtDistanceKltCylinder + MbtDistanceKltPoints + MbtDistanceLine + MbtFaceDepthDense + MbtFaceDepthNormal + MbtPolygon + MbtXmlGenericParser + + + + + + + + + diff --git a/modules/python/doc/_autosummary/visp.me.Me.rst b/modules/python/doc/_autosummary/visp.me.Me.rst new file mode 100644 index 0000000000..e1d1c59082 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.me.Me.rst @@ -0,0 +1,86 @@ +Me +== + +.. currentmodule:: visp.me + +.. autoclass:: Me + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~Me.checkSamplestep + ~Me.getAngleStep + ~Me.getLikelihoodThresholdType + ~Me.getMaskNumber + ~Me.getMaskSign + ~Me.getMaskSize + ~Me.getMinSampleStep + ~Me.getMu1 + ~Me.getMu2 + ~Me.getNbTotalSample + ~Me.getPointsToTrack + ~Me.getRange + ~Me.getSampleStep + ~Me.getStrip + ~Me.getThreshold + ~Me.initMask + ~Me.print + ~Me.setAngleStep + ~Me.setLikelihoodThresholdType + ~Me.setMaskNumber + ~Me.setMaskSign + ~Me.setMaskSize + ~Me.setMinSampleStep + ~Me.setMu1 + ~Me.setMu2 + ~Me.setNbTotalSample + ~Me.setPointsToTrack + ~Me.setRange + ~Me.setSampleStep + ~Me.setStrip + ~Me.setThreshold + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~Me.__doc__ + ~Me.__init__ + ~Me.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~Me.NORMALIZED_THRESHOLD + ~Me.OLD_THRESHOLD + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.me.MeEllipse.rst b/modules/python/doc/_autosummary/visp.me.MeEllipse.rst new file mode 100644 index 0000000000..5467e6c15c --- /dev/null +++ b/modules/python/doc/_autosummary/visp.me.MeEllipse.rst @@ -0,0 +1,90 @@ +MeEllipse +========= + +.. currentmodule:: visp.me + +.. autoclass:: MeEllipse + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~MeEllipse.display + ~MeEllipse.displayEllipse + ~MeEllipse.getArea + ~MeEllipse.getCenter + ~MeEllipse.getExpectedDensity + ~MeEllipse.getFirstEndpoint + ~MeEllipse.getHighestAngle + ~MeEllipse.getNumberOfGoodPoints + ~MeEllipse.getSecondEndpoint + ~MeEllipse.getSmallestAngle + ~MeEllipse.get_ABE + ~MeEllipse.get_nij + ~MeEllipse.initTracking + ~MeEllipse.printParameters + ~MeEllipse.setEndpoints + ~MeEllipse.setThresholdRobust + ~MeEllipse.track + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~MeEllipse.cPAvailable + ~MeEllipse.getMeList + ~MeEllipse.numberOfSignal + ~MeEllipse.setDisplay + ~MeEllipse.getInitRange + ~MeEllipse.get_cP + ~MeEllipse.totalNumberOfSignal + ~MeEllipse.getNbPoints + ~MeEllipse.setMeList + ~MeEllipse.outOfImage + ~MeEllipse.setMask + ~MeEllipse.get_p + ~MeEllipse.cP + ~MeEllipse.reset + ~MeEllipse.init + ~MeEllipse.p + ~MeEllipse.setInitRange + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~MeEllipse.__doc__ + ~MeEllipse.__init__ + ~MeEllipse.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~MeEllipse.cP + ~MeEllipse.cPAvailable + ~MeEllipse.p + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.me.MeLine.rst b/modules/python/doc/_autosummary/visp.me.MeLine.rst new file mode 100644 index 0000000000..e43724f14f --- /dev/null +++ b/modules/python/doc/_autosummary/visp.me.MeLine.rst @@ -0,0 +1,94 @@ +MeLine +====== + +.. currentmodule:: visp.me + +.. autoclass:: MeLine + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~MeLine.computeRhoSignFromIntensity + ~MeLine.computeRhoTheta + ~MeLine.display + ~MeLine.displayLine + ~MeLine.getA + ~MeLine.getB + ~MeLine.getC + ~MeLine.getEquationParam + ~MeLine.getExtremities + ~MeLine.getRho + ~MeLine.getTheta + ~MeLine.initTracking + ~MeLine.intersection + ~MeLine.leastSquare + ~MeLine.reSample + ~MeLine.sample + ~MeLine.seekExtremities + ~MeLine.setExtremities + ~MeLine.suppressPoints + ~MeLine.track + ~MeLine.updateDelta + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~MeLine.cPAvailable + ~MeLine.getMeList + ~MeLine.numberOfSignal + ~MeLine.setDisplay + ~MeLine.getInitRange + ~MeLine.get_cP + ~MeLine.totalNumberOfSignal + ~MeLine.getNbPoints + ~MeLine.setMeList + ~MeLine.outOfImage + ~MeLine.setMask + ~MeLine.get_p + ~MeLine.cP + ~MeLine.reset + ~MeLine.init + ~MeLine.p + ~MeLine.setInitRange + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~MeLine.__doc__ + ~MeLine.__init__ + ~MeLine.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~MeLine.cP + ~MeLine.cPAvailable + ~MeLine.p + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.me.MeNurbs.rst b/modules/python/doc/_autosummary/visp.me.MeNurbs.rst new file mode 100644 index 0000000000..56328a911e --- /dev/null +++ b/modules/python/doc/_autosummary/visp.me.MeNurbs.rst @@ -0,0 +1,89 @@ +MeNurbs +======= + +.. currentmodule:: visp.me + +.. autoclass:: MeNurbs + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~MeNurbs.display + ~MeNurbs.displayMeNurbs + ~MeNurbs.getNurbs + ~MeNurbs.initTracking + ~MeNurbs.localReSample + ~MeNurbs.reSample + ~MeNurbs.sample + ~MeNurbs.seekExtremities + ~MeNurbs.seekExtremitiesCanny + ~MeNurbs.setCannyThreshold + ~MeNurbs.setEnableCannyDetection + ~MeNurbs.setNbControlPoints + ~MeNurbs.suppressPoints + ~MeNurbs.supressNearPoints + ~MeNurbs.track + ~MeNurbs.updateDelta + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~MeNurbs.cPAvailable + ~MeNurbs.getMeList + ~MeNurbs.numberOfSignal + ~MeNurbs.setDisplay + ~MeNurbs.getInitRange + ~MeNurbs.get_cP + ~MeNurbs.totalNumberOfSignal + ~MeNurbs.getNbPoints + ~MeNurbs.setMeList + ~MeNurbs.outOfImage + ~MeNurbs.setMask + ~MeNurbs.get_p + ~MeNurbs.cP + ~MeNurbs.reset + ~MeNurbs.init + ~MeNurbs.p + ~MeNurbs.setInitRange + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~MeNurbs.__doc__ + ~MeNurbs.__init__ + ~MeNurbs.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~MeNurbs.cP + ~MeNurbs.cPAvailable + ~MeNurbs.p + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.me.MeSite.rst b/modules/python/doc/_autosummary/visp.me.MeSite.rst new file mode 100644 index 0000000000..a65a57b9ae --- /dev/null +++ b/modules/python/doc/_autosummary/visp.me.MeSite.rst @@ -0,0 +1,90 @@ +MeSite +====== + +.. currentmodule:: visp.me + +.. autoclass:: MeSite + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~MeSite.display + ~MeSite.displayMeSite + ~MeSite.distance + ~MeSite.getAlpha + ~MeSite.getState + ~MeSite.getWeight + ~MeSite.get_i + ~MeSite.get_ifloat + ~MeSite.get_j + ~MeSite.get_jfloat + ~MeSite.init + ~MeSite.setAlpha + ~MeSite.setDisplay + ~MeSite.setState + ~MeSite.setWeight + ~MeSite.sqrDistance + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~MeSite.__doc__ + ~MeSite.__init__ + ~MeSite.__module__ + ~MeSite.__ne__ + ~MeSite.__repr__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~MeSite.CONTRAST + ~MeSite.M_ESTIMATOR + ~MeSite.NONE + ~MeSite.NO_SUPPRESSION + ~MeSite.RANGE + ~MeSite.RANGE_RESULT + ~MeSite.RESULT + ~MeSite.THRESHOLD + ~MeSite.TOO_NEAR + ~MeSite.UNKNOW + ~MeSite.alpha + ~MeSite.ask_sign + ~MeSite.convlt + ~MeSite.i + ~MeSite.ifloat + ~MeSite.j + ~MeSite.jfloat + ~MeSite.normGradient + ~MeSite.weight + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.me.MeTracker.rst b/modules/python/doc/_autosummary/visp.me.MeTracker.rst new file mode 100644 index 0000000000..4a0463cf4a --- /dev/null +++ b/modules/python/doc/_autosummary/visp.me.MeTracker.rst @@ -0,0 +1,76 @@ +MeTracker +========= + +.. currentmodule:: visp.me + +.. autoclass:: MeTracker + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~MeTracker.display + ~MeTracker.getInitRange + ~MeTracker.getMeList + ~MeTracker.getNbPoints + ~MeTracker.init + ~MeTracker.initTracking + ~MeTracker.numberOfSignal + ~MeTracker.outOfImage + ~MeTracker.reset + ~MeTracker.setDisplay + ~MeTracker.setInitRange + ~MeTracker.setMask + ~MeTracker.setMeList + ~MeTracker.totalNumberOfSignal + ~MeTracker.track + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~MeTracker.cPAvailable + ~MeTracker.get_cP + ~MeTracker.get_p + ~MeTracker.cP + ~MeTracker.p + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~MeTracker.__doc__ + ~MeTracker.__init__ + ~MeTracker.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~MeTracker.cP + ~MeTracker.cPAvailable + ~MeTracker.p + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.me.Nurbs.rst b/modules/python/doc/_autosummary/visp.me.Nurbs.rst new file mode 100644 index 0000000000..b15e2a0130 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.me.Nurbs.rst @@ -0,0 +1,84 @@ +Nurbs +===== + +.. currentmodule:: visp.me + +.. autoclass:: Nurbs + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~Nurbs.computeCurvePoint + ~Nurbs.computeCurvePointStatic + ~Nurbs.curveKnotIns + ~Nurbs.curveKnotInsStatic + ~Nurbs.get_weights + ~Nurbs.globalCurveApprox + ~Nurbs.globalCurveApproxStatic + ~Nurbs.globalCurveInterp + ~Nurbs.globalCurveInterpStatic + ~Nurbs.removeCurveKnot + ~Nurbs.removeCurveKnotStatic + ~Nurbs.set_weights + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~Nurbs.set_p + ~Nurbs.get_crossingPoints + ~Nurbs.findSpan + ~Nurbs.crossingPoints + ~Nurbs.set_crossingPoints + ~Nurbs.knots + ~Nurbs.set_knots + ~Nurbs.get_controlPoints + ~Nurbs.get_knots + ~Nurbs.findSpanFromSpline + ~Nurbs.get_p + ~Nurbs.controlPoints + ~Nurbs.set_controlPoints + ~Nurbs.p + ~Nurbs.computeCurvePointFromSpline + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~Nurbs.__doc__ + ~Nurbs.__init__ + ~Nurbs.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~Nurbs.controlPoints + ~Nurbs.crossingPoints + ~Nurbs.knots + ~Nurbs.p + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.me.rst b/modules/python/doc/_autosummary/visp.me.rst new file mode 100644 index 0000000000..27deb82c1d --- /dev/null +++ b/modules/python/doc/_autosummary/visp.me.rst @@ -0,0 +1,38 @@ +me +== + +.. automodule:: visp.me + + + + + + + + + + + + .. rubric:: Classes + + .. autosummary:: + :toctree: + :template: custom-class-template.rst + :nosignatures: + + Me + MeEllipse + MeLine + MeNurbs + MeSite + MeTracker + Nurbs + + + + + + + + + diff --git a/modules/python/doc/_autosummary/visp.robot.Afma4.rst b/modules/python/doc/_autosummary/visp.robot.Afma4.rst new file mode 100644 index 0000000000..fb8555742b --- /dev/null +++ b/modules/python/doc/_autosummary/visp.robot.Afma4.rst @@ -0,0 +1,67 @@ +Afma4 +===== + +.. currentmodule:: visp.robot + +.. autoclass:: Afma4 + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~Afma4.getForwardKinematics + ~Afma4.getJointMax + ~Afma4.getJointMin + ~Afma4.get_cMe + ~Afma4.get_cVe + ~Afma4.get_cVf + ~Afma4.get_eJe + ~Afma4.get_fJe + ~Afma4.get_fJe_inverse + ~Afma4.get_fMc + ~Afma4.get_fMe + ~Afma4.init + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~Afma4.__doc__ + ~Afma4.__init__ + ~Afma4.__module__ + ~Afma4.__repr__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~Afma4.njoint + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.robot.Afma6.rst b/modules/python/doc/_autosummary/visp.robot.Afma6.rst new file mode 100644 index 0000000000..2212c9a318 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.robot.Afma6.rst @@ -0,0 +1,86 @@ +Afma6 +===== + +.. currentmodule:: visp.robot + +.. autoclass:: Afma6 + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~Afma6.getCameraParameters + ~Afma6.getCameraParametersProjType + ~Afma6.getCoupl56 + ~Afma6.getForwardKinematics + ~Afma6.getInverseKinematics + ~Afma6.getJointMax + ~Afma6.getJointMin + ~Afma6.getLong56 + ~Afma6.getToolType + ~Afma6.get_cMe + ~Afma6.get_cVe + ~Afma6.get_eJe + ~Afma6.get_eMc + ~Afma6.get_fJe + ~Afma6.get_fMc + ~Afma6.get_fMe + ~Afma6.init + ~Afma6.parseConfigFile + ~Afma6.set_eMc + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~Afma6.__doc__ + ~Afma6.__init__ + ~Afma6.__module__ + ~Afma6.__repr__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~Afma6.CONST_CCMOP_CAMERA_NAME + ~Afma6.CONST_GENERIC_CAMERA_NAME + ~Afma6.CONST_GRIPPER_CAMERA_NAME + ~Afma6.CONST_INTEL_D435_CAMERA_NAME + ~Afma6.CONST_VACUUM_CAMERA_NAME + ~Afma6.TOOL_CCMOP + ~Afma6.TOOL_CUSTOM + ~Afma6.TOOL_GENERIC_CAMERA + ~Afma6.TOOL_GRIPPER + ~Afma6.TOOL_INTEL_D435_CAMERA + ~Afma6.TOOL_VACUUM + ~Afma6.defaultTool + ~Afma6.njoint + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.robot.Biclops.rst b/modules/python/doc/_autosummary/visp.robot.Biclops.rst new file mode 100644 index 0000000000..3aa788d97e --- /dev/null +++ b/modules/python/doc/_autosummary/visp.robot.Biclops.rst @@ -0,0 +1,72 @@ +Biclops +======= + +.. currentmodule:: visp.robot + +.. autoclass:: Biclops + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~Biclops.computeMGD + ~Biclops.getDenavitHartenbergModel + ~Biclops.get_cMe + ~Biclops.get_cVe + ~Biclops.get_eJe + ~Biclops.get_fJe + ~Biclops.get_fMc + ~Biclops.get_fMe + ~Biclops.init + ~Biclops.setDenavitHartenbergModel + ~Biclops.set_cMe + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~Biclops.__doc__ + ~Biclops.__init__ + ~Biclops.__module__ + ~Biclops.__repr__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~Biclops.DH1 + ~Biclops.DH2 + ~Biclops.h + ~Biclops.ndof + ~Biclops.panJointLimit + ~Biclops.speedLimit + ~Biclops.tiltJointLimit + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.robot.ImageSimulator.rst b/modules/python/doc/_autosummary/visp.robot.ImageSimulator.rst new file mode 100644 index 0000000000..8589c039c5 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.robot.ImageSimulator.rst @@ -0,0 +1,66 @@ +ImageSimulator +============== + +.. currentmodule:: visp.robot + +.. autoclass:: ImageSimulator + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~ImageSimulator.get3DcornersTextureRectangle + ~ImageSimulator.getImage + ~ImageSimulator.getImageMultiplePlanes + ~ImageSimulator.init + ~ImageSimulator.setBackGroundTexture + ~ImageSimulator.setCameraPosition + ~ImageSimulator.setCleanPreviousImage + ~ImageSimulator.setInterpolationType + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~ImageSimulator.__doc__ + ~ImageSimulator.__init__ + ~ImageSimulator.__module__ + ~ImageSimulator.__repr__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~ImageSimulator.BILINEAR_INTERPOLATION + ~ImageSimulator.COLORED + ~ImageSimulator.GRAY_SCALED + ~ImageSimulator.SIMPLE + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.robot.Pioneer.rst b/modules/python/doc/_autosummary/visp.robot.Pioneer.rst new file mode 100644 index 0000000000..4c810e201c --- /dev/null +++ b/modules/python/doc/_autosummary/visp.robot.Pioneer.rst @@ -0,0 +1,53 @@ +Pioneer +======= + +.. currentmodule:: visp.robot + +.. autoclass:: Pioneer + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~Pioneer.set_eJe + ~Pioneer.get_eJe + ~Pioneer.set_cMe + ~Pioneer.get_cVe + ~Pioneer.get_cMe + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~Pioneer.__doc__ + ~Pioneer.__init__ + ~Pioneer.__module__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.robot.PioneerPan.rst b/modules/python/doc/_autosummary/visp.robot.PioneerPan.rst new file mode 100644 index 0000000000..1c7f93d60d --- /dev/null +++ b/modules/python/doc/_autosummary/visp.robot.PioneerPan.rst @@ -0,0 +1,53 @@ +PioneerPan +========== + +.. currentmodule:: visp.robot + +.. autoclass:: PioneerPan + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~PioneerPan.set_eJe + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~PioneerPan.get_eJe + ~PioneerPan.set_cMe + ~PioneerPan.get_cVe + ~PioneerPan.get_cMe + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~PioneerPan.__doc__ + ~PioneerPan.__init__ + ~PioneerPan.__module__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.robot.Pololu.rst b/modules/python/doc/_autosummary/visp.robot.Pololu.rst new file mode 100644 index 0000000000..04c6fa3b43 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.robot.Pololu.rst @@ -0,0 +1,67 @@ +Pololu +====== + +.. currentmodule:: visp.robot + +.. autoclass:: Pololu + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~Pololu.calibrate + ~Pololu.connect + ~Pololu.connected + ~Pololu.getAngularPosition + ~Pololu.getPwmPosition + ~Pololu.getRangeAngles + ~Pololu.getRangePwm + ~Pololu.pwmToRad + ~Pololu.radSToSpeed + ~Pololu.radToPwm + ~Pololu.setAngularPosition + ~Pololu.setAngularRange + ~Pololu.setAngularVelocity + ~Pololu.setPwmPosition + ~Pololu.setPwmRange + ~Pololu.setPwmVelocity + ~Pololu.setVerbose + ~Pololu.speedToRadS + ~Pololu.stopVelocityCmd + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~Pololu.__doc__ + ~Pololu.__init__ + ~Pololu.__module__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.robot.Ptu46.rst b/modules/python/doc/_autosummary/visp.robot.Ptu46.rst new file mode 100644 index 0000000000..82ab55193f --- /dev/null +++ b/modules/python/doc/_autosummary/visp.robot.Ptu46.rst @@ -0,0 +1,63 @@ +Ptu46 +===== + +.. currentmodule:: visp.robot + +.. autoclass:: Ptu46 + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~Ptu46.computeMGD + ~Ptu46.get_cMe + ~Ptu46.get_cVe + ~Ptu46.get_eJe + ~Ptu46.get_fJe + ~Ptu46.init + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~Ptu46.__doc__ + ~Ptu46.__init__ + ~Ptu46.__module__ + ~Ptu46.__repr__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~Ptu46.L + ~Ptu46.h + ~Ptu46.ndof + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.robot.QbDevice.rst b/modules/python/doc/_autosummary/visp.robot.QbDevice.rst new file mode 100644 index 0000000000..4ac4b90bd7 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.robot.QbDevice.rst @@ -0,0 +1,51 @@ +QbDevice +======== + +.. currentmodule:: visp.robot + +.. autoclass:: QbDevice + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~QbDevice.getCurrentMax + ~QbDevice.getPositionLimits + ~QbDevice.setMaxRepeats + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~QbDevice.__doc__ + ~QbDevice.__init__ + ~QbDevice.__module__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.robot.QbSoftHand.rst b/modules/python/doc/_autosummary/visp.robot.QbSoftHand.rst new file mode 100644 index 0000000000..8ad15b2173 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.robot.QbSoftHand.rst @@ -0,0 +1,54 @@ +QbSoftHand +========== + +.. currentmodule:: visp.robot + +.. autoclass:: QbSoftHand + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~QbSoftHand.getCurrent + ~QbSoftHand.getPosition + ~QbSoftHand.setPosition + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~QbSoftHand.getPositionLimits + ~QbSoftHand.getCurrentMax + ~QbSoftHand.setMaxRepeats + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~QbSoftHand.__doc__ + ~QbSoftHand.__init__ + ~QbSoftHand.__module__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.robot.ReflexTakktile2.rst b/modules/python/doc/_autosummary/visp.robot.ReflexTakktile2.rst new file mode 100644 index 0000000000..ab326cb935 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.robot.ReflexTakktile2.rst @@ -0,0 +1,67 @@ +ReflexTakktile2 +=============== + +.. currentmodule:: visp.robot + +.. autoclass:: ReflexTakktile2 + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~ReflexTakktile2.calibrate + ~ReflexTakktile2.disableTorque + ~ReflexTakktile2.getHandInfo + ~ReflexTakktile2.getNumFingers + ~ReflexTakktile2.getNumSensorsPerFinger + ~ReflexTakktile2.getNumServos + ~ReflexTakktile2.getPosition + ~ReflexTakktile2.getVelocity + ~ReflexTakktile2.open + ~ReflexTakktile2.setFingerConfigFile + ~ReflexTakktile2.setMotorConfigFile + ~ReflexTakktile2.setNetworkInterface + ~ReflexTakktile2.setPosition + ~ReflexTakktile2.setPositioningVelocity + ~ReflexTakktile2.setTactileConfigFile + ~ReflexTakktile2.setTactileThreshold + ~ReflexTakktile2.setVelocityUntilAnyContact + ~ReflexTakktile2.setVelocityUntilEachContact + ~ReflexTakktile2.wait + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~ReflexTakktile2.__doc__ + ~ReflexTakktile2.__init__ + ~ReflexTakktile2.__module__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.robot.RingLight.rst b/modules/python/doc/_autosummary/visp.robot.RingLight.rst new file mode 100644 index 0000000000..6fdd0a7fc5 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.robot.RingLight.rst @@ -0,0 +1,51 @@ +RingLight +========= + +.. currentmodule:: visp.robot + +.. autoclass:: RingLight + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~RingLight.off + ~RingLight.on + ~RingLight.pulse + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~RingLight.__doc__ + ~RingLight.__init__ + ~RingLight.__module__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.robot.Robot.rst b/modules/python/doc/_autosummary/visp.robot.Robot.rst new file mode 100644 index 0000000000..0e8506acb3 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.robot.Robot.rst @@ -0,0 +1,75 @@ +Robot +===== + +.. currentmodule:: visp.robot + +.. autoclass:: Robot + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~Robot.getMaxRotationVelocity + ~Robot.getMaxTranslationVelocity + ~Robot.getNDof + ~Robot.getPosition + ~Robot.getRobotState + ~Robot.saturateVelocities + ~Robot.setMaxRotationVelocity + ~Robot.setMaxTranslationVelocity + ~Robot.setRobotState + ~Robot.setVerbose + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~Robot.__doc__ + ~Robot.__init__ + ~Robot.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~Robot.ARTICULAR_FRAME + ~Robot.CAMERA_FRAME + ~Robot.END_EFFECTOR_FRAME + ~Robot.JOINT_STATE + ~Robot.MIXT_FRAME + ~Robot.REFERENCE_FRAME + ~Robot.STATE_ACCELERATION_CONTROL + ~Robot.STATE_FORCE_TORQUE_CONTROL + ~Robot.STATE_POSITION_CONTROL + ~Robot.STATE_STOP + ~Robot.STATE_VELOCITY_CONTROL + ~Robot.TOOL_FRAME + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.robot.RobotPololuPtu.rst b/modules/python/doc/_autosummary/visp.robot.RobotPololuPtu.rst new file mode 100644 index 0000000000..9a3d01f7fb --- /dev/null +++ b/modules/python/doc/_autosummary/visp.robot.RobotPololuPtu.rst @@ -0,0 +1,97 @@ +RobotPololuPtu +============== + +.. currentmodule:: visp.robot + +.. autoclass:: RobotPololuPtu + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~RobotPololuPtu.getAngularVelocityResolution + ~RobotPololuPtu.getPosition + ~RobotPololuPtu.getPositioningVelocityPercentage + ~RobotPololuPtu.get_eJe + ~RobotPololuPtu.get_fJe + ~RobotPololuPtu.setPosition + ~RobotPololuPtu.setPositioningVelocityPercentage + ~RobotPololuPtu.setRobotState + ~RobotPololuPtu.setVelocity + ~RobotPololuPtu.setVerbose + ~RobotPololuPtu.stopVelocity + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~RobotPololuPtu.REFERENCE_FRAME + ~RobotPololuPtu.setMaxTranslationVelocity + ~RobotPololuPtu.getRobotState + ~RobotPololuPtu.STATE_STOP + ~RobotPololuPtu.STATE_VELOCITY_CONTROL + ~RobotPololuPtu.STATE_FORCE_TORQUE_CONTROL + ~RobotPololuPtu.STATE_ACCELERATION_CONTROL + ~RobotPololuPtu.setMaxRotationVelocity + ~RobotPololuPtu.ControlFrameType + ~RobotPololuPtu.CAMERA_FRAME + ~RobotPololuPtu.MIXT_FRAME + ~RobotPololuPtu.getMaxRotationVelocity + ~RobotPololuPtu.STATE_POSITION_CONTROL + ~RobotPololuPtu.TOOL_FRAME + ~RobotPololuPtu.JOINT_STATE + ~RobotPololuPtu.ARTICULAR_FRAME + ~RobotPololuPtu.END_EFFECTOR_FRAME + ~RobotPololuPtu.RobotStateType + ~RobotPololuPtu.saturateVelocities + ~RobotPololuPtu.getMaxTranslationVelocity + ~RobotPololuPtu.getNDof + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~RobotPololuPtu.__doc__ + ~RobotPololuPtu.__init__ + ~RobotPololuPtu.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~RobotPololuPtu.ARTICULAR_FRAME + ~RobotPololuPtu.CAMERA_FRAME + ~RobotPololuPtu.END_EFFECTOR_FRAME + ~RobotPololuPtu.JOINT_STATE + ~RobotPololuPtu.MIXT_FRAME + ~RobotPololuPtu.REFERENCE_FRAME + ~RobotPololuPtu.STATE_ACCELERATION_CONTROL + ~RobotPololuPtu.STATE_FORCE_TORQUE_CONTROL + ~RobotPololuPtu.STATE_POSITION_CONTROL + ~RobotPololuPtu.STATE_STOP + ~RobotPololuPtu.STATE_VELOCITY_CONTROL + ~RobotPololuPtu.TOOL_FRAME + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.robot.RobotSimulator.rst b/modules/python/doc/_autosummary/visp.robot.RobotSimulator.rst new file mode 100644 index 0000000000..6bc8e7d11b --- /dev/null +++ b/modules/python/doc/_autosummary/visp.robot.RobotSimulator.rst @@ -0,0 +1,91 @@ +RobotSimulator +============== + +.. currentmodule:: visp.robot + +.. autoclass:: RobotSimulator + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~RobotSimulator.getSamplingTime + ~RobotSimulator.setSamplingTime + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~RobotSimulator.REFERENCE_FRAME + ~RobotSimulator.setMaxTranslationVelocity + ~RobotSimulator.getRobotState + ~RobotSimulator.STATE_STOP + ~RobotSimulator.getPosition + ~RobotSimulator.STATE_VELOCITY_CONTROL + ~RobotSimulator.STATE_FORCE_TORQUE_CONTROL + ~RobotSimulator.STATE_ACCELERATION_CONTROL + ~RobotSimulator.setMaxRotationVelocity + ~RobotSimulator.ControlFrameType + ~RobotSimulator.CAMERA_FRAME + ~RobotSimulator.MIXT_FRAME + ~RobotSimulator.getMaxRotationVelocity + ~RobotSimulator.setVerbose + ~RobotSimulator.STATE_POSITION_CONTROL + ~RobotSimulator.TOOL_FRAME + ~RobotSimulator.JOINT_STATE + ~RobotSimulator.getNDof + ~RobotSimulator.END_EFFECTOR_FRAME + ~RobotSimulator.RobotStateType + ~RobotSimulator.setRobotState + ~RobotSimulator.saturateVelocities + ~RobotSimulator.getMaxTranslationVelocity + ~RobotSimulator.ARTICULAR_FRAME + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~RobotSimulator.__doc__ + ~RobotSimulator.__init__ + ~RobotSimulator.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~RobotSimulator.ARTICULAR_FRAME + ~RobotSimulator.CAMERA_FRAME + ~RobotSimulator.END_EFFECTOR_FRAME + ~RobotSimulator.JOINT_STATE + ~RobotSimulator.MIXT_FRAME + ~RobotSimulator.REFERENCE_FRAME + ~RobotSimulator.STATE_ACCELERATION_CONTROL + ~RobotSimulator.STATE_FORCE_TORQUE_CONTROL + ~RobotSimulator.STATE_POSITION_CONTROL + ~RobotSimulator.STATE_STOP + ~RobotSimulator.STATE_VELOCITY_CONTROL + ~RobotSimulator.TOOL_FRAME + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.robot.RobotTemplate.rst b/modules/python/doc/_autosummary/visp.robot.RobotTemplate.rst new file mode 100644 index 0000000000..cd6bd6025d --- /dev/null +++ b/modules/python/doc/_autosummary/visp.robot.RobotTemplate.rst @@ -0,0 +1,96 @@ +RobotTemplate +============= + +.. currentmodule:: visp.robot + +.. autoclass:: RobotTemplate + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~RobotTemplate.getDisplacement + ~RobotTemplate.getPosition + ~RobotTemplate.get_eJe + ~RobotTemplate.get_eMc + ~RobotTemplate.get_fJe + ~RobotTemplate.setPosition + ~RobotTemplate.setVelocity + ~RobotTemplate.set_eMc + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~RobotTemplate.REFERENCE_FRAME + ~RobotTemplate.setMaxTranslationVelocity + ~RobotTemplate.getRobotState + ~RobotTemplate.STATE_STOP + ~RobotTemplate.STATE_VELOCITY_CONTROL + ~RobotTemplate.STATE_FORCE_TORQUE_CONTROL + ~RobotTemplate.STATE_ACCELERATION_CONTROL + ~RobotTemplate.setMaxRotationVelocity + ~RobotTemplate.ControlFrameType + ~RobotTemplate.CAMERA_FRAME + ~RobotTemplate.MIXT_FRAME + ~RobotTemplate.getMaxRotationVelocity + ~RobotTemplate.setVerbose + ~RobotTemplate.STATE_POSITION_CONTROL + ~RobotTemplate.TOOL_FRAME + ~RobotTemplate.JOINT_STATE + ~RobotTemplate.getNDof + ~RobotTemplate.END_EFFECTOR_FRAME + ~RobotTemplate.RobotStateType + ~RobotTemplate.setRobotState + ~RobotTemplate.saturateVelocities + ~RobotTemplate.getMaxTranslationVelocity + ~RobotTemplate.ARTICULAR_FRAME + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~RobotTemplate.__doc__ + ~RobotTemplate.__init__ + ~RobotTemplate.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~RobotTemplate.ARTICULAR_FRAME + ~RobotTemplate.CAMERA_FRAME + ~RobotTemplate.END_EFFECTOR_FRAME + ~RobotTemplate.JOINT_STATE + ~RobotTemplate.MIXT_FRAME + ~RobotTemplate.REFERENCE_FRAME + ~RobotTemplate.STATE_ACCELERATION_CONTROL + ~RobotTemplate.STATE_FORCE_TORQUE_CONTROL + ~RobotTemplate.STATE_POSITION_CONTROL + ~RobotTemplate.STATE_STOP + ~RobotTemplate.STATE_VELOCITY_CONTROL + ~RobotTemplate.TOOL_FRAME + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.robot.RobotWireFrameSimulator.rst b/modules/python/doc/_autosummary/visp.robot.RobotWireFrameSimulator.rst new file mode 100644 index 0000000000..d2b1fd2d7c --- /dev/null +++ b/modules/python/doc/_autosummary/visp.robot.RobotWireFrameSimulator.rst @@ -0,0 +1,110 @@ +RobotWireFrameSimulator +======================= + +.. currentmodule:: visp.robot + +.. autoclass:: RobotWireFrameSimulator + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~RobotWireFrameSimulator.getExternalCameraParameters + ~RobotWireFrameSimulator.getExternalCameraPosition + ~RobotWireFrameSimulator.getInternalView + ~RobotWireFrameSimulator.get_cMo + ~RobotWireFrameSimulator.get_fMo + ~RobotWireFrameSimulator.initScene + ~RobotWireFrameSimulator.setCameraColor + ~RobotWireFrameSimulator.setConstantSamplingTimeMode + ~RobotWireFrameSimulator.setCurrentViewColor + ~RobotWireFrameSimulator.setDesiredCameraPosition + ~RobotWireFrameSimulator.setDesiredViewColor + ~RobotWireFrameSimulator.setDisplayRobotType + ~RobotWireFrameSimulator.setExternalCameraPosition + ~RobotWireFrameSimulator.setGraphicsThickness + ~RobotWireFrameSimulator.setSamplingTime + ~RobotWireFrameSimulator.setSingularityManagement + ~RobotWireFrameSimulator.setVerbose + ~RobotWireFrameSimulator.set_fMo + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~RobotWireFrameSimulator.REFERENCE_FRAME + ~RobotWireFrameSimulator.setMaxTranslationVelocity + ~RobotWireFrameSimulator.getRobotState + ~RobotWireFrameSimulator.STATE_STOP + ~RobotWireFrameSimulator.getPosition + ~RobotWireFrameSimulator.STATE_VELOCITY_CONTROL + ~RobotWireFrameSimulator.STATE_FORCE_TORQUE_CONTROL + ~RobotWireFrameSimulator.STATE_ACCELERATION_CONTROL + ~RobotWireFrameSimulator.setMaxRotationVelocity + ~RobotWireFrameSimulator.ControlFrameType + ~RobotWireFrameSimulator.CAMERA_FRAME + ~RobotWireFrameSimulator.MIXT_FRAME + ~RobotWireFrameSimulator.getMaxRotationVelocity + ~RobotWireFrameSimulator.STATE_POSITION_CONTROL + ~RobotWireFrameSimulator.TOOL_FRAME + ~RobotWireFrameSimulator.JOINT_STATE + ~RobotWireFrameSimulator.ARTICULAR_FRAME + ~RobotWireFrameSimulator.END_EFFECTOR_FRAME + ~RobotWireFrameSimulator.RobotStateType + ~RobotWireFrameSimulator.setRobotState + ~RobotWireFrameSimulator.saturateVelocities + ~RobotWireFrameSimulator.getMaxTranslationVelocity + ~RobotWireFrameSimulator.getSamplingTime + ~RobotWireFrameSimulator.getNDof + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~RobotWireFrameSimulator.__doc__ + ~RobotWireFrameSimulator.__init__ + ~RobotWireFrameSimulator.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~RobotWireFrameSimulator.ARTICULAR_FRAME + ~RobotWireFrameSimulator.CAMERA_FRAME + ~RobotWireFrameSimulator.END_EFFECTOR_FRAME + ~RobotWireFrameSimulator.I + ~RobotWireFrameSimulator.JOINT_STATE + ~RobotWireFrameSimulator.MIXT_FRAME + ~RobotWireFrameSimulator.MODEL_3D + ~RobotWireFrameSimulator.MODEL_DH + ~RobotWireFrameSimulator.REFERENCE_FRAME + ~RobotWireFrameSimulator.STATE_ACCELERATION_CONTROL + ~RobotWireFrameSimulator.STATE_FORCE_TORQUE_CONTROL + ~RobotWireFrameSimulator.STATE_POSITION_CONTROL + ~RobotWireFrameSimulator.STATE_STOP + ~RobotWireFrameSimulator.STATE_VELOCITY_CONTROL + ~RobotWireFrameSimulator.TOOL_FRAME + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.robot.Servolens.rst b/modules/python/doc/_autosummary/visp.robot.Servolens.rst new file mode 100644 index 0000000000..507e0e1a0f --- /dev/null +++ b/modules/python/doc/_autosummary/visp.robot.Servolens.rst @@ -0,0 +1,74 @@ +Servolens +========= + +.. currentmodule:: visp.robot + +.. autoclass:: Servolens + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~Servolens.close + ~Servolens.enablePrompt + ~Servolens.getCameraParameters + ~Servolens.getPosition + ~Servolens.open + ~Servolens.reset + ~Servolens.setAutoIris + ~Servolens.setController + ~Servolens.setPosition + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~Servolens.__doc__ + ~Servolens.__init__ + ~Servolens.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~Servolens.AUTO + ~Servolens.CONTROLLED + ~Servolens.FOCUS + ~Servolens.FOCUS_MAX + ~Servolens.FOCUS_MIN + ~Servolens.IRIS + ~Servolens.IRIS_MAX + ~Servolens.IRIS_MIN + ~Servolens.RELEASED + ~Servolens.ZOOM + ~Servolens.ZOOM_MAX + ~Servolens.ZOOM_MIN + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.robot.SimulatorAfma6.rst b/modules/python/doc/_autosummary/visp.robot.SimulatorAfma6.rst new file mode 100644 index 0000000000..39b4c2ae21 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.robot.SimulatorAfma6.rst @@ -0,0 +1,175 @@ +SimulatorAfma6 +============== + +.. currentmodule:: visp.robot + +.. autoclass:: SimulatorAfma6 + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~SimulatorAfma6.getCameraParameters + ~SimulatorAfma6.getDisplacement + ~SimulatorAfma6.getPosition + ~SimulatorAfma6.getPositioningVelocity + ~SimulatorAfma6.getVelocity + ~SimulatorAfma6.get_cMe + ~SimulatorAfma6.get_cVe + ~SimulatorAfma6.get_eJe + ~SimulatorAfma6.get_fJe + ~SimulatorAfma6.init + ~SimulatorAfma6.initialiseCameraRelativeToObject + ~SimulatorAfma6.initialiseObjectRelativeToCamera + ~SimulatorAfma6.move + ~SimulatorAfma6.readPosFile + ~SimulatorAfma6.savePosFile + ~SimulatorAfma6.setCameraParameters + ~SimulatorAfma6.setJointLimit + ~SimulatorAfma6.setPosition + ~SimulatorAfma6.setPositioningVelocity + ~SimulatorAfma6.setRobotState + ~SimulatorAfma6.setVelocity + ~SimulatorAfma6.stopMotion + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~SimulatorAfma6.setExternalCameraPosition + ~SimulatorAfma6.I + ~SimulatorAfma6.setMaxTranslationVelocity + ~SimulatorAfma6.getRobotState + ~SimulatorAfma6.STATE_STOP + ~SimulatorAfma6.setDesiredViewColor + ~SimulatorAfma6.STATE_VELOCITY_CONTROL + ~SimulatorAfma6.STATE_FORCE_TORQUE_CONTROL + ~SimulatorAfma6.ControlFrameType + ~SimulatorAfma6.CONST_GRIPPER_CAMERA_NAME + ~SimulatorAfma6.setCurrentViewColor + ~SimulatorAfma6.defaultTool + ~SimulatorAfma6.MODEL_3D + ~SimulatorAfma6.parseConfigFile + ~SimulatorAfma6.MODEL_DH + ~SimulatorAfma6.setConstantSamplingTimeMode + ~SimulatorAfma6.getCoupl56 + ~SimulatorAfma6.CAMERA_FRAME + ~SimulatorAfma6.get_fMo + ~SimulatorAfma6.setVerbose + ~SimulatorAfma6.CONST_VACUUM_CAMERA_NAME + ~SimulatorAfma6.setSingularityManagement + ~SimulatorAfma6.CONST_INTEL_D435_CAMERA_NAME + ~SimulatorAfma6.getExternalCameraPosition + ~SimulatorAfma6.njoint + ~SimulatorAfma6.DisplayRobotType + ~SimulatorAfma6.JOINT_STATE + ~SimulatorAfma6.ARTICULAR_FRAME + ~SimulatorAfma6.getExternalCameraParameters + ~SimulatorAfma6.getJointMax + ~SimulatorAfma6.getInternalView + ~SimulatorAfma6.getLong56 + ~SimulatorAfma6.END_EFFECTOR_FRAME + ~SimulatorAfma6.setGraphicsThickness + ~SimulatorAfma6.getForwardKinematics + ~SimulatorAfma6.saturateVelocities + ~SimulatorAfma6.set_fMo + ~SimulatorAfma6.getMaxTranslationVelocity + ~SimulatorAfma6.getSamplingTime + ~SimulatorAfma6.getNDof + ~SimulatorAfma6.REFERENCE_FRAME + ~SimulatorAfma6.setSamplingTime + ~SimulatorAfma6.getInverseKinematics + ~SimulatorAfma6.get_fMc + ~SimulatorAfma6.setCameraColor + ~SimulatorAfma6.set_eMc + ~SimulatorAfma6.CONST_CCMOP_CAMERA_NAME + ~SimulatorAfma6.initScene + ~SimulatorAfma6.get_fMe + ~SimulatorAfma6.TOOL_GENERIC_CAMERA + ~SimulatorAfma6.setDisplayRobotType + ~SimulatorAfma6.STATE_ACCELERATION_CONTROL + ~SimulatorAfma6.getJointMin + ~SimulatorAfma6.setMaxRotationVelocity + ~SimulatorAfma6.get_eMc + ~SimulatorAfma6.get_cMo + ~SimulatorAfma6.TOOL_INTEL_D435_CAMERA + ~SimulatorAfma6.MIXT_FRAME + ~SimulatorAfma6.CONST_GENERIC_CAMERA_NAME + ~SimulatorAfma6.getMaxRotationVelocity + ~SimulatorAfma6.TOOL_FRAME + ~SimulatorAfma6.TOOL_VACUUM + ~SimulatorAfma6.getToolType + ~SimulatorAfma6.TOOL_CCMOP + ~SimulatorAfma6.STATE_POSITION_CONTROL + ~SimulatorAfma6.setDesiredCameraPosition + ~SimulatorAfma6.getCameraParametersProjType + ~SimulatorAfma6.TOOL_CUSTOM + ~SimulatorAfma6.Afma6ToolType + ~SimulatorAfma6.RobotStateType + ~SimulatorAfma6.TOOL_GRIPPER + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~SimulatorAfma6.__doc__ + ~SimulatorAfma6.__init__ + ~SimulatorAfma6.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~SimulatorAfma6.ARTICULAR_FRAME + ~SimulatorAfma6.CAMERA_FRAME + ~SimulatorAfma6.CONST_CCMOP_CAMERA_NAME + ~SimulatorAfma6.CONST_GENERIC_CAMERA_NAME + ~SimulatorAfma6.CONST_GRIPPER_CAMERA_NAME + ~SimulatorAfma6.CONST_INTEL_D435_CAMERA_NAME + ~SimulatorAfma6.CONST_VACUUM_CAMERA_NAME + ~SimulatorAfma6.END_EFFECTOR_FRAME + ~SimulatorAfma6.I + ~SimulatorAfma6.JOINT_STATE + ~SimulatorAfma6.MIXT_FRAME + ~SimulatorAfma6.MODEL_3D + ~SimulatorAfma6.MODEL_DH + ~SimulatorAfma6.REFERENCE_FRAME + ~SimulatorAfma6.STATE_ACCELERATION_CONTROL + ~SimulatorAfma6.STATE_FORCE_TORQUE_CONTROL + ~SimulatorAfma6.STATE_POSITION_CONTROL + ~SimulatorAfma6.STATE_STOP + ~SimulatorAfma6.STATE_VELOCITY_CONTROL + ~SimulatorAfma6.TOOL_CCMOP + ~SimulatorAfma6.TOOL_CUSTOM + ~SimulatorAfma6.TOOL_FRAME + ~SimulatorAfma6.TOOL_GENERIC_CAMERA + ~SimulatorAfma6.TOOL_GRIPPER + ~SimulatorAfma6.TOOL_INTEL_D435_CAMERA + ~SimulatorAfma6.TOOL_VACUUM + ~SimulatorAfma6.defaultPositioningVelocity + ~SimulatorAfma6.defaultTool + ~SimulatorAfma6.njoint + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.robot.SimulatorCamera.rst b/modules/python/doc/_autosummary/visp.robot.SimulatorCamera.rst new file mode 100644 index 0000000000..102b90a6ec --- /dev/null +++ b/modules/python/doc/_autosummary/visp.robot.SimulatorCamera.rst @@ -0,0 +1,95 @@ +SimulatorCamera +=============== + +.. currentmodule:: visp.robot + +.. autoclass:: SimulatorCamera + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~SimulatorCamera.getPosition + ~SimulatorCamera.get_cVe + ~SimulatorCamera.get_eJe + ~SimulatorCamera.setPosition + ~SimulatorCamera.setVelocity + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~SimulatorCamera.REFERENCE_FRAME + ~SimulatorCamera.setSamplingTime + ~SimulatorCamera.setMaxTranslationVelocity + ~SimulatorCamera.getRobotState + ~SimulatorCamera.STATE_STOP + ~SimulatorCamera.STATE_VELOCITY_CONTROL + ~SimulatorCamera.STATE_FORCE_TORQUE_CONTROL + ~SimulatorCamera.STATE_ACCELERATION_CONTROL + ~SimulatorCamera.setMaxRotationVelocity + ~SimulatorCamera.ControlFrameType + ~SimulatorCamera.CAMERA_FRAME + ~SimulatorCamera.MIXT_FRAME + ~SimulatorCamera.getMaxRotationVelocity + ~SimulatorCamera.setVerbose + ~SimulatorCamera.STATE_POSITION_CONTROL + ~SimulatorCamera.TOOL_FRAME + ~SimulatorCamera.JOINT_STATE + ~SimulatorCamera.getNDof + ~SimulatorCamera.END_EFFECTOR_FRAME + ~SimulatorCamera.RobotStateType + ~SimulatorCamera.setRobotState + ~SimulatorCamera.saturateVelocities + ~SimulatorCamera.getMaxTranslationVelocity + ~SimulatorCamera.getSamplingTime + ~SimulatorCamera.ARTICULAR_FRAME + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~SimulatorCamera.__doc__ + ~SimulatorCamera.__init__ + ~SimulatorCamera.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~SimulatorCamera.ARTICULAR_FRAME + ~SimulatorCamera.CAMERA_FRAME + ~SimulatorCamera.END_EFFECTOR_FRAME + ~SimulatorCamera.JOINT_STATE + ~SimulatorCamera.MIXT_FRAME + ~SimulatorCamera.REFERENCE_FRAME + ~SimulatorCamera.STATE_ACCELERATION_CONTROL + ~SimulatorCamera.STATE_FORCE_TORQUE_CONTROL + ~SimulatorCamera.STATE_POSITION_CONTROL + ~SimulatorCamera.STATE_STOP + ~SimulatorCamera.STATE_VELOCITY_CONTROL + ~SimulatorCamera.TOOL_FRAME + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.robot.SimulatorPioneer.rst b/modules/python/doc/_autosummary/visp.robot.SimulatorPioneer.rst new file mode 100644 index 0000000000..4aaa2df198 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.robot.SimulatorPioneer.rst @@ -0,0 +1,97 @@ +SimulatorPioneer +================ + +.. currentmodule:: visp.robot + +.. autoclass:: SimulatorPioneer + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~SimulatorPioneer.getPosition + ~SimulatorPioneer.get_eJe + ~SimulatorPioneer.setVelocity + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~SimulatorPioneer.REFERENCE_FRAME + ~SimulatorPioneer.setSamplingTime + ~SimulatorPioneer.setMaxTranslationVelocity + ~SimulatorPioneer.getRobotState + ~SimulatorPioneer.STATE_STOP + ~SimulatorPioneer.STATE_VELOCITY_CONTROL + ~SimulatorPioneer.STATE_FORCE_TORQUE_CONTROL + ~SimulatorPioneer.STATE_ACCELERATION_CONTROL + ~SimulatorPioneer.setMaxRotationVelocity + ~SimulatorPioneer.ControlFrameType + ~SimulatorPioneer.CAMERA_FRAME + ~SimulatorPioneer.set_cMe + ~SimulatorPioneer.MIXT_FRAME + ~SimulatorPioneer.getMaxRotationVelocity + ~SimulatorPioneer.setVerbose + ~SimulatorPioneer.STATE_POSITION_CONTROL + ~SimulatorPioneer.TOOL_FRAME + ~SimulatorPioneer.set_eJe + ~SimulatorPioneer.JOINT_STATE + ~SimulatorPioneer.getNDof + ~SimulatorPioneer.END_EFFECTOR_FRAME + ~SimulatorPioneer.RobotStateType + ~SimulatorPioneer.setRobotState + ~SimulatorPioneer.saturateVelocities + ~SimulatorPioneer.get_cVe + ~SimulatorPioneer.get_cMe + ~SimulatorPioneer.getMaxTranslationVelocity + ~SimulatorPioneer.getSamplingTime + ~SimulatorPioneer.ARTICULAR_FRAME + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~SimulatorPioneer.__doc__ + ~SimulatorPioneer.__init__ + ~SimulatorPioneer.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~SimulatorPioneer.ARTICULAR_FRAME + ~SimulatorPioneer.CAMERA_FRAME + ~SimulatorPioneer.END_EFFECTOR_FRAME + ~SimulatorPioneer.JOINT_STATE + ~SimulatorPioneer.MIXT_FRAME + ~SimulatorPioneer.REFERENCE_FRAME + ~SimulatorPioneer.STATE_ACCELERATION_CONTROL + ~SimulatorPioneer.STATE_FORCE_TORQUE_CONTROL + ~SimulatorPioneer.STATE_POSITION_CONTROL + ~SimulatorPioneer.STATE_STOP + ~SimulatorPioneer.STATE_VELOCITY_CONTROL + ~SimulatorPioneer.TOOL_FRAME + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.robot.SimulatorPioneerPan.rst b/modules/python/doc/_autosummary/visp.robot.SimulatorPioneerPan.rst new file mode 100644 index 0000000000..7f83baec5c --- /dev/null +++ b/modules/python/doc/_autosummary/visp.robot.SimulatorPioneerPan.rst @@ -0,0 +1,97 @@ +SimulatorPioneerPan +=================== + +.. currentmodule:: visp.robot + +.. autoclass:: SimulatorPioneerPan + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~SimulatorPioneerPan.getPosition + ~SimulatorPioneerPan.get_eJe + ~SimulatorPioneerPan.setVelocity + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~SimulatorPioneerPan.REFERENCE_FRAME + ~SimulatorPioneerPan.setSamplingTime + ~SimulatorPioneerPan.setMaxTranslationVelocity + ~SimulatorPioneerPan.getRobotState + ~SimulatorPioneerPan.STATE_STOP + ~SimulatorPioneerPan.STATE_VELOCITY_CONTROL + ~SimulatorPioneerPan.STATE_FORCE_TORQUE_CONTROL + ~SimulatorPioneerPan.STATE_ACCELERATION_CONTROL + ~SimulatorPioneerPan.setMaxRotationVelocity + ~SimulatorPioneerPan.ControlFrameType + ~SimulatorPioneerPan.CAMERA_FRAME + ~SimulatorPioneerPan.set_cMe + ~SimulatorPioneerPan.MIXT_FRAME + ~SimulatorPioneerPan.getMaxRotationVelocity + ~SimulatorPioneerPan.setVerbose + ~SimulatorPioneerPan.STATE_POSITION_CONTROL + ~SimulatorPioneerPan.TOOL_FRAME + ~SimulatorPioneerPan.set_eJe + ~SimulatorPioneerPan.JOINT_STATE + ~SimulatorPioneerPan.getNDof + ~SimulatorPioneerPan.END_EFFECTOR_FRAME + ~SimulatorPioneerPan.RobotStateType + ~SimulatorPioneerPan.setRobotState + ~SimulatorPioneerPan.saturateVelocities + ~SimulatorPioneerPan.get_cVe + ~SimulatorPioneerPan.get_cMe + ~SimulatorPioneerPan.getMaxTranslationVelocity + ~SimulatorPioneerPan.getSamplingTime + ~SimulatorPioneerPan.ARTICULAR_FRAME + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~SimulatorPioneerPan.__doc__ + ~SimulatorPioneerPan.__init__ + ~SimulatorPioneerPan.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~SimulatorPioneerPan.ARTICULAR_FRAME + ~SimulatorPioneerPan.CAMERA_FRAME + ~SimulatorPioneerPan.END_EFFECTOR_FRAME + ~SimulatorPioneerPan.JOINT_STATE + ~SimulatorPioneerPan.MIXT_FRAME + ~SimulatorPioneerPan.REFERENCE_FRAME + ~SimulatorPioneerPan.STATE_ACCELERATION_CONTROL + ~SimulatorPioneerPan.STATE_FORCE_TORQUE_CONTROL + ~SimulatorPioneerPan.STATE_POSITION_CONTROL + ~SimulatorPioneerPan.STATE_STOP + ~SimulatorPioneerPan.STATE_VELOCITY_CONTROL + ~SimulatorPioneerPan.TOOL_FRAME + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.robot.SimulatorViper850.rst b/modules/python/doc/_autosummary/visp.robot.SimulatorViper850.rst new file mode 100644 index 0000000000..bcad1e72cd --- /dev/null +++ b/modules/python/doc/_autosummary/visp.robot.SimulatorViper850.rst @@ -0,0 +1,175 @@ +SimulatorViper850 +================= + +.. currentmodule:: visp.robot + +.. autoclass:: SimulatorViper850 + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~SimulatorViper850.getCameraParameters + ~SimulatorViper850.getDisplacement + ~SimulatorViper850.getPosition + ~SimulatorViper850.getPositioningVelocity + ~SimulatorViper850.getVelocity + ~SimulatorViper850.get_cMe + ~SimulatorViper850.get_cVe + ~SimulatorViper850.get_eJe + ~SimulatorViper850.get_fJe + ~SimulatorViper850.init + ~SimulatorViper850.initialiseCameraRelativeToObject + ~SimulatorViper850.initialiseObjectRelativeToCamera + ~SimulatorViper850.move + ~SimulatorViper850.readPosFile + ~SimulatorViper850.savePosFile + ~SimulatorViper850.setCameraParameters + ~SimulatorViper850.setJointLimit + ~SimulatorViper850.setPosition + ~SimulatorViper850.setPositioningVelocity + ~SimulatorViper850.setRobotState + ~SimulatorViper850.setVelocity + ~SimulatorViper850.stopMotion + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~SimulatorViper850.get_wMe + ~SimulatorViper850.setExternalCameraPosition + ~SimulatorViper850.I + ~SimulatorViper850.setMaxTranslationVelocity + ~SimulatorViper850.getRobotState + ~SimulatorViper850.STATE_STOP + ~SimulatorViper850.setDesiredViewColor + ~SimulatorViper850.get_fMw + ~SimulatorViper850.STATE_VELOCITY_CONTROL + ~SimulatorViper850.STATE_FORCE_TORQUE_CONTROL + ~SimulatorViper850.ControlFrameType + ~SimulatorViper850.setCurrentViewColor + ~SimulatorViper850.defaultTool + ~SimulatorViper850.MODEL_3D + ~SimulatorViper850.parseConfigFile + ~SimulatorViper850.MODEL_DH + ~SimulatorViper850.setConstantSamplingTimeMode + ~SimulatorViper850.getCoupl56 + ~SimulatorViper850.CAMERA_FRAME + ~SimulatorViper850.get_fMo + ~SimulatorViper850.setVerbose + ~SimulatorViper850.setSingularityManagement + ~SimulatorViper850.getExternalCameraPosition + ~SimulatorViper850.njoint + ~SimulatorViper850.DisplayRobotType + ~SimulatorViper850.JOINT_STATE + ~SimulatorViper850.getExternalCameraParameters + ~SimulatorViper850.getJointMax + ~SimulatorViper850.getInternalView + ~SimulatorViper850.END_EFFECTOR_FRAME + ~SimulatorViper850.setGraphicsThickness + ~SimulatorViper850.getForwardKinematics + ~SimulatorViper850.TOOL_PTGREY_FLEA2_CAMERA + ~SimulatorViper850.saturateVelocities + ~SimulatorViper850.set_fMo + ~SimulatorViper850.CONST_PTGREY_FLEA2_CAMERA_NAME + ~SimulatorViper850.getMaxTranslationVelocity + ~SimulatorViper850.getSamplingTime + ~SimulatorViper850.getInverseKinematicsWrist + ~SimulatorViper850.CONST_MARLIN_F033C_CAMERA_NAME + ~SimulatorViper850.getNDof + ~SimulatorViper850.REFERENCE_FRAME + ~SimulatorViper850.setSamplingTime + ~SimulatorViper850.getInverseKinematics + ~SimulatorViper850.ToolType + ~SimulatorViper850.get_fMc + ~SimulatorViper850.setCameraColor + ~SimulatorViper850.set_eMc + ~SimulatorViper850.initScene + ~SimulatorViper850.get_fMe + ~SimulatorViper850.TOOL_GENERIC_CAMERA + ~SimulatorViper850.setDisplayRobotType + ~SimulatorViper850.STATE_ACCELERATION_CONTROL + ~SimulatorViper850.getJointMin + ~SimulatorViper850.setMaxRotationVelocity + ~SimulatorViper850.TOOL_MARLIN_F033C_CAMERA + ~SimulatorViper850.get_eMc + ~SimulatorViper850.get_cMo + ~SimulatorViper850.CONST_SCHUNK_GRIPPER_CAMERA_NAME + ~SimulatorViper850.MIXT_FRAME + ~SimulatorViper850.CONST_GENERIC_CAMERA_NAME + ~SimulatorViper850.getMaxRotationVelocity + ~SimulatorViper850.TOOL_FRAME + ~SimulatorViper850.getToolType + ~SimulatorViper850.setDesiredCameraPosition + ~SimulatorViper850.STATE_POSITION_CONTROL + ~SimulatorViper850.getCameraParametersProjType + ~SimulatorViper850.TOOL_SCHUNK_GRIPPER_CAMERA + ~SimulatorViper850.TOOL_CUSTOM + ~SimulatorViper850.RobotStateType + ~SimulatorViper850.get_eMs + ~SimulatorViper850.get_fJw + ~SimulatorViper850.ARTICULAR_FRAME + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~SimulatorViper850.__doc__ + ~SimulatorViper850.__init__ + ~SimulatorViper850.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~SimulatorViper850.ARTICULAR_FRAME + ~SimulatorViper850.CAMERA_FRAME + ~SimulatorViper850.CONST_GENERIC_CAMERA_NAME + ~SimulatorViper850.CONST_MARLIN_F033C_CAMERA_NAME + ~SimulatorViper850.CONST_PTGREY_FLEA2_CAMERA_NAME + ~SimulatorViper850.CONST_SCHUNK_GRIPPER_CAMERA_NAME + ~SimulatorViper850.END_EFFECTOR_FRAME + ~SimulatorViper850.I + ~SimulatorViper850.JOINT_STATE + ~SimulatorViper850.MIXT_FRAME + ~SimulatorViper850.MODEL_3D + ~SimulatorViper850.MODEL_DH + ~SimulatorViper850.REFERENCE_FRAME + ~SimulatorViper850.STATE_ACCELERATION_CONTROL + ~SimulatorViper850.STATE_FORCE_TORQUE_CONTROL + ~SimulatorViper850.STATE_POSITION_CONTROL + ~SimulatorViper850.STATE_STOP + ~SimulatorViper850.STATE_VELOCITY_CONTROL + ~SimulatorViper850.TOOL_CUSTOM + ~SimulatorViper850.TOOL_FRAME + ~SimulatorViper850.TOOL_GENERIC_CAMERA + ~SimulatorViper850.TOOL_MARLIN_F033C_CAMERA + ~SimulatorViper850.TOOL_PTGREY_FLEA2_CAMERA + ~SimulatorViper850.TOOL_SCHUNK_GRIPPER_CAMERA + ~SimulatorViper850.defaultPositioningVelocity + ~SimulatorViper850.defaultTool + ~SimulatorViper850.njoint + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.robot.Unicycle.rst b/modules/python/doc/_autosummary/visp.robot.Unicycle.rst new file mode 100644 index 0000000000..5f4671eb5a --- /dev/null +++ b/modules/python/doc/_autosummary/visp.robot.Unicycle.rst @@ -0,0 +1,53 @@ +Unicycle +======== + +.. currentmodule:: visp.robot + +.. autoclass:: Unicycle + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~Unicycle.get_cMe + ~Unicycle.get_cVe + ~Unicycle.get_eJe + ~Unicycle.set_cMe + ~Unicycle.set_eJe + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~Unicycle.__doc__ + ~Unicycle.__init__ + ~Unicycle.__module__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.robot.Viper.rst b/modules/python/doc/_autosummary/visp.robot.Viper.rst new file mode 100644 index 0000000000..02a3aafeb8 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.robot.Viper.rst @@ -0,0 +1,73 @@ +Viper +===== + +.. currentmodule:: visp.robot + +.. autoclass:: Viper + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~Viper.getCoupl56 + ~Viper.getForwardKinematics + ~Viper.getInverseKinematics + ~Viper.getInverseKinematicsWrist + ~Viper.getJointMax + ~Viper.getJointMin + ~Viper.get_cMe + ~Viper.get_cVe + ~Viper.get_eJe + ~Viper.get_eMc + ~Viper.get_eMs + ~Viper.get_fJe + ~Viper.get_fJw + ~Viper.get_fMc + ~Viper.get_fMe + ~Viper.get_fMw + ~Viper.get_wMe + ~Viper.set_eMc + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~Viper.__doc__ + ~Viper.__init__ + ~Viper.__module__ + ~Viper.__repr__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~Viper.njoint + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.robot.Viper650.rst b/modules/python/doc/_autosummary/visp.robot.Viper650.rst new file mode 100644 index 0000000000..17a5734dd6 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.robot.Viper650.rst @@ -0,0 +1,88 @@ +Viper650 +======== + +.. currentmodule:: visp.robot + +.. autoclass:: Viper650 + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~Viper650.getCameraParameters + ~Viper650.getCameraParametersProjType + ~Viper650.getToolType + ~Viper650.init + ~Viper650.parseConfigFile + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~Viper650.get_wMe + ~Viper650.get_fJe + ~Viper650.getInverseKinematics + ~Viper650.get_fMc + ~Viper650.set_eMc + ~Viper650.get_fMe + ~Viper650.get_eJe + ~Viper650.get_fMw + ~Viper650.getJointMin + ~Viper650.getCoupl56 + ~Viper650.get_eMc + ~Viper650.njoint + ~Viper650.getJointMax + ~Viper650.getForwardKinematics + ~Viper650.get_fJw + ~Viper650.get_cVe + ~Viper650.get_cMe + ~Viper650.get_eMs + ~Viper650.getInverseKinematicsWrist + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~Viper650.__doc__ + ~Viper650.__init__ + ~Viper650.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~Viper650.CONST_GENERIC_CAMERA_NAME + ~Viper650.CONST_MARLIN_F033C_CAMERA_NAME + ~Viper650.CONST_PTGREY_FLEA2_CAMERA_NAME + ~Viper650.CONST_SCHUNK_GRIPPER_CAMERA_NAME + ~Viper650.TOOL_CUSTOM + ~Viper650.TOOL_GENERIC_CAMERA + ~Viper650.TOOL_MARLIN_F033C_CAMERA + ~Viper650.TOOL_PTGREY_FLEA2_CAMERA + ~Viper650.TOOL_SCHUNK_GRIPPER_CAMERA + ~Viper650.defaultTool + ~Viper650.njoint + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.robot.Viper850.rst b/modules/python/doc/_autosummary/visp.robot.Viper850.rst new file mode 100644 index 0000000000..b5e924abf9 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.robot.Viper850.rst @@ -0,0 +1,88 @@ +Viper850 +======== + +.. currentmodule:: visp.robot + +.. autoclass:: Viper850 + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~Viper850.getCameraParameters + ~Viper850.getCameraParametersProjType + ~Viper850.getToolType + ~Viper850.init + ~Viper850.parseConfigFile + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~Viper850.get_wMe + ~Viper850.get_fJe + ~Viper850.getInverseKinematics + ~Viper850.get_fMc + ~Viper850.set_eMc + ~Viper850.get_fMe + ~Viper850.get_eJe + ~Viper850.get_fMw + ~Viper850.getJointMin + ~Viper850.getCoupl56 + ~Viper850.get_eMc + ~Viper850.njoint + ~Viper850.getJointMax + ~Viper850.getForwardKinematics + ~Viper850.get_fJw + ~Viper850.get_cVe + ~Viper850.get_cMe + ~Viper850.get_eMs + ~Viper850.getInverseKinematicsWrist + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~Viper850.__doc__ + ~Viper850.__init__ + ~Viper850.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~Viper850.CONST_GENERIC_CAMERA_NAME + ~Viper850.CONST_MARLIN_F033C_CAMERA_NAME + ~Viper850.CONST_PTGREY_FLEA2_CAMERA_NAME + ~Viper850.CONST_SCHUNK_GRIPPER_CAMERA_NAME + ~Viper850.TOOL_CUSTOM + ~Viper850.TOOL_GENERIC_CAMERA + ~Viper850.TOOL_MARLIN_F033C_CAMERA + ~Viper850.TOOL_PTGREY_FLEA2_CAMERA + ~Viper850.TOOL_SCHUNK_GRIPPER_CAMERA + ~Viper850.defaultTool + ~Viper850.njoint + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.robot.WireFrameSimulator.rst b/modules/python/doc/_autosummary/visp.robot.WireFrameSimulator.rst new file mode 100644 index 0000000000..37f6cb7924 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.robot.WireFrameSimulator.rst @@ -0,0 +1,103 @@ +WireFrameSimulator +================== + +.. currentmodule:: visp.robot + +.. autoclass:: WireFrameSimulator + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~WireFrameSimulator.deleteCameraPositionHistory + ~WireFrameSimulator.displayTrajectory + ~WireFrameSimulator.getExternalCameraParameters + ~WireFrameSimulator.getExternalCameraPosition + ~WireFrameSimulator.getExternalImage + ~WireFrameSimulator.getInternalCameraParameters + ~WireFrameSimulator.getInternalImage + ~WireFrameSimulator.get_cMo + ~WireFrameSimulator.get_cMo_History + ~WireFrameSimulator.get_fMo + ~WireFrameSimulator.get_fMo_History + ~WireFrameSimulator.initScene + ~WireFrameSimulator.setCameraColor + ~WireFrameSimulator.setCameraPositionRelObj + ~WireFrameSimulator.setCameraPositionRelWorld + ~WireFrameSimulator.setCameraSizeFactor + ~WireFrameSimulator.setCameraTrajectoryColor + ~WireFrameSimulator.setCameraTrajectoryDisplayType + ~WireFrameSimulator.setCurrentViewColor + ~WireFrameSimulator.setDesiredCameraPosition + ~WireFrameSimulator.setDesiredViewColor + ~WireFrameSimulator.setDisplayCameraTrajectory + ~WireFrameSimulator.setExternalCameraParameters + ~WireFrameSimulator.setExternalCameraPosition + ~WireFrameSimulator.setGraphicsThickness + ~WireFrameSimulator.setInternalCameraParameters + ~WireFrameSimulator.setNbPtTrajectory + ~WireFrameSimulator.set_fMo + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~WireFrameSimulator.__doc__ + ~WireFrameSimulator.__init__ + ~WireFrameSimulator.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~WireFrameSimulator.CIRCLE + ~WireFrameSimulator.CT_LINE + ~WireFrameSimulator.CT_POINT + ~WireFrameSimulator.CUBE + ~WireFrameSimulator.CYLINDER + ~WireFrameSimulator.DIAMOND + ~WireFrameSimulator.D_CIRCLE + ~WireFrameSimulator.D_STANDARD + ~WireFrameSimulator.D_TOOL + ~WireFrameSimulator.PIPE + ~WireFrameSimulator.PLAN + ~WireFrameSimulator.PLATE + ~WireFrameSimulator.POINT_CLOUD + ~WireFrameSimulator.RECTANGLE + ~WireFrameSimulator.ROAD + ~WireFrameSimulator.SMALL_PLATE + ~WireFrameSimulator.SPHERE + ~WireFrameSimulator.SQUARE_10CM + ~WireFrameSimulator.THREE_LINES + ~WireFrameSimulator.THREE_PTS + ~WireFrameSimulator.TIRE + ~WireFrameSimulator.TRAPEZOID + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.robot.rst b/modules/python/doc/_autosummary/visp.robot.rst new file mode 100644 index 0000000000..c00334ba7b --- /dev/null +++ b/modules/python/doc/_autosummary/visp.robot.rst @@ -0,0 +1,59 @@ +robot +===== + +.. automodule:: visp.robot + + + + + + + + + + + + .. rubric:: Classes + + .. autosummary:: + :toctree: + :template: custom-class-template.rst + :nosignatures: + + Afma4 + Afma6 + Biclops + ImageSimulator + Pioneer + PioneerPan + Pololu + Ptu46 + QbDevice + QbSoftHand + ReflexTakktile2 + RingLight + Robot + RobotPololuPtu + RobotSimulator + RobotTemplate + RobotWireFrameSimulator + Servolens + SimulatorAfma6 + SimulatorCamera + SimulatorPioneer + SimulatorPioneerPan + SimulatorViper850 + Unicycle + Viper + Viper650 + Viper850 + WireFrameSimulator + + + + + + + + + diff --git a/modules/python/doc/_autosummary/visp.sensor.ForceTorqueAtiNetFTSensor.rst b/modules/python/doc/_autosummary/visp.sensor.ForceTorqueAtiNetFTSensor.rst new file mode 100644 index 0000000000..bbb22e1950 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.sensor.ForceTorqueAtiNetFTSensor.rst @@ -0,0 +1,64 @@ +ForceTorqueAtiNetFTSensor +========================= + +.. currentmodule:: visp.sensor + +.. autoclass:: ForceTorqueAtiNetFTSensor + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~ForceTorqueAtiNetFTSensor.bias + ~ForceTorqueAtiNetFTSensor.getCountsPerForce + ~ForceTorqueAtiNetFTSensor.getCountsPerTorque + ~ForceTorqueAtiNetFTSensor.getDataCounter + ~ForceTorqueAtiNetFTSensor.getForceTorque + ~ForceTorqueAtiNetFTSensor.getScalingFactor + ~ForceTorqueAtiNetFTSensor.setCountsPerForce + ~ForceTorqueAtiNetFTSensor.setCountsPerTorque + ~ForceTorqueAtiNetFTSensor.setScalingFactor + ~ForceTorqueAtiNetFTSensor.startStreaming + ~ForceTorqueAtiNetFTSensor.stopStreaming + ~ForceTorqueAtiNetFTSensor.unbias + ~ForceTorqueAtiNetFTSensor.waitForNewData + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~ForceTorqueAtiNetFTSensor.receive + ~ForceTorqueAtiNetFTSensor.send + ~ForceTorqueAtiNetFTSensor.init + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~ForceTorqueAtiNetFTSensor.__doc__ + ~ForceTorqueAtiNetFTSensor.__init__ + ~ForceTorqueAtiNetFTSensor.__module__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.sensor.LaserScan.rst b/modules/python/doc/_autosummary/visp.sensor.LaserScan.rst new file mode 100644 index 0000000000..450c4048ce --- /dev/null +++ b/modules/python/doc/_autosummary/visp.sensor.LaserScan.rst @@ -0,0 +1,60 @@ +LaserScan +========= + +.. currentmodule:: visp.sensor + +.. autoclass:: LaserScan + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~LaserScan.addPoint + ~LaserScan.clear + ~LaserScan.getEndTimestamp + ~LaserScan.getScanPoints + ~LaserScan.getStartTimestamp + ~LaserScan.setEndTimestamp + ~LaserScan.setMeasurementId + ~LaserScan.setNumPoints + ~LaserScan.setNumSteps + ~LaserScan.setStartAngle + ~LaserScan.setStartTimestamp + ~LaserScan.setStopAngle + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~LaserScan.__doc__ + ~LaserScan.__init__ + ~LaserScan.__module__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.sensor.LaserScanner.rst b/modules/python/doc/_autosummary/visp.sensor.LaserScanner.rst new file mode 100644 index 0000000000..e4f701788a --- /dev/null +++ b/modules/python/doc/_autosummary/visp.sensor.LaserScanner.rst @@ -0,0 +1,50 @@ +LaserScanner +============ + +.. currentmodule:: visp.sensor + +.. autoclass:: LaserScanner + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~LaserScanner.setIpAddress + ~LaserScanner.setPort + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~LaserScanner.__doc__ + ~LaserScanner.__init__ + ~LaserScanner.__module__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.sensor.Mocap.rst b/modules/python/doc/_autosummary/visp.sensor.Mocap.rst new file mode 100644 index 0000000000..ce7dd1290d --- /dev/null +++ b/modules/python/doc/_autosummary/visp.sensor.Mocap.rst @@ -0,0 +1,50 @@ +Mocap +===== + +.. currentmodule:: visp.sensor + +.. autoclass:: Mocap + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~Mocap.setServerAddress + ~Mocap.setVerbose + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~Mocap.__doc__ + ~Mocap.__init__ + ~Mocap.__module__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.sensor.RealSense2.rst b/modules/python/doc/_autosummary/visp.sensor.RealSense2.rst new file mode 100644 index 0000000000..eb3003d12c --- /dev/null +++ b/modules/python/doc/_autosummary/visp.sensor.RealSense2.rst @@ -0,0 +1,62 @@ +RealSense2 +========== + +.. currentmodule:: visp.sensor + +.. autoclass:: RealSense2 + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~RealSense2.close + ~RealSense2.getCameraParameters + ~RealSense2.getDepthScale + ~RealSense2.getIntrinsics + ~RealSense2.getInvalidDepthValue + ~RealSense2.getMaxZ + ~RealSense2.getPipeline + ~RealSense2.getPipelineProfile + ~RealSense2.getProductLine + ~RealSense2.getTransformation + ~RealSense2.open + ~RealSense2.setInvalidDepthValue + ~RealSense2.setMaxZ + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~RealSense2.__doc__ + ~RealSense2.__init__ + ~RealSense2.__module__ + ~RealSense2.__repr__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.sensor.ScanPoint.rst b/modules/python/doc/_autosummary/visp.sensor.ScanPoint.rst new file mode 100644 index 0000000000..a23e311aa1 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.sensor.ScanPoint.rst @@ -0,0 +1,56 @@ +ScanPoint +========= + +.. currentmodule:: visp.sensor + +.. autoclass:: ScanPoint + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~ScanPoint.getHAngle + ~ScanPoint.getRadialDist + ~ScanPoint.getVAngle + ~ScanPoint.getX + ~ScanPoint.getY + ~ScanPoint.getZ + ~ScanPoint.setPolar + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~ScanPoint.__doc__ + ~ScanPoint.__init__ + ~ScanPoint.__module__ + ~ScanPoint.__repr__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.sensor.SickLDMRS.rst b/modules/python/doc/_autosummary/visp.sensor.SickLDMRS.rst new file mode 100644 index 0000000000..d39758c275 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.sensor.SickLDMRS.rst @@ -0,0 +1,58 @@ +SickLDMRS +========= + +.. currentmodule:: visp.sensor + +.. autoclass:: SickLDMRS + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~SickLDMRS.setup + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~SickLDMRS.setIpAddress + ~SickLDMRS.setPort + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~SickLDMRS.__doc__ + ~SickLDMRS.__init__ + ~SickLDMRS.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~SickLDMRS.MagicWordC2 + ~SickLDMRS.MeasuredData + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.sensor.V4l2Grabber.rst b/modules/python/doc/_autosummary/visp.sensor.V4l2Grabber.rst new file mode 100644 index 0000000000..1ccb26f6ab --- /dev/null +++ b/modules/python/doc/_autosummary/visp.sensor.V4l2Grabber.rst @@ -0,0 +1,90 @@ +V4l2Grabber +=========== + +.. currentmodule:: visp.sensor + +.. autoclass:: V4l2Grabber + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~V4l2Grabber.acquire + ~V4l2Grabber.close + ~V4l2Grabber.getField + ~V4l2Grabber.getFramerate + ~V4l2Grabber.getPixelFormat + ~V4l2Grabber.open + ~V4l2Grabber.setDevice + ~V4l2Grabber.setFramerate + ~V4l2Grabber.setHeight + ~V4l2Grabber.setInput + ~V4l2Grabber.setNBuffers + ~V4l2Grabber.setPixelFormat + ~V4l2Grabber.setScale + ~V4l2Grabber.setVerboseMode + ~V4l2Grabber.setWidth + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~V4l2Grabber.getWidth + ~V4l2Grabber.getHeight + ~V4l2Grabber.init + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~V4l2Grabber.__doc__ + ~V4l2Grabber.__init__ + ~V4l2Grabber.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~V4l2Grabber.DEFAULT_INPUT + ~V4l2Grabber.DEFAULT_SCALE + ~V4l2Grabber.FRAME_SIZE + ~V4l2Grabber.MAX_BUFFERS + ~V4l2Grabber.MAX_CTRL + ~V4l2Grabber.MAX_FORMAT + ~V4l2Grabber.MAX_INPUTS + ~V4l2Grabber.MAX_NORM + ~V4l2Grabber.V4L2_BGR24_FORMAT + ~V4l2Grabber.V4L2_FRAME_FORMAT + ~V4l2Grabber.V4L2_GREY_FORMAT + ~V4l2Grabber.V4L2_IMAGE_FORMAT + ~V4l2Grabber.V4L2_MAX_FORMAT + ~V4l2Grabber.V4L2_RGB24_FORMAT + ~V4l2Grabber.V4L2_RGB32_FORMAT + ~V4l2Grabber.V4L2_YUYV_FORMAT + ~V4l2Grabber.framerate_25fps + ~V4l2Grabber.framerate_50fps + ~V4l2Grabber.init + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.sensor.rst b/modules/python/doc/_autosummary/visp.sensor.rst new file mode 100644 index 0000000000..6ad7e581c5 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.sensor.rst @@ -0,0 +1,40 @@ +sensor +====== + +.. automodule:: visp.sensor + + + + + + + + + + + + .. rubric:: Classes + + .. autosummary:: + :toctree: + :template: custom-class-template.rst + :nosignatures: + + 1394TwoGrabber + ForceTorqueAtiNetFTSensor + LaserScan + LaserScanner + Mocap + RealSense2 + ScanPoint + SickLDMRS + V4l2Grabber + + + + + + + + + diff --git a/modules/python/doc/_autosummary/visp.tt.TemplateTracker.rst b/modules/python/doc/_autosummary/visp.tt.TemplateTracker.rst new file mode 100644 index 0000000000..00c717f24a --- /dev/null +++ b/modules/python/doc/_autosummary/visp.tt.TemplateTracker.rst @@ -0,0 +1,78 @@ +TemplateTracker +=============== + +.. currentmodule:: visp.tt + +.. autoclass:: TemplateTracker + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~TemplateTracker.display + ~TemplateTracker.getDiverge + ~TemplateTracker.getG + ~TemplateTracker.getH + ~TemplateTracker.getNbIteration + ~TemplateTracker.getNbParam + ~TemplateTracker.getRatioPixelIn + ~TemplateTracker.getZoneRef + ~TemplateTracker.getdp + ~TemplateTracker.getp + ~TemplateTracker.initClick + ~TemplateTracker.initFromPoints + ~TemplateTracker.initFromZone + ~TemplateTracker.resetTracker + ~TemplateTracker.setBlur + ~TemplateTracker.setCostFunctionVerification + ~TemplateTracker.setGain + ~TemplateTracker.setGaussianFilterSize + ~TemplateTracker.setHDes + ~TemplateTracker.setIterationMax + ~TemplateTracker.setLambda + ~TemplateTracker.setNbIterBrent + ~TemplateTracker.setPyramidal + ~TemplateTracker.setSampling + ~TemplateTracker.setThresholdGradient + ~TemplateTracker.setThresholdResidualDifference + ~TemplateTracker.setUseBrent + ~TemplateTracker.setp + ~TemplateTracker.track + ~TemplateTracker.trackRobust + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~TemplateTracker.__doc__ + ~TemplateTracker.__init__ + ~TemplateTracker.__module__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.tt.TemplateTrackerDPoint.rst b/modules/python/doc/_autosummary/visp.tt.TemplateTrackerDPoint.rst new file mode 100644 index 0000000000..1e3ef17a1f --- /dev/null +++ b/modules/python/doc/_autosummary/visp.tt.TemplateTrackerDPoint.rst @@ -0,0 +1,55 @@ +TemplateTrackerDPoint +===================== + +.. currentmodule:: visp.tt + +.. autoclass:: TemplateTrackerDPoint + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~TemplateTrackerDPoint.__doc__ + ~TemplateTrackerDPoint.__init__ + ~TemplateTrackerDPoint.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~TemplateTrackerDPoint.x + ~TemplateTrackerDPoint.y + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.tt.TemplateTrackerPoint.rst b/modules/python/doc/_autosummary/visp.tt.TemplateTrackerPoint.rst new file mode 100644 index 0000000000..327ed3b135 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.tt.TemplateTrackerPoint.rst @@ -0,0 +1,58 @@ +TemplateTrackerPoint +==================== + +.. currentmodule:: visp.tt + +.. autoclass:: TemplateTrackerPoint + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~TemplateTrackerPoint.__doc__ + ~TemplateTrackerPoint.__init__ + ~TemplateTrackerPoint.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~TemplateTrackerPoint.dx + ~TemplateTrackerPoint.dy + ~TemplateTrackerPoint.val + ~TemplateTrackerPoint.x + ~TemplateTrackerPoint.y + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.tt.TemplateTrackerPointCompo.rst b/modules/python/doc/_autosummary/visp.tt.TemplateTrackerPointCompo.rst new file mode 100644 index 0000000000..07e4b9b837 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.tt.TemplateTrackerPointCompo.rst @@ -0,0 +1,48 @@ +TemplateTrackerPointCompo +========================= + +.. currentmodule:: visp.tt + +.. autoclass:: TemplateTrackerPointCompo + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~TemplateTrackerPointCompo.__doc__ + ~TemplateTrackerPointCompo.__init__ + ~TemplateTrackerPointCompo.__module__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.tt.TemplateTrackerSSD.rst b/modules/python/doc/_autosummary/visp.tt.TemplateTrackerSSD.rst new file mode 100644 index 0000000000..98730b9846 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.tt.TemplateTrackerSSD.rst @@ -0,0 +1,79 @@ +TemplateTrackerSSD +================== + +.. currentmodule:: visp.tt + +.. autoclass:: TemplateTrackerSSD + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~TemplateTrackerSSD.getSSD + ~TemplateTrackerSSD.setGain + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~TemplateTrackerSSD.setLambda + ~TemplateTrackerSSD.setp + ~TemplateTrackerSSD.getNbParam + ~TemplateTrackerSSD.getG + ~TemplateTrackerSSD.getp + ~TemplateTrackerSSD.track + ~TemplateTrackerSSD.initFromZone + ~TemplateTrackerSSD.getDiverge + ~TemplateTrackerSSD.trackRobust + ~TemplateTrackerSSD.setCostFunctionVerification + ~TemplateTrackerSSD.setGaussianFilterSize + ~TemplateTrackerSSD.initClick + ~TemplateTrackerSSD.getRatioPixelIn + ~TemplateTrackerSSD.setThresholdResidualDifference + ~TemplateTrackerSSD.getNbIteration + ~TemplateTrackerSSD.initFromPoints + ~TemplateTrackerSSD.setSampling + ~TemplateTrackerSSD.setIterationMax + ~TemplateTrackerSSD.display + ~TemplateTrackerSSD.setUseBrent + ~TemplateTrackerSSD.setNbIterBrent + ~TemplateTrackerSSD.setThresholdGradient + ~TemplateTrackerSSD.getZoneRef + ~TemplateTrackerSSD.resetTracker + ~TemplateTrackerSSD.getdp + ~TemplateTrackerSSD.getH + ~TemplateTrackerSSD.setHDes + ~TemplateTrackerSSD.setBlur + ~TemplateTrackerSSD.setPyramidal + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~TemplateTrackerSSD.__doc__ + ~TemplateTrackerSSD.__init__ + ~TemplateTrackerSSD.__module__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.tt.TemplateTrackerSSDESM.rst b/modules/python/doc/_autosummary/visp.tt.TemplateTrackerSSDESM.rst new file mode 100644 index 0000000000..a4958682b3 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.tt.TemplateTrackerSSDESM.rst @@ -0,0 +1,79 @@ +TemplateTrackerSSDESM +===================== + +.. currentmodule:: visp.tt + +.. autoclass:: TemplateTrackerSSDESM + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~TemplateTrackerSSDESM.setLambda + ~TemplateTrackerSSDESM.setp + ~TemplateTrackerSSDESM.getNbParam + ~TemplateTrackerSSDESM.getG + ~TemplateTrackerSSDESM.getp + ~TemplateTrackerSSDESM.track + ~TemplateTrackerSSDESM.initFromZone + ~TemplateTrackerSSDESM.getDiverge + ~TemplateTrackerSSDESM.trackRobust + ~TemplateTrackerSSDESM.setCostFunctionVerification + ~TemplateTrackerSSDESM.setGaussianFilterSize + ~TemplateTrackerSSDESM.initClick + ~TemplateTrackerSSDESM.getRatioPixelIn + ~TemplateTrackerSSDESM.setThresholdResidualDifference + ~TemplateTrackerSSDESM.getNbIteration + ~TemplateTrackerSSDESM.initFromPoints + ~TemplateTrackerSSDESM.getSSD + ~TemplateTrackerSSDESM.setSampling + ~TemplateTrackerSSDESM.setIterationMax + ~TemplateTrackerSSDESM.display + ~TemplateTrackerSSDESM.setUseBrent + ~TemplateTrackerSSDESM.setNbIterBrent + ~TemplateTrackerSSDESM.setThresholdGradient + ~TemplateTrackerSSDESM.getZoneRef + ~TemplateTrackerSSDESM.setGain + ~TemplateTrackerSSDESM.resetTracker + ~TemplateTrackerSSDESM.getdp + ~TemplateTrackerSSDESM.getH + ~TemplateTrackerSSDESM.setHDes + ~TemplateTrackerSSDESM.setBlur + ~TemplateTrackerSSDESM.setPyramidal + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~TemplateTrackerSSDESM.__doc__ + ~TemplateTrackerSSDESM.__init__ + ~TemplateTrackerSSDESM.__module__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.tt.TemplateTrackerSSDForwardAdditional.rst b/modules/python/doc/_autosummary/visp.tt.TemplateTrackerSSDForwardAdditional.rst new file mode 100644 index 0000000000..9c06954ea4 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.tt.TemplateTrackerSSDForwardAdditional.rst @@ -0,0 +1,89 @@ +TemplateTrackerSSDForwardAdditional +=================================== + +.. currentmodule:: visp.tt + +.. autoclass:: TemplateTrackerSSDForwardAdditional + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~TemplateTrackerSSDForwardAdditional.setMinimizationMethod + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~TemplateTrackerSSDForwardAdditional.setLambda + ~TemplateTrackerSSDForwardAdditional.setp + ~TemplateTrackerSSDForwardAdditional.getNbParam + ~TemplateTrackerSSDForwardAdditional.getG + ~TemplateTrackerSSDForwardAdditional.getp + ~TemplateTrackerSSDForwardAdditional.track + ~TemplateTrackerSSDForwardAdditional.initFromZone + ~TemplateTrackerSSDForwardAdditional.getDiverge + ~TemplateTrackerSSDForwardAdditional.trackRobust + ~TemplateTrackerSSDForwardAdditional.setCostFunctionVerification + ~TemplateTrackerSSDForwardAdditional.setGaussianFilterSize + ~TemplateTrackerSSDForwardAdditional.initClick + ~TemplateTrackerSSDForwardAdditional.getRatioPixelIn + ~TemplateTrackerSSDForwardAdditional.setThresholdResidualDifference + ~TemplateTrackerSSDForwardAdditional.getNbIteration + ~TemplateTrackerSSDForwardAdditional.initFromPoints + ~TemplateTrackerSSDForwardAdditional.getSSD + ~TemplateTrackerSSDForwardAdditional.setSampling + ~TemplateTrackerSSDForwardAdditional.setIterationMax + ~TemplateTrackerSSDForwardAdditional.display + ~TemplateTrackerSSDForwardAdditional.setUseBrent + ~TemplateTrackerSSDForwardAdditional.setNbIterBrent + ~TemplateTrackerSSDForwardAdditional.setThresholdGradient + ~TemplateTrackerSSDForwardAdditional.getZoneRef + ~TemplateTrackerSSDForwardAdditional.setGain + ~TemplateTrackerSSDForwardAdditional.resetTracker + ~TemplateTrackerSSDForwardAdditional.getdp + ~TemplateTrackerSSDForwardAdditional.getH + ~TemplateTrackerSSDForwardAdditional.setHDes + ~TemplateTrackerSSDForwardAdditional.setBlur + ~TemplateTrackerSSDForwardAdditional.setPyramidal + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~TemplateTrackerSSDForwardAdditional.__doc__ + ~TemplateTrackerSSDForwardAdditional.__init__ + ~TemplateTrackerSSDForwardAdditional.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~TemplateTrackerSSDForwardAdditional.USE_GRADIENT + ~TemplateTrackerSSDForwardAdditional.USE_LMA + ~TemplateTrackerSSDForwardAdditional.USE_NEWTON + ~TemplateTrackerSSDForwardAdditional.USE_QUASINEWTON + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.tt.TemplateTrackerSSDForwardCompositional.rst b/modules/python/doc/_autosummary/visp.tt.TemplateTrackerSSDForwardCompositional.rst new file mode 100644 index 0000000000..7f54d15458 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.tt.TemplateTrackerSSDForwardCompositional.rst @@ -0,0 +1,79 @@ +TemplateTrackerSSDForwardCompositional +====================================== + +.. currentmodule:: visp.tt + +.. autoclass:: TemplateTrackerSSDForwardCompositional + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~TemplateTrackerSSDForwardCompositional.setLambda + ~TemplateTrackerSSDForwardCompositional.setp + ~TemplateTrackerSSDForwardCompositional.getNbParam + ~TemplateTrackerSSDForwardCompositional.getG + ~TemplateTrackerSSDForwardCompositional.getp + ~TemplateTrackerSSDForwardCompositional.track + ~TemplateTrackerSSDForwardCompositional.initFromZone + ~TemplateTrackerSSDForwardCompositional.getDiverge + ~TemplateTrackerSSDForwardCompositional.trackRobust + ~TemplateTrackerSSDForwardCompositional.setCostFunctionVerification + ~TemplateTrackerSSDForwardCompositional.setGaussianFilterSize + ~TemplateTrackerSSDForwardCompositional.initClick + ~TemplateTrackerSSDForwardCompositional.getRatioPixelIn + ~TemplateTrackerSSDForwardCompositional.setThresholdResidualDifference + ~TemplateTrackerSSDForwardCompositional.getNbIteration + ~TemplateTrackerSSDForwardCompositional.initFromPoints + ~TemplateTrackerSSDForwardCompositional.getSSD + ~TemplateTrackerSSDForwardCompositional.setSampling + ~TemplateTrackerSSDForwardCompositional.setIterationMax + ~TemplateTrackerSSDForwardCompositional.display + ~TemplateTrackerSSDForwardCompositional.setUseBrent + ~TemplateTrackerSSDForwardCompositional.setNbIterBrent + ~TemplateTrackerSSDForwardCompositional.setThresholdGradient + ~TemplateTrackerSSDForwardCompositional.getZoneRef + ~TemplateTrackerSSDForwardCompositional.setGain + ~TemplateTrackerSSDForwardCompositional.resetTracker + ~TemplateTrackerSSDForwardCompositional.getdp + ~TemplateTrackerSSDForwardCompositional.getH + ~TemplateTrackerSSDForwardCompositional.setHDes + ~TemplateTrackerSSDForwardCompositional.setBlur + ~TemplateTrackerSSDForwardCompositional.setPyramidal + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~TemplateTrackerSSDForwardCompositional.__doc__ + ~TemplateTrackerSSDForwardCompositional.__init__ + ~TemplateTrackerSSDForwardCompositional.__module__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.tt.TemplateTrackerSSDInverseCompositional.rst b/modules/python/doc/_autosummary/visp.tt.TemplateTrackerSSDInverseCompositional.rst new file mode 100644 index 0000000000..5a777ea749 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.tt.TemplateTrackerSSDInverseCompositional.rst @@ -0,0 +1,80 @@ +TemplateTrackerSSDInverseCompositional +====================================== + +.. currentmodule:: visp.tt + +.. autoclass:: TemplateTrackerSSDInverseCompositional + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~TemplateTrackerSSDInverseCompositional.setUseTemplateSelect + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~TemplateTrackerSSDInverseCompositional.setLambda + ~TemplateTrackerSSDInverseCompositional.setp + ~TemplateTrackerSSDInverseCompositional.getNbParam + ~TemplateTrackerSSDInverseCompositional.getG + ~TemplateTrackerSSDInverseCompositional.getp + ~TemplateTrackerSSDInverseCompositional.track + ~TemplateTrackerSSDInverseCompositional.initFromZone + ~TemplateTrackerSSDInverseCompositional.getDiverge + ~TemplateTrackerSSDInverseCompositional.trackRobust + ~TemplateTrackerSSDInverseCompositional.setCostFunctionVerification + ~TemplateTrackerSSDInverseCompositional.setGaussianFilterSize + ~TemplateTrackerSSDInverseCompositional.initClick + ~TemplateTrackerSSDInverseCompositional.getRatioPixelIn + ~TemplateTrackerSSDInverseCompositional.setThresholdResidualDifference + ~TemplateTrackerSSDInverseCompositional.getNbIteration + ~TemplateTrackerSSDInverseCompositional.initFromPoints + ~TemplateTrackerSSDInverseCompositional.getSSD + ~TemplateTrackerSSDInverseCompositional.setSampling + ~TemplateTrackerSSDInverseCompositional.setIterationMax + ~TemplateTrackerSSDInverseCompositional.display + ~TemplateTrackerSSDInverseCompositional.setUseBrent + ~TemplateTrackerSSDInverseCompositional.setNbIterBrent + ~TemplateTrackerSSDInverseCompositional.setThresholdGradient + ~TemplateTrackerSSDInverseCompositional.getZoneRef + ~TemplateTrackerSSDInverseCompositional.setGain + ~TemplateTrackerSSDInverseCompositional.resetTracker + ~TemplateTrackerSSDInverseCompositional.getdp + ~TemplateTrackerSSDInverseCompositional.getH + ~TemplateTrackerSSDInverseCompositional.setHDes + ~TemplateTrackerSSDInverseCompositional.setBlur + ~TemplateTrackerSSDInverseCompositional.setPyramidal + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~TemplateTrackerSSDInverseCompositional.__doc__ + ~TemplateTrackerSSDInverseCompositional.__init__ + ~TemplateTrackerSSDInverseCompositional.__module__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.tt.TemplateTrackerTriangle.rst b/modules/python/doc/_autosummary/visp.tt.TemplateTrackerTriangle.rst new file mode 100644 index 0000000000..7341119bc4 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.tt.TemplateTrackerTriangle.rst @@ -0,0 +1,59 @@ +TemplateTrackerTriangle +======================= + +.. currentmodule:: visp.tt + +.. autoclass:: TemplateTrackerTriangle + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~TemplateTrackerTriangle.getArea + ~TemplateTrackerTriangle.getCorner + ~TemplateTrackerTriangle.getCorners + ~TemplateTrackerTriangle.getMaxx + ~TemplateTrackerTriangle.getMaxy + ~TemplateTrackerTriangle.getMinx + ~TemplateTrackerTriangle.getMiny + ~TemplateTrackerTriangle.getPyramidDown + ~TemplateTrackerTriangle.getSize + ~TemplateTrackerTriangle.inTriangle + ~TemplateTrackerTriangle.init + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~TemplateTrackerTriangle.__doc__ + ~TemplateTrackerTriangle.__init__ + ~TemplateTrackerTriangle.__module__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.tt.TemplateTrackerWarp.rst b/modules/python/doc/_autosummary/visp.tt.TemplateTrackerWarp.rst new file mode 100644 index 0000000000..670108fb3b --- /dev/null +++ b/modules/python/doc/_autosummary/visp.tt.TemplateTrackerWarp.rst @@ -0,0 +1,53 @@ +TemplateTrackerWarp +=================== + +.. currentmodule:: visp.tt + +.. autoclass:: TemplateTrackerWarp + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~TemplateTrackerWarp.getDistanceBetweenZoneAndWarpedZone + ~TemplateTrackerWarp.getNbParam + ~TemplateTrackerWarp.setNbParam + ~TemplateTrackerWarp.warpTriangle + ~TemplateTrackerWarp.warpZone + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~TemplateTrackerWarp.__doc__ + ~TemplateTrackerWarp.__init__ + ~TemplateTrackerWarp.__module__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.tt.TemplateTrackerWarpAffine.rst b/modules/python/doc/_autosummary/visp.tt.TemplateTrackerWarpAffine.rst new file mode 100644 index 0000000000..2e317afb64 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.tt.TemplateTrackerWarpAffine.rst @@ -0,0 +1,61 @@ +TemplateTrackerWarpAffine +========================= + +.. currentmodule:: visp.tt + +.. autoclass:: TemplateTrackerWarpAffine + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~TemplateTrackerWarpAffine.dWarp + ~TemplateTrackerWarpAffine.getParamInverse + ~TemplateTrackerWarpAffine.getParamPyramidDown + ~TemplateTrackerWarpAffine.getParamPyramidUp + ~TemplateTrackerWarpAffine.isESMcompatible + ~TemplateTrackerWarpAffine.pRondp + ~TemplateTrackerWarpAffine.warpX + ~TemplateTrackerWarpAffine.warpXInv + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~TemplateTrackerWarpAffine.getNbParam + ~TemplateTrackerWarpAffine.warpTriangle + ~TemplateTrackerWarpAffine.getDistanceBetweenZoneAndWarpedZone + ~TemplateTrackerWarpAffine.setNbParam + ~TemplateTrackerWarpAffine.warpZone + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~TemplateTrackerWarpAffine.__doc__ + ~TemplateTrackerWarpAffine.__init__ + ~TemplateTrackerWarpAffine.__module__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.tt.TemplateTrackerWarpHomography.rst b/modules/python/doc/_autosummary/visp.tt.TemplateTrackerWarpHomography.rst new file mode 100644 index 0000000000..5bd5197c64 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.tt.TemplateTrackerWarpHomography.rst @@ -0,0 +1,64 @@ +TemplateTrackerWarpHomography +============================= + +.. currentmodule:: visp.tt + +.. autoclass:: TemplateTrackerWarpHomography + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~TemplateTrackerWarpHomography.computeDenom + ~TemplateTrackerWarpHomography.dWarp + ~TemplateTrackerWarpHomography.getHomography + ~TemplateTrackerWarpHomography.getParam + ~TemplateTrackerWarpHomography.getParamInverse + ~TemplateTrackerWarpHomography.getParamPyramidDown + ~TemplateTrackerWarpHomography.getParamPyramidUp + ~TemplateTrackerWarpHomography.isESMcompatible + ~TemplateTrackerWarpHomography.pRondp + ~TemplateTrackerWarpHomography.warpX + ~TemplateTrackerWarpHomography.warpXInv + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~TemplateTrackerWarpHomography.getNbParam + ~TemplateTrackerWarpHomography.warpTriangle + ~TemplateTrackerWarpHomography.getDistanceBetweenZoneAndWarpedZone + ~TemplateTrackerWarpHomography.setNbParam + ~TemplateTrackerWarpHomography.warpZone + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~TemplateTrackerWarpHomography.__doc__ + ~TemplateTrackerWarpHomography.__init__ + ~TemplateTrackerWarpHomography.__module__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.tt.TemplateTrackerWarpHomographySL3.rst b/modules/python/doc/_autosummary/visp.tt.TemplateTrackerWarpHomographySL3.rst new file mode 100644 index 0000000000..92c092b7b9 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.tt.TemplateTrackerWarpHomographySL3.rst @@ -0,0 +1,63 @@ +TemplateTrackerWarpHomographySL3 +================================ + +.. currentmodule:: visp.tt + +.. autoclass:: TemplateTrackerWarpHomographySL3 + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~TemplateTrackerWarpHomographySL3.computeCoeff + ~TemplateTrackerWarpHomographySL3.computeDenom + ~TemplateTrackerWarpHomographySL3.dWarp + ~TemplateTrackerWarpHomographySL3.getHomography + ~TemplateTrackerWarpHomographySL3.getParamInverse + ~TemplateTrackerWarpHomographySL3.getParamPyramidDown + ~TemplateTrackerWarpHomographySL3.getParamPyramidUp + ~TemplateTrackerWarpHomographySL3.isESMcompatible + ~TemplateTrackerWarpHomographySL3.pRondp + ~TemplateTrackerWarpHomographySL3.warpX + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~TemplateTrackerWarpHomographySL3.getNbParam + ~TemplateTrackerWarpHomographySL3.warpTriangle + ~TemplateTrackerWarpHomographySL3.getDistanceBetweenZoneAndWarpedZone + ~TemplateTrackerWarpHomographySL3.setNbParam + ~TemplateTrackerWarpHomographySL3.warpZone + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~TemplateTrackerWarpHomographySL3.__doc__ + ~TemplateTrackerWarpHomographySL3.__init__ + ~TemplateTrackerWarpHomographySL3.__module__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.tt.TemplateTrackerWarpRT.rst b/modules/python/doc/_autosummary/visp.tt.TemplateTrackerWarpRT.rst new file mode 100644 index 0000000000..6699489e78 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.tt.TemplateTrackerWarpRT.rst @@ -0,0 +1,61 @@ +TemplateTrackerWarpRT +===================== + +.. currentmodule:: visp.tt + +.. autoclass:: TemplateTrackerWarpRT + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~TemplateTrackerWarpRT.dWarp + ~TemplateTrackerWarpRT.getParamInverse + ~TemplateTrackerWarpRT.getParamPyramidDown + ~TemplateTrackerWarpRT.getParamPyramidUp + ~TemplateTrackerWarpRT.isESMcompatible + ~TemplateTrackerWarpRT.pRondp + ~TemplateTrackerWarpRT.warpX + ~TemplateTrackerWarpRT.warpXInv + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~TemplateTrackerWarpRT.getNbParam + ~TemplateTrackerWarpRT.warpTriangle + ~TemplateTrackerWarpRT.getDistanceBetweenZoneAndWarpedZone + ~TemplateTrackerWarpRT.setNbParam + ~TemplateTrackerWarpRT.warpZone + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~TemplateTrackerWarpRT.__doc__ + ~TemplateTrackerWarpRT.__init__ + ~TemplateTrackerWarpRT.__module__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.tt.TemplateTrackerWarpSRT.rst b/modules/python/doc/_autosummary/visp.tt.TemplateTrackerWarpSRT.rst new file mode 100644 index 0000000000..440bbc4e0e --- /dev/null +++ b/modules/python/doc/_autosummary/visp.tt.TemplateTrackerWarpSRT.rst @@ -0,0 +1,61 @@ +TemplateTrackerWarpSRT +====================== + +.. currentmodule:: visp.tt + +.. autoclass:: TemplateTrackerWarpSRT + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~TemplateTrackerWarpSRT.dWarp + ~TemplateTrackerWarpSRT.getParamInverse + ~TemplateTrackerWarpSRT.getParamPyramidDown + ~TemplateTrackerWarpSRT.getParamPyramidUp + ~TemplateTrackerWarpSRT.isESMcompatible + ~TemplateTrackerWarpSRT.pRondp + ~TemplateTrackerWarpSRT.warpX + ~TemplateTrackerWarpSRT.warpXInv + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~TemplateTrackerWarpSRT.getNbParam + ~TemplateTrackerWarpSRT.warpTriangle + ~TemplateTrackerWarpSRT.getDistanceBetweenZoneAndWarpedZone + ~TemplateTrackerWarpSRT.setNbParam + ~TemplateTrackerWarpSRT.warpZone + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~TemplateTrackerWarpSRT.__doc__ + ~TemplateTrackerWarpSRT.__init__ + ~TemplateTrackerWarpSRT.__module__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.tt.TemplateTrackerWarpTranslation.rst b/modules/python/doc/_autosummary/visp.tt.TemplateTrackerWarpTranslation.rst new file mode 100644 index 0000000000..3a74ae8ba7 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.tt.TemplateTrackerWarpTranslation.rst @@ -0,0 +1,61 @@ +TemplateTrackerWarpTranslation +============================== + +.. currentmodule:: visp.tt + +.. autoclass:: TemplateTrackerWarpTranslation + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~TemplateTrackerWarpTranslation.dWarp + ~TemplateTrackerWarpTranslation.getParamInverse + ~TemplateTrackerWarpTranslation.getParamPyramidDown + ~TemplateTrackerWarpTranslation.getParamPyramidUp + ~TemplateTrackerWarpTranslation.isESMcompatible + ~TemplateTrackerWarpTranslation.pRondp + ~TemplateTrackerWarpTranslation.warpX + ~TemplateTrackerWarpTranslation.warpXInv + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~TemplateTrackerWarpTranslation.getNbParam + ~TemplateTrackerWarpTranslation.warpTriangle + ~TemplateTrackerWarpTranslation.getDistanceBetweenZoneAndWarpedZone + ~TemplateTrackerWarpTranslation.setNbParam + ~TemplateTrackerWarpTranslation.warpZone + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~TemplateTrackerWarpTranslation.__doc__ + ~TemplateTrackerWarpTranslation.__init__ + ~TemplateTrackerWarpTranslation.__module__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.tt.TemplateTrackerZNCC.rst b/modules/python/doc/_autosummary/visp.tt.TemplateTrackerZNCC.rst new file mode 100644 index 0000000000..e512f822dd --- /dev/null +++ b/modules/python/doc/_autosummary/visp.tt.TemplateTrackerZNCC.rst @@ -0,0 +1,78 @@ +TemplateTrackerZNCC +=================== + +.. currentmodule:: visp.tt + +.. autoclass:: TemplateTrackerZNCC + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~TemplateTrackerZNCC.setGain + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~TemplateTrackerZNCC.setLambda + ~TemplateTrackerZNCC.setp + ~TemplateTrackerZNCC.getNbParam + ~TemplateTrackerZNCC.getG + ~TemplateTrackerZNCC.getp + ~TemplateTrackerZNCC.track + ~TemplateTrackerZNCC.initFromZone + ~TemplateTrackerZNCC.getDiverge + ~TemplateTrackerZNCC.trackRobust + ~TemplateTrackerZNCC.setCostFunctionVerification + ~TemplateTrackerZNCC.setGaussianFilterSize + ~TemplateTrackerZNCC.initClick + ~TemplateTrackerZNCC.getRatioPixelIn + ~TemplateTrackerZNCC.setThresholdResidualDifference + ~TemplateTrackerZNCC.getNbIteration + ~TemplateTrackerZNCC.initFromPoints + ~TemplateTrackerZNCC.setSampling + ~TemplateTrackerZNCC.setIterationMax + ~TemplateTrackerZNCC.display + ~TemplateTrackerZNCC.setUseBrent + ~TemplateTrackerZNCC.setNbIterBrent + ~TemplateTrackerZNCC.setThresholdGradient + ~TemplateTrackerZNCC.getZoneRef + ~TemplateTrackerZNCC.resetTracker + ~TemplateTrackerZNCC.getdp + ~TemplateTrackerZNCC.getH + ~TemplateTrackerZNCC.setHDes + ~TemplateTrackerZNCC.setBlur + ~TemplateTrackerZNCC.setPyramidal + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~TemplateTrackerZNCC.__doc__ + ~TemplateTrackerZNCC.__init__ + ~TemplateTrackerZNCC.__module__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.tt.TemplateTrackerZNCCForwardAdditional.rst b/modules/python/doc/_autosummary/visp.tt.TemplateTrackerZNCCForwardAdditional.rst new file mode 100644 index 0000000000..fdcd1b9d51 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.tt.TemplateTrackerZNCCForwardAdditional.rst @@ -0,0 +1,78 @@ +TemplateTrackerZNCCForwardAdditional +==================================== + +.. currentmodule:: visp.tt + +.. autoclass:: TemplateTrackerZNCCForwardAdditional + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~TemplateTrackerZNCCForwardAdditional.setLambda + ~TemplateTrackerZNCCForwardAdditional.setp + ~TemplateTrackerZNCCForwardAdditional.getNbParam + ~TemplateTrackerZNCCForwardAdditional.getG + ~TemplateTrackerZNCCForwardAdditional.getp + ~TemplateTrackerZNCCForwardAdditional.track + ~TemplateTrackerZNCCForwardAdditional.initFromZone + ~TemplateTrackerZNCCForwardAdditional.getDiverge + ~TemplateTrackerZNCCForwardAdditional.trackRobust + ~TemplateTrackerZNCCForwardAdditional.setCostFunctionVerification + ~TemplateTrackerZNCCForwardAdditional.setGaussianFilterSize + ~TemplateTrackerZNCCForwardAdditional.initClick + ~TemplateTrackerZNCCForwardAdditional.getRatioPixelIn + ~TemplateTrackerZNCCForwardAdditional.setThresholdResidualDifference + ~TemplateTrackerZNCCForwardAdditional.getNbIteration + ~TemplateTrackerZNCCForwardAdditional.initFromPoints + ~TemplateTrackerZNCCForwardAdditional.setSampling + ~TemplateTrackerZNCCForwardAdditional.setIterationMax + ~TemplateTrackerZNCCForwardAdditional.display + ~TemplateTrackerZNCCForwardAdditional.setUseBrent + ~TemplateTrackerZNCCForwardAdditional.setNbIterBrent + ~TemplateTrackerZNCCForwardAdditional.setThresholdGradient + ~TemplateTrackerZNCCForwardAdditional.getZoneRef + ~TemplateTrackerZNCCForwardAdditional.setGain + ~TemplateTrackerZNCCForwardAdditional.resetTracker + ~TemplateTrackerZNCCForwardAdditional.getdp + ~TemplateTrackerZNCCForwardAdditional.getH + ~TemplateTrackerZNCCForwardAdditional.setHDes + ~TemplateTrackerZNCCForwardAdditional.setBlur + ~TemplateTrackerZNCCForwardAdditional.setPyramidal + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~TemplateTrackerZNCCForwardAdditional.__doc__ + ~TemplateTrackerZNCCForwardAdditional.__init__ + ~TemplateTrackerZNCCForwardAdditional.__module__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.tt.TemplateTrackerZNCCInverseCompositional.rst b/modules/python/doc/_autosummary/visp.tt.TemplateTrackerZNCCInverseCompositional.rst new file mode 100644 index 0000000000..b60dc1f182 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.tt.TemplateTrackerZNCCInverseCompositional.rst @@ -0,0 +1,78 @@ +TemplateTrackerZNCCInverseCompositional +======================================= + +.. currentmodule:: visp.tt + +.. autoclass:: TemplateTrackerZNCCInverseCompositional + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~TemplateTrackerZNCCInverseCompositional.setLambda + ~TemplateTrackerZNCCInverseCompositional.setp + ~TemplateTrackerZNCCInverseCompositional.getNbParam + ~TemplateTrackerZNCCInverseCompositional.getG + ~TemplateTrackerZNCCInverseCompositional.getp + ~TemplateTrackerZNCCInverseCompositional.track + ~TemplateTrackerZNCCInverseCompositional.initFromZone + ~TemplateTrackerZNCCInverseCompositional.getDiverge + ~TemplateTrackerZNCCInverseCompositional.trackRobust + ~TemplateTrackerZNCCInverseCompositional.setCostFunctionVerification + ~TemplateTrackerZNCCInverseCompositional.setGaussianFilterSize + ~TemplateTrackerZNCCInverseCompositional.initClick + ~TemplateTrackerZNCCInverseCompositional.getRatioPixelIn + ~TemplateTrackerZNCCInverseCompositional.setThresholdResidualDifference + ~TemplateTrackerZNCCInverseCompositional.getNbIteration + ~TemplateTrackerZNCCInverseCompositional.initFromPoints + ~TemplateTrackerZNCCInverseCompositional.setSampling + ~TemplateTrackerZNCCInverseCompositional.setIterationMax + ~TemplateTrackerZNCCInverseCompositional.display + ~TemplateTrackerZNCCInverseCompositional.setUseBrent + ~TemplateTrackerZNCCInverseCompositional.setNbIterBrent + ~TemplateTrackerZNCCInverseCompositional.setThresholdGradient + ~TemplateTrackerZNCCInverseCompositional.getZoneRef + ~TemplateTrackerZNCCInverseCompositional.setGain + ~TemplateTrackerZNCCInverseCompositional.resetTracker + ~TemplateTrackerZNCCInverseCompositional.getdp + ~TemplateTrackerZNCCInverseCompositional.getH + ~TemplateTrackerZNCCInverseCompositional.setHDes + ~TemplateTrackerZNCCInverseCompositional.setBlur + ~TemplateTrackerZNCCInverseCompositional.setPyramidal + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~TemplateTrackerZNCCInverseCompositional.__doc__ + ~TemplateTrackerZNCCInverseCompositional.__init__ + ~TemplateTrackerZNCCInverseCompositional.__module__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.tt.TemplateTrackerZPoint.rst b/modules/python/doc/_autosummary/visp.tt.TemplateTrackerZPoint.rst new file mode 100644 index 0000000000..52fb0cf889 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.tt.TemplateTrackerZPoint.rst @@ -0,0 +1,55 @@ +TemplateTrackerZPoint +===================== + +.. currentmodule:: visp.tt + +.. autoclass:: TemplateTrackerZPoint + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~TemplateTrackerZPoint.__doc__ + ~TemplateTrackerZPoint.__init__ + ~TemplateTrackerZPoint.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~TemplateTrackerZPoint.x + ~TemplateTrackerZPoint.y + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.tt.TemplateTrackerZone.rst b/modules/python/doc/_autosummary/visp.tt.TemplateTrackerZone.rst new file mode 100644 index 0000000000..c15b38fcb9 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.tt.TemplateTrackerZone.rst @@ -0,0 +1,66 @@ +TemplateTrackerZone +=================== + +.. currentmodule:: visp.tt + +.. autoclass:: TemplateTrackerZone + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~TemplateTrackerZone.add + ~TemplateTrackerZone.clear + ~TemplateTrackerZone.copy + ~TemplateTrackerZone.display + ~TemplateTrackerZone.fillTriangle + ~TemplateTrackerZone.getArea + ~TemplateTrackerZone.getBoundingBox + ~TemplateTrackerZone.getCenter + ~TemplateTrackerZone.getMaxx + ~TemplateTrackerZone.getMaxy + ~TemplateTrackerZone.getMinx + ~TemplateTrackerZone.getMiny + ~TemplateTrackerZone.getNbTriangle + ~TemplateTrackerZone.getPyramidDown + ~TemplateTrackerZone.getTriangle + ~TemplateTrackerZone.inZone + ~TemplateTrackerZone.initClick + ~TemplateTrackerZone.initFromPoints + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~TemplateTrackerZone.__doc__ + ~TemplateTrackerZone.__init__ + ~TemplateTrackerZone.__module__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.tt.rst b/modules/python/doc/_autosummary/visp.tt.rst new file mode 100644 index 0000000000..9e607632f1 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.tt.rst @@ -0,0 +1,53 @@ +tt +== + +.. automodule:: visp.tt + + + + + + + + + + + + .. rubric:: Classes + + .. autosummary:: + :toctree: + :template: custom-class-template.rst + :nosignatures: + + TemplateTracker + TemplateTrackerDPoint + TemplateTrackerPoint + TemplateTrackerPointCompo + TemplateTrackerSSD + TemplateTrackerSSDESM + TemplateTrackerSSDForwardAdditional + TemplateTrackerSSDForwardCompositional + TemplateTrackerSSDInverseCompositional + TemplateTrackerTriangle + TemplateTrackerWarp + TemplateTrackerWarpAffine + TemplateTrackerWarpHomography + TemplateTrackerWarpHomographySL3 + TemplateTrackerWarpRT + TemplateTrackerWarpSRT + TemplateTrackerWarpTranslation + TemplateTrackerZNCC + TemplateTrackerZNCCForwardAdditional + TemplateTrackerZNCCInverseCompositional + TemplateTrackerZPoint + TemplateTrackerZone + + + + + + + + + diff --git a/modules/python/doc/_autosummary/visp.tt_mi.TemplateTrackerMI.rst b/modules/python/doc/_autosummary/visp.tt_mi.TemplateTrackerMI.rst new file mode 100644 index 0000000000..e28798cab2 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.tt_mi.TemplateTrackerMI.rst @@ -0,0 +1,103 @@ +TemplateTrackerMI +================= + +.. currentmodule:: visp.tt_mi + +.. autoclass:: TemplateTrackerMI + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~TemplateTrackerMI.getCovarianceMatrix + ~TemplateTrackerMI.getMI + ~TemplateTrackerMI.getMI256 + ~TemplateTrackerMI.getNMI + ~TemplateTrackerMI.setApprocHessian + ~TemplateTrackerMI.setBspline + ~TemplateTrackerMI.setCovarianceComputation + ~TemplateTrackerMI.setHessianComputation + ~TemplateTrackerMI.setLambda + ~TemplateTrackerMI.setNc + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~TemplateTrackerMI.setp + ~TemplateTrackerMI.getNbParam + ~TemplateTrackerMI.getG + ~TemplateTrackerMI.getp + ~TemplateTrackerMI.track + ~TemplateTrackerMI.initFromZone + ~TemplateTrackerMI.getDiverge + ~TemplateTrackerMI.trackRobust + ~TemplateTrackerMI.setCostFunctionVerification + ~TemplateTrackerMI.setGaussianFilterSize + ~TemplateTrackerMI.setThresholdResidualDifference + ~TemplateTrackerMI.getRatioPixelIn + ~TemplateTrackerMI.initClick + ~TemplateTrackerMI.getNbIteration + ~TemplateTrackerMI.initFromPoints + ~TemplateTrackerMI.setSampling + ~TemplateTrackerMI.setIterationMax + ~TemplateTrackerMI.display + ~TemplateTrackerMI.setUseBrent + ~TemplateTrackerMI.setNbIterBrent + ~TemplateTrackerMI.setThresholdGradient + ~TemplateTrackerMI.getZoneRef + ~TemplateTrackerMI.setGain + ~TemplateTrackerMI.resetTracker + ~TemplateTrackerMI.getdp + ~TemplateTrackerMI.getH + ~TemplateTrackerMI.setHDes + ~TemplateTrackerMI.setBlur + ~TemplateTrackerMI.setPyramidal + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~TemplateTrackerMI.__doc__ + ~TemplateTrackerMI.__init__ + ~TemplateTrackerMI.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~TemplateTrackerMI.BSPLINE_FOURTH_ORDER + ~TemplateTrackerMI.BSPLINE_THIRD_ORDER + ~TemplateTrackerMI.HESSIAN_0 + ~TemplateTrackerMI.HESSIAN_EXACT + ~TemplateTrackerMI.HESSIAN_NEW + ~TemplateTrackerMI.HESSIAN_NONSECOND + ~TemplateTrackerMI.HESSIAN_YOUCEF + ~TemplateTrackerMI.HESSIAN_d2I + ~TemplateTrackerMI.USE_HESSIEN_BEST_COND + ~TemplateTrackerMI.USE_HESSIEN_DESIRE + ~TemplateTrackerMI.USE_HESSIEN_NORMAL + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.tt_mi.TemplateTrackerMIESM.rst b/modules/python/doc/_autosummary/visp.tt_mi.TemplateTrackerMIESM.rst new file mode 100644 index 0000000000..86d8abd7b7 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.tt_mi.TemplateTrackerMIESM.rst @@ -0,0 +1,122 @@ +TemplateTrackerMIESM +==================== + +.. currentmodule:: visp.tt_mi + +.. autoclass:: TemplateTrackerMIESM + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~TemplateTrackerMIESM.setMinimizationMethod + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~TemplateTrackerMIESM.setCovarianceComputation + ~TemplateTrackerMIESM.setLambda + ~TemplateTrackerMIESM.setp + ~TemplateTrackerMIESM.getNbParam + ~TemplateTrackerMIESM.HESSIAN_NEW + ~TemplateTrackerMIESM.getp + ~TemplateTrackerMIESM.HESSIAN_0 + ~TemplateTrackerMIESM.USE_HESSIEN_DESIRE + ~TemplateTrackerMIESM.initFromZone + ~TemplateTrackerMIESM.getDiverge + ~TemplateTrackerMIESM.setCostFunctionVerification + ~TemplateTrackerMIESM.USE_HESSIEN_NORMAL + ~TemplateTrackerMIESM.setThresholdResidualDifference + ~TemplateTrackerMIESM.getRatioPixelIn + ~TemplateTrackerMIESM.initFromPoints + ~TemplateTrackerMIESM.setSampling + ~TemplateTrackerMIESM.display + ~TemplateTrackerMIESM.setUseBrent + ~TemplateTrackerMIESM.setHessianComputation + ~TemplateTrackerMIESM.HESSIAN_EXACT + ~TemplateTrackerMIESM.setThresholdGradient + ~TemplateTrackerMIESM.getZoneRef + ~TemplateTrackerMIESM.setGain + ~TemplateTrackerMIESM.BsplineType + ~TemplateTrackerMIESM.HessienType + ~TemplateTrackerMIESM.HESSIAN_d2I + ~TemplateTrackerMIESM.setHDes + ~TemplateTrackerMIESM.setBspline + ~TemplateTrackerMIESM.setPyramidal + ~TemplateTrackerMIESM.getMI + ~TemplateTrackerMIESM.getG + ~TemplateTrackerMIESM.BSPLINE_THIRD_ORDER + ~TemplateTrackerMIESM.track + ~TemplateTrackerMIESM.trackRobust + ~TemplateTrackerMIESM.setGaussianFilterSize + ~TemplateTrackerMIESM.initClick + ~TemplateTrackerMIESM.getNbIteration + ~TemplateTrackerMIESM.setIterationMax + ~TemplateTrackerMIESM.HessienApproximationType + ~TemplateTrackerMIESM.setNc + ~TemplateTrackerMIESM.getNMI + ~TemplateTrackerMIESM.USE_HESSIEN_BEST_COND + ~TemplateTrackerMIESM.setNbIterBrent + ~TemplateTrackerMIESM.HESSIAN_NONSECOND + ~TemplateTrackerMIESM.resetTracker + ~TemplateTrackerMIESM.HESSIAN_YOUCEF + ~TemplateTrackerMIESM.BSPLINE_FOURTH_ORDER + ~TemplateTrackerMIESM.getCovarianceMatrix + ~TemplateTrackerMIESM.getdp + ~TemplateTrackerMIESM.getH + ~TemplateTrackerMIESM.getMI256 + ~TemplateTrackerMIESM.setApprocHessian + ~TemplateTrackerMIESM.setBlur + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~TemplateTrackerMIESM.__doc__ + ~TemplateTrackerMIESM.__init__ + ~TemplateTrackerMIESM.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~TemplateTrackerMIESM.BSPLINE_FOURTH_ORDER + ~TemplateTrackerMIESM.BSPLINE_THIRD_ORDER + ~TemplateTrackerMIESM.HESSIAN_0 + ~TemplateTrackerMIESM.HESSIAN_EXACT + ~TemplateTrackerMIESM.HESSIAN_NEW + ~TemplateTrackerMIESM.HESSIAN_NONSECOND + ~TemplateTrackerMIESM.HESSIAN_YOUCEF + ~TemplateTrackerMIESM.HESSIAN_d2I + ~TemplateTrackerMIESM.USE_GRADIENT + ~TemplateTrackerMIESM.USE_HESSIEN_BEST_COND + ~TemplateTrackerMIESM.USE_HESSIEN_DESIRE + ~TemplateTrackerMIESM.USE_HESSIEN_NORMAL + ~TemplateTrackerMIESM.USE_LMA + ~TemplateTrackerMIESM.USE_NEWTON + ~TemplateTrackerMIESM.USE_QUASINEWTON + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.tt_mi.TemplateTrackerMIForwardAdditional.rst b/modules/python/doc/_autosummary/visp.tt_mi.TemplateTrackerMIForwardAdditional.rst new file mode 100644 index 0000000000..c2f7204e67 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.tt_mi.TemplateTrackerMIForwardAdditional.rst @@ -0,0 +1,122 @@ +TemplateTrackerMIForwardAdditional +================================== + +.. currentmodule:: visp.tt_mi + +.. autoclass:: TemplateTrackerMIForwardAdditional + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~TemplateTrackerMIForwardAdditional.setMinimizationMethod + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~TemplateTrackerMIForwardAdditional.setCovarianceComputation + ~TemplateTrackerMIForwardAdditional.setLambda + ~TemplateTrackerMIForwardAdditional.setp + ~TemplateTrackerMIForwardAdditional.getNbParam + ~TemplateTrackerMIForwardAdditional.HESSIAN_NEW + ~TemplateTrackerMIForwardAdditional.getp + ~TemplateTrackerMIForwardAdditional.HESSIAN_0 + ~TemplateTrackerMIForwardAdditional.USE_HESSIEN_DESIRE + ~TemplateTrackerMIForwardAdditional.initFromZone + ~TemplateTrackerMIForwardAdditional.getDiverge + ~TemplateTrackerMIForwardAdditional.setCostFunctionVerification + ~TemplateTrackerMIForwardAdditional.USE_HESSIEN_NORMAL + ~TemplateTrackerMIForwardAdditional.setThresholdResidualDifference + ~TemplateTrackerMIForwardAdditional.getRatioPixelIn + ~TemplateTrackerMIForwardAdditional.initFromPoints + ~TemplateTrackerMIForwardAdditional.setSampling + ~TemplateTrackerMIForwardAdditional.display + ~TemplateTrackerMIForwardAdditional.setUseBrent + ~TemplateTrackerMIForwardAdditional.setHessianComputation + ~TemplateTrackerMIForwardAdditional.HESSIAN_EXACT + ~TemplateTrackerMIForwardAdditional.setThresholdGradient + ~TemplateTrackerMIForwardAdditional.getZoneRef + ~TemplateTrackerMIForwardAdditional.setGain + ~TemplateTrackerMIForwardAdditional.BsplineType + ~TemplateTrackerMIForwardAdditional.HessienType + ~TemplateTrackerMIForwardAdditional.HESSIAN_d2I + ~TemplateTrackerMIForwardAdditional.setHDes + ~TemplateTrackerMIForwardAdditional.setBspline + ~TemplateTrackerMIForwardAdditional.setPyramidal + ~TemplateTrackerMIForwardAdditional.getMI + ~TemplateTrackerMIForwardAdditional.getG + ~TemplateTrackerMIForwardAdditional.BSPLINE_THIRD_ORDER + ~TemplateTrackerMIForwardAdditional.track + ~TemplateTrackerMIForwardAdditional.trackRobust + ~TemplateTrackerMIForwardAdditional.setGaussianFilterSize + ~TemplateTrackerMIForwardAdditional.initClick + ~TemplateTrackerMIForwardAdditional.getNbIteration + ~TemplateTrackerMIForwardAdditional.setIterationMax + ~TemplateTrackerMIForwardAdditional.HessienApproximationType + ~TemplateTrackerMIForwardAdditional.setNc + ~TemplateTrackerMIForwardAdditional.getNMI + ~TemplateTrackerMIForwardAdditional.USE_HESSIEN_BEST_COND + ~TemplateTrackerMIForwardAdditional.setNbIterBrent + ~TemplateTrackerMIForwardAdditional.HESSIAN_NONSECOND + ~TemplateTrackerMIForwardAdditional.resetTracker + ~TemplateTrackerMIForwardAdditional.HESSIAN_YOUCEF + ~TemplateTrackerMIForwardAdditional.BSPLINE_FOURTH_ORDER + ~TemplateTrackerMIForwardAdditional.getCovarianceMatrix + ~TemplateTrackerMIForwardAdditional.getdp + ~TemplateTrackerMIForwardAdditional.getH + ~TemplateTrackerMIForwardAdditional.getMI256 + ~TemplateTrackerMIForwardAdditional.setApprocHessian + ~TemplateTrackerMIForwardAdditional.setBlur + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~TemplateTrackerMIForwardAdditional.__doc__ + ~TemplateTrackerMIForwardAdditional.__init__ + ~TemplateTrackerMIForwardAdditional.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~TemplateTrackerMIForwardAdditional.BSPLINE_FOURTH_ORDER + ~TemplateTrackerMIForwardAdditional.BSPLINE_THIRD_ORDER + ~TemplateTrackerMIForwardAdditional.HESSIAN_0 + ~TemplateTrackerMIForwardAdditional.HESSIAN_EXACT + ~TemplateTrackerMIForwardAdditional.HESSIAN_NEW + ~TemplateTrackerMIForwardAdditional.HESSIAN_NONSECOND + ~TemplateTrackerMIForwardAdditional.HESSIAN_YOUCEF + ~TemplateTrackerMIForwardAdditional.HESSIAN_d2I + ~TemplateTrackerMIForwardAdditional.USE_GRADIENT + ~TemplateTrackerMIForwardAdditional.USE_HESSIEN_BEST_COND + ~TemplateTrackerMIForwardAdditional.USE_HESSIEN_DESIRE + ~TemplateTrackerMIForwardAdditional.USE_HESSIEN_NORMAL + ~TemplateTrackerMIForwardAdditional.USE_LMA + ~TemplateTrackerMIForwardAdditional.USE_NEWTON + ~TemplateTrackerMIForwardAdditional.USE_QUASINEWTON + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.tt_mi.TemplateTrackerMIForwardCompositional.rst b/modules/python/doc/_autosummary/visp.tt_mi.TemplateTrackerMIForwardCompositional.rst new file mode 100644 index 0000000000..3d3f538c08 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.tt_mi.TemplateTrackerMIForwardCompositional.rst @@ -0,0 +1,117 @@ +TemplateTrackerMIForwardCompositional +===================================== + +.. currentmodule:: visp.tt_mi + +.. autoclass:: TemplateTrackerMIForwardCompositional + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~TemplateTrackerMIForwardCompositional.setCovarianceComputation + ~TemplateTrackerMIForwardCompositional.setLambda + ~TemplateTrackerMIForwardCompositional.setp + ~TemplateTrackerMIForwardCompositional.getNbParam + ~TemplateTrackerMIForwardCompositional.HESSIAN_NEW + ~TemplateTrackerMIForwardCompositional.getp + ~TemplateTrackerMIForwardCompositional.HESSIAN_0 + ~TemplateTrackerMIForwardCompositional.USE_HESSIEN_DESIRE + ~TemplateTrackerMIForwardCompositional.initFromZone + ~TemplateTrackerMIForwardCompositional.getDiverge + ~TemplateTrackerMIForwardCompositional.setCostFunctionVerification + ~TemplateTrackerMIForwardCompositional.USE_HESSIEN_NORMAL + ~TemplateTrackerMIForwardCompositional.setThresholdResidualDifference + ~TemplateTrackerMIForwardCompositional.getRatioPixelIn + ~TemplateTrackerMIForwardCompositional.initFromPoints + ~TemplateTrackerMIForwardCompositional.setSampling + ~TemplateTrackerMIForwardCompositional.display + ~TemplateTrackerMIForwardCompositional.setUseBrent + ~TemplateTrackerMIForwardCompositional.setHessianComputation + ~TemplateTrackerMIForwardCompositional.HESSIAN_EXACT + ~TemplateTrackerMIForwardCompositional.setThresholdGradient + ~TemplateTrackerMIForwardCompositional.getZoneRef + ~TemplateTrackerMIForwardCompositional.setGain + ~TemplateTrackerMIForwardCompositional.BsplineType + ~TemplateTrackerMIForwardCompositional.HessienType + ~TemplateTrackerMIForwardCompositional.HESSIAN_d2I + ~TemplateTrackerMIForwardCompositional.setHDes + ~TemplateTrackerMIForwardCompositional.setBspline + ~TemplateTrackerMIForwardCompositional.setPyramidal + ~TemplateTrackerMIForwardCompositional.getMI + ~TemplateTrackerMIForwardCompositional.getG + ~TemplateTrackerMIForwardCompositional.BSPLINE_THIRD_ORDER + ~TemplateTrackerMIForwardCompositional.track + ~TemplateTrackerMIForwardCompositional.trackRobust + ~TemplateTrackerMIForwardCompositional.setGaussianFilterSize + ~TemplateTrackerMIForwardCompositional.initClick + ~TemplateTrackerMIForwardCompositional.getNbIteration + ~TemplateTrackerMIForwardCompositional.setIterationMax + ~TemplateTrackerMIForwardCompositional.HessienApproximationType + ~TemplateTrackerMIForwardCompositional.setNc + ~TemplateTrackerMIForwardCompositional.getNMI + ~TemplateTrackerMIForwardCompositional.USE_HESSIEN_BEST_COND + ~TemplateTrackerMIForwardCompositional.setNbIterBrent + ~TemplateTrackerMIForwardCompositional.HESSIAN_NONSECOND + ~TemplateTrackerMIForwardCompositional.resetTracker + ~TemplateTrackerMIForwardCompositional.HESSIAN_YOUCEF + ~TemplateTrackerMIForwardCompositional.BSPLINE_FOURTH_ORDER + ~TemplateTrackerMIForwardCompositional.getCovarianceMatrix + ~TemplateTrackerMIForwardCompositional.getdp + ~TemplateTrackerMIForwardCompositional.getH + ~TemplateTrackerMIForwardCompositional.getMI256 + ~TemplateTrackerMIForwardCompositional.setApprocHessian + ~TemplateTrackerMIForwardCompositional.setBlur + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~TemplateTrackerMIForwardCompositional.__doc__ + ~TemplateTrackerMIForwardCompositional.__init__ + ~TemplateTrackerMIForwardCompositional.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~TemplateTrackerMIForwardCompositional.BSPLINE_FOURTH_ORDER + ~TemplateTrackerMIForwardCompositional.BSPLINE_THIRD_ORDER + ~TemplateTrackerMIForwardCompositional.HESSIAN_0 + ~TemplateTrackerMIForwardCompositional.HESSIAN_EXACT + ~TemplateTrackerMIForwardCompositional.HESSIAN_NEW + ~TemplateTrackerMIForwardCompositional.HESSIAN_NONSECOND + ~TemplateTrackerMIForwardCompositional.HESSIAN_YOUCEF + ~TemplateTrackerMIForwardCompositional.HESSIAN_d2I + ~TemplateTrackerMIForwardCompositional.USE_HESSIEN_BEST_COND + ~TemplateTrackerMIForwardCompositional.USE_HESSIEN_DESIRE + ~TemplateTrackerMIForwardCompositional.USE_HESSIEN_NORMAL + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.tt_mi.TemplateTrackerMIInverseCompositional.rst b/modules/python/doc/_autosummary/visp.tt_mi.TemplateTrackerMIInverseCompositional.rst new file mode 100644 index 0000000000..286c9322da --- /dev/null +++ b/modules/python/doc/_autosummary/visp.tt_mi.TemplateTrackerMIInverseCompositional.rst @@ -0,0 +1,124 @@ +TemplateTrackerMIInverseCompositional +===================================== + +.. currentmodule:: visp.tt_mi + +.. autoclass:: TemplateTrackerMIInverseCompositional + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~TemplateTrackerMIInverseCompositional.initTemplateRefBspline + ~TemplateTrackerMIInverseCompositional.setMinimizationMethod + ~TemplateTrackerMIInverseCompositional.setUseTemplateSelect + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~TemplateTrackerMIInverseCompositional.setCovarianceComputation + ~TemplateTrackerMIInverseCompositional.setLambda + ~TemplateTrackerMIInverseCompositional.setp + ~TemplateTrackerMIInverseCompositional.getNbParam + ~TemplateTrackerMIInverseCompositional.HESSIAN_NEW + ~TemplateTrackerMIInverseCompositional.getp + ~TemplateTrackerMIInverseCompositional.HESSIAN_0 + ~TemplateTrackerMIInverseCompositional.USE_HESSIEN_DESIRE + ~TemplateTrackerMIInverseCompositional.initFromZone + ~TemplateTrackerMIInverseCompositional.getDiverge + ~TemplateTrackerMIInverseCompositional.setCostFunctionVerification + ~TemplateTrackerMIInverseCompositional.USE_HESSIEN_NORMAL + ~TemplateTrackerMIInverseCompositional.setThresholdResidualDifference + ~TemplateTrackerMIInverseCompositional.getRatioPixelIn + ~TemplateTrackerMIInverseCompositional.initFromPoints + ~TemplateTrackerMIInverseCompositional.setSampling + ~TemplateTrackerMIInverseCompositional.display + ~TemplateTrackerMIInverseCompositional.setUseBrent + ~TemplateTrackerMIInverseCompositional.setHessianComputation + ~TemplateTrackerMIInverseCompositional.HESSIAN_EXACT + ~TemplateTrackerMIInverseCompositional.setThresholdGradient + ~TemplateTrackerMIInverseCompositional.getZoneRef + ~TemplateTrackerMIInverseCompositional.setGain + ~TemplateTrackerMIInverseCompositional.BsplineType + ~TemplateTrackerMIInverseCompositional.HessienType + ~TemplateTrackerMIInverseCompositional.HESSIAN_d2I + ~TemplateTrackerMIInverseCompositional.setHDes + ~TemplateTrackerMIInverseCompositional.setBspline + ~TemplateTrackerMIInverseCompositional.setPyramidal + ~TemplateTrackerMIInverseCompositional.getMI + ~TemplateTrackerMIInverseCompositional.getG + ~TemplateTrackerMIInverseCompositional.BSPLINE_THIRD_ORDER + ~TemplateTrackerMIInverseCompositional.track + ~TemplateTrackerMIInverseCompositional.trackRobust + ~TemplateTrackerMIInverseCompositional.setGaussianFilterSize + ~TemplateTrackerMIInverseCompositional.initClick + ~TemplateTrackerMIInverseCompositional.getNbIteration + ~TemplateTrackerMIInverseCompositional.setIterationMax + ~TemplateTrackerMIInverseCompositional.HessienApproximationType + ~TemplateTrackerMIInverseCompositional.setNc + ~TemplateTrackerMIInverseCompositional.getNMI + ~TemplateTrackerMIInverseCompositional.USE_HESSIEN_BEST_COND + ~TemplateTrackerMIInverseCompositional.setNbIterBrent + ~TemplateTrackerMIInverseCompositional.HESSIAN_NONSECOND + ~TemplateTrackerMIInverseCompositional.resetTracker + ~TemplateTrackerMIInverseCompositional.HESSIAN_YOUCEF + ~TemplateTrackerMIInverseCompositional.BSPLINE_FOURTH_ORDER + ~TemplateTrackerMIInverseCompositional.getCovarianceMatrix + ~TemplateTrackerMIInverseCompositional.getdp + ~TemplateTrackerMIInverseCompositional.getH + ~TemplateTrackerMIInverseCompositional.getMI256 + ~TemplateTrackerMIInverseCompositional.setApprocHessian + ~TemplateTrackerMIInverseCompositional.setBlur + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~TemplateTrackerMIInverseCompositional.__doc__ + ~TemplateTrackerMIInverseCompositional.__init__ + ~TemplateTrackerMIInverseCompositional.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~TemplateTrackerMIInverseCompositional.BSPLINE_FOURTH_ORDER + ~TemplateTrackerMIInverseCompositional.BSPLINE_THIRD_ORDER + ~TemplateTrackerMIInverseCompositional.HESSIAN_0 + ~TemplateTrackerMIInverseCompositional.HESSIAN_EXACT + ~TemplateTrackerMIInverseCompositional.HESSIAN_NEW + ~TemplateTrackerMIInverseCompositional.HESSIAN_NONSECOND + ~TemplateTrackerMIInverseCompositional.HESSIAN_YOUCEF + ~TemplateTrackerMIInverseCompositional.HESSIAN_d2I + ~TemplateTrackerMIInverseCompositional.USE_GRADIENT + ~TemplateTrackerMIInverseCompositional.USE_HESSIEN_BEST_COND + ~TemplateTrackerMIInverseCompositional.USE_HESSIEN_DESIRE + ~TemplateTrackerMIInverseCompositional.USE_HESSIEN_NORMAL + ~TemplateTrackerMIInverseCompositional.USE_LMA + ~TemplateTrackerMIInverseCompositional.USE_NEWTON + ~TemplateTrackerMIInverseCompositional.USE_QUASINEWTON + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.tt_mi.rst b/modules/python/doc/_autosummary/visp.tt_mi.rst new file mode 100644 index 0000000000..c6336a4393 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.tt_mi.rst @@ -0,0 +1,36 @@ +tt\_mi +====== + +.. automodule:: visp.tt_mi + + + + + + + + + + + + .. rubric:: Classes + + .. autosummary:: + :toctree: + :template: custom-class-template.rst + :nosignatures: + + TemplateTrackerMI + TemplateTrackerMIESM + TemplateTrackerMIForwardAdditional + TemplateTrackerMIForwardCompositional + TemplateTrackerMIInverseCompositional + + + + + + + + + diff --git a/modules/python/doc/_autosummary/visp.vision.BasicKeyPoint.rst b/modules/python/doc/_autosummary/visp.vision.BasicKeyPoint.rst new file mode 100644 index 0000000000..02f5c5b56c --- /dev/null +++ b/modules/python/doc/_autosummary/visp.vision.BasicKeyPoint.rst @@ -0,0 +1,57 @@ +BasicKeyPoint +============= + +.. currentmodule:: visp.vision + +.. autoclass:: BasicKeyPoint + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~BasicKeyPoint.getCurrentImagePointsList + ~BasicKeyPoint.getIndexInAllReferencePointList + ~BasicKeyPoint.getMatchedPointNumber + ~BasicKeyPoint.getMatchedPoints + ~BasicKeyPoint.getMatchedReferencePoints + ~BasicKeyPoint.getReferenceImagePointsList + ~BasicKeyPoint.getReferencePoint + ~BasicKeyPoint.getReferencePointNumber + ~BasicKeyPoint.referenceBuilt + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~BasicKeyPoint.__doc__ + ~BasicKeyPoint.__init__ + ~BasicKeyPoint.__module__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.vision.Calibration.rst b/modules/python/doc/_autosummary/visp.vision.Calibration.rst new file mode 100644 index 0000000000..903b3201ae --- /dev/null +++ b/modules/python/doc/_autosummary/visp.vision.Calibration.rst @@ -0,0 +1,84 @@ +Calibration +=========== + +.. currentmodule:: visp.vision + +.. autoclass:: Calibration + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~Calibration.addPoint + ~Calibration.clearPoint + ~Calibration.computeCalibration + ~Calibration.computeCalibrationMulti + ~Calibration.computeStdDeviation + ~Calibration.computeStdDeviation_dist + ~Calibration.displayData + ~Calibration.displayGrid + ~Calibration.getLambda + ~Calibration.getResidual + ~Calibration.getResidual_dist + ~Calibration.get_npt + ~Calibration.init + ~Calibration.readData + ~Calibration.readGrid + ~Calibration.setAspectRatio + ~Calibration.setLambda + ~Calibration.writeData + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~Calibration.__doc__ + ~Calibration.__init__ + ~Calibration.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~Calibration.CALIB_LAGRANGE + ~Calibration.CALIB_LAGRANGE_VIRTUAL_VS + ~Calibration.CALIB_LAGRANGE_VIRTUAL_VS_DIST + ~Calibration.CALIB_VIRTUAL_VS + ~Calibration.CALIB_VIRTUAL_VS_DIST + ~Calibration.aspect_ratio + ~Calibration.cMo + ~Calibration.cMo_dist + ~Calibration.cam + ~Calibration.cam_dist + ~Calibration.eMc + ~Calibration.eMc_dist + ~Calibration.rMe + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.vision.HandEyeCalibration.rst b/modules/python/doc/_autosummary/visp.vision.HandEyeCalibration.rst new file mode 100644 index 0000000000..65d4d37423 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.vision.HandEyeCalibration.rst @@ -0,0 +1,49 @@ +HandEyeCalibration +================== + +.. currentmodule:: visp.vision + +.. autoclass:: HandEyeCalibration + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~HandEyeCalibration.calibrate + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~HandEyeCalibration.__doc__ + ~HandEyeCalibration.__init__ + ~HandEyeCalibration.__module__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.vision.Homography.rst b/modules/python/doc/_autosummary/visp.vision.Homography.rst new file mode 100644 index 0000000000..bbab7e4b8d --- /dev/null +++ b/modules/python/doc/_autosummary/visp.vision.Homography.rst @@ -0,0 +1,81 @@ +Homography +========== + +.. currentmodule:: visp.vision + +.. autoclass:: Homography + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~Homography.DLT + ~Homography.HLM + ~Homography.buildFrom + ~Homography.collineation2homography + ~Homography.computeDisplacement + ~Homography.convert + ~Homography.det + ~Homography.eye + ~Homography.homography2collineation + ~Homography.inverse + ~Homography.load + ~Homography.project + ~Homography.projection + ~Homography.ransac + ~Homography.resize + ~Homography.robust + ~Homography.save + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~Homography.insertStatic + ~Homography.getMaxValue + ~Homography.t + ~Homography.size + ~Homography.hadamard + ~Homography.insert + ~Homography.getCols + ~Homography.getMinValue + ~Homography.numpy + ~Homography.reshape + ~Homography.conv2 + ~Homography.saveYAML + ~Homography.getRows + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~Homography.__doc__ + ~Homography.__init__ + ~Homography.__itruediv__ + ~Homography.__module__ + ~Homography.__mul__ + ~Homography.__truediv__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.vision.KeyPoint.rst b/modules/python/doc/_autosummary/visp.vision.KeyPoint.rst new file mode 100644 index 0000000000..fff19bc2c2 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.vision.KeyPoint.rst @@ -0,0 +1,161 @@ +KeyPoint +======== + +.. currentmodule:: visp.vision + +.. autoclass:: KeyPoint + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~KeyPoint.buildReference + ~KeyPoint.compute3D + ~KeyPoint.createImageMatching + ~KeyPoint.detect + ~KeyPoint.display + ~KeyPoint.displayMatching + ~KeyPoint.getCovarianceMatrix + ~KeyPoint.getDetectionTime + ~KeyPoint.getDetector + ~KeyPoint.getDetectorNames + ~KeyPoint.getExtractionTime + ~KeyPoint.getExtractor + ~KeyPoint.getExtractorNames + ~KeyPoint.getImageFormat + ~KeyPoint.getMatchQueryToTrainKeyPoints + ~KeyPoint.getMatcher + ~KeyPoint.getMatches + ~KeyPoint.getMatchingTime + ~KeyPoint.getNbImages + ~KeyPoint.getObjectPoints + ~KeyPoint.getPoseTime + ~KeyPoint.getQueryDescriptors + ~KeyPoint.getQueryKeyPoints + ~KeyPoint.getRansacInliers + ~KeyPoint.getRansacOutliers + ~KeyPoint.getTrainDescriptors + ~KeyPoint.getTrainKeyPoints + ~KeyPoint.getTrainPoints + ~KeyPoint.initMatcher + ~KeyPoint.insertImageMatching + ~KeyPoint.loadConfigFile + ~KeyPoint.loadLearningData + ~KeyPoint.match + ~KeyPoint.matchPoint + ~KeyPoint.reset + ~KeyPoint.saveLearningData + ~KeyPoint.setCovarianceComputation + ~KeyPoint.setDetectionMethod + ~KeyPoint.setDetector + ~KeyPoint.setDetectors + ~KeyPoint.setExtractor + ~KeyPoint.setExtractors + ~KeyPoint.setFilterMatchingType + ~KeyPoint.setImageFormat + ~KeyPoint.setMatcher + ~KeyPoint.setMatchingFactorThreshold + ~KeyPoint.setMatchingRatioThreshold + ~KeyPoint.setMaxFeatures + ~KeyPoint.setRansacConsensusPercentage + ~KeyPoint.setRansacFilterFlag + ~KeyPoint.setRansacIteration + ~KeyPoint.setRansacMinInlierCount + ~KeyPoint.setRansacParallel + ~KeyPoint.setRansacParallelNbThreads + ~KeyPoint.setRansacReprojectionError + ~KeyPoint.setRansacThreshold + ~KeyPoint.setUseAffineDetection + ~KeyPoint.setUseMatchTrainToQuery + ~KeyPoint.setUseRansacConsensusPercentage + ~KeyPoint.setUseRansacVVS + ~KeyPoint.setUseSingleMatchFilter + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~KeyPoint.referenceBuilt + ~KeyPoint.getMatchedPointNumber + ~KeyPoint.getIndexInAllReferencePointList + ~KeyPoint.getMatchedReferencePoints + ~KeyPoint.getReferenceImagePointsList + ~KeyPoint.getReferencePoint + ~KeyPoint.getMatchedPoints + ~KeyPoint.getCurrentImagePointsList + ~KeyPoint.getReferencePointNumber + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~KeyPoint.__doc__ + ~KeyPoint.__init__ + ~KeyPoint.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~KeyPoint.DESCRIPTOR_AKAZE + ~KeyPoint.DESCRIPTOR_BRIEF + ~KeyPoint.DESCRIPTOR_BRISK + ~KeyPoint.DESCRIPTOR_BoostDesc + ~KeyPoint.DESCRIPTOR_DAISY + ~KeyPoint.DESCRIPTOR_FREAK + ~KeyPoint.DESCRIPTOR_KAZE + ~KeyPoint.DESCRIPTOR_LATCH + ~KeyPoint.DESCRIPTOR_ORB + ~KeyPoint.DESCRIPTOR_SIFT + ~KeyPoint.DESCRIPTOR_SURF + ~KeyPoint.DESCRIPTOR_TYPE_SIZE + ~KeyPoint.DESCRIPTOR_VGG + ~KeyPoint.DETECTOR_AGAST + ~KeyPoint.DETECTOR_AKAZE + ~KeyPoint.DETECTOR_BRISK + ~KeyPoint.DETECTOR_FAST + ~KeyPoint.DETECTOR_GFTT + ~KeyPoint.DETECTOR_KAZE + ~KeyPoint.DETECTOR_MSD + ~KeyPoint.DETECTOR_MSER + ~KeyPoint.DETECTOR_ORB + ~KeyPoint.DETECTOR_SIFT + ~KeyPoint.DETECTOR_STAR + ~KeyPoint.DETECTOR_SURF + ~KeyPoint.DETECTOR_SimpleBlob + ~KeyPoint.DETECTOR_TYPE_SIZE + ~KeyPoint.constantFactorDistanceThreshold + ~KeyPoint.detectionScore + ~KeyPoint.detectionThreshold + ~KeyPoint.jpgImageFormat + ~KeyPoint.noFilterMatching + ~KeyPoint.pgmImageFormat + ~KeyPoint.pngImageFormat + ~KeyPoint.ppmImageFormat + ~KeyPoint.ratioDistanceThreshold + ~KeyPoint.stdAndRatioDistanceThreshold + ~KeyPoint.stdDistanceThreshold + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.vision.PlaneEstimation.rst b/modules/python/doc/_autosummary/visp.vision.PlaneEstimation.rst new file mode 100644 index 0000000000..c14013620a --- /dev/null +++ b/modules/python/doc/_autosummary/visp.vision.PlaneEstimation.rst @@ -0,0 +1,49 @@ +PlaneEstimation +=============== + +.. currentmodule:: visp.vision + +.. autoclass:: PlaneEstimation + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~PlaneEstimation.estimatePlane + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~PlaneEstimation.__doc__ + ~PlaneEstimation.__init__ + ~PlaneEstimation.__module__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.vision.Pose.rst b/modules/python/doc/_autosummary/visp.vision.Pose.rst new file mode 100644 index 0000000000..c9fae834ca --- /dev/null +++ b/modules/python/doc/_autosummary/visp.vision.Pose.rst @@ -0,0 +1,105 @@ +Pose +==== + +.. currentmodule:: visp.vision + +.. autoclass:: Pose + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~Pose.addPoint + ~Pose.addPoints + ~Pose.clearPoint + ~Pose.computePoseDementhonLagrangeVVS + ~Pose.computeRansacIterations + ~Pose.computeResidual + ~Pose.display + ~Pose.displayModel + ~Pose.getCovarianceMatrix + ~Pose.getNbParallelRansacThreads + ~Pose.getPoints + ~Pose.getRansacInlierIndex + ~Pose.getRansacInliers + ~Pose.getRansacNbInliers + ~Pose.getUseParallelRansac + ~Pose.poseDementhonNonPlan + ~Pose.poseDementhonPlan + ~Pose.poseFromRectangle + ~Pose.poseLagrangeNonPlan + ~Pose.poseLowe + ~Pose.poseVirtualVS + ~Pose.poseVirtualVSWithDepth + ~Pose.poseVirtualVSrobust + ~Pose.printPoint + ~Pose.setCovarianceComputation + ~Pose.setDementhonSvThreshold + ~Pose.setDistanceToPlaneForCoplanarityTest + ~Pose.setLambda + ~Pose.setNbParallelRansacThreads + ~Pose.setRansacFilterFlag + ~Pose.setRansacMaxTrials + ~Pose.setRansacNbInliersToReachConsensus + ~Pose.setRansacThreshold + ~Pose.setUseParallelRansac + ~Pose.setVvsEpsilon + ~Pose.setVvsIterMax + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~Pose.__doc__ + ~Pose.__init__ + ~Pose.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~Pose.CHECK_DEGENERATE_POINTS + ~Pose.DEMENTHON + ~Pose.DEMENTHON_LAGRANGE_VIRTUAL_VS + ~Pose.DEMENTHON_LOWE + ~Pose.DEMENTHON_VIRTUAL_VS + ~Pose.LAGRANGE + ~Pose.LAGRANGE_LOWE + ~Pose.LAGRANGE_VIRTUAL_VS + ~Pose.LOWE + ~Pose.NO_FILTER + ~Pose.PREFILTER_DEGENERATE_POINTS + ~Pose.RANSAC + ~Pose.VIRTUAL_VS + ~Pose.listP + ~Pose.npt + ~Pose.residual + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.vision.XmlConfigParserKeyPoint.rst b/modules/python/doc/_autosummary/visp.vision.XmlConfigParserKeyPoint.rst new file mode 100644 index 0000000000..8535f200b5 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.vision.XmlConfigParserKeyPoint.rst @@ -0,0 +1,72 @@ +XmlConfigParserKeyPoint +======================= + +.. currentmodule:: visp.vision + +.. autoclass:: XmlConfigParserKeyPoint + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~XmlConfigParserKeyPoint.getDetectorName + ~XmlConfigParserKeyPoint.getExtractorName + ~XmlConfigParserKeyPoint.getMatcherName + ~XmlConfigParserKeyPoint.getMatchingFactorThreshold + ~XmlConfigParserKeyPoint.getMatchingMethod + ~XmlConfigParserKeyPoint.getMatchingRatioThreshold + ~XmlConfigParserKeyPoint.getNbRansacIterations + ~XmlConfigParserKeyPoint.getNbRansacMinInlierCount + ~XmlConfigParserKeyPoint.getRansacConsensusPercentage + ~XmlConfigParserKeyPoint.getRansacReprojectionError + ~XmlConfigParserKeyPoint.getRansacThreshold + ~XmlConfigParserKeyPoint.getUseRansacConsensusPercentage + ~XmlConfigParserKeyPoint.getUseRansacVVSPoseEstimation + ~XmlConfigParserKeyPoint.parse + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~XmlConfigParserKeyPoint.__doc__ + ~XmlConfigParserKeyPoint.__init__ + ~XmlConfigParserKeyPoint.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~XmlConfigParserKeyPoint.constantFactorDistanceThreshold + ~XmlConfigParserKeyPoint.noFilterMatching + ~XmlConfigParserKeyPoint.ratioDistanceThreshold + ~XmlConfigParserKeyPoint.stdAndRatioDistanceThreshold + ~XmlConfigParserKeyPoint.stdDistanceThreshold + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.vision.rst b/modules/python/doc/_autosummary/visp.vision.rst new file mode 100644 index 0000000000..387500bbbe --- /dev/null +++ b/modules/python/doc/_autosummary/visp.vision.rst @@ -0,0 +1,46 @@ +vision +====== + +.. automodule:: visp.vision + + + + + + + + .. rubric:: Functions + + .. autosummary:: + :nosignatures: + + pythag + + + + + + .. rubric:: Classes + + .. autosummary:: + :toctree: + :template: custom-class-template.rst + :nosignatures: + + BasicKeyPoint + Calibration + HandEyeCalibration + Homography + KeyPoint + PlaneEstimation + Pose + XmlConfigParserKeyPoint + + + + + + + + + diff --git a/modules/python/doc/_autosummary/visp.visual_features.BasicFeature.rst b/modules/python/doc/_autosummary/visp.visual_features.BasicFeature.rst new file mode 100644 index 0000000000..bdffa0f597 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.visual_features.BasicFeature.rst @@ -0,0 +1,64 @@ +BasicFeature +============ + +.. currentmodule:: visp.visual_features + +.. autoclass:: BasicFeature + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~BasicFeature.dimension_s + ~BasicFeature.error + ~BasicFeature.getDeallocate + ~BasicFeature.getDimension + ~BasicFeature.get_s + ~BasicFeature.selectAll + ~BasicFeature.setDeallocate + ~BasicFeature.setFlags + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~BasicFeature.__doc__ + ~BasicFeature.__init__ + ~BasicFeature.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~BasicFeature.FEATURE_ALL + ~BasicFeature.user + ~BasicFeature.vpServo + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.visual_features.FeatureBuilder.rst b/modules/python/doc/_autosummary/visp.visual_features.FeatureBuilder.rst new file mode 100644 index 0000000000..c3df559c23 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.visual_features.FeatureBuilder.rst @@ -0,0 +1,49 @@ +FeatureBuilder +============== + +.. currentmodule:: visp.visual_features + +.. autoclass:: FeatureBuilder + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~FeatureBuilder.create + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~FeatureBuilder.__doc__ + ~FeatureBuilder.__init__ + ~FeatureBuilder.__module__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.visual_features.FeatureDepth.rst b/modules/python/doc/_autosummary/visp.visual_features.FeatureDepth.rst new file mode 100644 index 0000000000..1910f185e3 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.visual_features.FeatureDepth.rst @@ -0,0 +1,83 @@ +FeatureDepth +============ + +.. currentmodule:: visp.visual_features + +.. autoclass:: FeatureDepth + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~FeatureDepth.buildFrom + ~FeatureDepth.display + ~FeatureDepth.error + ~FeatureDepth.get_LogZoverZstar + ~FeatureDepth.get_Z + ~FeatureDepth.get_x + ~FeatureDepth.get_y + ~FeatureDepth.init + ~FeatureDepth.interaction + ~FeatureDepth.print + ~FeatureDepth.set_LogZoverZstar + ~FeatureDepth.set_Z + ~FeatureDepth.set_x + ~FeatureDepth.set_xyZLogZoverZstar + ~FeatureDepth.set_y + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~FeatureDepth.user + ~FeatureDepth.dimension_s + ~FeatureDepth.get_s + ~FeatureDepth.BasicFeatureDeallocatorType + ~FeatureDepth.BasicFeatureSelect + ~FeatureDepth.getDeallocate + ~FeatureDepth.selectAll + ~FeatureDepth.setFlags + ~FeatureDepth.FEATURE_ALL + ~FeatureDepth.setDeallocate + ~FeatureDepth.vpServo + ~FeatureDepth.getDimension + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~FeatureDepth.__doc__ + ~FeatureDepth.__init__ + ~FeatureDepth.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~FeatureDepth.FEATURE_ALL + ~FeatureDepth.user + ~FeatureDepth.vpServo + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.visual_features.FeatureEllipse.rst b/modules/python/doc/_autosummary/visp.visual_features.FeatureEllipse.rst new file mode 100644 index 0000000000..af79a2c537 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.visual_features.FeatureEllipse.rst @@ -0,0 +1,89 @@ +FeatureEllipse +============== + +.. currentmodule:: visp.visual_features + +.. autoclass:: FeatureEllipse + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~FeatureEllipse.buildFrom + ~FeatureEllipse.display + ~FeatureEllipse.error + ~FeatureEllipse.get_n02 + ~FeatureEllipse.get_n11 + ~FeatureEllipse.get_n20 + ~FeatureEllipse.get_x + ~FeatureEllipse.get_y + ~FeatureEllipse.init + ~FeatureEllipse.interaction + ~FeatureEllipse.print + ~FeatureEllipse.selectX + ~FeatureEllipse.selectY + ~FeatureEllipse.select_n02 + ~FeatureEllipse.select_n11 + ~FeatureEllipse.select_n20 + ~FeatureEllipse.setABC + ~FeatureEllipse.setMoments + ~FeatureEllipse.set_x + ~FeatureEllipse.set_xy + ~FeatureEllipse.set_y + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~FeatureEllipse.user + ~FeatureEllipse.dimension_s + ~FeatureEllipse.get_s + ~FeatureEllipse.BasicFeatureDeallocatorType + ~FeatureEllipse.BasicFeatureSelect + ~FeatureEllipse.getDeallocate + ~FeatureEllipse.selectAll + ~FeatureEllipse.setFlags + ~FeatureEllipse.FEATURE_ALL + ~FeatureEllipse.setDeallocate + ~FeatureEllipse.vpServo + ~FeatureEllipse.getDimension + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~FeatureEllipse.__doc__ + ~FeatureEllipse.__init__ + ~FeatureEllipse.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~FeatureEllipse.FEATURE_ALL + ~FeatureEllipse.user + ~FeatureEllipse.vpServo + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.visual_features.FeatureLine.rst b/modules/python/doc/_autosummary/visp.visual_features.FeatureLine.rst new file mode 100644 index 0000000000..77c85e4f49 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.visual_features.FeatureLine.rst @@ -0,0 +1,80 @@ +FeatureLine +=========== + +.. currentmodule:: visp.visual_features + +.. autoclass:: FeatureLine + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~FeatureLine.buildFrom + ~FeatureLine.display + ~FeatureLine.error + ~FeatureLine.getRho + ~FeatureLine.getTheta + ~FeatureLine.init + ~FeatureLine.interaction + ~FeatureLine.print + ~FeatureLine.selectRho + ~FeatureLine.selectTheta + ~FeatureLine.setABCD + ~FeatureLine.setRhoTheta + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~FeatureLine.user + ~FeatureLine.dimension_s + ~FeatureLine.get_s + ~FeatureLine.BasicFeatureDeallocatorType + ~FeatureLine.BasicFeatureSelect + ~FeatureLine.getDeallocate + ~FeatureLine.selectAll + ~FeatureLine.setFlags + ~FeatureLine.FEATURE_ALL + ~FeatureLine.setDeallocate + ~FeatureLine.vpServo + ~FeatureLine.getDimension + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~FeatureLine.__doc__ + ~FeatureLine.__init__ + ~FeatureLine.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~FeatureLine.FEATURE_ALL + ~FeatureLine.user + ~FeatureLine.vpServo + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.visual_features.FeatureLuminance.rst b/modules/python/doc/_autosummary/visp.visual_features.FeatureLuminance.rst new file mode 100644 index 0000000000..790df0aa8c --- /dev/null +++ b/modules/python/doc/_autosummary/visp.visual_features.FeatureLuminance.rst @@ -0,0 +1,78 @@ +FeatureLuminance +================ + +.. currentmodule:: visp.visual_features + +.. autoclass:: FeatureLuminance + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~FeatureLuminance.buildFrom + ~FeatureLuminance.display + ~FeatureLuminance.error + ~FeatureLuminance.get_Z + ~FeatureLuminance.init + ~FeatureLuminance.interaction + ~FeatureLuminance.print + ~FeatureLuminance.setCameraParameters + ~FeatureLuminance.set_Z + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~FeatureLuminance.user + ~FeatureLuminance.dimension_s + ~FeatureLuminance.get_s + ~FeatureLuminance.BasicFeatureDeallocatorType + ~FeatureLuminance.BasicFeatureSelect + ~FeatureLuminance.getDeallocate + ~FeatureLuminance.selectAll + ~FeatureLuminance.setFlags + ~FeatureLuminance.FEATURE_ALL + ~FeatureLuminance.setDeallocate + ~FeatureLuminance.vpServo + ~FeatureLuminance.getDimension + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~FeatureLuminance.__doc__ + ~FeatureLuminance.__init__ + ~FeatureLuminance.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~FeatureLuminance.FEATURE_ALL + ~FeatureLuminance.cam + ~FeatureLuminance.user + ~FeatureLuminance.vpServo + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.visual_features.FeatureMoment.rst b/modules/python/doc/_autosummary/visp.visual_features.FeatureMoment.rst new file mode 100644 index 0000000000..6b5298845d --- /dev/null +++ b/modules/python/doc/_autosummary/visp.visual_features.FeatureMoment.rst @@ -0,0 +1,78 @@ +FeatureMoment +============= + +.. currentmodule:: visp.visual_features + +.. autoclass:: FeatureMoment + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~FeatureMoment.compute_interaction + ~FeatureMoment.display + ~FeatureMoment.getDimension + ~FeatureMoment.init + ~FeatureMoment.interaction + ~FeatureMoment.linkTo + ~FeatureMoment.print + ~FeatureMoment.printDependencies + ~FeatureMoment.update + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~FeatureMoment.user + ~FeatureMoment.dimension_s + ~FeatureMoment.get_s + ~FeatureMoment.BasicFeatureDeallocatorType + ~FeatureMoment.BasicFeatureSelect + ~FeatureMoment.getDeallocate + ~FeatureMoment.selectAll + ~FeatureMoment.error + ~FeatureMoment.setFlags + ~FeatureMoment.FEATURE_ALL + ~FeatureMoment.setDeallocate + ~FeatureMoment.vpServo + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~FeatureMoment.__doc__ + ~FeatureMoment.__init__ + ~FeatureMoment.__module__ + ~FeatureMoment.__repr__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~FeatureMoment.FEATURE_ALL + ~FeatureMoment.user + ~FeatureMoment.vpServo + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.visual_features.FeatureMomentAlpha.rst b/modules/python/doc/_autosummary/visp.visual_features.FeatureMomentAlpha.rst new file mode 100644 index 0000000000..eb397c03e6 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.visual_features.FeatureMomentAlpha.rst @@ -0,0 +1,79 @@ +FeatureMomentAlpha +================== + +.. currentmodule:: visp.visual_features + +.. autoclass:: FeatureMomentAlpha + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~FeatureMomentAlpha.compute_interaction + ~FeatureMomentAlpha.error + ~FeatureMomentAlpha.momentName + ~FeatureMomentAlpha.name + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~FeatureMomentAlpha.user + ~FeatureMomentAlpha.dimension_s + ~FeatureMomentAlpha.get_s + ~FeatureMomentAlpha.BasicFeatureDeallocatorType + ~FeatureMomentAlpha.BasicFeatureSelect + ~FeatureMomentAlpha.update + ~FeatureMomentAlpha.getDeallocate + ~FeatureMomentAlpha.selectAll + ~FeatureMomentAlpha.display + ~FeatureMomentAlpha.setFlags + ~FeatureMomentAlpha.linkTo + ~FeatureMomentAlpha.interaction + ~FeatureMomentAlpha.print + ~FeatureMomentAlpha.FEATURE_ALL + ~FeatureMomentAlpha.setDeallocate + ~FeatureMomentAlpha.printDependencies + ~FeatureMomentAlpha.init + ~FeatureMomentAlpha.vpServo + ~FeatureMomentAlpha.getDimension + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~FeatureMomentAlpha.__doc__ + ~FeatureMomentAlpha.__init__ + ~FeatureMomentAlpha.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~FeatureMomentAlpha.FEATURE_ALL + ~FeatureMomentAlpha.user + ~FeatureMomentAlpha.vpServo + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.visual_features.FeatureMomentArea.rst b/modules/python/doc/_autosummary/visp.visual_features.FeatureMomentArea.rst new file mode 100644 index 0000000000..396e04f1b7 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.visual_features.FeatureMomentArea.rst @@ -0,0 +1,79 @@ +FeatureMomentArea +================= + +.. currentmodule:: visp.visual_features + +.. autoclass:: FeatureMomentArea + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~FeatureMomentArea.compute_interaction + ~FeatureMomentArea.momentName + ~FeatureMomentArea.name + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~FeatureMomentArea.user + ~FeatureMomentArea.dimension_s + ~FeatureMomentArea.get_s + ~FeatureMomentArea.BasicFeatureDeallocatorType + ~FeatureMomentArea.BasicFeatureSelect + ~FeatureMomentArea.update + ~FeatureMomentArea.getDeallocate + ~FeatureMomentArea.selectAll + ~FeatureMomentArea.display + ~FeatureMomentArea.error + ~FeatureMomentArea.setFlags + ~FeatureMomentArea.linkTo + ~FeatureMomentArea.interaction + ~FeatureMomentArea.print + ~FeatureMomentArea.FEATURE_ALL + ~FeatureMomentArea.setDeallocate + ~FeatureMomentArea.printDependencies + ~FeatureMomentArea.init + ~FeatureMomentArea.vpServo + ~FeatureMomentArea.getDimension + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~FeatureMomentArea.__doc__ + ~FeatureMomentArea.__init__ + ~FeatureMomentArea.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~FeatureMomentArea.FEATURE_ALL + ~FeatureMomentArea.user + ~FeatureMomentArea.vpServo + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.visual_features.FeatureMomentAreaNormalized.rst b/modules/python/doc/_autosummary/visp.visual_features.FeatureMomentAreaNormalized.rst new file mode 100644 index 0000000000..059d78c5ab --- /dev/null +++ b/modules/python/doc/_autosummary/visp.visual_features.FeatureMomentAreaNormalized.rst @@ -0,0 +1,79 @@ +FeatureMomentAreaNormalized +=========================== + +.. currentmodule:: visp.visual_features + +.. autoclass:: FeatureMomentAreaNormalized + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~FeatureMomentAreaNormalized.compute_interaction + ~FeatureMomentAreaNormalized.momentName + ~FeatureMomentAreaNormalized.name + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~FeatureMomentAreaNormalized.user + ~FeatureMomentAreaNormalized.dimension_s + ~FeatureMomentAreaNormalized.get_s + ~FeatureMomentAreaNormalized.BasicFeatureDeallocatorType + ~FeatureMomentAreaNormalized.BasicFeatureSelect + ~FeatureMomentAreaNormalized.update + ~FeatureMomentAreaNormalized.getDeallocate + ~FeatureMomentAreaNormalized.selectAll + ~FeatureMomentAreaNormalized.display + ~FeatureMomentAreaNormalized.error + ~FeatureMomentAreaNormalized.setFlags + ~FeatureMomentAreaNormalized.linkTo + ~FeatureMomentAreaNormalized.interaction + ~FeatureMomentAreaNormalized.print + ~FeatureMomentAreaNormalized.FEATURE_ALL + ~FeatureMomentAreaNormalized.setDeallocate + ~FeatureMomentAreaNormalized.printDependencies + ~FeatureMomentAreaNormalized.init + ~FeatureMomentAreaNormalized.vpServo + ~FeatureMomentAreaNormalized.getDimension + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~FeatureMomentAreaNormalized.__doc__ + ~FeatureMomentAreaNormalized.__init__ + ~FeatureMomentAreaNormalized.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~FeatureMomentAreaNormalized.FEATURE_ALL + ~FeatureMomentAreaNormalized.user + ~FeatureMomentAreaNormalized.vpServo + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.visual_features.FeatureMomentBasic.rst b/modules/python/doc/_autosummary/visp.visual_features.FeatureMomentBasic.rst new file mode 100644 index 0000000000..00d7b29e5d --- /dev/null +++ b/modules/python/doc/_autosummary/visp.visual_features.FeatureMomentBasic.rst @@ -0,0 +1,79 @@ +FeatureMomentBasic +================== + +.. currentmodule:: visp.visual_features + +.. autoclass:: FeatureMomentBasic + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~FeatureMomentBasic.compute_interaction + ~FeatureMomentBasic.interaction + ~FeatureMomentBasic.momentName + ~FeatureMomentBasic.name + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~FeatureMomentBasic.user + ~FeatureMomentBasic.dimension_s + ~FeatureMomentBasic.get_s + ~FeatureMomentBasic.BasicFeatureDeallocatorType + ~FeatureMomentBasic.BasicFeatureSelect + ~FeatureMomentBasic.update + ~FeatureMomentBasic.getDeallocate + ~FeatureMomentBasic.selectAll + ~FeatureMomentBasic.display + ~FeatureMomentBasic.error + ~FeatureMomentBasic.setFlags + ~FeatureMomentBasic.linkTo + ~FeatureMomentBasic.print + ~FeatureMomentBasic.FEATURE_ALL + ~FeatureMomentBasic.setDeallocate + ~FeatureMomentBasic.printDependencies + ~FeatureMomentBasic.init + ~FeatureMomentBasic.vpServo + ~FeatureMomentBasic.getDimension + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~FeatureMomentBasic.__doc__ + ~FeatureMomentBasic.__init__ + ~FeatureMomentBasic.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~FeatureMomentBasic.FEATURE_ALL + ~FeatureMomentBasic.user + ~FeatureMomentBasic.vpServo + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.visual_features.FeatureMomentCInvariant.rst b/modules/python/doc/_autosummary/visp.visual_features.FeatureMomentCInvariant.rst new file mode 100644 index 0000000000..dd6f1f40b5 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.visual_features.FeatureMomentCInvariant.rst @@ -0,0 +1,95 @@ +FeatureMomentCInvariant +======================= + +.. currentmodule:: visp.visual_features + +.. autoclass:: FeatureMomentCInvariant + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~FeatureMomentCInvariant.compute_interaction + ~FeatureMomentCInvariant.momentName + ~FeatureMomentCInvariant.name + ~FeatureMomentCInvariant.printLsofInvariants + ~FeatureMomentCInvariant.selectC1 + ~FeatureMomentCInvariant.selectC10 + ~FeatureMomentCInvariant.selectC2 + ~FeatureMomentCInvariant.selectC3 + ~FeatureMomentCInvariant.selectC4 + ~FeatureMomentCInvariant.selectC5 + ~FeatureMomentCInvariant.selectC6 + ~FeatureMomentCInvariant.selectC7 + ~FeatureMomentCInvariant.selectC8 + ~FeatureMomentCInvariant.selectC9 + ~FeatureMomentCInvariant.selectPx + ~FeatureMomentCInvariant.selectPy + ~FeatureMomentCInvariant.selectSx + ~FeatureMomentCInvariant.selectSy + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~FeatureMomentCInvariant.user + ~FeatureMomentCInvariant.dimension_s + ~FeatureMomentCInvariant.get_s + ~FeatureMomentCInvariant.BasicFeatureDeallocatorType + ~FeatureMomentCInvariant.BasicFeatureSelect + ~FeatureMomentCInvariant.update + ~FeatureMomentCInvariant.getDeallocate + ~FeatureMomentCInvariant.selectAll + ~FeatureMomentCInvariant.display + ~FeatureMomentCInvariant.error + ~FeatureMomentCInvariant.setFlags + ~FeatureMomentCInvariant.linkTo + ~FeatureMomentCInvariant.interaction + ~FeatureMomentCInvariant.print + ~FeatureMomentCInvariant.FEATURE_ALL + ~FeatureMomentCInvariant.setDeallocate + ~FeatureMomentCInvariant.printDependencies + ~FeatureMomentCInvariant.init + ~FeatureMomentCInvariant.vpServo + ~FeatureMomentCInvariant.getDimension + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~FeatureMomentCInvariant.__doc__ + ~FeatureMomentCInvariant.__init__ + ~FeatureMomentCInvariant.__module__ + ~FeatureMomentCInvariant.__repr__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~FeatureMomentCInvariant.FEATURE_ALL + ~FeatureMomentCInvariant.user + ~FeatureMomentCInvariant.vpServo + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.visual_features.FeatureMomentCentered.rst b/modules/python/doc/_autosummary/visp.visual_features.FeatureMomentCentered.rst new file mode 100644 index 0000000000..b8018f9b24 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.visual_features.FeatureMomentCentered.rst @@ -0,0 +1,80 @@ +FeatureMomentCentered +===================== + +.. currentmodule:: visp.visual_features + +.. autoclass:: FeatureMomentCentered + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~FeatureMomentCentered.compute_interaction + ~FeatureMomentCentered.interaction + ~FeatureMomentCentered.momentName + ~FeatureMomentCentered.name + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~FeatureMomentCentered.user + ~FeatureMomentCentered.dimension_s + ~FeatureMomentCentered.get_s + ~FeatureMomentCentered.BasicFeatureDeallocatorType + ~FeatureMomentCentered.BasicFeatureSelect + ~FeatureMomentCentered.update + ~FeatureMomentCentered.getDeallocate + ~FeatureMomentCentered.selectAll + ~FeatureMomentCentered.display + ~FeatureMomentCentered.error + ~FeatureMomentCentered.setFlags + ~FeatureMomentCentered.linkTo + ~FeatureMomentCentered.print + ~FeatureMomentCentered.FEATURE_ALL + ~FeatureMomentCentered.setDeallocate + ~FeatureMomentCentered.printDependencies + ~FeatureMomentCentered.init + ~FeatureMomentCentered.vpServo + ~FeatureMomentCentered.getDimension + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~FeatureMomentCentered.__doc__ + ~FeatureMomentCentered.__init__ + ~FeatureMomentCentered.__module__ + ~FeatureMomentCentered.__repr__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~FeatureMomentCentered.FEATURE_ALL + ~FeatureMomentCentered.user + ~FeatureMomentCentered.vpServo + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.visual_features.FeatureMomentCommon.rst b/modules/python/doc/_autosummary/visp.visual_features.FeatureMomentCommon.rst new file mode 100644 index 0000000000..b7db965cfe --- /dev/null +++ b/modules/python/doc/_autosummary/visp.visual_features.FeatureMomentCommon.rst @@ -0,0 +1,58 @@ +FeatureMomentCommon +=================== + +.. currentmodule:: visp.visual_features + +.. autoclass:: FeatureMomentCommon + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~FeatureMomentCommon.getFeatureAlpha + ~FeatureMomentCommon.getFeatureAn + ~FeatureMomentCommon.getFeatureArea + ~FeatureMomentCommon.getFeatureCInvariant + ~FeatureMomentCommon.getFeatureCentered + ~FeatureMomentCommon.getFeatureGravityCenter + ~FeatureMomentCommon.getFeatureGravityNormalized + ~FeatureMomentCommon.getFeatureMomentBasic + ~FeatureMomentCommon.updateAll + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~FeatureMomentCommon.get + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~FeatureMomentCommon.__doc__ + ~FeatureMomentCommon.__init__ + ~FeatureMomentCommon.__module__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.visual_features.FeatureMomentDatabase.rst b/modules/python/doc/_autosummary/visp.visual_features.FeatureMomentDatabase.rst new file mode 100644 index 0000000000..91c12cb194 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.visual_features.FeatureMomentDatabase.rst @@ -0,0 +1,50 @@ +FeatureMomentDatabase +===================== + +.. currentmodule:: visp.visual_features + +.. autoclass:: FeatureMomentDatabase + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~FeatureMomentDatabase.get + ~FeatureMomentDatabase.updateAll + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~FeatureMomentDatabase.__doc__ + ~FeatureMomentDatabase.__init__ + ~FeatureMomentDatabase.__module__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.visual_features.FeatureMomentGravityCenter.rst b/modules/python/doc/_autosummary/visp.visual_features.FeatureMomentGravityCenter.rst new file mode 100644 index 0000000000..25c3ce5f1e --- /dev/null +++ b/modules/python/doc/_autosummary/visp.visual_features.FeatureMomentGravityCenter.rst @@ -0,0 +1,81 @@ +FeatureMomentGravityCenter +========================== + +.. currentmodule:: visp.visual_features + +.. autoclass:: FeatureMomentGravityCenter + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~FeatureMomentGravityCenter.compute_interaction + ~FeatureMomentGravityCenter.momentName + ~FeatureMomentGravityCenter.name + ~FeatureMomentGravityCenter.selectXg + ~FeatureMomentGravityCenter.selectYg + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~FeatureMomentGravityCenter.user + ~FeatureMomentGravityCenter.dimension_s + ~FeatureMomentGravityCenter.get_s + ~FeatureMomentGravityCenter.BasicFeatureDeallocatorType + ~FeatureMomentGravityCenter.BasicFeatureSelect + ~FeatureMomentGravityCenter.update + ~FeatureMomentGravityCenter.getDeallocate + ~FeatureMomentGravityCenter.selectAll + ~FeatureMomentGravityCenter.display + ~FeatureMomentGravityCenter.error + ~FeatureMomentGravityCenter.setFlags + ~FeatureMomentGravityCenter.linkTo + ~FeatureMomentGravityCenter.interaction + ~FeatureMomentGravityCenter.print + ~FeatureMomentGravityCenter.FEATURE_ALL + ~FeatureMomentGravityCenter.setDeallocate + ~FeatureMomentGravityCenter.printDependencies + ~FeatureMomentGravityCenter.init + ~FeatureMomentGravityCenter.vpServo + ~FeatureMomentGravityCenter.getDimension + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~FeatureMomentGravityCenter.__doc__ + ~FeatureMomentGravityCenter.__init__ + ~FeatureMomentGravityCenter.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~FeatureMomentGravityCenter.FEATURE_ALL + ~FeatureMomentGravityCenter.user + ~FeatureMomentGravityCenter.vpServo + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.visual_features.FeatureMomentGravityCenterNormalized.rst b/modules/python/doc/_autosummary/visp.visual_features.FeatureMomentGravityCenterNormalized.rst new file mode 100644 index 0000000000..a9c3617bbd --- /dev/null +++ b/modules/python/doc/_autosummary/visp.visual_features.FeatureMomentGravityCenterNormalized.rst @@ -0,0 +1,81 @@ +FeatureMomentGravityCenterNormalized +==================================== + +.. currentmodule:: visp.visual_features + +.. autoclass:: FeatureMomentGravityCenterNormalized + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~FeatureMomentGravityCenterNormalized.compute_interaction + ~FeatureMomentGravityCenterNormalized.momentName + ~FeatureMomentGravityCenterNormalized.name + ~FeatureMomentGravityCenterNormalized.selectXn + ~FeatureMomentGravityCenterNormalized.selectYn + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~FeatureMomentGravityCenterNormalized.user + ~FeatureMomentGravityCenterNormalized.dimension_s + ~FeatureMomentGravityCenterNormalized.get_s + ~FeatureMomentGravityCenterNormalized.BasicFeatureDeallocatorType + ~FeatureMomentGravityCenterNormalized.BasicFeatureSelect + ~FeatureMomentGravityCenterNormalized.update + ~FeatureMomentGravityCenterNormalized.getDeallocate + ~FeatureMomentGravityCenterNormalized.selectAll + ~FeatureMomentGravityCenterNormalized.display + ~FeatureMomentGravityCenterNormalized.error + ~FeatureMomentGravityCenterNormalized.setFlags + ~FeatureMomentGravityCenterNormalized.linkTo + ~FeatureMomentGravityCenterNormalized.interaction + ~FeatureMomentGravityCenterNormalized.print + ~FeatureMomentGravityCenterNormalized.FEATURE_ALL + ~FeatureMomentGravityCenterNormalized.setDeallocate + ~FeatureMomentGravityCenterNormalized.printDependencies + ~FeatureMomentGravityCenterNormalized.init + ~FeatureMomentGravityCenterNormalized.vpServo + ~FeatureMomentGravityCenterNormalized.getDimension + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~FeatureMomentGravityCenterNormalized.__doc__ + ~FeatureMomentGravityCenterNormalized.__init__ + ~FeatureMomentGravityCenterNormalized.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~FeatureMomentGravityCenterNormalized.FEATURE_ALL + ~FeatureMomentGravityCenterNormalized.user + ~FeatureMomentGravityCenterNormalized.vpServo + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.visual_features.FeaturePoint.rst b/modules/python/doc/_autosummary/visp.visual_features.FeaturePoint.rst new file mode 100644 index 0000000000..d6f4094591 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.visual_features.FeaturePoint.rst @@ -0,0 +1,85 @@ +FeaturePoint +============ + +.. currentmodule:: visp.visual_features + +.. autoclass:: FeaturePoint + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~FeaturePoint.buildFrom + ~FeaturePoint.display + ~FeaturePoint.error + ~FeaturePoint.get_Z + ~FeaturePoint.get_x + ~FeaturePoint.get_y + ~FeaturePoint.init + ~FeaturePoint.interaction + ~FeaturePoint.print + ~FeaturePoint.selectX + ~FeaturePoint.selectY + ~FeaturePoint.set_Z + ~FeaturePoint.set_x + ~FeaturePoint.set_xyZ + ~FeaturePoint.set_y + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~FeaturePoint.user + ~FeaturePoint.dimension_s + ~FeaturePoint.get_s + ~FeaturePoint.BasicFeatureDeallocatorType + ~FeaturePoint.BasicFeatureSelect + ~FeaturePoint.getDeallocate + ~FeaturePoint.selectAll + ~FeaturePoint.setFlags + ~FeaturePoint.FEATURE_ALL + ~FeaturePoint.setDeallocate + ~FeaturePoint.vpServo + ~FeaturePoint.getDimension + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~FeaturePoint.__doc__ + ~FeaturePoint.__init__ + ~FeaturePoint.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~FeaturePoint.FEATURE_ALL + ~FeaturePoint.X + ~FeaturePoint.Y + ~FeaturePoint.user + ~FeaturePoint.vpServo + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.visual_features.FeaturePoint3D.rst b/modules/python/doc/_autosummary/visp.visual_features.FeaturePoint3D.rst new file mode 100644 index 0000000000..135fec26e8 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.visual_features.FeaturePoint3D.rst @@ -0,0 +1,84 @@ +FeaturePoint3D +============== + +.. currentmodule:: visp.visual_features + +.. autoclass:: FeaturePoint3D + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~FeaturePoint3D.buildFrom + ~FeaturePoint3D.display + ~FeaturePoint3D.error + ~FeaturePoint3D.get_X + ~FeaturePoint3D.get_Y + ~FeaturePoint3D.get_Z + ~FeaturePoint3D.init + ~FeaturePoint3D.interaction + ~FeaturePoint3D.print + ~FeaturePoint3D.selectX + ~FeaturePoint3D.selectY + ~FeaturePoint3D.selectZ + ~FeaturePoint3D.set_X + ~FeaturePoint3D.set_XYZ + ~FeaturePoint3D.set_Y + ~FeaturePoint3D.set_Z + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~FeaturePoint3D.user + ~FeaturePoint3D.dimension_s + ~FeaturePoint3D.get_s + ~FeaturePoint3D.BasicFeatureDeallocatorType + ~FeaturePoint3D.BasicFeatureSelect + ~FeaturePoint3D.getDeallocate + ~FeaturePoint3D.selectAll + ~FeaturePoint3D.setFlags + ~FeaturePoint3D.FEATURE_ALL + ~FeaturePoint3D.setDeallocate + ~FeaturePoint3D.vpServo + ~FeaturePoint3D.getDimension + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~FeaturePoint3D.__doc__ + ~FeaturePoint3D.__init__ + ~FeaturePoint3D.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~FeaturePoint3D.FEATURE_ALL + ~FeaturePoint3D.user + ~FeaturePoint3D.vpServo + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.visual_features.FeaturePointPolar.rst b/modules/python/doc/_autosummary/visp.visual_features.FeaturePointPolar.rst new file mode 100644 index 0000000000..731ab9404f --- /dev/null +++ b/modules/python/doc/_autosummary/visp.visual_features.FeaturePointPolar.rst @@ -0,0 +1,83 @@ +FeaturePointPolar +================= + +.. currentmodule:: visp.visual_features + +.. autoclass:: FeaturePointPolar + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~FeaturePointPolar.buildFrom + ~FeaturePointPolar.display + ~FeaturePointPolar.error + ~FeaturePointPolar.get_Z + ~FeaturePointPolar.get_rho + ~FeaturePointPolar.get_theta + ~FeaturePointPolar.init + ~FeaturePointPolar.interaction + ~FeaturePointPolar.print + ~FeaturePointPolar.selectRho + ~FeaturePointPolar.selectTheta + ~FeaturePointPolar.set_Z + ~FeaturePointPolar.set_rho + ~FeaturePointPolar.set_rhoThetaZ + ~FeaturePointPolar.set_theta + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~FeaturePointPolar.user + ~FeaturePointPolar.dimension_s + ~FeaturePointPolar.get_s + ~FeaturePointPolar.BasicFeatureDeallocatorType + ~FeaturePointPolar.BasicFeatureSelect + ~FeaturePointPolar.getDeallocate + ~FeaturePointPolar.selectAll + ~FeaturePointPolar.setFlags + ~FeaturePointPolar.FEATURE_ALL + ~FeaturePointPolar.setDeallocate + ~FeaturePointPolar.vpServo + ~FeaturePointPolar.getDimension + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~FeaturePointPolar.__doc__ + ~FeaturePointPolar.__init__ + ~FeaturePointPolar.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~FeaturePointPolar.FEATURE_ALL + ~FeaturePointPolar.user + ~FeaturePointPolar.vpServo + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.visual_features.FeatureSegment.rst b/modules/python/doc/_autosummary/visp.visual_features.FeatureSegment.rst new file mode 100644 index 0000000000..2075146f6a --- /dev/null +++ b/modules/python/doc/_autosummary/visp.visual_features.FeatureSegment.rst @@ -0,0 +1,92 @@ +FeatureSegment +============== + +.. currentmodule:: visp.visual_features + +.. autoclass:: FeatureSegment + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~FeatureSegment.buildFrom + ~FeatureSegment.display + ~FeatureSegment.error + ~FeatureSegment.getAlpha + ~FeatureSegment.getL + ~FeatureSegment.getXc + ~FeatureSegment.getYc + ~FeatureSegment.getZ1 + ~FeatureSegment.getZ2 + ~FeatureSegment.init + ~FeatureSegment.interaction + ~FeatureSegment.isNormalized + ~FeatureSegment.print + ~FeatureSegment.selectAlpha + ~FeatureSegment.selectL + ~FeatureSegment.selectXc + ~FeatureSegment.selectYc + ~FeatureSegment.setAlpha + ~FeatureSegment.setL + ~FeatureSegment.setNormalized + ~FeatureSegment.setXc + ~FeatureSegment.setYc + ~FeatureSegment.setZ1 + ~FeatureSegment.setZ2 + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~FeatureSegment.user + ~FeatureSegment.dimension_s + ~FeatureSegment.get_s + ~FeatureSegment.BasicFeatureDeallocatorType + ~FeatureSegment.BasicFeatureSelect + ~FeatureSegment.getDeallocate + ~FeatureSegment.selectAll + ~FeatureSegment.setFlags + ~FeatureSegment.FEATURE_ALL + ~FeatureSegment.setDeallocate + ~FeatureSegment.vpServo + ~FeatureSegment.getDimension + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~FeatureSegment.__doc__ + ~FeatureSegment.__init__ + ~FeatureSegment.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~FeatureSegment.FEATURE_ALL + ~FeatureSegment.user + ~FeatureSegment.vpServo + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.visual_features.FeatureThetaU.rst b/modules/python/doc/_autosummary/visp.visual_features.FeatureThetaU.rst new file mode 100644 index 0000000000..2ac408e901 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.visual_features.FeatureThetaU.rst @@ -0,0 +1,90 @@ +FeatureThetaU +============= + +.. currentmodule:: visp.visual_features + +.. autoclass:: FeatureThetaU + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~FeatureThetaU.buildFrom + ~FeatureThetaU.display + ~FeatureThetaU.error + ~FeatureThetaU.getFeatureThetaURotationType + ~FeatureThetaU.get_TUx + ~FeatureThetaU.get_TUy + ~FeatureThetaU.get_TUz + ~FeatureThetaU.init + ~FeatureThetaU.interaction + ~FeatureThetaU.print + ~FeatureThetaU.selectTUx + ~FeatureThetaU.selectTUy + ~FeatureThetaU.selectTUz + ~FeatureThetaU.setFeatureThetaURotationType + ~FeatureThetaU.set_TUx + ~FeatureThetaU.set_TUy + ~FeatureThetaU.set_TUz + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~FeatureThetaU.user + ~FeatureThetaU.dimension_s + ~FeatureThetaU.get_s + ~FeatureThetaU.BasicFeatureDeallocatorType + ~FeatureThetaU.BasicFeatureSelect + ~FeatureThetaU.getDeallocate + ~FeatureThetaU.selectAll + ~FeatureThetaU.setFlags + ~FeatureThetaU.FEATURE_ALL + ~FeatureThetaU.setDeallocate + ~FeatureThetaU.vpServo + ~FeatureThetaU.getDimension + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~FeatureThetaU.__doc__ + ~FeatureThetaU.__init__ + ~FeatureThetaU.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~FeatureThetaU.FEATURE_ALL + ~FeatureThetaU.TUx + ~FeatureThetaU.TUy + ~FeatureThetaU.TUz + ~FeatureThetaU.cRcd + ~FeatureThetaU.cdRc + ~FeatureThetaU.user + ~FeatureThetaU.vpServo + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.visual_features.FeatureTranslation.rst b/modules/python/doc/_autosummary/visp.visual_features.FeatureTranslation.rst new file mode 100644 index 0000000000..cc16751660 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.visual_features.FeatureTranslation.rst @@ -0,0 +1,88 @@ +FeatureTranslation +================== + +.. currentmodule:: visp.visual_features + +.. autoclass:: FeatureTranslation + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~FeatureTranslation.buildFrom + ~FeatureTranslation.display + ~FeatureTranslation.error + ~FeatureTranslation.getFeatureTranslationType + ~FeatureTranslation.get_Tx + ~FeatureTranslation.get_Ty + ~FeatureTranslation.get_Tz + ~FeatureTranslation.init + ~FeatureTranslation.interaction + ~FeatureTranslation.print + ~FeatureTranslation.selectTx + ~FeatureTranslation.selectTy + ~FeatureTranslation.selectTz + ~FeatureTranslation.setFeatureTranslationType + ~FeatureTranslation.set_Tx + ~FeatureTranslation.set_Ty + ~FeatureTranslation.set_Tz + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~FeatureTranslation.user + ~FeatureTranslation.dimension_s + ~FeatureTranslation.get_s + ~FeatureTranslation.BasicFeatureDeallocatorType + ~FeatureTranslation.BasicFeatureSelect + ~FeatureTranslation.getDeallocate + ~FeatureTranslation.selectAll + ~FeatureTranslation.setFlags + ~FeatureTranslation.FEATURE_ALL + ~FeatureTranslation.setDeallocate + ~FeatureTranslation.vpServo + ~FeatureTranslation.getDimension + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~FeatureTranslation.__doc__ + ~FeatureTranslation.__init__ + ~FeatureTranslation.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~FeatureTranslation.FEATURE_ALL + ~FeatureTranslation.cMcd + ~FeatureTranslation.cMo + ~FeatureTranslation.cdMc + ~FeatureTranslation.user + ~FeatureTranslation.vpServo + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.visual_features.FeatureVanishingPoint.rst b/modules/python/doc/_autosummary/visp.visual_features.FeatureVanishingPoint.rst new file mode 100644 index 0000000000..14bae1c9e1 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.visual_features.FeatureVanishingPoint.rst @@ -0,0 +1,90 @@ +FeatureVanishingPoint +===================== + +.. currentmodule:: visp.visual_features + +.. autoclass:: FeatureVanishingPoint + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~FeatureVanishingPoint.buildFrom + ~FeatureVanishingPoint.display + ~FeatureVanishingPoint.error + ~FeatureVanishingPoint.getAlpha + ~FeatureVanishingPoint.getAtanOneOverRho + ~FeatureVanishingPoint.getOneOverRho + ~FeatureVanishingPoint.get_x + ~FeatureVanishingPoint.get_y + ~FeatureVanishingPoint.init + ~FeatureVanishingPoint.interaction + ~FeatureVanishingPoint.print + ~FeatureVanishingPoint.selectAlpha + ~FeatureVanishingPoint.selectAtanOneOverRho + ~FeatureVanishingPoint.selectOneOverRho + ~FeatureVanishingPoint.selectX + ~FeatureVanishingPoint.selectY + ~FeatureVanishingPoint.setAlpha + ~FeatureVanishingPoint.setAtanOneOverRho + ~FeatureVanishingPoint.setOneOverRho + ~FeatureVanishingPoint.set_x + ~FeatureVanishingPoint.set_xy + ~FeatureVanishingPoint.set_y + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~FeatureVanishingPoint.user + ~FeatureVanishingPoint.dimension_s + ~FeatureVanishingPoint.get_s + ~FeatureVanishingPoint.BasicFeatureDeallocatorType + ~FeatureVanishingPoint.BasicFeatureSelect + ~FeatureVanishingPoint.getDeallocate + ~FeatureVanishingPoint.selectAll + ~FeatureVanishingPoint.setFlags + ~FeatureVanishingPoint.FEATURE_ALL + ~FeatureVanishingPoint.setDeallocate + ~FeatureVanishingPoint.vpServo + ~FeatureVanishingPoint.getDimension + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~FeatureVanishingPoint.__doc__ + ~FeatureVanishingPoint.__init__ + ~FeatureVanishingPoint.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~FeatureVanishingPoint.FEATURE_ALL + ~FeatureVanishingPoint.user + ~FeatureVanishingPoint.vpServo + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.visual_features.GenericFeature.rst b/modules/python/doc/_autosummary/visp.visual_features.GenericFeature.rst new file mode 100644 index 0000000000..48d554df49 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.visual_features.GenericFeature.rst @@ -0,0 +1,77 @@ +GenericFeature +============== + +.. currentmodule:: visp.visual_features + +.. autoclass:: GenericFeature + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~GenericFeature.display + ~GenericFeature.error + ~GenericFeature.getInteractionMatrix + ~GenericFeature.get_s + ~GenericFeature.init + ~GenericFeature.interaction + ~GenericFeature.print + ~GenericFeature.setError + ~GenericFeature.setInteractionMatrix + ~GenericFeature.set_s + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~GenericFeature.user + ~GenericFeature.dimension_s + ~GenericFeature.BasicFeatureDeallocatorType + ~GenericFeature.BasicFeatureSelect + ~GenericFeature.getDeallocate + ~GenericFeature.selectAll + ~GenericFeature.setFlags + ~GenericFeature.FEATURE_ALL + ~GenericFeature.setDeallocate + ~GenericFeature.vpServo + ~GenericFeature.getDimension + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~GenericFeature.__doc__ + ~GenericFeature.__init__ + ~GenericFeature.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~GenericFeature.FEATURE_ALL + ~GenericFeature.user + ~GenericFeature.vpServo + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.visual_features.MomentGenericFeature.rst b/modules/python/doc/_autosummary/visp.visual_features.MomentGenericFeature.rst new file mode 100644 index 0000000000..3980ba7386 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.visual_features.MomentGenericFeature.rst @@ -0,0 +1,79 @@ +MomentGenericFeature +==================== + +.. currentmodule:: visp.visual_features + +.. autoclass:: MomentGenericFeature + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~MomentGenericFeature.momentName + ~MomentGenericFeature.name + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + ~MomentGenericFeature.user + ~MomentGenericFeature.dimension_s + ~MomentGenericFeature.get_s + ~MomentGenericFeature.compute_interaction + ~MomentGenericFeature.BasicFeatureDeallocatorType + ~MomentGenericFeature.BasicFeatureSelect + ~MomentGenericFeature.update + ~MomentGenericFeature.getDeallocate + ~MomentGenericFeature.selectAll + ~MomentGenericFeature.display + ~MomentGenericFeature.error + ~MomentGenericFeature.setFlags + ~MomentGenericFeature.linkTo + ~MomentGenericFeature.interaction + ~MomentGenericFeature.print + ~MomentGenericFeature.FEATURE_ALL + ~MomentGenericFeature.setDeallocate + ~MomentGenericFeature.printDependencies + ~MomentGenericFeature.init + ~MomentGenericFeature.vpServo + ~MomentGenericFeature.getDimension + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~MomentGenericFeature.__doc__ + ~MomentGenericFeature.__init__ + ~MomentGenericFeature.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~MomentGenericFeature.FEATURE_ALL + ~MomentGenericFeature.user + ~MomentGenericFeature.vpServo + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.visual_features.rst b/modules/python/doc/_autosummary/visp.visual_features.rst new file mode 100644 index 0000000000..7b69141ffd --- /dev/null +++ b/modules/python/doc/_autosummary/visp.visual_features.rst @@ -0,0 +1,57 @@ +visual\_features +================ + +.. automodule:: visp.visual_features + + + + + + + + + + + + .. rubric:: Classes + + .. autosummary:: + :toctree: + :template: custom-class-template.rst + :nosignatures: + + BasicFeature + FeatureBuilder + FeatureDepth + FeatureEllipse + FeatureLine + FeatureLuminance + FeatureMoment + FeatureMomentAlpha + FeatureMomentArea + FeatureMomentAreaNormalized + FeatureMomentBasic + FeatureMomentCInvariant + FeatureMomentCentered + FeatureMomentCommon + FeatureMomentDatabase + FeatureMomentGravityCenter + FeatureMomentGravityCenterNormalized + FeaturePoint + FeaturePoint3D + FeaturePointPolar + FeatureSegment + FeatureThetaU + FeatureTranslation + FeatureVanishingPoint + GenericFeature + MomentGenericFeature + + + + + + + + + diff --git a/modules/python/doc/_autosummary/visp.vs.AdaptiveGain.rst b/modules/python/doc/_autosummary/visp.vs.AdaptiveGain.rst new file mode 100644 index 0000000000..bd0c409920 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.vs.AdaptiveGain.rst @@ -0,0 +1,66 @@ +AdaptiveGain +============ + +.. currentmodule:: visp.vs + +.. autoclass:: AdaptiveGain + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~AdaptiveGain.getLastValue + ~AdaptiveGain.initFromConstant + ~AdaptiveGain.initFromVoid + ~AdaptiveGain.initStandard + ~AdaptiveGain.limitValue + ~AdaptiveGain.limitValue_const + ~AdaptiveGain.setConstant + ~AdaptiveGain.value + ~AdaptiveGain.value_const + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~AdaptiveGain.__doc__ + ~AdaptiveGain.__init__ + ~AdaptiveGain.__module__ + ~AdaptiveGain.__repr__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~AdaptiveGain.DEFAULT_LAMBDA_INFINITY + ~AdaptiveGain.DEFAULT_LAMBDA_SLOPE + ~AdaptiveGain.DEFAULT_LAMBDA_ZERO + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.vs.Servo.rst b/modules/python/doc/_autosummary/visp.vs.Servo.rst new file mode 100644 index 0000000000..4eb71a0268 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.vs.Servo.rst @@ -0,0 +1,131 @@ +Servo +===== + +.. currentmodule:: visp.vs + +.. autoclass:: Servo + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~Servo.addFeature + ~Servo.computeControlLaw + ~Servo.computeError + ~Servo.computeInteractionMatrix + ~Servo.getDimension + ~Servo.getError + ~Servo.getI_WpW + ~Servo.getInteractionMatrix + ~Servo.getLargeP + ~Servo.getPseudoInverseThreshold + ~Servo.getServoType + ~Servo.getTaskJacobian + ~Servo.getTaskJacobianPseudoInverse + ~Servo.getTaskRank + ~Servo.getTaskSingularValues + ~Servo.getWpW + ~Servo.get_cVe + ~Servo.get_cVf + ~Servo.get_eJe + ~Servo.get_fJe + ~Servo.get_fVe + ~Servo.kill + ~Servo.print + ~Servo.secondaryTask + ~Servo.secondaryTaskJointLimitAvoidance + ~Servo.setCameraDoF + ~Servo.setForceInteractionMatrixComputation + ~Servo.setInteractionMatrixType + ~Servo.setLambda + ~Servo.setMu + ~Servo.setPseudoInverseThreshold + ~Servo.setServo + ~Servo.set_cVe + ~Servo.set_cVf + ~Servo.set_eJe + ~Servo.set_fJe + ~Servo.set_fVe + ~Servo.testInitialization + ~Servo.testUpdated + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~Servo.__doc__ + ~Servo.__init__ + ~Servo.__module__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~Servo.ALL + ~Servo.CONTROLLER + ~Servo.CURRENT + ~Servo.DESIRED + ~Servo.ERROR_VECTOR + ~Servo.EYEINHAND_CAMERA + ~Servo.EYEINHAND_L_cVe_eJe + ~Servo.EYETOHAND_L_cVe_eJe + ~Servo.EYETOHAND_L_cVf_fJe + ~Servo.EYETOHAND_L_cVf_fVe_eJe + ~Servo.FEATURE_CURRENT + ~Servo.FEATURE_DESIRED + ~Servo.GAIN + ~Servo.INTERACTION_MATRIX + ~Servo.J1 + ~Servo.J1p + ~Servo.L + ~Servo.MEAN + ~Servo.MINIMUM + ~Servo.NONE + ~Servo.PSEUDO_INVERSE + ~Servo.TRANSPOSE + ~Servo.USER_DEFINED + ~Servo.desiredFeatureList + ~Servo.e + ~Servo.e1 + ~Servo.error + ~Servo.featureList + ~Servo.featureSelectionList + ~Servo.interactionMatrixType + ~Servo.inversionType + ~Servo.lambda + ~Servo.q_dot + ~Servo.rankJ1 + ~Servo.s + ~Servo.sStar + ~Servo.servoType + ~Servo.signInteractionMatrix + ~Servo.v + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.vs.ServoData.rst b/modules/python/doc/_autosummary/visp.vs.ServoData.rst new file mode 100644 index 0000000000..6a0e6164d8 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.vs.ServoData.rst @@ -0,0 +1,53 @@ +ServoData +========= + +.. currentmodule:: visp.vs + +.. autoclass:: ServoData + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~ServoData.close + ~ServoData.open + ~ServoData.save + ~ServoData.setCmDeg + ~ServoData.setMeterRad + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~ServoData.__doc__ + ~ServoData.__init__ + ~ServoData.__module__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.vs.ServoDisplay.rst b/modules/python/doc/_autosummary/visp.vs.ServoDisplay.rst new file mode 100644 index 0000000000..e1caf760eb --- /dev/null +++ b/modules/python/doc/_autosummary/visp.vs.ServoDisplay.rst @@ -0,0 +1,49 @@ +ServoDisplay +============ + +.. currentmodule:: visp.vs + +.. autoclass:: ServoDisplay + :members: + :show-inheritance: + :member-order: groupwise + :inherited-members: pybind11_builtins.pybind11_object + :special-members: + + + + .. rubric:: Methods + + .. autosummary:: + :nosignatures: + + ~ServoDisplay.display + + + + + + .. rubric:: Inherited Methods + + .. autosummary:: + :nosignatures: + + + + + + + .. rubric:: Operators + + .. autosummary:: + :nosignatures: + + ~ServoDisplay.__doc__ + ~ServoDisplay.__init__ + ~ServoDisplay.__module__ + + + + + + \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.vs.rst b/modules/python/doc/_autosummary/visp.vs.rst new file mode 100644 index 0000000000..2e29641cf9 --- /dev/null +++ b/modules/python/doc/_autosummary/visp.vs.rst @@ -0,0 +1,35 @@ +vs +== + +.. automodule:: visp.vs + + + + + + + + + + + + .. rubric:: Classes + + .. autosummary:: + :toctree: + :template: custom-class-template.rst + :nosignatures: + + AdaptiveGain + Servo + ServoData + ServoDisplay + + + + + + + + + diff --git a/modules/python/docs/_templates/custom-class-template.rst b/modules/python/doc/_templates/custom-class-template.rst similarity index 100% rename from modules/python/docs/_templates/custom-class-template.rst rename to modules/python/doc/_templates/custom-class-template.rst diff --git a/modules/python/docs/_templates/custom-module-template.rst b/modules/python/doc/_templates/custom-module-template.rst similarity index 100% rename from modules/python/docs/_templates/custom-module-template.rst rename to modules/python/doc/_templates/custom-module-template.rst diff --git a/modules/python/doc/api.rst b/modules/python/doc/api.rst new file mode 100644 index 0000000000..b6fa3e7b4d --- /dev/null +++ b/modules/python/doc/api.rst @@ -0,0 +1,28 @@ +API reference +============== + + +.. autosummary:: + :toctree: _autosummary + :recursive: + :template: custom-module-template.rst + + visp.core + visp.dnn_tracker + visp.gui + visp.imgproc + visp.io + visp.klt + visp.me + visp.sensor + visp.ar + visp.blob + visp.robot + visp.visual_features + visp.vs + visp.vision + visp.detection + visp.mbt + visp.tt + visp.tt_mi + diff --git a/modules/python/docs/api.rst.in b/modules/python/doc/api.rst.in similarity index 100% rename from modules/python/docs/api.rst.in rename to modules/python/doc/api.rst.in diff --git a/modules/python/docs/conf.py.in b/modules/python/doc/conf.py.in similarity index 100% rename from modules/python/docs/conf.py.in rename to modules/python/doc/conf.py.in diff --git a/modules/python/docs/index.rst b/modules/python/doc/index.rst similarity index 100% rename from modules/python/docs/index.rst rename to modules/python/doc/index.rst diff --git a/modules/python/docs/requirements.txt b/modules/python/doc/requirements.txt similarity index 100% rename from modules/python/docs/requirements.txt rename to modules/python/doc/requirements.txt diff --git a/modules/python/docs/todos.rst b/modules/python/doc/todos.rst similarity index 100% rename from modules/python/docs/todos.rst rename to modules/python/doc/todos.rst From 42eb27456798818922f71bafd4254795fa2b1fe5 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Fri, 1 Dec 2023 16:02:47 +0100 Subject: [PATCH 147/169] cleanup things that should not be in source control --- modules/python/doc/_autosummary/visp.ar.rst | 23 --- .../python/doc/_autosummary/visp.blob.Dot.rst | 94 ---------- .../doc/_autosummary/visp.blob.Dot2.rst | 103 ----------- modules/python/doc/_autosummary/visp.blob.rst | 33 ---- .../_autosummary/visp.core.ArrayDouble2D.rst | 68 ------- .../doc/_autosummary/visp.core.BSpline.rst | 69 ------- .../visp.core.CameraParameters.rst | 84 --------- .../visp.core.CannyEdgeDetection.rst | 56 ------ .../doc/_autosummary/visp.core.Chrono.rst | 53 ------ .../doc/_autosummary/visp.core.Circle.rst | 91 --------- .../doc/_autosummary/visp.core.Client.rst | 76 -------- .../doc/_autosummary/visp.core.ColVector.rst | 104 ----------- .../doc/_autosummary/visp.core.Color.rst | 106 ----------- .../visp.core.ColorDepthConversion.rst | 49 ----- .../doc/_autosummary/visp.core.Colormap.rst | 76 -------- .../doc/_autosummary/visp.core.Convert.rst | 50 ----- .../doc/_autosummary/visp.core.Cylinder.rst | 93 ---------- .../doc/_autosummary/visp.core.Display.rst | 101 ---------- .../_autosummary/visp.core.ExponentialMap.rst | 50 ----- .../_autosummary/visp.core.FeatureDisplay.rst | 52 ------ .../doc/_autosummary/visp.core.Font.rst | 59 ------ .../visp.core.ForceTwistMatrix.rst | 67 ------- .../visp.core.ForwardProjection.rst | 70 ------- .../_autosummary/visp.core.FrameGrabber.rst | 56 ------ .../doc/_autosummary/visp.core.GaussRand.rst | 50 ----- .../_autosummary/visp.core.GaussianFilter.rst | 49 ----- .../doc/_autosummary/visp.core.Hinkley.rst | 68 ------- .../doc/_autosummary/visp.core.Histogram.rst | 59 ------ .../_autosummary/visp.core.HistogramPeak.rst | 56 ------ .../_autosummary/visp.core.HistogramValey.rst | 56 ------ .../visp.core.HomogeneousMatrix.rst | 88 --------- .../_autosummary/visp.core.ImageCircle.rst | 56 ------ .../_autosummary/visp.core.ImageConvert.rst | 80 -------- .../_autosummary/visp.core.ImageDouble.rst | 76 -------- .../doc/_autosummary/visp.core.ImageDraw.rst | 58 ------ .../_autosummary/visp.core.ImageFilter.rst | 75 -------- .../doc/_autosummary/visp.core.ImageFloat.rst | 76 -------- .../doc/_autosummary/visp.core.ImageGray.rst | 76 -------- .../visp.core.ImageMorphology.rst | 55 ------ .../doc/_autosummary/visp.core.ImagePoint.rst | 69 ------- .../doc/_autosummary/visp.core.ImageRGBA.rst | 75 -------- .../doc/_autosummary/visp.core.ImageRGBa.rst | 76 -------- .../doc/_autosummary/visp.core.ImageRGBf.rst | 76 -------- .../doc/_autosummary/visp.core.ImageTools.rst | 72 ------- .../_autosummary/visp.core.ImageUInt16.rst | 76 -------- .../doc/_autosummary/visp.core.IoTools.rst | 91 --------- .../_autosummary/visp.core.KalmanFilter.rst | 71 ------- .../doc/_autosummary/visp.core.LinProg.rst | 56 ------ .../doc/_autosummary/visp.core.Line.rst | 82 -------- ...p.core.LinearKalmanFilterInstantiation.rst | 91 --------- .../doc/_autosummary/visp.core.Math.rst | 77 -------- .../doc/_autosummary/visp.core.Matrix.rst | 157 ---------------- .../visp.core.MeterPixelConversion.rst | 52 ------ .../doc/_autosummary/visp.core.Moment.rst | 54 ------ .../_autosummary/visp.core.MomentAlpha.rst | 58 ------ .../doc/_autosummary/visp.core.MomentArea.rst | 56 ------ .../visp.core.MomentAreaNormalized.rst | 60 ------ .../_autosummary/visp.core.MomentBasic.rst | 56 ------ .../visp.core.MomentCInvariant.rst | 82 -------- .../_autosummary/visp.core.MomentCentered.rst | 57 ------ .../_autosummary/visp.core.MomentCommon.rst | 54 ------ .../_autosummary/visp.core.MomentDatabase.rst | 52 ------ .../visp.core.MomentGravityCenter.rst | 58 ------ ...isp.core.MomentGravityCenterNormalized.rst | 58 ------ .../_autosummary/visp.core.MomentObject.rst | 69 ------- .../_autosummary/visp.core.MouseButton.rst | 57 ------ .../doc/_autosummary/visp.core.Munkres.rst | 48 ----- .../doc/_autosummary/visp.core.Mutex.rst | 50 ----- .../doc/_autosummary/visp.core.Network.rst | 69 ------- .../visp.core.PixelMeterConversion.rst | 53 ------ .../doc/_autosummary/visp.core.Plane.rst | 74 -------- .../doc/_autosummary/visp.core.Point.rst | 102 ---------- .../doc/_autosummary/visp.core.Polygon.rst | 65 ------- .../doc/_autosummary/visp.core.Polygon3D.rst | 89 --------- .../doc/_autosummary/visp.core.PoseVector.rst | 78 -------- .../doc/_autosummary/visp.core.QuadProg.rst | 55 ------ .../visp.core.QuaternionVector.rst | 84 --------- .../doc/_autosummary/visp.core.RGBa.rst | 67 ------- .../doc/_autosummary/visp.core.RGBf.rst | 65 ------- .../doc/_autosummary/visp.core.Rect.rst | 78 -------- .../_autosummary/visp.core.RectOriented.rst | 61 ------ .../doc/_autosummary/visp.core.Request.rst | 53 ------ .../doc/_autosummary/visp.core.Robust.rst | 60 ------ .../_autosummary/visp.core.RotationMatrix.rst | 75 -------- .../_autosummary/visp.core.RotationVector.rst | 66 ------- .../doc/_autosummary/visp.core.RowVector.rst | 97 ---------- .../doc/_autosummary/visp.core.RxyzVector.rst | 66 ------- .../doc/_autosummary/visp.core.RzyxVector.rst | 66 ------- .../doc/_autosummary/visp.core.RzyzVector.rst | 66 ------- .../doc/_autosummary/visp.core.Scale.rst | 53 ------ .../doc/_autosummary/visp.core.Serial.rst | 82 -------- .../doc/_autosummary/visp.core.Server.rst | 75 -------- .../doc/_autosummary/visp.core.Sphere.rst | 87 --------- .../_autosummary/visp.core.SubColVector.rst | 92 --------- .../doc/_autosummary/visp.core.SubMatrix.rst | 150 --------------- .../_autosummary/visp.core.SubRowVector.rst | 85 --------- .../_autosummary/visp.core.ThetaUVector.rst | 70 ------- .../doc/_autosummary/visp.core.Thread.rst | 52 ------ .../doc/_autosummary/visp.core.Tracker.rst | 58 ------ .../visp.core.TranslationVector.rst | 79 -------- .../doc/_autosummary/visp.core.Triangle.rst | 52 ------ .../doc/_autosummary/visp.core.UDPClient.rst | 51 ----- .../doc/_autosummary/visp.core.UDPServer.rst | 50 ----- .../doc/_autosummary/visp.core.UniRand.rst | 51 ----- .../visp.core.VelocityTwistMatrix.rst | 69 ------- .../doc/_autosummary/visp.core.XmlParser.rst | 53 ------ .../visp.core.XmlParserCamera.rst | 68 ------- .../visp.core.XmlParserHomogeneousMatrix.rst | 60 ------ .../visp.core.XmlParserRectOriented.rst | 59 ------ modules/python/doc/_autosummary/visp.core.rst | 167 ----------------- .../visp.detection.DetectorAprilTag.rst | 92 --------- .../visp.detection.DetectorBase.rst | 54 ------ .../visp.detection.DetectorDNNOpenCV.rst | 83 --------- .../visp.detection.DetectorFace.rst | 56 ------ .../visp.detection.DetectorQRCode.rst | 55 ------ .../doc/_autosummary/visp.detection.rst | 36 ---- .../visp.dnn_tracker.MegaPose.rst | 72 ------- .../visp.dnn_tracker.MegaPoseEstimate.rst | 56 ------ .../visp.dnn_tracker.MegaPoseTracker.rst | 51 ----- .../doc/_autosummary/visp.dnn_tracker.rst | 34 ---- .../visp.gui.ColorBlindFriendlyPalette.rst | 70 ------- .../_autosummary/visp.gui.DisplayOpenCV.rst | 118 ------------ .../doc/_autosummary/visp.gui.DisplayX.rst | 119 ------------ .../python/doc/_autosummary/visp.gui.Plot.rst | 72 ------- .../visp.gui.ProjectionDisplay.rst | 55 ------ modules/python/doc/_autosummary/visp.gui.rst | 36 ---- .../visp.imgproc.AutoThresholdMethod.rst | 82 -------- .../visp.imgproc.CircleHoughTransform.rst | 81 -------- .../visp.imgproc.ContourRetrievalType.rst | 79 -------- .../_autosummary/visp.imgproc.ContourType.rst | 78 -------- .../visp.imgproc.DirectionType.rst | 85 --------- .../visp.imgproc.RETINEX_LEVEL.rst | 79 -------- .../python/doc/_autosummary/visp.imgproc.rst | 58 ------ .../doc/_autosummary/visp.io.DiskGrabber.rst | 69 ------- .../doc/_autosummary/visp.io.ImageIo.rst | 74 -------- .../doc/_autosummary/visp.io.Keyboard.rst | 50 ----- .../doc/_autosummary/visp.io.ParallelPort.rst | 50 ----- .../doc/_autosummary/visp.io.VideoReader.rst | 74 -------- .../doc/_autosummary/visp.io.VideoWriter.rst | 59 ------ modules/python/doc/_autosummary/visp.io.rst | 37 ---- .../doc/_autosummary/visp.klt.KltOpencv.rst | 78 -------- modules/python/doc/_autosummary/visp.klt.rst | 32 ---- .../visp.mbt.MbDepthDenseTracker.rst | 127 ------------- .../visp.mbt.MbDepthNormalTracker.rst | 129 ------------- .../visp.mbt.MbEdgeKltTracker.rst | 151 --------------- .../_autosummary/visp.mbt.MbEdgeTracker.rst | 130 ------------- .../visp.mbt.MbGenericTracker.rst | 175 ------------------ .../_autosummary/visp.mbt.MbKltTracker.rst | 140 -------------- .../doc/_autosummary/visp.mbt.MbTracker.rst | 108 ----------- .../visp.mbt.MbtDistanceCircle.rst | 81 -------- .../visp.mbt.MbtDistanceCylinder.rst | 85 --------- .../visp.mbt.MbtDistanceKltCylinder.rst | 75 -------- .../visp.mbt.MbtDistanceKltPoints.rst | 72 ------- .../_autosummary/visp.mbt.MbtDistanceLine.rst | 88 --------- .../visp.mbt.MbtFaceDepthDense.rst | 79 -------- .../visp.mbt.MbtFaceDepthNormal.rst | 81 -------- .../doc/_autosummary/visp.mbt.MbtPolygon.rst | 124 ------------- .../visp.mbt.MbtXmlGenericParser.rst | 114 ------------ modules/python/doc/_autosummary/visp.mbt.rst | 47 ----- .../python/doc/_autosummary/visp.me.Me.rst | 86 --------- .../doc/_autosummary/visp.me.MeEllipse.rst | 90 --------- .../doc/_autosummary/visp.me.MeLine.rst | 94 ---------- .../doc/_autosummary/visp.me.MeNurbs.rst | 89 --------- .../doc/_autosummary/visp.me.MeSite.rst | 90 --------- .../doc/_autosummary/visp.me.MeTracker.rst | 76 -------- .../python/doc/_autosummary/visp.me.Nurbs.rst | 84 --------- modules/python/doc/_autosummary/visp.me.rst | 38 ---- .../doc/_autosummary/visp.robot.Afma4.rst | 67 ------- .../doc/_autosummary/visp.robot.Afma6.rst | 86 --------- .../doc/_autosummary/visp.robot.Biclops.rst | 72 ------- .../visp.robot.ImageSimulator.rst | 66 ------- .../doc/_autosummary/visp.robot.Pioneer.rst | 53 ------ .../_autosummary/visp.robot.PioneerPan.rst | 53 ------ .../doc/_autosummary/visp.robot.Pololu.rst | 67 ------- .../doc/_autosummary/visp.robot.Ptu46.rst | 63 ------- .../doc/_autosummary/visp.robot.QbDevice.rst | 51 ----- .../_autosummary/visp.robot.QbSoftHand.rst | 54 ------ .../visp.robot.ReflexTakktile2.rst | 67 ------- .../doc/_autosummary/visp.robot.RingLight.rst | 51 ----- .../doc/_autosummary/visp.robot.Robot.rst | 75 -------- .../visp.robot.RobotPololuPtu.rst | 97 ---------- .../visp.robot.RobotSimulator.rst | 91 --------- .../_autosummary/visp.robot.RobotTemplate.rst | 96 ---------- .../visp.robot.RobotWireFrameSimulator.rst | 110 ----------- .../doc/_autosummary/visp.robot.Servolens.rst | 74 -------- .../visp.robot.SimulatorAfma6.rst | 175 ------------------ .../visp.robot.SimulatorCamera.rst | 95 ---------- .../visp.robot.SimulatorPioneer.rst | 97 ---------- .../visp.robot.SimulatorPioneerPan.rst | 97 ---------- .../visp.robot.SimulatorViper850.rst | 175 ------------------ .../doc/_autosummary/visp.robot.Unicycle.rst | 53 ------ .../doc/_autosummary/visp.robot.Viper.rst | 73 -------- .../doc/_autosummary/visp.robot.Viper650.rst | 88 --------- .../doc/_autosummary/visp.robot.Viper850.rst | 88 --------- .../visp.robot.WireFrameSimulator.rst | 103 ----------- .../python/doc/_autosummary/visp.robot.rst | 59 ------ .../visp.sensor.ForceTorqueAtiNetFTSensor.rst | 64 ------- .../_autosummary/visp.sensor.LaserScan.rst | 60 ------ .../_autosummary/visp.sensor.LaserScanner.rst | 50 ----- .../doc/_autosummary/visp.sensor.Mocap.rst | 50 ----- .../_autosummary/visp.sensor.RealSense2.rst | 62 ------- .../_autosummary/visp.sensor.ScanPoint.rst | 56 ------ .../_autosummary/visp.sensor.SickLDMRS.rst | 58 ------ .../_autosummary/visp.sensor.V4l2Grabber.rst | 90 --------- .../python/doc/_autosummary/visp.sensor.rst | 40 ---- .../_autosummary/visp.tt.TemplateTracker.rst | 78 -------- .../visp.tt.TemplateTrackerDPoint.rst | 55 ------ .../visp.tt.TemplateTrackerPoint.rst | 58 ------ .../visp.tt.TemplateTrackerPointCompo.rst | 48 ----- .../visp.tt.TemplateTrackerSSD.rst | 79 -------- .../visp.tt.TemplateTrackerSSDESM.rst | 79 -------- ...tt.TemplateTrackerSSDForwardAdditional.rst | 89 --------- ...TemplateTrackerSSDForwardCompositional.rst | 79 -------- ...TemplateTrackerSSDInverseCompositional.rst | 80 -------- .../visp.tt.TemplateTrackerTriangle.rst | 59 ------ .../visp.tt.TemplateTrackerWarp.rst | 53 ------ .../visp.tt.TemplateTrackerWarpAffine.rst | 61 ------ .../visp.tt.TemplateTrackerWarpHomography.rst | 64 ------- ...sp.tt.TemplateTrackerWarpHomographySL3.rst | 63 ------- .../visp.tt.TemplateTrackerWarpRT.rst | 61 ------ .../visp.tt.TemplateTrackerWarpSRT.rst | 61 ------ ...visp.tt.TemplateTrackerWarpTranslation.rst | 61 ------ .../visp.tt.TemplateTrackerZNCC.rst | 78 -------- ...t.TemplateTrackerZNCCForwardAdditional.rst | 78 -------- ...emplateTrackerZNCCInverseCompositional.rst | 78 -------- .../visp.tt.TemplateTrackerZPoint.rst | 55 ------ .../visp.tt.TemplateTrackerZone.rst | 66 ------- modules/python/doc/_autosummary/visp.tt.rst | 53 ------ .../visp.tt_mi.TemplateTrackerMI.rst | 103 ----------- .../visp.tt_mi.TemplateTrackerMIESM.rst | 122 ------------ ..._mi.TemplateTrackerMIForwardAdditional.rst | 122 ------------ ....TemplateTrackerMIForwardCompositional.rst | 117 ------------ ....TemplateTrackerMIInverseCompositional.rst | 124 ------------- .../python/doc/_autosummary/visp.tt_mi.rst | 36 ---- .../visp.vision.BasicKeyPoint.rst | 57 ------ .../_autosummary/visp.vision.Calibration.rst | 84 --------- .../visp.vision.HandEyeCalibration.rst | 49 ----- .../_autosummary/visp.vision.Homography.rst | 81 -------- .../doc/_autosummary/visp.vision.KeyPoint.rst | 161 ---------------- .../visp.vision.PlaneEstimation.rst | 49 ----- .../doc/_autosummary/visp.vision.Pose.rst | 105 ----------- .../visp.vision.XmlConfigParserKeyPoint.rst | 72 ------- .../python/doc/_autosummary/visp.vision.rst | 46 ----- .../visp.visual_features.BasicFeature.rst | 64 ------- .../visp.visual_features.FeatureBuilder.rst | 49 ----- .../visp.visual_features.FeatureDepth.rst | 83 --------- .../visp.visual_features.FeatureEllipse.rst | 89 --------- .../visp.visual_features.FeatureLine.rst | 80 -------- .../visp.visual_features.FeatureLuminance.rst | 78 -------- .../visp.visual_features.FeatureMoment.rst | 78 -------- ...isp.visual_features.FeatureMomentAlpha.rst | 79 -------- ...visp.visual_features.FeatureMomentArea.rst | 79 -------- ...l_features.FeatureMomentAreaNormalized.rst | 79 -------- ...isp.visual_features.FeatureMomentBasic.rst | 79 -------- ...isual_features.FeatureMomentCInvariant.rst | 95 ---------- ....visual_features.FeatureMomentCentered.rst | 80 -------- ...sp.visual_features.FeatureMomentCommon.rst | 58 ------ ....visual_features.FeatureMomentDatabase.rst | 50 ----- ...al_features.FeatureMomentGravityCenter.rst | 81 -------- ...s.FeatureMomentGravityCenterNormalized.rst | 81 -------- .../visp.visual_features.FeaturePoint.rst | 85 --------- .../visp.visual_features.FeaturePoint3D.rst | 84 --------- ...visp.visual_features.FeaturePointPolar.rst | 83 --------- .../visp.visual_features.FeatureSegment.rst | 92 --------- .../visp.visual_features.FeatureThetaU.rst | 90 --------- ...isp.visual_features.FeatureTranslation.rst | 88 --------- ....visual_features.FeatureVanishingPoint.rst | 90 --------- .../visp.visual_features.GenericFeature.rst | 77 -------- ...p.visual_features.MomentGenericFeature.rst | 79 -------- .../doc/_autosummary/visp.visual_features.rst | 57 ------ .../doc/_autosummary/visp.vs.AdaptiveGain.rst | 66 ------- .../python/doc/_autosummary/visp.vs.Servo.rst | 131 ------------- .../doc/_autosummary/visp.vs.ServoData.rst | 53 ------ .../doc/_autosummary/visp.vs.ServoDisplay.rst | 49 ----- modules/python/doc/_autosummary/visp.vs.rst | 35 ---- modules/python/doc/api.rst | 28 --- 276 files changed, 20539 deletions(-) delete mode 100644 modules/python/doc/_autosummary/visp.ar.rst delete mode 100644 modules/python/doc/_autosummary/visp.blob.Dot.rst delete mode 100644 modules/python/doc/_autosummary/visp.blob.Dot2.rst delete mode 100644 modules/python/doc/_autosummary/visp.blob.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.ArrayDouble2D.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.BSpline.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.CameraParameters.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.CannyEdgeDetection.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.Chrono.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.Circle.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.Client.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.ColVector.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.Color.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.ColorDepthConversion.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.Colormap.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.Convert.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.Cylinder.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.Display.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.ExponentialMap.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.FeatureDisplay.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.Font.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.ForceTwistMatrix.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.ForwardProjection.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.FrameGrabber.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.GaussRand.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.GaussianFilter.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.Hinkley.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.Histogram.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.HistogramPeak.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.HistogramValey.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.HomogeneousMatrix.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.ImageCircle.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.ImageConvert.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.ImageDouble.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.ImageDraw.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.ImageFilter.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.ImageFloat.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.ImageGray.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.ImageMorphology.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.ImagePoint.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.ImageRGBA.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.ImageRGBa.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.ImageRGBf.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.ImageTools.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.ImageUInt16.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.IoTools.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.KalmanFilter.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.LinProg.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.Line.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.LinearKalmanFilterInstantiation.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.Math.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.Matrix.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.MeterPixelConversion.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.Moment.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.MomentAlpha.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.MomentArea.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.MomentAreaNormalized.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.MomentBasic.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.MomentCInvariant.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.MomentCentered.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.MomentCommon.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.MomentDatabase.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.MomentGravityCenter.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.MomentGravityCenterNormalized.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.MomentObject.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.MouseButton.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.Munkres.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.Mutex.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.Network.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.PixelMeterConversion.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.Plane.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.Point.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.Polygon.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.Polygon3D.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.PoseVector.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.QuadProg.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.QuaternionVector.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.RGBa.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.RGBf.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.Rect.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.RectOriented.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.Request.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.Robust.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.RotationMatrix.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.RotationVector.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.RowVector.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.RxyzVector.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.RzyxVector.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.RzyzVector.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.Scale.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.Serial.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.Server.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.Sphere.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.SubColVector.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.SubMatrix.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.SubRowVector.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.ThetaUVector.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.Thread.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.Tracker.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.TranslationVector.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.Triangle.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.UDPClient.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.UDPServer.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.UniRand.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.VelocityTwistMatrix.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.XmlParser.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.XmlParserCamera.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.XmlParserHomogeneousMatrix.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.XmlParserRectOriented.rst delete mode 100644 modules/python/doc/_autosummary/visp.core.rst delete mode 100644 modules/python/doc/_autosummary/visp.detection.DetectorAprilTag.rst delete mode 100644 modules/python/doc/_autosummary/visp.detection.DetectorBase.rst delete mode 100644 modules/python/doc/_autosummary/visp.detection.DetectorDNNOpenCV.rst delete mode 100644 modules/python/doc/_autosummary/visp.detection.DetectorFace.rst delete mode 100644 modules/python/doc/_autosummary/visp.detection.DetectorQRCode.rst delete mode 100644 modules/python/doc/_autosummary/visp.detection.rst delete mode 100644 modules/python/doc/_autosummary/visp.dnn_tracker.MegaPose.rst delete mode 100644 modules/python/doc/_autosummary/visp.dnn_tracker.MegaPoseEstimate.rst delete mode 100644 modules/python/doc/_autosummary/visp.dnn_tracker.MegaPoseTracker.rst delete mode 100644 modules/python/doc/_autosummary/visp.dnn_tracker.rst delete mode 100644 modules/python/doc/_autosummary/visp.gui.ColorBlindFriendlyPalette.rst delete mode 100644 modules/python/doc/_autosummary/visp.gui.DisplayOpenCV.rst delete mode 100644 modules/python/doc/_autosummary/visp.gui.DisplayX.rst delete mode 100644 modules/python/doc/_autosummary/visp.gui.Plot.rst delete mode 100644 modules/python/doc/_autosummary/visp.gui.ProjectionDisplay.rst delete mode 100644 modules/python/doc/_autosummary/visp.gui.rst delete mode 100644 modules/python/doc/_autosummary/visp.imgproc.AutoThresholdMethod.rst delete mode 100644 modules/python/doc/_autosummary/visp.imgproc.CircleHoughTransform.rst delete mode 100644 modules/python/doc/_autosummary/visp.imgproc.ContourRetrievalType.rst delete mode 100644 modules/python/doc/_autosummary/visp.imgproc.ContourType.rst delete mode 100644 modules/python/doc/_autosummary/visp.imgproc.DirectionType.rst delete mode 100644 modules/python/doc/_autosummary/visp.imgproc.RETINEX_LEVEL.rst delete mode 100644 modules/python/doc/_autosummary/visp.imgproc.rst delete mode 100644 modules/python/doc/_autosummary/visp.io.DiskGrabber.rst delete mode 100644 modules/python/doc/_autosummary/visp.io.ImageIo.rst delete mode 100644 modules/python/doc/_autosummary/visp.io.Keyboard.rst delete mode 100644 modules/python/doc/_autosummary/visp.io.ParallelPort.rst delete mode 100644 modules/python/doc/_autosummary/visp.io.VideoReader.rst delete mode 100644 modules/python/doc/_autosummary/visp.io.VideoWriter.rst delete mode 100644 modules/python/doc/_autosummary/visp.io.rst delete mode 100644 modules/python/doc/_autosummary/visp.klt.KltOpencv.rst delete mode 100644 modules/python/doc/_autosummary/visp.klt.rst delete mode 100644 modules/python/doc/_autosummary/visp.mbt.MbDepthDenseTracker.rst delete mode 100644 modules/python/doc/_autosummary/visp.mbt.MbDepthNormalTracker.rst delete mode 100644 modules/python/doc/_autosummary/visp.mbt.MbEdgeKltTracker.rst delete mode 100644 modules/python/doc/_autosummary/visp.mbt.MbEdgeTracker.rst delete mode 100644 modules/python/doc/_autosummary/visp.mbt.MbGenericTracker.rst delete mode 100644 modules/python/doc/_autosummary/visp.mbt.MbKltTracker.rst delete mode 100644 modules/python/doc/_autosummary/visp.mbt.MbTracker.rst delete mode 100644 modules/python/doc/_autosummary/visp.mbt.MbtDistanceCircle.rst delete mode 100644 modules/python/doc/_autosummary/visp.mbt.MbtDistanceCylinder.rst delete mode 100644 modules/python/doc/_autosummary/visp.mbt.MbtDistanceKltCylinder.rst delete mode 100644 modules/python/doc/_autosummary/visp.mbt.MbtDistanceKltPoints.rst delete mode 100644 modules/python/doc/_autosummary/visp.mbt.MbtDistanceLine.rst delete mode 100644 modules/python/doc/_autosummary/visp.mbt.MbtFaceDepthDense.rst delete mode 100644 modules/python/doc/_autosummary/visp.mbt.MbtFaceDepthNormal.rst delete mode 100644 modules/python/doc/_autosummary/visp.mbt.MbtPolygon.rst delete mode 100644 modules/python/doc/_autosummary/visp.mbt.MbtXmlGenericParser.rst delete mode 100644 modules/python/doc/_autosummary/visp.mbt.rst delete mode 100644 modules/python/doc/_autosummary/visp.me.Me.rst delete mode 100644 modules/python/doc/_autosummary/visp.me.MeEllipse.rst delete mode 100644 modules/python/doc/_autosummary/visp.me.MeLine.rst delete mode 100644 modules/python/doc/_autosummary/visp.me.MeNurbs.rst delete mode 100644 modules/python/doc/_autosummary/visp.me.MeSite.rst delete mode 100644 modules/python/doc/_autosummary/visp.me.MeTracker.rst delete mode 100644 modules/python/doc/_autosummary/visp.me.Nurbs.rst delete mode 100644 modules/python/doc/_autosummary/visp.me.rst delete mode 100644 modules/python/doc/_autosummary/visp.robot.Afma4.rst delete mode 100644 modules/python/doc/_autosummary/visp.robot.Afma6.rst delete mode 100644 modules/python/doc/_autosummary/visp.robot.Biclops.rst delete mode 100644 modules/python/doc/_autosummary/visp.robot.ImageSimulator.rst delete mode 100644 modules/python/doc/_autosummary/visp.robot.Pioneer.rst delete mode 100644 modules/python/doc/_autosummary/visp.robot.PioneerPan.rst delete mode 100644 modules/python/doc/_autosummary/visp.robot.Pololu.rst delete mode 100644 modules/python/doc/_autosummary/visp.robot.Ptu46.rst delete mode 100644 modules/python/doc/_autosummary/visp.robot.QbDevice.rst delete mode 100644 modules/python/doc/_autosummary/visp.robot.QbSoftHand.rst delete mode 100644 modules/python/doc/_autosummary/visp.robot.ReflexTakktile2.rst delete mode 100644 modules/python/doc/_autosummary/visp.robot.RingLight.rst delete mode 100644 modules/python/doc/_autosummary/visp.robot.Robot.rst delete mode 100644 modules/python/doc/_autosummary/visp.robot.RobotPololuPtu.rst delete mode 100644 modules/python/doc/_autosummary/visp.robot.RobotSimulator.rst delete mode 100644 modules/python/doc/_autosummary/visp.robot.RobotTemplate.rst delete mode 100644 modules/python/doc/_autosummary/visp.robot.RobotWireFrameSimulator.rst delete mode 100644 modules/python/doc/_autosummary/visp.robot.Servolens.rst delete mode 100644 modules/python/doc/_autosummary/visp.robot.SimulatorAfma6.rst delete mode 100644 modules/python/doc/_autosummary/visp.robot.SimulatorCamera.rst delete mode 100644 modules/python/doc/_autosummary/visp.robot.SimulatorPioneer.rst delete mode 100644 modules/python/doc/_autosummary/visp.robot.SimulatorPioneerPan.rst delete mode 100644 modules/python/doc/_autosummary/visp.robot.SimulatorViper850.rst delete mode 100644 modules/python/doc/_autosummary/visp.robot.Unicycle.rst delete mode 100644 modules/python/doc/_autosummary/visp.robot.Viper.rst delete mode 100644 modules/python/doc/_autosummary/visp.robot.Viper650.rst delete mode 100644 modules/python/doc/_autosummary/visp.robot.Viper850.rst delete mode 100644 modules/python/doc/_autosummary/visp.robot.WireFrameSimulator.rst delete mode 100644 modules/python/doc/_autosummary/visp.robot.rst delete mode 100644 modules/python/doc/_autosummary/visp.sensor.ForceTorqueAtiNetFTSensor.rst delete mode 100644 modules/python/doc/_autosummary/visp.sensor.LaserScan.rst delete mode 100644 modules/python/doc/_autosummary/visp.sensor.LaserScanner.rst delete mode 100644 modules/python/doc/_autosummary/visp.sensor.Mocap.rst delete mode 100644 modules/python/doc/_autosummary/visp.sensor.RealSense2.rst delete mode 100644 modules/python/doc/_autosummary/visp.sensor.ScanPoint.rst delete mode 100644 modules/python/doc/_autosummary/visp.sensor.SickLDMRS.rst delete mode 100644 modules/python/doc/_autosummary/visp.sensor.V4l2Grabber.rst delete mode 100644 modules/python/doc/_autosummary/visp.sensor.rst delete mode 100644 modules/python/doc/_autosummary/visp.tt.TemplateTracker.rst delete mode 100644 modules/python/doc/_autosummary/visp.tt.TemplateTrackerDPoint.rst delete mode 100644 modules/python/doc/_autosummary/visp.tt.TemplateTrackerPoint.rst delete mode 100644 modules/python/doc/_autosummary/visp.tt.TemplateTrackerPointCompo.rst delete mode 100644 modules/python/doc/_autosummary/visp.tt.TemplateTrackerSSD.rst delete mode 100644 modules/python/doc/_autosummary/visp.tt.TemplateTrackerSSDESM.rst delete mode 100644 modules/python/doc/_autosummary/visp.tt.TemplateTrackerSSDForwardAdditional.rst delete mode 100644 modules/python/doc/_autosummary/visp.tt.TemplateTrackerSSDForwardCompositional.rst delete mode 100644 modules/python/doc/_autosummary/visp.tt.TemplateTrackerSSDInverseCompositional.rst delete mode 100644 modules/python/doc/_autosummary/visp.tt.TemplateTrackerTriangle.rst delete mode 100644 modules/python/doc/_autosummary/visp.tt.TemplateTrackerWarp.rst delete mode 100644 modules/python/doc/_autosummary/visp.tt.TemplateTrackerWarpAffine.rst delete mode 100644 modules/python/doc/_autosummary/visp.tt.TemplateTrackerWarpHomography.rst delete mode 100644 modules/python/doc/_autosummary/visp.tt.TemplateTrackerWarpHomographySL3.rst delete mode 100644 modules/python/doc/_autosummary/visp.tt.TemplateTrackerWarpRT.rst delete mode 100644 modules/python/doc/_autosummary/visp.tt.TemplateTrackerWarpSRT.rst delete mode 100644 modules/python/doc/_autosummary/visp.tt.TemplateTrackerWarpTranslation.rst delete mode 100644 modules/python/doc/_autosummary/visp.tt.TemplateTrackerZNCC.rst delete mode 100644 modules/python/doc/_autosummary/visp.tt.TemplateTrackerZNCCForwardAdditional.rst delete mode 100644 modules/python/doc/_autosummary/visp.tt.TemplateTrackerZNCCInverseCompositional.rst delete mode 100644 modules/python/doc/_autosummary/visp.tt.TemplateTrackerZPoint.rst delete mode 100644 modules/python/doc/_autosummary/visp.tt.TemplateTrackerZone.rst delete mode 100644 modules/python/doc/_autosummary/visp.tt.rst delete mode 100644 modules/python/doc/_autosummary/visp.tt_mi.TemplateTrackerMI.rst delete mode 100644 modules/python/doc/_autosummary/visp.tt_mi.TemplateTrackerMIESM.rst delete mode 100644 modules/python/doc/_autosummary/visp.tt_mi.TemplateTrackerMIForwardAdditional.rst delete mode 100644 modules/python/doc/_autosummary/visp.tt_mi.TemplateTrackerMIForwardCompositional.rst delete mode 100644 modules/python/doc/_autosummary/visp.tt_mi.TemplateTrackerMIInverseCompositional.rst delete mode 100644 modules/python/doc/_autosummary/visp.tt_mi.rst delete mode 100644 modules/python/doc/_autosummary/visp.vision.BasicKeyPoint.rst delete mode 100644 modules/python/doc/_autosummary/visp.vision.Calibration.rst delete mode 100644 modules/python/doc/_autosummary/visp.vision.HandEyeCalibration.rst delete mode 100644 modules/python/doc/_autosummary/visp.vision.Homography.rst delete mode 100644 modules/python/doc/_autosummary/visp.vision.KeyPoint.rst delete mode 100644 modules/python/doc/_autosummary/visp.vision.PlaneEstimation.rst delete mode 100644 modules/python/doc/_autosummary/visp.vision.Pose.rst delete mode 100644 modules/python/doc/_autosummary/visp.vision.XmlConfigParserKeyPoint.rst delete mode 100644 modules/python/doc/_autosummary/visp.vision.rst delete mode 100644 modules/python/doc/_autosummary/visp.visual_features.BasicFeature.rst delete mode 100644 modules/python/doc/_autosummary/visp.visual_features.FeatureBuilder.rst delete mode 100644 modules/python/doc/_autosummary/visp.visual_features.FeatureDepth.rst delete mode 100644 modules/python/doc/_autosummary/visp.visual_features.FeatureEllipse.rst delete mode 100644 modules/python/doc/_autosummary/visp.visual_features.FeatureLine.rst delete mode 100644 modules/python/doc/_autosummary/visp.visual_features.FeatureLuminance.rst delete mode 100644 modules/python/doc/_autosummary/visp.visual_features.FeatureMoment.rst delete mode 100644 modules/python/doc/_autosummary/visp.visual_features.FeatureMomentAlpha.rst delete mode 100644 modules/python/doc/_autosummary/visp.visual_features.FeatureMomentArea.rst delete mode 100644 modules/python/doc/_autosummary/visp.visual_features.FeatureMomentAreaNormalized.rst delete mode 100644 modules/python/doc/_autosummary/visp.visual_features.FeatureMomentBasic.rst delete mode 100644 modules/python/doc/_autosummary/visp.visual_features.FeatureMomentCInvariant.rst delete mode 100644 modules/python/doc/_autosummary/visp.visual_features.FeatureMomentCentered.rst delete mode 100644 modules/python/doc/_autosummary/visp.visual_features.FeatureMomentCommon.rst delete mode 100644 modules/python/doc/_autosummary/visp.visual_features.FeatureMomentDatabase.rst delete mode 100644 modules/python/doc/_autosummary/visp.visual_features.FeatureMomentGravityCenter.rst delete mode 100644 modules/python/doc/_autosummary/visp.visual_features.FeatureMomentGravityCenterNormalized.rst delete mode 100644 modules/python/doc/_autosummary/visp.visual_features.FeaturePoint.rst delete mode 100644 modules/python/doc/_autosummary/visp.visual_features.FeaturePoint3D.rst delete mode 100644 modules/python/doc/_autosummary/visp.visual_features.FeaturePointPolar.rst delete mode 100644 modules/python/doc/_autosummary/visp.visual_features.FeatureSegment.rst delete mode 100644 modules/python/doc/_autosummary/visp.visual_features.FeatureThetaU.rst delete mode 100644 modules/python/doc/_autosummary/visp.visual_features.FeatureTranslation.rst delete mode 100644 modules/python/doc/_autosummary/visp.visual_features.FeatureVanishingPoint.rst delete mode 100644 modules/python/doc/_autosummary/visp.visual_features.GenericFeature.rst delete mode 100644 modules/python/doc/_autosummary/visp.visual_features.MomentGenericFeature.rst delete mode 100644 modules/python/doc/_autosummary/visp.visual_features.rst delete mode 100644 modules/python/doc/_autosummary/visp.vs.AdaptiveGain.rst delete mode 100644 modules/python/doc/_autosummary/visp.vs.Servo.rst delete mode 100644 modules/python/doc/_autosummary/visp.vs.ServoData.rst delete mode 100644 modules/python/doc/_autosummary/visp.vs.ServoDisplay.rst delete mode 100644 modules/python/doc/_autosummary/visp.vs.rst delete mode 100644 modules/python/doc/api.rst diff --git a/modules/python/doc/_autosummary/visp.ar.rst b/modules/python/doc/_autosummary/visp.ar.rst deleted file mode 100644 index 38b0ff1cf7..0000000000 --- a/modules/python/doc/_autosummary/visp.ar.rst +++ /dev/null @@ -1,23 +0,0 @@ -ar -== - -.. automodule:: visp.ar - - - - - - - - - - - - - - - - - - - diff --git a/modules/python/doc/_autosummary/visp.blob.Dot.rst b/modules/python/doc/_autosummary/visp.blob.Dot.rst deleted file mode 100644 index 2741ae5266..0000000000 --- a/modules/python/doc/_autosummary/visp.blob.Dot.rst +++ /dev/null @@ -1,94 +0,0 @@ -Dot -=== - -.. currentmodule:: visp.blob - -.. autoclass:: Dot - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~Dot.display - ~Dot.displayDot - ~Dot.getArea - ~Dot.getBBox - ~Dot.getCog - ~Dot.getConnexities - ~Dot.getEdges - ~Dot.getGamma - ~Dot.getGrayLevelPrecision - ~Dot.getHeight - ~Dot.getMaxDotSize - ~Dot.getMeanGrayLevel - ~Dot.getPolygon - ~Dot.getWidth - ~Dot.get_nij - ~Dot.initTracking - ~Dot.print - ~Dot.setCog - ~Dot.setComputeMoments - ~Dot.setConnexity - ~Dot.setGraphics - ~Dot.setGraphicsThickness - ~Dot.setGrayLevelMax - ~Dot.setGrayLevelMin - ~Dot.setGrayLevelPrecision - ~Dot.setMaxDotSize - ~Dot.track - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~Dot.cPAvailable - ~Dot.get_cP - ~Dot.get_p - ~Dot.cP - ~Dot.p - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~Dot.__doc__ - ~Dot.__eq__ - ~Dot.__hash__ - ~Dot.__init__ - ~Dot.__module__ - ~Dot.__ne__ - ~Dot.__repr__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~Dot.CONNEXITY_4 - ~Dot.CONNEXITY_8 - ~Dot.cP - ~Dot.cPAvailable - ~Dot.p - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.blob.Dot2.rst b/modules/python/doc/_autosummary/visp.blob.Dot2.rst deleted file mode 100644 index b2139fc816..0000000000 --- a/modules/python/doc/_autosummary/visp.blob.Dot2.rst +++ /dev/null @@ -1,103 +0,0 @@ -Dot2 -==== - -.. currentmodule:: visp.blob - -.. autoclass:: Dot2 - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~Dot2.defineDots - ~Dot2.display - ~Dot2.displayDot - ~Dot2.getArea - ~Dot2.getBBox - ~Dot2.getCog - ~Dot2.getDistance - ~Dot2.getEdges - ~Dot2.getEllipsoidBadPointsPercentage - ~Dot2.getEllipsoidShapePrecision - ~Dot2.getFreemanChain - ~Dot2.getGamma - ~Dot2.getGrayLevelMax - ~Dot2.getGrayLevelMin - ~Dot2.getGrayLevelPrecision - ~Dot2.getHeight - ~Dot2.getMaxSizeSearchDistancePrecision - ~Dot2.getMeanGrayLevel - ~Dot2.getPolygon - ~Dot2.getSizePrecision - ~Dot2.getWidth - ~Dot2.get_nij - ~Dot2.initTracking - ~Dot2.print - ~Dot2.searchDotsInArea - ~Dot2.setArea - ~Dot2.setCog - ~Dot2.setComputeMoments - ~Dot2.setEllipsoidBadPointsPercentage - ~Dot2.setEllipsoidShapePrecision - ~Dot2.setGraphics - ~Dot2.setGraphicsThickness - ~Dot2.setGrayLevelMax - ~Dot2.setGrayLevelMin - ~Dot2.setGrayLevelPrecision - ~Dot2.setHeight - ~Dot2.setMaxSizeSearchDistancePrecision - ~Dot2.setSizePrecision - ~Dot2.setWidth - ~Dot2.track - ~Dot2.trackAndDisplay - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~Dot2.cPAvailable - ~Dot2.get_cP - ~Dot2.get_p - ~Dot2.cP - ~Dot2.p - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~Dot2.__doc__ - ~Dot2.__init__ - ~Dot2.__module__ - ~Dot2.__repr__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~Dot2.cP - ~Dot2.cPAvailable - ~Dot2.p - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.blob.rst b/modules/python/doc/_autosummary/visp.blob.rst deleted file mode 100644 index f7c0c5a1e4..0000000000 --- a/modules/python/doc/_autosummary/visp.blob.rst +++ /dev/null @@ -1,33 +0,0 @@ -blob -==== - -.. automodule:: visp.blob - - - - - - - - - - - - .. rubric:: Classes - - .. autosummary:: - :toctree: - :template: custom-class-template.rst - :nosignatures: - - Dot - Dot2 - - - - - - - - - diff --git a/modules/python/doc/_autosummary/visp.core.ArrayDouble2D.rst b/modules/python/doc/_autosummary/visp.core.ArrayDouble2D.rst deleted file mode 100644 index e0c9871ba5..0000000000 --- a/modules/python/doc/_autosummary/visp.core.ArrayDouble2D.rst +++ /dev/null @@ -1,68 +0,0 @@ -ArrayDouble2D -============= - -.. currentmodule:: visp.core - -.. autoclass:: ArrayDouble2D - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~ArrayDouble2D.conv2 - ~ArrayDouble2D.getCols - ~ArrayDouble2D.getMaxValue - ~ArrayDouble2D.getMinValue - ~ArrayDouble2D.getRows - ~ArrayDouble2D.hadamard - ~ArrayDouble2D.insert - ~ArrayDouble2D.insertStatic - ~ArrayDouble2D.numpy - ~ArrayDouble2D.reshape - ~ArrayDouble2D.resize - ~ArrayDouble2D.save - ~ArrayDouble2D.saveYAML - ~ArrayDouble2D.size - ~ArrayDouble2D.t - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~ArrayDouble2D.__doc__ - ~ArrayDouble2D.__eq__ - ~ArrayDouble2D.__getitem__ - ~ArrayDouble2D.__hash__ - ~ArrayDouble2D.__init__ - ~ArrayDouble2D.__module__ - ~ArrayDouble2D.__ne__ - ~ArrayDouble2D.__repr__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.BSpline.rst b/modules/python/doc/_autosummary/visp.core.BSpline.rst deleted file mode 100644 index b35ca21688..0000000000 --- a/modules/python/doc/_autosummary/visp.core.BSpline.rst +++ /dev/null @@ -1,69 +0,0 @@ -BSpline -======= - -.. currentmodule:: visp.core - -.. autoclass:: BSpline - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~BSpline.computeCurvePoint - ~BSpline.computeCurvePointFromSpline - ~BSpline.findSpan - ~BSpline.findSpanFromSpline - ~BSpline.get_controlPoints - ~BSpline.get_crossingPoints - ~BSpline.get_knots - ~BSpline.get_p - ~BSpline.set_controlPoints - ~BSpline.set_crossingPoints - ~BSpline.set_knots - ~BSpline.set_p - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~BSpline.__doc__ - ~BSpline.__init__ - ~BSpline.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~BSpline.controlPoints - ~BSpline.crossingPoints - ~BSpline.knots - ~BSpline.p - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.CameraParameters.rst b/modules/python/doc/_autosummary/visp.core.CameraParameters.rst deleted file mode 100644 index 4c0def9c89..0000000000 --- a/modules/python/doc/_autosummary/visp.core.CameraParameters.rst +++ /dev/null @@ -1,84 +0,0 @@ -CameraParameters -================ - -.. currentmodule:: visp.core - -.. autoclass:: CameraParameters - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~CameraParameters.computeFov - ~CameraParameters.getFovNormals - ~CameraParameters.getHorizontalFovAngle - ~CameraParameters.getKannalaBrandtDistortionCoefficients - ~CameraParameters.getVerticalFovAngle - ~CameraParameters.get_K - ~CameraParameters.get_K_inverse - ~CameraParameters.get_kdu - ~CameraParameters.get_kud - ~CameraParameters.get_projModel - ~CameraParameters.get_px - ~CameraParameters.get_px_inverse - ~CameraParameters.get_py - ~CameraParameters.get_py_inverse - ~CameraParameters.get_u0 - ~CameraParameters.get_v0 - ~CameraParameters.init - ~CameraParameters.initFromCalibrationMatrix - ~CameraParameters.initFromFov - ~CameraParameters.initPersProjWithDistortion - ~CameraParameters.initPersProjWithoutDistortion - ~CameraParameters.initProjWithKannalaBrandtDistortion - ~CameraParameters.isFovComputed - ~CameraParameters.printParameters - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~CameraParameters.__doc__ - ~CameraParameters.__eq__ - ~CameraParameters.__hash__ - ~CameraParameters.__init__ - ~CameraParameters.__module__ - ~CameraParameters.__ne__ - ~CameraParameters.__repr__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~CameraParameters.ProjWithKannalaBrandtDistortion - ~CameraParameters.perspectiveProjWithDistortion - ~CameraParameters.perspectiveProjWithoutDistortion - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.CannyEdgeDetection.rst b/modules/python/doc/_autosummary/visp.core.CannyEdgeDetection.rst deleted file mode 100644 index 6de99db92c..0000000000 --- a/modules/python/doc/_autosummary/visp.core.CannyEdgeDetection.rst +++ /dev/null @@ -1,56 +0,0 @@ -CannyEdgeDetection -================== - -.. currentmodule:: visp.core - -.. autoclass:: CannyEdgeDetection - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~CannyEdgeDetection.detect - ~CannyEdgeDetection.initFromJSON - ~CannyEdgeDetection.setCannyThresholds - ~CannyEdgeDetection.setCannyThresholdsRatio - ~CannyEdgeDetection.setFilteringAndGradientType - ~CannyEdgeDetection.setGaussianFilterParameters - ~CannyEdgeDetection.setGradientFilterAperture - ~CannyEdgeDetection.setGradients - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~CannyEdgeDetection.__doc__ - ~CannyEdgeDetection.__init__ - ~CannyEdgeDetection.__module__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.Chrono.rst b/modules/python/doc/_autosummary/visp.core.Chrono.rst deleted file mode 100644 index 7474ecb162..0000000000 --- a/modules/python/doc/_autosummary/visp.core.Chrono.rst +++ /dev/null @@ -1,53 +0,0 @@ -Chrono -====== - -.. currentmodule:: visp.core - -.. autoclass:: Chrono - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~Chrono.getDurationMicros - ~Chrono.getDurationMs - ~Chrono.getDurationSeconds - ~Chrono.start - ~Chrono.stop - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~Chrono.__doc__ - ~Chrono.__init__ - ~Chrono.__module__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.Circle.rst b/modules/python/doc/_autosummary/visp.core.Circle.rst deleted file mode 100644 index d0db87396c..0000000000 --- a/modules/python/doc/_autosummary/visp.core.Circle.rst +++ /dev/null @@ -1,91 +0,0 @@ -Circle -====== - -.. currentmodule:: visp.core - -.. autoclass:: Circle - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~Circle.changeFrame - ~Circle.computeIntersectionPoint - ~Circle.display - ~Circle.getA - ~Circle.getB - ~Circle.getC - ~Circle.getR - ~Circle.getX - ~Circle.getY - ~Circle.getZ - ~Circle.get_n02 - ~Circle.get_n11 - ~Circle.get_n20 - ~Circle.get_x - ~Circle.get_y - ~Circle.projection - ~Circle.setWorldCoordinates - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~Circle.cPAvailable - ~Circle.user - ~Circle.track - ~Circle.getDeallocate - ~Circle.get_cP - ~Circle.project - ~Circle.ForwardProjectionDeallocatorType - ~Circle.print - ~Circle.get_p - ~Circle.setDeallocate - ~Circle.cP - ~Circle.vpDisplayForwardProjection - ~Circle.p - ~Circle.get_oP - ~Circle.oP - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~Circle.__doc__ - ~Circle.__init__ - ~Circle.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~Circle.cP - ~Circle.cPAvailable - ~Circle.oP - ~Circle.p - ~Circle.user - ~Circle.vpDisplayForwardProjection - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.Client.rst b/modules/python/doc/_autosummary/visp.core.Client.rst deleted file mode 100644 index c5c1c97aa4..0000000000 --- a/modules/python/doc/_autosummary/visp.core.Client.rst +++ /dev/null @@ -1,76 +0,0 @@ -Client -====== - -.. currentmodule:: visp.core - -.. autoclass:: Client - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~Client.connectToHostname - ~Client.connectToIP - ~Client.deconnect - ~Client.getNumberOfAttempts - ~Client.getNumberOfServers - ~Client.print - ~Client.setNumberOfAttempts - ~Client.stop - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~Client.removeDecodingRequest - ~Client.setMaxSizeReceivedMessage - ~Client.receiveRequestFrom - ~Client.receiveAndDecodeRequestFrom - ~Client.setTimeoutUSec - ~Client.getRequestIdFromIndex - ~Client.receiveRequest - ~Client.setVerbose - ~Client.sendRequestTo - ~Client.receiveAndDecodeRequestOnce - ~Client.receiveRequestOnceFrom - ~Client.sendRequest - ~Client.getReceptorIndex - ~Client.setTimeoutSec - ~Client.getMaxSizeReceivedMessage - ~Client.sendAndEncodeRequest - ~Client.receiveAndDecodeRequest - ~Client.receiveRequestOnce - ~Client.sendAndEncodeRequestTo - ~Client.receiveAndDecodeRequestOnceFrom - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~Client.__doc__ - ~Client.__init__ - ~Client.__module__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.ColVector.rst b/modules/python/doc/_autosummary/visp.core.ColVector.rst deleted file mode 100644 index 0888cf9a41..0000000000 --- a/modules/python/doc/_autosummary/visp.core.ColVector.rst +++ /dev/null @@ -1,104 +0,0 @@ -ColVector -========= - -.. currentmodule:: visp.core - -.. autoclass:: ColVector - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~ColVector.clear - ~ColVector.cppPrint - ~ColVector.cross - ~ColVector.crossProd - ~ColVector.csvPrint - ~ColVector.deg2rad - ~ColVector.dotProd - ~ColVector.extract - ~ColVector.frobeniusNorm - ~ColVector.hadamard - ~ColVector.infinityNorm - ~ColVector.init - ~ColVector.insert - ~ColVector.invSort - ~ColVector.maplePrint - ~ColVector.matlabPrint - ~ColVector.mean - ~ColVector.median - ~ColVector.normalize - ~ColVector.numpy - ~ColVector.print - ~ColVector.rad2deg - ~ColVector.reshape - ~ColVector.resize - ~ColVector.skew - ~ColVector.sort - ~ColVector.stack - ~ColVector.stackVectors - ~ColVector.stdev - ~ColVector.sum - ~ColVector.sumSquare - ~ColVector.t - ~ColVector.toStdVector - ~ColVector.transpose - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~ColVector.insertStatic - ~ColVector.getMaxValue - ~ColVector.save - ~ColVector.size - ~ColVector.getCols - ~ColVector.getMinValue - ~ColVector.conv2 - ~ColVector.saveYAML - ~ColVector.getRows - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~ColVector.__add__ - ~ColVector.__doc__ - ~ColVector.__eq__ - ~ColVector.__getitem__ - ~ColVector.__hash__ - ~ColVector.__iadd__ - ~ColVector.__imul__ - ~ColVector.__init__ - ~ColVector.__isub__ - ~ColVector.__itruediv__ - ~ColVector.__module__ - ~ColVector.__mul__ - ~ColVector.__ne__ - ~ColVector.__neg__ - ~ColVector.__sub__ - ~ColVector.__truediv__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.Color.rst b/modules/python/doc/_autosummary/visp.core.Color.rst deleted file mode 100644 index 65d17226e0..0000000000 --- a/modules/python/doc/_autosummary/visp.core.Color.rst +++ /dev/null @@ -1,106 +0,0 @@ -Color -===== - -.. currentmodule:: visp.core - -.. autoclass:: Color - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~Color.getColor - ~Color.setColor - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~Color.A - ~Color.R - ~Color.AlphaDefault - ~Color.alpha_default - ~Color.G - ~Color.B - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~Color.__doc__ - ~Color.__init__ - ~Color.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~Color.A - ~Color.B - ~Color.G - ~Color.R - ~Color.alpha_default - ~Color.black - ~Color.blue - ~Color.cyan - ~Color.darkBlue - ~Color.darkGray - ~Color.darkGreen - ~Color.darkRed - ~Color.gray - ~Color.green - ~Color.id - ~Color.id_black - ~Color.id_blue - ~Color.id_cyan - ~Color.id_darkBlue - ~Color.id_darkGray - ~Color.id_darkGreen - ~Color.id_darkRed - ~Color.id_gray - ~Color.id_green - ~Color.id_lightBlue - ~Color.id_lightGray - ~Color.id_lightGreen - ~Color.id_lightRed - ~Color.id_orange - ~Color.id_purple - ~Color.id_red - ~Color.id_unknown - ~Color.id_white - ~Color.id_yellow - ~Color.lightBlue - ~Color.lightGray - ~Color.lightGreen - ~Color.lightRed - ~Color.nbColors - ~Color.none - ~Color.orange - ~Color.purple - ~Color.red - ~Color.white - ~Color.yellow - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.ColorDepthConversion.rst b/modules/python/doc/_autosummary/visp.core.ColorDepthConversion.rst deleted file mode 100644 index 629c3baa20..0000000000 --- a/modules/python/doc/_autosummary/visp.core.ColorDepthConversion.rst +++ /dev/null @@ -1,49 +0,0 @@ -ColorDepthConversion -==================== - -.. currentmodule:: visp.core - -.. autoclass:: ColorDepthConversion - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~ColorDepthConversion.projectColorToDepth - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~ColorDepthConversion.__doc__ - ~ColorDepthConversion.__init__ - ~ColorDepthConversion.__module__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.Colormap.rst b/modules/python/doc/_autosummary/visp.core.Colormap.rst deleted file mode 100644 index c6effccde4..0000000000 --- a/modules/python/doc/_autosummary/visp.core.Colormap.rst +++ /dev/null @@ -1,76 +0,0 @@ -Colormap -======== - -.. currentmodule:: visp.core - -.. autoclass:: Colormap - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~Colormap.convert - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~Colormap.__doc__ - ~Colormap.__init__ - ~Colormap.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~Colormap.COLORMAP_AUTUMN - ~Colormap.COLORMAP_CIVIDIS - ~Colormap.COLORMAP_COOL - ~Colormap.COLORMAP_GIST_EARTH - ~Colormap.COLORMAP_GNUPLOT - ~Colormap.COLORMAP_GNUPLOT2 - ~Colormap.COLORMAP_HOT - ~Colormap.COLORMAP_HSV - ~Colormap.COLORMAP_INFERNO - ~Colormap.COLORMAP_JET - ~Colormap.COLORMAP_MAGMA - ~Colormap.COLORMAP_OCEAN - ~Colormap.COLORMAP_PLASMA - ~Colormap.COLORMAP_RAINBOW - ~Colormap.COLORMAP_SPRING - ~Colormap.COLORMAP_SUMMER - ~Colormap.COLORMAP_TERRAIN - ~Colormap.COLORMAP_TURBO - ~Colormap.COLORMAP_TWILIGHT - ~Colormap.COLORMAP_TWILIGHT_SHIFTED - ~Colormap.COLORMAP_VIRIDIS - ~Colormap.COLORMAP_WINTER - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.Convert.rst b/modules/python/doc/_autosummary/visp.core.Convert.rst deleted file mode 100644 index 2a7f3efed4..0000000000 --- a/modules/python/doc/_autosummary/visp.core.Convert.rst +++ /dev/null @@ -1,50 +0,0 @@ -Convert -======= - -.. currentmodule:: visp.core - -.. autoclass:: Convert - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~Convert.convertFromOpenCV - ~Convert.convertToOpenCV - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~Convert.__doc__ - ~Convert.__init__ - ~Convert.__module__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.Cylinder.rst b/modules/python/doc/_autosummary/visp.core.Cylinder.rst deleted file mode 100644 index 9fd8ed05fe..0000000000 --- a/modules/python/doc/_autosummary/visp.core.Cylinder.rst +++ /dev/null @@ -1,93 +0,0 @@ -Cylinder -======== - -.. currentmodule:: visp.core - -.. autoclass:: Cylinder - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~Cylinder.changeFrame - ~Cylinder.computeZ - ~Cylinder.display - ~Cylinder.getA - ~Cylinder.getB - ~Cylinder.getC - ~Cylinder.getR - ~Cylinder.getRho1 - ~Cylinder.getRho2 - ~Cylinder.getTheta1 - ~Cylinder.getTheta2 - ~Cylinder.getX - ~Cylinder.getY - ~Cylinder.getZ - ~Cylinder.init - ~Cylinder.projection - ~Cylinder.setWorldCoordinates - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~Cylinder.cPAvailable - ~Cylinder.user - ~Cylinder.track - ~Cylinder.getDeallocate - ~Cylinder.get_cP - ~Cylinder.project - ~Cylinder.ForwardProjectionDeallocatorType - ~Cylinder.print - ~Cylinder.get_p - ~Cylinder.setDeallocate - ~Cylinder.cP - ~Cylinder.vpDisplayForwardProjection - ~Cylinder.p - ~Cylinder.get_oP - ~Cylinder.oP - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~Cylinder.__doc__ - ~Cylinder.__init__ - ~Cylinder.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~Cylinder.cP - ~Cylinder.cPAvailable - ~Cylinder.line1 - ~Cylinder.line2 - ~Cylinder.oP - ~Cylinder.p - ~Cylinder.user - ~Cylinder.vpDisplayForwardProjection - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.Display.rst b/modules/python/doc/_autosummary/visp.core.Display.rst deleted file mode 100644 index d329ccf909..0000000000 --- a/modules/python/doc/_autosummary/visp.core.Display.rst +++ /dev/null @@ -1,101 +0,0 @@ -Display -======= - -.. currentmodule:: visp.core - -.. autoclass:: Display - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~Display.close - ~Display.computeAutoScale - ~Display.display - ~Display.displayArrow - ~Display.displayCamera - ~Display.displayCircleStatic - ~Display.displayCross - ~Display.displayDotLine - ~Display.displayEllipse - ~Display.displayFrame - ~Display.displayLine - ~Display.displayPoint - ~Display.displayPolygon - ~Display.displayROI - ~Display.displayRectangle - ~Display.displayText - ~Display.flush - ~Display.flushROI - ~Display.getClick - ~Display.getClickUp - ~Display.getDownScalingFactor - ~Display.getHeight - ~Display.getImage - ~Display.getImageDownScalingFactor - ~Display.getKeyboardEvent - ~Display.getPointerMotionEvent - ~Display.getPointerPosition - ~Display.getWidth - ~Display.getWindowXPosition - ~Display.getWindowYPosition - ~Display.isInitialised - ~Display.setBackground - ~Display.setDownScalingFactor - ~Display.setFont - ~Display.setTitle - ~Display.setWindowPosition - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~Display.__doc__ - ~Display.__init__ - ~Display.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~Display.SCALE_1 - ~Display.SCALE_10 - ~Display.SCALE_2 - ~Display.SCALE_3 - ~Display.SCALE_4 - ~Display.SCALE_5 - ~Display.SCALE_6 - ~Display.SCALE_7 - ~Display.SCALE_8 - ~Display.SCALE_9 - ~Display.SCALE_AUTO - ~Display.SCALE_DEFAULT - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.ExponentialMap.rst b/modules/python/doc/_autosummary/visp.core.ExponentialMap.rst deleted file mode 100644 index c06de1655a..0000000000 --- a/modules/python/doc/_autosummary/visp.core.ExponentialMap.rst +++ /dev/null @@ -1,50 +0,0 @@ -ExponentialMap -============== - -.. currentmodule:: visp.core - -.. autoclass:: ExponentialMap - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~ExponentialMap.direct - ~ExponentialMap.inverse - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~ExponentialMap.__doc__ - ~ExponentialMap.__init__ - ~ExponentialMap.__module__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.FeatureDisplay.rst b/modules/python/doc/_autosummary/visp.core.FeatureDisplay.rst deleted file mode 100644 index cd0695a1d1..0000000000 --- a/modules/python/doc/_autosummary/visp.core.FeatureDisplay.rst +++ /dev/null @@ -1,52 +0,0 @@ -FeatureDisplay -============== - -.. currentmodule:: visp.core - -.. autoclass:: FeatureDisplay - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~FeatureDisplay.displayCylinder - ~FeatureDisplay.displayEllipse - ~FeatureDisplay.displayLine - ~FeatureDisplay.displayPoint - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~FeatureDisplay.__doc__ - ~FeatureDisplay.__init__ - ~FeatureDisplay.__module__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.Font.rst b/modules/python/doc/_autosummary/visp.core.Font.rst deleted file mode 100644 index cfb06f599c..0000000000 --- a/modules/python/doc/_autosummary/visp.core.Font.rst +++ /dev/null @@ -1,59 +0,0 @@ -Font -==== - -.. currentmodule:: visp.core - -.. autoclass:: Font - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~Font.drawText - ~Font.getHeight - ~Font.getMeasure - ~Font.setHeight - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~Font.__doc__ - ~Font.__init__ - ~Font.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~Font.GENERIC_MONOSPACE - ~Font.TRUETYPE_FILE - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.ForceTwistMatrix.rst b/modules/python/doc/_autosummary/visp.core.ForceTwistMatrix.rst deleted file mode 100644 index 695d247e74..0000000000 --- a/modules/python/doc/_autosummary/visp.core.ForceTwistMatrix.rst +++ /dev/null @@ -1,67 +0,0 @@ -ForceTwistMatrix -================ - -.. currentmodule:: visp.core - -.. autoclass:: ForceTwistMatrix - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~ForceTwistMatrix.buildFrom - ~ForceTwistMatrix.eye - ~ForceTwistMatrix.print - ~ForceTwistMatrix.resize - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~ForceTwistMatrix.insertStatic - ~ForceTwistMatrix.getMaxValue - ~ForceTwistMatrix.t - ~ForceTwistMatrix.save - ~ForceTwistMatrix.size - ~ForceTwistMatrix.hadamard - ~ForceTwistMatrix.insert - ~ForceTwistMatrix.getCols - ~ForceTwistMatrix.getMinValue - ~ForceTwistMatrix.numpy - ~ForceTwistMatrix.reshape - ~ForceTwistMatrix.conv2 - ~ForceTwistMatrix.saveYAML - ~ForceTwistMatrix.getRows - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~ForceTwistMatrix.__doc__ - ~ForceTwistMatrix.__init__ - ~ForceTwistMatrix.__module__ - ~ForceTwistMatrix.__mul__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.ForwardProjection.rst b/modules/python/doc/_autosummary/visp.core.ForwardProjection.rst deleted file mode 100644 index a19dd2b4aa..0000000000 --- a/modules/python/doc/_autosummary/visp.core.ForwardProjection.rst +++ /dev/null @@ -1,70 +0,0 @@ -ForwardProjection -================= - -.. currentmodule:: visp.core - -.. autoclass:: ForwardProjection - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~ForwardProjection.getDeallocate - ~ForwardProjection.get_oP - ~ForwardProjection.print - ~ForwardProjection.project - ~ForwardProjection.setDeallocate - ~ForwardProjection.track - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~ForwardProjection.cPAvailable - ~ForwardProjection.get_cP - ~ForwardProjection.get_p - ~ForwardProjection.cP - ~ForwardProjection.p - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~ForwardProjection.__doc__ - ~ForwardProjection.__init__ - ~ForwardProjection.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~ForwardProjection.cP - ~ForwardProjection.cPAvailable - ~ForwardProjection.oP - ~ForwardProjection.p - ~ForwardProjection.user - ~ForwardProjection.vpDisplayForwardProjection - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.FrameGrabber.rst b/modules/python/doc/_autosummary/visp.core.FrameGrabber.rst deleted file mode 100644 index bfbc8410ca..0000000000 --- a/modules/python/doc/_autosummary/visp.core.FrameGrabber.rst +++ /dev/null @@ -1,56 +0,0 @@ -FrameGrabber -============ - -.. currentmodule:: visp.core - -.. autoclass:: FrameGrabber - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~FrameGrabber.getHeight - ~FrameGrabber.getWidth - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~FrameGrabber.__doc__ - ~FrameGrabber.__init__ - ~FrameGrabber.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~FrameGrabber.init - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.GaussRand.rst b/modules/python/doc/_autosummary/visp.core.GaussRand.rst deleted file mode 100644 index 13c3d21281..0000000000 --- a/modules/python/doc/_autosummary/visp.core.GaussRand.rst +++ /dev/null @@ -1,50 +0,0 @@ -GaussRand -========= - -.. currentmodule:: visp.core - -.. autoclass:: GaussRand - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~GaussRand.seed - ~GaussRand.setSigmaMean - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~GaussRand.__doc__ - ~GaussRand.__init__ - ~GaussRand.__module__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.GaussianFilter.rst b/modules/python/doc/_autosummary/visp.core.GaussianFilter.rst deleted file mode 100644 index 6076679d7c..0000000000 --- a/modules/python/doc/_autosummary/visp.core.GaussianFilter.rst +++ /dev/null @@ -1,49 +0,0 @@ -GaussianFilter -============== - -.. currentmodule:: visp.core - -.. autoclass:: GaussianFilter - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~GaussianFilter.apply - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~GaussianFilter.__doc__ - ~GaussianFilter.__init__ - ~GaussianFilter.__module__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.Hinkley.rst b/modules/python/doc/_autosummary/visp.core.Hinkley.rst deleted file mode 100644 index 62a29de67a..0000000000 --- a/modules/python/doc/_autosummary/visp.core.Hinkley.rst +++ /dev/null @@ -1,68 +0,0 @@ -Hinkley -======= - -.. currentmodule:: visp.core - -.. autoclass:: Hinkley - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~Hinkley.getMean - ~Hinkley.getMk - ~Hinkley.getNk - ~Hinkley.getSk - ~Hinkley.getTk - ~Hinkley.init - ~Hinkley.print - ~Hinkley.setAlpha - ~Hinkley.setDelta - ~Hinkley.testDownUpwardJump - ~Hinkley.testDownwardJump - ~Hinkley.testUpwardJump - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~Hinkley.__doc__ - ~Hinkley.__init__ - ~Hinkley.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~Hinkley.downwardJump - ~Hinkley.noJump - ~Hinkley.upwardJump - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.Histogram.rst b/modules/python/doc/_autosummary/visp.core.Histogram.rst deleted file mode 100644 index 4e9025fef7..0000000000 --- a/modules/python/doc/_autosummary/visp.core.Histogram.rst +++ /dev/null @@ -1,59 +0,0 @@ -Histogram -========= - -.. currentmodule:: visp.core - -.. autoclass:: Histogram - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~Histogram.calculate - ~Histogram.display - ~Histogram.equalize - ~Histogram.get - ~Histogram.getPeaks - ~Histogram.getSize - ~Histogram.getValey - ~Histogram.set - ~Histogram.smooth - ~Histogram.sort - ~Histogram.write - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~Histogram.__doc__ - ~Histogram.__init__ - ~Histogram.__module__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.HistogramPeak.rst b/modules/python/doc/_autosummary/visp.core.HistogramPeak.rst deleted file mode 100644 index 0e0c5f67af..0000000000 --- a/modules/python/doc/_autosummary/visp.core.HistogramPeak.rst +++ /dev/null @@ -1,56 +0,0 @@ -HistogramPeak -============= - -.. currentmodule:: visp.core - -.. autoclass:: HistogramPeak - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~HistogramPeak.getLevel - ~HistogramPeak.getValue - ~HistogramPeak.set - ~HistogramPeak.setLevel - ~HistogramPeak.setValue - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~HistogramPeak.__doc__ - ~HistogramPeak.__eq__ - ~HistogramPeak.__hash__ - ~HistogramPeak.__init__ - ~HistogramPeak.__module__ - ~HistogramPeak.__repr__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.HistogramValey.rst b/modules/python/doc/_autosummary/visp.core.HistogramValey.rst deleted file mode 100644 index c54c54c08a..0000000000 --- a/modules/python/doc/_autosummary/visp.core.HistogramValey.rst +++ /dev/null @@ -1,56 +0,0 @@ -HistogramValey -============== - -.. currentmodule:: visp.core - -.. autoclass:: HistogramValey - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~HistogramValey.getLevel - ~HistogramValey.getValue - ~HistogramValey.set - ~HistogramValey.setLevel - ~HistogramValey.setValue - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~HistogramValey.__doc__ - ~HistogramValey.__eq__ - ~HistogramValey.__hash__ - ~HistogramValey.__init__ - ~HistogramValey.__module__ - ~HistogramValey.__repr__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.HomogeneousMatrix.rst b/modules/python/doc/_autosummary/visp.core.HomogeneousMatrix.rst deleted file mode 100644 index 30e32123e5..0000000000 --- a/modules/python/doc/_autosummary/visp.core.HomogeneousMatrix.rst +++ /dev/null @@ -1,88 +0,0 @@ -HomogeneousMatrix -================= - -.. currentmodule:: visp.core - -.. autoclass:: HomogeneousMatrix - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~HomogeneousMatrix.buildFrom - ~HomogeneousMatrix.compute3d3dTransformation - ~HomogeneousMatrix.convert - ~HomogeneousMatrix.extract - ~HomogeneousMatrix.eye - ~HomogeneousMatrix.getCol - ~HomogeneousMatrix.getRotationMatrix - ~HomogeneousMatrix.getThetaUVector - ~HomogeneousMatrix.getTranslationVector - ~HomogeneousMatrix.insert - ~HomogeneousMatrix.inverse - ~HomogeneousMatrix.isAnHomogeneousMatrix - ~HomogeneousMatrix.isValid - ~HomogeneousMatrix.load - ~HomogeneousMatrix.mean - ~HomogeneousMatrix.numpy - ~HomogeneousMatrix.orthogonalizeRotation - ~HomogeneousMatrix.print - ~HomogeneousMatrix.resize - ~HomogeneousMatrix.save - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~HomogeneousMatrix.insertStatic - ~HomogeneousMatrix.getMaxValue - ~HomogeneousMatrix.t - ~HomogeneousMatrix.size - ~HomogeneousMatrix.hadamard - ~HomogeneousMatrix.getCols - ~HomogeneousMatrix.getMinValue - ~HomogeneousMatrix.reshape - ~HomogeneousMatrix.conv2 - ~HomogeneousMatrix.saveYAML - ~HomogeneousMatrix.getRows - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~HomogeneousMatrix.__doc__ - ~HomogeneousMatrix.__getitem__ - ~HomogeneousMatrix.__imul__ - ~HomogeneousMatrix.__init__ - ~HomogeneousMatrix.__module__ - ~HomogeneousMatrix.__mul__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~HomogeneousMatrix.jsonTypeName - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.ImageCircle.rst b/modules/python/doc/_autosummary/visp.core.ImageCircle.rst deleted file mode 100644 index 6aec114851..0000000000 --- a/modules/python/doc/_autosummary/visp.core.ImageCircle.rst +++ /dev/null @@ -1,56 +0,0 @@ -ImageCircle -=========== - -.. currentmodule:: visp.core - -.. autoclass:: ImageCircle - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~ImageCircle.computeAngularCoverageInRoI - ~ImageCircle.computeArcLengthInRoI - ~ImageCircle.getBBox - ~ImageCircle.getCenter - ~ImageCircle.getRadius - ~ImageCircle.get_n02 - ~ImageCircle.get_n11 - ~ImageCircle.get_n20 - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~ImageCircle.__doc__ - ~ImageCircle.__init__ - ~ImageCircle.__module__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.ImageConvert.rst b/modules/python/doc/_autosummary/visp.core.ImageConvert.rst deleted file mode 100644 index 6e4798b52c..0000000000 --- a/modules/python/doc/_autosummary/visp.core.ImageConvert.rst +++ /dev/null @@ -1,80 +0,0 @@ -ImageConvert -============ - -.. currentmodule:: visp.core - -.. autoclass:: ImageConvert - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~ImageConvert.GreyToRGB - ~ImageConvert.GreyToRGBa - ~ImageConvert.RGBToGrey - ~ImageConvert.RGBToRGBa - ~ImageConvert.RGBaToRGB - ~ImageConvert.YCbCrToGrey - ~ImageConvert.YCbCrToRGB - ~ImageConvert.YCbCrToRGBa - ~ImageConvert.YCrCbToRGB - ~ImageConvert.YCrCbToRGBa - ~ImageConvert.YUV411ToGrey - ~ImageConvert.YUV411ToRGB - ~ImageConvert.YUV411ToRGBa - ~ImageConvert.YUV420ToGrey - ~ImageConvert.YUV420ToRGB - ~ImageConvert.YUV420ToRGBa - ~ImageConvert.YUV422ToGrey - ~ImageConvert.YUV422ToRGB - ~ImageConvert.YUV422ToRGBa - ~ImageConvert.YUV444ToGrey - ~ImageConvert.YUV444ToRGB - ~ImageConvert.YUV444ToRGBa - ~ImageConvert.YUVToRGB - ~ImageConvert.YUYVToGrey - ~ImageConvert.YUYVToRGB - ~ImageConvert.YUYVToRGBa - ~ImageConvert.YV12ToRGB - ~ImageConvert.YV12ToRGBa - ~ImageConvert.YVU9ToRGB - ~ImageConvert.YVU9ToRGBa - ~ImageConvert.convert - ~ImageConvert.createDepthHistogram - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~ImageConvert.__doc__ - ~ImageConvert.__init__ - ~ImageConvert.__module__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.ImageDouble.rst b/modules/python/doc/_autosummary/visp.core.ImageDouble.rst deleted file mode 100644 index aef488b13e..0000000000 --- a/modules/python/doc/_autosummary/visp.core.ImageDouble.rst +++ /dev/null @@ -1,76 +0,0 @@ -ImageDouble -=========== - -.. currentmodule:: visp.core - -.. autoclass:: ImageDouble - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~ImageDouble.destroy - ~ImageDouble.doubleSizeImage - ~ImageDouble.getCols - ~ImageDouble.getHeight - ~ImageDouble.getMaxValue - ~ImageDouble.getMeanValue - ~ImageDouble.getMinMaxValue - ~ImageDouble.getMinValue - ~ImageDouble.getNumberOfPixel - ~ImageDouble.getRows - ~ImageDouble.getSize - ~ImageDouble.getSum - ~ImageDouble.getValue - ~ImageDouble.getWidth - ~ImageDouble.halfSizeImage - ~ImageDouble.init - ~ImageDouble.insert - ~ImageDouble.numpy - ~ImageDouble.quarterSizeImage - ~ImageDouble.resize - ~ImageDouble.sub - ~ImageDouble.subsample - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~ImageDouble.__doc__ - ~ImageDouble.__eq__ - ~ImageDouble.__getitem__ - ~ImageDouble.__hash__ - ~ImageDouble.__init__ - ~ImageDouble.__module__ - ~ImageDouble.__ne__ - ~ImageDouble.__repr__ - ~ImageDouble.__sub__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.ImageDraw.rst b/modules/python/doc/_autosummary/visp.core.ImageDraw.rst deleted file mode 100644 index 0279095bdb..0000000000 --- a/modules/python/doc/_autosummary/visp.core.ImageDraw.rst +++ /dev/null @@ -1,58 +0,0 @@ -ImageDraw -========= - -.. currentmodule:: visp.core - -.. autoclass:: ImageDraw - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~ImageDraw.drawArrow - ~ImageDraw.drawCircle - ~ImageDraw.drawCross - ~ImageDraw.drawDottedLine - ~ImageDraw.drawEllipse - ~ImageDraw.drawFrame - ~ImageDraw.drawLine - ~ImageDraw.drawPoint - ~ImageDraw.drawPolygon - ~ImageDraw.drawRectangle - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~ImageDraw.__doc__ - ~ImageDraw.__init__ - ~ImageDraw.__module__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.ImageFilter.rst b/modules/python/doc/_autosummary/visp.core.ImageFilter.rst deleted file mode 100644 index 89db29236b..0000000000 --- a/modules/python/doc/_autosummary/visp.core.ImageFilter.rst +++ /dev/null @@ -1,75 +0,0 @@ -ImageFilter -=========== - -.. currentmodule:: visp.core - -.. autoclass:: ImageFilter - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~ImageFilter.canny - ~ImageFilter.computePartialDerivatives - ~ImageFilter.filterGaussXPyramidal - ~ImageFilter.filterGaussYPyramidal - ~ImageFilter.gaussianBlur - ~ImageFilter.getGaussPyramidal - ~ImageFilter.getGaussXPyramidal - ~ImageFilter.getGaussYPyramidal - ~ImageFilter.median - ~ImageFilter.sepFilter - ~ImageFilter.vpCannyBackendTypeFromString - ~ImageFilter.vpCannyBackendTypeList - ~ImageFilter.vpCannyBackendTypeToString - ~ImageFilter.vpCannyFilteringAndGradientTypeFromString - ~ImageFilter.vpCannyFilteringAndGradientTypeList - ~ImageFilter.vpCannyFilteringAndGradientTypeToString - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~ImageFilter.__doc__ - ~ImageFilter.__init__ - ~ImageFilter.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~ImageFilter.CANNY_COUNT_BACKEND - ~ImageFilter.CANNY_COUNT_FILTERING - ~ImageFilter.CANNY_GBLUR_SCHARR_FILTERING - ~ImageFilter.CANNY_GBLUR_SOBEL_FILTERING - ~ImageFilter.CANNY_OPENCV_BACKEND - ~ImageFilter.CANNY_VISP_BACKEND - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.ImageFloat.rst b/modules/python/doc/_autosummary/visp.core.ImageFloat.rst deleted file mode 100644 index 36b34dba16..0000000000 --- a/modules/python/doc/_autosummary/visp.core.ImageFloat.rst +++ /dev/null @@ -1,76 +0,0 @@ -ImageFloat -========== - -.. currentmodule:: visp.core - -.. autoclass:: ImageFloat - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~ImageFloat.destroy - ~ImageFloat.doubleSizeImage - ~ImageFloat.getCols - ~ImageFloat.getHeight - ~ImageFloat.getMaxValue - ~ImageFloat.getMeanValue - ~ImageFloat.getMinMaxValue - ~ImageFloat.getMinValue - ~ImageFloat.getNumberOfPixel - ~ImageFloat.getRows - ~ImageFloat.getSize - ~ImageFloat.getSum - ~ImageFloat.getValue - ~ImageFloat.getWidth - ~ImageFloat.halfSizeImage - ~ImageFloat.init - ~ImageFloat.insert - ~ImageFloat.numpy - ~ImageFloat.quarterSizeImage - ~ImageFloat.resize - ~ImageFloat.sub - ~ImageFloat.subsample - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~ImageFloat.__doc__ - ~ImageFloat.__eq__ - ~ImageFloat.__getitem__ - ~ImageFloat.__hash__ - ~ImageFloat.__init__ - ~ImageFloat.__module__ - ~ImageFloat.__ne__ - ~ImageFloat.__repr__ - ~ImageFloat.__sub__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.ImageGray.rst b/modules/python/doc/_autosummary/visp.core.ImageGray.rst deleted file mode 100644 index df042a3a80..0000000000 --- a/modules/python/doc/_autosummary/visp.core.ImageGray.rst +++ /dev/null @@ -1,76 +0,0 @@ -ImageGray -========= - -.. currentmodule:: visp.core - -.. autoclass:: ImageGray - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~ImageGray.destroy - ~ImageGray.doubleSizeImage - ~ImageGray.getCols - ~ImageGray.getHeight - ~ImageGray.getMaxValue - ~ImageGray.getMeanValue - ~ImageGray.getMinMaxValue - ~ImageGray.getMinValue - ~ImageGray.getNumberOfPixel - ~ImageGray.getRows - ~ImageGray.getSize - ~ImageGray.getSum - ~ImageGray.getValue - ~ImageGray.getWidth - ~ImageGray.halfSizeImage - ~ImageGray.init - ~ImageGray.insert - ~ImageGray.numpy - ~ImageGray.quarterSizeImage - ~ImageGray.resize - ~ImageGray.sub - ~ImageGray.subsample - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~ImageGray.__doc__ - ~ImageGray.__eq__ - ~ImageGray.__getitem__ - ~ImageGray.__hash__ - ~ImageGray.__init__ - ~ImageGray.__module__ - ~ImageGray.__ne__ - ~ImageGray.__repr__ - ~ImageGray.__sub__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.ImageMorphology.rst b/modules/python/doc/_autosummary/visp.core.ImageMorphology.rst deleted file mode 100644 index 5f19ed844c..0000000000 --- a/modules/python/doc/_autosummary/visp.core.ImageMorphology.rst +++ /dev/null @@ -1,55 +0,0 @@ -ImageMorphology -=============== - -.. currentmodule:: visp.core - -.. autoclass:: ImageMorphology - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~ImageMorphology.__doc__ - ~ImageMorphology.__init__ - ~ImageMorphology.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~ImageMorphology.CONNEXITY_4 - ~ImageMorphology.CONNEXITY_8 - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.ImagePoint.rst b/modules/python/doc/_autosummary/visp.core.ImagePoint.rst deleted file mode 100644 index a7da364786..0000000000 --- a/modules/python/doc/_autosummary/visp.core.ImagePoint.rst +++ /dev/null @@ -1,69 +0,0 @@ -ImagePoint -========== - -.. currentmodule:: visp.core - -.. autoclass:: ImagePoint - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~ImagePoint.distance - ~ImagePoint.getBBox - ~ImagePoint.get_i - ~ImagePoint.get_j - ~ImagePoint.get_u - ~ImagePoint.get_v - ~ImagePoint.inRectangle - ~ImagePoint.inSegment - ~ImagePoint.nextInSegment - ~ImagePoint.set_i - ~ImagePoint.set_ij - ~ImagePoint.set_j - ~ImagePoint.set_u - ~ImagePoint.set_uv - ~ImagePoint.set_v - ~ImagePoint.sqrDistance - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~ImagePoint.__doc__ - ~ImagePoint.__iadd__ - ~ImagePoint.__imul__ - ~ImagePoint.__init__ - ~ImagePoint.__isub__ - ~ImagePoint.__itruediv__ - ~ImagePoint.__module__ - ~ImagePoint.__repr__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.ImageRGBA.rst b/modules/python/doc/_autosummary/visp.core.ImageRGBA.rst deleted file mode 100644 index b0e24f398b..0000000000 --- a/modules/python/doc/_autosummary/visp.core.ImageRGBA.rst +++ /dev/null @@ -1,75 +0,0 @@ -ImageRGBA -========= - -.. currentmodule:: visp.core - -.. autoclass:: ImageRGBA - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~ImageRGBA.destroy - ~ImageRGBA.doubleSizeImage - ~ImageRGBA.getCols - ~ImageRGBA.getHeight - ~ImageRGBA.getMaxValue - ~ImageRGBA.getMeanValue - ~ImageRGBA.getMinMaxValue - ~ImageRGBA.getMinValue - ~ImageRGBA.getNumberOfPixel - ~ImageRGBA.getRows - ~ImageRGBA.getSize - ~ImageRGBA.getSum - ~ImageRGBA.getValue - ~ImageRGBA.getWidth - ~ImageRGBA.halfSizeImage - ~ImageRGBA.init - ~ImageRGBA.insert - ~ImageRGBA.numpy - ~ImageRGBA.quarterSizeImage - ~ImageRGBA.resize - ~ImageRGBA.sub - ~ImageRGBA.subsample - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~ImageRGBA.__doc__ - ~ImageRGBA.__eq__ - ~ImageRGBA.__hash__ - ~ImageRGBA.__init__ - ~ImageRGBA.__module__ - ~ImageRGBA.__ne__ - ~ImageRGBA.__repr__ - ~ImageRGBA.__sub__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.ImageRGBa.rst b/modules/python/doc/_autosummary/visp.core.ImageRGBa.rst deleted file mode 100644 index 3e81686afb..0000000000 --- a/modules/python/doc/_autosummary/visp.core.ImageRGBa.rst +++ /dev/null @@ -1,76 +0,0 @@ -ImageRGBa -========= - -.. currentmodule:: visp.core - -.. autoclass:: ImageRGBa - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~ImageRGBa.destroy - ~ImageRGBa.doubleSizeImage - ~ImageRGBa.getCols - ~ImageRGBa.getHeight - ~ImageRGBa.getMaxValue - ~ImageRGBa.getMeanValue - ~ImageRGBa.getMinMaxValue - ~ImageRGBa.getMinValue - ~ImageRGBa.getNumberOfPixel - ~ImageRGBa.getRows - ~ImageRGBa.getSize - ~ImageRGBa.getSum - ~ImageRGBa.getValue - ~ImageRGBa.getWidth - ~ImageRGBa.halfSizeImage - ~ImageRGBa.init - ~ImageRGBa.insert - ~ImageRGBa.numpy - ~ImageRGBa.quarterSizeImage - ~ImageRGBa.resize - ~ImageRGBa.sub - ~ImageRGBa.subsample - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~ImageRGBa.__doc__ - ~ImageRGBa.__eq__ - ~ImageRGBa.__getitem__ - ~ImageRGBa.__hash__ - ~ImageRGBa.__init__ - ~ImageRGBa.__module__ - ~ImageRGBa.__ne__ - ~ImageRGBa.__repr__ - ~ImageRGBa.__sub__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.ImageRGBf.rst b/modules/python/doc/_autosummary/visp.core.ImageRGBf.rst deleted file mode 100644 index 6aeb07cc71..0000000000 --- a/modules/python/doc/_autosummary/visp.core.ImageRGBf.rst +++ /dev/null @@ -1,76 +0,0 @@ -ImageRGBf -========= - -.. currentmodule:: visp.core - -.. autoclass:: ImageRGBf - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~ImageRGBf.destroy - ~ImageRGBf.doubleSizeImage - ~ImageRGBf.getCols - ~ImageRGBf.getHeight - ~ImageRGBf.getMaxValue - ~ImageRGBf.getMeanValue - ~ImageRGBf.getMinMaxValue - ~ImageRGBf.getMinValue - ~ImageRGBf.getNumberOfPixel - ~ImageRGBf.getRows - ~ImageRGBf.getSize - ~ImageRGBf.getSum - ~ImageRGBf.getValue - ~ImageRGBf.getWidth - ~ImageRGBf.halfSizeImage - ~ImageRGBf.init - ~ImageRGBf.insert - ~ImageRGBf.numpy - ~ImageRGBf.quarterSizeImage - ~ImageRGBf.resize - ~ImageRGBf.sub - ~ImageRGBf.subsample - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~ImageRGBf.__doc__ - ~ImageRGBf.__eq__ - ~ImageRGBf.__getitem__ - ~ImageRGBf.__hash__ - ~ImageRGBf.__init__ - ~ImageRGBf.__module__ - ~ImageRGBf.__ne__ - ~ImageRGBf.__repr__ - ~ImageRGBf.__sub__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.ImageTools.rst b/modules/python/doc/_autosummary/visp.core.ImageTools.rst deleted file mode 100644 index f501db1bbd..0000000000 --- a/modules/python/doc/_autosummary/visp.core.ImageTools.rst +++ /dev/null @@ -1,72 +0,0 @@ -ImageTools -========== - -.. currentmodule:: visp.core - -.. autoclass:: ImageTools - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~ImageTools.changeLUT - ~ImageTools.columnMean - ~ImageTools.extract - ~ImageTools.imageAdd - ~ImageTools.imageDifference - ~ImageTools.imageDifferenceAbsolute - ~ImageTools.imageSubtract - ~ImageTools.initUndistortMap - ~ImageTools.integralImage - ~ImageTools.interpolate - ~ImageTools.normalize - ~ImageTools.normalizedCorrelation - ~ImageTools.remap - ~ImageTools.templateMatching - ~ImageTools.warpImage - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~ImageTools.__doc__ - ~ImageTools.__init__ - ~ImageTools.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~ImageTools.INTERPOLATION_AREA - ~ImageTools.INTERPOLATION_CUBIC - ~ImageTools.INTERPOLATION_LINEAR - ~ImageTools.INTERPOLATION_NEAREST - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.ImageUInt16.rst b/modules/python/doc/_autosummary/visp.core.ImageUInt16.rst deleted file mode 100644 index 9c52a9b74b..0000000000 --- a/modules/python/doc/_autosummary/visp.core.ImageUInt16.rst +++ /dev/null @@ -1,76 +0,0 @@ -ImageUInt16 -=========== - -.. currentmodule:: visp.core - -.. autoclass:: ImageUInt16 - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~ImageUInt16.destroy - ~ImageUInt16.doubleSizeImage - ~ImageUInt16.getCols - ~ImageUInt16.getHeight - ~ImageUInt16.getMaxValue - ~ImageUInt16.getMeanValue - ~ImageUInt16.getMinMaxValue - ~ImageUInt16.getMinValue - ~ImageUInt16.getNumberOfPixel - ~ImageUInt16.getRows - ~ImageUInt16.getSize - ~ImageUInt16.getSum - ~ImageUInt16.getValue - ~ImageUInt16.getWidth - ~ImageUInt16.halfSizeImage - ~ImageUInt16.init - ~ImageUInt16.insert - ~ImageUInt16.numpy - ~ImageUInt16.quarterSizeImage - ~ImageUInt16.resize - ~ImageUInt16.sub - ~ImageUInt16.subsample - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~ImageUInt16.__doc__ - ~ImageUInt16.__eq__ - ~ImageUInt16.__getitem__ - ~ImageUInt16.__hash__ - ~ImageUInt16.__init__ - ~ImageUInt16.__module__ - ~ImageUInt16.__ne__ - ~ImageUInt16.__repr__ - ~ImageUInt16.__sub__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.IoTools.rst b/modules/python/doc/_autosummary/visp.core.IoTools.rst deleted file mode 100644 index 9eb06b35ff..0000000000 --- a/modules/python/doc/_autosummary/visp.core.IoTools.rst +++ /dev/null @@ -1,91 +0,0 @@ -IoTools -======= - -.. currentmodule:: visp.core - -.. autoclass:: IoTools - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~IoTools.addNameElement - ~IoTools.checkDirectory - ~IoTools.checkFifo - ~IoTools.checkFilename - ~IoTools.copy - ~IoTools.createBaseNamePath - ~IoTools.createFilePath - ~IoTools.getAbsolutePathname - ~IoTools.getBaseName - ~IoTools.getBuildInformation - ~IoTools.getDirFiles - ~IoTools.getFileExtension - ~IoTools.getFullName - ~IoTools.getIndex - ~IoTools.getName - ~IoTools.getNameWE - ~IoTools.getParent - ~IoTools.getTempPath - ~IoTools.getUserName - ~IoTools.getVersion - ~IoTools.getViSPImagesDataPath - ~IoTools.getenv - ~IoTools.isAbsolutePathname - ~IoTools.isSamePathname - ~IoTools.loadConfigFile - ~IoTools.makeDirectory - ~IoTools.makeFifo - ~IoTools.makeTempDirectory - ~IoTools.parseBoolean - ~IoTools.path - ~IoTools.readBinaryValueLE - ~IoTools.readConfigVar - ~IoTools.remove - ~IoTools.rename - ~IoTools.saveConfigFile - ~IoTools.setBaseDir - ~IoTools.setBaseName - ~IoTools.splitChain - ~IoTools.splitDrive - ~IoTools.toLowerCase - ~IoTools.toUpperCase - ~IoTools.trim - ~IoTools.writeBinaryValueLE - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~IoTools.__doc__ - ~IoTools.__init__ - ~IoTools.__module__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.KalmanFilter.rst b/modules/python/doc/_autosummary/visp.core.KalmanFilter.rst deleted file mode 100644 index a75f91b938..0000000000 --- a/modules/python/doc/_autosummary/visp.core.KalmanFilter.rst +++ /dev/null @@ -1,71 +0,0 @@ -KalmanFilter -============ - -.. currentmodule:: visp.core - -.. autoclass:: KalmanFilter - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~KalmanFilter.filtering - ~KalmanFilter.getIteration - ~KalmanFilter.getMeasureSize - ~KalmanFilter.getNumberOfSignal - ~KalmanFilter.getStateSize - ~KalmanFilter.init - ~KalmanFilter.prediction - ~KalmanFilter.setNumberOfSignal - ~KalmanFilter.verbose - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~KalmanFilter.__doc__ - ~KalmanFilter.__init__ - ~KalmanFilter.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~KalmanFilter.F - ~KalmanFilter.H - ~KalmanFilter.Pest - ~KalmanFilter.Ppre - ~KalmanFilter.Q - ~KalmanFilter.R - ~KalmanFilter.Xest - ~KalmanFilter.Xpre - ~KalmanFilter.dt - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.LinProg.rst b/modules/python/doc/_autosummary/visp.core.LinProg.rst deleted file mode 100644 index 8d0ac1951b..0000000000 --- a/modules/python/doc/_autosummary/visp.core.LinProg.rst +++ /dev/null @@ -1,56 +0,0 @@ -LinProg -======= - -.. currentmodule:: visp.core - -.. autoclass:: LinProg - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~LinProg.allClose - ~LinProg.allGreater - ~LinProg.allLesser - ~LinProg.allZero - ~LinProg.colReduction - ~LinProg.rowReduction - ~LinProg.simplex - ~LinProg.solveLP - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~LinProg.__doc__ - ~LinProg.__init__ - ~LinProg.__module__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.Line.rst b/modules/python/doc/_autosummary/visp.core.Line.rst deleted file mode 100644 index ac53dba8aa..0000000000 --- a/modules/python/doc/_autosummary/visp.core.Line.rst +++ /dev/null @@ -1,82 +0,0 @@ -Line -==== - -.. currentmodule:: visp.core - -.. autoclass:: Line - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~Line.changeFrame - ~Line.display - ~Line.getRho - ~Line.getTheta - ~Line.projection - ~Line.setRho - ~Line.setTheta - ~Line.setWorldCoordinates - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~Line.cPAvailable - ~Line.user - ~Line.track - ~Line.getDeallocate - ~Line.get_cP - ~Line.project - ~Line.ForwardProjectionDeallocatorType - ~Line.print - ~Line.get_p - ~Line.setDeallocate - ~Line.cP - ~Line.vpDisplayForwardProjection - ~Line.p - ~Line.get_oP - ~Line.oP - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~Line.__doc__ - ~Line.__init__ - ~Line.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~Line.cP - ~Line.cPAvailable - ~Line.oP - ~Line.p - ~Line.user - ~Line.vpDisplayForwardProjection - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.LinearKalmanFilterInstantiation.rst b/modules/python/doc/_autosummary/visp.core.LinearKalmanFilterInstantiation.rst deleted file mode 100644 index a6acca38d0..0000000000 --- a/modules/python/doc/_autosummary/visp.core.LinearKalmanFilterInstantiation.rst +++ /dev/null @@ -1,91 +0,0 @@ -LinearKalmanFilterInstantiation -=============================== - -.. currentmodule:: visp.core - -.. autoclass:: LinearKalmanFilterInstantiation - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~LinearKalmanFilterInstantiation.filter - ~LinearKalmanFilterInstantiation.getStateModel - ~LinearKalmanFilterInstantiation.initFilter - ~LinearKalmanFilterInstantiation.initStateConstAccWithColoredNoise_MeasureVel - ~LinearKalmanFilterInstantiation.initStateConstVelWithColoredNoise_MeasureVel - ~LinearKalmanFilterInstantiation.initStateConstVel_MeasurePos - ~LinearKalmanFilterInstantiation.setStateModel - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~LinearKalmanFilterInstantiation.getIteration - ~LinearKalmanFilterInstantiation.getStateSize - ~LinearKalmanFilterInstantiation.R - ~LinearKalmanFilterInstantiation.Xpre - ~LinearKalmanFilterInstantiation.dt - ~LinearKalmanFilterInstantiation.Q - ~LinearKalmanFilterInstantiation.Pest - ~LinearKalmanFilterInstantiation.Ppre - ~LinearKalmanFilterInstantiation.setNumberOfSignal - ~LinearKalmanFilterInstantiation.prediction - ~LinearKalmanFilterInstantiation.Xest - ~LinearKalmanFilterInstantiation.verbose - ~LinearKalmanFilterInstantiation.getNumberOfSignal - ~LinearKalmanFilterInstantiation.F - ~LinearKalmanFilterInstantiation.H - ~LinearKalmanFilterInstantiation.getMeasureSize - ~LinearKalmanFilterInstantiation.init - ~LinearKalmanFilterInstantiation.filtering - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~LinearKalmanFilterInstantiation.__doc__ - ~LinearKalmanFilterInstantiation.__init__ - ~LinearKalmanFilterInstantiation.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~LinearKalmanFilterInstantiation.F - ~LinearKalmanFilterInstantiation.H - ~LinearKalmanFilterInstantiation.Pest - ~LinearKalmanFilterInstantiation.Ppre - ~LinearKalmanFilterInstantiation.Q - ~LinearKalmanFilterInstantiation.R - ~LinearKalmanFilterInstantiation.Xest - ~LinearKalmanFilterInstantiation.Xpre - ~LinearKalmanFilterInstantiation.dt - ~LinearKalmanFilterInstantiation.stateConstAccWithColoredNoise_MeasureVel - ~LinearKalmanFilterInstantiation.stateConstVelWithColoredNoise_MeasureVel - ~LinearKalmanFilterInstantiation.stateConstVel_MeasurePos - ~LinearKalmanFilterInstantiation.unknown - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.Math.rst b/modules/python/doc/_autosummary/visp.core.Math.rst deleted file mode 100644 index 9c19b81de2..0000000000 --- a/modules/python/doc/_autosummary/visp.core.Math.rst +++ /dev/null @@ -1,77 +0,0 @@ -Math -==== - -.. currentmodule:: visp.core - -.. autoclass:: Math - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~Math.comb - ~Math.computeRegularPointsOnSphere - ~Math.deg - ~Math.enu2ecef - ~Math.enu2ned - ~Math.equal - ~Math.fact - ~Math.getAngleBetweenMinPiAndPi - ~Math.getMean - ~Math.getMedian - ~Math.getStdev - ~Math.greater - ~Math.isFinite - ~Math.isInf - ~Math.isNaN - ~Math.isNumber - ~Math.lineFitting - ~Math.lookAt - ~Math.mcosc - ~Math.modulo - ~Math.msinc - ~Math.ned2ecef - ~Math.nul - ~Math.rad - ~Math.round - ~Math.sigmoid - ~Math.sign - ~Math.sinc - ~Math.sqr - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~Math.__doc__ - ~Math.__init__ - ~Math.__module__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.Matrix.rst b/modules/python/doc/_autosummary/visp.core.Matrix.rst deleted file mode 100644 index b2c4883612..0000000000 --- a/modules/python/doc/_autosummary/visp.core.Matrix.rst +++ /dev/null @@ -1,157 +0,0 @@ -Matrix -====== - -.. currentmodule:: visp.core - -.. autoclass:: Matrix - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~Matrix.AAt - ~Matrix.AtA - ~Matrix.add2Matrices - ~Matrix.add2WeightedMatrices - ~Matrix.clear - ~Matrix.computeCovarianceMatrix - ~Matrix.computeCovarianceMatrixVVS - ~Matrix.computeHLM - ~Matrix.cond - ~Matrix.cppPrint - ~Matrix.createDiagonalMatrix - ~Matrix.csvPrint - ~Matrix.det - ~Matrix.detByLU - ~Matrix.detByLUEigen3 - ~Matrix.detByLULapack - ~Matrix.detByLUOpenCV - ~Matrix.diag - ~Matrix.eigenValues - ~Matrix.expm - ~Matrix.extract - ~Matrix.eye - ~Matrix.frobeniusNorm - ~Matrix.getCol - ~Matrix.getDiag - ~Matrix.getLapackMatrixMinSize - ~Matrix.getRow - ~Matrix.hadamard - ~Matrix.inducedL2Norm - ~Matrix.infinityNorm - ~Matrix.init - ~Matrix.insert - ~Matrix.insertMatrixInMatrix - ~Matrix.inverseByCholesky - ~Matrix.inverseByCholeskyLapack - ~Matrix.inverseByCholeskyOpenCV - ~Matrix.inverseByLU - ~Matrix.inverseByLUEigen3 - ~Matrix.inverseByLULapack - ~Matrix.inverseByLUOpenCV - ~Matrix.inverseByQR - ~Matrix.inverseByQRLapack - ~Matrix.inverseTriangular - ~Matrix.juxtaposeMatrices - ~Matrix.kernel - ~Matrix.kron - ~Matrix.kronStatic - ~Matrix.maplePrint - ~Matrix.matlabPrint - ~Matrix.mult2Matrices - ~Matrix.multMatrixVector - ~Matrix.negateMatrix - ~Matrix.nullSpace - ~Matrix.numpy - ~Matrix.print - ~Matrix.printSize - ~Matrix.pseudoInverse - ~Matrix.pseudoInverseEigen3 - ~Matrix.pseudoInverseLapack - ~Matrix.pseudoInverseOpenCV - ~Matrix.qr - ~Matrix.qrPivot - ~Matrix.saveMatrix - ~Matrix.saveMatrixYAML - ~Matrix.setLapackMatrixMinSize - ~Matrix.solveByQR - ~Matrix.solveBySVD - ~Matrix.stack - ~Matrix.stackColumn - ~Matrix.stackColumns - ~Matrix.stackMatrices - ~Matrix.stackRow - ~Matrix.stackRows - ~Matrix.sub2Matrices - ~Matrix.sum - ~Matrix.sumSquare - ~Matrix.svd - ~Matrix.svdEigen3 - ~Matrix.svdLapack - ~Matrix.svdOpenCV - ~Matrix.t - ~Matrix.transpose - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~Matrix.insertStatic - ~Matrix.getMaxValue - ~Matrix.save - ~Matrix.size - ~Matrix.getCols - ~Matrix.getMinValue - ~Matrix.reshape - ~Matrix.resize - ~Matrix.conv2 - ~Matrix.saveYAML - ~Matrix.getRows - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~Matrix.__add__ - ~Matrix.__doc__ - ~Matrix.__getitem__ - ~Matrix.__iadd__ - ~Matrix.__imul__ - ~Matrix.__init__ - ~Matrix.__isub__ - ~Matrix.__itruediv__ - ~Matrix.__module__ - ~Matrix.__mul__ - ~Matrix.__neg__ - ~Matrix.__sub__ - ~Matrix.__truediv__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~Matrix.LU_DECOMPOSITION - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.MeterPixelConversion.rst b/modules/python/doc/_autosummary/visp.core.MeterPixelConversion.rst deleted file mode 100644 index 61d694433c..0000000000 --- a/modules/python/doc/_autosummary/visp.core.MeterPixelConversion.rst +++ /dev/null @@ -1,52 +0,0 @@ -MeterPixelConversion -==================== - -.. currentmodule:: visp.core - -.. autoclass:: MeterPixelConversion - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~MeterPixelConversion.convertEllipse - ~MeterPixelConversion.convertLine - ~MeterPixelConversion.convertPoint - ~MeterPixelConversion.convertPoints - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~MeterPixelConversion.__doc__ - ~MeterPixelConversion.__init__ - ~MeterPixelConversion.__module__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.Moment.rst b/modules/python/doc/_autosummary/visp.core.Moment.rst deleted file mode 100644 index 72d19bea1a..0000000000 --- a/modules/python/doc/_autosummary/visp.core.Moment.rst +++ /dev/null @@ -1,54 +0,0 @@ -Moment -====== - -.. currentmodule:: visp.core - -.. autoclass:: Moment - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~Moment.get - ~Moment.getObject - ~Moment.linkTo - ~Moment.printDependencies - ~Moment.update - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~Moment.__doc__ - ~Moment.__init__ - ~Moment.__module__ - ~Moment.__repr__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.MomentAlpha.rst b/modules/python/doc/_autosummary/visp.core.MomentAlpha.rst deleted file mode 100644 index 8ad5baeeac..0000000000 --- a/modules/python/doc/_autosummary/visp.core.MomentAlpha.rst +++ /dev/null @@ -1,58 +0,0 @@ -MomentAlpha -=========== - -.. currentmodule:: visp.core - -.. autoclass:: MomentAlpha - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~MomentAlpha.compute - ~MomentAlpha.get - ~MomentAlpha.is_ref - ~MomentAlpha.is_symmetric - ~MomentAlpha.name - ~MomentAlpha.printDependencies - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~MomentAlpha.update - ~MomentAlpha.linkTo - ~MomentAlpha.getObject - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~MomentAlpha.__doc__ - ~MomentAlpha.__init__ - ~MomentAlpha.__module__ - ~MomentAlpha.__repr__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.MomentArea.rst b/modules/python/doc/_autosummary/visp.core.MomentArea.rst deleted file mode 100644 index 7f5b66463d..0000000000 --- a/modules/python/doc/_autosummary/visp.core.MomentArea.rst +++ /dev/null @@ -1,56 +0,0 @@ -MomentArea -========== - -.. currentmodule:: visp.core - -.. autoclass:: MomentArea - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~MomentArea.compute - ~MomentArea.name - ~MomentArea.printDependencies - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~MomentArea.update - ~MomentArea.linkTo - ~MomentArea.get - ~MomentArea.getObject - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~MomentArea.__doc__ - ~MomentArea.__init__ - ~MomentArea.__module__ - ~MomentArea.__repr__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.MomentAreaNormalized.rst b/modules/python/doc/_autosummary/visp.core.MomentAreaNormalized.rst deleted file mode 100644 index 5f3a851777..0000000000 --- a/modules/python/doc/_autosummary/visp.core.MomentAreaNormalized.rst +++ /dev/null @@ -1,60 +0,0 @@ -MomentAreaNormalized -==================== - -.. currentmodule:: visp.core - -.. autoclass:: MomentAreaNormalized - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~MomentAreaNormalized.compute - ~MomentAreaNormalized.getDesiredArea - ~MomentAreaNormalized.getDesiredDepth - ~MomentAreaNormalized.name - ~MomentAreaNormalized.printDependencies - ~MomentAreaNormalized.setDesiredArea - ~MomentAreaNormalized.setDesiredDepth - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~MomentAreaNormalized.update - ~MomentAreaNormalized.linkTo - ~MomentAreaNormalized.get - ~MomentAreaNormalized.getObject - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~MomentAreaNormalized.__doc__ - ~MomentAreaNormalized.__init__ - ~MomentAreaNormalized.__module__ - ~MomentAreaNormalized.__repr__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.MomentBasic.rst b/modules/python/doc/_autosummary/visp.core.MomentBasic.rst deleted file mode 100644 index 0042ea2a28..0000000000 --- a/modules/python/doc/_autosummary/visp.core.MomentBasic.rst +++ /dev/null @@ -1,56 +0,0 @@ -MomentBasic -=========== - -.. currentmodule:: visp.core - -.. autoclass:: MomentBasic - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~MomentBasic.compute - ~MomentBasic.get - ~MomentBasic.name - ~MomentBasic.printDependencies - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~MomentBasic.update - ~MomentBasic.linkTo - ~MomentBasic.getObject - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~MomentBasic.__doc__ - ~MomentBasic.__init__ - ~MomentBasic.__module__ - ~MomentBasic.__repr__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.MomentCInvariant.rst b/modules/python/doc/_autosummary/visp.core.MomentCInvariant.rst deleted file mode 100644 index 7018be8691..0000000000 --- a/modules/python/doc/_autosummary/visp.core.MomentCInvariant.rst +++ /dev/null @@ -1,82 +0,0 @@ -MomentCInvariant -================ - -.. currentmodule:: visp.core - -.. autoclass:: MomentCInvariant - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~MomentCInvariant.C1 - ~MomentCInvariant.C10 - ~MomentCInvariant.C2 - ~MomentCInvariant.C3 - ~MomentCInvariant.C4 - ~MomentCInvariant.C5 - ~MomentCInvariant.C6 - ~MomentCInvariant.C7 - ~MomentCInvariant.C8 - ~MomentCInvariant.C9 - ~MomentCInvariant.Px - ~MomentCInvariant.Py - ~MomentCInvariant.Sx - ~MomentCInvariant.Sy - ~MomentCInvariant.compute - ~MomentCInvariant.get - ~MomentCInvariant.getC - ~MomentCInvariant.getCN - ~MomentCInvariant.getI - ~MomentCInvariant.getII - ~MomentCInvariant.getIn1 - ~MomentCInvariant.getK - ~MomentCInvariant.getMomentVector - ~MomentCInvariant.getS - ~MomentCInvariant.getSN - ~MomentCInvariant.isSxSyfromNormalizedMoments - ~MomentCInvariant.name - ~MomentCInvariant.printI - ~MomentCInvariant.printInvariants - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~MomentCInvariant.update - ~MomentCInvariant.linkTo - ~MomentCInvariant.printDependencies - ~MomentCInvariant.getObject - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~MomentCInvariant.__doc__ - ~MomentCInvariant.__init__ - ~MomentCInvariant.__module__ - ~MomentCInvariant.__repr__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.MomentCentered.rst b/modules/python/doc/_autosummary/visp.core.MomentCentered.rst deleted file mode 100644 index 501658c49c..0000000000 --- a/modules/python/doc/_autosummary/visp.core.MomentCentered.rst +++ /dev/null @@ -1,57 +0,0 @@ -MomentCentered -============== - -.. currentmodule:: visp.core - -.. autoclass:: MomentCentered - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~MomentCentered.compute - ~MomentCentered.get - ~MomentCentered.name - ~MomentCentered.printDependencies - ~MomentCentered.printWithIndices - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~MomentCentered.update - ~MomentCentered.linkTo - ~MomentCentered.getObject - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~MomentCentered.__doc__ - ~MomentCentered.__init__ - ~MomentCentered.__module__ - ~MomentCentered.__repr__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.MomentCommon.rst b/modules/python/doc/_autosummary/visp.core.MomentCommon.rst deleted file mode 100644 index c20225bfe6..0000000000 --- a/modules/python/doc/_autosummary/visp.core.MomentCommon.rst +++ /dev/null @@ -1,54 +0,0 @@ -MomentCommon -============ - -.. currentmodule:: visp.core - -.. autoclass:: MomentCommon - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~MomentCommon.getAlpha - ~MomentCommon.getMu3 - ~MomentCommon.getSurface - ~MomentCommon.updateAll - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~MomentCommon.get - ~MomentCommon.get_first - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~MomentCommon.__doc__ - ~MomentCommon.__init__ - ~MomentCommon.__module__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.MomentDatabase.rst b/modules/python/doc/_autosummary/visp.core.MomentDatabase.rst deleted file mode 100644 index 1754853e73..0000000000 --- a/modules/python/doc/_autosummary/visp.core.MomentDatabase.rst +++ /dev/null @@ -1,52 +0,0 @@ -MomentDatabase -============== - -.. currentmodule:: visp.core - -.. autoclass:: MomentDatabase - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~MomentDatabase.get - ~MomentDatabase.get_first - ~MomentDatabase.updateAll - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~MomentDatabase.__doc__ - ~MomentDatabase.__init__ - ~MomentDatabase.__module__ - ~MomentDatabase.__repr__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.MomentGravityCenter.rst b/modules/python/doc/_autosummary/visp.core.MomentGravityCenter.rst deleted file mode 100644 index 38a180a958..0000000000 --- a/modules/python/doc/_autosummary/visp.core.MomentGravityCenter.rst +++ /dev/null @@ -1,58 +0,0 @@ -MomentGravityCenter -=================== - -.. currentmodule:: visp.core - -.. autoclass:: MomentGravityCenter - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~MomentGravityCenter.compute - ~MomentGravityCenter.get - ~MomentGravityCenter.getXg - ~MomentGravityCenter.getYg - ~MomentGravityCenter.name - ~MomentGravityCenter.printDependencies - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~MomentGravityCenter.update - ~MomentGravityCenter.linkTo - ~MomentGravityCenter.getObject - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~MomentGravityCenter.__doc__ - ~MomentGravityCenter.__init__ - ~MomentGravityCenter.__module__ - ~MomentGravityCenter.__repr__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.MomentGravityCenterNormalized.rst b/modules/python/doc/_autosummary/visp.core.MomentGravityCenterNormalized.rst deleted file mode 100644 index db65be838f..0000000000 --- a/modules/python/doc/_autosummary/visp.core.MomentGravityCenterNormalized.rst +++ /dev/null @@ -1,58 +0,0 @@ -MomentGravityCenterNormalized -============================= - -.. currentmodule:: visp.core - -.. autoclass:: MomentGravityCenterNormalized - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~MomentGravityCenterNormalized.compute - ~MomentGravityCenterNormalized.name - ~MomentGravityCenterNormalized.printDependencies - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~MomentGravityCenterNormalized.getXg - ~MomentGravityCenterNormalized.update - ~MomentGravityCenterNormalized.linkTo - ~MomentGravityCenterNormalized.getYg - ~MomentGravityCenterNormalized.get - ~MomentGravityCenterNormalized.getObject - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~MomentGravityCenterNormalized.__doc__ - ~MomentGravityCenterNormalized.__init__ - ~MomentGravityCenterNormalized.__module__ - ~MomentGravityCenterNormalized.__repr__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.MomentObject.rst b/modules/python/doc/_autosummary/visp.core.MomentObject.rst deleted file mode 100644 index 8dd949ccdb..0000000000 --- a/modules/python/doc/_autosummary/visp.core.MomentObject.rst +++ /dev/null @@ -1,69 +0,0 @@ -MomentObject -============ - -.. currentmodule:: visp.core - -.. autoclass:: MomentObject - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~MomentObject.convertTovpMatrix - ~MomentObject.fromImage - ~MomentObject.fromVector - ~MomentObject.get - ~MomentObject.getOrder - ~MomentObject.getType - ~MomentObject.init - ~MomentObject.printWithIndices - ~MomentObject.setType - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~MomentObject.__doc__ - ~MomentObject.__init__ - ~MomentObject.__module__ - ~MomentObject.__repr__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~MomentObject.BLACK - ~MomentObject.DENSE_FULL_OBJECT - ~MomentObject.DENSE_POLYGON - ~MomentObject.DISCRETE - ~MomentObject.WHITE - ~MomentObject.flg_normalize_intensity - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.MouseButton.rst b/modules/python/doc/_autosummary/visp.core.MouseButton.rst deleted file mode 100644 index cd33da700c..0000000000 --- a/modules/python/doc/_autosummary/visp.core.MouseButton.rst +++ /dev/null @@ -1,57 +0,0 @@ -MouseButton -=========== - -.. currentmodule:: visp.core - -.. autoclass:: MouseButton - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~MouseButton.__doc__ - ~MouseButton.__init__ - ~MouseButton.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~MouseButton.button1 - ~MouseButton.button2 - ~MouseButton.button3 - ~MouseButton.none - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.Munkres.rst b/modules/python/doc/_autosummary/visp.core.Munkres.rst deleted file mode 100644 index 9d4acf0221..0000000000 --- a/modules/python/doc/_autosummary/visp.core.Munkres.rst +++ /dev/null @@ -1,48 +0,0 @@ -Munkres -======= - -.. currentmodule:: visp.core - -.. autoclass:: Munkres - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~Munkres.__doc__ - ~Munkres.__init__ - ~Munkres.__module__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.Mutex.rst b/modules/python/doc/_autosummary/visp.core.Mutex.rst deleted file mode 100644 index a53d088516..0000000000 --- a/modules/python/doc/_autosummary/visp.core.Mutex.rst +++ /dev/null @@ -1,50 +0,0 @@ -Mutex -===== - -.. currentmodule:: visp.core - -.. autoclass:: Mutex - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~Mutex.lock - ~Mutex.unlock - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~Mutex.__doc__ - ~Mutex.__init__ - ~Mutex.__module__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.Network.rst b/modules/python/doc/_autosummary/visp.core.Network.rst deleted file mode 100644 index 895da04502..0000000000 --- a/modules/python/doc/_autosummary/visp.core.Network.rst +++ /dev/null @@ -1,69 +0,0 @@ -Network -======= - -.. currentmodule:: visp.core - -.. autoclass:: Network - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~Network.getMaxSizeReceivedMessage - ~Network.getReceptorIndex - ~Network.getRequestIdFromIndex - ~Network.print - ~Network.receiveAndDecodeRequest - ~Network.receiveAndDecodeRequestFrom - ~Network.receiveAndDecodeRequestOnce - ~Network.receiveAndDecodeRequestOnceFrom - ~Network.receiveRequest - ~Network.receiveRequestFrom - ~Network.receiveRequestOnce - ~Network.receiveRequestOnceFrom - ~Network.removeDecodingRequest - ~Network.sendAndEncodeRequest - ~Network.sendAndEncodeRequestTo - ~Network.sendRequest - ~Network.sendRequestTo - ~Network.setMaxSizeReceivedMessage - ~Network.setTimeoutSec - ~Network.setTimeoutUSec - ~Network.setVerbose - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~Network.__doc__ - ~Network.__init__ - ~Network.__module__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.PixelMeterConversion.rst b/modules/python/doc/_autosummary/visp.core.PixelMeterConversion.rst deleted file mode 100644 index e9547e7c25..0000000000 --- a/modules/python/doc/_autosummary/visp.core.PixelMeterConversion.rst +++ /dev/null @@ -1,53 +0,0 @@ -PixelMeterConversion -==================== - -.. currentmodule:: visp.core - -.. autoclass:: PixelMeterConversion - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~PixelMeterConversion.convertEllipse - ~PixelMeterConversion.convertLine - ~PixelMeterConversion.convertMoment - ~PixelMeterConversion.convertPoint - ~PixelMeterConversion.convertPoints - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~PixelMeterConversion.__doc__ - ~PixelMeterConversion.__init__ - ~PixelMeterConversion.__module__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.Plane.rst b/modules/python/doc/_autosummary/visp.core.Plane.rst deleted file mode 100644 index 773527022d..0000000000 --- a/modules/python/doc/_autosummary/visp.core.Plane.rst +++ /dev/null @@ -1,74 +0,0 @@ -Plane -===== - -.. currentmodule:: visp.core - -.. autoclass:: Plane - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~Plane.abcd - ~Plane.changeFrame - ~Plane.computeZ - ~Plane.getA - ~Plane.getABCD - ~Plane.getB - ~Plane.getC - ~Plane.getD - ~Plane.getIntersection - ~Plane.getNormal - ~Plane.init - ~Plane.projectionPointOnPlan - ~Plane.rayIntersection - ~Plane.setA - ~Plane.setABCD - ~Plane.setB - ~Plane.setC - ~Plane.setD - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~Plane.__doc__ - ~Plane.__init__ - ~Plane.__module__ - ~Plane.__repr__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~Plane.camera_frame - ~Plane.object_frame - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.Point.rst b/modules/python/doc/_autosummary/visp.core.Point.rst deleted file mode 100644 index d694520169..0000000000 --- a/modules/python/doc/_autosummary/visp.core.Point.rst +++ /dev/null @@ -1,102 +0,0 @@ -Point -===== - -.. currentmodule:: visp.core - -.. autoclass:: Point - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~Point.changeFrame - ~Point.display - ~Point.getWorldCoordinates - ~Point.get_W - ~Point.get_X - ~Point.get_Y - ~Point.get_Z - ~Point.get_oW - ~Point.get_oX - ~Point.get_oY - ~Point.get_oZ - ~Point.get_w - ~Point.get_x - ~Point.get_y - ~Point.projection - ~Point.setWorldCoordinates - ~Point.set_W - ~Point.set_X - ~Point.set_Y - ~Point.set_Z - ~Point.set_oW - ~Point.set_oX - ~Point.set_oY - ~Point.set_oZ - ~Point.set_w - ~Point.set_x - ~Point.set_y - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~Point.cPAvailable - ~Point.user - ~Point.track - ~Point.getDeallocate - ~Point.get_cP - ~Point.project - ~Point.ForwardProjectionDeallocatorType - ~Point.print - ~Point.get_p - ~Point.setDeallocate - ~Point.cP - ~Point.vpDisplayForwardProjection - ~Point.p - ~Point.get_oP - ~Point.oP - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~Point.__doc__ - ~Point.__init__ - ~Point.__module__ - ~Point.__repr__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~Point.cP - ~Point.cPAvailable - ~Point.oP - ~Point.p - ~Point.user - ~Point.vpDisplayForwardProjection - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.Polygon.rst b/modules/python/doc/_autosummary/visp.core.Polygon.rst deleted file mode 100644 index 671fbeab84..0000000000 --- a/modules/python/doc/_autosummary/visp.core.Polygon.rst +++ /dev/null @@ -1,65 +0,0 @@ -Polygon -======= - -.. currentmodule:: visp.core - -.. autoclass:: Polygon - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~Polygon.buildFrom - ~Polygon.display - ~Polygon.getArea - ~Polygon.getBoundingBox - ~Polygon.getCenter - ~Polygon.getCorners - ~Polygon.getSize - ~Polygon.initClick - ~Polygon.isInside - ~Polygon.isInsideFromPoints - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~Polygon.__doc__ - ~Polygon.__init__ - ~Polygon.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~Polygon.PnPolyRayCasting - ~Polygon.PnPolySegmentIntersection - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.Polygon3D.rst b/modules/python/doc/_autosummary/visp.core.Polygon3D.rst deleted file mode 100644 index e2c250c2bc..0000000000 --- a/modules/python/doc/_autosummary/visp.core.Polygon3D.rst +++ /dev/null @@ -1,89 +0,0 @@ -Polygon3D -========= - -.. currentmodule:: visp.core - -.. autoclass:: Polygon3D - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~Polygon3D.addPoint - ~Polygon3D.changeFrame - ~Polygon3D.computePolygonClipped - ~Polygon3D.getClippedPolygon - ~Polygon3D.getClipping - ~Polygon3D.getFarClippingDistance - ~Polygon3D.getMinMaxRoi - ~Polygon3D.getNbCornerInsideImage - ~Polygon3D.getNbCornerInsidePrevImage - ~Polygon3D.getNbPoint - ~Polygon3D.getNearClippingDistance - ~Polygon3D.getPoint - ~Polygon3D.getPolygonClipped - ~Polygon3D.getPolygonClippedWithInfo - ~Polygon3D.getRoi - ~Polygon3D.getRoiClipped - ~Polygon3D.roiInsideImage - ~Polygon3D.setClipping - ~Polygon3D.setFarClippingDistance - ~Polygon3D.setNbPoint - ~Polygon3D.setNearClippingDistance - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~Polygon3D.__doc__ - ~Polygon3D.__init__ - ~Polygon3D.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~Polygon3D.ALL_CLIPPING - ~Polygon3D.DOWN_CLIPPING - ~Polygon3D.FAR_CLIPPING - ~Polygon3D.FOV_CLIPPING - ~Polygon3D.LEFT_CLIPPING - ~Polygon3D.NEAR_CLIPPING - ~Polygon3D.NO_CLIPPING - ~Polygon3D.RIGHT_CLIPPING - ~Polygon3D.UP_CLIPPING - ~Polygon3D.clippingFlag - ~Polygon3D.distFarClip - ~Polygon3D.distNearClip - ~Polygon3D.nbCornersInsidePrev - ~Polygon3D.nbpt - ~Polygon3D.polyClipped - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.PoseVector.rst b/modules/python/doc/_autosummary/visp.core.PoseVector.rst deleted file mode 100644 index da0a7aec47..0000000000 --- a/modules/python/doc/_autosummary/visp.core.PoseVector.rst +++ /dev/null @@ -1,78 +0,0 @@ -PoseVector -========== - -.. currentmodule:: visp.core - -.. autoclass:: PoseVector - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~PoseVector.buildFrom - ~PoseVector.extract - ~PoseVector.getRotationMatrix - ~PoseVector.getThetaUVector - ~PoseVector.getTranslationVector - ~PoseVector.load - ~PoseVector.print - ~PoseVector.resize - ~PoseVector.save - ~PoseVector.set - ~PoseVector.t - ~PoseVector.toStdVector - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~PoseVector.insertStatic - ~PoseVector.getMaxValue - ~PoseVector.size - ~PoseVector.hadamard - ~PoseVector.insert - ~PoseVector.getCols - ~PoseVector.getMinValue - ~PoseVector.numpy - ~PoseVector.reshape - ~PoseVector.conv2 - ~PoseVector.saveYAML - ~PoseVector.getRows - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~PoseVector.__doc__ - ~PoseVector.__init__ - ~PoseVector.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~PoseVector.jsonTypeName - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.QuadProg.rst b/modules/python/doc/_autosummary/visp.core.QuadProg.rst deleted file mode 100644 index 00ad768e7a..0000000000 --- a/modules/python/doc/_autosummary/visp.core.QuadProg.rst +++ /dev/null @@ -1,55 +0,0 @@ -QuadProg -======== - -.. currentmodule:: visp.core - -.. autoclass:: QuadProg - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~QuadProg.fromCanonicalCost - ~QuadProg.resetActiveSet - ~QuadProg.setEqualityConstraint - ~QuadProg.solveQP - ~QuadProg.solveQPe - ~QuadProg.solveQPeStatic - ~QuadProg.solveQPi - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~QuadProg.__doc__ - ~QuadProg.__init__ - ~QuadProg.__module__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.QuaternionVector.rst b/modules/python/doc/_autosummary/visp.core.QuaternionVector.rst deleted file mode 100644 index bfe31396f7..0000000000 --- a/modules/python/doc/_autosummary/visp.core.QuaternionVector.rst +++ /dev/null @@ -1,84 +0,0 @@ -QuaternionVector -================ - -.. currentmodule:: visp.core - -.. autoclass:: QuaternionVector - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~QuaternionVector.buildFrom - ~QuaternionVector.conjugate - ~QuaternionVector.dot - ~QuaternionVector.inverse - ~QuaternionVector.lerp - ~QuaternionVector.magnitude - ~QuaternionVector.nlerp - ~QuaternionVector.normalize - ~QuaternionVector.set - ~QuaternionVector.slerp - ~QuaternionVector.w - ~QuaternionVector.x - ~QuaternionVector.y - ~QuaternionVector.z - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~QuaternionVector.insertStatic - ~QuaternionVector.getMaxValue - ~QuaternionVector.sumSquare - ~QuaternionVector.t - ~QuaternionVector.save - ~QuaternionVector.size - ~QuaternionVector.hadamard - ~QuaternionVector.insert - ~QuaternionVector.getCols - ~QuaternionVector.getMinValue - ~QuaternionVector.numpy - ~QuaternionVector.reshape - ~QuaternionVector.resize - ~QuaternionVector.conv2 - ~QuaternionVector.toStdVector - ~QuaternionVector.saveYAML - ~QuaternionVector.getRows - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~QuaternionVector.__add__ - ~QuaternionVector.__doc__ - ~QuaternionVector.__init__ - ~QuaternionVector.__module__ - ~QuaternionVector.__mul__ - ~QuaternionVector.__neg__ - ~QuaternionVector.__sub__ - ~QuaternionVector.__truediv__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.RGBa.rst b/modules/python/doc/_autosummary/visp.core.RGBa.rst deleted file mode 100644 index c43ef4470f..0000000000 --- a/modules/python/doc/_autosummary/visp.core.RGBa.rst +++ /dev/null @@ -1,67 +0,0 @@ -RGBa -==== - -.. currentmodule:: visp.core - -.. autoclass:: RGBa - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~RGBa.__add__ - ~RGBa.__doc__ - ~RGBa.__eq__ - ~RGBa.__gt__ - ~RGBa.__hash__ - ~RGBa.__init__ - ~RGBa.__lt__ - ~RGBa.__module__ - ~RGBa.__mul__ - ~RGBa.__ne__ - ~RGBa.__repr__ - ~RGBa.__sub__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~RGBa.A - ~RGBa.B - ~RGBa.G - ~RGBa.R - ~RGBa.alpha_default - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.RGBf.rst b/modules/python/doc/_autosummary/visp.core.RGBf.rst deleted file mode 100644 index 9799663a35..0000000000 --- a/modules/python/doc/_autosummary/visp.core.RGBf.rst +++ /dev/null @@ -1,65 +0,0 @@ -RGBf -==== - -.. currentmodule:: visp.core - -.. autoclass:: RGBf - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~RGBf.__add__ - ~RGBf.__doc__ - ~RGBf.__eq__ - ~RGBf.__gt__ - ~RGBf.__hash__ - ~RGBf.__init__ - ~RGBf.__lt__ - ~RGBf.__module__ - ~RGBf.__mul__ - ~RGBf.__ne__ - ~RGBf.__repr__ - ~RGBf.__sub__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~RGBf.B - ~RGBf.G - ~RGBf.R - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.Rect.rst b/modules/python/doc/_autosummary/visp.core.Rect.rst deleted file mode 100644 index 0d27a830a7..0000000000 --- a/modules/python/doc/_autosummary/visp.core.Rect.rst +++ /dev/null @@ -1,78 +0,0 @@ -Rect -==== - -.. currentmodule:: visp.core - -.. autoclass:: Rect - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~Rect.getArea - ~Rect.getBottom - ~Rect.getBottomLeft - ~Rect.getBottomRight - ~Rect.getCenter - ~Rect.getHeight - ~Rect.getLeft - ~Rect.getRight - ~Rect.getSize - ~Rect.getTop - ~Rect.getTopLeft - ~Rect.getTopRight - ~Rect.getWidth - ~Rect.isInside - ~Rect.moveCenter - ~Rect.set - ~Rect.setBottom - ~Rect.setBottomRight - ~Rect.setHeight - ~Rect.setLeft - ~Rect.setRect - ~Rect.setRight - ~Rect.setTop - ~Rect.setTopLeft - ~Rect.setWidth - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~Rect.__and__ - ~Rect.__doc__ - ~Rect.__eq__ - ~Rect.__hash__ - ~Rect.__init__ - ~Rect.__module__ - ~Rect.__ne__ - ~Rect.__repr__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.RectOriented.rst b/modules/python/doc/_autosummary/visp.core.RectOriented.rst deleted file mode 100644 index bfa8c2a631..0000000000 --- a/modules/python/doc/_autosummary/visp.core.RectOriented.rst +++ /dev/null @@ -1,61 +0,0 @@ -RectOriented -============ - -.. currentmodule:: visp.core - -.. autoclass:: RectOriented - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~RectOriented.getBottomLeft - ~RectOriented.getBottomRight - ~RectOriented.getCenter - ~RectOriented.getHeight - ~RectOriented.getOrientation - ~RectOriented.getTopLeft - ~RectOriented.getTopRight - ~RectOriented.getWidth - ~RectOriented.isInside - ~RectOriented.setCenter - ~RectOriented.setOrientation - ~RectOriented.setPoints - ~RectOriented.setSize - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~RectOriented.__doc__ - ~RectOriented.__init__ - ~RectOriented.__module__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.Request.rst b/modules/python/doc/_autosummary/visp.core.Request.rst deleted file mode 100644 index 04013603fe..0000000000 --- a/modules/python/doc/_autosummary/visp.core.Request.rst +++ /dev/null @@ -1,53 +0,0 @@ -Request -======= - -.. currentmodule:: visp.core - -.. autoclass:: Request - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~Request.addParameter - ~Request.clear - ~Request.getId - ~Request.setId - ~Request.size - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~Request.__doc__ - ~Request.__init__ - ~Request.__module__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.Robust.rst b/modules/python/doc/_autosummary/visp.core.Robust.rst deleted file mode 100644 index 07ad9a2a09..0000000000 --- a/modules/python/doc/_autosummary/visp.core.Robust.rst +++ /dev/null @@ -1,60 +0,0 @@ -Robust -====== - -.. currentmodule:: visp.core - -.. autoclass:: Robust - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~Robust.MEstimator - ~Robust.getMedianAbsoluteDeviation - ~Robust.getMinMedianAbsoluteDeviation - ~Robust.setMinMedianAbsoluteDeviation - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~Robust.__doc__ - ~Robust.__init__ - ~Robust.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~Robust.CAUCHY - ~Robust.HUBER - ~Robust.TUKEY - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.RotationMatrix.rst b/modules/python/doc/_autosummary/visp.core.RotationMatrix.rst deleted file mode 100644 index 0ec3b793f1..0000000000 --- a/modules/python/doc/_autosummary/visp.core.RotationMatrix.rst +++ /dev/null @@ -1,75 +0,0 @@ -RotationMatrix -============== - -.. currentmodule:: visp.core - -.. autoclass:: RotationMatrix - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~RotationMatrix.buildFrom - ~RotationMatrix.eye - ~RotationMatrix.getCol - ~RotationMatrix.getThetaUVector - ~RotationMatrix.inverse - ~RotationMatrix.isARotationMatrix - ~RotationMatrix.mean - ~RotationMatrix.numpy - ~RotationMatrix.orthogonalize - ~RotationMatrix.printVector - ~RotationMatrix.resize - ~RotationMatrix.t - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~RotationMatrix.insertStatic - ~RotationMatrix.getMaxValue - ~RotationMatrix.save - ~RotationMatrix.size - ~RotationMatrix.hadamard - ~RotationMatrix.insert - ~RotationMatrix.getCols - ~RotationMatrix.getMinValue - ~RotationMatrix.reshape - ~RotationMatrix.conv2 - ~RotationMatrix.saveYAML - ~RotationMatrix.getRows - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~RotationMatrix.__doc__ - ~RotationMatrix.__getitem__ - ~RotationMatrix.__imul__ - ~RotationMatrix.__init__ - ~RotationMatrix.__module__ - ~RotationMatrix.__mul__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.RotationVector.rst b/modules/python/doc/_autosummary/visp.core.RotationVector.rst deleted file mode 100644 index 10daa4c18a..0000000000 --- a/modules/python/doc/_autosummary/visp.core.RotationVector.rst +++ /dev/null @@ -1,66 +0,0 @@ -RotationVector -============== - -.. currentmodule:: visp.core - -.. autoclass:: RotationVector - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~RotationVector.sumSquare - ~RotationVector.t - ~RotationVector.toStdVector - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~RotationVector.insertStatic - ~RotationVector.getMaxValue - ~RotationVector.save - ~RotationVector.size - ~RotationVector.hadamard - ~RotationVector.insert - ~RotationVector.getCols - ~RotationVector.getMinValue - ~RotationVector.numpy - ~RotationVector.reshape - ~RotationVector.resize - ~RotationVector.conv2 - ~RotationVector.saveYAML - ~RotationVector.getRows - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~RotationVector.__doc__ - ~RotationVector.__init__ - ~RotationVector.__module__ - ~RotationVector.__mul__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.RowVector.rst b/modules/python/doc/_autosummary/visp.core.RowVector.rst deleted file mode 100644 index ee48f9910a..0000000000 --- a/modules/python/doc/_autosummary/visp.core.RowVector.rst +++ /dev/null @@ -1,97 +0,0 @@ -RowVector -========= - -.. currentmodule:: visp.core - -.. autoclass:: RowVector - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~RowVector.clear - ~RowVector.cppPrint - ~RowVector.csvPrint - ~RowVector.deg2rad - ~RowVector.extract - ~RowVector.frobeniusNorm - ~RowVector.init - ~RowVector.insert - ~RowVector.maplePrint - ~RowVector.matlabPrint - ~RowVector.mean - ~RowVector.median - ~RowVector.normalize - ~RowVector.numpy - ~RowVector.print - ~RowVector.rad2deg - ~RowVector.reshape - ~RowVector.resize - ~RowVector.stack - ~RowVector.stackVectors - ~RowVector.stdev - ~RowVector.sum - ~RowVector.sumSquare - ~RowVector.t - ~RowVector.toStdVector - ~RowVector.transpose - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~RowVector.insertStatic - ~RowVector.getMaxValue - ~RowVector.save - ~RowVector.size - ~RowVector.hadamard - ~RowVector.getCols - ~RowVector.getMinValue - ~RowVector.conv2 - ~RowVector.saveYAML - ~RowVector.getRows - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~RowVector.__add__ - ~RowVector.__doc__ - ~RowVector.__eq__ - ~RowVector.__getitem__ - ~RowVector.__hash__ - ~RowVector.__iadd__ - ~RowVector.__imul__ - ~RowVector.__init__ - ~RowVector.__isub__ - ~RowVector.__itruediv__ - ~RowVector.__module__ - ~RowVector.__mul__ - ~RowVector.__ne__ - ~RowVector.__neg__ - ~RowVector.__sub__ - ~RowVector.__truediv__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.RxyzVector.rst b/modules/python/doc/_autosummary/visp.core.RxyzVector.rst deleted file mode 100644 index 68735a0c51..0000000000 --- a/modules/python/doc/_autosummary/visp.core.RxyzVector.rst +++ /dev/null @@ -1,66 +0,0 @@ -RxyzVector -========== - -.. currentmodule:: visp.core - -.. autoclass:: RxyzVector - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~RxyzVector.buildFrom - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~RxyzVector.insertStatic - ~RxyzVector.getMaxValue - ~RxyzVector.sumSquare - ~RxyzVector.t - ~RxyzVector.save - ~RxyzVector.size - ~RxyzVector.hadamard - ~RxyzVector.insert - ~RxyzVector.getCols - ~RxyzVector.getMinValue - ~RxyzVector.numpy - ~RxyzVector.reshape - ~RxyzVector.resize - ~RxyzVector.conv2 - ~RxyzVector.toStdVector - ~RxyzVector.saveYAML - ~RxyzVector.getRows - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~RxyzVector.__doc__ - ~RxyzVector.__init__ - ~RxyzVector.__module__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.RzyxVector.rst b/modules/python/doc/_autosummary/visp.core.RzyxVector.rst deleted file mode 100644 index e38d68f3ed..0000000000 --- a/modules/python/doc/_autosummary/visp.core.RzyxVector.rst +++ /dev/null @@ -1,66 +0,0 @@ -RzyxVector -========== - -.. currentmodule:: visp.core - -.. autoclass:: RzyxVector - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~RzyxVector.buildFrom - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~RzyxVector.insertStatic - ~RzyxVector.getMaxValue - ~RzyxVector.sumSquare - ~RzyxVector.t - ~RzyxVector.save - ~RzyxVector.size - ~RzyxVector.hadamard - ~RzyxVector.insert - ~RzyxVector.getCols - ~RzyxVector.getMinValue - ~RzyxVector.numpy - ~RzyxVector.reshape - ~RzyxVector.resize - ~RzyxVector.conv2 - ~RzyxVector.toStdVector - ~RzyxVector.saveYAML - ~RzyxVector.getRows - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~RzyxVector.__doc__ - ~RzyxVector.__init__ - ~RzyxVector.__module__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.RzyzVector.rst b/modules/python/doc/_autosummary/visp.core.RzyzVector.rst deleted file mode 100644 index b325714cb8..0000000000 --- a/modules/python/doc/_autosummary/visp.core.RzyzVector.rst +++ /dev/null @@ -1,66 +0,0 @@ -RzyzVector -========== - -.. currentmodule:: visp.core - -.. autoclass:: RzyzVector - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~RzyzVector.buildFrom - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~RzyzVector.insertStatic - ~RzyzVector.getMaxValue - ~RzyzVector.sumSquare - ~RzyzVector.t - ~RzyzVector.save - ~RzyzVector.size - ~RzyzVector.hadamard - ~RzyzVector.insert - ~RzyzVector.getCols - ~RzyzVector.getMinValue - ~RzyzVector.numpy - ~RzyzVector.reshape - ~RzyzVector.resize - ~RzyzVector.conv2 - ~RzyzVector.toStdVector - ~RzyzVector.saveYAML - ~RzyzVector.getRows - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~RzyzVector.__doc__ - ~RzyzVector.__init__ - ~RzyzVector.__module__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.Scale.rst b/modules/python/doc/_autosummary/visp.core.Scale.rst deleted file mode 100644 index 35fbdb0bba..0000000000 --- a/modules/python/doc/_autosummary/visp.core.Scale.rst +++ /dev/null @@ -1,53 +0,0 @@ -Scale -===== - -.. currentmodule:: visp.core - -.. autoclass:: Scale - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~Scale.KernelDensity - ~Scale.KernelDensityGradient - ~Scale.KernelDensityGradient_EPANECHNIKOV - ~Scale.KernelDensity_EPANECHNIKOV - ~Scale.MeanShift - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~Scale.__doc__ - ~Scale.__init__ - ~Scale.__module__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.Serial.rst b/modules/python/doc/_autosummary/visp.core.Serial.rst deleted file mode 100644 index 80861ad766..0000000000 --- a/modules/python/doc/_autosummary/visp.core.Serial.rst +++ /dev/null @@ -1,82 +0,0 @@ -Serial -====== - -.. currentmodule:: visp.core - -.. autoclass:: Serial - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~Serial.available - ~Serial.close - ~Serial.getBaudrate - ~Serial.getBytesize - ~Serial.getFlowcontrol - ~Serial.getParity - ~Serial.getPort - ~Serial.getStopbits - ~Serial.open - ~Serial.readline - ~Serial.setBaudrate - ~Serial.setBytesize - ~Serial.setFlowcontrol - ~Serial.setParity - ~Serial.setPort - ~Serial.setStopbits - ~Serial.write - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~Serial.__doc__ - ~Serial.__init__ - ~Serial.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~Serial.eightbits - ~Serial.fivebits - ~Serial.flowcontrol_hardware - ~Serial.flowcontrol_none - ~Serial.flowcontrol_software - ~Serial.parity_even - ~Serial.parity_none - ~Serial.parity_odd - ~Serial.sevenbits - ~Serial.sixbits - ~Serial.stopbits_one - ~Serial.stopbits_two - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.Server.rst b/modules/python/doc/_autosummary/visp.core.Server.rst deleted file mode 100644 index fe0cea8531..0000000000 --- a/modules/python/doc/_autosummary/visp.core.Server.rst +++ /dev/null @@ -1,75 +0,0 @@ -Server -====== - -.. currentmodule:: visp.core - -.. autoclass:: Server - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~Server.checkForConnections - ~Server.getMaxNumberOfClients - ~Server.getNumberOfClients - ~Server.isStarted - ~Server.print - ~Server.setMaxNumberOfClients - ~Server.start - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~Server.removeDecodingRequest - ~Server.setMaxSizeReceivedMessage - ~Server.receiveRequestFrom - ~Server.receiveAndDecodeRequestFrom - ~Server.setTimeoutUSec - ~Server.getRequestIdFromIndex - ~Server.receiveRequest - ~Server.setVerbose - ~Server.sendRequestTo - ~Server.receiveAndDecodeRequestOnce - ~Server.receiveRequestOnceFrom - ~Server.sendRequest - ~Server.getReceptorIndex - ~Server.setTimeoutSec - ~Server.getMaxSizeReceivedMessage - ~Server.sendAndEncodeRequest - ~Server.receiveAndDecodeRequest - ~Server.receiveRequestOnce - ~Server.sendAndEncodeRequestTo - ~Server.receiveAndDecodeRequestOnceFrom - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~Server.__doc__ - ~Server.__init__ - ~Server.__module__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.Sphere.rst b/modules/python/doc/_autosummary/visp.core.Sphere.rst deleted file mode 100644 index 3652186176..0000000000 --- a/modules/python/doc/_autosummary/visp.core.Sphere.rst +++ /dev/null @@ -1,87 +0,0 @@ -Sphere -====== - -.. currentmodule:: visp.core - -.. autoclass:: Sphere - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~Sphere.changeFrame - ~Sphere.display - ~Sphere.getR - ~Sphere.getX - ~Sphere.getY - ~Sphere.getZ - ~Sphere.get_n02 - ~Sphere.get_n11 - ~Sphere.get_n20 - ~Sphere.get_x - ~Sphere.get_y - ~Sphere.projection - ~Sphere.setWorldCoordinates - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~Sphere.cPAvailable - ~Sphere.user - ~Sphere.track - ~Sphere.getDeallocate - ~Sphere.get_cP - ~Sphere.project - ~Sphere.ForwardProjectionDeallocatorType - ~Sphere.print - ~Sphere.get_p - ~Sphere.setDeallocate - ~Sphere.cP - ~Sphere.vpDisplayForwardProjection - ~Sphere.p - ~Sphere.get_oP - ~Sphere.oP - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~Sphere.__doc__ - ~Sphere.__init__ - ~Sphere.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~Sphere.cP - ~Sphere.cPAvailable - ~Sphere.oP - ~Sphere.p - ~Sphere.user - ~Sphere.vpDisplayForwardProjection - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.SubColVector.rst b/modules/python/doc/_autosummary/visp.core.SubColVector.rst deleted file mode 100644 index 4a36629e62..0000000000 --- a/modules/python/doc/_autosummary/visp.core.SubColVector.rst +++ /dev/null @@ -1,92 +0,0 @@ -SubColVector -============ - -.. currentmodule:: visp.core - -.. autoclass:: SubColVector - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~SubColVector.checkParentStatus - ~SubColVector.init - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~SubColVector.insertStatic - ~SubColVector.median - ~SubColVector.invSort - ~SubColVector.matlabPrint - ~SubColVector.sumSquare - ~SubColVector.transpose - ~SubColVector.t - ~SubColVector.deg2rad - ~SubColVector.size - ~SubColVector.rad2deg - ~SubColVector.insert - ~SubColVector.getCols - ~SubColVector.getMinValue - ~SubColVector.reshape - ~SubColVector.resize - ~SubColVector.toStdVector - ~SubColVector.crossProd - ~SubColVector.sort - ~SubColVector.skew - ~SubColVector.print - ~SubColVector.getRows - ~SubColVector.cppPrint - ~SubColVector.dotProd - ~SubColVector.stackVectors - ~SubColVector.getMaxValue - ~SubColVector.infinityNorm - ~SubColVector.frobeniusNorm - ~SubColVector.maplePrint - ~SubColVector.mean - ~SubColVector.cross - ~SubColVector.stdev - ~SubColVector.save - ~SubColVector.clear - ~SubColVector.hadamard - ~SubColVector.csvPrint - ~SubColVector.stack - ~SubColVector.numpy - ~SubColVector.conv2 - ~SubColVector.normalize - ~SubColVector.saveYAML - ~SubColVector.sum - ~SubColVector.extract - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~SubColVector.__doc__ - ~SubColVector.__init__ - ~SubColVector.__module__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.SubMatrix.rst b/modules/python/doc/_autosummary/visp.core.SubMatrix.rst deleted file mode 100644 index bea7c44ed1..0000000000 --- a/modules/python/doc/_autosummary/visp.core.SubMatrix.rst +++ /dev/null @@ -1,150 +0,0 @@ -SubMatrix -========= - -.. currentmodule:: visp.core - -.. autoclass:: SubMatrix - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~SubMatrix.checkParentStatus - ~SubMatrix.init - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~SubMatrix.det - ~SubMatrix.inverseByCholesky - ~SubMatrix.detByLUOpenCV - ~SubMatrix.matlabPrint - ~SubMatrix.sumSquare - ~SubMatrix.detByLU - ~SubMatrix.printSize - ~SubMatrix.t - ~SubMatrix.insertMatrixInMatrix - ~SubMatrix.pseudoInverseOpenCV - ~SubMatrix.getRow - ~SubMatrix.inducedL2Norm - ~SubMatrix.cond - ~SubMatrix.eye - ~SubMatrix.juxtaposeMatrices - ~SubMatrix.pseudoInverseEigen3 - ~SubMatrix.getCols - ~SubMatrix.getMinValue - ~SubMatrix.inverseTriangular - ~SubMatrix.multMatrixVector - ~SubMatrix.getCol - ~SubMatrix.resize - ~SubMatrix.inverseByCholeskyOpenCV - ~SubMatrix.getRows - ~SubMatrix.cppPrint - ~SubMatrix.stackMatrices - ~SubMatrix.computeCovarianceMatrix - ~SubMatrix.getMaxValue - ~SubMatrix.inverseByLUEigen3 - ~SubMatrix.frobeniusNorm - ~SubMatrix.maplePrint - ~SubMatrix.AAt - ~SubMatrix.clear - ~SubMatrix.sub2Matrices - ~SubMatrix.stack - ~SubMatrix.stackColumn - ~SubMatrix.qrPivot - ~SubMatrix.inverseByCholeskyLapack - ~SubMatrix.conv2 - ~SubMatrix.getDiag - ~SubMatrix.DetMethod - ~SubMatrix.stackRow - ~SubMatrix.negateMatrix - ~SubMatrix.stackColumns - ~SubMatrix.sum - ~SubMatrix.extract - ~SubMatrix.add2Matrices - ~SubMatrix.kronStatic - ~SubMatrix.insertStatic - ~SubMatrix.svdLapack - ~SubMatrix.qr - ~SubMatrix.AtA - ~SubMatrix.getLapackMatrixMinSize - ~SubMatrix.transpose - ~SubMatrix.setLapackMatrixMinSize - ~SubMatrix.inverseByLUOpenCV - ~SubMatrix.size - ~SubMatrix.inverseByLU - ~SubMatrix.insert - ~SubMatrix.inverseByQR - ~SubMatrix.kron - ~SubMatrix.solveByQR - ~SubMatrix.kernel - ~SubMatrix.reshape - ~SubMatrix.saveMatrixYAML - ~SubMatrix.print - ~SubMatrix.svd - ~SubMatrix.solveBySVD - ~SubMatrix.pseudoInverseLapack - ~SubMatrix.expm - ~SubMatrix.computeHLM - ~SubMatrix.pseudoInverse - ~SubMatrix.add2WeightedMatrices - ~SubMatrix.infinityNorm - ~SubMatrix.detByLULapack - ~SubMatrix.detByLUEigen3 - ~SubMatrix.saveMatrix - ~SubMatrix.LU_DECOMPOSITION - ~SubMatrix.nullSpace - ~SubMatrix.stackRows - ~SubMatrix.save - ~SubMatrix.svdOpenCV - ~SubMatrix.mult2Matrices - ~SubMatrix.hadamard - ~SubMatrix.csvPrint - ~SubMatrix.diag - ~SubMatrix.numpy - ~SubMatrix.svdEigen3 - ~SubMatrix.saveYAML - ~SubMatrix.eigenValues - ~SubMatrix.inverseByQRLapack - ~SubMatrix.inverseByLULapack - ~SubMatrix.computeCovarianceMatrixVVS - ~SubMatrix.createDiagonalMatrix - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~SubMatrix.__doc__ - ~SubMatrix.__init__ - ~SubMatrix.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~SubMatrix.LU_DECOMPOSITION - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.SubRowVector.rst b/modules/python/doc/_autosummary/visp.core.SubRowVector.rst deleted file mode 100644 index 22e15c9509..0000000000 --- a/modules/python/doc/_autosummary/visp.core.SubRowVector.rst +++ /dev/null @@ -1,85 +0,0 @@ -SubRowVector -============ - -.. currentmodule:: visp.core - -.. autoclass:: SubRowVector - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~SubRowVector.checkParentStatus - ~SubRowVector.init - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~SubRowVector.insertStatic - ~SubRowVector.median - ~SubRowVector.matlabPrint - ~SubRowVector.sumSquare - ~SubRowVector.transpose - ~SubRowVector.t - ~SubRowVector.deg2rad - ~SubRowVector.size - ~SubRowVector.rad2deg - ~SubRowVector.insert - ~SubRowVector.getCols - ~SubRowVector.getMinValue - ~SubRowVector.reshape - ~SubRowVector.resize - ~SubRowVector.toStdVector - ~SubRowVector.print - ~SubRowVector.getRows - ~SubRowVector.cppPrint - ~SubRowVector.stackVectors - ~SubRowVector.getMaxValue - ~SubRowVector.frobeniusNorm - ~SubRowVector.maplePrint - ~SubRowVector.mean - ~SubRowVector.stdev - ~SubRowVector.save - ~SubRowVector.clear - ~SubRowVector.hadamard - ~SubRowVector.csvPrint - ~SubRowVector.stack - ~SubRowVector.numpy - ~SubRowVector.conv2 - ~SubRowVector.normalize - ~SubRowVector.saveYAML - ~SubRowVector.sum - ~SubRowVector.extract - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~SubRowVector.__doc__ - ~SubRowVector.__init__ - ~SubRowVector.__module__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.ThetaUVector.rst b/modules/python/doc/_autosummary/visp.core.ThetaUVector.rst deleted file mode 100644 index 990c8cec8b..0000000000 --- a/modules/python/doc/_autosummary/visp.core.ThetaUVector.rst +++ /dev/null @@ -1,70 +0,0 @@ -ThetaUVector -============ - -.. currentmodule:: visp.core - -.. autoclass:: ThetaUVector - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~ThetaUVector.buildFrom - ~ThetaUVector.extract - ~ThetaUVector.getTheta - ~ThetaUVector.getU - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~ThetaUVector.insertStatic - ~ThetaUVector.getMaxValue - ~ThetaUVector.sumSquare - ~ThetaUVector.t - ~ThetaUVector.save - ~ThetaUVector.size - ~ThetaUVector.hadamard - ~ThetaUVector.insert - ~ThetaUVector.getCols - ~ThetaUVector.getMinValue - ~ThetaUVector.numpy - ~ThetaUVector.reshape - ~ThetaUVector.resize - ~ThetaUVector.conv2 - ~ThetaUVector.toStdVector - ~ThetaUVector.saveYAML - ~ThetaUVector.getRows - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~ThetaUVector.__doc__ - ~ThetaUVector.__init__ - ~ThetaUVector.__module__ - ~ThetaUVector.__mul__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.Thread.rst b/modules/python/doc/_autosummary/visp.core.Thread.rst deleted file mode 100644 index 911b75b46f..0000000000 --- a/modules/python/doc/_autosummary/visp.core.Thread.rst +++ /dev/null @@ -1,52 +0,0 @@ -Thread -====== - -.. currentmodule:: visp.core - -.. autoclass:: Thread - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~Thread.create - ~Thread.getHandle - ~Thread.join - ~Thread.joinable - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~Thread.__doc__ - ~Thread.__init__ - ~Thread.__module__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.Tracker.rst b/modules/python/doc/_autosummary/visp.core.Tracker.rst deleted file mode 100644 index 2de9d9d4dd..0000000000 --- a/modules/python/doc/_autosummary/visp.core.Tracker.rst +++ /dev/null @@ -1,58 +0,0 @@ -Tracker -======= - -.. currentmodule:: visp.core - -.. autoclass:: Tracker - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~Tracker.get_cP - ~Tracker.get_p - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~Tracker.__doc__ - ~Tracker.__init__ - ~Tracker.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~Tracker.cP - ~Tracker.cPAvailable - ~Tracker.p - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.TranslationVector.rst b/modules/python/doc/_autosummary/visp.core.TranslationVector.rst deleted file mode 100644 index e972d43038..0000000000 --- a/modules/python/doc/_autosummary/visp.core.TranslationVector.rst +++ /dev/null @@ -1,79 +0,0 @@ -TranslationVector -================= - -.. currentmodule:: visp.core - -.. autoclass:: TranslationVector - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~TranslationVector.buildFrom - ~TranslationVector.cross - ~TranslationVector.frobeniusNorm - ~TranslationVector.mean - ~TranslationVector.numpy - ~TranslationVector.resize - ~TranslationVector.set - ~TranslationVector.skew - ~TranslationVector.skewOf - ~TranslationVector.sumSquare - ~TranslationVector.t - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~TranslationVector.insertStatic - ~TranslationVector.getMaxValue - ~TranslationVector.save - ~TranslationVector.size - ~TranslationVector.hadamard - ~TranslationVector.insert - ~TranslationVector.getCols - ~TranslationVector.getMinValue - ~TranslationVector.reshape - ~TranslationVector.conv2 - ~TranslationVector.saveYAML - ~TranslationVector.getRows - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~TranslationVector.__add__ - ~TranslationVector.__doc__ - ~TranslationVector.__getitem__ - ~TranslationVector.__imul__ - ~TranslationVector.__init__ - ~TranslationVector.__itruediv__ - ~TranslationVector.__module__ - ~TranslationVector.__mul__ - ~TranslationVector.__neg__ - ~TranslationVector.__sub__ - ~TranslationVector.__truediv__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.Triangle.rst b/modules/python/doc/_autosummary/visp.core.Triangle.rst deleted file mode 100644 index 9cedf40026..0000000000 --- a/modules/python/doc/_autosummary/visp.core.Triangle.rst +++ /dev/null @@ -1,52 +0,0 @@ -Triangle -======== - -.. currentmodule:: visp.core - -.. autoclass:: Triangle - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~Triangle.buildFrom - ~Triangle.getArea - ~Triangle.getTriangleApexes - ~Triangle.inTriangle - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~Triangle.__doc__ - ~Triangle.__init__ - ~Triangle.__module__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.UDPClient.rst b/modules/python/doc/_autosummary/visp.core.UDPClient.rst deleted file mode 100644 index babb16104a..0000000000 --- a/modules/python/doc/_autosummary/visp.core.UDPClient.rst +++ /dev/null @@ -1,51 +0,0 @@ -UDPClient -========= - -.. currentmodule:: visp.core - -.. autoclass:: UDPClient - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~UDPClient.init - ~UDPClient.receive - ~UDPClient.send - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~UDPClient.__doc__ - ~UDPClient.__init__ - ~UDPClient.__module__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.UDPServer.rst b/modules/python/doc/_autosummary/visp.core.UDPServer.rst deleted file mode 100644 index 44f9989bd0..0000000000 --- a/modules/python/doc/_autosummary/visp.core.UDPServer.rst +++ /dev/null @@ -1,50 +0,0 @@ -UDPServer -========= - -.. currentmodule:: visp.core - -.. autoclass:: UDPServer - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~UDPServer.receive - ~UDPServer.send - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~UDPServer.__doc__ - ~UDPServer.__init__ - ~UDPServer.__module__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.UniRand.rst b/modules/python/doc/_autosummary/visp.core.UniRand.rst deleted file mode 100644 index a0e6ac6d9c..0000000000 --- a/modules/python/doc/_autosummary/visp.core.UniRand.rst +++ /dev/null @@ -1,51 +0,0 @@ -UniRand -======= - -.. currentmodule:: visp.core - -.. autoclass:: UniRand - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~UniRand.next - ~UniRand.setSeed - ~UniRand.uniform - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~UniRand.__doc__ - ~UniRand.__init__ - ~UniRand.__module__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.VelocityTwistMatrix.rst b/modules/python/doc/_autosummary/visp.core.VelocityTwistMatrix.rst deleted file mode 100644 index 7e9634d9be..0000000000 --- a/modules/python/doc/_autosummary/visp.core.VelocityTwistMatrix.rst +++ /dev/null @@ -1,69 +0,0 @@ -VelocityTwistMatrix -=================== - -.. currentmodule:: visp.core - -.. autoclass:: VelocityTwistMatrix - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~VelocityTwistMatrix.buildFrom - ~VelocityTwistMatrix.extract - ~VelocityTwistMatrix.eye - ~VelocityTwistMatrix.inverse - ~VelocityTwistMatrix.print - ~VelocityTwistMatrix.resize - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~VelocityTwistMatrix.insertStatic - ~VelocityTwistMatrix.getMaxValue - ~VelocityTwistMatrix.t - ~VelocityTwistMatrix.save - ~VelocityTwistMatrix.size - ~VelocityTwistMatrix.hadamard - ~VelocityTwistMatrix.insert - ~VelocityTwistMatrix.getCols - ~VelocityTwistMatrix.getMinValue - ~VelocityTwistMatrix.numpy - ~VelocityTwistMatrix.reshape - ~VelocityTwistMatrix.conv2 - ~VelocityTwistMatrix.saveYAML - ~VelocityTwistMatrix.getRows - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~VelocityTwistMatrix.__doc__ - ~VelocityTwistMatrix.__init__ - ~VelocityTwistMatrix.__module__ - ~VelocityTwistMatrix.__mul__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.XmlParser.rst b/modules/python/doc/_autosummary/visp.core.XmlParser.rst deleted file mode 100644 index 7e058e195e..0000000000 --- a/modules/python/doc/_autosummary/visp.core.XmlParser.rst +++ /dev/null @@ -1,53 +0,0 @@ -XmlParser -========= - -.. currentmodule:: visp.core - -.. autoclass:: XmlParser - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~XmlParser.cleanup - ~XmlParser.parse - ~XmlParser.save - ~XmlParser.setMainTag - ~XmlParser.setMap - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~XmlParser.__doc__ - ~XmlParser.__init__ - ~XmlParser.__module__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.XmlParserCamera.rst b/modules/python/doc/_autosummary/visp.core.XmlParserCamera.rst deleted file mode 100644 index 656450d909..0000000000 --- a/modules/python/doc/_autosummary/visp.core.XmlParserCamera.rst +++ /dev/null @@ -1,68 +0,0 @@ -XmlParserCamera -=============== - -.. currentmodule:: visp.core - -.. autoclass:: XmlParserCamera - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~XmlParserCamera.getCameraName - ~XmlParserCamera.getCameraParameters - ~XmlParserCamera.getHeight - ~XmlParserCamera.getSubsampling_height - ~XmlParserCamera.getSubsampling_width - ~XmlParserCamera.getWidth - ~XmlParserCamera.parse - ~XmlParserCamera.save - ~XmlParserCamera.setCameraName - ~XmlParserCamera.setHeight - ~XmlParserCamera.setSubsampling_height - ~XmlParserCamera.setSubsampling_width - ~XmlParserCamera.setWidth - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~XmlParserCamera.__doc__ - ~XmlParserCamera.__init__ - ~XmlParserCamera.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~XmlParserCamera.SEQUENCE_ERROR - ~XmlParserCamera.SEQUENCE_OK - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.XmlParserHomogeneousMatrix.rst b/modules/python/doc/_autosummary/visp.core.XmlParserHomogeneousMatrix.rst deleted file mode 100644 index cdf628811b..0000000000 --- a/modules/python/doc/_autosummary/visp.core.XmlParserHomogeneousMatrix.rst +++ /dev/null @@ -1,60 +0,0 @@ -XmlParserHomogeneousMatrix -========================== - -.. currentmodule:: visp.core - -.. autoclass:: XmlParserHomogeneousMatrix - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~XmlParserHomogeneousMatrix.getHomogeneousMatrix - ~XmlParserHomogeneousMatrix.getHomogeneousMatrixName - ~XmlParserHomogeneousMatrix.parse - ~XmlParserHomogeneousMatrix.save - ~XmlParserHomogeneousMatrix.setHomogeneousMatrixName - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~XmlParserHomogeneousMatrix.__doc__ - ~XmlParserHomogeneousMatrix.__init__ - ~XmlParserHomogeneousMatrix.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~XmlParserHomogeneousMatrix.SEQUENCE_ERROR - ~XmlParserHomogeneousMatrix.SEQUENCE_OK - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.XmlParserRectOriented.rst b/modules/python/doc/_autosummary/visp.core.XmlParserRectOriented.rst deleted file mode 100644 index 6c00c629ae..0000000000 --- a/modules/python/doc/_autosummary/visp.core.XmlParserRectOriented.rst +++ /dev/null @@ -1,59 +0,0 @@ -XmlParserRectOriented -===================== - -.. currentmodule:: visp.core - -.. autoclass:: XmlParserRectOriented - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~XmlParserRectOriented.getRectangle - ~XmlParserRectOriented.parse - ~XmlParserRectOriented.save - ~XmlParserRectOriented.setRectangle - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~XmlParserRectOriented.__doc__ - ~XmlParserRectOriented.__init__ - ~XmlParserRectOriented.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~XmlParserRectOriented.SEQUENCE_ERROR - ~XmlParserRectOriented.SEQUENCE_OK - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.core.rst b/modules/python/doc/_autosummary/visp.core.rst deleted file mode 100644 index 3654e3972f..0000000000 --- a/modules/python/doc/_autosummary/visp.core.rst +++ /dev/null @@ -1,167 +0,0 @@ -core -==== - -.. automodule:: visp.core - - - - - - - - .. rubric:: Functions - - .. autosummary:: - :nosignatures: - - checkAVX - checkAVX2 - checkNeon - checkSSE2 - checkSSE3 - checkSSE41 - checkSSE42 - checkSSSE3 - clippingFlagsToJSON - eigen2visp - getCPUCacheL1 - getCPUCacheL2 - getCPUCacheL3 - getDateTime - getMinTimeForUsleepCall - measureTimeMicros - measureTimeMs - measureTimeSecond - printCPUInfo - sleepMs - swap16bits - swap32bits - swapDouble - swapFloat - visp2eigen - wait - - - - - - .. rubric:: Classes - - .. autosummary:: - :toctree: - :template: custom-class-template.rst - :nosignatures: - - ArrayDouble2D - BSpline - CameraParameters - CannyEdgeDetection - Chrono - Circle - Client - ColVector - Color - ColorDepthConversion - Colormap - Convert - Cylinder - Display - ExponentialMap - FeatureDisplay - Font - ForceTwistMatrix - ForwardProjection - FrameGrabber - GaussRand - GaussianFilter - Hinkley - Histogram - HistogramPeak - HistogramValey - HomogeneousMatrix - ImageCircle - ImageConvert - ImageDouble - ImageDraw - ImageFilter - ImageFloat - ImageGray - ImageMorphology - ImagePoint - ImageRGBa - ImageRGBf - ImageTools - ImageUInt16 - IoTools - KalmanFilter - LinProg - Line - LinearKalmanFilterInstantiation - Math - Matrix - MeterPixelConversion - Moment - MomentAlpha - MomentArea - MomentAreaNormalized - MomentBasic - MomentCInvariant - MomentCentered - MomentCommon - MomentDatabase - MomentGravityCenter - MomentGravityCenterNormalized - MomentObject - MouseButton - Munkres - Mutex - Network - PixelMeterConversion - Plane - Point - Polygon - Polygon3D - PoseVector - QuadProg - QuaternionVector - RGBa - RGBf - Rect - RectOriented - Request - Robust - RotationMatrix - RotationVector - RowVector - RxyzVector - RzyxVector - RzyzVector - Scale - Serial - Server - Sphere - SubColVector - SubMatrix - SubRowVector - ThetaUVector - Thread - Tracker - TranslationVector - Triangle - UDPClient - UDPServer - UniRand - VelocityTwistMatrix - XmlParser - XmlParserCamera - XmlParserHomogeneousMatrix - XmlParserRectOriented - - - - - - - - - diff --git a/modules/python/doc/_autosummary/visp.detection.DetectorAprilTag.rst b/modules/python/doc/_autosummary/visp.detection.DetectorAprilTag.rst deleted file mode 100644 index d682f1f23e..0000000000 --- a/modules/python/doc/_autosummary/visp.detection.DetectorAprilTag.rst +++ /dev/null @@ -1,92 +0,0 @@ -DetectorAprilTag -================ - -.. currentmodule:: visp.detection - -.. autoclass:: DetectorAprilTag - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~DetectorAprilTag.detect - ~DetectorAprilTag.displayFrames - ~DetectorAprilTag.displayTags - ~DetectorAprilTag.getPoseEstimationMethod - ~DetectorAprilTag.getTagsCorners - ~DetectorAprilTag.getTagsId - ~DetectorAprilTag.getTagsPoints3D - ~DetectorAprilTag.setAprilTagDecodeSharpening - ~DetectorAprilTag.setAprilTagFamily - ~DetectorAprilTag.setAprilTagNbThreads - ~DetectorAprilTag.setAprilTagPoseEstimationMethod - ~DetectorAprilTag.setAprilTagQuadDecimate - ~DetectorAprilTag.setAprilTagQuadSigma - ~DetectorAprilTag.setAprilTagRefineEdges - ~DetectorAprilTag.setDisplayTag - ~DetectorAprilTag.setZAlignedWithCameraAxis - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~DetectorAprilTag.getBBox - ~DetectorAprilTag.setTimeout - ~DetectorAprilTag.getPolygon - ~DetectorAprilTag.getCog - ~DetectorAprilTag.getMessage - ~DetectorAprilTag.getNbObjects - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~DetectorAprilTag.__doc__ - ~DetectorAprilTag.__init__ - ~DetectorAprilTag.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~DetectorAprilTag.BEST_RESIDUAL_VIRTUAL_VS - ~DetectorAprilTag.DEMENTHON_VIRTUAL_VS - ~DetectorAprilTag.HOMOGRAPHY - ~DetectorAprilTag.HOMOGRAPHY_ORTHOGONAL_ITERATION - ~DetectorAprilTag.HOMOGRAPHY_VIRTUAL_VS - ~DetectorAprilTag.LAGRANGE_VIRTUAL_VS - ~DetectorAprilTag.TAG_16h5 - ~DetectorAprilTag.TAG_25h7 - ~DetectorAprilTag.TAG_25h9 - ~DetectorAprilTag.TAG_36ARTOOLKIT - ~DetectorAprilTag.TAG_36h10 - ~DetectorAprilTag.TAG_36h11 - ~DetectorAprilTag.TAG_CIRCLE21h7 - ~DetectorAprilTag.TAG_CIRCLE49h12 - ~DetectorAprilTag.TAG_CUSTOM48h12 - ~DetectorAprilTag.TAG_STANDARD41h12 - ~DetectorAprilTag.TAG_STANDARD52h13 - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.detection.DetectorBase.rst b/modules/python/doc/_autosummary/visp.detection.DetectorBase.rst deleted file mode 100644 index e99417d715..0000000000 --- a/modules/python/doc/_autosummary/visp.detection.DetectorBase.rst +++ /dev/null @@ -1,54 +0,0 @@ -DetectorBase -============ - -.. currentmodule:: visp.detection - -.. autoclass:: DetectorBase - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~DetectorBase.getBBox - ~DetectorBase.getCog - ~DetectorBase.getMessage - ~DetectorBase.getNbObjects - ~DetectorBase.getPolygon - ~DetectorBase.setTimeout - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~DetectorBase.__doc__ - ~DetectorBase.__init__ - ~DetectorBase.__module__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.detection.DetectorDNNOpenCV.rst b/modules/python/doc/_autosummary/visp.detection.DetectorDNNOpenCV.rst deleted file mode 100644 index 2d0f2f22e7..0000000000 --- a/modules/python/doc/_autosummary/visp.detection.DetectorDNNOpenCV.rst +++ /dev/null @@ -1,83 +0,0 @@ -DetectorDNNOpenCV -================= - -.. currentmodule:: visp.detection - -.. autoclass:: DetectorDNNOpenCV - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~DetectorDNNOpenCV.detect - ~DetectorDNNOpenCV.dnnResultsParsingTypeFromString - ~DetectorDNNOpenCV.dnnResultsParsingTypeToString - ~DetectorDNNOpenCV.getAvailableDnnResultsParsingTypes - ~DetectorDNNOpenCV.getNetConfig - ~DetectorDNNOpenCV.initFromJSON - ~DetectorDNNOpenCV.parseClassNamesFile - ~DetectorDNNOpenCV.readNet - ~DetectorDNNOpenCV.saveConfigurationInJSON - ~DetectorDNNOpenCV.setConfidenceThreshold - ~DetectorDNNOpenCV.setDetectionFilterSizeRatio - ~DetectorDNNOpenCV.setInputSize - ~DetectorDNNOpenCV.setMean - ~DetectorDNNOpenCV.setNMSThreshold - ~DetectorDNNOpenCV.setNetConfig - ~DetectorDNNOpenCV.setPreferableBackend - ~DetectorDNNOpenCV.setPreferableTarget - ~DetectorDNNOpenCV.setScaleFactor - ~DetectorDNNOpenCV.setSwapRB - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~DetectorDNNOpenCV.__doc__ - ~DetectorDNNOpenCV.__init__ - ~DetectorDNNOpenCV.__module__ - ~DetectorDNNOpenCV.__repr__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~DetectorDNNOpenCV.COUNT - ~DetectorDNNOpenCV.FASTER_RCNN - ~DetectorDNNOpenCV.RESNET_10 - ~DetectorDNNOpenCV.SSD_MOBILENET - ~DetectorDNNOpenCV.USER_SPECIFIED - ~DetectorDNNOpenCV.YOLO_V3 - ~DetectorDNNOpenCV.YOLO_V4 - ~DetectorDNNOpenCV.YOLO_V5 - ~DetectorDNNOpenCV.YOLO_V7 - ~DetectorDNNOpenCV.YOLO_V8 - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.detection.DetectorFace.rst b/modules/python/doc/_autosummary/visp.detection.DetectorFace.rst deleted file mode 100644 index 9530a27822..0000000000 --- a/modules/python/doc/_autosummary/visp.detection.DetectorFace.rst +++ /dev/null @@ -1,56 +0,0 @@ -DetectorFace -============ - -.. currentmodule:: visp.detection - -.. autoclass:: DetectorFace - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~DetectorFace.detect - ~DetectorFace.setCascadeClassifierFile - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~DetectorFace.getBBox - ~DetectorFace.setTimeout - ~DetectorFace.getPolygon - ~DetectorFace.getCog - ~DetectorFace.getMessage - ~DetectorFace.getNbObjects - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~DetectorFace.__doc__ - ~DetectorFace.__init__ - ~DetectorFace.__module__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.detection.DetectorQRCode.rst b/modules/python/doc/_autosummary/visp.detection.DetectorQRCode.rst deleted file mode 100644 index b1da2c4a5b..0000000000 --- a/modules/python/doc/_autosummary/visp.detection.DetectorQRCode.rst +++ /dev/null @@ -1,55 +0,0 @@ -DetectorQRCode -============== - -.. currentmodule:: visp.detection - -.. autoclass:: DetectorQRCode - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~DetectorQRCode.detect - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~DetectorQRCode.getMessage - ~DetectorQRCode.getBBox - ~DetectorQRCode.setTimeout - ~DetectorQRCode.getNbObjects - ~DetectorQRCode.getPolygon - ~DetectorQRCode.getCog - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~DetectorQRCode.__doc__ - ~DetectorQRCode.__init__ - ~DetectorQRCode.__module__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.detection.rst b/modules/python/doc/_autosummary/visp.detection.rst deleted file mode 100644 index 50de0fc566..0000000000 --- a/modules/python/doc/_autosummary/visp.detection.rst +++ /dev/null @@ -1,36 +0,0 @@ -detection -========= - -.. automodule:: visp.detection - - - - - - - - - - - - .. rubric:: Classes - - .. autosummary:: - :toctree: - :template: custom-class-template.rst - :nosignatures: - - DetectorAprilTag - DetectorBase - DetectorDNNOpenCV - DetectorFace - DetectorQRCode - - - - - - - - - diff --git a/modules/python/doc/_autosummary/visp.dnn_tracker.MegaPose.rst b/modules/python/doc/_autosummary/visp.dnn_tracker.MegaPose.rst deleted file mode 100644 index c01db6801c..0000000000 --- a/modules/python/doc/_autosummary/visp.dnn_tracker.MegaPose.rst +++ /dev/null @@ -1,72 +0,0 @@ -MegaPose -======== - -.. currentmodule:: visp.dnn_tracker - -.. autoclass:: MegaPose - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~MegaPose.getObjectNames - ~MegaPose.scorePoses - ~MegaPose.setCoarseNumSamples - ~MegaPose.setIntrinsics - ~MegaPose.viewObjects - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~MegaPose.__doc__ - ~MegaPose.__init__ - ~MegaPose.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~MegaPose.ERR - ~MegaPose.EXIT - ~MegaPose.GET_LIST_OBJECTS - ~MegaPose.GET_POSE - ~MegaPose.GET_SCORE - ~MegaPose.GET_VIZ - ~MegaPose.OK - ~MegaPose.RET_LIST_OBJECTS - ~MegaPose.RET_POSE - ~MegaPose.RET_SCORE - ~MegaPose.RET_VIZ - ~MegaPose.SET_INTR - ~MegaPose.SET_SO3_GRID_SIZE - ~MegaPose.UNKNOWN - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.dnn_tracker.MegaPoseEstimate.rst b/modules/python/doc/_autosummary/visp.dnn_tracker.MegaPoseEstimate.rst deleted file mode 100644 index f05f2a2890..0000000000 --- a/modules/python/doc/_autosummary/visp.dnn_tracker.MegaPoseEstimate.rst +++ /dev/null @@ -1,56 +0,0 @@ -MegaPoseEstimate -================ - -.. currentmodule:: visp.dnn_tracker - -.. autoclass:: MegaPoseEstimate - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~MegaPoseEstimate.__doc__ - ~MegaPoseEstimate.__init__ - ~MegaPoseEstimate.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~MegaPoseEstimate.boundingBox - ~MegaPoseEstimate.cTo - ~MegaPoseEstimate.score - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.dnn_tracker.MegaPoseTracker.rst b/modules/python/doc/_autosummary/visp.dnn_tracker.MegaPoseTracker.rst deleted file mode 100644 index 602ebc981e..0000000000 --- a/modules/python/doc/_autosummary/visp.dnn_tracker.MegaPoseTracker.rst +++ /dev/null @@ -1,51 +0,0 @@ -MegaPoseTracker -=============== - -.. currentmodule:: visp.dnn_tracker - -.. autoclass:: MegaPoseTracker - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~MegaPoseTracker.init - ~MegaPoseTracker.track - ~MegaPoseTracker.updatePose - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~MegaPoseTracker.__doc__ - ~MegaPoseTracker.__init__ - ~MegaPoseTracker.__module__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.dnn_tracker.rst b/modules/python/doc/_autosummary/visp.dnn_tracker.rst deleted file mode 100644 index aff2ad80a4..0000000000 --- a/modules/python/doc/_autosummary/visp.dnn_tracker.rst +++ /dev/null @@ -1,34 +0,0 @@ -dnn\_tracker -============ - -.. automodule:: visp.dnn_tracker - - - - - - - - - - - - .. rubric:: Classes - - .. autosummary:: - :toctree: - :template: custom-class-template.rst - :nosignatures: - - MegaPose - MegaPoseEstimate - MegaPoseTracker - - - - - - - - - diff --git a/modules/python/doc/_autosummary/visp.gui.ColorBlindFriendlyPalette.rst b/modules/python/doc/_autosummary/visp.gui.ColorBlindFriendlyPalette.rst deleted file mode 100644 index 47ec304d2c..0000000000 --- a/modules/python/doc/_autosummary/visp.gui.ColorBlindFriendlyPalette.rst +++ /dev/null @@ -1,70 +0,0 @@ -ColorBlindFriendlyPalette -========================= - -.. currentmodule:: visp.gui - -.. autoclass:: ColorBlindFriendlyPalette - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~ColorBlindFriendlyPalette.getAvailableColorsNames - ~ColorBlindFriendlyPalette.get_colorID - ~ColorBlindFriendlyPalette.set_fromString - ~ColorBlindFriendlyPalette.to_RGB - ~ColorBlindFriendlyPalette.to_colorRatio - ~ColorBlindFriendlyPalette.to_string - ~ColorBlindFriendlyPalette.to_vpColor - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~ColorBlindFriendlyPalette.__doc__ - ~ColorBlindFriendlyPalette.__init__ - ~ColorBlindFriendlyPalette.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~ColorBlindFriendlyPalette.Black - ~ColorBlindFriendlyPalette.Blue - ~ColorBlindFriendlyPalette.COUNT - ~ColorBlindFriendlyPalette.Green - ~ColorBlindFriendlyPalette.Orange - ~ColorBlindFriendlyPalette.Purple - ~ColorBlindFriendlyPalette.SkyBlue - ~ColorBlindFriendlyPalette.Vermillon - ~ColorBlindFriendlyPalette.Yellow - ~ColorBlindFriendlyPalette.s_paletteNames - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.gui.DisplayOpenCV.rst b/modules/python/doc/_autosummary/visp.gui.DisplayOpenCV.rst deleted file mode 100644 index 6034c58466..0000000000 --- a/modules/python/doc/_autosummary/visp.gui.DisplayOpenCV.rst +++ /dev/null @@ -1,118 +0,0 @@ -DisplayOpenCV -============= - -.. currentmodule:: visp.gui - -.. autoclass:: DisplayOpenCV - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~DisplayOpenCV.getImage - ~DisplayOpenCV.getScreenHeight - ~DisplayOpenCV.getScreenSize - ~DisplayOpenCV.getScreenWidth - ~DisplayOpenCV.init - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~DisplayOpenCV.SCALE_6 - ~DisplayOpenCV.ScaleType - ~DisplayOpenCV.displayArrow - ~DisplayOpenCV.displayRectangle - ~DisplayOpenCV.getWindowYPosition - ~DisplayOpenCV.SCALE_AUTO - ~DisplayOpenCV.displayLine - ~DisplayOpenCV.display - ~DisplayOpenCV.SCALE_4 - ~DisplayOpenCV.displayText - ~DisplayOpenCV.close - ~DisplayOpenCV.getClickUp - ~DisplayOpenCV.setDownScalingFactor - ~DisplayOpenCV.setBackground - ~DisplayOpenCV.SCALE_3 - ~DisplayOpenCV.SCALE_9 - ~DisplayOpenCV.displayFrame - ~DisplayOpenCV.flush - ~DisplayOpenCV.displayCamera - ~DisplayOpenCV.displayPoint - ~DisplayOpenCV.displayPolygon - ~DisplayOpenCV.getWindowXPosition - ~DisplayOpenCV.flushROI - ~DisplayOpenCV.SCALE_2 - ~DisplayOpenCV.SCALE_1 - ~DisplayOpenCV.setFont - ~DisplayOpenCV.SCALE_7 - ~DisplayOpenCV.isInitialised - ~DisplayOpenCV.SCALE_DEFAULT - ~DisplayOpenCV.getDownScalingFactor - ~DisplayOpenCV.getPointerMotionEvent - ~DisplayOpenCV.getWidth - ~DisplayOpenCV.getHeight - ~DisplayOpenCV.SCALE_10 - ~DisplayOpenCV.computeAutoScale - ~DisplayOpenCV.getPointerPosition - ~DisplayOpenCV.setTitle - ~DisplayOpenCV.displayEllipse - ~DisplayOpenCV.getClick - ~DisplayOpenCV.displayCircleStatic - ~DisplayOpenCV.getKeyboardEvent - ~DisplayOpenCV.displayCross - ~DisplayOpenCV.displayDotLine - ~DisplayOpenCV.getImageDownScalingFactor - ~DisplayOpenCV.setWindowPosition - ~DisplayOpenCV.displayROI - ~DisplayOpenCV.SCALE_8 - ~DisplayOpenCV.SCALE_5 - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~DisplayOpenCV.__doc__ - ~DisplayOpenCV.__init__ - ~DisplayOpenCV.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~DisplayOpenCV.SCALE_1 - ~DisplayOpenCV.SCALE_10 - ~DisplayOpenCV.SCALE_2 - ~DisplayOpenCV.SCALE_3 - ~DisplayOpenCV.SCALE_4 - ~DisplayOpenCV.SCALE_5 - ~DisplayOpenCV.SCALE_6 - ~DisplayOpenCV.SCALE_7 - ~DisplayOpenCV.SCALE_8 - ~DisplayOpenCV.SCALE_9 - ~DisplayOpenCV.SCALE_AUTO - ~DisplayOpenCV.SCALE_DEFAULT - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.gui.DisplayX.rst b/modules/python/doc/_autosummary/visp.gui.DisplayX.rst deleted file mode 100644 index 6f694f3348..0000000000 --- a/modules/python/doc/_autosummary/visp.gui.DisplayX.rst +++ /dev/null @@ -1,119 +0,0 @@ -DisplayX -======== - -.. currentmodule:: visp.gui - -.. autoclass:: DisplayX - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~DisplayX.getImage - ~DisplayX.getScreenDepth - ~DisplayX.getScreenHeight - ~DisplayX.getScreenSize - ~DisplayX.getScreenWidth - ~DisplayX.init - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~DisplayX.SCALE_6 - ~DisplayX.ScaleType - ~DisplayX.displayArrow - ~DisplayX.displayRectangle - ~DisplayX.getWindowYPosition - ~DisplayX.SCALE_AUTO - ~DisplayX.displayLine - ~DisplayX.display - ~DisplayX.SCALE_4 - ~DisplayX.displayText - ~DisplayX.close - ~DisplayX.getClickUp - ~DisplayX.setDownScalingFactor - ~DisplayX.setBackground - ~DisplayX.SCALE_3 - ~DisplayX.SCALE_9 - ~DisplayX.displayFrame - ~DisplayX.flush - ~DisplayX.displayCamera - ~DisplayX.displayPoint - ~DisplayX.displayPolygon - ~DisplayX.getWindowXPosition - ~DisplayX.flushROI - ~DisplayX.SCALE_2 - ~DisplayX.SCALE_1 - ~DisplayX.setFont - ~DisplayX.SCALE_7 - ~DisplayX.isInitialised - ~DisplayX.SCALE_DEFAULT - ~DisplayX.getDownScalingFactor - ~DisplayX.getPointerMotionEvent - ~DisplayX.getWidth - ~DisplayX.getHeight - ~DisplayX.SCALE_10 - ~DisplayX.computeAutoScale - ~DisplayX.getPointerPosition - ~DisplayX.setTitle - ~DisplayX.displayEllipse - ~DisplayX.getClick - ~DisplayX.displayCircleStatic - ~DisplayX.getKeyboardEvent - ~DisplayX.displayCross - ~DisplayX.displayDotLine - ~DisplayX.getImageDownScalingFactor - ~DisplayX.setWindowPosition - ~DisplayX.displayROI - ~DisplayX.SCALE_8 - ~DisplayX.SCALE_5 - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~DisplayX.__doc__ - ~DisplayX.__init__ - ~DisplayX.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~DisplayX.SCALE_1 - ~DisplayX.SCALE_10 - ~DisplayX.SCALE_2 - ~DisplayX.SCALE_3 - ~DisplayX.SCALE_4 - ~DisplayX.SCALE_5 - ~DisplayX.SCALE_6 - ~DisplayX.SCALE_7 - ~DisplayX.SCALE_8 - ~DisplayX.SCALE_9 - ~DisplayX.SCALE_AUTO - ~DisplayX.SCALE_DEFAULT - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.gui.Plot.rst b/modules/python/doc/_autosummary/visp.gui.Plot.rst deleted file mode 100644 index 435185f4bd..0000000000 --- a/modules/python/doc/_autosummary/visp.gui.Plot.rst +++ /dev/null @@ -1,72 +0,0 @@ -Plot -==== - -.. currentmodule:: visp.gui - -.. autoclass:: Plot - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~Plot.getPixelValue - ~Plot.init - ~Plot.initGraph - ~Plot.initRange - ~Plot.navigate - ~Plot.plot - ~Plot.resetPointList - ~Plot.saveData - ~Plot.setColor - ~Plot.setFont - ~Plot.setGraphThickness - ~Plot.setGridThickness - ~Plot.setLegend - ~Plot.setThickness - ~Plot.setTitle - ~Plot.setUnitX - ~Plot.setUnitY - ~Plot.setUnitZ - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~Plot.__doc__ - ~Plot.__init__ - ~Plot.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~Plot.I - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.gui.ProjectionDisplay.rst b/modules/python/doc/_autosummary/visp.gui.ProjectionDisplay.rst deleted file mode 100644 index dcc643c4e1..0000000000 --- a/modules/python/doc/_autosummary/visp.gui.ProjectionDisplay.rst +++ /dev/null @@ -1,55 +0,0 @@ -ProjectionDisplay -================= - -.. currentmodule:: visp.gui - -.. autoclass:: ProjectionDisplay - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~ProjectionDisplay.close - ~ProjectionDisplay.display - ~ProjectionDisplay.displayCamera - ~ProjectionDisplay.externalView - ~ProjectionDisplay.init - ~ProjectionDisplay.insert - ~ProjectionDisplay.internalView - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~ProjectionDisplay.__doc__ - ~ProjectionDisplay.__init__ - ~ProjectionDisplay.__module__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.gui.rst b/modules/python/doc/_autosummary/visp.gui.rst deleted file mode 100644 index 6aeaf8cd1a..0000000000 --- a/modules/python/doc/_autosummary/visp.gui.rst +++ /dev/null @@ -1,36 +0,0 @@ -gui -=== - -.. automodule:: visp.gui - - - - - - - - - - - - .. rubric:: Classes - - .. autosummary:: - :toctree: - :template: custom-class-template.rst - :nosignatures: - - ColorBlindFriendlyPalette - DisplayOpenCV - DisplayX - Plot - ProjectionDisplay - - - - - - - - - diff --git a/modules/python/doc/_autosummary/visp.imgproc.AutoThresholdMethod.rst b/modules/python/doc/_autosummary/visp.imgproc.AutoThresholdMethod.rst deleted file mode 100644 index 8c959d559f..0000000000 --- a/modules/python/doc/_autosummary/visp.imgproc.AutoThresholdMethod.rst +++ /dev/null @@ -1,82 +0,0 @@ -AutoThresholdMethod -=================== - -.. currentmodule:: visp.imgproc - -.. autoclass:: AutoThresholdMethod - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~AutoThresholdMethod.__and__ - ~AutoThresholdMethod.__doc__ - ~AutoThresholdMethod.__eq__ - ~AutoThresholdMethod.__ge__ - ~AutoThresholdMethod.__getstate__ - ~AutoThresholdMethod.__gt__ - ~AutoThresholdMethod.__hash__ - ~AutoThresholdMethod.__index__ - ~AutoThresholdMethod.__init__ - ~AutoThresholdMethod.__int__ - ~AutoThresholdMethod.__invert__ - ~AutoThresholdMethod.__le__ - ~AutoThresholdMethod.__lt__ - ~AutoThresholdMethod.__members__ - ~AutoThresholdMethod.__module__ - ~AutoThresholdMethod.__ne__ - ~AutoThresholdMethod.__or__ - ~AutoThresholdMethod.__rand__ - ~AutoThresholdMethod.__repr__ - ~AutoThresholdMethod.__ror__ - ~AutoThresholdMethod.__rxor__ - ~AutoThresholdMethod.__setstate__ - ~AutoThresholdMethod.__str__ - ~AutoThresholdMethod.__xor__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~AutoThresholdMethod.AUTO_THRESHOLD_HUANG - ~AutoThresholdMethod.AUTO_THRESHOLD_INTERMODES - ~AutoThresholdMethod.AUTO_THRESHOLD_ISODATA - ~AutoThresholdMethod.AUTO_THRESHOLD_MEAN - ~AutoThresholdMethod.AUTO_THRESHOLD_OTSU - ~AutoThresholdMethod.AUTO_THRESHOLD_TRIANGLE - ~AutoThresholdMethod.name - ~AutoThresholdMethod.value - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.imgproc.CircleHoughTransform.rst b/modules/python/doc/_autosummary/visp.imgproc.CircleHoughTransform.rst deleted file mode 100644 index 124c962e5b..0000000000 --- a/modules/python/doc/_autosummary/visp.imgproc.CircleHoughTransform.rst +++ /dev/null @@ -1,81 +0,0 @@ -CircleHoughTransform -==================== - -.. currentmodule:: visp.imgproc - -.. autoclass:: CircleHoughTransform - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~CircleHoughTransform.detect - ~CircleHoughTransform.getCannyThreshold - ~CircleHoughTransform.getCenterCandidatesList - ~CircleHoughTransform.getCenterCandidatesVotes - ~CircleHoughTransform.getCircleCandidates - ~CircleHoughTransform.getCircleCandidatesProbabilities - ~CircleHoughTransform.getCircleCenterMinDist - ~CircleHoughTransform.getCircleMaxRadius - ~CircleHoughTransform.getCircleMinRadius - ~CircleHoughTransform.getDetectionsProbabilities - ~CircleHoughTransform.getDetectionsVotes - ~CircleHoughTransform.getEdgeMap - ~CircleHoughTransform.getGradientX - ~CircleHoughTransform.getGradientY - ~CircleHoughTransform.init - ~CircleHoughTransform.initFromJSON - ~CircleHoughTransform.saveConfigurationInJSON - ~CircleHoughTransform.setCannyBackend - ~CircleHoughTransform.setCannyThreshold - ~CircleHoughTransform.setCannyThresholdRatio - ~CircleHoughTransform.setCenterComputationParameters - ~CircleHoughTransform.setCircleCenterBoundingBox - ~CircleHoughTransform.setCircleCenterMinDist - ~CircleHoughTransform.setCircleMaxRadius - ~CircleHoughTransform.setCircleMinRadius - ~CircleHoughTransform.setCirclePerfectness - ~CircleHoughTransform.setFilteringAndGradientType - ~CircleHoughTransform.setGaussianParameters - ~CircleHoughTransform.setGradientFilterAperture - ~CircleHoughTransform.setRadiusMergingThresholds - ~CircleHoughTransform.setRadiusRatioThreshold - ~CircleHoughTransform.toString - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~CircleHoughTransform.__doc__ - ~CircleHoughTransform.__init__ - ~CircleHoughTransform.__module__ - ~CircleHoughTransform.__repr__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.imgproc.ContourRetrievalType.rst b/modules/python/doc/_autosummary/visp.imgproc.ContourRetrievalType.rst deleted file mode 100644 index f946471b4b..0000000000 --- a/modules/python/doc/_autosummary/visp.imgproc.ContourRetrievalType.rst +++ /dev/null @@ -1,79 +0,0 @@ -ContourRetrievalType -==================== - -.. currentmodule:: visp.imgproc - -.. autoclass:: ContourRetrievalType - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~ContourRetrievalType.__and__ - ~ContourRetrievalType.__doc__ - ~ContourRetrievalType.__eq__ - ~ContourRetrievalType.__ge__ - ~ContourRetrievalType.__getstate__ - ~ContourRetrievalType.__gt__ - ~ContourRetrievalType.__hash__ - ~ContourRetrievalType.__index__ - ~ContourRetrievalType.__init__ - ~ContourRetrievalType.__int__ - ~ContourRetrievalType.__invert__ - ~ContourRetrievalType.__le__ - ~ContourRetrievalType.__lt__ - ~ContourRetrievalType.__members__ - ~ContourRetrievalType.__module__ - ~ContourRetrievalType.__ne__ - ~ContourRetrievalType.__or__ - ~ContourRetrievalType.__rand__ - ~ContourRetrievalType.__repr__ - ~ContourRetrievalType.__ror__ - ~ContourRetrievalType.__rxor__ - ~ContourRetrievalType.__setstate__ - ~ContourRetrievalType.__str__ - ~ContourRetrievalType.__xor__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~ContourRetrievalType.CONTOUR_RETR_EXTERNAL - ~ContourRetrievalType.CONTOUR_RETR_LIST - ~ContourRetrievalType.CONTOUR_RETR_TREE - ~ContourRetrievalType.name - ~ContourRetrievalType.value - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.imgproc.ContourType.rst b/modules/python/doc/_autosummary/visp.imgproc.ContourType.rst deleted file mode 100644 index fede860ef4..0000000000 --- a/modules/python/doc/_autosummary/visp.imgproc.ContourType.rst +++ /dev/null @@ -1,78 +0,0 @@ -ContourType -=========== - -.. currentmodule:: visp.imgproc - -.. autoclass:: ContourType - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~ContourType.__and__ - ~ContourType.__doc__ - ~ContourType.__eq__ - ~ContourType.__ge__ - ~ContourType.__getstate__ - ~ContourType.__gt__ - ~ContourType.__hash__ - ~ContourType.__index__ - ~ContourType.__init__ - ~ContourType.__int__ - ~ContourType.__invert__ - ~ContourType.__le__ - ~ContourType.__lt__ - ~ContourType.__members__ - ~ContourType.__module__ - ~ContourType.__ne__ - ~ContourType.__or__ - ~ContourType.__rand__ - ~ContourType.__repr__ - ~ContourType.__ror__ - ~ContourType.__rxor__ - ~ContourType.__setstate__ - ~ContourType.__str__ - ~ContourType.__xor__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~ContourType.CONTOUR_HOLE - ~ContourType.CONTOUR_OUTER - ~ContourType.name - ~ContourType.value - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.imgproc.DirectionType.rst b/modules/python/doc/_autosummary/visp.imgproc.DirectionType.rst deleted file mode 100644 index 022775d712..0000000000 --- a/modules/python/doc/_autosummary/visp.imgproc.DirectionType.rst +++ /dev/null @@ -1,85 +0,0 @@ -DirectionType -============= - -.. currentmodule:: visp.imgproc - -.. autoclass:: DirectionType - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~DirectionType.__and__ - ~DirectionType.__doc__ - ~DirectionType.__eq__ - ~DirectionType.__ge__ - ~DirectionType.__getstate__ - ~DirectionType.__gt__ - ~DirectionType.__hash__ - ~DirectionType.__index__ - ~DirectionType.__init__ - ~DirectionType.__int__ - ~DirectionType.__invert__ - ~DirectionType.__le__ - ~DirectionType.__lt__ - ~DirectionType.__members__ - ~DirectionType.__module__ - ~DirectionType.__ne__ - ~DirectionType.__or__ - ~DirectionType.__rand__ - ~DirectionType.__repr__ - ~DirectionType.__ror__ - ~DirectionType.__rxor__ - ~DirectionType.__setstate__ - ~DirectionType.__str__ - ~DirectionType.__xor__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~DirectionType.EAST - ~DirectionType.LAST_DIRECTION - ~DirectionType.NORTH - ~DirectionType.NORTH_EAST - ~DirectionType.NORTH_WEST - ~DirectionType.SOUTH - ~DirectionType.SOUTH_EAST - ~DirectionType.SOUTH_WEST - ~DirectionType.WEST - ~DirectionType.name - ~DirectionType.value - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.imgproc.RETINEX_LEVEL.rst b/modules/python/doc/_autosummary/visp.imgproc.RETINEX_LEVEL.rst deleted file mode 100644 index 537bf095f1..0000000000 --- a/modules/python/doc/_autosummary/visp.imgproc.RETINEX_LEVEL.rst +++ /dev/null @@ -1,79 +0,0 @@ -RETINEX\_LEVEL -============== - -.. currentmodule:: visp.imgproc - -.. autoclass:: RETINEX_LEVEL - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~RETINEX_LEVEL.__and__ - ~RETINEX_LEVEL.__doc__ - ~RETINEX_LEVEL.__eq__ - ~RETINEX_LEVEL.__ge__ - ~RETINEX_LEVEL.__getstate__ - ~RETINEX_LEVEL.__gt__ - ~RETINEX_LEVEL.__hash__ - ~RETINEX_LEVEL.__index__ - ~RETINEX_LEVEL.__init__ - ~RETINEX_LEVEL.__int__ - ~RETINEX_LEVEL.__invert__ - ~RETINEX_LEVEL.__le__ - ~RETINEX_LEVEL.__lt__ - ~RETINEX_LEVEL.__members__ - ~RETINEX_LEVEL.__module__ - ~RETINEX_LEVEL.__ne__ - ~RETINEX_LEVEL.__or__ - ~RETINEX_LEVEL.__rand__ - ~RETINEX_LEVEL.__repr__ - ~RETINEX_LEVEL.__ror__ - ~RETINEX_LEVEL.__rxor__ - ~RETINEX_LEVEL.__setstate__ - ~RETINEX_LEVEL.__str__ - ~RETINEX_LEVEL.__xor__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~RETINEX_LEVEL.RETINEX_HIGH - ~RETINEX_LEVEL.RETINEX_LOW - ~RETINEX_LEVEL.RETINEX_UNIFORM - ~RETINEX_LEVEL.name - ~RETINEX_LEVEL.value - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.imgproc.rst b/modules/python/doc/_autosummary/visp.imgproc.rst deleted file mode 100644 index 465acfa3b2..0000000000 --- a/modules/python/doc/_autosummary/visp.imgproc.rst +++ /dev/null @@ -1,58 +0,0 @@ -imgproc -======= - -.. automodule:: visp.imgproc - - - - - - - - .. rubric:: Functions - - .. autosummary:: - :nosignatures: - - adjust - autoThreshold - clahe - connectedComponents - drawContours - equalizeHistogram - fillHoles - findContours - floodFill - gammaCorrection - reconstruct - retinex - stretchContrast - stretchContrastHSV - unsharpMask - - - - - - .. rubric:: Classes - - .. autosummary:: - :toctree: - :template: custom-class-template.rst - :nosignatures: - - AutoThresholdMethod - CircleHoughTransform - ContourRetrievalType - ContourType - DirectionType - RETINEX_LEVEL - - - - - - - - - diff --git a/modules/python/doc/_autosummary/visp.io.DiskGrabber.rst b/modules/python/doc/_autosummary/visp.io.DiskGrabber.rst deleted file mode 100644 index e3911f1a31..0000000000 --- a/modules/python/doc/_autosummary/visp.io.DiskGrabber.rst +++ /dev/null @@ -1,69 +0,0 @@ -DiskGrabber -=========== - -.. currentmodule:: visp.io - -.. autoclass:: DiskGrabber - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~DiskGrabber.acquire - ~DiskGrabber.close - ~DiskGrabber.getImageName - ~DiskGrabber.getImageNumber - ~DiskGrabber.open - ~DiskGrabber.setBaseName - ~DiskGrabber.setDirectory - ~DiskGrabber.setExtension - ~DiskGrabber.setGenericName - ~DiskGrabber.setImageNumber - ~DiskGrabber.setNumberOfZero - ~DiskGrabber.setStep - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~DiskGrabber.getWidth - ~DiskGrabber.getHeight - ~DiskGrabber.init - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~DiskGrabber.__doc__ - ~DiskGrabber.__init__ - ~DiskGrabber.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~DiskGrabber.init - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.io.ImageIo.rst b/modules/python/doc/_autosummary/visp.io.ImageIo.rst deleted file mode 100644 index 9f4fbe64e8..0000000000 --- a/modules/python/doc/_autosummary/visp.io.ImageIo.rst +++ /dev/null @@ -1,74 +0,0 @@ -ImageIo -======= - -.. currentmodule:: visp.io - -.. autoclass:: ImageIo - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~ImageIo.read - ~ImageIo.readEXR - ~ImageIo.readJPEG - ~ImageIo.readPFM - ~ImageIo.readPFM_HDR - ~ImageIo.readPGM - ~ImageIo.readPNG - ~ImageIo.readPPM - ~ImageIo.write - ~ImageIo.writeEXR - ~ImageIo.writeJPEG - ~ImageIo.writePFM - ~ImageIo.writePFM_HDR - ~ImageIo.writePGM - ~ImageIo.writePNG - ~ImageIo.writePPM - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~ImageIo.__doc__ - ~ImageIo.__init__ - ~ImageIo.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~ImageIo.IO_DEFAULT_BACKEND - ~ImageIo.IO_OPENCV_BACKEND - ~ImageIo.IO_SIMDLIB_BACKEND - ~ImageIo.IO_STB_IMAGE_BACKEND - ~ImageIo.IO_SYSTEM_LIB_BACKEND - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.io.Keyboard.rst b/modules/python/doc/_autosummary/visp.io.Keyboard.rst deleted file mode 100644 index fe36c7eac1..0000000000 --- a/modules/python/doc/_autosummary/visp.io.Keyboard.rst +++ /dev/null @@ -1,50 +0,0 @@ -Keyboard -======== - -.. currentmodule:: visp.io - -.. autoclass:: Keyboard - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~Keyboard.getchar - ~Keyboard.kbhit - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~Keyboard.__doc__ - ~Keyboard.__init__ - ~Keyboard.__module__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.io.ParallelPort.rst b/modules/python/doc/_autosummary/visp.io.ParallelPort.rst deleted file mode 100644 index cd231252ad..0000000000 --- a/modules/python/doc/_autosummary/visp.io.ParallelPort.rst +++ /dev/null @@ -1,50 +0,0 @@ -ParallelPort -============ - -.. currentmodule:: visp.io - -.. autoclass:: ParallelPort - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~ParallelPort.getData - ~ParallelPort.sendData - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~ParallelPort.__doc__ - ~ParallelPort.__init__ - ~ParallelPort.__module__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.io.VideoReader.rst b/modules/python/doc/_autosummary/visp.io.VideoReader.rst deleted file mode 100644 index b8d5e2e972..0000000000 --- a/modules/python/doc/_autosummary/visp.io.VideoReader.rst +++ /dev/null @@ -1,74 +0,0 @@ -VideoReader -=========== - -.. currentmodule:: visp.io - -.. autoclass:: VideoReader - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~VideoReader.acquire - ~VideoReader.close - ~VideoReader.end - ~VideoReader.getFirstFrameIndex - ~VideoReader.getFrame - ~VideoReader.getFrameIndex - ~VideoReader.getFrameName - ~VideoReader.getFrameStep - ~VideoReader.getFramerate - ~VideoReader.getLastFrameIndex - ~VideoReader.isVideoFormat - ~VideoReader.open - ~VideoReader.resetFrameCounter - ~VideoReader.setFileName - ~VideoReader.setFirstFrameIndex - ~VideoReader.setFrameStep - ~VideoReader.setLastFrameIndex - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~VideoReader.getWidth - ~VideoReader.getHeight - ~VideoReader.init - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~VideoReader.__doc__ - ~VideoReader.__init__ - ~VideoReader.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~VideoReader.init - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.io.VideoWriter.rst b/modules/python/doc/_autosummary/visp.io.VideoWriter.rst deleted file mode 100644 index 6e4d6b29bd..0000000000 --- a/modules/python/doc/_autosummary/visp.io.VideoWriter.rst +++ /dev/null @@ -1,59 +0,0 @@ -VideoWriter -=========== - -.. currentmodule:: visp.io - -.. autoclass:: VideoWriter - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~VideoWriter.close - ~VideoWriter.getCurrentFrameIndex - ~VideoWriter.getFrameName - ~VideoWriter.open - ~VideoWriter.resetFrameCounter - ~VideoWriter.saveFrame - ~VideoWriter.setCodec - ~VideoWriter.setFileName - ~VideoWriter.setFirstFrameIndex - ~VideoWriter.setFrameStep - ~VideoWriter.setFramerate - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~VideoWriter.__doc__ - ~VideoWriter.__init__ - ~VideoWriter.__module__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.io.rst b/modules/python/doc/_autosummary/visp.io.rst deleted file mode 100644 index 79e0094ce9..0000000000 --- a/modules/python/doc/_autosummary/visp.io.rst +++ /dev/null @@ -1,37 +0,0 @@ -io -== - -.. automodule:: visp.io - - - - - - - - - - - - .. rubric:: Classes - - .. autosummary:: - :toctree: - :template: custom-class-template.rst - :nosignatures: - - DiskGrabber - ImageIo - Keyboard - ParallelPort - VideoReader - VideoWriter - - - - - - - - - diff --git a/modules/python/doc/_autosummary/visp.klt.KltOpencv.rst b/modules/python/doc/_autosummary/visp.klt.KltOpencv.rst deleted file mode 100644 index 8462f93794..0000000000 --- a/modules/python/doc/_autosummary/visp.klt.KltOpencv.rst +++ /dev/null @@ -1,78 +0,0 @@ -KltOpencv -========= - -.. currentmodule:: visp.klt - -.. autoclass:: KltOpencv - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~KltOpencv.addFeature - ~KltOpencv.display - ~KltOpencv.displaySelf - ~KltOpencv.getBlockSize - ~KltOpencv.getFeature - ~KltOpencv.getFeatures - ~KltOpencv.getFeaturesId - ~KltOpencv.getHarrisFreeParameter - ~KltOpencv.getMaxFeatures - ~KltOpencv.getMinDistance - ~KltOpencv.getNbFeatures - ~KltOpencv.getNbPrevFeatures - ~KltOpencv.getPrevFeatures - ~KltOpencv.getPyramidLevels - ~KltOpencv.getQuality - ~KltOpencv.getWindowSize - ~KltOpencv.initTracking - ~KltOpencv.setBlockSize - ~KltOpencv.setHarrisFreeParameter - ~KltOpencv.setInitialGuess - ~KltOpencv.setMaxFeatures - ~KltOpencv.setMinDistance - ~KltOpencv.setMinEigThreshold - ~KltOpencv.setPyramidLevels - ~KltOpencv.setQuality - ~KltOpencv.setTrackerId - ~KltOpencv.setUseHarris - ~KltOpencv.setWindowSize - ~KltOpencv.suppressFeature - ~KltOpencv.track - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~KltOpencv.__doc__ - ~KltOpencv.__init__ - ~KltOpencv.__module__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.klt.rst b/modules/python/doc/_autosummary/visp.klt.rst deleted file mode 100644 index a697997229..0000000000 --- a/modules/python/doc/_autosummary/visp.klt.rst +++ /dev/null @@ -1,32 +0,0 @@ -klt -=== - -.. automodule:: visp.klt - - - - - - - - - - - - .. rubric:: Classes - - .. autosummary:: - :toctree: - :template: custom-class-template.rst - :nosignatures: - - KltOpencv - - - - - - - - - diff --git a/modules/python/doc/_autosummary/visp.mbt.MbDepthDenseTracker.rst b/modules/python/doc/_autosummary/visp.mbt.MbDepthDenseTracker.rst deleted file mode 100644 index 49979c9c02..0000000000 --- a/modules/python/doc/_autosummary/visp.mbt.MbDepthDenseTracker.rst +++ /dev/null @@ -1,127 +0,0 @@ -MbDepthDenseTracker -=================== - -.. currentmodule:: visp.mbt - -.. autoclass:: MbDepthDenseTracker - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~MbDepthDenseTracker.display - ~MbDepthDenseTracker.getError - ~MbDepthDenseTracker.getModelForDisplay - ~MbDepthDenseTracker.getRobustWeights - ~MbDepthDenseTracker.init - ~MbDepthDenseTracker.loadConfigFile - ~MbDepthDenseTracker.reInitModel - ~MbDepthDenseTracker.resetTracker - ~MbDepthDenseTracker.setCameraParameters - ~MbDepthDenseTracker.setDepthDenseFilteringMaxDistance - ~MbDepthDenseTracker.setDepthDenseFilteringMethod - ~MbDepthDenseTracker.setDepthDenseFilteringMinDistance - ~MbDepthDenseTracker.setDepthDenseFilteringOccupancyRatio - ~MbDepthDenseTracker.setDepthDenseSamplingStep - ~MbDepthDenseTracker.setOgreVisibilityTest - ~MbDepthDenseTracker.setPose - ~MbDepthDenseTracker.setScanLineVisibilityTest - ~MbDepthDenseTracker.setUseDepthDenseTracking - ~MbDepthDenseTracker.testTracking - ~MbDepthDenseTracker.track - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~MbDepthDenseTracker.getEstimatedDoF - ~MbDepthDenseTracker.setCovarianceComputation - ~MbDepthDenseTracker.setLambda - ~MbDepthDenseTracker.setMinLineLengthThresh - ~MbDepthDenseTracker.setAngleAppear - ~MbDepthDenseTracker.setMinPolygonAreaThresh - ~MbDepthDenseTracker.getAngleAppear - ~MbDepthDenseTracker.setAngleDisappear - ~MbDepthDenseTracker.getNbPolygon - ~MbDepthDenseTracker.initFromPoints - ~MbDepthDenseTracker.setPoseSavingFilename - ~MbDepthDenseTracker.MbtOptimizationMethod - ~MbDepthDenseTracker.getClipping - ~MbDepthDenseTracker.getCameraParameters - ~MbDepthDenseTracker.setClipping - ~MbDepthDenseTracker.setProjectionErrorKernelSize - ~MbDepthDenseTracker.setProjectionErrorDisplayArrowThickness - ~MbDepthDenseTracker.setProjectionErrorDisplayArrowLength - ~MbDepthDenseTracker.setMask - ~MbDepthDenseTracker.getProjectionError - ~MbDepthDenseTracker.setDisplayFeatures - ~MbDepthDenseTracker.computeCurrentProjectionError - ~MbDepthDenseTracker.setEstimatedDoF - ~MbDepthDenseTracker.setProjectionErrorDisplay - ~MbDepthDenseTracker.getPolygonFaces - ~MbDepthDenseTracker.getInitialMu - ~MbDepthDenseTracker.setProjectionErrorMovingEdge - ~MbDepthDenseTracker.getMaxIter - ~MbDepthDenseTracker.getPose - ~MbDepthDenseTracker.getOptimizationMethod - ~MbDepthDenseTracker.setInitialMu - ~MbDepthDenseTracker.setProjectionErrorComputation - ~MbDepthDenseTracker.setMaxIter - ~MbDepthDenseTracker.setOptimizationMethod - ~MbDepthDenseTracker.initClick - ~MbDepthDenseTracker.setOgreShowConfigDialog - ~MbDepthDenseTracker.GAUSS_NEWTON_OPT - ~MbDepthDenseTracker.loadModel - ~MbDepthDenseTracker.getFarClippingDistance - ~MbDepthDenseTracker.getFaces - ~MbDepthDenseTracker.setLod - ~MbDepthDenseTracker.initFromPose - ~MbDepthDenseTracker.setFarClippingDistance - ~MbDepthDenseTracker.getAngleDisappear - ~MbDepthDenseTracker.setStopCriteriaEpsilon - ~MbDepthDenseTracker.getLambda - ~MbDepthDenseTracker.setNearClippingDistance - ~MbDepthDenseTracker.getCovarianceMatrix - ~MbDepthDenseTracker.getNearClippingDistance - ~MbDepthDenseTracker.LEVENBERG_MARQUARDT_OPT - ~MbDepthDenseTracker.getStopCriteriaEpsilon - ~MbDepthDenseTracker.savePose - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~MbDepthDenseTracker.__doc__ - ~MbDepthDenseTracker.__init__ - ~MbDepthDenseTracker.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~MbDepthDenseTracker.GAUSS_NEWTON_OPT - ~MbDepthDenseTracker.LEVENBERG_MARQUARDT_OPT - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.mbt.MbDepthNormalTracker.rst b/modules/python/doc/_autosummary/visp.mbt.MbDepthNormalTracker.rst deleted file mode 100644 index 40bdd480cd..0000000000 --- a/modules/python/doc/_autosummary/visp.mbt.MbDepthNormalTracker.rst +++ /dev/null @@ -1,129 +0,0 @@ -MbDepthNormalTracker -==================== - -.. currentmodule:: visp.mbt - -.. autoclass:: MbDepthNormalTracker - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~MbDepthNormalTracker.display - ~MbDepthNormalTracker.getDepthFeatureEstimationMethod - ~MbDepthNormalTracker.getError - ~MbDepthNormalTracker.getModelForDisplay - ~MbDepthNormalTracker.getRobustWeights - ~MbDepthNormalTracker.init - ~MbDepthNormalTracker.loadConfigFile - ~MbDepthNormalTracker.reInitModel - ~MbDepthNormalTracker.resetTracker - ~MbDepthNormalTracker.setCameraParameters - ~MbDepthNormalTracker.setDepthNormalFaceCentroidMethod - ~MbDepthNormalTracker.setDepthNormalFeatureEstimationMethod - ~MbDepthNormalTracker.setDepthNormalPclPlaneEstimationMethod - ~MbDepthNormalTracker.setDepthNormalPclPlaneEstimationRansacMaxIter - ~MbDepthNormalTracker.setDepthNormalPclPlaneEstimationRansacThreshold - ~MbDepthNormalTracker.setDepthNormalSamplingStep - ~MbDepthNormalTracker.setOgreVisibilityTest - ~MbDepthNormalTracker.setPose - ~MbDepthNormalTracker.setScanLineVisibilityTest - ~MbDepthNormalTracker.setUseDepthNormalTracking - ~MbDepthNormalTracker.testTracking - ~MbDepthNormalTracker.track - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~MbDepthNormalTracker.getInitialMu - ~MbDepthNormalTracker.getEstimatedDoF - ~MbDepthNormalTracker.setLambda - ~MbDepthNormalTracker.setCovarianceComputation - ~MbDepthNormalTracker.setProjectionErrorMovingEdge - ~MbDepthNormalTracker.getMaxIter - ~MbDepthNormalTracker.setMinLineLengthThresh - ~MbDepthNormalTracker.getPose - ~MbDepthNormalTracker.getOptimizationMethod - ~MbDepthNormalTracker.setAngleAppear - ~MbDepthNormalTracker.setInitialMu - ~MbDepthNormalTracker.setMinPolygonAreaThresh - ~MbDepthNormalTracker.setProjectionErrorComputation - ~MbDepthNormalTracker.setMaxIter - ~MbDepthNormalTracker.getAngleAppear - ~MbDepthNormalTracker.setOptimizationMethod - ~MbDepthNormalTracker.initClick - ~MbDepthNormalTracker.setAngleDisappear - ~MbDepthNormalTracker.getNbPolygon - ~MbDepthNormalTracker.setOgreShowConfigDialog - ~MbDepthNormalTracker.initFromPoints - ~MbDepthNormalTracker.savePose - ~MbDepthNormalTracker.GAUSS_NEWTON_OPT - ~MbDepthNormalTracker.setPoseSavingFilename - ~MbDepthNormalTracker.MbtOptimizationMethod - ~MbDepthNormalTracker.getClipping - ~MbDepthNormalTracker.getCameraParameters - ~MbDepthNormalTracker.loadModel - ~MbDepthNormalTracker.setClipping - ~MbDepthNormalTracker.getFarClippingDistance - ~MbDepthNormalTracker.getFaces - ~MbDepthNormalTracker.setLod - ~MbDepthNormalTracker.initFromPose - ~MbDepthNormalTracker.setFarClippingDistance - ~MbDepthNormalTracker.setProjectionErrorKernelSize - ~MbDepthNormalTracker.getAngleDisappear - ~MbDepthNormalTracker.setStopCriteriaEpsilon - ~MbDepthNormalTracker.getLambda - ~MbDepthNormalTracker.setProjectionErrorDisplayArrowThickness - ~MbDepthNormalTracker.setNearClippingDistance - ~MbDepthNormalTracker.setProjectionErrorDisplayArrowLength - ~MbDepthNormalTracker.getCovarianceMatrix - ~MbDepthNormalTracker.getNearClippingDistance - ~MbDepthNormalTracker.setMask - ~MbDepthNormalTracker.getProjectionError - ~MbDepthNormalTracker.setDisplayFeatures - ~MbDepthNormalTracker.LEVENBERG_MARQUARDT_OPT - ~MbDepthNormalTracker.getStopCriteriaEpsilon - ~MbDepthNormalTracker.computeCurrentProjectionError - ~MbDepthNormalTracker.setEstimatedDoF - ~MbDepthNormalTracker.setProjectionErrorDisplay - ~MbDepthNormalTracker.getPolygonFaces - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~MbDepthNormalTracker.__doc__ - ~MbDepthNormalTracker.__init__ - ~MbDepthNormalTracker.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~MbDepthNormalTracker.GAUSS_NEWTON_OPT - ~MbDepthNormalTracker.LEVENBERG_MARQUARDT_OPT - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.mbt.MbEdgeKltTracker.rst b/modules/python/doc/_autosummary/visp.mbt.MbEdgeKltTracker.rst deleted file mode 100644 index 670a855e32..0000000000 --- a/modules/python/doc/_autosummary/visp.mbt.MbEdgeKltTracker.rst +++ /dev/null @@ -1,151 +0,0 @@ -MbEdgeKltTracker -================ - -.. currentmodule:: visp.mbt - -.. autoclass:: MbEdgeKltTracker - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~MbEdgeKltTracker.display - ~MbEdgeKltTracker.getError - ~MbEdgeKltTracker.getModelForDisplay - ~MbEdgeKltTracker.getNearClippingDistance - ~MbEdgeKltTracker.getRobustWeights - ~MbEdgeKltTracker.loadConfigFile - ~MbEdgeKltTracker.reInitModel - ~MbEdgeKltTracker.resetTracker - ~MbEdgeKltTracker.setCameraParameters - ~MbEdgeKltTracker.setClipping - ~MbEdgeKltTracker.setFarClippingDistance - ~MbEdgeKltTracker.setNearClippingDistance - ~MbEdgeKltTracker.setOgreVisibilityTest - ~MbEdgeKltTracker.setPose - ~MbEdgeKltTracker.setProjectionErrorComputation - ~MbEdgeKltTracker.setScanLineVisibilityTest - ~MbEdgeKltTracker.testTracking - ~MbEdgeKltTracker.track - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~MbEdgeKltTracker.getEstimatedDoF - ~MbEdgeKltTracker.setCovarianceComputation - ~MbEdgeKltTracker.setLambda - ~MbEdgeKltTracker.setMovingEdge - ~MbEdgeKltTracker.setMinLineLengthThresh - ~MbEdgeKltTracker.addCircle - ~MbEdgeKltTracker.setAngleAppear - ~MbEdgeKltTracker.setMinPolygonAreaThresh - ~MbEdgeKltTracker.getLcylinder - ~MbEdgeKltTracker.getAngleAppear - ~MbEdgeKltTracker.getLline - ~MbEdgeKltTracker.setKltThresholdAcceptation - ~MbEdgeKltTracker.setThresholdAcceptation - ~MbEdgeKltTracker.setAngleDisappear - ~MbEdgeKltTracker.getNbPolygon - ~MbEdgeKltTracker.initFromPoints - ~MbEdgeKltTracker.setScales - ~MbEdgeKltTracker.getThresholdAcceptation - ~MbEdgeKltTracker.getFeaturesCircle - ~MbEdgeKltTracker.setPoseSavingFilename - ~MbEdgeKltTracker.MbtOptimizationMethod - ~MbEdgeKltTracker.getKltOpencv - ~MbEdgeKltTracker.getNbPoints - ~MbEdgeKltTracker.getFeaturesKltCylinder - ~MbEdgeKltTracker.getMaskBorder - ~MbEdgeKltTracker.getClipping - ~MbEdgeKltTracker.getKltPoints - ~MbEdgeKltTracker.getCameraParameters - ~MbEdgeKltTracker.setKltMaskBorder - ~MbEdgeKltTracker.setProjectionErrorKernelSize - ~MbEdgeKltTracker.setProjectionErrorDisplayArrowThickness - ~MbEdgeKltTracker.getKltImagePoints - ~MbEdgeKltTracker.setProjectionErrorDisplayArrowLength - ~MbEdgeKltTracker.getKltThresholdAcceptation - ~MbEdgeKltTracker.setMask - ~MbEdgeKltTracker.getProjectionError - ~MbEdgeKltTracker.setDisplayFeatures - ~MbEdgeKltTracker.getFeaturesKlt - ~MbEdgeKltTracker.computeCurrentProjectionError - ~MbEdgeKltTracker.getKltMaskBorder - ~MbEdgeKltTracker.setEstimatedDoF - ~MbEdgeKltTracker.setGoodMovingEdgesRatioThreshold - ~MbEdgeKltTracker.setProjectionErrorDisplay - ~MbEdgeKltTracker.getNbKltPoints - ~MbEdgeKltTracker.getPolygonFaces - ~MbEdgeKltTracker.getInitialMu - ~MbEdgeKltTracker.setProjectionErrorMovingEdge - ~MbEdgeKltTracker.getMaxIter - ~MbEdgeKltTracker.setKltOpencv - ~MbEdgeKltTracker.getPose - ~MbEdgeKltTracker.getOptimizationMethod - ~MbEdgeKltTracker.setInitialMu - ~MbEdgeKltTracker.setMaxIter - ~MbEdgeKltTracker.setOptimizationMethod - ~MbEdgeKltTracker.initClick - ~MbEdgeKltTracker.getMovingEdge - ~MbEdgeKltTracker.getGoodMovingEdgesRatioThreshold - ~MbEdgeKltTracker.setOgreShowConfigDialog - ~MbEdgeKltTracker.GAUSS_NEWTON_OPT - ~MbEdgeKltTracker.setUseKltTracking - ~MbEdgeKltTracker.getScales - ~MbEdgeKltTracker.setUseEdgeTracking - ~MbEdgeKltTracker.loadModel - ~MbEdgeKltTracker.getFarClippingDistance - ~MbEdgeKltTracker.getFaces - ~MbEdgeKltTracker.setLod - ~MbEdgeKltTracker.initFromPose - ~MbEdgeKltTracker.getAngleDisappear - ~MbEdgeKltTracker.setStopCriteriaEpsilon - ~MbEdgeKltTracker.getLambda - ~MbEdgeKltTracker.setMaskBorder - ~MbEdgeKltTracker.getKltImagePointsWithId - ~MbEdgeKltTracker.getCovarianceMatrix - ~MbEdgeKltTracker.LEVENBERG_MARQUARDT_OPT - ~MbEdgeKltTracker.getLcircle - ~MbEdgeKltTracker.getStopCriteriaEpsilon - ~MbEdgeKltTracker.getKltNbPoints - ~MbEdgeKltTracker.savePose - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~MbEdgeKltTracker.__doc__ - ~MbEdgeKltTracker.__init__ - ~MbEdgeKltTracker.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~MbEdgeKltTracker.GAUSS_NEWTON_OPT - ~MbEdgeKltTracker.LEVENBERG_MARQUARDT_OPT - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.mbt.MbEdgeTracker.rst b/modules/python/doc/_autosummary/visp.mbt.MbEdgeTracker.rst deleted file mode 100644 index 4b42128a58..0000000000 --- a/modules/python/doc/_autosummary/visp.mbt.MbEdgeTracker.rst +++ /dev/null @@ -1,130 +0,0 @@ -MbEdgeTracker -============= - -.. currentmodule:: visp.mbt - -.. autoclass:: MbEdgeTracker - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~MbEdgeTracker.display - ~MbEdgeTracker.getError - ~MbEdgeTracker.getGoodMovingEdgesRatioThreshold - ~MbEdgeTracker.getLcircle - ~MbEdgeTracker.getLcylinder - ~MbEdgeTracker.getLline - ~MbEdgeTracker.getModelForDisplay - ~MbEdgeTracker.getMovingEdge - ~MbEdgeTracker.getNbPoints - ~MbEdgeTracker.getRobustWeights - ~MbEdgeTracker.getScales - ~MbEdgeTracker.loadConfigFile - ~MbEdgeTracker.reInitModel - ~MbEdgeTracker.resetTracker - ~MbEdgeTracker.setCameraParameters - ~MbEdgeTracker.setClipping - ~MbEdgeTracker.setFarClippingDistance - ~MbEdgeTracker.setGoodMovingEdgesRatioThreshold - ~MbEdgeTracker.setMovingEdge - ~MbEdgeTracker.setNearClippingDistance - ~MbEdgeTracker.setOgreVisibilityTest - ~MbEdgeTracker.setPose - ~MbEdgeTracker.setScales - ~MbEdgeTracker.setScanLineVisibilityTest - ~MbEdgeTracker.setUseEdgeTracking - ~MbEdgeTracker.track - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~MbEdgeTracker.getInitialMu - ~MbEdgeTracker.getEstimatedDoF - ~MbEdgeTracker.setLambda - ~MbEdgeTracker.setCovarianceComputation - ~MbEdgeTracker.setProjectionErrorMovingEdge - ~MbEdgeTracker.getMaxIter - ~MbEdgeTracker.setMinLineLengthThresh - ~MbEdgeTracker.getPose - ~MbEdgeTracker.getOptimizationMethod - ~MbEdgeTracker.setAngleAppear - ~MbEdgeTracker.setInitialMu - ~MbEdgeTracker.setMinPolygonAreaThresh - ~MbEdgeTracker.setProjectionErrorComputation - ~MbEdgeTracker.setMaxIter - ~MbEdgeTracker.getAngleAppear - ~MbEdgeTracker.setOptimizationMethod - ~MbEdgeTracker.initClick - ~MbEdgeTracker.setAngleDisappear - ~MbEdgeTracker.getNbPolygon - ~MbEdgeTracker.setOgreShowConfigDialog - ~MbEdgeTracker.initFromPoints - ~MbEdgeTracker.savePose - ~MbEdgeTracker.GAUSS_NEWTON_OPT - ~MbEdgeTracker.setPoseSavingFilename - ~MbEdgeTracker.MbtOptimizationMethod - ~MbEdgeTracker.getClipping - ~MbEdgeTracker.getCameraParameters - ~MbEdgeTracker.loadModel - ~MbEdgeTracker.getFarClippingDistance - ~MbEdgeTracker.getFaces - ~MbEdgeTracker.setLod - ~MbEdgeTracker.initFromPose - ~MbEdgeTracker.getAngleDisappear - ~MbEdgeTracker.setProjectionErrorKernelSize - ~MbEdgeTracker.setStopCriteriaEpsilon - ~MbEdgeTracker.getLambda - ~MbEdgeTracker.setProjectionErrorDisplayArrowThickness - ~MbEdgeTracker.setProjectionErrorDisplayArrowLength - ~MbEdgeTracker.getCovarianceMatrix - ~MbEdgeTracker.getNearClippingDistance - ~MbEdgeTracker.setMask - ~MbEdgeTracker.getProjectionError - ~MbEdgeTracker.setDisplayFeatures - ~MbEdgeTracker.LEVENBERG_MARQUARDT_OPT - ~MbEdgeTracker.getStopCriteriaEpsilon - ~MbEdgeTracker.computeCurrentProjectionError - ~MbEdgeTracker.setEstimatedDoF - ~MbEdgeTracker.setProjectionErrorDisplay - ~MbEdgeTracker.getPolygonFaces - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~MbEdgeTracker.__doc__ - ~MbEdgeTracker.__init__ - ~MbEdgeTracker.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~MbEdgeTracker.GAUSS_NEWTON_OPT - ~MbEdgeTracker.LEVENBERG_MARQUARDT_OPT - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.mbt.MbGenericTracker.rst b/modules/python/doc/_autosummary/visp.mbt.MbGenericTracker.rst deleted file mode 100644 index d85a201e14..0000000000 --- a/modules/python/doc/_autosummary/visp.mbt.MbGenericTracker.rst +++ /dev/null @@ -1,175 +0,0 @@ -MbGenericTracker -================ - -.. currentmodule:: visp.mbt - -.. autoclass:: MbGenericTracker - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~MbGenericTracker.computeCurrentProjectionError - ~MbGenericTracker.display - ~MbGenericTracker.getCameraNames - ~MbGenericTracker.getCameraParameters - ~MbGenericTracker.getCameraTrackerTypes - ~MbGenericTracker.getClipping - ~MbGenericTracker.getError - ~MbGenericTracker.getFaces - ~MbGenericTracker.getFeaturesCircle - ~MbGenericTracker.getFeaturesForDisplay - ~MbGenericTracker.getFeaturesKlt - ~MbGenericTracker.getFeaturesKltCylinder - ~MbGenericTracker.getGoodMovingEdgesRatioThreshold - ~MbGenericTracker.getKltImagePoints - ~MbGenericTracker.getKltImagePointsWithId - ~MbGenericTracker.getKltMaskBorder - ~MbGenericTracker.getKltNbPoints - ~MbGenericTracker.getKltOpencv - ~MbGenericTracker.getKltPoints - ~MbGenericTracker.getKltThresholdAcceptation - ~MbGenericTracker.getLcircle - ~MbGenericTracker.getLcylinder - ~MbGenericTracker.getLline - ~MbGenericTracker.getModelForDisplay - ~MbGenericTracker.getMovingEdge - ~MbGenericTracker.getNbFeaturesDepthDense - ~MbGenericTracker.getNbFeaturesDepthNormal - ~MbGenericTracker.getNbFeaturesEdge - ~MbGenericTracker.getNbFeaturesKlt - ~MbGenericTracker.getNbPoints - ~MbGenericTracker.getNbPolygon - ~MbGenericTracker.getPolygonFaces - ~MbGenericTracker.getPose - ~MbGenericTracker.getReferenceCameraName - ~MbGenericTracker.getRobustWeights - ~MbGenericTracker.getTrackerType - ~MbGenericTracker.init - ~MbGenericTracker.initClick - ~MbGenericTracker.initFromPoints - ~MbGenericTracker.initFromPose - ~MbGenericTracker.loadConfigFile - ~MbGenericTracker.loadModel - ~MbGenericTracker.reInitModel - ~MbGenericTracker.resetTracker - ~MbGenericTracker.saveConfigFile - ~MbGenericTracker.setAngleAppear - ~MbGenericTracker.setAngleDisappear - ~MbGenericTracker.setCameraParameters - ~MbGenericTracker.setCameraTransformationMatrix - ~MbGenericTracker.setClipping - ~MbGenericTracker.setDepthDenseFilteringMaxDistance - ~MbGenericTracker.setDepthDenseFilteringMethod - ~MbGenericTracker.setDepthDenseFilteringMinDistance - ~MbGenericTracker.setDepthDenseFilteringOccupancyRatio - ~MbGenericTracker.setDepthDenseSamplingStep - ~MbGenericTracker.setDepthNormalFaceCentroidMethod - ~MbGenericTracker.setDepthNormalFeatureEstimationMethod - ~MbGenericTracker.setDepthNormalPclPlaneEstimationMethod - ~MbGenericTracker.setDepthNormalPclPlaneEstimationRansacMaxIter - ~MbGenericTracker.setDepthNormalPclPlaneEstimationRansacThreshold - ~MbGenericTracker.setDepthNormalSamplingStep - ~MbGenericTracker.setDisplayFeatures - ~MbGenericTracker.setFarClippingDistance - ~MbGenericTracker.setFeatureFactors - ~MbGenericTracker.setGoodMovingEdgesRatioThreshold - ~MbGenericTracker.setKltMaskBorder - ~MbGenericTracker.setKltOpencv - ~MbGenericTracker.setKltThresholdAcceptation - ~MbGenericTracker.setLod - ~MbGenericTracker.setMask - ~MbGenericTracker.setMinLineLengthThresh - ~MbGenericTracker.setMinPolygonAreaThresh - ~MbGenericTracker.setMovingEdge - ~MbGenericTracker.setNearClippingDistance - ~MbGenericTracker.setOgreShowConfigDialog - ~MbGenericTracker.setOgreVisibilityTest - ~MbGenericTracker.setOptimizationMethod - ~MbGenericTracker.setPose - ~MbGenericTracker.setProjectionErrorComputation - ~MbGenericTracker.setProjectionErrorDisplay - ~MbGenericTracker.setProjectionErrorDisplayArrowLength - ~MbGenericTracker.setProjectionErrorDisplayArrowThickness - ~MbGenericTracker.setReferenceCameraName - ~MbGenericTracker.setScanLineVisibilityTest - ~MbGenericTracker.setTrackerType - ~MbGenericTracker.setUseDepthDenseTracking - ~MbGenericTracker.setUseDepthNormalTracking - ~MbGenericTracker.setUseEdgeTracking - ~MbGenericTracker.setUseKltTracking - ~MbGenericTracker.testTracking - ~MbGenericTracker.track - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~MbGenericTracker.getInitialMu - ~MbGenericTracker.getEstimatedDoF - ~MbGenericTracker.setLambda - ~MbGenericTracker.setCovarianceComputation - ~MbGenericTracker.setProjectionErrorMovingEdge - ~MbGenericTracker.getMaxIter - ~MbGenericTracker.getOptimizationMethod - ~MbGenericTracker.setInitialMu - ~MbGenericTracker.setMaxIter - ~MbGenericTracker.getAngleAppear - ~MbGenericTracker.GAUSS_NEWTON_OPT - ~MbGenericTracker.setPoseSavingFilename - ~MbGenericTracker.MbtOptimizationMethod - ~MbGenericTracker.getFarClippingDistance - ~MbGenericTracker.getAngleDisappear - ~MbGenericTracker.setStopCriteriaEpsilon - ~MbGenericTracker.setProjectionErrorKernelSize - ~MbGenericTracker.getLambda - ~MbGenericTracker.getCovarianceMatrix - ~MbGenericTracker.getNearClippingDistance - ~MbGenericTracker.getProjectionError - ~MbGenericTracker.LEVENBERG_MARQUARDT_OPT - ~MbGenericTracker.getStopCriteriaEpsilon - ~MbGenericTracker.setEstimatedDoF - ~MbGenericTracker.savePose - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~MbGenericTracker.__doc__ - ~MbGenericTracker.__init__ - ~MbGenericTracker.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~MbGenericTracker.DEPTH_DENSE_TRACKER - ~MbGenericTracker.DEPTH_NORMAL_TRACKER - ~MbGenericTracker.EDGE_TRACKER - ~MbGenericTracker.GAUSS_NEWTON_OPT - ~MbGenericTracker.KLT_TRACKER - ~MbGenericTracker.LEVENBERG_MARQUARDT_OPT - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.mbt.MbKltTracker.rst b/modules/python/doc/_autosummary/visp.mbt.MbKltTracker.rst deleted file mode 100644 index e6f776aac1..0000000000 --- a/modules/python/doc/_autosummary/visp.mbt.MbKltTracker.rst +++ /dev/null @@ -1,140 +0,0 @@ -MbKltTracker -============ - -.. currentmodule:: visp.mbt - -.. autoclass:: MbKltTracker - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~MbKltTracker.addCircle - ~MbKltTracker.display - ~MbKltTracker.getError - ~MbKltTracker.getFeaturesCircle - ~MbKltTracker.getFeaturesKlt - ~MbKltTracker.getFeaturesKltCylinder - ~MbKltTracker.getKltImagePoints - ~MbKltTracker.getKltImagePointsWithId - ~MbKltTracker.getKltMaskBorder - ~MbKltTracker.getKltNbPoints - ~MbKltTracker.getKltOpencv - ~MbKltTracker.getKltPoints - ~MbKltTracker.getKltThresholdAcceptation - ~MbKltTracker.getMaskBorder - ~MbKltTracker.getModelForDisplay - ~MbKltTracker.getNbKltPoints - ~MbKltTracker.getRobustWeights - ~MbKltTracker.getThresholdAcceptation - ~MbKltTracker.loadConfigFile - ~MbKltTracker.reInitModel - ~MbKltTracker.resetTracker - ~MbKltTracker.setCameraParameters - ~MbKltTracker.setKltMaskBorder - ~MbKltTracker.setKltOpencv - ~MbKltTracker.setKltThresholdAcceptation - ~MbKltTracker.setMaskBorder - ~MbKltTracker.setOgreVisibilityTest - ~MbKltTracker.setPose - ~MbKltTracker.setProjectionErrorComputation - ~MbKltTracker.setScanLineVisibilityTest - ~MbKltTracker.setThresholdAcceptation - ~MbKltTracker.setUseKltTracking - ~MbKltTracker.testTracking - ~MbKltTracker.track - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~MbKltTracker.getInitialMu - ~MbKltTracker.getEstimatedDoF - ~MbKltTracker.setLambda - ~MbKltTracker.setCovarianceComputation - ~MbKltTracker.setProjectionErrorMovingEdge - ~MbKltTracker.getMaxIter - ~MbKltTracker.setMinLineLengthThresh - ~MbKltTracker.getPose - ~MbKltTracker.getOptimizationMethod - ~MbKltTracker.setAngleAppear - ~MbKltTracker.setInitialMu - ~MbKltTracker.setMinPolygonAreaThresh - ~MbKltTracker.setMaxIter - ~MbKltTracker.getAngleAppear - ~MbKltTracker.setOptimizationMethod - ~MbKltTracker.initClick - ~MbKltTracker.setAngleDisappear - ~MbKltTracker.getNbPolygon - ~MbKltTracker.setOgreShowConfigDialog - ~MbKltTracker.initFromPoints - ~MbKltTracker.savePose - ~MbKltTracker.GAUSS_NEWTON_OPT - ~MbKltTracker.setPoseSavingFilename - ~MbKltTracker.MbtOptimizationMethod - ~MbKltTracker.getClipping - ~MbKltTracker.getCameraParameters - ~MbKltTracker.loadModel - ~MbKltTracker.setClipping - ~MbKltTracker.getFarClippingDistance - ~MbKltTracker.getFaces - ~MbKltTracker.setLod - ~MbKltTracker.initFromPose - ~MbKltTracker.setFarClippingDistance - ~MbKltTracker.setProjectionErrorKernelSize - ~MbKltTracker.getAngleDisappear - ~MbKltTracker.setStopCriteriaEpsilon - ~MbKltTracker.getLambda - ~MbKltTracker.setProjectionErrorDisplayArrowThickness - ~MbKltTracker.setNearClippingDistance - ~MbKltTracker.setProjectionErrorDisplayArrowLength - ~MbKltTracker.getCovarianceMatrix - ~MbKltTracker.getNearClippingDistance - ~MbKltTracker.setMask - ~MbKltTracker.getProjectionError - ~MbKltTracker.setDisplayFeatures - ~MbKltTracker.LEVENBERG_MARQUARDT_OPT - ~MbKltTracker.getStopCriteriaEpsilon - ~MbKltTracker.computeCurrentProjectionError - ~MbKltTracker.setEstimatedDoF - ~MbKltTracker.setProjectionErrorDisplay - ~MbKltTracker.getPolygonFaces - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~MbKltTracker.__doc__ - ~MbKltTracker.__init__ - ~MbKltTracker.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~MbKltTracker.GAUSS_NEWTON_OPT - ~MbKltTracker.LEVENBERG_MARQUARDT_OPT - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.mbt.MbTracker.rst b/modules/python/doc/_autosummary/visp.mbt.MbTracker.rst deleted file mode 100644 index f314187166..0000000000 --- a/modules/python/doc/_autosummary/visp.mbt.MbTracker.rst +++ /dev/null @@ -1,108 +0,0 @@ -MbTracker -========= - -.. currentmodule:: visp.mbt - -.. autoclass:: MbTracker - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~MbTracker.computeCurrentProjectionError - ~MbTracker.getAngleAppear - ~MbTracker.getAngleDisappear - ~MbTracker.getCameraParameters - ~MbTracker.getClipping - ~MbTracker.getCovarianceMatrix - ~MbTracker.getEstimatedDoF - ~MbTracker.getFaces - ~MbTracker.getFarClippingDistance - ~MbTracker.getInitialMu - ~MbTracker.getLambda - ~MbTracker.getMaxIter - ~MbTracker.getNbPolygon - ~MbTracker.getNearClippingDistance - ~MbTracker.getOptimizationMethod - ~MbTracker.getPolygonFaces - ~MbTracker.getPose - ~MbTracker.getProjectionError - ~MbTracker.getStopCriteriaEpsilon - ~MbTracker.initClick - ~MbTracker.initFromPoints - ~MbTracker.initFromPose - ~MbTracker.loadConfigFile - ~MbTracker.loadModel - ~MbTracker.savePose - ~MbTracker.setAngleAppear - ~MbTracker.setAngleDisappear - ~MbTracker.setCameraParameters - ~MbTracker.setClipping - ~MbTracker.setCovarianceComputation - ~MbTracker.setDisplayFeatures - ~MbTracker.setEstimatedDoF - ~MbTracker.setFarClippingDistance - ~MbTracker.setInitialMu - ~MbTracker.setLambda - ~MbTracker.setLod - ~MbTracker.setMask - ~MbTracker.setMaxIter - ~MbTracker.setMinLineLengthThresh - ~MbTracker.setMinPolygonAreaThresh - ~MbTracker.setNearClippingDistance - ~MbTracker.setOgreShowConfigDialog - ~MbTracker.setOgreVisibilityTest - ~MbTracker.setOptimizationMethod - ~MbTracker.setPoseSavingFilename - ~MbTracker.setProjectionErrorComputation - ~MbTracker.setProjectionErrorDisplay - ~MbTracker.setProjectionErrorDisplayArrowLength - ~MbTracker.setProjectionErrorDisplayArrowThickness - ~MbTracker.setProjectionErrorKernelSize - ~MbTracker.setProjectionErrorMovingEdge - ~MbTracker.setScanLineVisibilityTest - ~MbTracker.setStopCriteriaEpsilon - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~MbTracker.__doc__ - ~MbTracker.__init__ - ~MbTracker.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~MbTracker.GAUSS_NEWTON_OPT - ~MbTracker.LEVENBERG_MARQUARDT_OPT - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.mbt.MbtDistanceCircle.rst b/modules/python/doc/_autosummary/visp.mbt.MbtDistanceCircle.rst deleted file mode 100644 index 7b194ee775..0000000000 --- a/modules/python/doc/_autosummary/visp.mbt.MbtDistanceCircle.rst +++ /dev/null @@ -1,81 +0,0 @@ -MbtDistanceCircle -================= - -.. currentmodule:: visp.mbt - -.. autoclass:: MbtDistanceCircle - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~MbtDistanceCircle.buildFrom - ~MbtDistanceCircle.computeInteractionMatrixError - ~MbtDistanceCircle.display - ~MbtDistanceCircle.displayMovingEdges - ~MbtDistanceCircle.getCameraParameters - ~MbtDistanceCircle.getFeaturesForDisplay - ~MbtDistanceCircle.getIndex - ~MbtDistanceCircle.getMeanWeight - ~MbtDistanceCircle.getModelForDisplay - ~MbtDistanceCircle.getName - ~MbtDistanceCircle.initInteractionMatrixError - ~MbtDistanceCircle.isTracked - ~MbtDistanceCircle.isVisible - ~MbtDistanceCircle.setCameraParameters - ~MbtDistanceCircle.setIndex - ~MbtDistanceCircle.setMeanWeight - ~MbtDistanceCircle.setName - ~MbtDistanceCircle.setTracked - ~MbtDistanceCircle.setVisible - ~MbtDistanceCircle.trackMovingEdge - ~MbtDistanceCircle.updateMovingEdge - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~MbtDistanceCircle.__doc__ - ~MbtDistanceCircle.__init__ - ~MbtDistanceCircle.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~MbtDistanceCircle.L - ~MbtDistanceCircle.Reinit - ~MbtDistanceCircle.error - ~MbtDistanceCircle.index_polygon - ~MbtDistanceCircle.isvisible - ~MbtDistanceCircle.nbFeature - ~MbtDistanceCircle.radius - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.mbt.MbtDistanceCylinder.rst b/modules/python/doc/_autosummary/visp.mbt.MbtDistanceCylinder.rst deleted file mode 100644 index 0231516000..0000000000 --- a/modules/python/doc/_autosummary/visp.mbt.MbtDistanceCylinder.rst +++ /dev/null @@ -1,85 +0,0 @@ -MbtDistanceCylinder -=================== - -.. currentmodule:: visp.mbt - -.. autoclass:: MbtDistanceCylinder - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~MbtDistanceCylinder.buildFrom - ~MbtDistanceCylinder.computeInteractionMatrixError - ~MbtDistanceCylinder.display - ~MbtDistanceCylinder.displayMovingEdges - ~MbtDistanceCylinder.getCameraParameters - ~MbtDistanceCylinder.getFeaturesForDisplay - ~MbtDistanceCylinder.getIndex - ~MbtDistanceCylinder.getMeanWeight1 - ~MbtDistanceCylinder.getMeanWeight2 - ~MbtDistanceCylinder.getModelForDisplay - ~MbtDistanceCylinder.getName - ~MbtDistanceCylinder.initInteractionMatrixError - ~MbtDistanceCylinder.isTracked - ~MbtDistanceCylinder.isVisible - ~MbtDistanceCylinder.setCameraParameters - ~MbtDistanceCylinder.setIndex - ~MbtDistanceCylinder.setMeanWeight1 - ~MbtDistanceCylinder.setMeanWeight2 - ~MbtDistanceCylinder.setName - ~MbtDistanceCylinder.setTracked - ~MbtDistanceCylinder.setVisible - ~MbtDistanceCylinder.trackMovingEdge - ~MbtDistanceCylinder.updateMovingEdge - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~MbtDistanceCylinder.__doc__ - ~MbtDistanceCylinder.__init__ - ~MbtDistanceCylinder.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~MbtDistanceCylinder.L - ~MbtDistanceCylinder.Reinit - ~MbtDistanceCylinder.error - ~MbtDistanceCylinder.index_polygon - ~MbtDistanceCylinder.isvisible - ~MbtDistanceCylinder.nbFeature - ~MbtDistanceCylinder.nbFeaturel1 - ~MbtDistanceCylinder.nbFeaturel2 - ~MbtDistanceCylinder.radius - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.mbt.MbtDistanceKltCylinder.rst b/modules/python/doc/_autosummary/visp.mbt.MbtDistanceKltCylinder.rst deleted file mode 100644 index 5e4f3644ae..0000000000 --- a/modules/python/doc/_autosummary/visp.mbt.MbtDistanceKltCylinder.rst +++ /dev/null @@ -1,75 +0,0 @@ -MbtDistanceKltCylinder -====================== - -.. currentmodule:: visp.mbt - -.. autoclass:: MbtDistanceKltCylinder - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~MbtDistanceKltCylinder.buildFrom - ~MbtDistanceKltCylinder.computeInteractionMatrixAndResidu - ~MbtDistanceKltCylinder.computeNbDetectedCurrent - ~MbtDistanceKltCylinder.display - ~MbtDistanceKltCylinder.displayPrimitive - ~MbtDistanceKltCylinder.getCameraParameters - ~MbtDistanceKltCylinder.getCurrentNumberPoints - ~MbtDistanceKltCylinder.getCurrentPoints - ~MbtDistanceKltCylinder.getCurrentPointsInd - ~MbtDistanceKltCylinder.getCylinder - ~MbtDistanceKltCylinder.getFeaturesForDisplay - ~MbtDistanceKltCylinder.getInitialNumberPoint - ~MbtDistanceKltCylinder.getModelForDisplay - ~MbtDistanceKltCylinder.hasEnoughPoints - ~MbtDistanceKltCylinder.init - ~MbtDistanceKltCylinder.isTracked - ~MbtDistanceKltCylinder.removeOutliers - ~MbtDistanceKltCylinder.setCameraParameters - ~MbtDistanceKltCylinder.setTracked - ~MbtDistanceKltCylinder.updateMask - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~MbtDistanceKltCylinder.__doc__ - ~MbtDistanceKltCylinder.__init__ - ~MbtDistanceKltCylinder.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~MbtDistanceKltCylinder.listIndicesCylinderBBox - ~MbtDistanceKltCylinder.useScanLine - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.mbt.MbtDistanceKltPoints.rst b/modules/python/doc/_autosummary/visp.mbt.MbtDistanceKltPoints.rst deleted file mode 100644 index f07bbf6583..0000000000 --- a/modules/python/doc/_autosummary/visp.mbt.MbtDistanceKltPoints.rst +++ /dev/null @@ -1,72 +0,0 @@ -MbtDistanceKltPoints -==================== - -.. currentmodule:: visp.mbt - -.. autoclass:: MbtDistanceKltPoints - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~MbtDistanceKltPoints.computeHomography - ~MbtDistanceKltPoints.computeInteractionMatrixAndResidu - ~MbtDistanceKltPoints.display - ~MbtDistanceKltPoints.displayPrimitive - ~MbtDistanceKltPoints.getCameraParameters - ~MbtDistanceKltPoints.getCurrentNormal - ~MbtDistanceKltPoints.getCurrentNumberPoints - ~MbtDistanceKltPoints.getCurrentPoints - ~MbtDistanceKltPoints.getCurrentPointsInd - ~MbtDistanceKltPoints.getFeaturesForDisplay - ~MbtDistanceKltPoints.getInitialNumberPoint - ~MbtDistanceKltPoints.getModelForDisplay - ~MbtDistanceKltPoints.hasEnoughPoints - ~MbtDistanceKltPoints.isTracked - ~MbtDistanceKltPoints.removeOutliers - ~MbtDistanceKltPoints.setCameraParameters - ~MbtDistanceKltPoints.setTracked - ~MbtDistanceKltPoints.updateMask - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~MbtDistanceKltPoints.__doc__ - ~MbtDistanceKltPoints.__init__ - ~MbtDistanceKltPoints.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~MbtDistanceKltPoints.useScanLine - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.mbt.MbtDistanceLine.rst b/modules/python/doc/_autosummary/visp.mbt.MbtDistanceLine.rst deleted file mode 100644 index 32196e6ad5..0000000000 --- a/modules/python/doc/_autosummary/visp.mbt.MbtDistanceLine.rst +++ /dev/null @@ -1,88 +0,0 @@ -MbtDistanceLine -=============== - -.. currentmodule:: visp.mbt - -.. autoclass:: MbtDistanceLine - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~MbtDistanceLine.addPolygon - ~MbtDistanceLine.buildFrom - ~MbtDistanceLine.closeToImageBorder - ~MbtDistanceLine.computeInteractionMatrixError - ~MbtDistanceLine.display - ~MbtDistanceLine.displayMovingEdges - ~MbtDistanceLine.getCameraParameters - ~MbtDistanceLine.getFeaturesForDisplay - ~MbtDistanceLine.getIndex - ~MbtDistanceLine.getMeanWeight - ~MbtDistanceLine.getModelForDisplay - ~MbtDistanceLine.getName - ~MbtDistanceLine.getPolygon - ~MbtDistanceLine.initInteractionMatrixError - ~MbtDistanceLine.isTracked - ~MbtDistanceLine.isVisible - ~MbtDistanceLine.setCameraParameters - ~MbtDistanceLine.setIndex - ~MbtDistanceLine.setMeanWeight - ~MbtDistanceLine.setName - ~MbtDistanceLine.setTracked - ~MbtDistanceLine.setVisible - ~MbtDistanceLine.trackMovingEdge - ~MbtDistanceLine.updateMovingEdge - ~MbtDistanceLine.updateTracked - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~MbtDistanceLine.__doc__ - ~MbtDistanceLine.__init__ - ~MbtDistanceLine.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~MbtDistanceLine.L - ~MbtDistanceLine.Lindex_polygon - ~MbtDistanceLine.Lindex_polygon_tracked - ~MbtDistanceLine.Reinit - ~MbtDistanceLine.eline - ~MbtDistanceLine.error - ~MbtDistanceLine.isvisible - ~MbtDistanceLine.nbFeature - ~MbtDistanceLine.nbFeatureTotal - ~MbtDistanceLine.useScanLine - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.mbt.MbtFaceDepthDense.rst b/modules/python/doc/_autosummary/visp.mbt.MbtFaceDepthDense.rst deleted file mode 100644 index 886acd2a2b..0000000000 --- a/modules/python/doc/_autosummary/visp.mbt.MbtFaceDepthDense.rst +++ /dev/null @@ -1,79 +0,0 @@ -MbtFaceDepthDense -================= - -.. currentmodule:: visp.mbt - -.. autoclass:: MbtFaceDepthDense - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~MbtFaceDepthDense.computeInteractionMatrixAndResidu - ~MbtFaceDepthDense.computeVisibility - ~MbtFaceDepthDense.computeVisibilityDisplay - ~MbtFaceDepthDense.display - ~MbtFaceDepthDense.displayFeature - ~MbtFaceDepthDense.getModelForDisplay - ~MbtFaceDepthDense.getNbFeatures - ~MbtFaceDepthDense.isTracked - ~MbtFaceDepthDense.isVisible - ~MbtFaceDepthDense.setCameraParameters - ~MbtFaceDepthDense.setDepthDenseFilteringMaxDistance - ~MbtFaceDepthDense.setDepthDenseFilteringMethod - ~MbtFaceDepthDense.setDepthDenseFilteringMinDistance - ~MbtFaceDepthDense.setDepthDenseFilteringOccupancyRatio - ~MbtFaceDepthDense.setScanLineVisibilityTest - ~MbtFaceDepthDense.setTracked - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~MbtFaceDepthDense.__doc__ - ~MbtFaceDepthDense.__init__ - ~MbtFaceDepthDense.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~MbtFaceDepthDense.DEPTH_OCCUPANCY_RATIO_FILTERING - ~MbtFaceDepthDense.MAX_DISTANCE_FILTERING - ~MbtFaceDepthDense.MIN_DISTANCE_FILTERING - ~MbtFaceDepthDense.NO_FILTERING - ~MbtFaceDepthDense.cam - ~MbtFaceDepthDense.clippingFlag - ~MbtFaceDepthDense.distFarClip - ~MbtFaceDepthDense.distNearClip - ~MbtFaceDepthDense.planeObject - ~MbtFaceDepthDense.useScanLine - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.mbt.MbtFaceDepthNormal.rst b/modules/python/doc/_autosummary/visp.mbt.MbtFaceDepthNormal.rst deleted file mode 100644 index 4c1fd6266d..0000000000 --- a/modules/python/doc/_autosummary/visp.mbt.MbtFaceDepthNormal.rst +++ /dev/null @@ -1,81 +0,0 @@ -MbtFaceDepthNormal -================== - -.. currentmodule:: visp.mbt - -.. autoclass:: MbtFaceDepthNormal - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~MbtFaceDepthNormal.computeInteractionMatrix - ~MbtFaceDepthNormal.computeNormalVisibility - ~MbtFaceDepthNormal.computeVisibility - ~MbtFaceDepthNormal.computeVisibilityDisplay - ~MbtFaceDepthNormal.display - ~MbtFaceDepthNormal.displayFeature - ~MbtFaceDepthNormal.getFeaturesForDisplay - ~MbtFaceDepthNormal.getModelForDisplay - ~MbtFaceDepthNormal.isTracked - ~MbtFaceDepthNormal.isVisible - ~MbtFaceDepthNormal.setCameraParameters - ~MbtFaceDepthNormal.setFaceCentroidMethod - ~MbtFaceDepthNormal.setFeatureEstimationMethod - ~MbtFaceDepthNormal.setPclPlaneEstimationMethod - ~MbtFaceDepthNormal.setPclPlaneEstimationRansacMaxIter - ~MbtFaceDepthNormal.setPclPlaneEstimationRansacThreshold - ~MbtFaceDepthNormal.setScanLineVisibilityTest - ~MbtFaceDepthNormal.setTracked - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~MbtFaceDepthNormal.__doc__ - ~MbtFaceDepthNormal.__init__ - ~MbtFaceDepthNormal.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~MbtFaceDepthNormal.GEOMETRIC_CENTROID - ~MbtFaceDepthNormal.MEAN_CENTROID - ~MbtFaceDepthNormal.ROBUST_FEATURE_ESTIMATION - ~MbtFaceDepthNormal.ROBUST_SVD_PLANE_ESTIMATION - ~MbtFaceDepthNormal.cam - ~MbtFaceDepthNormal.clippingFlag - ~MbtFaceDepthNormal.distFarClip - ~MbtFaceDepthNormal.distNearClip - ~MbtFaceDepthNormal.planeObject - ~MbtFaceDepthNormal.useScanLine - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.mbt.MbtPolygon.rst b/modules/python/doc/_autosummary/visp.mbt.MbtPolygon.rst deleted file mode 100644 index ca0a1c5ceb..0000000000 --- a/modules/python/doc/_autosummary/visp.mbt.MbtPolygon.rst +++ /dev/null @@ -1,124 +0,0 @@ -MbtPolygon -========== - -.. currentmodule:: visp.mbt - -.. autoclass:: MbtPolygon - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~MbtPolygon.getIndex - ~MbtPolygon.getName - ~MbtPolygon.isAppearing - ~MbtPolygon.isPolygonOriented - ~MbtPolygon.isVisible - ~MbtPolygon.setIndex - ~MbtPolygon.setIsPolygonOriented - ~MbtPolygon.setLod - ~MbtPolygon.setMinLineLengthThresh - ~MbtPolygon.setMinPolygonAreaThresh - ~MbtPolygon.setName - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~MbtPolygon.LEFT_CLIPPING - ~MbtPolygon.clippingFlag - ~MbtPolygon.getNbCornerInsidePrevImage - ~MbtPolygon.getNbPoint - ~MbtPolygon.getRoiClipped - ~MbtPolygon.getPoint - ~MbtPolygon.getRoi - ~MbtPolygon.getNbCornerInsideImage - ~MbtPolygon.DOWN_CLIPPING - ~MbtPolygon.FOV_CLIPPING - ~MbtPolygon.UP_CLIPPING - ~MbtPolygon.getPolygonClipped - ~MbtPolygon.nbpt - ~MbtPolygon.NEAR_CLIPPING - ~MbtPolygon.getClippedPolygon - ~MbtPolygon.polyClipped - ~MbtPolygon.distFarClip - ~MbtPolygon.roiInsideImage - ~MbtPolygon.getClipping - ~MbtPolygon.setClipping - ~MbtPolygon.Polygon3DClippingType - ~MbtPolygon.getFarClippingDistance - ~MbtPolygon.getPolygonClippedWithInfo - ~MbtPolygon.setFarClippingDistance - ~MbtPolygon.setNearClippingDistance - ~MbtPolygon.addPoint - ~MbtPolygon.FAR_CLIPPING - ~MbtPolygon.ALL_CLIPPING - ~MbtPolygon.nbCornersInsidePrev - ~MbtPolygon.NO_CLIPPING - ~MbtPolygon.getNearClippingDistance - ~MbtPolygon.RIGHT_CLIPPING - ~MbtPolygon.distNearClip - ~MbtPolygon.getMinMaxRoi - ~MbtPolygon.changeFrame - ~MbtPolygon.computePolygonClipped - ~MbtPolygon.setNbPoint - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~MbtPolygon.__doc__ - ~MbtPolygon.__init__ - ~MbtPolygon.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~MbtPolygon.ALL_CLIPPING - ~MbtPolygon.DOWN_CLIPPING - ~MbtPolygon.FAR_CLIPPING - ~MbtPolygon.FOV_CLIPPING - ~MbtPolygon.LEFT_CLIPPING - ~MbtPolygon.NEAR_CLIPPING - ~MbtPolygon.NO_CLIPPING - ~MbtPolygon.RIGHT_CLIPPING - ~MbtPolygon.UP_CLIPPING - ~MbtPolygon.clippingFlag - ~MbtPolygon.distFarClip - ~MbtPolygon.distNearClip - ~MbtPolygon.hasOrientation - ~MbtPolygon.inLineLengthThresh - ~MbtPolygon.inPolygonAreaThresh - ~MbtPolygon.index - ~MbtPolygon.isappearing - ~MbtPolygon.isvisible - ~MbtPolygon.name - ~MbtPolygon.nbCornersInsidePrev - ~MbtPolygon.nbpt - ~MbtPolygon.polyClipped - ~MbtPolygon.useLod - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.mbt.MbtXmlGenericParser.rst b/modules/python/doc/_autosummary/visp.mbt.MbtXmlGenericParser.rst deleted file mode 100644 index 0065acb675..0000000000 --- a/modules/python/doc/_autosummary/visp.mbt.MbtXmlGenericParser.rst +++ /dev/null @@ -1,114 +0,0 @@ -MbtXmlGenericParser -=================== - -.. currentmodule:: visp.mbt - -.. autoclass:: MbtXmlGenericParser - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~MbtXmlGenericParser.getAngleAppear - ~MbtXmlGenericParser.getAngleDisappear - ~MbtXmlGenericParser.getCameraParameters - ~MbtXmlGenericParser.getDepthDenseSamplingStepX - ~MbtXmlGenericParser.getDepthDenseSamplingStepY - ~MbtXmlGenericParser.getDepthNormalFeatureEstimationMethod - ~MbtXmlGenericParser.getDepthNormalPclPlaneEstimationMethod - ~MbtXmlGenericParser.getDepthNormalPclPlaneEstimationRansacMaxIter - ~MbtXmlGenericParser.getDepthNormalPclPlaneEstimationRansacThreshold - ~MbtXmlGenericParser.getDepthNormalSamplingStepX - ~MbtXmlGenericParser.getDepthNormalSamplingStepY - ~MbtXmlGenericParser.getEdgeMe - ~MbtXmlGenericParser.getFarClippingDistance - ~MbtXmlGenericParser.getFovClipping - ~MbtXmlGenericParser.getKltBlockSize - ~MbtXmlGenericParser.getKltHarrisParam - ~MbtXmlGenericParser.getKltMaskBorder - ~MbtXmlGenericParser.getKltMaxFeatures - ~MbtXmlGenericParser.getKltMinDistance - ~MbtXmlGenericParser.getKltPyramidLevels - ~MbtXmlGenericParser.getKltQuality - ~MbtXmlGenericParser.getKltWindowSize - ~MbtXmlGenericParser.getLodMinLineLengthThreshold - ~MbtXmlGenericParser.getLodMinPolygonAreaThreshold - ~MbtXmlGenericParser.getLodState - ~MbtXmlGenericParser.getNearClippingDistance - ~MbtXmlGenericParser.getProjectionErrorKernelSize - ~MbtXmlGenericParser.getProjectionErrorMe - ~MbtXmlGenericParser.hasFarClippingDistance - ~MbtXmlGenericParser.hasNearClippingDistance - ~MbtXmlGenericParser.parse - ~MbtXmlGenericParser.setAngleAppear - ~MbtXmlGenericParser.setAngleDisappear - ~MbtXmlGenericParser.setCameraParameters - ~MbtXmlGenericParser.setDepthDenseSamplingStepX - ~MbtXmlGenericParser.setDepthDenseSamplingStepY - ~MbtXmlGenericParser.setDepthNormalFeatureEstimationMethod - ~MbtXmlGenericParser.setDepthNormalPclPlaneEstimationMethod - ~MbtXmlGenericParser.setDepthNormalPclPlaneEstimationRansacMaxIter - ~MbtXmlGenericParser.setDepthNormalPclPlaneEstimationRansacThreshold - ~MbtXmlGenericParser.setDepthNormalSamplingStepX - ~MbtXmlGenericParser.setDepthNormalSamplingStepY - ~MbtXmlGenericParser.setEdgeMe - ~MbtXmlGenericParser.setFarClippingDistance - ~MbtXmlGenericParser.setKltBlockSize - ~MbtXmlGenericParser.setKltHarrisParam - ~MbtXmlGenericParser.setKltMaskBorder - ~MbtXmlGenericParser.setKltMaxFeatures - ~MbtXmlGenericParser.setKltMinDistance - ~MbtXmlGenericParser.setKltPyramidLevels - ~MbtXmlGenericParser.setKltQuality - ~MbtXmlGenericParser.setKltWindowSize - ~MbtXmlGenericParser.setNearClippingDistance - ~MbtXmlGenericParser.setProjectionErrorKernelSize - ~MbtXmlGenericParser.setProjectionErrorMe - ~MbtXmlGenericParser.setVerbose - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~MbtXmlGenericParser.__doc__ - ~MbtXmlGenericParser.__init__ - ~MbtXmlGenericParser.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~MbtXmlGenericParser.DEPTH_DENSE_PARSER - ~MbtXmlGenericParser.DEPTH_NORMAL_PARSER - ~MbtXmlGenericParser.EDGE_PARSER - ~MbtXmlGenericParser.KLT_PARSER - ~MbtXmlGenericParser.PROJECTION_ERROR_PARSER - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.mbt.rst b/modules/python/doc/_autosummary/visp.mbt.rst deleted file mode 100644 index 733aa4e432..0000000000 --- a/modules/python/doc/_autosummary/visp.mbt.rst +++ /dev/null @@ -1,47 +0,0 @@ -mbt -=== - -.. automodule:: visp.mbt - - - - - - - - - - - - .. rubric:: Classes - - .. autosummary:: - :toctree: - :template: custom-class-template.rst - :nosignatures: - - MbDepthDenseTracker - MbDepthNormalTracker - MbEdgeKltTracker - MbEdgeTracker - MbGenericTracker - MbKltTracker - MbTracker - MbtDistanceCircle - MbtDistanceCylinder - MbtDistanceKltCylinder - MbtDistanceKltPoints - MbtDistanceLine - MbtFaceDepthDense - MbtFaceDepthNormal - MbtPolygon - MbtXmlGenericParser - - - - - - - - - diff --git a/modules/python/doc/_autosummary/visp.me.Me.rst b/modules/python/doc/_autosummary/visp.me.Me.rst deleted file mode 100644 index e1d1c59082..0000000000 --- a/modules/python/doc/_autosummary/visp.me.Me.rst +++ /dev/null @@ -1,86 +0,0 @@ -Me -== - -.. currentmodule:: visp.me - -.. autoclass:: Me - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~Me.checkSamplestep - ~Me.getAngleStep - ~Me.getLikelihoodThresholdType - ~Me.getMaskNumber - ~Me.getMaskSign - ~Me.getMaskSize - ~Me.getMinSampleStep - ~Me.getMu1 - ~Me.getMu2 - ~Me.getNbTotalSample - ~Me.getPointsToTrack - ~Me.getRange - ~Me.getSampleStep - ~Me.getStrip - ~Me.getThreshold - ~Me.initMask - ~Me.print - ~Me.setAngleStep - ~Me.setLikelihoodThresholdType - ~Me.setMaskNumber - ~Me.setMaskSign - ~Me.setMaskSize - ~Me.setMinSampleStep - ~Me.setMu1 - ~Me.setMu2 - ~Me.setNbTotalSample - ~Me.setPointsToTrack - ~Me.setRange - ~Me.setSampleStep - ~Me.setStrip - ~Me.setThreshold - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~Me.__doc__ - ~Me.__init__ - ~Me.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~Me.NORMALIZED_THRESHOLD - ~Me.OLD_THRESHOLD - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.me.MeEllipse.rst b/modules/python/doc/_autosummary/visp.me.MeEllipse.rst deleted file mode 100644 index 5467e6c15c..0000000000 --- a/modules/python/doc/_autosummary/visp.me.MeEllipse.rst +++ /dev/null @@ -1,90 +0,0 @@ -MeEllipse -========= - -.. currentmodule:: visp.me - -.. autoclass:: MeEllipse - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~MeEllipse.display - ~MeEllipse.displayEllipse - ~MeEllipse.getArea - ~MeEllipse.getCenter - ~MeEllipse.getExpectedDensity - ~MeEllipse.getFirstEndpoint - ~MeEllipse.getHighestAngle - ~MeEllipse.getNumberOfGoodPoints - ~MeEllipse.getSecondEndpoint - ~MeEllipse.getSmallestAngle - ~MeEllipse.get_ABE - ~MeEllipse.get_nij - ~MeEllipse.initTracking - ~MeEllipse.printParameters - ~MeEllipse.setEndpoints - ~MeEllipse.setThresholdRobust - ~MeEllipse.track - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~MeEllipse.cPAvailable - ~MeEllipse.getMeList - ~MeEllipse.numberOfSignal - ~MeEllipse.setDisplay - ~MeEllipse.getInitRange - ~MeEllipse.get_cP - ~MeEllipse.totalNumberOfSignal - ~MeEllipse.getNbPoints - ~MeEllipse.setMeList - ~MeEllipse.outOfImage - ~MeEllipse.setMask - ~MeEllipse.get_p - ~MeEllipse.cP - ~MeEllipse.reset - ~MeEllipse.init - ~MeEllipse.p - ~MeEllipse.setInitRange - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~MeEllipse.__doc__ - ~MeEllipse.__init__ - ~MeEllipse.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~MeEllipse.cP - ~MeEllipse.cPAvailable - ~MeEllipse.p - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.me.MeLine.rst b/modules/python/doc/_autosummary/visp.me.MeLine.rst deleted file mode 100644 index e43724f14f..0000000000 --- a/modules/python/doc/_autosummary/visp.me.MeLine.rst +++ /dev/null @@ -1,94 +0,0 @@ -MeLine -====== - -.. currentmodule:: visp.me - -.. autoclass:: MeLine - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~MeLine.computeRhoSignFromIntensity - ~MeLine.computeRhoTheta - ~MeLine.display - ~MeLine.displayLine - ~MeLine.getA - ~MeLine.getB - ~MeLine.getC - ~MeLine.getEquationParam - ~MeLine.getExtremities - ~MeLine.getRho - ~MeLine.getTheta - ~MeLine.initTracking - ~MeLine.intersection - ~MeLine.leastSquare - ~MeLine.reSample - ~MeLine.sample - ~MeLine.seekExtremities - ~MeLine.setExtremities - ~MeLine.suppressPoints - ~MeLine.track - ~MeLine.updateDelta - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~MeLine.cPAvailable - ~MeLine.getMeList - ~MeLine.numberOfSignal - ~MeLine.setDisplay - ~MeLine.getInitRange - ~MeLine.get_cP - ~MeLine.totalNumberOfSignal - ~MeLine.getNbPoints - ~MeLine.setMeList - ~MeLine.outOfImage - ~MeLine.setMask - ~MeLine.get_p - ~MeLine.cP - ~MeLine.reset - ~MeLine.init - ~MeLine.p - ~MeLine.setInitRange - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~MeLine.__doc__ - ~MeLine.__init__ - ~MeLine.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~MeLine.cP - ~MeLine.cPAvailable - ~MeLine.p - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.me.MeNurbs.rst b/modules/python/doc/_autosummary/visp.me.MeNurbs.rst deleted file mode 100644 index 56328a911e..0000000000 --- a/modules/python/doc/_autosummary/visp.me.MeNurbs.rst +++ /dev/null @@ -1,89 +0,0 @@ -MeNurbs -======= - -.. currentmodule:: visp.me - -.. autoclass:: MeNurbs - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~MeNurbs.display - ~MeNurbs.displayMeNurbs - ~MeNurbs.getNurbs - ~MeNurbs.initTracking - ~MeNurbs.localReSample - ~MeNurbs.reSample - ~MeNurbs.sample - ~MeNurbs.seekExtremities - ~MeNurbs.seekExtremitiesCanny - ~MeNurbs.setCannyThreshold - ~MeNurbs.setEnableCannyDetection - ~MeNurbs.setNbControlPoints - ~MeNurbs.suppressPoints - ~MeNurbs.supressNearPoints - ~MeNurbs.track - ~MeNurbs.updateDelta - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~MeNurbs.cPAvailable - ~MeNurbs.getMeList - ~MeNurbs.numberOfSignal - ~MeNurbs.setDisplay - ~MeNurbs.getInitRange - ~MeNurbs.get_cP - ~MeNurbs.totalNumberOfSignal - ~MeNurbs.getNbPoints - ~MeNurbs.setMeList - ~MeNurbs.outOfImage - ~MeNurbs.setMask - ~MeNurbs.get_p - ~MeNurbs.cP - ~MeNurbs.reset - ~MeNurbs.init - ~MeNurbs.p - ~MeNurbs.setInitRange - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~MeNurbs.__doc__ - ~MeNurbs.__init__ - ~MeNurbs.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~MeNurbs.cP - ~MeNurbs.cPAvailable - ~MeNurbs.p - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.me.MeSite.rst b/modules/python/doc/_autosummary/visp.me.MeSite.rst deleted file mode 100644 index a65a57b9ae..0000000000 --- a/modules/python/doc/_autosummary/visp.me.MeSite.rst +++ /dev/null @@ -1,90 +0,0 @@ -MeSite -====== - -.. currentmodule:: visp.me - -.. autoclass:: MeSite - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~MeSite.display - ~MeSite.displayMeSite - ~MeSite.distance - ~MeSite.getAlpha - ~MeSite.getState - ~MeSite.getWeight - ~MeSite.get_i - ~MeSite.get_ifloat - ~MeSite.get_j - ~MeSite.get_jfloat - ~MeSite.init - ~MeSite.setAlpha - ~MeSite.setDisplay - ~MeSite.setState - ~MeSite.setWeight - ~MeSite.sqrDistance - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~MeSite.__doc__ - ~MeSite.__init__ - ~MeSite.__module__ - ~MeSite.__ne__ - ~MeSite.__repr__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~MeSite.CONTRAST - ~MeSite.M_ESTIMATOR - ~MeSite.NONE - ~MeSite.NO_SUPPRESSION - ~MeSite.RANGE - ~MeSite.RANGE_RESULT - ~MeSite.RESULT - ~MeSite.THRESHOLD - ~MeSite.TOO_NEAR - ~MeSite.UNKNOW - ~MeSite.alpha - ~MeSite.ask_sign - ~MeSite.convlt - ~MeSite.i - ~MeSite.ifloat - ~MeSite.j - ~MeSite.jfloat - ~MeSite.normGradient - ~MeSite.weight - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.me.MeTracker.rst b/modules/python/doc/_autosummary/visp.me.MeTracker.rst deleted file mode 100644 index 4a0463cf4a..0000000000 --- a/modules/python/doc/_autosummary/visp.me.MeTracker.rst +++ /dev/null @@ -1,76 +0,0 @@ -MeTracker -========= - -.. currentmodule:: visp.me - -.. autoclass:: MeTracker - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~MeTracker.display - ~MeTracker.getInitRange - ~MeTracker.getMeList - ~MeTracker.getNbPoints - ~MeTracker.init - ~MeTracker.initTracking - ~MeTracker.numberOfSignal - ~MeTracker.outOfImage - ~MeTracker.reset - ~MeTracker.setDisplay - ~MeTracker.setInitRange - ~MeTracker.setMask - ~MeTracker.setMeList - ~MeTracker.totalNumberOfSignal - ~MeTracker.track - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~MeTracker.cPAvailable - ~MeTracker.get_cP - ~MeTracker.get_p - ~MeTracker.cP - ~MeTracker.p - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~MeTracker.__doc__ - ~MeTracker.__init__ - ~MeTracker.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~MeTracker.cP - ~MeTracker.cPAvailable - ~MeTracker.p - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.me.Nurbs.rst b/modules/python/doc/_autosummary/visp.me.Nurbs.rst deleted file mode 100644 index b15e2a0130..0000000000 --- a/modules/python/doc/_autosummary/visp.me.Nurbs.rst +++ /dev/null @@ -1,84 +0,0 @@ -Nurbs -===== - -.. currentmodule:: visp.me - -.. autoclass:: Nurbs - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~Nurbs.computeCurvePoint - ~Nurbs.computeCurvePointStatic - ~Nurbs.curveKnotIns - ~Nurbs.curveKnotInsStatic - ~Nurbs.get_weights - ~Nurbs.globalCurveApprox - ~Nurbs.globalCurveApproxStatic - ~Nurbs.globalCurveInterp - ~Nurbs.globalCurveInterpStatic - ~Nurbs.removeCurveKnot - ~Nurbs.removeCurveKnotStatic - ~Nurbs.set_weights - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~Nurbs.set_p - ~Nurbs.get_crossingPoints - ~Nurbs.findSpan - ~Nurbs.crossingPoints - ~Nurbs.set_crossingPoints - ~Nurbs.knots - ~Nurbs.set_knots - ~Nurbs.get_controlPoints - ~Nurbs.get_knots - ~Nurbs.findSpanFromSpline - ~Nurbs.get_p - ~Nurbs.controlPoints - ~Nurbs.set_controlPoints - ~Nurbs.p - ~Nurbs.computeCurvePointFromSpline - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~Nurbs.__doc__ - ~Nurbs.__init__ - ~Nurbs.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~Nurbs.controlPoints - ~Nurbs.crossingPoints - ~Nurbs.knots - ~Nurbs.p - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.me.rst b/modules/python/doc/_autosummary/visp.me.rst deleted file mode 100644 index 27deb82c1d..0000000000 --- a/modules/python/doc/_autosummary/visp.me.rst +++ /dev/null @@ -1,38 +0,0 @@ -me -== - -.. automodule:: visp.me - - - - - - - - - - - - .. rubric:: Classes - - .. autosummary:: - :toctree: - :template: custom-class-template.rst - :nosignatures: - - Me - MeEllipse - MeLine - MeNurbs - MeSite - MeTracker - Nurbs - - - - - - - - - diff --git a/modules/python/doc/_autosummary/visp.robot.Afma4.rst b/modules/python/doc/_autosummary/visp.robot.Afma4.rst deleted file mode 100644 index fb8555742b..0000000000 --- a/modules/python/doc/_autosummary/visp.robot.Afma4.rst +++ /dev/null @@ -1,67 +0,0 @@ -Afma4 -===== - -.. currentmodule:: visp.robot - -.. autoclass:: Afma4 - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~Afma4.getForwardKinematics - ~Afma4.getJointMax - ~Afma4.getJointMin - ~Afma4.get_cMe - ~Afma4.get_cVe - ~Afma4.get_cVf - ~Afma4.get_eJe - ~Afma4.get_fJe - ~Afma4.get_fJe_inverse - ~Afma4.get_fMc - ~Afma4.get_fMe - ~Afma4.init - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~Afma4.__doc__ - ~Afma4.__init__ - ~Afma4.__module__ - ~Afma4.__repr__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~Afma4.njoint - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.robot.Afma6.rst b/modules/python/doc/_autosummary/visp.robot.Afma6.rst deleted file mode 100644 index 2212c9a318..0000000000 --- a/modules/python/doc/_autosummary/visp.robot.Afma6.rst +++ /dev/null @@ -1,86 +0,0 @@ -Afma6 -===== - -.. currentmodule:: visp.robot - -.. autoclass:: Afma6 - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~Afma6.getCameraParameters - ~Afma6.getCameraParametersProjType - ~Afma6.getCoupl56 - ~Afma6.getForwardKinematics - ~Afma6.getInverseKinematics - ~Afma6.getJointMax - ~Afma6.getJointMin - ~Afma6.getLong56 - ~Afma6.getToolType - ~Afma6.get_cMe - ~Afma6.get_cVe - ~Afma6.get_eJe - ~Afma6.get_eMc - ~Afma6.get_fJe - ~Afma6.get_fMc - ~Afma6.get_fMe - ~Afma6.init - ~Afma6.parseConfigFile - ~Afma6.set_eMc - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~Afma6.__doc__ - ~Afma6.__init__ - ~Afma6.__module__ - ~Afma6.__repr__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~Afma6.CONST_CCMOP_CAMERA_NAME - ~Afma6.CONST_GENERIC_CAMERA_NAME - ~Afma6.CONST_GRIPPER_CAMERA_NAME - ~Afma6.CONST_INTEL_D435_CAMERA_NAME - ~Afma6.CONST_VACUUM_CAMERA_NAME - ~Afma6.TOOL_CCMOP - ~Afma6.TOOL_CUSTOM - ~Afma6.TOOL_GENERIC_CAMERA - ~Afma6.TOOL_GRIPPER - ~Afma6.TOOL_INTEL_D435_CAMERA - ~Afma6.TOOL_VACUUM - ~Afma6.defaultTool - ~Afma6.njoint - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.robot.Biclops.rst b/modules/python/doc/_autosummary/visp.robot.Biclops.rst deleted file mode 100644 index 3aa788d97e..0000000000 --- a/modules/python/doc/_autosummary/visp.robot.Biclops.rst +++ /dev/null @@ -1,72 +0,0 @@ -Biclops -======= - -.. currentmodule:: visp.robot - -.. autoclass:: Biclops - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~Biclops.computeMGD - ~Biclops.getDenavitHartenbergModel - ~Biclops.get_cMe - ~Biclops.get_cVe - ~Biclops.get_eJe - ~Biclops.get_fJe - ~Biclops.get_fMc - ~Biclops.get_fMe - ~Biclops.init - ~Biclops.setDenavitHartenbergModel - ~Biclops.set_cMe - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~Biclops.__doc__ - ~Biclops.__init__ - ~Biclops.__module__ - ~Biclops.__repr__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~Biclops.DH1 - ~Biclops.DH2 - ~Biclops.h - ~Biclops.ndof - ~Biclops.panJointLimit - ~Biclops.speedLimit - ~Biclops.tiltJointLimit - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.robot.ImageSimulator.rst b/modules/python/doc/_autosummary/visp.robot.ImageSimulator.rst deleted file mode 100644 index 8589c039c5..0000000000 --- a/modules/python/doc/_autosummary/visp.robot.ImageSimulator.rst +++ /dev/null @@ -1,66 +0,0 @@ -ImageSimulator -============== - -.. currentmodule:: visp.robot - -.. autoclass:: ImageSimulator - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~ImageSimulator.get3DcornersTextureRectangle - ~ImageSimulator.getImage - ~ImageSimulator.getImageMultiplePlanes - ~ImageSimulator.init - ~ImageSimulator.setBackGroundTexture - ~ImageSimulator.setCameraPosition - ~ImageSimulator.setCleanPreviousImage - ~ImageSimulator.setInterpolationType - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~ImageSimulator.__doc__ - ~ImageSimulator.__init__ - ~ImageSimulator.__module__ - ~ImageSimulator.__repr__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~ImageSimulator.BILINEAR_INTERPOLATION - ~ImageSimulator.COLORED - ~ImageSimulator.GRAY_SCALED - ~ImageSimulator.SIMPLE - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.robot.Pioneer.rst b/modules/python/doc/_autosummary/visp.robot.Pioneer.rst deleted file mode 100644 index 4c810e201c..0000000000 --- a/modules/python/doc/_autosummary/visp.robot.Pioneer.rst +++ /dev/null @@ -1,53 +0,0 @@ -Pioneer -======= - -.. currentmodule:: visp.robot - -.. autoclass:: Pioneer - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~Pioneer.set_eJe - ~Pioneer.get_eJe - ~Pioneer.set_cMe - ~Pioneer.get_cVe - ~Pioneer.get_cMe - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~Pioneer.__doc__ - ~Pioneer.__init__ - ~Pioneer.__module__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.robot.PioneerPan.rst b/modules/python/doc/_autosummary/visp.robot.PioneerPan.rst deleted file mode 100644 index 1c7f93d60d..0000000000 --- a/modules/python/doc/_autosummary/visp.robot.PioneerPan.rst +++ /dev/null @@ -1,53 +0,0 @@ -PioneerPan -========== - -.. currentmodule:: visp.robot - -.. autoclass:: PioneerPan - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~PioneerPan.set_eJe - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~PioneerPan.get_eJe - ~PioneerPan.set_cMe - ~PioneerPan.get_cVe - ~PioneerPan.get_cMe - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~PioneerPan.__doc__ - ~PioneerPan.__init__ - ~PioneerPan.__module__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.robot.Pololu.rst b/modules/python/doc/_autosummary/visp.robot.Pololu.rst deleted file mode 100644 index 04c6fa3b43..0000000000 --- a/modules/python/doc/_autosummary/visp.robot.Pololu.rst +++ /dev/null @@ -1,67 +0,0 @@ -Pololu -====== - -.. currentmodule:: visp.robot - -.. autoclass:: Pololu - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~Pololu.calibrate - ~Pololu.connect - ~Pololu.connected - ~Pololu.getAngularPosition - ~Pololu.getPwmPosition - ~Pololu.getRangeAngles - ~Pololu.getRangePwm - ~Pololu.pwmToRad - ~Pololu.radSToSpeed - ~Pololu.radToPwm - ~Pololu.setAngularPosition - ~Pololu.setAngularRange - ~Pololu.setAngularVelocity - ~Pololu.setPwmPosition - ~Pololu.setPwmRange - ~Pololu.setPwmVelocity - ~Pololu.setVerbose - ~Pololu.speedToRadS - ~Pololu.stopVelocityCmd - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~Pololu.__doc__ - ~Pololu.__init__ - ~Pololu.__module__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.robot.Ptu46.rst b/modules/python/doc/_autosummary/visp.robot.Ptu46.rst deleted file mode 100644 index 82ab55193f..0000000000 --- a/modules/python/doc/_autosummary/visp.robot.Ptu46.rst +++ /dev/null @@ -1,63 +0,0 @@ -Ptu46 -===== - -.. currentmodule:: visp.robot - -.. autoclass:: Ptu46 - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~Ptu46.computeMGD - ~Ptu46.get_cMe - ~Ptu46.get_cVe - ~Ptu46.get_eJe - ~Ptu46.get_fJe - ~Ptu46.init - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~Ptu46.__doc__ - ~Ptu46.__init__ - ~Ptu46.__module__ - ~Ptu46.__repr__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~Ptu46.L - ~Ptu46.h - ~Ptu46.ndof - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.robot.QbDevice.rst b/modules/python/doc/_autosummary/visp.robot.QbDevice.rst deleted file mode 100644 index 4ac4b90bd7..0000000000 --- a/modules/python/doc/_autosummary/visp.robot.QbDevice.rst +++ /dev/null @@ -1,51 +0,0 @@ -QbDevice -======== - -.. currentmodule:: visp.robot - -.. autoclass:: QbDevice - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~QbDevice.getCurrentMax - ~QbDevice.getPositionLimits - ~QbDevice.setMaxRepeats - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~QbDevice.__doc__ - ~QbDevice.__init__ - ~QbDevice.__module__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.robot.QbSoftHand.rst b/modules/python/doc/_autosummary/visp.robot.QbSoftHand.rst deleted file mode 100644 index 8ad15b2173..0000000000 --- a/modules/python/doc/_autosummary/visp.robot.QbSoftHand.rst +++ /dev/null @@ -1,54 +0,0 @@ -QbSoftHand -========== - -.. currentmodule:: visp.robot - -.. autoclass:: QbSoftHand - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~QbSoftHand.getCurrent - ~QbSoftHand.getPosition - ~QbSoftHand.setPosition - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~QbSoftHand.getPositionLimits - ~QbSoftHand.getCurrentMax - ~QbSoftHand.setMaxRepeats - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~QbSoftHand.__doc__ - ~QbSoftHand.__init__ - ~QbSoftHand.__module__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.robot.ReflexTakktile2.rst b/modules/python/doc/_autosummary/visp.robot.ReflexTakktile2.rst deleted file mode 100644 index ab326cb935..0000000000 --- a/modules/python/doc/_autosummary/visp.robot.ReflexTakktile2.rst +++ /dev/null @@ -1,67 +0,0 @@ -ReflexTakktile2 -=============== - -.. currentmodule:: visp.robot - -.. autoclass:: ReflexTakktile2 - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~ReflexTakktile2.calibrate - ~ReflexTakktile2.disableTorque - ~ReflexTakktile2.getHandInfo - ~ReflexTakktile2.getNumFingers - ~ReflexTakktile2.getNumSensorsPerFinger - ~ReflexTakktile2.getNumServos - ~ReflexTakktile2.getPosition - ~ReflexTakktile2.getVelocity - ~ReflexTakktile2.open - ~ReflexTakktile2.setFingerConfigFile - ~ReflexTakktile2.setMotorConfigFile - ~ReflexTakktile2.setNetworkInterface - ~ReflexTakktile2.setPosition - ~ReflexTakktile2.setPositioningVelocity - ~ReflexTakktile2.setTactileConfigFile - ~ReflexTakktile2.setTactileThreshold - ~ReflexTakktile2.setVelocityUntilAnyContact - ~ReflexTakktile2.setVelocityUntilEachContact - ~ReflexTakktile2.wait - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~ReflexTakktile2.__doc__ - ~ReflexTakktile2.__init__ - ~ReflexTakktile2.__module__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.robot.RingLight.rst b/modules/python/doc/_autosummary/visp.robot.RingLight.rst deleted file mode 100644 index 6fdd0a7fc5..0000000000 --- a/modules/python/doc/_autosummary/visp.robot.RingLight.rst +++ /dev/null @@ -1,51 +0,0 @@ -RingLight -========= - -.. currentmodule:: visp.robot - -.. autoclass:: RingLight - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~RingLight.off - ~RingLight.on - ~RingLight.pulse - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~RingLight.__doc__ - ~RingLight.__init__ - ~RingLight.__module__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.robot.Robot.rst b/modules/python/doc/_autosummary/visp.robot.Robot.rst deleted file mode 100644 index 0e8506acb3..0000000000 --- a/modules/python/doc/_autosummary/visp.robot.Robot.rst +++ /dev/null @@ -1,75 +0,0 @@ -Robot -===== - -.. currentmodule:: visp.robot - -.. autoclass:: Robot - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~Robot.getMaxRotationVelocity - ~Robot.getMaxTranslationVelocity - ~Robot.getNDof - ~Robot.getPosition - ~Robot.getRobotState - ~Robot.saturateVelocities - ~Robot.setMaxRotationVelocity - ~Robot.setMaxTranslationVelocity - ~Robot.setRobotState - ~Robot.setVerbose - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~Robot.__doc__ - ~Robot.__init__ - ~Robot.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~Robot.ARTICULAR_FRAME - ~Robot.CAMERA_FRAME - ~Robot.END_EFFECTOR_FRAME - ~Robot.JOINT_STATE - ~Robot.MIXT_FRAME - ~Robot.REFERENCE_FRAME - ~Robot.STATE_ACCELERATION_CONTROL - ~Robot.STATE_FORCE_TORQUE_CONTROL - ~Robot.STATE_POSITION_CONTROL - ~Robot.STATE_STOP - ~Robot.STATE_VELOCITY_CONTROL - ~Robot.TOOL_FRAME - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.robot.RobotPololuPtu.rst b/modules/python/doc/_autosummary/visp.robot.RobotPololuPtu.rst deleted file mode 100644 index 9a3d01f7fb..0000000000 --- a/modules/python/doc/_autosummary/visp.robot.RobotPololuPtu.rst +++ /dev/null @@ -1,97 +0,0 @@ -RobotPololuPtu -============== - -.. currentmodule:: visp.robot - -.. autoclass:: RobotPololuPtu - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~RobotPololuPtu.getAngularVelocityResolution - ~RobotPololuPtu.getPosition - ~RobotPololuPtu.getPositioningVelocityPercentage - ~RobotPololuPtu.get_eJe - ~RobotPololuPtu.get_fJe - ~RobotPololuPtu.setPosition - ~RobotPololuPtu.setPositioningVelocityPercentage - ~RobotPololuPtu.setRobotState - ~RobotPololuPtu.setVelocity - ~RobotPololuPtu.setVerbose - ~RobotPololuPtu.stopVelocity - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~RobotPololuPtu.REFERENCE_FRAME - ~RobotPololuPtu.setMaxTranslationVelocity - ~RobotPololuPtu.getRobotState - ~RobotPololuPtu.STATE_STOP - ~RobotPololuPtu.STATE_VELOCITY_CONTROL - ~RobotPololuPtu.STATE_FORCE_TORQUE_CONTROL - ~RobotPololuPtu.STATE_ACCELERATION_CONTROL - ~RobotPololuPtu.setMaxRotationVelocity - ~RobotPololuPtu.ControlFrameType - ~RobotPololuPtu.CAMERA_FRAME - ~RobotPololuPtu.MIXT_FRAME - ~RobotPololuPtu.getMaxRotationVelocity - ~RobotPololuPtu.STATE_POSITION_CONTROL - ~RobotPololuPtu.TOOL_FRAME - ~RobotPololuPtu.JOINT_STATE - ~RobotPololuPtu.ARTICULAR_FRAME - ~RobotPololuPtu.END_EFFECTOR_FRAME - ~RobotPololuPtu.RobotStateType - ~RobotPololuPtu.saturateVelocities - ~RobotPololuPtu.getMaxTranslationVelocity - ~RobotPololuPtu.getNDof - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~RobotPololuPtu.__doc__ - ~RobotPololuPtu.__init__ - ~RobotPololuPtu.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~RobotPololuPtu.ARTICULAR_FRAME - ~RobotPololuPtu.CAMERA_FRAME - ~RobotPololuPtu.END_EFFECTOR_FRAME - ~RobotPololuPtu.JOINT_STATE - ~RobotPololuPtu.MIXT_FRAME - ~RobotPololuPtu.REFERENCE_FRAME - ~RobotPololuPtu.STATE_ACCELERATION_CONTROL - ~RobotPololuPtu.STATE_FORCE_TORQUE_CONTROL - ~RobotPololuPtu.STATE_POSITION_CONTROL - ~RobotPololuPtu.STATE_STOP - ~RobotPololuPtu.STATE_VELOCITY_CONTROL - ~RobotPololuPtu.TOOL_FRAME - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.robot.RobotSimulator.rst b/modules/python/doc/_autosummary/visp.robot.RobotSimulator.rst deleted file mode 100644 index 6bc8e7d11b..0000000000 --- a/modules/python/doc/_autosummary/visp.robot.RobotSimulator.rst +++ /dev/null @@ -1,91 +0,0 @@ -RobotSimulator -============== - -.. currentmodule:: visp.robot - -.. autoclass:: RobotSimulator - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~RobotSimulator.getSamplingTime - ~RobotSimulator.setSamplingTime - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~RobotSimulator.REFERENCE_FRAME - ~RobotSimulator.setMaxTranslationVelocity - ~RobotSimulator.getRobotState - ~RobotSimulator.STATE_STOP - ~RobotSimulator.getPosition - ~RobotSimulator.STATE_VELOCITY_CONTROL - ~RobotSimulator.STATE_FORCE_TORQUE_CONTROL - ~RobotSimulator.STATE_ACCELERATION_CONTROL - ~RobotSimulator.setMaxRotationVelocity - ~RobotSimulator.ControlFrameType - ~RobotSimulator.CAMERA_FRAME - ~RobotSimulator.MIXT_FRAME - ~RobotSimulator.getMaxRotationVelocity - ~RobotSimulator.setVerbose - ~RobotSimulator.STATE_POSITION_CONTROL - ~RobotSimulator.TOOL_FRAME - ~RobotSimulator.JOINT_STATE - ~RobotSimulator.getNDof - ~RobotSimulator.END_EFFECTOR_FRAME - ~RobotSimulator.RobotStateType - ~RobotSimulator.setRobotState - ~RobotSimulator.saturateVelocities - ~RobotSimulator.getMaxTranslationVelocity - ~RobotSimulator.ARTICULAR_FRAME - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~RobotSimulator.__doc__ - ~RobotSimulator.__init__ - ~RobotSimulator.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~RobotSimulator.ARTICULAR_FRAME - ~RobotSimulator.CAMERA_FRAME - ~RobotSimulator.END_EFFECTOR_FRAME - ~RobotSimulator.JOINT_STATE - ~RobotSimulator.MIXT_FRAME - ~RobotSimulator.REFERENCE_FRAME - ~RobotSimulator.STATE_ACCELERATION_CONTROL - ~RobotSimulator.STATE_FORCE_TORQUE_CONTROL - ~RobotSimulator.STATE_POSITION_CONTROL - ~RobotSimulator.STATE_STOP - ~RobotSimulator.STATE_VELOCITY_CONTROL - ~RobotSimulator.TOOL_FRAME - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.robot.RobotTemplate.rst b/modules/python/doc/_autosummary/visp.robot.RobotTemplate.rst deleted file mode 100644 index cd6bd6025d..0000000000 --- a/modules/python/doc/_autosummary/visp.robot.RobotTemplate.rst +++ /dev/null @@ -1,96 +0,0 @@ -RobotTemplate -============= - -.. currentmodule:: visp.robot - -.. autoclass:: RobotTemplate - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~RobotTemplate.getDisplacement - ~RobotTemplate.getPosition - ~RobotTemplate.get_eJe - ~RobotTemplate.get_eMc - ~RobotTemplate.get_fJe - ~RobotTemplate.setPosition - ~RobotTemplate.setVelocity - ~RobotTemplate.set_eMc - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~RobotTemplate.REFERENCE_FRAME - ~RobotTemplate.setMaxTranslationVelocity - ~RobotTemplate.getRobotState - ~RobotTemplate.STATE_STOP - ~RobotTemplate.STATE_VELOCITY_CONTROL - ~RobotTemplate.STATE_FORCE_TORQUE_CONTROL - ~RobotTemplate.STATE_ACCELERATION_CONTROL - ~RobotTemplate.setMaxRotationVelocity - ~RobotTemplate.ControlFrameType - ~RobotTemplate.CAMERA_FRAME - ~RobotTemplate.MIXT_FRAME - ~RobotTemplate.getMaxRotationVelocity - ~RobotTemplate.setVerbose - ~RobotTemplate.STATE_POSITION_CONTROL - ~RobotTemplate.TOOL_FRAME - ~RobotTemplate.JOINT_STATE - ~RobotTemplate.getNDof - ~RobotTemplate.END_EFFECTOR_FRAME - ~RobotTemplate.RobotStateType - ~RobotTemplate.setRobotState - ~RobotTemplate.saturateVelocities - ~RobotTemplate.getMaxTranslationVelocity - ~RobotTemplate.ARTICULAR_FRAME - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~RobotTemplate.__doc__ - ~RobotTemplate.__init__ - ~RobotTemplate.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~RobotTemplate.ARTICULAR_FRAME - ~RobotTemplate.CAMERA_FRAME - ~RobotTemplate.END_EFFECTOR_FRAME - ~RobotTemplate.JOINT_STATE - ~RobotTemplate.MIXT_FRAME - ~RobotTemplate.REFERENCE_FRAME - ~RobotTemplate.STATE_ACCELERATION_CONTROL - ~RobotTemplate.STATE_FORCE_TORQUE_CONTROL - ~RobotTemplate.STATE_POSITION_CONTROL - ~RobotTemplate.STATE_STOP - ~RobotTemplate.STATE_VELOCITY_CONTROL - ~RobotTemplate.TOOL_FRAME - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.robot.RobotWireFrameSimulator.rst b/modules/python/doc/_autosummary/visp.robot.RobotWireFrameSimulator.rst deleted file mode 100644 index d2b1fd2d7c..0000000000 --- a/modules/python/doc/_autosummary/visp.robot.RobotWireFrameSimulator.rst +++ /dev/null @@ -1,110 +0,0 @@ -RobotWireFrameSimulator -======================= - -.. currentmodule:: visp.robot - -.. autoclass:: RobotWireFrameSimulator - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~RobotWireFrameSimulator.getExternalCameraParameters - ~RobotWireFrameSimulator.getExternalCameraPosition - ~RobotWireFrameSimulator.getInternalView - ~RobotWireFrameSimulator.get_cMo - ~RobotWireFrameSimulator.get_fMo - ~RobotWireFrameSimulator.initScene - ~RobotWireFrameSimulator.setCameraColor - ~RobotWireFrameSimulator.setConstantSamplingTimeMode - ~RobotWireFrameSimulator.setCurrentViewColor - ~RobotWireFrameSimulator.setDesiredCameraPosition - ~RobotWireFrameSimulator.setDesiredViewColor - ~RobotWireFrameSimulator.setDisplayRobotType - ~RobotWireFrameSimulator.setExternalCameraPosition - ~RobotWireFrameSimulator.setGraphicsThickness - ~RobotWireFrameSimulator.setSamplingTime - ~RobotWireFrameSimulator.setSingularityManagement - ~RobotWireFrameSimulator.setVerbose - ~RobotWireFrameSimulator.set_fMo - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~RobotWireFrameSimulator.REFERENCE_FRAME - ~RobotWireFrameSimulator.setMaxTranslationVelocity - ~RobotWireFrameSimulator.getRobotState - ~RobotWireFrameSimulator.STATE_STOP - ~RobotWireFrameSimulator.getPosition - ~RobotWireFrameSimulator.STATE_VELOCITY_CONTROL - ~RobotWireFrameSimulator.STATE_FORCE_TORQUE_CONTROL - ~RobotWireFrameSimulator.STATE_ACCELERATION_CONTROL - ~RobotWireFrameSimulator.setMaxRotationVelocity - ~RobotWireFrameSimulator.ControlFrameType - ~RobotWireFrameSimulator.CAMERA_FRAME - ~RobotWireFrameSimulator.MIXT_FRAME - ~RobotWireFrameSimulator.getMaxRotationVelocity - ~RobotWireFrameSimulator.STATE_POSITION_CONTROL - ~RobotWireFrameSimulator.TOOL_FRAME - ~RobotWireFrameSimulator.JOINT_STATE - ~RobotWireFrameSimulator.ARTICULAR_FRAME - ~RobotWireFrameSimulator.END_EFFECTOR_FRAME - ~RobotWireFrameSimulator.RobotStateType - ~RobotWireFrameSimulator.setRobotState - ~RobotWireFrameSimulator.saturateVelocities - ~RobotWireFrameSimulator.getMaxTranslationVelocity - ~RobotWireFrameSimulator.getSamplingTime - ~RobotWireFrameSimulator.getNDof - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~RobotWireFrameSimulator.__doc__ - ~RobotWireFrameSimulator.__init__ - ~RobotWireFrameSimulator.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~RobotWireFrameSimulator.ARTICULAR_FRAME - ~RobotWireFrameSimulator.CAMERA_FRAME - ~RobotWireFrameSimulator.END_EFFECTOR_FRAME - ~RobotWireFrameSimulator.I - ~RobotWireFrameSimulator.JOINT_STATE - ~RobotWireFrameSimulator.MIXT_FRAME - ~RobotWireFrameSimulator.MODEL_3D - ~RobotWireFrameSimulator.MODEL_DH - ~RobotWireFrameSimulator.REFERENCE_FRAME - ~RobotWireFrameSimulator.STATE_ACCELERATION_CONTROL - ~RobotWireFrameSimulator.STATE_FORCE_TORQUE_CONTROL - ~RobotWireFrameSimulator.STATE_POSITION_CONTROL - ~RobotWireFrameSimulator.STATE_STOP - ~RobotWireFrameSimulator.STATE_VELOCITY_CONTROL - ~RobotWireFrameSimulator.TOOL_FRAME - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.robot.Servolens.rst b/modules/python/doc/_autosummary/visp.robot.Servolens.rst deleted file mode 100644 index 507e0e1a0f..0000000000 --- a/modules/python/doc/_autosummary/visp.robot.Servolens.rst +++ /dev/null @@ -1,74 +0,0 @@ -Servolens -========= - -.. currentmodule:: visp.robot - -.. autoclass:: Servolens - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~Servolens.close - ~Servolens.enablePrompt - ~Servolens.getCameraParameters - ~Servolens.getPosition - ~Servolens.open - ~Servolens.reset - ~Servolens.setAutoIris - ~Servolens.setController - ~Servolens.setPosition - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~Servolens.__doc__ - ~Servolens.__init__ - ~Servolens.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~Servolens.AUTO - ~Servolens.CONTROLLED - ~Servolens.FOCUS - ~Servolens.FOCUS_MAX - ~Servolens.FOCUS_MIN - ~Servolens.IRIS - ~Servolens.IRIS_MAX - ~Servolens.IRIS_MIN - ~Servolens.RELEASED - ~Servolens.ZOOM - ~Servolens.ZOOM_MAX - ~Servolens.ZOOM_MIN - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.robot.SimulatorAfma6.rst b/modules/python/doc/_autosummary/visp.robot.SimulatorAfma6.rst deleted file mode 100644 index 39b4c2ae21..0000000000 --- a/modules/python/doc/_autosummary/visp.robot.SimulatorAfma6.rst +++ /dev/null @@ -1,175 +0,0 @@ -SimulatorAfma6 -============== - -.. currentmodule:: visp.robot - -.. autoclass:: SimulatorAfma6 - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~SimulatorAfma6.getCameraParameters - ~SimulatorAfma6.getDisplacement - ~SimulatorAfma6.getPosition - ~SimulatorAfma6.getPositioningVelocity - ~SimulatorAfma6.getVelocity - ~SimulatorAfma6.get_cMe - ~SimulatorAfma6.get_cVe - ~SimulatorAfma6.get_eJe - ~SimulatorAfma6.get_fJe - ~SimulatorAfma6.init - ~SimulatorAfma6.initialiseCameraRelativeToObject - ~SimulatorAfma6.initialiseObjectRelativeToCamera - ~SimulatorAfma6.move - ~SimulatorAfma6.readPosFile - ~SimulatorAfma6.savePosFile - ~SimulatorAfma6.setCameraParameters - ~SimulatorAfma6.setJointLimit - ~SimulatorAfma6.setPosition - ~SimulatorAfma6.setPositioningVelocity - ~SimulatorAfma6.setRobotState - ~SimulatorAfma6.setVelocity - ~SimulatorAfma6.stopMotion - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~SimulatorAfma6.setExternalCameraPosition - ~SimulatorAfma6.I - ~SimulatorAfma6.setMaxTranslationVelocity - ~SimulatorAfma6.getRobotState - ~SimulatorAfma6.STATE_STOP - ~SimulatorAfma6.setDesiredViewColor - ~SimulatorAfma6.STATE_VELOCITY_CONTROL - ~SimulatorAfma6.STATE_FORCE_TORQUE_CONTROL - ~SimulatorAfma6.ControlFrameType - ~SimulatorAfma6.CONST_GRIPPER_CAMERA_NAME - ~SimulatorAfma6.setCurrentViewColor - ~SimulatorAfma6.defaultTool - ~SimulatorAfma6.MODEL_3D - ~SimulatorAfma6.parseConfigFile - ~SimulatorAfma6.MODEL_DH - ~SimulatorAfma6.setConstantSamplingTimeMode - ~SimulatorAfma6.getCoupl56 - ~SimulatorAfma6.CAMERA_FRAME - ~SimulatorAfma6.get_fMo - ~SimulatorAfma6.setVerbose - ~SimulatorAfma6.CONST_VACUUM_CAMERA_NAME - ~SimulatorAfma6.setSingularityManagement - ~SimulatorAfma6.CONST_INTEL_D435_CAMERA_NAME - ~SimulatorAfma6.getExternalCameraPosition - ~SimulatorAfma6.njoint - ~SimulatorAfma6.DisplayRobotType - ~SimulatorAfma6.JOINT_STATE - ~SimulatorAfma6.ARTICULAR_FRAME - ~SimulatorAfma6.getExternalCameraParameters - ~SimulatorAfma6.getJointMax - ~SimulatorAfma6.getInternalView - ~SimulatorAfma6.getLong56 - ~SimulatorAfma6.END_EFFECTOR_FRAME - ~SimulatorAfma6.setGraphicsThickness - ~SimulatorAfma6.getForwardKinematics - ~SimulatorAfma6.saturateVelocities - ~SimulatorAfma6.set_fMo - ~SimulatorAfma6.getMaxTranslationVelocity - ~SimulatorAfma6.getSamplingTime - ~SimulatorAfma6.getNDof - ~SimulatorAfma6.REFERENCE_FRAME - ~SimulatorAfma6.setSamplingTime - ~SimulatorAfma6.getInverseKinematics - ~SimulatorAfma6.get_fMc - ~SimulatorAfma6.setCameraColor - ~SimulatorAfma6.set_eMc - ~SimulatorAfma6.CONST_CCMOP_CAMERA_NAME - ~SimulatorAfma6.initScene - ~SimulatorAfma6.get_fMe - ~SimulatorAfma6.TOOL_GENERIC_CAMERA - ~SimulatorAfma6.setDisplayRobotType - ~SimulatorAfma6.STATE_ACCELERATION_CONTROL - ~SimulatorAfma6.getJointMin - ~SimulatorAfma6.setMaxRotationVelocity - ~SimulatorAfma6.get_eMc - ~SimulatorAfma6.get_cMo - ~SimulatorAfma6.TOOL_INTEL_D435_CAMERA - ~SimulatorAfma6.MIXT_FRAME - ~SimulatorAfma6.CONST_GENERIC_CAMERA_NAME - ~SimulatorAfma6.getMaxRotationVelocity - ~SimulatorAfma6.TOOL_FRAME - ~SimulatorAfma6.TOOL_VACUUM - ~SimulatorAfma6.getToolType - ~SimulatorAfma6.TOOL_CCMOP - ~SimulatorAfma6.STATE_POSITION_CONTROL - ~SimulatorAfma6.setDesiredCameraPosition - ~SimulatorAfma6.getCameraParametersProjType - ~SimulatorAfma6.TOOL_CUSTOM - ~SimulatorAfma6.Afma6ToolType - ~SimulatorAfma6.RobotStateType - ~SimulatorAfma6.TOOL_GRIPPER - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~SimulatorAfma6.__doc__ - ~SimulatorAfma6.__init__ - ~SimulatorAfma6.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~SimulatorAfma6.ARTICULAR_FRAME - ~SimulatorAfma6.CAMERA_FRAME - ~SimulatorAfma6.CONST_CCMOP_CAMERA_NAME - ~SimulatorAfma6.CONST_GENERIC_CAMERA_NAME - ~SimulatorAfma6.CONST_GRIPPER_CAMERA_NAME - ~SimulatorAfma6.CONST_INTEL_D435_CAMERA_NAME - ~SimulatorAfma6.CONST_VACUUM_CAMERA_NAME - ~SimulatorAfma6.END_EFFECTOR_FRAME - ~SimulatorAfma6.I - ~SimulatorAfma6.JOINT_STATE - ~SimulatorAfma6.MIXT_FRAME - ~SimulatorAfma6.MODEL_3D - ~SimulatorAfma6.MODEL_DH - ~SimulatorAfma6.REFERENCE_FRAME - ~SimulatorAfma6.STATE_ACCELERATION_CONTROL - ~SimulatorAfma6.STATE_FORCE_TORQUE_CONTROL - ~SimulatorAfma6.STATE_POSITION_CONTROL - ~SimulatorAfma6.STATE_STOP - ~SimulatorAfma6.STATE_VELOCITY_CONTROL - ~SimulatorAfma6.TOOL_CCMOP - ~SimulatorAfma6.TOOL_CUSTOM - ~SimulatorAfma6.TOOL_FRAME - ~SimulatorAfma6.TOOL_GENERIC_CAMERA - ~SimulatorAfma6.TOOL_GRIPPER - ~SimulatorAfma6.TOOL_INTEL_D435_CAMERA - ~SimulatorAfma6.TOOL_VACUUM - ~SimulatorAfma6.defaultPositioningVelocity - ~SimulatorAfma6.defaultTool - ~SimulatorAfma6.njoint - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.robot.SimulatorCamera.rst b/modules/python/doc/_autosummary/visp.robot.SimulatorCamera.rst deleted file mode 100644 index 102b90a6ec..0000000000 --- a/modules/python/doc/_autosummary/visp.robot.SimulatorCamera.rst +++ /dev/null @@ -1,95 +0,0 @@ -SimulatorCamera -=============== - -.. currentmodule:: visp.robot - -.. autoclass:: SimulatorCamera - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~SimulatorCamera.getPosition - ~SimulatorCamera.get_cVe - ~SimulatorCamera.get_eJe - ~SimulatorCamera.setPosition - ~SimulatorCamera.setVelocity - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~SimulatorCamera.REFERENCE_FRAME - ~SimulatorCamera.setSamplingTime - ~SimulatorCamera.setMaxTranslationVelocity - ~SimulatorCamera.getRobotState - ~SimulatorCamera.STATE_STOP - ~SimulatorCamera.STATE_VELOCITY_CONTROL - ~SimulatorCamera.STATE_FORCE_TORQUE_CONTROL - ~SimulatorCamera.STATE_ACCELERATION_CONTROL - ~SimulatorCamera.setMaxRotationVelocity - ~SimulatorCamera.ControlFrameType - ~SimulatorCamera.CAMERA_FRAME - ~SimulatorCamera.MIXT_FRAME - ~SimulatorCamera.getMaxRotationVelocity - ~SimulatorCamera.setVerbose - ~SimulatorCamera.STATE_POSITION_CONTROL - ~SimulatorCamera.TOOL_FRAME - ~SimulatorCamera.JOINT_STATE - ~SimulatorCamera.getNDof - ~SimulatorCamera.END_EFFECTOR_FRAME - ~SimulatorCamera.RobotStateType - ~SimulatorCamera.setRobotState - ~SimulatorCamera.saturateVelocities - ~SimulatorCamera.getMaxTranslationVelocity - ~SimulatorCamera.getSamplingTime - ~SimulatorCamera.ARTICULAR_FRAME - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~SimulatorCamera.__doc__ - ~SimulatorCamera.__init__ - ~SimulatorCamera.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~SimulatorCamera.ARTICULAR_FRAME - ~SimulatorCamera.CAMERA_FRAME - ~SimulatorCamera.END_EFFECTOR_FRAME - ~SimulatorCamera.JOINT_STATE - ~SimulatorCamera.MIXT_FRAME - ~SimulatorCamera.REFERENCE_FRAME - ~SimulatorCamera.STATE_ACCELERATION_CONTROL - ~SimulatorCamera.STATE_FORCE_TORQUE_CONTROL - ~SimulatorCamera.STATE_POSITION_CONTROL - ~SimulatorCamera.STATE_STOP - ~SimulatorCamera.STATE_VELOCITY_CONTROL - ~SimulatorCamera.TOOL_FRAME - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.robot.SimulatorPioneer.rst b/modules/python/doc/_autosummary/visp.robot.SimulatorPioneer.rst deleted file mode 100644 index 4aaa2df198..0000000000 --- a/modules/python/doc/_autosummary/visp.robot.SimulatorPioneer.rst +++ /dev/null @@ -1,97 +0,0 @@ -SimulatorPioneer -================ - -.. currentmodule:: visp.robot - -.. autoclass:: SimulatorPioneer - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~SimulatorPioneer.getPosition - ~SimulatorPioneer.get_eJe - ~SimulatorPioneer.setVelocity - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~SimulatorPioneer.REFERENCE_FRAME - ~SimulatorPioneer.setSamplingTime - ~SimulatorPioneer.setMaxTranslationVelocity - ~SimulatorPioneer.getRobotState - ~SimulatorPioneer.STATE_STOP - ~SimulatorPioneer.STATE_VELOCITY_CONTROL - ~SimulatorPioneer.STATE_FORCE_TORQUE_CONTROL - ~SimulatorPioneer.STATE_ACCELERATION_CONTROL - ~SimulatorPioneer.setMaxRotationVelocity - ~SimulatorPioneer.ControlFrameType - ~SimulatorPioneer.CAMERA_FRAME - ~SimulatorPioneer.set_cMe - ~SimulatorPioneer.MIXT_FRAME - ~SimulatorPioneer.getMaxRotationVelocity - ~SimulatorPioneer.setVerbose - ~SimulatorPioneer.STATE_POSITION_CONTROL - ~SimulatorPioneer.TOOL_FRAME - ~SimulatorPioneer.set_eJe - ~SimulatorPioneer.JOINT_STATE - ~SimulatorPioneer.getNDof - ~SimulatorPioneer.END_EFFECTOR_FRAME - ~SimulatorPioneer.RobotStateType - ~SimulatorPioneer.setRobotState - ~SimulatorPioneer.saturateVelocities - ~SimulatorPioneer.get_cVe - ~SimulatorPioneer.get_cMe - ~SimulatorPioneer.getMaxTranslationVelocity - ~SimulatorPioneer.getSamplingTime - ~SimulatorPioneer.ARTICULAR_FRAME - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~SimulatorPioneer.__doc__ - ~SimulatorPioneer.__init__ - ~SimulatorPioneer.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~SimulatorPioneer.ARTICULAR_FRAME - ~SimulatorPioneer.CAMERA_FRAME - ~SimulatorPioneer.END_EFFECTOR_FRAME - ~SimulatorPioneer.JOINT_STATE - ~SimulatorPioneer.MIXT_FRAME - ~SimulatorPioneer.REFERENCE_FRAME - ~SimulatorPioneer.STATE_ACCELERATION_CONTROL - ~SimulatorPioneer.STATE_FORCE_TORQUE_CONTROL - ~SimulatorPioneer.STATE_POSITION_CONTROL - ~SimulatorPioneer.STATE_STOP - ~SimulatorPioneer.STATE_VELOCITY_CONTROL - ~SimulatorPioneer.TOOL_FRAME - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.robot.SimulatorPioneerPan.rst b/modules/python/doc/_autosummary/visp.robot.SimulatorPioneerPan.rst deleted file mode 100644 index 7f83baec5c..0000000000 --- a/modules/python/doc/_autosummary/visp.robot.SimulatorPioneerPan.rst +++ /dev/null @@ -1,97 +0,0 @@ -SimulatorPioneerPan -=================== - -.. currentmodule:: visp.robot - -.. autoclass:: SimulatorPioneerPan - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~SimulatorPioneerPan.getPosition - ~SimulatorPioneerPan.get_eJe - ~SimulatorPioneerPan.setVelocity - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~SimulatorPioneerPan.REFERENCE_FRAME - ~SimulatorPioneerPan.setSamplingTime - ~SimulatorPioneerPan.setMaxTranslationVelocity - ~SimulatorPioneerPan.getRobotState - ~SimulatorPioneerPan.STATE_STOP - ~SimulatorPioneerPan.STATE_VELOCITY_CONTROL - ~SimulatorPioneerPan.STATE_FORCE_TORQUE_CONTROL - ~SimulatorPioneerPan.STATE_ACCELERATION_CONTROL - ~SimulatorPioneerPan.setMaxRotationVelocity - ~SimulatorPioneerPan.ControlFrameType - ~SimulatorPioneerPan.CAMERA_FRAME - ~SimulatorPioneerPan.set_cMe - ~SimulatorPioneerPan.MIXT_FRAME - ~SimulatorPioneerPan.getMaxRotationVelocity - ~SimulatorPioneerPan.setVerbose - ~SimulatorPioneerPan.STATE_POSITION_CONTROL - ~SimulatorPioneerPan.TOOL_FRAME - ~SimulatorPioneerPan.set_eJe - ~SimulatorPioneerPan.JOINT_STATE - ~SimulatorPioneerPan.getNDof - ~SimulatorPioneerPan.END_EFFECTOR_FRAME - ~SimulatorPioneerPan.RobotStateType - ~SimulatorPioneerPan.setRobotState - ~SimulatorPioneerPan.saturateVelocities - ~SimulatorPioneerPan.get_cVe - ~SimulatorPioneerPan.get_cMe - ~SimulatorPioneerPan.getMaxTranslationVelocity - ~SimulatorPioneerPan.getSamplingTime - ~SimulatorPioneerPan.ARTICULAR_FRAME - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~SimulatorPioneerPan.__doc__ - ~SimulatorPioneerPan.__init__ - ~SimulatorPioneerPan.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~SimulatorPioneerPan.ARTICULAR_FRAME - ~SimulatorPioneerPan.CAMERA_FRAME - ~SimulatorPioneerPan.END_EFFECTOR_FRAME - ~SimulatorPioneerPan.JOINT_STATE - ~SimulatorPioneerPan.MIXT_FRAME - ~SimulatorPioneerPan.REFERENCE_FRAME - ~SimulatorPioneerPan.STATE_ACCELERATION_CONTROL - ~SimulatorPioneerPan.STATE_FORCE_TORQUE_CONTROL - ~SimulatorPioneerPan.STATE_POSITION_CONTROL - ~SimulatorPioneerPan.STATE_STOP - ~SimulatorPioneerPan.STATE_VELOCITY_CONTROL - ~SimulatorPioneerPan.TOOL_FRAME - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.robot.SimulatorViper850.rst b/modules/python/doc/_autosummary/visp.robot.SimulatorViper850.rst deleted file mode 100644 index bcad1e72cd..0000000000 --- a/modules/python/doc/_autosummary/visp.robot.SimulatorViper850.rst +++ /dev/null @@ -1,175 +0,0 @@ -SimulatorViper850 -================= - -.. currentmodule:: visp.robot - -.. autoclass:: SimulatorViper850 - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~SimulatorViper850.getCameraParameters - ~SimulatorViper850.getDisplacement - ~SimulatorViper850.getPosition - ~SimulatorViper850.getPositioningVelocity - ~SimulatorViper850.getVelocity - ~SimulatorViper850.get_cMe - ~SimulatorViper850.get_cVe - ~SimulatorViper850.get_eJe - ~SimulatorViper850.get_fJe - ~SimulatorViper850.init - ~SimulatorViper850.initialiseCameraRelativeToObject - ~SimulatorViper850.initialiseObjectRelativeToCamera - ~SimulatorViper850.move - ~SimulatorViper850.readPosFile - ~SimulatorViper850.savePosFile - ~SimulatorViper850.setCameraParameters - ~SimulatorViper850.setJointLimit - ~SimulatorViper850.setPosition - ~SimulatorViper850.setPositioningVelocity - ~SimulatorViper850.setRobotState - ~SimulatorViper850.setVelocity - ~SimulatorViper850.stopMotion - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~SimulatorViper850.get_wMe - ~SimulatorViper850.setExternalCameraPosition - ~SimulatorViper850.I - ~SimulatorViper850.setMaxTranslationVelocity - ~SimulatorViper850.getRobotState - ~SimulatorViper850.STATE_STOP - ~SimulatorViper850.setDesiredViewColor - ~SimulatorViper850.get_fMw - ~SimulatorViper850.STATE_VELOCITY_CONTROL - ~SimulatorViper850.STATE_FORCE_TORQUE_CONTROL - ~SimulatorViper850.ControlFrameType - ~SimulatorViper850.setCurrentViewColor - ~SimulatorViper850.defaultTool - ~SimulatorViper850.MODEL_3D - ~SimulatorViper850.parseConfigFile - ~SimulatorViper850.MODEL_DH - ~SimulatorViper850.setConstantSamplingTimeMode - ~SimulatorViper850.getCoupl56 - ~SimulatorViper850.CAMERA_FRAME - ~SimulatorViper850.get_fMo - ~SimulatorViper850.setVerbose - ~SimulatorViper850.setSingularityManagement - ~SimulatorViper850.getExternalCameraPosition - ~SimulatorViper850.njoint - ~SimulatorViper850.DisplayRobotType - ~SimulatorViper850.JOINT_STATE - ~SimulatorViper850.getExternalCameraParameters - ~SimulatorViper850.getJointMax - ~SimulatorViper850.getInternalView - ~SimulatorViper850.END_EFFECTOR_FRAME - ~SimulatorViper850.setGraphicsThickness - ~SimulatorViper850.getForwardKinematics - ~SimulatorViper850.TOOL_PTGREY_FLEA2_CAMERA - ~SimulatorViper850.saturateVelocities - ~SimulatorViper850.set_fMo - ~SimulatorViper850.CONST_PTGREY_FLEA2_CAMERA_NAME - ~SimulatorViper850.getMaxTranslationVelocity - ~SimulatorViper850.getSamplingTime - ~SimulatorViper850.getInverseKinematicsWrist - ~SimulatorViper850.CONST_MARLIN_F033C_CAMERA_NAME - ~SimulatorViper850.getNDof - ~SimulatorViper850.REFERENCE_FRAME - ~SimulatorViper850.setSamplingTime - ~SimulatorViper850.getInverseKinematics - ~SimulatorViper850.ToolType - ~SimulatorViper850.get_fMc - ~SimulatorViper850.setCameraColor - ~SimulatorViper850.set_eMc - ~SimulatorViper850.initScene - ~SimulatorViper850.get_fMe - ~SimulatorViper850.TOOL_GENERIC_CAMERA - ~SimulatorViper850.setDisplayRobotType - ~SimulatorViper850.STATE_ACCELERATION_CONTROL - ~SimulatorViper850.getJointMin - ~SimulatorViper850.setMaxRotationVelocity - ~SimulatorViper850.TOOL_MARLIN_F033C_CAMERA - ~SimulatorViper850.get_eMc - ~SimulatorViper850.get_cMo - ~SimulatorViper850.CONST_SCHUNK_GRIPPER_CAMERA_NAME - ~SimulatorViper850.MIXT_FRAME - ~SimulatorViper850.CONST_GENERIC_CAMERA_NAME - ~SimulatorViper850.getMaxRotationVelocity - ~SimulatorViper850.TOOL_FRAME - ~SimulatorViper850.getToolType - ~SimulatorViper850.setDesiredCameraPosition - ~SimulatorViper850.STATE_POSITION_CONTROL - ~SimulatorViper850.getCameraParametersProjType - ~SimulatorViper850.TOOL_SCHUNK_GRIPPER_CAMERA - ~SimulatorViper850.TOOL_CUSTOM - ~SimulatorViper850.RobotStateType - ~SimulatorViper850.get_eMs - ~SimulatorViper850.get_fJw - ~SimulatorViper850.ARTICULAR_FRAME - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~SimulatorViper850.__doc__ - ~SimulatorViper850.__init__ - ~SimulatorViper850.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~SimulatorViper850.ARTICULAR_FRAME - ~SimulatorViper850.CAMERA_FRAME - ~SimulatorViper850.CONST_GENERIC_CAMERA_NAME - ~SimulatorViper850.CONST_MARLIN_F033C_CAMERA_NAME - ~SimulatorViper850.CONST_PTGREY_FLEA2_CAMERA_NAME - ~SimulatorViper850.CONST_SCHUNK_GRIPPER_CAMERA_NAME - ~SimulatorViper850.END_EFFECTOR_FRAME - ~SimulatorViper850.I - ~SimulatorViper850.JOINT_STATE - ~SimulatorViper850.MIXT_FRAME - ~SimulatorViper850.MODEL_3D - ~SimulatorViper850.MODEL_DH - ~SimulatorViper850.REFERENCE_FRAME - ~SimulatorViper850.STATE_ACCELERATION_CONTROL - ~SimulatorViper850.STATE_FORCE_TORQUE_CONTROL - ~SimulatorViper850.STATE_POSITION_CONTROL - ~SimulatorViper850.STATE_STOP - ~SimulatorViper850.STATE_VELOCITY_CONTROL - ~SimulatorViper850.TOOL_CUSTOM - ~SimulatorViper850.TOOL_FRAME - ~SimulatorViper850.TOOL_GENERIC_CAMERA - ~SimulatorViper850.TOOL_MARLIN_F033C_CAMERA - ~SimulatorViper850.TOOL_PTGREY_FLEA2_CAMERA - ~SimulatorViper850.TOOL_SCHUNK_GRIPPER_CAMERA - ~SimulatorViper850.defaultPositioningVelocity - ~SimulatorViper850.defaultTool - ~SimulatorViper850.njoint - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.robot.Unicycle.rst b/modules/python/doc/_autosummary/visp.robot.Unicycle.rst deleted file mode 100644 index 5f4671eb5a..0000000000 --- a/modules/python/doc/_autosummary/visp.robot.Unicycle.rst +++ /dev/null @@ -1,53 +0,0 @@ -Unicycle -======== - -.. currentmodule:: visp.robot - -.. autoclass:: Unicycle - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~Unicycle.get_cMe - ~Unicycle.get_cVe - ~Unicycle.get_eJe - ~Unicycle.set_cMe - ~Unicycle.set_eJe - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~Unicycle.__doc__ - ~Unicycle.__init__ - ~Unicycle.__module__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.robot.Viper.rst b/modules/python/doc/_autosummary/visp.robot.Viper.rst deleted file mode 100644 index 02a3aafeb8..0000000000 --- a/modules/python/doc/_autosummary/visp.robot.Viper.rst +++ /dev/null @@ -1,73 +0,0 @@ -Viper -===== - -.. currentmodule:: visp.robot - -.. autoclass:: Viper - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~Viper.getCoupl56 - ~Viper.getForwardKinematics - ~Viper.getInverseKinematics - ~Viper.getInverseKinematicsWrist - ~Viper.getJointMax - ~Viper.getJointMin - ~Viper.get_cMe - ~Viper.get_cVe - ~Viper.get_eJe - ~Viper.get_eMc - ~Viper.get_eMs - ~Viper.get_fJe - ~Viper.get_fJw - ~Viper.get_fMc - ~Viper.get_fMe - ~Viper.get_fMw - ~Viper.get_wMe - ~Viper.set_eMc - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~Viper.__doc__ - ~Viper.__init__ - ~Viper.__module__ - ~Viper.__repr__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~Viper.njoint - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.robot.Viper650.rst b/modules/python/doc/_autosummary/visp.robot.Viper650.rst deleted file mode 100644 index 17a5734dd6..0000000000 --- a/modules/python/doc/_autosummary/visp.robot.Viper650.rst +++ /dev/null @@ -1,88 +0,0 @@ -Viper650 -======== - -.. currentmodule:: visp.robot - -.. autoclass:: Viper650 - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~Viper650.getCameraParameters - ~Viper650.getCameraParametersProjType - ~Viper650.getToolType - ~Viper650.init - ~Viper650.parseConfigFile - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~Viper650.get_wMe - ~Viper650.get_fJe - ~Viper650.getInverseKinematics - ~Viper650.get_fMc - ~Viper650.set_eMc - ~Viper650.get_fMe - ~Viper650.get_eJe - ~Viper650.get_fMw - ~Viper650.getJointMin - ~Viper650.getCoupl56 - ~Viper650.get_eMc - ~Viper650.njoint - ~Viper650.getJointMax - ~Viper650.getForwardKinematics - ~Viper650.get_fJw - ~Viper650.get_cVe - ~Viper650.get_cMe - ~Viper650.get_eMs - ~Viper650.getInverseKinematicsWrist - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~Viper650.__doc__ - ~Viper650.__init__ - ~Viper650.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~Viper650.CONST_GENERIC_CAMERA_NAME - ~Viper650.CONST_MARLIN_F033C_CAMERA_NAME - ~Viper650.CONST_PTGREY_FLEA2_CAMERA_NAME - ~Viper650.CONST_SCHUNK_GRIPPER_CAMERA_NAME - ~Viper650.TOOL_CUSTOM - ~Viper650.TOOL_GENERIC_CAMERA - ~Viper650.TOOL_MARLIN_F033C_CAMERA - ~Viper650.TOOL_PTGREY_FLEA2_CAMERA - ~Viper650.TOOL_SCHUNK_GRIPPER_CAMERA - ~Viper650.defaultTool - ~Viper650.njoint - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.robot.Viper850.rst b/modules/python/doc/_autosummary/visp.robot.Viper850.rst deleted file mode 100644 index b5e924abf9..0000000000 --- a/modules/python/doc/_autosummary/visp.robot.Viper850.rst +++ /dev/null @@ -1,88 +0,0 @@ -Viper850 -======== - -.. currentmodule:: visp.robot - -.. autoclass:: Viper850 - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~Viper850.getCameraParameters - ~Viper850.getCameraParametersProjType - ~Viper850.getToolType - ~Viper850.init - ~Viper850.parseConfigFile - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~Viper850.get_wMe - ~Viper850.get_fJe - ~Viper850.getInverseKinematics - ~Viper850.get_fMc - ~Viper850.set_eMc - ~Viper850.get_fMe - ~Viper850.get_eJe - ~Viper850.get_fMw - ~Viper850.getJointMin - ~Viper850.getCoupl56 - ~Viper850.get_eMc - ~Viper850.njoint - ~Viper850.getJointMax - ~Viper850.getForwardKinematics - ~Viper850.get_fJw - ~Viper850.get_cVe - ~Viper850.get_cMe - ~Viper850.get_eMs - ~Viper850.getInverseKinematicsWrist - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~Viper850.__doc__ - ~Viper850.__init__ - ~Viper850.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~Viper850.CONST_GENERIC_CAMERA_NAME - ~Viper850.CONST_MARLIN_F033C_CAMERA_NAME - ~Viper850.CONST_PTGREY_FLEA2_CAMERA_NAME - ~Viper850.CONST_SCHUNK_GRIPPER_CAMERA_NAME - ~Viper850.TOOL_CUSTOM - ~Viper850.TOOL_GENERIC_CAMERA - ~Viper850.TOOL_MARLIN_F033C_CAMERA - ~Viper850.TOOL_PTGREY_FLEA2_CAMERA - ~Viper850.TOOL_SCHUNK_GRIPPER_CAMERA - ~Viper850.defaultTool - ~Viper850.njoint - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.robot.WireFrameSimulator.rst b/modules/python/doc/_autosummary/visp.robot.WireFrameSimulator.rst deleted file mode 100644 index 37f6cb7924..0000000000 --- a/modules/python/doc/_autosummary/visp.robot.WireFrameSimulator.rst +++ /dev/null @@ -1,103 +0,0 @@ -WireFrameSimulator -================== - -.. currentmodule:: visp.robot - -.. autoclass:: WireFrameSimulator - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~WireFrameSimulator.deleteCameraPositionHistory - ~WireFrameSimulator.displayTrajectory - ~WireFrameSimulator.getExternalCameraParameters - ~WireFrameSimulator.getExternalCameraPosition - ~WireFrameSimulator.getExternalImage - ~WireFrameSimulator.getInternalCameraParameters - ~WireFrameSimulator.getInternalImage - ~WireFrameSimulator.get_cMo - ~WireFrameSimulator.get_cMo_History - ~WireFrameSimulator.get_fMo - ~WireFrameSimulator.get_fMo_History - ~WireFrameSimulator.initScene - ~WireFrameSimulator.setCameraColor - ~WireFrameSimulator.setCameraPositionRelObj - ~WireFrameSimulator.setCameraPositionRelWorld - ~WireFrameSimulator.setCameraSizeFactor - ~WireFrameSimulator.setCameraTrajectoryColor - ~WireFrameSimulator.setCameraTrajectoryDisplayType - ~WireFrameSimulator.setCurrentViewColor - ~WireFrameSimulator.setDesiredCameraPosition - ~WireFrameSimulator.setDesiredViewColor - ~WireFrameSimulator.setDisplayCameraTrajectory - ~WireFrameSimulator.setExternalCameraParameters - ~WireFrameSimulator.setExternalCameraPosition - ~WireFrameSimulator.setGraphicsThickness - ~WireFrameSimulator.setInternalCameraParameters - ~WireFrameSimulator.setNbPtTrajectory - ~WireFrameSimulator.set_fMo - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~WireFrameSimulator.__doc__ - ~WireFrameSimulator.__init__ - ~WireFrameSimulator.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~WireFrameSimulator.CIRCLE - ~WireFrameSimulator.CT_LINE - ~WireFrameSimulator.CT_POINT - ~WireFrameSimulator.CUBE - ~WireFrameSimulator.CYLINDER - ~WireFrameSimulator.DIAMOND - ~WireFrameSimulator.D_CIRCLE - ~WireFrameSimulator.D_STANDARD - ~WireFrameSimulator.D_TOOL - ~WireFrameSimulator.PIPE - ~WireFrameSimulator.PLAN - ~WireFrameSimulator.PLATE - ~WireFrameSimulator.POINT_CLOUD - ~WireFrameSimulator.RECTANGLE - ~WireFrameSimulator.ROAD - ~WireFrameSimulator.SMALL_PLATE - ~WireFrameSimulator.SPHERE - ~WireFrameSimulator.SQUARE_10CM - ~WireFrameSimulator.THREE_LINES - ~WireFrameSimulator.THREE_PTS - ~WireFrameSimulator.TIRE - ~WireFrameSimulator.TRAPEZOID - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.robot.rst b/modules/python/doc/_autosummary/visp.robot.rst deleted file mode 100644 index c00334ba7b..0000000000 --- a/modules/python/doc/_autosummary/visp.robot.rst +++ /dev/null @@ -1,59 +0,0 @@ -robot -===== - -.. automodule:: visp.robot - - - - - - - - - - - - .. rubric:: Classes - - .. autosummary:: - :toctree: - :template: custom-class-template.rst - :nosignatures: - - Afma4 - Afma6 - Biclops - ImageSimulator - Pioneer - PioneerPan - Pololu - Ptu46 - QbDevice - QbSoftHand - ReflexTakktile2 - RingLight - Robot - RobotPololuPtu - RobotSimulator - RobotTemplate - RobotWireFrameSimulator - Servolens - SimulatorAfma6 - SimulatorCamera - SimulatorPioneer - SimulatorPioneerPan - SimulatorViper850 - Unicycle - Viper - Viper650 - Viper850 - WireFrameSimulator - - - - - - - - - diff --git a/modules/python/doc/_autosummary/visp.sensor.ForceTorqueAtiNetFTSensor.rst b/modules/python/doc/_autosummary/visp.sensor.ForceTorqueAtiNetFTSensor.rst deleted file mode 100644 index bbb22e1950..0000000000 --- a/modules/python/doc/_autosummary/visp.sensor.ForceTorqueAtiNetFTSensor.rst +++ /dev/null @@ -1,64 +0,0 @@ -ForceTorqueAtiNetFTSensor -========================= - -.. currentmodule:: visp.sensor - -.. autoclass:: ForceTorqueAtiNetFTSensor - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~ForceTorqueAtiNetFTSensor.bias - ~ForceTorqueAtiNetFTSensor.getCountsPerForce - ~ForceTorqueAtiNetFTSensor.getCountsPerTorque - ~ForceTorqueAtiNetFTSensor.getDataCounter - ~ForceTorqueAtiNetFTSensor.getForceTorque - ~ForceTorqueAtiNetFTSensor.getScalingFactor - ~ForceTorqueAtiNetFTSensor.setCountsPerForce - ~ForceTorqueAtiNetFTSensor.setCountsPerTorque - ~ForceTorqueAtiNetFTSensor.setScalingFactor - ~ForceTorqueAtiNetFTSensor.startStreaming - ~ForceTorqueAtiNetFTSensor.stopStreaming - ~ForceTorqueAtiNetFTSensor.unbias - ~ForceTorqueAtiNetFTSensor.waitForNewData - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~ForceTorqueAtiNetFTSensor.receive - ~ForceTorqueAtiNetFTSensor.send - ~ForceTorqueAtiNetFTSensor.init - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~ForceTorqueAtiNetFTSensor.__doc__ - ~ForceTorqueAtiNetFTSensor.__init__ - ~ForceTorqueAtiNetFTSensor.__module__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.sensor.LaserScan.rst b/modules/python/doc/_autosummary/visp.sensor.LaserScan.rst deleted file mode 100644 index 450c4048ce..0000000000 --- a/modules/python/doc/_autosummary/visp.sensor.LaserScan.rst +++ /dev/null @@ -1,60 +0,0 @@ -LaserScan -========= - -.. currentmodule:: visp.sensor - -.. autoclass:: LaserScan - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~LaserScan.addPoint - ~LaserScan.clear - ~LaserScan.getEndTimestamp - ~LaserScan.getScanPoints - ~LaserScan.getStartTimestamp - ~LaserScan.setEndTimestamp - ~LaserScan.setMeasurementId - ~LaserScan.setNumPoints - ~LaserScan.setNumSteps - ~LaserScan.setStartAngle - ~LaserScan.setStartTimestamp - ~LaserScan.setStopAngle - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~LaserScan.__doc__ - ~LaserScan.__init__ - ~LaserScan.__module__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.sensor.LaserScanner.rst b/modules/python/doc/_autosummary/visp.sensor.LaserScanner.rst deleted file mode 100644 index e4f701788a..0000000000 --- a/modules/python/doc/_autosummary/visp.sensor.LaserScanner.rst +++ /dev/null @@ -1,50 +0,0 @@ -LaserScanner -============ - -.. currentmodule:: visp.sensor - -.. autoclass:: LaserScanner - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~LaserScanner.setIpAddress - ~LaserScanner.setPort - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~LaserScanner.__doc__ - ~LaserScanner.__init__ - ~LaserScanner.__module__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.sensor.Mocap.rst b/modules/python/doc/_autosummary/visp.sensor.Mocap.rst deleted file mode 100644 index ce7dd1290d..0000000000 --- a/modules/python/doc/_autosummary/visp.sensor.Mocap.rst +++ /dev/null @@ -1,50 +0,0 @@ -Mocap -===== - -.. currentmodule:: visp.sensor - -.. autoclass:: Mocap - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~Mocap.setServerAddress - ~Mocap.setVerbose - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~Mocap.__doc__ - ~Mocap.__init__ - ~Mocap.__module__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.sensor.RealSense2.rst b/modules/python/doc/_autosummary/visp.sensor.RealSense2.rst deleted file mode 100644 index eb3003d12c..0000000000 --- a/modules/python/doc/_autosummary/visp.sensor.RealSense2.rst +++ /dev/null @@ -1,62 +0,0 @@ -RealSense2 -========== - -.. currentmodule:: visp.sensor - -.. autoclass:: RealSense2 - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~RealSense2.close - ~RealSense2.getCameraParameters - ~RealSense2.getDepthScale - ~RealSense2.getIntrinsics - ~RealSense2.getInvalidDepthValue - ~RealSense2.getMaxZ - ~RealSense2.getPipeline - ~RealSense2.getPipelineProfile - ~RealSense2.getProductLine - ~RealSense2.getTransformation - ~RealSense2.open - ~RealSense2.setInvalidDepthValue - ~RealSense2.setMaxZ - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~RealSense2.__doc__ - ~RealSense2.__init__ - ~RealSense2.__module__ - ~RealSense2.__repr__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.sensor.ScanPoint.rst b/modules/python/doc/_autosummary/visp.sensor.ScanPoint.rst deleted file mode 100644 index a23e311aa1..0000000000 --- a/modules/python/doc/_autosummary/visp.sensor.ScanPoint.rst +++ /dev/null @@ -1,56 +0,0 @@ -ScanPoint -========= - -.. currentmodule:: visp.sensor - -.. autoclass:: ScanPoint - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~ScanPoint.getHAngle - ~ScanPoint.getRadialDist - ~ScanPoint.getVAngle - ~ScanPoint.getX - ~ScanPoint.getY - ~ScanPoint.getZ - ~ScanPoint.setPolar - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~ScanPoint.__doc__ - ~ScanPoint.__init__ - ~ScanPoint.__module__ - ~ScanPoint.__repr__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.sensor.SickLDMRS.rst b/modules/python/doc/_autosummary/visp.sensor.SickLDMRS.rst deleted file mode 100644 index d39758c275..0000000000 --- a/modules/python/doc/_autosummary/visp.sensor.SickLDMRS.rst +++ /dev/null @@ -1,58 +0,0 @@ -SickLDMRS -========= - -.. currentmodule:: visp.sensor - -.. autoclass:: SickLDMRS - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~SickLDMRS.setup - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~SickLDMRS.setIpAddress - ~SickLDMRS.setPort - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~SickLDMRS.__doc__ - ~SickLDMRS.__init__ - ~SickLDMRS.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~SickLDMRS.MagicWordC2 - ~SickLDMRS.MeasuredData - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.sensor.V4l2Grabber.rst b/modules/python/doc/_autosummary/visp.sensor.V4l2Grabber.rst deleted file mode 100644 index 1ccb26f6ab..0000000000 --- a/modules/python/doc/_autosummary/visp.sensor.V4l2Grabber.rst +++ /dev/null @@ -1,90 +0,0 @@ -V4l2Grabber -=========== - -.. currentmodule:: visp.sensor - -.. autoclass:: V4l2Grabber - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~V4l2Grabber.acquire - ~V4l2Grabber.close - ~V4l2Grabber.getField - ~V4l2Grabber.getFramerate - ~V4l2Grabber.getPixelFormat - ~V4l2Grabber.open - ~V4l2Grabber.setDevice - ~V4l2Grabber.setFramerate - ~V4l2Grabber.setHeight - ~V4l2Grabber.setInput - ~V4l2Grabber.setNBuffers - ~V4l2Grabber.setPixelFormat - ~V4l2Grabber.setScale - ~V4l2Grabber.setVerboseMode - ~V4l2Grabber.setWidth - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~V4l2Grabber.getWidth - ~V4l2Grabber.getHeight - ~V4l2Grabber.init - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~V4l2Grabber.__doc__ - ~V4l2Grabber.__init__ - ~V4l2Grabber.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~V4l2Grabber.DEFAULT_INPUT - ~V4l2Grabber.DEFAULT_SCALE - ~V4l2Grabber.FRAME_SIZE - ~V4l2Grabber.MAX_BUFFERS - ~V4l2Grabber.MAX_CTRL - ~V4l2Grabber.MAX_FORMAT - ~V4l2Grabber.MAX_INPUTS - ~V4l2Grabber.MAX_NORM - ~V4l2Grabber.V4L2_BGR24_FORMAT - ~V4l2Grabber.V4L2_FRAME_FORMAT - ~V4l2Grabber.V4L2_GREY_FORMAT - ~V4l2Grabber.V4L2_IMAGE_FORMAT - ~V4l2Grabber.V4L2_MAX_FORMAT - ~V4l2Grabber.V4L2_RGB24_FORMAT - ~V4l2Grabber.V4L2_RGB32_FORMAT - ~V4l2Grabber.V4L2_YUYV_FORMAT - ~V4l2Grabber.framerate_25fps - ~V4l2Grabber.framerate_50fps - ~V4l2Grabber.init - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.sensor.rst b/modules/python/doc/_autosummary/visp.sensor.rst deleted file mode 100644 index 6ad7e581c5..0000000000 --- a/modules/python/doc/_autosummary/visp.sensor.rst +++ /dev/null @@ -1,40 +0,0 @@ -sensor -====== - -.. automodule:: visp.sensor - - - - - - - - - - - - .. rubric:: Classes - - .. autosummary:: - :toctree: - :template: custom-class-template.rst - :nosignatures: - - 1394TwoGrabber - ForceTorqueAtiNetFTSensor - LaserScan - LaserScanner - Mocap - RealSense2 - ScanPoint - SickLDMRS - V4l2Grabber - - - - - - - - - diff --git a/modules/python/doc/_autosummary/visp.tt.TemplateTracker.rst b/modules/python/doc/_autosummary/visp.tt.TemplateTracker.rst deleted file mode 100644 index 00c717f24a..0000000000 --- a/modules/python/doc/_autosummary/visp.tt.TemplateTracker.rst +++ /dev/null @@ -1,78 +0,0 @@ -TemplateTracker -=============== - -.. currentmodule:: visp.tt - -.. autoclass:: TemplateTracker - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~TemplateTracker.display - ~TemplateTracker.getDiverge - ~TemplateTracker.getG - ~TemplateTracker.getH - ~TemplateTracker.getNbIteration - ~TemplateTracker.getNbParam - ~TemplateTracker.getRatioPixelIn - ~TemplateTracker.getZoneRef - ~TemplateTracker.getdp - ~TemplateTracker.getp - ~TemplateTracker.initClick - ~TemplateTracker.initFromPoints - ~TemplateTracker.initFromZone - ~TemplateTracker.resetTracker - ~TemplateTracker.setBlur - ~TemplateTracker.setCostFunctionVerification - ~TemplateTracker.setGain - ~TemplateTracker.setGaussianFilterSize - ~TemplateTracker.setHDes - ~TemplateTracker.setIterationMax - ~TemplateTracker.setLambda - ~TemplateTracker.setNbIterBrent - ~TemplateTracker.setPyramidal - ~TemplateTracker.setSampling - ~TemplateTracker.setThresholdGradient - ~TemplateTracker.setThresholdResidualDifference - ~TemplateTracker.setUseBrent - ~TemplateTracker.setp - ~TemplateTracker.track - ~TemplateTracker.trackRobust - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~TemplateTracker.__doc__ - ~TemplateTracker.__init__ - ~TemplateTracker.__module__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.tt.TemplateTrackerDPoint.rst b/modules/python/doc/_autosummary/visp.tt.TemplateTrackerDPoint.rst deleted file mode 100644 index 1e3ef17a1f..0000000000 --- a/modules/python/doc/_autosummary/visp.tt.TemplateTrackerDPoint.rst +++ /dev/null @@ -1,55 +0,0 @@ -TemplateTrackerDPoint -===================== - -.. currentmodule:: visp.tt - -.. autoclass:: TemplateTrackerDPoint - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~TemplateTrackerDPoint.__doc__ - ~TemplateTrackerDPoint.__init__ - ~TemplateTrackerDPoint.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~TemplateTrackerDPoint.x - ~TemplateTrackerDPoint.y - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.tt.TemplateTrackerPoint.rst b/modules/python/doc/_autosummary/visp.tt.TemplateTrackerPoint.rst deleted file mode 100644 index 327ed3b135..0000000000 --- a/modules/python/doc/_autosummary/visp.tt.TemplateTrackerPoint.rst +++ /dev/null @@ -1,58 +0,0 @@ -TemplateTrackerPoint -==================== - -.. currentmodule:: visp.tt - -.. autoclass:: TemplateTrackerPoint - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~TemplateTrackerPoint.__doc__ - ~TemplateTrackerPoint.__init__ - ~TemplateTrackerPoint.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~TemplateTrackerPoint.dx - ~TemplateTrackerPoint.dy - ~TemplateTrackerPoint.val - ~TemplateTrackerPoint.x - ~TemplateTrackerPoint.y - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.tt.TemplateTrackerPointCompo.rst b/modules/python/doc/_autosummary/visp.tt.TemplateTrackerPointCompo.rst deleted file mode 100644 index 07e4b9b837..0000000000 --- a/modules/python/doc/_autosummary/visp.tt.TemplateTrackerPointCompo.rst +++ /dev/null @@ -1,48 +0,0 @@ -TemplateTrackerPointCompo -========================= - -.. currentmodule:: visp.tt - -.. autoclass:: TemplateTrackerPointCompo - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~TemplateTrackerPointCompo.__doc__ - ~TemplateTrackerPointCompo.__init__ - ~TemplateTrackerPointCompo.__module__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.tt.TemplateTrackerSSD.rst b/modules/python/doc/_autosummary/visp.tt.TemplateTrackerSSD.rst deleted file mode 100644 index 98730b9846..0000000000 --- a/modules/python/doc/_autosummary/visp.tt.TemplateTrackerSSD.rst +++ /dev/null @@ -1,79 +0,0 @@ -TemplateTrackerSSD -================== - -.. currentmodule:: visp.tt - -.. autoclass:: TemplateTrackerSSD - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~TemplateTrackerSSD.getSSD - ~TemplateTrackerSSD.setGain - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~TemplateTrackerSSD.setLambda - ~TemplateTrackerSSD.setp - ~TemplateTrackerSSD.getNbParam - ~TemplateTrackerSSD.getG - ~TemplateTrackerSSD.getp - ~TemplateTrackerSSD.track - ~TemplateTrackerSSD.initFromZone - ~TemplateTrackerSSD.getDiverge - ~TemplateTrackerSSD.trackRobust - ~TemplateTrackerSSD.setCostFunctionVerification - ~TemplateTrackerSSD.setGaussianFilterSize - ~TemplateTrackerSSD.initClick - ~TemplateTrackerSSD.getRatioPixelIn - ~TemplateTrackerSSD.setThresholdResidualDifference - ~TemplateTrackerSSD.getNbIteration - ~TemplateTrackerSSD.initFromPoints - ~TemplateTrackerSSD.setSampling - ~TemplateTrackerSSD.setIterationMax - ~TemplateTrackerSSD.display - ~TemplateTrackerSSD.setUseBrent - ~TemplateTrackerSSD.setNbIterBrent - ~TemplateTrackerSSD.setThresholdGradient - ~TemplateTrackerSSD.getZoneRef - ~TemplateTrackerSSD.resetTracker - ~TemplateTrackerSSD.getdp - ~TemplateTrackerSSD.getH - ~TemplateTrackerSSD.setHDes - ~TemplateTrackerSSD.setBlur - ~TemplateTrackerSSD.setPyramidal - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~TemplateTrackerSSD.__doc__ - ~TemplateTrackerSSD.__init__ - ~TemplateTrackerSSD.__module__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.tt.TemplateTrackerSSDESM.rst b/modules/python/doc/_autosummary/visp.tt.TemplateTrackerSSDESM.rst deleted file mode 100644 index a4958682b3..0000000000 --- a/modules/python/doc/_autosummary/visp.tt.TemplateTrackerSSDESM.rst +++ /dev/null @@ -1,79 +0,0 @@ -TemplateTrackerSSDESM -===================== - -.. currentmodule:: visp.tt - -.. autoclass:: TemplateTrackerSSDESM - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~TemplateTrackerSSDESM.setLambda - ~TemplateTrackerSSDESM.setp - ~TemplateTrackerSSDESM.getNbParam - ~TemplateTrackerSSDESM.getG - ~TemplateTrackerSSDESM.getp - ~TemplateTrackerSSDESM.track - ~TemplateTrackerSSDESM.initFromZone - ~TemplateTrackerSSDESM.getDiverge - ~TemplateTrackerSSDESM.trackRobust - ~TemplateTrackerSSDESM.setCostFunctionVerification - ~TemplateTrackerSSDESM.setGaussianFilterSize - ~TemplateTrackerSSDESM.initClick - ~TemplateTrackerSSDESM.getRatioPixelIn - ~TemplateTrackerSSDESM.setThresholdResidualDifference - ~TemplateTrackerSSDESM.getNbIteration - ~TemplateTrackerSSDESM.initFromPoints - ~TemplateTrackerSSDESM.getSSD - ~TemplateTrackerSSDESM.setSampling - ~TemplateTrackerSSDESM.setIterationMax - ~TemplateTrackerSSDESM.display - ~TemplateTrackerSSDESM.setUseBrent - ~TemplateTrackerSSDESM.setNbIterBrent - ~TemplateTrackerSSDESM.setThresholdGradient - ~TemplateTrackerSSDESM.getZoneRef - ~TemplateTrackerSSDESM.setGain - ~TemplateTrackerSSDESM.resetTracker - ~TemplateTrackerSSDESM.getdp - ~TemplateTrackerSSDESM.getH - ~TemplateTrackerSSDESM.setHDes - ~TemplateTrackerSSDESM.setBlur - ~TemplateTrackerSSDESM.setPyramidal - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~TemplateTrackerSSDESM.__doc__ - ~TemplateTrackerSSDESM.__init__ - ~TemplateTrackerSSDESM.__module__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.tt.TemplateTrackerSSDForwardAdditional.rst b/modules/python/doc/_autosummary/visp.tt.TemplateTrackerSSDForwardAdditional.rst deleted file mode 100644 index 9c06954ea4..0000000000 --- a/modules/python/doc/_autosummary/visp.tt.TemplateTrackerSSDForwardAdditional.rst +++ /dev/null @@ -1,89 +0,0 @@ -TemplateTrackerSSDForwardAdditional -=================================== - -.. currentmodule:: visp.tt - -.. autoclass:: TemplateTrackerSSDForwardAdditional - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~TemplateTrackerSSDForwardAdditional.setMinimizationMethod - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~TemplateTrackerSSDForwardAdditional.setLambda - ~TemplateTrackerSSDForwardAdditional.setp - ~TemplateTrackerSSDForwardAdditional.getNbParam - ~TemplateTrackerSSDForwardAdditional.getG - ~TemplateTrackerSSDForwardAdditional.getp - ~TemplateTrackerSSDForwardAdditional.track - ~TemplateTrackerSSDForwardAdditional.initFromZone - ~TemplateTrackerSSDForwardAdditional.getDiverge - ~TemplateTrackerSSDForwardAdditional.trackRobust - ~TemplateTrackerSSDForwardAdditional.setCostFunctionVerification - ~TemplateTrackerSSDForwardAdditional.setGaussianFilterSize - ~TemplateTrackerSSDForwardAdditional.initClick - ~TemplateTrackerSSDForwardAdditional.getRatioPixelIn - ~TemplateTrackerSSDForwardAdditional.setThresholdResidualDifference - ~TemplateTrackerSSDForwardAdditional.getNbIteration - ~TemplateTrackerSSDForwardAdditional.initFromPoints - ~TemplateTrackerSSDForwardAdditional.getSSD - ~TemplateTrackerSSDForwardAdditional.setSampling - ~TemplateTrackerSSDForwardAdditional.setIterationMax - ~TemplateTrackerSSDForwardAdditional.display - ~TemplateTrackerSSDForwardAdditional.setUseBrent - ~TemplateTrackerSSDForwardAdditional.setNbIterBrent - ~TemplateTrackerSSDForwardAdditional.setThresholdGradient - ~TemplateTrackerSSDForwardAdditional.getZoneRef - ~TemplateTrackerSSDForwardAdditional.setGain - ~TemplateTrackerSSDForwardAdditional.resetTracker - ~TemplateTrackerSSDForwardAdditional.getdp - ~TemplateTrackerSSDForwardAdditional.getH - ~TemplateTrackerSSDForwardAdditional.setHDes - ~TemplateTrackerSSDForwardAdditional.setBlur - ~TemplateTrackerSSDForwardAdditional.setPyramidal - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~TemplateTrackerSSDForwardAdditional.__doc__ - ~TemplateTrackerSSDForwardAdditional.__init__ - ~TemplateTrackerSSDForwardAdditional.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~TemplateTrackerSSDForwardAdditional.USE_GRADIENT - ~TemplateTrackerSSDForwardAdditional.USE_LMA - ~TemplateTrackerSSDForwardAdditional.USE_NEWTON - ~TemplateTrackerSSDForwardAdditional.USE_QUASINEWTON - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.tt.TemplateTrackerSSDForwardCompositional.rst b/modules/python/doc/_autosummary/visp.tt.TemplateTrackerSSDForwardCompositional.rst deleted file mode 100644 index 7f54d15458..0000000000 --- a/modules/python/doc/_autosummary/visp.tt.TemplateTrackerSSDForwardCompositional.rst +++ /dev/null @@ -1,79 +0,0 @@ -TemplateTrackerSSDForwardCompositional -====================================== - -.. currentmodule:: visp.tt - -.. autoclass:: TemplateTrackerSSDForwardCompositional - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~TemplateTrackerSSDForwardCompositional.setLambda - ~TemplateTrackerSSDForwardCompositional.setp - ~TemplateTrackerSSDForwardCompositional.getNbParam - ~TemplateTrackerSSDForwardCompositional.getG - ~TemplateTrackerSSDForwardCompositional.getp - ~TemplateTrackerSSDForwardCompositional.track - ~TemplateTrackerSSDForwardCompositional.initFromZone - ~TemplateTrackerSSDForwardCompositional.getDiverge - ~TemplateTrackerSSDForwardCompositional.trackRobust - ~TemplateTrackerSSDForwardCompositional.setCostFunctionVerification - ~TemplateTrackerSSDForwardCompositional.setGaussianFilterSize - ~TemplateTrackerSSDForwardCompositional.initClick - ~TemplateTrackerSSDForwardCompositional.getRatioPixelIn - ~TemplateTrackerSSDForwardCompositional.setThresholdResidualDifference - ~TemplateTrackerSSDForwardCompositional.getNbIteration - ~TemplateTrackerSSDForwardCompositional.initFromPoints - ~TemplateTrackerSSDForwardCompositional.getSSD - ~TemplateTrackerSSDForwardCompositional.setSampling - ~TemplateTrackerSSDForwardCompositional.setIterationMax - ~TemplateTrackerSSDForwardCompositional.display - ~TemplateTrackerSSDForwardCompositional.setUseBrent - ~TemplateTrackerSSDForwardCompositional.setNbIterBrent - ~TemplateTrackerSSDForwardCompositional.setThresholdGradient - ~TemplateTrackerSSDForwardCompositional.getZoneRef - ~TemplateTrackerSSDForwardCompositional.setGain - ~TemplateTrackerSSDForwardCompositional.resetTracker - ~TemplateTrackerSSDForwardCompositional.getdp - ~TemplateTrackerSSDForwardCompositional.getH - ~TemplateTrackerSSDForwardCompositional.setHDes - ~TemplateTrackerSSDForwardCompositional.setBlur - ~TemplateTrackerSSDForwardCompositional.setPyramidal - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~TemplateTrackerSSDForwardCompositional.__doc__ - ~TemplateTrackerSSDForwardCompositional.__init__ - ~TemplateTrackerSSDForwardCompositional.__module__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.tt.TemplateTrackerSSDInverseCompositional.rst b/modules/python/doc/_autosummary/visp.tt.TemplateTrackerSSDInverseCompositional.rst deleted file mode 100644 index 5a777ea749..0000000000 --- a/modules/python/doc/_autosummary/visp.tt.TemplateTrackerSSDInverseCompositional.rst +++ /dev/null @@ -1,80 +0,0 @@ -TemplateTrackerSSDInverseCompositional -====================================== - -.. currentmodule:: visp.tt - -.. autoclass:: TemplateTrackerSSDInverseCompositional - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~TemplateTrackerSSDInverseCompositional.setUseTemplateSelect - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~TemplateTrackerSSDInverseCompositional.setLambda - ~TemplateTrackerSSDInverseCompositional.setp - ~TemplateTrackerSSDInverseCompositional.getNbParam - ~TemplateTrackerSSDInverseCompositional.getG - ~TemplateTrackerSSDInverseCompositional.getp - ~TemplateTrackerSSDInverseCompositional.track - ~TemplateTrackerSSDInverseCompositional.initFromZone - ~TemplateTrackerSSDInverseCompositional.getDiverge - ~TemplateTrackerSSDInverseCompositional.trackRobust - ~TemplateTrackerSSDInverseCompositional.setCostFunctionVerification - ~TemplateTrackerSSDInverseCompositional.setGaussianFilterSize - ~TemplateTrackerSSDInverseCompositional.initClick - ~TemplateTrackerSSDInverseCompositional.getRatioPixelIn - ~TemplateTrackerSSDInverseCompositional.setThresholdResidualDifference - ~TemplateTrackerSSDInverseCompositional.getNbIteration - ~TemplateTrackerSSDInverseCompositional.initFromPoints - ~TemplateTrackerSSDInverseCompositional.getSSD - ~TemplateTrackerSSDInverseCompositional.setSampling - ~TemplateTrackerSSDInverseCompositional.setIterationMax - ~TemplateTrackerSSDInverseCompositional.display - ~TemplateTrackerSSDInverseCompositional.setUseBrent - ~TemplateTrackerSSDInverseCompositional.setNbIterBrent - ~TemplateTrackerSSDInverseCompositional.setThresholdGradient - ~TemplateTrackerSSDInverseCompositional.getZoneRef - ~TemplateTrackerSSDInverseCompositional.setGain - ~TemplateTrackerSSDInverseCompositional.resetTracker - ~TemplateTrackerSSDInverseCompositional.getdp - ~TemplateTrackerSSDInverseCompositional.getH - ~TemplateTrackerSSDInverseCompositional.setHDes - ~TemplateTrackerSSDInverseCompositional.setBlur - ~TemplateTrackerSSDInverseCompositional.setPyramidal - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~TemplateTrackerSSDInverseCompositional.__doc__ - ~TemplateTrackerSSDInverseCompositional.__init__ - ~TemplateTrackerSSDInverseCompositional.__module__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.tt.TemplateTrackerTriangle.rst b/modules/python/doc/_autosummary/visp.tt.TemplateTrackerTriangle.rst deleted file mode 100644 index 7341119bc4..0000000000 --- a/modules/python/doc/_autosummary/visp.tt.TemplateTrackerTriangle.rst +++ /dev/null @@ -1,59 +0,0 @@ -TemplateTrackerTriangle -======================= - -.. currentmodule:: visp.tt - -.. autoclass:: TemplateTrackerTriangle - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~TemplateTrackerTriangle.getArea - ~TemplateTrackerTriangle.getCorner - ~TemplateTrackerTriangle.getCorners - ~TemplateTrackerTriangle.getMaxx - ~TemplateTrackerTriangle.getMaxy - ~TemplateTrackerTriangle.getMinx - ~TemplateTrackerTriangle.getMiny - ~TemplateTrackerTriangle.getPyramidDown - ~TemplateTrackerTriangle.getSize - ~TemplateTrackerTriangle.inTriangle - ~TemplateTrackerTriangle.init - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~TemplateTrackerTriangle.__doc__ - ~TemplateTrackerTriangle.__init__ - ~TemplateTrackerTriangle.__module__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.tt.TemplateTrackerWarp.rst b/modules/python/doc/_autosummary/visp.tt.TemplateTrackerWarp.rst deleted file mode 100644 index 670108fb3b..0000000000 --- a/modules/python/doc/_autosummary/visp.tt.TemplateTrackerWarp.rst +++ /dev/null @@ -1,53 +0,0 @@ -TemplateTrackerWarp -=================== - -.. currentmodule:: visp.tt - -.. autoclass:: TemplateTrackerWarp - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~TemplateTrackerWarp.getDistanceBetweenZoneAndWarpedZone - ~TemplateTrackerWarp.getNbParam - ~TemplateTrackerWarp.setNbParam - ~TemplateTrackerWarp.warpTriangle - ~TemplateTrackerWarp.warpZone - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~TemplateTrackerWarp.__doc__ - ~TemplateTrackerWarp.__init__ - ~TemplateTrackerWarp.__module__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.tt.TemplateTrackerWarpAffine.rst b/modules/python/doc/_autosummary/visp.tt.TemplateTrackerWarpAffine.rst deleted file mode 100644 index 2e317afb64..0000000000 --- a/modules/python/doc/_autosummary/visp.tt.TemplateTrackerWarpAffine.rst +++ /dev/null @@ -1,61 +0,0 @@ -TemplateTrackerWarpAffine -========================= - -.. currentmodule:: visp.tt - -.. autoclass:: TemplateTrackerWarpAffine - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~TemplateTrackerWarpAffine.dWarp - ~TemplateTrackerWarpAffine.getParamInverse - ~TemplateTrackerWarpAffine.getParamPyramidDown - ~TemplateTrackerWarpAffine.getParamPyramidUp - ~TemplateTrackerWarpAffine.isESMcompatible - ~TemplateTrackerWarpAffine.pRondp - ~TemplateTrackerWarpAffine.warpX - ~TemplateTrackerWarpAffine.warpXInv - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~TemplateTrackerWarpAffine.getNbParam - ~TemplateTrackerWarpAffine.warpTriangle - ~TemplateTrackerWarpAffine.getDistanceBetweenZoneAndWarpedZone - ~TemplateTrackerWarpAffine.setNbParam - ~TemplateTrackerWarpAffine.warpZone - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~TemplateTrackerWarpAffine.__doc__ - ~TemplateTrackerWarpAffine.__init__ - ~TemplateTrackerWarpAffine.__module__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.tt.TemplateTrackerWarpHomography.rst b/modules/python/doc/_autosummary/visp.tt.TemplateTrackerWarpHomography.rst deleted file mode 100644 index 5bd5197c64..0000000000 --- a/modules/python/doc/_autosummary/visp.tt.TemplateTrackerWarpHomography.rst +++ /dev/null @@ -1,64 +0,0 @@ -TemplateTrackerWarpHomography -============================= - -.. currentmodule:: visp.tt - -.. autoclass:: TemplateTrackerWarpHomography - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~TemplateTrackerWarpHomography.computeDenom - ~TemplateTrackerWarpHomography.dWarp - ~TemplateTrackerWarpHomography.getHomography - ~TemplateTrackerWarpHomography.getParam - ~TemplateTrackerWarpHomography.getParamInverse - ~TemplateTrackerWarpHomography.getParamPyramidDown - ~TemplateTrackerWarpHomography.getParamPyramidUp - ~TemplateTrackerWarpHomography.isESMcompatible - ~TemplateTrackerWarpHomography.pRondp - ~TemplateTrackerWarpHomography.warpX - ~TemplateTrackerWarpHomography.warpXInv - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~TemplateTrackerWarpHomography.getNbParam - ~TemplateTrackerWarpHomography.warpTriangle - ~TemplateTrackerWarpHomography.getDistanceBetweenZoneAndWarpedZone - ~TemplateTrackerWarpHomography.setNbParam - ~TemplateTrackerWarpHomography.warpZone - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~TemplateTrackerWarpHomography.__doc__ - ~TemplateTrackerWarpHomography.__init__ - ~TemplateTrackerWarpHomography.__module__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.tt.TemplateTrackerWarpHomographySL3.rst b/modules/python/doc/_autosummary/visp.tt.TemplateTrackerWarpHomographySL3.rst deleted file mode 100644 index 92c092b7b9..0000000000 --- a/modules/python/doc/_autosummary/visp.tt.TemplateTrackerWarpHomographySL3.rst +++ /dev/null @@ -1,63 +0,0 @@ -TemplateTrackerWarpHomographySL3 -================================ - -.. currentmodule:: visp.tt - -.. autoclass:: TemplateTrackerWarpHomographySL3 - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~TemplateTrackerWarpHomographySL3.computeCoeff - ~TemplateTrackerWarpHomographySL3.computeDenom - ~TemplateTrackerWarpHomographySL3.dWarp - ~TemplateTrackerWarpHomographySL3.getHomography - ~TemplateTrackerWarpHomographySL3.getParamInverse - ~TemplateTrackerWarpHomographySL3.getParamPyramidDown - ~TemplateTrackerWarpHomographySL3.getParamPyramidUp - ~TemplateTrackerWarpHomographySL3.isESMcompatible - ~TemplateTrackerWarpHomographySL3.pRondp - ~TemplateTrackerWarpHomographySL3.warpX - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~TemplateTrackerWarpHomographySL3.getNbParam - ~TemplateTrackerWarpHomographySL3.warpTriangle - ~TemplateTrackerWarpHomographySL3.getDistanceBetweenZoneAndWarpedZone - ~TemplateTrackerWarpHomographySL3.setNbParam - ~TemplateTrackerWarpHomographySL3.warpZone - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~TemplateTrackerWarpHomographySL3.__doc__ - ~TemplateTrackerWarpHomographySL3.__init__ - ~TemplateTrackerWarpHomographySL3.__module__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.tt.TemplateTrackerWarpRT.rst b/modules/python/doc/_autosummary/visp.tt.TemplateTrackerWarpRT.rst deleted file mode 100644 index 6699489e78..0000000000 --- a/modules/python/doc/_autosummary/visp.tt.TemplateTrackerWarpRT.rst +++ /dev/null @@ -1,61 +0,0 @@ -TemplateTrackerWarpRT -===================== - -.. currentmodule:: visp.tt - -.. autoclass:: TemplateTrackerWarpRT - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~TemplateTrackerWarpRT.dWarp - ~TemplateTrackerWarpRT.getParamInverse - ~TemplateTrackerWarpRT.getParamPyramidDown - ~TemplateTrackerWarpRT.getParamPyramidUp - ~TemplateTrackerWarpRT.isESMcompatible - ~TemplateTrackerWarpRT.pRondp - ~TemplateTrackerWarpRT.warpX - ~TemplateTrackerWarpRT.warpXInv - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~TemplateTrackerWarpRT.getNbParam - ~TemplateTrackerWarpRT.warpTriangle - ~TemplateTrackerWarpRT.getDistanceBetweenZoneAndWarpedZone - ~TemplateTrackerWarpRT.setNbParam - ~TemplateTrackerWarpRT.warpZone - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~TemplateTrackerWarpRT.__doc__ - ~TemplateTrackerWarpRT.__init__ - ~TemplateTrackerWarpRT.__module__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.tt.TemplateTrackerWarpSRT.rst b/modules/python/doc/_autosummary/visp.tt.TemplateTrackerWarpSRT.rst deleted file mode 100644 index 440bbc4e0e..0000000000 --- a/modules/python/doc/_autosummary/visp.tt.TemplateTrackerWarpSRT.rst +++ /dev/null @@ -1,61 +0,0 @@ -TemplateTrackerWarpSRT -====================== - -.. currentmodule:: visp.tt - -.. autoclass:: TemplateTrackerWarpSRT - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~TemplateTrackerWarpSRT.dWarp - ~TemplateTrackerWarpSRT.getParamInverse - ~TemplateTrackerWarpSRT.getParamPyramidDown - ~TemplateTrackerWarpSRT.getParamPyramidUp - ~TemplateTrackerWarpSRT.isESMcompatible - ~TemplateTrackerWarpSRT.pRondp - ~TemplateTrackerWarpSRT.warpX - ~TemplateTrackerWarpSRT.warpXInv - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~TemplateTrackerWarpSRT.getNbParam - ~TemplateTrackerWarpSRT.warpTriangle - ~TemplateTrackerWarpSRT.getDistanceBetweenZoneAndWarpedZone - ~TemplateTrackerWarpSRT.setNbParam - ~TemplateTrackerWarpSRT.warpZone - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~TemplateTrackerWarpSRT.__doc__ - ~TemplateTrackerWarpSRT.__init__ - ~TemplateTrackerWarpSRT.__module__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.tt.TemplateTrackerWarpTranslation.rst b/modules/python/doc/_autosummary/visp.tt.TemplateTrackerWarpTranslation.rst deleted file mode 100644 index 3a74ae8ba7..0000000000 --- a/modules/python/doc/_autosummary/visp.tt.TemplateTrackerWarpTranslation.rst +++ /dev/null @@ -1,61 +0,0 @@ -TemplateTrackerWarpTranslation -============================== - -.. currentmodule:: visp.tt - -.. autoclass:: TemplateTrackerWarpTranslation - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~TemplateTrackerWarpTranslation.dWarp - ~TemplateTrackerWarpTranslation.getParamInverse - ~TemplateTrackerWarpTranslation.getParamPyramidDown - ~TemplateTrackerWarpTranslation.getParamPyramidUp - ~TemplateTrackerWarpTranslation.isESMcompatible - ~TemplateTrackerWarpTranslation.pRondp - ~TemplateTrackerWarpTranslation.warpX - ~TemplateTrackerWarpTranslation.warpXInv - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~TemplateTrackerWarpTranslation.getNbParam - ~TemplateTrackerWarpTranslation.warpTriangle - ~TemplateTrackerWarpTranslation.getDistanceBetweenZoneAndWarpedZone - ~TemplateTrackerWarpTranslation.setNbParam - ~TemplateTrackerWarpTranslation.warpZone - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~TemplateTrackerWarpTranslation.__doc__ - ~TemplateTrackerWarpTranslation.__init__ - ~TemplateTrackerWarpTranslation.__module__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.tt.TemplateTrackerZNCC.rst b/modules/python/doc/_autosummary/visp.tt.TemplateTrackerZNCC.rst deleted file mode 100644 index e512f822dd..0000000000 --- a/modules/python/doc/_autosummary/visp.tt.TemplateTrackerZNCC.rst +++ /dev/null @@ -1,78 +0,0 @@ -TemplateTrackerZNCC -=================== - -.. currentmodule:: visp.tt - -.. autoclass:: TemplateTrackerZNCC - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~TemplateTrackerZNCC.setGain - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~TemplateTrackerZNCC.setLambda - ~TemplateTrackerZNCC.setp - ~TemplateTrackerZNCC.getNbParam - ~TemplateTrackerZNCC.getG - ~TemplateTrackerZNCC.getp - ~TemplateTrackerZNCC.track - ~TemplateTrackerZNCC.initFromZone - ~TemplateTrackerZNCC.getDiverge - ~TemplateTrackerZNCC.trackRobust - ~TemplateTrackerZNCC.setCostFunctionVerification - ~TemplateTrackerZNCC.setGaussianFilterSize - ~TemplateTrackerZNCC.initClick - ~TemplateTrackerZNCC.getRatioPixelIn - ~TemplateTrackerZNCC.setThresholdResidualDifference - ~TemplateTrackerZNCC.getNbIteration - ~TemplateTrackerZNCC.initFromPoints - ~TemplateTrackerZNCC.setSampling - ~TemplateTrackerZNCC.setIterationMax - ~TemplateTrackerZNCC.display - ~TemplateTrackerZNCC.setUseBrent - ~TemplateTrackerZNCC.setNbIterBrent - ~TemplateTrackerZNCC.setThresholdGradient - ~TemplateTrackerZNCC.getZoneRef - ~TemplateTrackerZNCC.resetTracker - ~TemplateTrackerZNCC.getdp - ~TemplateTrackerZNCC.getH - ~TemplateTrackerZNCC.setHDes - ~TemplateTrackerZNCC.setBlur - ~TemplateTrackerZNCC.setPyramidal - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~TemplateTrackerZNCC.__doc__ - ~TemplateTrackerZNCC.__init__ - ~TemplateTrackerZNCC.__module__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.tt.TemplateTrackerZNCCForwardAdditional.rst b/modules/python/doc/_autosummary/visp.tt.TemplateTrackerZNCCForwardAdditional.rst deleted file mode 100644 index fdcd1b9d51..0000000000 --- a/modules/python/doc/_autosummary/visp.tt.TemplateTrackerZNCCForwardAdditional.rst +++ /dev/null @@ -1,78 +0,0 @@ -TemplateTrackerZNCCForwardAdditional -==================================== - -.. currentmodule:: visp.tt - -.. autoclass:: TemplateTrackerZNCCForwardAdditional - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~TemplateTrackerZNCCForwardAdditional.setLambda - ~TemplateTrackerZNCCForwardAdditional.setp - ~TemplateTrackerZNCCForwardAdditional.getNbParam - ~TemplateTrackerZNCCForwardAdditional.getG - ~TemplateTrackerZNCCForwardAdditional.getp - ~TemplateTrackerZNCCForwardAdditional.track - ~TemplateTrackerZNCCForwardAdditional.initFromZone - ~TemplateTrackerZNCCForwardAdditional.getDiverge - ~TemplateTrackerZNCCForwardAdditional.trackRobust - ~TemplateTrackerZNCCForwardAdditional.setCostFunctionVerification - ~TemplateTrackerZNCCForwardAdditional.setGaussianFilterSize - ~TemplateTrackerZNCCForwardAdditional.initClick - ~TemplateTrackerZNCCForwardAdditional.getRatioPixelIn - ~TemplateTrackerZNCCForwardAdditional.setThresholdResidualDifference - ~TemplateTrackerZNCCForwardAdditional.getNbIteration - ~TemplateTrackerZNCCForwardAdditional.initFromPoints - ~TemplateTrackerZNCCForwardAdditional.setSampling - ~TemplateTrackerZNCCForwardAdditional.setIterationMax - ~TemplateTrackerZNCCForwardAdditional.display - ~TemplateTrackerZNCCForwardAdditional.setUseBrent - ~TemplateTrackerZNCCForwardAdditional.setNbIterBrent - ~TemplateTrackerZNCCForwardAdditional.setThresholdGradient - ~TemplateTrackerZNCCForwardAdditional.getZoneRef - ~TemplateTrackerZNCCForwardAdditional.setGain - ~TemplateTrackerZNCCForwardAdditional.resetTracker - ~TemplateTrackerZNCCForwardAdditional.getdp - ~TemplateTrackerZNCCForwardAdditional.getH - ~TemplateTrackerZNCCForwardAdditional.setHDes - ~TemplateTrackerZNCCForwardAdditional.setBlur - ~TemplateTrackerZNCCForwardAdditional.setPyramidal - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~TemplateTrackerZNCCForwardAdditional.__doc__ - ~TemplateTrackerZNCCForwardAdditional.__init__ - ~TemplateTrackerZNCCForwardAdditional.__module__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.tt.TemplateTrackerZNCCInverseCompositional.rst b/modules/python/doc/_autosummary/visp.tt.TemplateTrackerZNCCInverseCompositional.rst deleted file mode 100644 index b60dc1f182..0000000000 --- a/modules/python/doc/_autosummary/visp.tt.TemplateTrackerZNCCInverseCompositional.rst +++ /dev/null @@ -1,78 +0,0 @@ -TemplateTrackerZNCCInverseCompositional -======================================= - -.. currentmodule:: visp.tt - -.. autoclass:: TemplateTrackerZNCCInverseCompositional - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~TemplateTrackerZNCCInverseCompositional.setLambda - ~TemplateTrackerZNCCInverseCompositional.setp - ~TemplateTrackerZNCCInverseCompositional.getNbParam - ~TemplateTrackerZNCCInverseCompositional.getG - ~TemplateTrackerZNCCInverseCompositional.getp - ~TemplateTrackerZNCCInverseCompositional.track - ~TemplateTrackerZNCCInverseCompositional.initFromZone - ~TemplateTrackerZNCCInverseCompositional.getDiverge - ~TemplateTrackerZNCCInverseCompositional.trackRobust - ~TemplateTrackerZNCCInverseCompositional.setCostFunctionVerification - ~TemplateTrackerZNCCInverseCompositional.setGaussianFilterSize - ~TemplateTrackerZNCCInverseCompositional.initClick - ~TemplateTrackerZNCCInverseCompositional.getRatioPixelIn - ~TemplateTrackerZNCCInverseCompositional.setThresholdResidualDifference - ~TemplateTrackerZNCCInverseCompositional.getNbIteration - ~TemplateTrackerZNCCInverseCompositional.initFromPoints - ~TemplateTrackerZNCCInverseCompositional.setSampling - ~TemplateTrackerZNCCInverseCompositional.setIterationMax - ~TemplateTrackerZNCCInverseCompositional.display - ~TemplateTrackerZNCCInverseCompositional.setUseBrent - ~TemplateTrackerZNCCInverseCompositional.setNbIterBrent - ~TemplateTrackerZNCCInverseCompositional.setThresholdGradient - ~TemplateTrackerZNCCInverseCompositional.getZoneRef - ~TemplateTrackerZNCCInverseCompositional.setGain - ~TemplateTrackerZNCCInverseCompositional.resetTracker - ~TemplateTrackerZNCCInverseCompositional.getdp - ~TemplateTrackerZNCCInverseCompositional.getH - ~TemplateTrackerZNCCInverseCompositional.setHDes - ~TemplateTrackerZNCCInverseCompositional.setBlur - ~TemplateTrackerZNCCInverseCompositional.setPyramidal - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~TemplateTrackerZNCCInverseCompositional.__doc__ - ~TemplateTrackerZNCCInverseCompositional.__init__ - ~TemplateTrackerZNCCInverseCompositional.__module__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.tt.TemplateTrackerZPoint.rst b/modules/python/doc/_autosummary/visp.tt.TemplateTrackerZPoint.rst deleted file mode 100644 index 52fb0cf889..0000000000 --- a/modules/python/doc/_autosummary/visp.tt.TemplateTrackerZPoint.rst +++ /dev/null @@ -1,55 +0,0 @@ -TemplateTrackerZPoint -===================== - -.. currentmodule:: visp.tt - -.. autoclass:: TemplateTrackerZPoint - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~TemplateTrackerZPoint.__doc__ - ~TemplateTrackerZPoint.__init__ - ~TemplateTrackerZPoint.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~TemplateTrackerZPoint.x - ~TemplateTrackerZPoint.y - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.tt.TemplateTrackerZone.rst b/modules/python/doc/_autosummary/visp.tt.TemplateTrackerZone.rst deleted file mode 100644 index c15b38fcb9..0000000000 --- a/modules/python/doc/_autosummary/visp.tt.TemplateTrackerZone.rst +++ /dev/null @@ -1,66 +0,0 @@ -TemplateTrackerZone -=================== - -.. currentmodule:: visp.tt - -.. autoclass:: TemplateTrackerZone - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~TemplateTrackerZone.add - ~TemplateTrackerZone.clear - ~TemplateTrackerZone.copy - ~TemplateTrackerZone.display - ~TemplateTrackerZone.fillTriangle - ~TemplateTrackerZone.getArea - ~TemplateTrackerZone.getBoundingBox - ~TemplateTrackerZone.getCenter - ~TemplateTrackerZone.getMaxx - ~TemplateTrackerZone.getMaxy - ~TemplateTrackerZone.getMinx - ~TemplateTrackerZone.getMiny - ~TemplateTrackerZone.getNbTriangle - ~TemplateTrackerZone.getPyramidDown - ~TemplateTrackerZone.getTriangle - ~TemplateTrackerZone.inZone - ~TemplateTrackerZone.initClick - ~TemplateTrackerZone.initFromPoints - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~TemplateTrackerZone.__doc__ - ~TemplateTrackerZone.__init__ - ~TemplateTrackerZone.__module__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.tt.rst b/modules/python/doc/_autosummary/visp.tt.rst deleted file mode 100644 index 9e607632f1..0000000000 --- a/modules/python/doc/_autosummary/visp.tt.rst +++ /dev/null @@ -1,53 +0,0 @@ -tt -== - -.. automodule:: visp.tt - - - - - - - - - - - - .. rubric:: Classes - - .. autosummary:: - :toctree: - :template: custom-class-template.rst - :nosignatures: - - TemplateTracker - TemplateTrackerDPoint - TemplateTrackerPoint - TemplateTrackerPointCompo - TemplateTrackerSSD - TemplateTrackerSSDESM - TemplateTrackerSSDForwardAdditional - TemplateTrackerSSDForwardCompositional - TemplateTrackerSSDInverseCompositional - TemplateTrackerTriangle - TemplateTrackerWarp - TemplateTrackerWarpAffine - TemplateTrackerWarpHomography - TemplateTrackerWarpHomographySL3 - TemplateTrackerWarpRT - TemplateTrackerWarpSRT - TemplateTrackerWarpTranslation - TemplateTrackerZNCC - TemplateTrackerZNCCForwardAdditional - TemplateTrackerZNCCInverseCompositional - TemplateTrackerZPoint - TemplateTrackerZone - - - - - - - - - diff --git a/modules/python/doc/_autosummary/visp.tt_mi.TemplateTrackerMI.rst b/modules/python/doc/_autosummary/visp.tt_mi.TemplateTrackerMI.rst deleted file mode 100644 index e28798cab2..0000000000 --- a/modules/python/doc/_autosummary/visp.tt_mi.TemplateTrackerMI.rst +++ /dev/null @@ -1,103 +0,0 @@ -TemplateTrackerMI -================= - -.. currentmodule:: visp.tt_mi - -.. autoclass:: TemplateTrackerMI - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~TemplateTrackerMI.getCovarianceMatrix - ~TemplateTrackerMI.getMI - ~TemplateTrackerMI.getMI256 - ~TemplateTrackerMI.getNMI - ~TemplateTrackerMI.setApprocHessian - ~TemplateTrackerMI.setBspline - ~TemplateTrackerMI.setCovarianceComputation - ~TemplateTrackerMI.setHessianComputation - ~TemplateTrackerMI.setLambda - ~TemplateTrackerMI.setNc - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~TemplateTrackerMI.setp - ~TemplateTrackerMI.getNbParam - ~TemplateTrackerMI.getG - ~TemplateTrackerMI.getp - ~TemplateTrackerMI.track - ~TemplateTrackerMI.initFromZone - ~TemplateTrackerMI.getDiverge - ~TemplateTrackerMI.trackRobust - ~TemplateTrackerMI.setCostFunctionVerification - ~TemplateTrackerMI.setGaussianFilterSize - ~TemplateTrackerMI.setThresholdResidualDifference - ~TemplateTrackerMI.getRatioPixelIn - ~TemplateTrackerMI.initClick - ~TemplateTrackerMI.getNbIteration - ~TemplateTrackerMI.initFromPoints - ~TemplateTrackerMI.setSampling - ~TemplateTrackerMI.setIterationMax - ~TemplateTrackerMI.display - ~TemplateTrackerMI.setUseBrent - ~TemplateTrackerMI.setNbIterBrent - ~TemplateTrackerMI.setThresholdGradient - ~TemplateTrackerMI.getZoneRef - ~TemplateTrackerMI.setGain - ~TemplateTrackerMI.resetTracker - ~TemplateTrackerMI.getdp - ~TemplateTrackerMI.getH - ~TemplateTrackerMI.setHDes - ~TemplateTrackerMI.setBlur - ~TemplateTrackerMI.setPyramidal - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~TemplateTrackerMI.__doc__ - ~TemplateTrackerMI.__init__ - ~TemplateTrackerMI.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~TemplateTrackerMI.BSPLINE_FOURTH_ORDER - ~TemplateTrackerMI.BSPLINE_THIRD_ORDER - ~TemplateTrackerMI.HESSIAN_0 - ~TemplateTrackerMI.HESSIAN_EXACT - ~TemplateTrackerMI.HESSIAN_NEW - ~TemplateTrackerMI.HESSIAN_NONSECOND - ~TemplateTrackerMI.HESSIAN_YOUCEF - ~TemplateTrackerMI.HESSIAN_d2I - ~TemplateTrackerMI.USE_HESSIEN_BEST_COND - ~TemplateTrackerMI.USE_HESSIEN_DESIRE - ~TemplateTrackerMI.USE_HESSIEN_NORMAL - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.tt_mi.TemplateTrackerMIESM.rst b/modules/python/doc/_autosummary/visp.tt_mi.TemplateTrackerMIESM.rst deleted file mode 100644 index 86d8abd7b7..0000000000 --- a/modules/python/doc/_autosummary/visp.tt_mi.TemplateTrackerMIESM.rst +++ /dev/null @@ -1,122 +0,0 @@ -TemplateTrackerMIESM -==================== - -.. currentmodule:: visp.tt_mi - -.. autoclass:: TemplateTrackerMIESM - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~TemplateTrackerMIESM.setMinimizationMethod - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~TemplateTrackerMIESM.setCovarianceComputation - ~TemplateTrackerMIESM.setLambda - ~TemplateTrackerMIESM.setp - ~TemplateTrackerMIESM.getNbParam - ~TemplateTrackerMIESM.HESSIAN_NEW - ~TemplateTrackerMIESM.getp - ~TemplateTrackerMIESM.HESSIAN_0 - ~TemplateTrackerMIESM.USE_HESSIEN_DESIRE - ~TemplateTrackerMIESM.initFromZone - ~TemplateTrackerMIESM.getDiverge - ~TemplateTrackerMIESM.setCostFunctionVerification - ~TemplateTrackerMIESM.USE_HESSIEN_NORMAL - ~TemplateTrackerMIESM.setThresholdResidualDifference - ~TemplateTrackerMIESM.getRatioPixelIn - ~TemplateTrackerMIESM.initFromPoints - ~TemplateTrackerMIESM.setSampling - ~TemplateTrackerMIESM.display - ~TemplateTrackerMIESM.setUseBrent - ~TemplateTrackerMIESM.setHessianComputation - ~TemplateTrackerMIESM.HESSIAN_EXACT - ~TemplateTrackerMIESM.setThresholdGradient - ~TemplateTrackerMIESM.getZoneRef - ~TemplateTrackerMIESM.setGain - ~TemplateTrackerMIESM.BsplineType - ~TemplateTrackerMIESM.HessienType - ~TemplateTrackerMIESM.HESSIAN_d2I - ~TemplateTrackerMIESM.setHDes - ~TemplateTrackerMIESM.setBspline - ~TemplateTrackerMIESM.setPyramidal - ~TemplateTrackerMIESM.getMI - ~TemplateTrackerMIESM.getG - ~TemplateTrackerMIESM.BSPLINE_THIRD_ORDER - ~TemplateTrackerMIESM.track - ~TemplateTrackerMIESM.trackRobust - ~TemplateTrackerMIESM.setGaussianFilterSize - ~TemplateTrackerMIESM.initClick - ~TemplateTrackerMIESM.getNbIteration - ~TemplateTrackerMIESM.setIterationMax - ~TemplateTrackerMIESM.HessienApproximationType - ~TemplateTrackerMIESM.setNc - ~TemplateTrackerMIESM.getNMI - ~TemplateTrackerMIESM.USE_HESSIEN_BEST_COND - ~TemplateTrackerMIESM.setNbIterBrent - ~TemplateTrackerMIESM.HESSIAN_NONSECOND - ~TemplateTrackerMIESM.resetTracker - ~TemplateTrackerMIESM.HESSIAN_YOUCEF - ~TemplateTrackerMIESM.BSPLINE_FOURTH_ORDER - ~TemplateTrackerMIESM.getCovarianceMatrix - ~TemplateTrackerMIESM.getdp - ~TemplateTrackerMIESM.getH - ~TemplateTrackerMIESM.getMI256 - ~TemplateTrackerMIESM.setApprocHessian - ~TemplateTrackerMIESM.setBlur - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~TemplateTrackerMIESM.__doc__ - ~TemplateTrackerMIESM.__init__ - ~TemplateTrackerMIESM.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~TemplateTrackerMIESM.BSPLINE_FOURTH_ORDER - ~TemplateTrackerMIESM.BSPLINE_THIRD_ORDER - ~TemplateTrackerMIESM.HESSIAN_0 - ~TemplateTrackerMIESM.HESSIAN_EXACT - ~TemplateTrackerMIESM.HESSIAN_NEW - ~TemplateTrackerMIESM.HESSIAN_NONSECOND - ~TemplateTrackerMIESM.HESSIAN_YOUCEF - ~TemplateTrackerMIESM.HESSIAN_d2I - ~TemplateTrackerMIESM.USE_GRADIENT - ~TemplateTrackerMIESM.USE_HESSIEN_BEST_COND - ~TemplateTrackerMIESM.USE_HESSIEN_DESIRE - ~TemplateTrackerMIESM.USE_HESSIEN_NORMAL - ~TemplateTrackerMIESM.USE_LMA - ~TemplateTrackerMIESM.USE_NEWTON - ~TemplateTrackerMIESM.USE_QUASINEWTON - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.tt_mi.TemplateTrackerMIForwardAdditional.rst b/modules/python/doc/_autosummary/visp.tt_mi.TemplateTrackerMIForwardAdditional.rst deleted file mode 100644 index c2f7204e67..0000000000 --- a/modules/python/doc/_autosummary/visp.tt_mi.TemplateTrackerMIForwardAdditional.rst +++ /dev/null @@ -1,122 +0,0 @@ -TemplateTrackerMIForwardAdditional -================================== - -.. currentmodule:: visp.tt_mi - -.. autoclass:: TemplateTrackerMIForwardAdditional - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~TemplateTrackerMIForwardAdditional.setMinimizationMethod - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~TemplateTrackerMIForwardAdditional.setCovarianceComputation - ~TemplateTrackerMIForwardAdditional.setLambda - ~TemplateTrackerMIForwardAdditional.setp - ~TemplateTrackerMIForwardAdditional.getNbParam - ~TemplateTrackerMIForwardAdditional.HESSIAN_NEW - ~TemplateTrackerMIForwardAdditional.getp - ~TemplateTrackerMIForwardAdditional.HESSIAN_0 - ~TemplateTrackerMIForwardAdditional.USE_HESSIEN_DESIRE - ~TemplateTrackerMIForwardAdditional.initFromZone - ~TemplateTrackerMIForwardAdditional.getDiverge - ~TemplateTrackerMIForwardAdditional.setCostFunctionVerification - ~TemplateTrackerMIForwardAdditional.USE_HESSIEN_NORMAL - ~TemplateTrackerMIForwardAdditional.setThresholdResidualDifference - ~TemplateTrackerMIForwardAdditional.getRatioPixelIn - ~TemplateTrackerMIForwardAdditional.initFromPoints - ~TemplateTrackerMIForwardAdditional.setSampling - ~TemplateTrackerMIForwardAdditional.display - ~TemplateTrackerMIForwardAdditional.setUseBrent - ~TemplateTrackerMIForwardAdditional.setHessianComputation - ~TemplateTrackerMIForwardAdditional.HESSIAN_EXACT - ~TemplateTrackerMIForwardAdditional.setThresholdGradient - ~TemplateTrackerMIForwardAdditional.getZoneRef - ~TemplateTrackerMIForwardAdditional.setGain - ~TemplateTrackerMIForwardAdditional.BsplineType - ~TemplateTrackerMIForwardAdditional.HessienType - ~TemplateTrackerMIForwardAdditional.HESSIAN_d2I - ~TemplateTrackerMIForwardAdditional.setHDes - ~TemplateTrackerMIForwardAdditional.setBspline - ~TemplateTrackerMIForwardAdditional.setPyramidal - ~TemplateTrackerMIForwardAdditional.getMI - ~TemplateTrackerMIForwardAdditional.getG - ~TemplateTrackerMIForwardAdditional.BSPLINE_THIRD_ORDER - ~TemplateTrackerMIForwardAdditional.track - ~TemplateTrackerMIForwardAdditional.trackRobust - ~TemplateTrackerMIForwardAdditional.setGaussianFilterSize - ~TemplateTrackerMIForwardAdditional.initClick - ~TemplateTrackerMIForwardAdditional.getNbIteration - ~TemplateTrackerMIForwardAdditional.setIterationMax - ~TemplateTrackerMIForwardAdditional.HessienApproximationType - ~TemplateTrackerMIForwardAdditional.setNc - ~TemplateTrackerMIForwardAdditional.getNMI - ~TemplateTrackerMIForwardAdditional.USE_HESSIEN_BEST_COND - ~TemplateTrackerMIForwardAdditional.setNbIterBrent - ~TemplateTrackerMIForwardAdditional.HESSIAN_NONSECOND - ~TemplateTrackerMIForwardAdditional.resetTracker - ~TemplateTrackerMIForwardAdditional.HESSIAN_YOUCEF - ~TemplateTrackerMIForwardAdditional.BSPLINE_FOURTH_ORDER - ~TemplateTrackerMIForwardAdditional.getCovarianceMatrix - ~TemplateTrackerMIForwardAdditional.getdp - ~TemplateTrackerMIForwardAdditional.getH - ~TemplateTrackerMIForwardAdditional.getMI256 - ~TemplateTrackerMIForwardAdditional.setApprocHessian - ~TemplateTrackerMIForwardAdditional.setBlur - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~TemplateTrackerMIForwardAdditional.__doc__ - ~TemplateTrackerMIForwardAdditional.__init__ - ~TemplateTrackerMIForwardAdditional.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~TemplateTrackerMIForwardAdditional.BSPLINE_FOURTH_ORDER - ~TemplateTrackerMIForwardAdditional.BSPLINE_THIRD_ORDER - ~TemplateTrackerMIForwardAdditional.HESSIAN_0 - ~TemplateTrackerMIForwardAdditional.HESSIAN_EXACT - ~TemplateTrackerMIForwardAdditional.HESSIAN_NEW - ~TemplateTrackerMIForwardAdditional.HESSIAN_NONSECOND - ~TemplateTrackerMIForwardAdditional.HESSIAN_YOUCEF - ~TemplateTrackerMIForwardAdditional.HESSIAN_d2I - ~TemplateTrackerMIForwardAdditional.USE_GRADIENT - ~TemplateTrackerMIForwardAdditional.USE_HESSIEN_BEST_COND - ~TemplateTrackerMIForwardAdditional.USE_HESSIEN_DESIRE - ~TemplateTrackerMIForwardAdditional.USE_HESSIEN_NORMAL - ~TemplateTrackerMIForwardAdditional.USE_LMA - ~TemplateTrackerMIForwardAdditional.USE_NEWTON - ~TemplateTrackerMIForwardAdditional.USE_QUASINEWTON - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.tt_mi.TemplateTrackerMIForwardCompositional.rst b/modules/python/doc/_autosummary/visp.tt_mi.TemplateTrackerMIForwardCompositional.rst deleted file mode 100644 index 3d3f538c08..0000000000 --- a/modules/python/doc/_autosummary/visp.tt_mi.TemplateTrackerMIForwardCompositional.rst +++ /dev/null @@ -1,117 +0,0 @@ -TemplateTrackerMIForwardCompositional -===================================== - -.. currentmodule:: visp.tt_mi - -.. autoclass:: TemplateTrackerMIForwardCompositional - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~TemplateTrackerMIForwardCompositional.setCovarianceComputation - ~TemplateTrackerMIForwardCompositional.setLambda - ~TemplateTrackerMIForwardCompositional.setp - ~TemplateTrackerMIForwardCompositional.getNbParam - ~TemplateTrackerMIForwardCompositional.HESSIAN_NEW - ~TemplateTrackerMIForwardCompositional.getp - ~TemplateTrackerMIForwardCompositional.HESSIAN_0 - ~TemplateTrackerMIForwardCompositional.USE_HESSIEN_DESIRE - ~TemplateTrackerMIForwardCompositional.initFromZone - ~TemplateTrackerMIForwardCompositional.getDiverge - ~TemplateTrackerMIForwardCompositional.setCostFunctionVerification - ~TemplateTrackerMIForwardCompositional.USE_HESSIEN_NORMAL - ~TemplateTrackerMIForwardCompositional.setThresholdResidualDifference - ~TemplateTrackerMIForwardCompositional.getRatioPixelIn - ~TemplateTrackerMIForwardCompositional.initFromPoints - ~TemplateTrackerMIForwardCompositional.setSampling - ~TemplateTrackerMIForwardCompositional.display - ~TemplateTrackerMIForwardCompositional.setUseBrent - ~TemplateTrackerMIForwardCompositional.setHessianComputation - ~TemplateTrackerMIForwardCompositional.HESSIAN_EXACT - ~TemplateTrackerMIForwardCompositional.setThresholdGradient - ~TemplateTrackerMIForwardCompositional.getZoneRef - ~TemplateTrackerMIForwardCompositional.setGain - ~TemplateTrackerMIForwardCompositional.BsplineType - ~TemplateTrackerMIForwardCompositional.HessienType - ~TemplateTrackerMIForwardCompositional.HESSIAN_d2I - ~TemplateTrackerMIForwardCompositional.setHDes - ~TemplateTrackerMIForwardCompositional.setBspline - ~TemplateTrackerMIForwardCompositional.setPyramidal - ~TemplateTrackerMIForwardCompositional.getMI - ~TemplateTrackerMIForwardCompositional.getG - ~TemplateTrackerMIForwardCompositional.BSPLINE_THIRD_ORDER - ~TemplateTrackerMIForwardCompositional.track - ~TemplateTrackerMIForwardCompositional.trackRobust - ~TemplateTrackerMIForwardCompositional.setGaussianFilterSize - ~TemplateTrackerMIForwardCompositional.initClick - ~TemplateTrackerMIForwardCompositional.getNbIteration - ~TemplateTrackerMIForwardCompositional.setIterationMax - ~TemplateTrackerMIForwardCompositional.HessienApproximationType - ~TemplateTrackerMIForwardCompositional.setNc - ~TemplateTrackerMIForwardCompositional.getNMI - ~TemplateTrackerMIForwardCompositional.USE_HESSIEN_BEST_COND - ~TemplateTrackerMIForwardCompositional.setNbIterBrent - ~TemplateTrackerMIForwardCompositional.HESSIAN_NONSECOND - ~TemplateTrackerMIForwardCompositional.resetTracker - ~TemplateTrackerMIForwardCompositional.HESSIAN_YOUCEF - ~TemplateTrackerMIForwardCompositional.BSPLINE_FOURTH_ORDER - ~TemplateTrackerMIForwardCompositional.getCovarianceMatrix - ~TemplateTrackerMIForwardCompositional.getdp - ~TemplateTrackerMIForwardCompositional.getH - ~TemplateTrackerMIForwardCompositional.getMI256 - ~TemplateTrackerMIForwardCompositional.setApprocHessian - ~TemplateTrackerMIForwardCompositional.setBlur - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~TemplateTrackerMIForwardCompositional.__doc__ - ~TemplateTrackerMIForwardCompositional.__init__ - ~TemplateTrackerMIForwardCompositional.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~TemplateTrackerMIForwardCompositional.BSPLINE_FOURTH_ORDER - ~TemplateTrackerMIForwardCompositional.BSPLINE_THIRD_ORDER - ~TemplateTrackerMIForwardCompositional.HESSIAN_0 - ~TemplateTrackerMIForwardCompositional.HESSIAN_EXACT - ~TemplateTrackerMIForwardCompositional.HESSIAN_NEW - ~TemplateTrackerMIForwardCompositional.HESSIAN_NONSECOND - ~TemplateTrackerMIForwardCompositional.HESSIAN_YOUCEF - ~TemplateTrackerMIForwardCompositional.HESSIAN_d2I - ~TemplateTrackerMIForwardCompositional.USE_HESSIEN_BEST_COND - ~TemplateTrackerMIForwardCompositional.USE_HESSIEN_DESIRE - ~TemplateTrackerMIForwardCompositional.USE_HESSIEN_NORMAL - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.tt_mi.TemplateTrackerMIInverseCompositional.rst b/modules/python/doc/_autosummary/visp.tt_mi.TemplateTrackerMIInverseCompositional.rst deleted file mode 100644 index 286c9322da..0000000000 --- a/modules/python/doc/_autosummary/visp.tt_mi.TemplateTrackerMIInverseCompositional.rst +++ /dev/null @@ -1,124 +0,0 @@ -TemplateTrackerMIInverseCompositional -===================================== - -.. currentmodule:: visp.tt_mi - -.. autoclass:: TemplateTrackerMIInverseCompositional - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~TemplateTrackerMIInverseCompositional.initTemplateRefBspline - ~TemplateTrackerMIInverseCompositional.setMinimizationMethod - ~TemplateTrackerMIInverseCompositional.setUseTemplateSelect - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~TemplateTrackerMIInverseCompositional.setCovarianceComputation - ~TemplateTrackerMIInverseCompositional.setLambda - ~TemplateTrackerMIInverseCompositional.setp - ~TemplateTrackerMIInverseCompositional.getNbParam - ~TemplateTrackerMIInverseCompositional.HESSIAN_NEW - ~TemplateTrackerMIInverseCompositional.getp - ~TemplateTrackerMIInverseCompositional.HESSIAN_0 - ~TemplateTrackerMIInverseCompositional.USE_HESSIEN_DESIRE - ~TemplateTrackerMIInverseCompositional.initFromZone - ~TemplateTrackerMIInverseCompositional.getDiverge - ~TemplateTrackerMIInverseCompositional.setCostFunctionVerification - ~TemplateTrackerMIInverseCompositional.USE_HESSIEN_NORMAL - ~TemplateTrackerMIInverseCompositional.setThresholdResidualDifference - ~TemplateTrackerMIInverseCompositional.getRatioPixelIn - ~TemplateTrackerMIInverseCompositional.initFromPoints - ~TemplateTrackerMIInverseCompositional.setSampling - ~TemplateTrackerMIInverseCompositional.display - ~TemplateTrackerMIInverseCompositional.setUseBrent - ~TemplateTrackerMIInverseCompositional.setHessianComputation - ~TemplateTrackerMIInverseCompositional.HESSIAN_EXACT - ~TemplateTrackerMIInverseCompositional.setThresholdGradient - ~TemplateTrackerMIInverseCompositional.getZoneRef - ~TemplateTrackerMIInverseCompositional.setGain - ~TemplateTrackerMIInverseCompositional.BsplineType - ~TemplateTrackerMIInverseCompositional.HessienType - ~TemplateTrackerMIInverseCompositional.HESSIAN_d2I - ~TemplateTrackerMIInverseCompositional.setHDes - ~TemplateTrackerMIInverseCompositional.setBspline - ~TemplateTrackerMIInverseCompositional.setPyramidal - ~TemplateTrackerMIInverseCompositional.getMI - ~TemplateTrackerMIInverseCompositional.getG - ~TemplateTrackerMIInverseCompositional.BSPLINE_THIRD_ORDER - ~TemplateTrackerMIInverseCompositional.track - ~TemplateTrackerMIInverseCompositional.trackRobust - ~TemplateTrackerMIInverseCompositional.setGaussianFilterSize - ~TemplateTrackerMIInverseCompositional.initClick - ~TemplateTrackerMIInverseCompositional.getNbIteration - ~TemplateTrackerMIInverseCompositional.setIterationMax - ~TemplateTrackerMIInverseCompositional.HessienApproximationType - ~TemplateTrackerMIInverseCompositional.setNc - ~TemplateTrackerMIInverseCompositional.getNMI - ~TemplateTrackerMIInverseCompositional.USE_HESSIEN_BEST_COND - ~TemplateTrackerMIInverseCompositional.setNbIterBrent - ~TemplateTrackerMIInverseCompositional.HESSIAN_NONSECOND - ~TemplateTrackerMIInverseCompositional.resetTracker - ~TemplateTrackerMIInverseCompositional.HESSIAN_YOUCEF - ~TemplateTrackerMIInverseCompositional.BSPLINE_FOURTH_ORDER - ~TemplateTrackerMIInverseCompositional.getCovarianceMatrix - ~TemplateTrackerMIInverseCompositional.getdp - ~TemplateTrackerMIInverseCompositional.getH - ~TemplateTrackerMIInverseCompositional.getMI256 - ~TemplateTrackerMIInverseCompositional.setApprocHessian - ~TemplateTrackerMIInverseCompositional.setBlur - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~TemplateTrackerMIInverseCompositional.__doc__ - ~TemplateTrackerMIInverseCompositional.__init__ - ~TemplateTrackerMIInverseCompositional.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~TemplateTrackerMIInverseCompositional.BSPLINE_FOURTH_ORDER - ~TemplateTrackerMIInverseCompositional.BSPLINE_THIRD_ORDER - ~TemplateTrackerMIInverseCompositional.HESSIAN_0 - ~TemplateTrackerMIInverseCompositional.HESSIAN_EXACT - ~TemplateTrackerMIInverseCompositional.HESSIAN_NEW - ~TemplateTrackerMIInverseCompositional.HESSIAN_NONSECOND - ~TemplateTrackerMIInverseCompositional.HESSIAN_YOUCEF - ~TemplateTrackerMIInverseCompositional.HESSIAN_d2I - ~TemplateTrackerMIInverseCompositional.USE_GRADIENT - ~TemplateTrackerMIInverseCompositional.USE_HESSIEN_BEST_COND - ~TemplateTrackerMIInverseCompositional.USE_HESSIEN_DESIRE - ~TemplateTrackerMIInverseCompositional.USE_HESSIEN_NORMAL - ~TemplateTrackerMIInverseCompositional.USE_LMA - ~TemplateTrackerMIInverseCompositional.USE_NEWTON - ~TemplateTrackerMIInverseCompositional.USE_QUASINEWTON - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.tt_mi.rst b/modules/python/doc/_autosummary/visp.tt_mi.rst deleted file mode 100644 index c6336a4393..0000000000 --- a/modules/python/doc/_autosummary/visp.tt_mi.rst +++ /dev/null @@ -1,36 +0,0 @@ -tt\_mi -====== - -.. automodule:: visp.tt_mi - - - - - - - - - - - - .. rubric:: Classes - - .. autosummary:: - :toctree: - :template: custom-class-template.rst - :nosignatures: - - TemplateTrackerMI - TemplateTrackerMIESM - TemplateTrackerMIForwardAdditional - TemplateTrackerMIForwardCompositional - TemplateTrackerMIInverseCompositional - - - - - - - - - diff --git a/modules/python/doc/_autosummary/visp.vision.BasicKeyPoint.rst b/modules/python/doc/_autosummary/visp.vision.BasicKeyPoint.rst deleted file mode 100644 index 02f5c5b56c..0000000000 --- a/modules/python/doc/_autosummary/visp.vision.BasicKeyPoint.rst +++ /dev/null @@ -1,57 +0,0 @@ -BasicKeyPoint -============= - -.. currentmodule:: visp.vision - -.. autoclass:: BasicKeyPoint - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~BasicKeyPoint.getCurrentImagePointsList - ~BasicKeyPoint.getIndexInAllReferencePointList - ~BasicKeyPoint.getMatchedPointNumber - ~BasicKeyPoint.getMatchedPoints - ~BasicKeyPoint.getMatchedReferencePoints - ~BasicKeyPoint.getReferenceImagePointsList - ~BasicKeyPoint.getReferencePoint - ~BasicKeyPoint.getReferencePointNumber - ~BasicKeyPoint.referenceBuilt - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~BasicKeyPoint.__doc__ - ~BasicKeyPoint.__init__ - ~BasicKeyPoint.__module__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.vision.Calibration.rst b/modules/python/doc/_autosummary/visp.vision.Calibration.rst deleted file mode 100644 index 903b3201ae..0000000000 --- a/modules/python/doc/_autosummary/visp.vision.Calibration.rst +++ /dev/null @@ -1,84 +0,0 @@ -Calibration -=========== - -.. currentmodule:: visp.vision - -.. autoclass:: Calibration - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~Calibration.addPoint - ~Calibration.clearPoint - ~Calibration.computeCalibration - ~Calibration.computeCalibrationMulti - ~Calibration.computeStdDeviation - ~Calibration.computeStdDeviation_dist - ~Calibration.displayData - ~Calibration.displayGrid - ~Calibration.getLambda - ~Calibration.getResidual - ~Calibration.getResidual_dist - ~Calibration.get_npt - ~Calibration.init - ~Calibration.readData - ~Calibration.readGrid - ~Calibration.setAspectRatio - ~Calibration.setLambda - ~Calibration.writeData - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~Calibration.__doc__ - ~Calibration.__init__ - ~Calibration.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~Calibration.CALIB_LAGRANGE - ~Calibration.CALIB_LAGRANGE_VIRTUAL_VS - ~Calibration.CALIB_LAGRANGE_VIRTUAL_VS_DIST - ~Calibration.CALIB_VIRTUAL_VS - ~Calibration.CALIB_VIRTUAL_VS_DIST - ~Calibration.aspect_ratio - ~Calibration.cMo - ~Calibration.cMo_dist - ~Calibration.cam - ~Calibration.cam_dist - ~Calibration.eMc - ~Calibration.eMc_dist - ~Calibration.rMe - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.vision.HandEyeCalibration.rst b/modules/python/doc/_autosummary/visp.vision.HandEyeCalibration.rst deleted file mode 100644 index 65d4d37423..0000000000 --- a/modules/python/doc/_autosummary/visp.vision.HandEyeCalibration.rst +++ /dev/null @@ -1,49 +0,0 @@ -HandEyeCalibration -================== - -.. currentmodule:: visp.vision - -.. autoclass:: HandEyeCalibration - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~HandEyeCalibration.calibrate - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~HandEyeCalibration.__doc__ - ~HandEyeCalibration.__init__ - ~HandEyeCalibration.__module__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.vision.Homography.rst b/modules/python/doc/_autosummary/visp.vision.Homography.rst deleted file mode 100644 index bbab7e4b8d..0000000000 --- a/modules/python/doc/_autosummary/visp.vision.Homography.rst +++ /dev/null @@ -1,81 +0,0 @@ -Homography -========== - -.. currentmodule:: visp.vision - -.. autoclass:: Homography - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~Homography.DLT - ~Homography.HLM - ~Homography.buildFrom - ~Homography.collineation2homography - ~Homography.computeDisplacement - ~Homography.convert - ~Homography.det - ~Homography.eye - ~Homography.homography2collineation - ~Homography.inverse - ~Homography.load - ~Homography.project - ~Homography.projection - ~Homography.ransac - ~Homography.resize - ~Homography.robust - ~Homography.save - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~Homography.insertStatic - ~Homography.getMaxValue - ~Homography.t - ~Homography.size - ~Homography.hadamard - ~Homography.insert - ~Homography.getCols - ~Homography.getMinValue - ~Homography.numpy - ~Homography.reshape - ~Homography.conv2 - ~Homography.saveYAML - ~Homography.getRows - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~Homography.__doc__ - ~Homography.__init__ - ~Homography.__itruediv__ - ~Homography.__module__ - ~Homography.__mul__ - ~Homography.__truediv__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.vision.KeyPoint.rst b/modules/python/doc/_autosummary/visp.vision.KeyPoint.rst deleted file mode 100644 index fff19bc2c2..0000000000 --- a/modules/python/doc/_autosummary/visp.vision.KeyPoint.rst +++ /dev/null @@ -1,161 +0,0 @@ -KeyPoint -======== - -.. currentmodule:: visp.vision - -.. autoclass:: KeyPoint - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~KeyPoint.buildReference - ~KeyPoint.compute3D - ~KeyPoint.createImageMatching - ~KeyPoint.detect - ~KeyPoint.display - ~KeyPoint.displayMatching - ~KeyPoint.getCovarianceMatrix - ~KeyPoint.getDetectionTime - ~KeyPoint.getDetector - ~KeyPoint.getDetectorNames - ~KeyPoint.getExtractionTime - ~KeyPoint.getExtractor - ~KeyPoint.getExtractorNames - ~KeyPoint.getImageFormat - ~KeyPoint.getMatchQueryToTrainKeyPoints - ~KeyPoint.getMatcher - ~KeyPoint.getMatches - ~KeyPoint.getMatchingTime - ~KeyPoint.getNbImages - ~KeyPoint.getObjectPoints - ~KeyPoint.getPoseTime - ~KeyPoint.getQueryDescriptors - ~KeyPoint.getQueryKeyPoints - ~KeyPoint.getRansacInliers - ~KeyPoint.getRansacOutliers - ~KeyPoint.getTrainDescriptors - ~KeyPoint.getTrainKeyPoints - ~KeyPoint.getTrainPoints - ~KeyPoint.initMatcher - ~KeyPoint.insertImageMatching - ~KeyPoint.loadConfigFile - ~KeyPoint.loadLearningData - ~KeyPoint.match - ~KeyPoint.matchPoint - ~KeyPoint.reset - ~KeyPoint.saveLearningData - ~KeyPoint.setCovarianceComputation - ~KeyPoint.setDetectionMethod - ~KeyPoint.setDetector - ~KeyPoint.setDetectors - ~KeyPoint.setExtractor - ~KeyPoint.setExtractors - ~KeyPoint.setFilterMatchingType - ~KeyPoint.setImageFormat - ~KeyPoint.setMatcher - ~KeyPoint.setMatchingFactorThreshold - ~KeyPoint.setMatchingRatioThreshold - ~KeyPoint.setMaxFeatures - ~KeyPoint.setRansacConsensusPercentage - ~KeyPoint.setRansacFilterFlag - ~KeyPoint.setRansacIteration - ~KeyPoint.setRansacMinInlierCount - ~KeyPoint.setRansacParallel - ~KeyPoint.setRansacParallelNbThreads - ~KeyPoint.setRansacReprojectionError - ~KeyPoint.setRansacThreshold - ~KeyPoint.setUseAffineDetection - ~KeyPoint.setUseMatchTrainToQuery - ~KeyPoint.setUseRansacConsensusPercentage - ~KeyPoint.setUseRansacVVS - ~KeyPoint.setUseSingleMatchFilter - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~KeyPoint.referenceBuilt - ~KeyPoint.getMatchedPointNumber - ~KeyPoint.getIndexInAllReferencePointList - ~KeyPoint.getMatchedReferencePoints - ~KeyPoint.getReferenceImagePointsList - ~KeyPoint.getReferencePoint - ~KeyPoint.getMatchedPoints - ~KeyPoint.getCurrentImagePointsList - ~KeyPoint.getReferencePointNumber - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~KeyPoint.__doc__ - ~KeyPoint.__init__ - ~KeyPoint.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~KeyPoint.DESCRIPTOR_AKAZE - ~KeyPoint.DESCRIPTOR_BRIEF - ~KeyPoint.DESCRIPTOR_BRISK - ~KeyPoint.DESCRIPTOR_BoostDesc - ~KeyPoint.DESCRIPTOR_DAISY - ~KeyPoint.DESCRIPTOR_FREAK - ~KeyPoint.DESCRIPTOR_KAZE - ~KeyPoint.DESCRIPTOR_LATCH - ~KeyPoint.DESCRIPTOR_ORB - ~KeyPoint.DESCRIPTOR_SIFT - ~KeyPoint.DESCRIPTOR_SURF - ~KeyPoint.DESCRIPTOR_TYPE_SIZE - ~KeyPoint.DESCRIPTOR_VGG - ~KeyPoint.DETECTOR_AGAST - ~KeyPoint.DETECTOR_AKAZE - ~KeyPoint.DETECTOR_BRISK - ~KeyPoint.DETECTOR_FAST - ~KeyPoint.DETECTOR_GFTT - ~KeyPoint.DETECTOR_KAZE - ~KeyPoint.DETECTOR_MSD - ~KeyPoint.DETECTOR_MSER - ~KeyPoint.DETECTOR_ORB - ~KeyPoint.DETECTOR_SIFT - ~KeyPoint.DETECTOR_STAR - ~KeyPoint.DETECTOR_SURF - ~KeyPoint.DETECTOR_SimpleBlob - ~KeyPoint.DETECTOR_TYPE_SIZE - ~KeyPoint.constantFactorDistanceThreshold - ~KeyPoint.detectionScore - ~KeyPoint.detectionThreshold - ~KeyPoint.jpgImageFormat - ~KeyPoint.noFilterMatching - ~KeyPoint.pgmImageFormat - ~KeyPoint.pngImageFormat - ~KeyPoint.ppmImageFormat - ~KeyPoint.ratioDistanceThreshold - ~KeyPoint.stdAndRatioDistanceThreshold - ~KeyPoint.stdDistanceThreshold - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.vision.PlaneEstimation.rst b/modules/python/doc/_autosummary/visp.vision.PlaneEstimation.rst deleted file mode 100644 index c14013620a..0000000000 --- a/modules/python/doc/_autosummary/visp.vision.PlaneEstimation.rst +++ /dev/null @@ -1,49 +0,0 @@ -PlaneEstimation -=============== - -.. currentmodule:: visp.vision - -.. autoclass:: PlaneEstimation - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~PlaneEstimation.estimatePlane - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~PlaneEstimation.__doc__ - ~PlaneEstimation.__init__ - ~PlaneEstimation.__module__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.vision.Pose.rst b/modules/python/doc/_autosummary/visp.vision.Pose.rst deleted file mode 100644 index c9fae834ca..0000000000 --- a/modules/python/doc/_autosummary/visp.vision.Pose.rst +++ /dev/null @@ -1,105 +0,0 @@ -Pose -==== - -.. currentmodule:: visp.vision - -.. autoclass:: Pose - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~Pose.addPoint - ~Pose.addPoints - ~Pose.clearPoint - ~Pose.computePoseDementhonLagrangeVVS - ~Pose.computeRansacIterations - ~Pose.computeResidual - ~Pose.display - ~Pose.displayModel - ~Pose.getCovarianceMatrix - ~Pose.getNbParallelRansacThreads - ~Pose.getPoints - ~Pose.getRansacInlierIndex - ~Pose.getRansacInliers - ~Pose.getRansacNbInliers - ~Pose.getUseParallelRansac - ~Pose.poseDementhonNonPlan - ~Pose.poseDementhonPlan - ~Pose.poseFromRectangle - ~Pose.poseLagrangeNonPlan - ~Pose.poseLowe - ~Pose.poseVirtualVS - ~Pose.poseVirtualVSWithDepth - ~Pose.poseVirtualVSrobust - ~Pose.printPoint - ~Pose.setCovarianceComputation - ~Pose.setDementhonSvThreshold - ~Pose.setDistanceToPlaneForCoplanarityTest - ~Pose.setLambda - ~Pose.setNbParallelRansacThreads - ~Pose.setRansacFilterFlag - ~Pose.setRansacMaxTrials - ~Pose.setRansacNbInliersToReachConsensus - ~Pose.setRansacThreshold - ~Pose.setUseParallelRansac - ~Pose.setVvsEpsilon - ~Pose.setVvsIterMax - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~Pose.__doc__ - ~Pose.__init__ - ~Pose.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~Pose.CHECK_DEGENERATE_POINTS - ~Pose.DEMENTHON - ~Pose.DEMENTHON_LAGRANGE_VIRTUAL_VS - ~Pose.DEMENTHON_LOWE - ~Pose.DEMENTHON_VIRTUAL_VS - ~Pose.LAGRANGE - ~Pose.LAGRANGE_LOWE - ~Pose.LAGRANGE_VIRTUAL_VS - ~Pose.LOWE - ~Pose.NO_FILTER - ~Pose.PREFILTER_DEGENERATE_POINTS - ~Pose.RANSAC - ~Pose.VIRTUAL_VS - ~Pose.listP - ~Pose.npt - ~Pose.residual - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.vision.XmlConfigParserKeyPoint.rst b/modules/python/doc/_autosummary/visp.vision.XmlConfigParserKeyPoint.rst deleted file mode 100644 index 8535f200b5..0000000000 --- a/modules/python/doc/_autosummary/visp.vision.XmlConfigParserKeyPoint.rst +++ /dev/null @@ -1,72 +0,0 @@ -XmlConfigParserKeyPoint -======================= - -.. currentmodule:: visp.vision - -.. autoclass:: XmlConfigParserKeyPoint - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~XmlConfigParserKeyPoint.getDetectorName - ~XmlConfigParserKeyPoint.getExtractorName - ~XmlConfigParserKeyPoint.getMatcherName - ~XmlConfigParserKeyPoint.getMatchingFactorThreshold - ~XmlConfigParserKeyPoint.getMatchingMethod - ~XmlConfigParserKeyPoint.getMatchingRatioThreshold - ~XmlConfigParserKeyPoint.getNbRansacIterations - ~XmlConfigParserKeyPoint.getNbRansacMinInlierCount - ~XmlConfigParserKeyPoint.getRansacConsensusPercentage - ~XmlConfigParserKeyPoint.getRansacReprojectionError - ~XmlConfigParserKeyPoint.getRansacThreshold - ~XmlConfigParserKeyPoint.getUseRansacConsensusPercentage - ~XmlConfigParserKeyPoint.getUseRansacVVSPoseEstimation - ~XmlConfigParserKeyPoint.parse - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~XmlConfigParserKeyPoint.__doc__ - ~XmlConfigParserKeyPoint.__init__ - ~XmlConfigParserKeyPoint.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~XmlConfigParserKeyPoint.constantFactorDistanceThreshold - ~XmlConfigParserKeyPoint.noFilterMatching - ~XmlConfigParserKeyPoint.ratioDistanceThreshold - ~XmlConfigParserKeyPoint.stdAndRatioDistanceThreshold - ~XmlConfigParserKeyPoint.stdDistanceThreshold - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.vision.rst b/modules/python/doc/_autosummary/visp.vision.rst deleted file mode 100644 index 387500bbbe..0000000000 --- a/modules/python/doc/_autosummary/visp.vision.rst +++ /dev/null @@ -1,46 +0,0 @@ -vision -====== - -.. automodule:: visp.vision - - - - - - - - .. rubric:: Functions - - .. autosummary:: - :nosignatures: - - pythag - - - - - - .. rubric:: Classes - - .. autosummary:: - :toctree: - :template: custom-class-template.rst - :nosignatures: - - BasicKeyPoint - Calibration - HandEyeCalibration - Homography - KeyPoint - PlaneEstimation - Pose - XmlConfigParserKeyPoint - - - - - - - - - diff --git a/modules/python/doc/_autosummary/visp.visual_features.BasicFeature.rst b/modules/python/doc/_autosummary/visp.visual_features.BasicFeature.rst deleted file mode 100644 index bdffa0f597..0000000000 --- a/modules/python/doc/_autosummary/visp.visual_features.BasicFeature.rst +++ /dev/null @@ -1,64 +0,0 @@ -BasicFeature -============ - -.. currentmodule:: visp.visual_features - -.. autoclass:: BasicFeature - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~BasicFeature.dimension_s - ~BasicFeature.error - ~BasicFeature.getDeallocate - ~BasicFeature.getDimension - ~BasicFeature.get_s - ~BasicFeature.selectAll - ~BasicFeature.setDeallocate - ~BasicFeature.setFlags - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~BasicFeature.__doc__ - ~BasicFeature.__init__ - ~BasicFeature.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~BasicFeature.FEATURE_ALL - ~BasicFeature.user - ~BasicFeature.vpServo - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.visual_features.FeatureBuilder.rst b/modules/python/doc/_autosummary/visp.visual_features.FeatureBuilder.rst deleted file mode 100644 index c3df559c23..0000000000 --- a/modules/python/doc/_autosummary/visp.visual_features.FeatureBuilder.rst +++ /dev/null @@ -1,49 +0,0 @@ -FeatureBuilder -============== - -.. currentmodule:: visp.visual_features - -.. autoclass:: FeatureBuilder - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~FeatureBuilder.create - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~FeatureBuilder.__doc__ - ~FeatureBuilder.__init__ - ~FeatureBuilder.__module__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.visual_features.FeatureDepth.rst b/modules/python/doc/_autosummary/visp.visual_features.FeatureDepth.rst deleted file mode 100644 index 1910f185e3..0000000000 --- a/modules/python/doc/_autosummary/visp.visual_features.FeatureDepth.rst +++ /dev/null @@ -1,83 +0,0 @@ -FeatureDepth -============ - -.. currentmodule:: visp.visual_features - -.. autoclass:: FeatureDepth - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~FeatureDepth.buildFrom - ~FeatureDepth.display - ~FeatureDepth.error - ~FeatureDepth.get_LogZoverZstar - ~FeatureDepth.get_Z - ~FeatureDepth.get_x - ~FeatureDepth.get_y - ~FeatureDepth.init - ~FeatureDepth.interaction - ~FeatureDepth.print - ~FeatureDepth.set_LogZoverZstar - ~FeatureDepth.set_Z - ~FeatureDepth.set_x - ~FeatureDepth.set_xyZLogZoverZstar - ~FeatureDepth.set_y - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~FeatureDepth.user - ~FeatureDepth.dimension_s - ~FeatureDepth.get_s - ~FeatureDepth.BasicFeatureDeallocatorType - ~FeatureDepth.BasicFeatureSelect - ~FeatureDepth.getDeallocate - ~FeatureDepth.selectAll - ~FeatureDepth.setFlags - ~FeatureDepth.FEATURE_ALL - ~FeatureDepth.setDeallocate - ~FeatureDepth.vpServo - ~FeatureDepth.getDimension - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~FeatureDepth.__doc__ - ~FeatureDepth.__init__ - ~FeatureDepth.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~FeatureDepth.FEATURE_ALL - ~FeatureDepth.user - ~FeatureDepth.vpServo - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.visual_features.FeatureEllipse.rst b/modules/python/doc/_autosummary/visp.visual_features.FeatureEllipse.rst deleted file mode 100644 index af79a2c537..0000000000 --- a/modules/python/doc/_autosummary/visp.visual_features.FeatureEllipse.rst +++ /dev/null @@ -1,89 +0,0 @@ -FeatureEllipse -============== - -.. currentmodule:: visp.visual_features - -.. autoclass:: FeatureEllipse - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~FeatureEllipse.buildFrom - ~FeatureEllipse.display - ~FeatureEllipse.error - ~FeatureEllipse.get_n02 - ~FeatureEllipse.get_n11 - ~FeatureEllipse.get_n20 - ~FeatureEllipse.get_x - ~FeatureEllipse.get_y - ~FeatureEllipse.init - ~FeatureEllipse.interaction - ~FeatureEllipse.print - ~FeatureEllipse.selectX - ~FeatureEllipse.selectY - ~FeatureEllipse.select_n02 - ~FeatureEllipse.select_n11 - ~FeatureEllipse.select_n20 - ~FeatureEllipse.setABC - ~FeatureEllipse.setMoments - ~FeatureEllipse.set_x - ~FeatureEllipse.set_xy - ~FeatureEllipse.set_y - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~FeatureEllipse.user - ~FeatureEllipse.dimension_s - ~FeatureEllipse.get_s - ~FeatureEllipse.BasicFeatureDeallocatorType - ~FeatureEllipse.BasicFeatureSelect - ~FeatureEllipse.getDeallocate - ~FeatureEllipse.selectAll - ~FeatureEllipse.setFlags - ~FeatureEllipse.FEATURE_ALL - ~FeatureEllipse.setDeallocate - ~FeatureEllipse.vpServo - ~FeatureEllipse.getDimension - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~FeatureEllipse.__doc__ - ~FeatureEllipse.__init__ - ~FeatureEllipse.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~FeatureEllipse.FEATURE_ALL - ~FeatureEllipse.user - ~FeatureEllipse.vpServo - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.visual_features.FeatureLine.rst b/modules/python/doc/_autosummary/visp.visual_features.FeatureLine.rst deleted file mode 100644 index 77c85e4f49..0000000000 --- a/modules/python/doc/_autosummary/visp.visual_features.FeatureLine.rst +++ /dev/null @@ -1,80 +0,0 @@ -FeatureLine -=========== - -.. currentmodule:: visp.visual_features - -.. autoclass:: FeatureLine - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~FeatureLine.buildFrom - ~FeatureLine.display - ~FeatureLine.error - ~FeatureLine.getRho - ~FeatureLine.getTheta - ~FeatureLine.init - ~FeatureLine.interaction - ~FeatureLine.print - ~FeatureLine.selectRho - ~FeatureLine.selectTheta - ~FeatureLine.setABCD - ~FeatureLine.setRhoTheta - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~FeatureLine.user - ~FeatureLine.dimension_s - ~FeatureLine.get_s - ~FeatureLine.BasicFeatureDeallocatorType - ~FeatureLine.BasicFeatureSelect - ~FeatureLine.getDeallocate - ~FeatureLine.selectAll - ~FeatureLine.setFlags - ~FeatureLine.FEATURE_ALL - ~FeatureLine.setDeallocate - ~FeatureLine.vpServo - ~FeatureLine.getDimension - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~FeatureLine.__doc__ - ~FeatureLine.__init__ - ~FeatureLine.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~FeatureLine.FEATURE_ALL - ~FeatureLine.user - ~FeatureLine.vpServo - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.visual_features.FeatureLuminance.rst b/modules/python/doc/_autosummary/visp.visual_features.FeatureLuminance.rst deleted file mode 100644 index 790df0aa8c..0000000000 --- a/modules/python/doc/_autosummary/visp.visual_features.FeatureLuminance.rst +++ /dev/null @@ -1,78 +0,0 @@ -FeatureLuminance -================ - -.. currentmodule:: visp.visual_features - -.. autoclass:: FeatureLuminance - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~FeatureLuminance.buildFrom - ~FeatureLuminance.display - ~FeatureLuminance.error - ~FeatureLuminance.get_Z - ~FeatureLuminance.init - ~FeatureLuminance.interaction - ~FeatureLuminance.print - ~FeatureLuminance.setCameraParameters - ~FeatureLuminance.set_Z - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~FeatureLuminance.user - ~FeatureLuminance.dimension_s - ~FeatureLuminance.get_s - ~FeatureLuminance.BasicFeatureDeallocatorType - ~FeatureLuminance.BasicFeatureSelect - ~FeatureLuminance.getDeallocate - ~FeatureLuminance.selectAll - ~FeatureLuminance.setFlags - ~FeatureLuminance.FEATURE_ALL - ~FeatureLuminance.setDeallocate - ~FeatureLuminance.vpServo - ~FeatureLuminance.getDimension - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~FeatureLuminance.__doc__ - ~FeatureLuminance.__init__ - ~FeatureLuminance.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~FeatureLuminance.FEATURE_ALL - ~FeatureLuminance.cam - ~FeatureLuminance.user - ~FeatureLuminance.vpServo - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.visual_features.FeatureMoment.rst b/modules/python/doc/_autosummary/visp.visual_features.FeatureMoment.rst deleted file mode 100644 index 6b5298845d..0000000000 --- a/modules/python/doc/_autosummary/visp.visual_features.FeatureMoment.rst +++ /dev/null @@ -1,78 +0,0 @@ -FeatureMoment -============= - -.. currentmodule:: visp.visual_features - -.. autoclass:: FeatureMoment - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~FeatureMoment.compute_interaction - ~FeatureMoment.display - ~FeatureMoment.getDimension - ~FeatureMoment.init - ~FeatureMoment.interaction - ~FeatureMoment.linkTo - ~FeatureMoment.print - ~FeatureMoment.printDependencies - ~FeatureMoment.update - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~FeatureMoment.user - ~FeatureMoment.dimension_s - ~FeatureMoment.get_s - ~FeatureMoment.BasicFeatureDeallocatorType - ~FeatureMoment.BasicFeatureSelect - ~FeatureMoment.getDeallocate - ~FeatureMoment.selectAll - ~FeatureMoment.error - ~FeatureMoment.setFlags - ~FeatureMoment.FEATURE_ALL - ~FeatureMoment.setDeallocate - ~FeatureMoment.vpServo - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~FeatureMoment.__doc__ - ~FeatureMoment.__init__ - ~FeatureMoment.__module__ - ~FeatureMoment.__repr__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~FeatureMoment.FEATURE_ALL - ~FeatureMoment.user - ~FeatureMoment.vpServo - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.visual_features.FeatureMomentAlpha.rst b/modules/python/doc/_autosummary/visp.visual_features.FeatureMomentAlpha.rst deleted file mode 100644 index eb397c03e6..0000000000 --- a/modules/python/doc/_autosummary/visp.visual_features.FeatureMomentAlpha.rst +++ /dev/null @@ -1,79 +0,0 @@ -FeatureMomentAlpha -================== - -.. currentmodule:: visp.visual_features - -.. autoclass:: FeatureMomentAlpha - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~FeatureMomentAlpha.compute_interaction - ~FeatureMomentAlpha.error - ~FeatureMomentAlpha.momentName - ~FeatureMomentAlpha.name - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~FeatureMomentAlpha.user - ~FeatureMomentAlpha.dimension_s - ~FeatureMomentAlpha.get_s - ~FeatureMomentAlpha.BasicFeatureDeallocatorType - ~FeatureMomentAlpha.BasicFeatureSelect - ~FeatureMomentAlpha.update - ~FeatureMomentAlpha.getDeallocate - ~FeatureMomentAlpha.selectAll - ~FeatureMomentAlpha.display - ~FeatureMomentAlpha.setFlags - ~FeatureMomentAlpha.linkTo - ~FeatureMomentAlpha.interaction - ~FeatureMomentAlpha.print - ~FeatureMomentAlpha.FEATURE_ALL - ~FeatureMomentAlpha.setDeallocate - ~FeatureMomentAlpha.printDependencies - ~FeatureMomentAlpha.init - ~FeatureMomentAlpha.vpServo - ~FeatureMomentAlpha.getDimension - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~FeatureMomentAlpha.__doc__ - ~FeatureMomentAlpha.__init__ - ~FeatureMomentAlpha.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~FeatureMomentAlpha.FEATURE_ALL - ~FeatureMomentAlpha.user - ~FeatureMomentAlpha.vpServo - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.visual_features.FeatureMomentArea.rst b/modules/python/doc/_autosummary/visp.visual_features.FeatureMomentArea.rst deleted file mode 100644 index 396e04f1b7..0000000000 --- a/modules/python/doc/_autosummary/visp.visual_features.FeatureMomentArea.rst +++ /dev/null @@ -1,79 +0,0 @@ -FeatureMomentArea -================= - -.. currentmodule:: visp.visual_features - -.. autoclass:: FeatureMomentArea - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~FeatureMomentArea.compute_interaction - ~FeatureMomentArea.momentName - ~FeatureMomentArea.name - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~FeatureMomentArea.user - ~FeatureMomentArea.dimension_s - ~FeatureMomentArea.get_s - ~FeatureMomentArea.BasicFeatureDeallocatorType - ~FeatureMomentArea.BasicFeatureSelect - ~FeatureMomentArea.update - ~FeatureMomentArea.getDeallocate - ~FeatureMomentArea.selectAll - ~FeatureMomentArea.display - ~FeatureMomentArea.error - ~FeatureMomentArea.setFlags - ~FeatureMomentArea.linkTo - ~FeatureMomentArea.interaction - ~FeatureMomentArea.print - ~FeatureMomentArea.FEATURE_ALL - ~FeatureMomentArea.setDeallocate - ~FeatureMomentArea.printDependencies - ~FeatureMomentArea.init - ~FeatureMomentArea.vpServo - ~FeatureMomentArea.getDimension - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~FeatureMomentArea.__doc__ - ~FeatureMomentArea.__init__ - ~FeatureMomentArea.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~FeatureMomentArea.FEATURE_ALL - ~FeatureMomentArea.user - ~FeatureMomentArea.vpServo - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.visual_features.FeatureMomentAreaNormalized.rst b/modules/python/doc/_autosummary/visp.visual_features.FeatureMomentAreaNormalized.rst deleted file mode 100644 index 059d78c5ab..0000000000 --- a/modules/python/doc/_autosummary/visp.visual_features.FeatureMomentAreaNormalized.rst +++ /dev/null @@ -1,79 +0,0 @@ -FeatureMomentAreaNormalized -=========================== - -.. currentmodule:: visp.visual_features - -.. autoclass:: FeatureMomentAreaNormalized - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~FeatureMomentAreaNormalized.compute_interaction - ~FeatureMomentAreaNormalized.momentName - ~FeatureMomentAreaNormalized.name - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~FeatureMomentAreaNormalized.user - ~FeatureMomentAreaNormalized.dimension_s - ~FeatureMomentAreaNormalized.get_s - ~FeatureMomentAreaNormalized.BasicFeatureDeallocatorType - ~FeatureMomentAreaNormalized.BasicFeatureSelect - ~FeatureMomentAreaNormalized.update - ~FeatureMomentAreaNormalized.getDeallocate - ~FeatureMomentAreaNormalized.selectAll - ~FeatureMomentAreaNormalized.display - ~FeatureMomentAreaNormalized.error - ~FeatureMomentAreaNormalized.setFlags - ~FeatureMomentAreaNormalized.linkTo - ~FeatureMomentAreaNormalized.interaction - ~FeatureMomentAreaNormalized.print - ~FeatureMomentAreaNormalized.FEATURE_ALL - ~FeatureMomentAreaNormalized.setDeallocate - ~FeatureMomentAreaNormalized.printDependencies - ~FeatureMomentAreaNormalized.init - ~FeatureMomentAreaNormalized.vpServo - ~FeatureMomentAreaNormalized.getDimension - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~FeatureMomentAreaNormalized.__doc__ - ~FeatureMomentAreaNormalized.__init__ - ~FeatureMomentAreaNormalized.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~FeatureMomentAreaNormalized.FEATURE_ALL - ~FeatureMomentAreaNormalized.user - ~FeatureMomentAreaNormalized.vpServo - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.visual_features.FeatureMomentBasic.rst b/modules/python/doc/_autosummary/visp.visual_features.FeatureMomentBasic.rst deleted file mode 100644 index 00d7b29e5d..0000000000 --- a/modules/python/doc/_autosummary/visp.visual_features.FeatureMomentBasic.rst +++ /dev/null @@ -1,79 +0,0 @@ -FeatureMomentBasic -================== - -.. currentmodule:: visp.visual_features - -.. autoclass:: FeatureMomentBasic - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~FeatureMomentBasic.compute_interaction - ~FeatureMomentBasic.interaction - ~FeatureMomentBasic.momentName - ~FeatureMomentBasic.name - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~FeatureMomentBasic.user - ~FeatureMomentBasic.dimension_s - ~FeatureMomentBasic.get_s - ~FeatureMomentBasic.BasicFeatureDeallocatorType - ~FeatureMomentBasic.BasicFeatureSelect - ~FeatureMomentBasic.update - ~FeatureMomentBasic.getDeallocate - ~FeatureMomentBasic.selectAll - ~FeatureMomentBasic.display - ~FeatureMomentBasic.error - ~FeatureMomentBasic.setFlags - ~FeatureMomentBasic.linkTo - ~FeatureMomentBasic.print - ~FeatureMomentBasic.FEATURE_ALL - ~FeatureMomentBasic.setDeallocate - ~FeatureMomentBasic.printDependencies - ~FeatureMomentBasic.init - ~FeatureMomentBasic.vpServo - ~FeatureMomentBasic.getDimension - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~FeatureMomentBasic.__doc__ - ~FeatureMomentBasic.__init__ - ~FeatureMomentBasic.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~FeatureMomentBasic.FEATURE_ALL - ~FeatureMomentBasic.user - ~FeatureMomentBasic.vpServo - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.visual_features.FeatureMomentCInvariant.rst b/modules/python/doc/_autosummary/visp.visual_features.FeatureMomentCInvariant.rst deleted file mode 100644 index dd6f1f40b5..0000000000 --- a/modules/python/doc/_autosummary/visp.visual_features.FeatureMomentCInvariant.rst +++ /dev/null @@ -1,95 +0,0 @@ -FeatureMomentCInvariant -======================= - -.. currentmodule:: visp.visual_features - -.. autoclass:: FeatureMomentCInvariant - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~FeatureMomentCInvariant.compute_interaction - ~FeatureMomentCInvariant.momentName - ~FeatureMomentCInvariant.name - ~FeatureMomentCInvariant.printLsofInvariants - ~FeatureMomentCInvariant.selectC1 - ~FeatureMomentCInvariant.selectC10 - ~FeatureMomentCInvariant.selectC2 - ~FeatureMomentCInvariant.selectC3 - ~FeatureMomentCInvariant.selectC4 - ~FeatureMomentCInvariant.selectC5 - ~FeatureMomentCInvariant.selectC6 - ~FeatureMomentCInvariant.selectC7 - ~FeatureMomentCInvariant.selectC8 - ~FeatureMomentCInvariant.selectC9 - ~FeatureMomentCInvariant.selectPx - ~FeatureMomentCInvariant.selectPy - ~FeatureMomentCInvariant.selectSx - ~FeatureMomentCInvariant.selectSy - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~FeatureMomentCInvariant.user - ~FeatureMomentCInvariant.dimension_s - ~FeatureMomentCInvariant.get_s - ~FeatureMomentCInvariant.BasicFeatureDeallocatorType - ~FeatureMomentCInvariant.BasicFeatureSelect - ~FeatureMomentCInvariant.update - ~FeatureMomentCInvariant.getDeallocate - ~FeatureMomentCInvariant.selectAll - ~FeatureMomentCInvariant.display - ~FeatureMomentCInvariant.error - ~FeatureMomentCInvariant.setFlags - ~FeatureMomentCInvariant.linkTo - ~FeatureMomentCInvariant.interaction - ~FeatureMomentCInvariant.print - ~FeatureMomentCInvariant.FEATURE_ALL - ~FeatureMomentCInvariant.setDeallocate - ~FeatureMomentCInvariant.printDependencies - ~FeatureMomentCInvariant.init - ~FeatureMomentCInvariant.vpServo - ~FeatureMomentCInvariant.getDimension - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~FeatureMomentCInvariant.__doc__ - ~FeatureMomentCInvariant.__init__ - ~FeatureMomentCInvariant.__module__ - ~FeatureMomentCInvariant.__repr__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~FeatureMomentCInvariant.FEATURE_ALL - ~FeatureMomentCInvariant.user - ~FeatureMomentCInvariant.vpServo - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.visual_features.FeatureMomentCentered.rst b/modules/python/doc/_autosummary/visp.visual_features.FeatureMomentCentered.rst deleted file mode 100644 index b8018f9b24..0000000000 --- a/modules/python/doc/_autosummary/visp.visual_features.FeatureMomentCentered.rst +++ /dev/null @@ -1,80 +0,0 @@ -FeatureMomentCentered -===================== - -.. currentmodule:: visp.visual_features - -.. autoclass:: FeatureMomentCentered - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~FeatureMomentCentered.compute_interaction - ~FeatureMomentCentered.interaction - ~FeatureMomentCentered.momentName - ~FeatureMomentCentered.name - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~FeatureMomentCentered.user - ~FeatureMomentCentered.dimension_s - ~FeatureMomentCentered.get_s - ~FeatureMomentCentered.BasicFeatureDeallocatorType - ~FeatureMomentCentered.BasicFeatureSelect - ~FeatureMomentCentered.update - ~FeatureMomentCentered.getDeallocate - ~FeatureMomentCentered.selectAll - ~FeatureMomentCentered.display - ~FeatureMomentCentered.error - ~FeatureMomentCentered.setFlags - ~FeatureMomentCentered.linkTo - ~FeatureMomentCentered.print - ~FeatureMomentCentered.FEATURE_ALL - ~FeatureMomentCentered.setDeallocate - ~FeatureMomentCentered.printDependencies - ~FeatureMomentCentered.init - ~FeatureMomentCentered.vpServo - ~FeatureMomentCentered.getDimension - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~FeatureMomentCentered.__doc__ - ~FeatureMomentCentered.__init__ - ~FeatureMomentCentered.__module__ - ~FeatureMomentCentered.__repr__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~FeatureMomentCentered.FEATURE_ALL - ~FeatureMomentCentered.user - ~FeatureMomentCentered.vpServo - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.visual_features.FeatureMomentCommon.rst b/modules/python/doc/_autosummary/visp.visual_features.FeatureMomentCommon.rst deleted file mode 100644 index b7db965cfe..0000000000 --- a/modules/python/doc/_autosummary/visp.visual_features.FeatureMomentCommon.rst +++ /dev/null @@ -1,58 +0,0 @@ -FeatureMomentCommon -=================== - -.. currentmodule:: visp.visual_features - -.. autoclass:: FeatureMomentCommon - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~FeatureMomentCommon.getFeatureAlpha - ~FeatureMomentCommon.getFeatureAn - ~FeatureMomentCommon.getFeatureArea - ~FeatureMomentCommon.getFeatureCInvariant - ~FeatureMomentCommon.getFeatureCentered - ~FeatureMomentCommon.getFeatureGravityCenter - ~FeatureMomentCommon.getFeatureGravityNormalized - ~FeatureMomentCommon.getFeatureMomentBasic - ~FeatureMomentCommon.updateAll - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~FeatureMomentCommon.get - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~FeatureMomentCommon.__doc__ - ~FeatureMomentCommon.__init__ - ~FeatureMomentCommon.__module__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.visual_features.FeatureMomentDatabase.rst b/modules/python/doc/_autosummary/visp.visual_features.FeatureMomentDatabase.rst deleted file mode 100644 index 91c12cb194..0000000000 --- a/modules/python/doc/_autosummary/visp.visual_features.FeatureMomentDatabase.rst +++ /dev/null @@ -1,50 +0,0 @@ -FeatureMomentDatabase -===================== - -.. currentmodule:: visp.visual_features - -.. autoclass:: FeatureMomentDatabase - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~FeatureMomentDatabase.get - ~FeatureMomentDatabase.updateAll - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~FeatureMomentDatabase.__doc__ - ~FeatureMomentDatabase.__init__ - ~FeatureMomentDatabase.__module__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.visual_features.FeatureMomentGravityCenter.rst b/modules/python/doc/_autosummary/visp.visual_features.FeatureMomentGravityCenter.rst deleted file mode 100644 index 25c3ce5f1e..0000000000 --- a/modules/python/doc/_autosummary/visp.visual_features.FeatureMomentGravityCenter.rst +++ /dev/null @@ -1,81 +0,0 @@ -FeatureMomentGravityCenter -========================== - -.. currentmodule:: visp.visual_features - -.. autoclass:: FeatureMomentGravityCenter - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~FeatureMomentGravityCenter.compute_interaction - ~FeatureMomentGravityCenter.momentName - ~FeatureMomentGravityCenter.name - ~FeatureMomentGravityCenter.selectXg - ~FeatureMomentGravityCenter.selectYg - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~FeatureMomentGravityCenter.user - ~FeatureMomentGravityCenter.dimension_s - ~FeatureMomentGravityCenter.get_s - ~FeatureMomentGravityCenter.BasicFeatureDeallocatorType - ~FeatureMomentGravityCenter.BasicFeatureSelect - ~FeatureMomentGravityCenter.update - ~FeatureMomentGravityCenter.getDeallocate - ~FeatureMomentGravityCenter.selectAll - ~FeatureMomentGravityCenter.display - ~FeatureMomentGravityCenter.error - ~FeatureMomentGravityCenter.setFlags - ~FeatureMomentGravityCenter.linkTo - ~FeatureMomentGravityCenter.interaction - ~FeatureMomentGravityCenter.print - ~FeatureMomentGravityCenter.FEATURE_ALL - ~FeatureMomentGravityCenter.setDeallocate - ~FeatureMomentGravityCenter.printDependencies - ~FeatureMomentGravityCenter.init - ~FeatureMomentGravityCenter.vpServo - ~FeatureMomentGravityCenter.getDimension - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~FeatureMomentGravityCenter.__doc__ - ~FeatureMomentGravityCenter.__init__ - ~FeatureMomentGravityCenter.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~FeatureMomentGravityCenter.FEATURE_ALL - ~FeatureMomentGravityCenter.user - ~FeatureMomentGravityCenter.vpServo - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.visual_features.FeatureMomentGravityCenterNormalized.rst b/modules/python/doc/_autosummary/visp.visual_features.FeatureMomentGravityCenterNormalized.rst deleted file mode 100644 index a9c3617bbd..0000000000 --- a/modules/python/doc/_autosummary/visp.visual_features.FeatureMomentGravityCenterNormalized.rst +++ /dev/null @@ -1,81 +0,0 @@ -FeatureMomentGravityCenterNormalized -==================================== - -.. currentmodule:: visp.visual_features - -.. autoclass:: FeatureMomentGravityCenterNormalized - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~FeatureMomentGravityCenterNormalized.compute_interaction - ~FeatureMomentGravityCenterNormalized.momentName - ~FeatureMomentGravityCenterNormalized.name - ~FeatureMomentGravityCenterNormalized.selectXn - ~FeatureMomentGravityCenterNormalized.selectYn - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~FeatureMomentGravityCenterNormalized.user - ~FeatureMomentGravityCenterNormalized.dimension_s - ~FeatureMomentGravityCenterNormalized.get_s - ~FeatureMomentGravityCenterNormalized.BasicFeatureDeallocatorType - ~FeatureMomentGravityCenterNormalized.BasicFeatureSelect - ~FeatureMomentGravityCenterNormalized.update - ~FeatureMomentGravityCenterNormalized.getDeallocate - ~FeatureMomentGravityCenterNormalized.selectAll - ~FeatureMomentGravityCenterNormalized.display - ~FeatureMomentGravityCenterNormalized.error - ~FeatureMomentGravityCenterNormalized.setFlags - ~FeatureMomentGravityCenterNormalized.linkTo - ~FeatureMomentGravityCenterNormalized.interaction - ~FeatureMomentGravityCenterNormalized.print - ~FeatureMomentGravityCenterNormalized.FEATURE_ALL - ~FeatureMomentGravityCenterNormalized.setDeallocate - ~FeatureMomentGravityCenterNormalized.printDependencies - ~FeatureMomentGravityCenterNormalized.init - ~FeatureMomentGravityCenterNormalized.vpServo - ~FeatureMomentGravityCenterNormalized.getDimension - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~FeatureMomentGravityCenterNormalized.__doc__ - ~FeatureMomentGravityCenterNormalized.__init__ - ~FeatureMomentGravityCenterNormalized.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~FeatureMomentGravityCenterNormalized.FEATURE_ALL - ~FeatureMomentGravityCenterNormalized.user - ~FeatureMomentGravityCenterNormalized.vpServo - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.visual_features.FeaturePoint.rst b/modules/python/doc/_autosummary/visp.visual_features.FeaturePoint.rst deleted file mode 100644 index d6f4094591..0000000000 --- a/modules/python/doc/_autosummary/visp.visual_features.FeaturePoint.rst +++ /dev/null @@ -1,85 +0,0 @@ -FeaturePoint -============ - -.. currentmodule:: visp.visual_features - -.. autoclass:: FeaturePoint - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~FeaturePoint.buildFrom - ~FeaturePoint.display - ~FeaturePoint.error - ~FeaturePoint.get_Z - ~FeaturePoint.get_x - ~FeaturePoint.get_y - ~FeaturePoint.init - ~FeaturePoint.interaction - ~FeaturePoint.print - ~FeaturePoint.selectX - ~FeaturePoint.selectY - ~FeaturePoint.set_Z - ~FeaturePoint.set_x - ~FeaturePoint.set_xyZ - ~FeaturePoint.set_y - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~FeaturePoint.user - ~FeaturePoint.dimension_s - ~FeaturePoint.get_s - ~FeaturePoint.BasicFeatureDeallocatorType - ~FeaturePoint.BasicFeatureSelect - ~FeaturePoint.getDeallocate - ~FeaturePoint.selectAll - ~FeaturePoint.setFlags - ~FeaturePoint.FEATURE_ALL - ~FeaturePoint.setDeallocate - ~FeaturePoint.vpServo - ~FeaturePoint.getDimension - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~FeaturePoint.__doc__ - ~FeaturePoint.__init__ - ~FeaturePoint.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~FeaturePoint.FEATURE_ALL - ~FeaturePoint.X - ~FeaturePoint.Y - ~FeaturePoint.user - ~FeaturePoint.vpServo - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.visual_features.FeaturePoint3D.rst b/modules/python/doc/_autosummary/visp.visual_features.FeaturePoint3D.rst deleted file mode 100644 index 135fec26e8..0000000000 --- a/modules/python/doc/_autosummary/visp.visual_features.FeaturePoint3D.rst +++ /dev/null @@ -1,84 +0,0 @@ -FeaturePoint3D -============== - -.. currentmodule:: visp.visual_features - -.. autoclass:: FeaturePoint3D - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~FeaturePoint3D.buildFrom - ~FeaturePoint3D.display - ~FeaturePoint3D.error - ~FeaturePoint3D.get_X - ~FeaturePoint3D.get_Y - ~FeaturePoint3D.get_Z - ~FeaturePoint3D.init - ~FeaturePoint3D.interaction - ~FeaturePoint3D.print - ~FeaturePoint3D.selectX - ~FeaturePoint3D.selectY - ~FeaturePoint3D.selectZ - ~FeaturePoint3D.set_X - ~FeaturePoint3D.set_XYZ - ~FeaturePoint3D.set_Y - ~FeaturePoint3D.set_Z - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~FeaturePoint3D.user - ~FeaturePoint3D.dimension_s - ~FeaturePoint3D.get_s - ~FeaturePoint3D.BasicFeatureDeallocatorType - ~FeaturePoint3D.BasicFeatureSelect - ~FeaturePoint3D.getDeallocate - ~FeaturePoint3D.selectAll - ~FeaturePoint3D.setFlags - ~FeaturePoint3D.FEATURE_ALL - ~FeaturePoint3D.setDeallocate - ~FeaturePoint3D.vpServo - ~FeaturePoint3D.getDimension - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~FeaturePoint3D.__doc__ - ~FeaturePoint3D.__init__ - ~FeaturePoint3D.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~FeaturePoint3D.FEATURE_ALL - ~FeaturePoint3D.user - ~FeaturePoint3D.vpServo - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.visual_features.FeaturePointPolar.rst b/modules/python/doc/_autosummary/visp.visual_features.FeaturePointPolar.rst deleted file mode 100644 index 731ab9404f..0000000000 --- a/modules/python/doc/_autosummary/visp.visual_features.FeaturePointPolar.rst +++ /dev/null @@ -1,83 +0,0 @@ -FeaturePointPolar -================= - -.. currentmodule:: visp.visual_features - -.. autoclass:: FeaturePointPolar - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~FeaturePointPolar.buildFrom - ~FeaturePointPolar.display - ~FeaturePointPolar.error - ~FeaturePointPolar.get_Z - ~FeaturePointPolar.get_rho - ~FeaturePointPolar.get_theta - ~FeaturePointPolar.init - ~FeaturePointPolar.interaction - ~FeaturePointPolar.print - ~FeaturePointPolar.selectRho - ~FeaturePointPolar.selectTheta - ~FeaturePointPolar.set_Z - ~FeaturePointPolar.set_rho - ~FeaturePointPolar.set_rhoThetaZ - ~FeaturePointPolar.set_theta - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~FeaturePointPolar.user - ~FeaturePointPolar.dimension_s - ~FeaturePointPolar.get_s - ~FeaturePointPolar.BasicFeatureDeallocatorType - ~FeaturePointPolar.BasicFeatureSelect - ~FeaturePointPolar.getDeallocate - ~FeaturePointPolar.selectAll - ~FeaturePointPolar.setFlags - ~FeaturePointPolar.FEATURE_ALL - ~FeaturePointPolar.setDeallocate - ~FeaturePointPolar.vpServo - ~FeaturePointPolar.getDimension - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~FeaturePointPolar.__doc__ - ~FeaturePointPolar.__init__ - ~FeaturePointPolar.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~FeaturePointPolar.FEATURE_ALL - ~FeaturePointPolar.user - ~FeaturePointPolar.vpServo - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.visual_features.FeatureSegment.rst b/modules/python/doc/_autosummary/visp.visual_features.FeatureSegment.rst deleted file mode 100644 index 2075146f6a..0000000000 --- a/modules/python/doc/_autosummary/visp.visual_features.FeatureSegment.rst +++ /dev/null @@ -1,92 +0,0 @@ -FeatureSegment -============== - -.. currentmodule:: visp.visual_features - -.. autoclass:: FeatureSegment - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~FeatureSegment.buildFrom - ~FeatureSegment.display - ~FeatureSegment.error - ~FeatureSegment.getAlpha - ~FeatureSegment.getL - ~FeatureSegment.getXc - ~FeatureSegment.getYc - ~FeatureSegment.getZ1 - ~FeatureSegment.getZ2 - ~FeatureSegment.init - ~FeatureSegment.interaction - ~FeatureSegment.isNormalized - ~FeatureSegment.print - ~FeatureSegment.selectAlpha - ~FeatureSegment.selectL - ~FeatureSegment.selectXc - ~FeatureSegment.selectYc - ~FeatureSegment.setAlpha - ~FeatureSegment.setL - ~FeatureSegment.setNormalized - ~FeatureSegment.setXc - ~FeatureSegment.setYc - ~FeatureSegment.setZ1 - ~FeatureSegment.setZ2 - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~FeatureSegment.user - ~FeatureSegment.dimension_s - ~FeatureSegment.get_s - ~FeatureSegment.BasicFeatureDeallocatorType - ~FeatureSegment.BasicFeatureSelect - ~FeatureSegment.getDeallocate - ~FeatureSegment.selectAll - ~FeatureSegment.setFlags - ~FeatureSegment.FEATURE_ALL - ~FeatureSegment.setDeallocate - ~FeatureSegment.vpServo - ~FeatureSegment.getDimension - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~FeatureSegment.__doc__ - ~FeatureSegment.__init__ - ~FeatureSegment.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~FeatureSegment.FEATURE_ALL - ~FeatureSegment.user - ~FeatureSegment.vpServo - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.visual_features.FeatureThetaU.rst b/modules/python/doc/_autosummary/visp.visual_features.FeatureThetaU.rst deleted file mode 100644 index 2ac408e901..0000000000 --- a/modules/python/doc/_autosummary/visp.visual_features.FeatureThetaU.rst +++ /dev/null @@ -1,90 +0,0 @@ -FeatureThetaU -============= - -.. currentmodule:: visp.visual_features - -.. autoclass:: FeatureThetaU - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~FeatureThetaU.buildFrom - ~FeatureThetaU.display - ~FeatureThetaU.error - ~FeatureThetaU.getFeatureThetaURotationType - ~FeatureThetaU.get_TUx - ~FeatureThetaU.get_TUy - ~FeatureThetaU.get_TUz - ~FeatureThetaU.init - ~FeatureThetaU.interaction - ~FeatureThetaU.print - ~FeatureThetaU.selectTUx - ~FeatureThetaU.selectTUy - ~FeatureThetaU.selectTUz - ~FeatureThetaU.setFeatureThetaURotationType - ~FeatureThetaU.set_TUx - ~FeatureThetaU.set_TUy - ~FeatureThetaU.set_TUz - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~FeatureThetaU.user - ~FeatureThetaU.dimension_s - ~FeatureThetaU.get_s - ~FeatureThetaU.BasicFeatureDeallocatorType - ~FeatureThetaU.BasicFeatureSelect - ~FeatureThetaU.getDeallocate - ~FeatureThetaU.selectAll - ~FeatureThetaU.setFlags - ~FeatureThetaU.FEATURE_ALL - ~FeatureThetaU.setDeallocate - ~FeatureThetaU.vpServo - ~FeatureThetaU.getDimension - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~FeatureThetaU.__doc__ - ~FeatureThetaU.__init__ - ~FeatureThetaU.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~FeatureThetaU.FEATURE_ALL - ~FeatureThetaU.TUx - ~FeatureThetaU.TUy - ~FeatureThetaU.TUz - ~FeatureThetaU.cRcd - ~FeatureThetaU.cdRc - ~FeatureThetaU.user - ~FeatureThetaU.vpServo - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.visual_features.FeatureTranslation.rst b/modules/python/doc/_autosummary/visp.visual_features.FeatureTranslation.rst deleted file mode 100644 index cc16751660..0000000000 --- a/modules/python/doc/_autosummary/visp.visual_features.FeatureTranslation.rst +++ /dev/null @@ -1,88 +0,0 @@ -FeatureTranslation -================== - -.. currentmodule:: visp.visual_features - -.. autoclass:: FeatureTranslation - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~FeatureTranslation.buildFrom - ~FeatureTranslation.display - ~FeatureTranslation.error - ~FeatureTranslation.getFeatureTranslationType - ~FeatureTranslation.get_Tx - ~FeatureTranslation.get_Ty - ~FeatureTranslation.get_Tz - ~FeatureTranslation.init - ~FeatureTranslation.interaction - ~FeatureTranslation.print - ~FeatureTranslation.selectTx - ~FeatureTranslation.selectTy - ~FeatureTranslation.selectTz - ~FeatureTranslation.setFeatureTranslationType - ~FeatureTranslation.set_Tx - ~FeatureTranslation.set_Ty - ~FeatureTranslation.set_Tz - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~FeatureTranslation.user - ~FeatureTranslation.dimension_s - ~FeatureTranslation.get_s - ~FeatureTranslation.BasicFeatureDeallocatorType - ~FeatureTranslation.BasicFeatureSelect - ~FeatureTranslation.getDeallocate - ~FeatureTranslation.selectAll - ~FeatureTranslation.setFlags - ~FeatureTranslation.FEATURE_ALL - ~FeatureTranslation.setDeallocate - ~FeatureTranslation.vpServo - ~FeatureTranslation.getDimension - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~FeatureTranslation.__doc__ - ~FeatureTranslation.__init__ - ~FeatureTranslation.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~FeatureTranslation.FEATURE_ALL - ~FeatureTranslation.cMcd - ~FeatureTranslation.cMo - ~FeatureTranslation.cdMc - ~FeatureTranslation.user - ~FeatureTranslation.vpServo - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.visual_features.FeatureVanishingPoint.rst b/modules/python/doc/_autosummary/visp.visual_features.FeatureVanishingPoint.rst deleted file mode 100644 index 14bae1c9e1..0000000000 --- a/modules/python/doc/_autosummary/visp.visual_features.FeatureVanishingPoint.rst +++ /dev/null @@ -1,90 +0,0 @@ -FeatureVanishingPoint -===================== - -.. currentmodule:: visp.visual_features - -.. autoclass:: FeatureVanishingPoint - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~FeatureVanishingPoint.buildFrom - ~FeatureVanishingPoint.display - ~FeatureVanishingPoint.error - ~FeatureVanishingPoint.getAlpha - ~FeatureVanishingPoint.getAtanOneOverRho - ~FeatureVanishingPoint.getOneOverRho - ~FeatureVanishingPoint.get_x - ~FeatureVanishingPoint.get_y - ~FeatureVanishingPoint.init - ~FeatureVanishingPoint.interaction - ~FeatureVanishingPoint.print - ~FeatureVanishingPoint.selectAlpha - ~FeatureVanishingPoint.selectAtanOneOverRho - ~FeatureVanishingPoint.selectOneOverRho - ~FeatureVanishingPoint.selectX - ~FeatureVanishingPoint.selectY - ~FeatureVanishingPoint.setAlpha - ~FeatureVanishingPoint.setAtanOneOverRho - ~FeatureVanishingPoint.setOneOverRho - ~FeatureVanishingPoint.set_x - ~FeatureVanishingPoint.set_xy - ~FeatureVanishingPoint.set_y - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~FeatureVanishingPoint.user - ~FeatureVanishingPoint.dimension_s - ~FeatureVanishingPoint.get_s - ~FeatureVanishingPoint.BasicFeatureDeallocatorType - ~FeatureVanishingPoint.BasicFeatureSelect - ~FeatureVanishingPoint.getDeallocate - ~FeatureVanishingPoint.selectAll - ~FeatureVanishingPoint.setFlags - ~FeatureVanishingPoint.FEATURE_ALL - ~FeatureVanishingPoint.setDeallocate - ~FeatureVanishingPoint.vpServo - ~FeatureVanishingPoint.getDimension - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~FeatureVanishingPoint.__doc__ - ~FeatureVanishingPoint.__init__ - ~FeatureVanishingPoint.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~FeatureVanishingPoint.FEATURE_ALL - ~FeatureVanishingPoint.user - ~FeatureVanishingPoint.vpServo - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.visual_features.GenericFeature.rst b/modules/python/doc/_autosummary/visp.visual_features.GenericFeature.rst deleted file mode 100644 index 48d554df49..0000000000 --- a/modules/python/doc/_autosummary/visp.visual_features.GenericFeature.rst +++ /dev/null @@ -1,77 +0,0 @@ -GenericFeature -============== - -.. currentmodule:: visp.visual_features - -.. autoclass:: GenericFeature - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~GenericFeature.display - ~GenericFeature.error - ~GenericFeature.getInteractionMatrix - ~GenericFeature.get_s - ~GenericFeature.init - ~GenericFeature.interaction - ~GenericFeature.print - ~GenericFeature.setError - ~GenericFeature.setInteractionMatrix - ~GenericFeature.set_s - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~GenericFeature.user - ~GenericFeature.dimension_s - ~GenericFeature.BasicFeatureDeallocatorType - ~GenericFeature.BasicFeatureSelect - ~GenericFeature.getDeallocate - ~GenericFeature.selectAll - ~GenericFeature.setFlags - ~GenericFeature.FEATURE_ALL - ~GenericFeature.setDeallocate - ~GenericFeature.vpServo - ~GenericFeature.getDimension - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~GenericFeature.__doc__ - ~GenericFeature.__init__ - ~GenericFeature.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~GenericFeature.FEATURE_ALL - ~GenericFeature.user - ~GenericFeature.vpServo - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.visual_features.MomentGenericFeature.rst b/modules/python/doc/_autosummary/visp.visual_features.MomentGenericFeature.rst deleted file mode 100644 index 3980ba7386..0000000000 --- a/modules/python/doc/_autosummary/visp.visual_features.MomentGenericFeature.rst +++ /dev/null @@ -1,79 +0,0 @@ -MomentGenericFeature -==================== - -.. currentmodule:: visp.visual_features - -.. autoclass:: MomentGenericFeature - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~MomentGenericFeature.momentName - ~MomentGenericFeature.name - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - ~MomentGenericFeature.user - ~MomentGenericFeature.dimension_s - ~MomentGenericFeature.get_s - ~MomentGenericFeature.compute_interaction - ~MomentGenericFeature.BasicFeatureDeallocatorType - ~MomentGenericFeature.BasicFeatureSelect - ~MomentGenericFeature.update - ~MomentGenericFeature.getDeallocate - ~MomentGenericFeature.selectAll - ~MomentGenericFeature.display - ~MomentGenericFeature.error - ~MomentGenericFeature.setFlags - ~MomentGenericFeature.linkTo - ~MomentGenericFeature.interaction - ~MomentGenericFeature.print - ~MomentGenericFeature.FEATURE_ALL - ~MomentGenericFeature.setDeallocate - ~MomentGenericFeature.printDependencies - ~MomentGenericFeature.init - ~MomentGenericFeature.vpServo - ~MomentGenericFeature.getDimension - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~MomentGenericFeature.__doc__ - ~MomentGenericFeature.__init__ - ~MomentGenericFeature.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~MomentGenericFeature.FEATURE_ALL - ~MomentGenericFeature.user - ~MomentGenericFeature.vpServo - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.visual_features.rst b/modules/python/doc/_autosummary/visp.visual_features.rst deleted file mode 100644 index 7b69141ffd..0000000000 --- a/modules/python/doc/_autosummary/visp.visual_features.rst +++ /dev/null @@ -1,57 +0,0 @@ -visual\_features -================ - -.. automodule:: visp.visual_features - - - - - - - - - - - - .. rubric:: Classes - - .. autosummary:: - :toctree: - :template: custom-class-template.rst - :nosignatures: - - BasicFeature - FeatureBuilder - FeatureDepth - FeatureEllipse - FeatureLine - FeatureLuminance - FeatureMoment - FeatureMomentAlpha - FeatureMomentArea - FeatureMomentAreaNormalized - FeatureMomentBasic - FeatureMomentCInvariant - FeatureMomentCentered - FeatureMomentCommon - FeatureMomentDatabase - FeatureMomentGravityCenter - FeatureMomentGravityCenterNormalized - FeaturePoint - FeaturePoint3D - FeaturePointPolar - FeatureSegment - FeatureThetaU - FeatureTranslation - FeatureVanishingPoint - GenericFeature - MomentGenericFeature - - - - - - - - - diff --git a/modules/python/doc/_autosummary/visp.vs.AdaptiveGain.rst b/modules/python/doc/_autosummary/visp.vs.AdaptiveGain.rst deleted file mode 100644 index bd0c409920..0000000000 --- a/modules/python/doc/_autosummary/visp.vs.AdaptiveGain.rst +++ /dev/null @@ -1,66 +0,0 @@ -AdaptiveGain -============ - -.. currentmodule:: visp.vs - -.. autoclass:: AdaptiveGain - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~AdaptiveGain.getLastValue - ~AdaptiveGain.initFromConstant - ~AdaptiveGain.initFromVoid - ~AdaptiveGain.initStandard - ~AdaptiveGain.limitValue - ~AdaptiveGain.limitValue_const - ~AdaptiveGain.setConstant - ~AdaptiveGain.value - ~AdaptiveGain.value_const - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~AdaptiveGain.__doc__ - ~AdaptiveGain.__init__ - ~AdaptiveGain.__module__ - ~AdaptiveGain.__repr__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~AdaptiveGain.DEFAULT_LAMBDA_INFINITY - ~AdaptiveGain.DEFAULT_LAMBDA_SLOPE - ~AdaptiveGain.DEFAULT_LAMBDA_ZERO - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.vs.Servo.rst b/modules/python/doc/_autosummary/visp.vs.Servo.rst deleted file mode 100644 index 4eb71a0268..0000000000 --- a/modules/python/doc/_autosummary/visp.vs.Servo.rst +++ /dev/null @@ -1,131 +0,0 @@ -Servo -===== - -.. currentmodule:: visp.vs - -.. autoclass:: Servo - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~Servo.addFeature - ~Servo.computeControlLaw - ~Servo.computeError - ~Servo.computeInteractionMatrix - ~Servo.getDimension - ~Servo.getError - ~Servo.getI_WpW - ~Servo.getInteractionMatrix - ~Servo.getLargeP - ~Servo.getPseudoInverseThreshold - ~Servo.getServoType - ~Servo.getTaskJacobian - ~Servo.getTaskJacobianPseudoInverse - ~Servo.getTaskRank - ~Servo.getTaskSingularValues - ~Servo.getWpW - ~Servo.get_cVe - ~Servo.get_cVf - ~Servo.get_eJe - ~Servo.get_fJe - ~Servo.get_fVe - ~Servo.kill - ~Servo.print - ~Servo.secondaryTask - ~Servo.secondaryTaskJointLimitAvoidance - ~Servo.setCameraDoF - ~Servo.setForceInteractionMatrixComputation - ~Servo.setInteractionMatrixType - ~Servo.setLambda - ~Servo.setMu - ~Servo.setPseudoInverseThreshold - ~Servo.setServo - ~Servo.set_cVe - ~Servo.set_cVf - ~Servo.set_eJe - ~Servo.set_fJe - ~Servo.set_fVe - ~Servo.testInitialization - ~Servo.testUpdated - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~Servo.__doc__ - ~Servo.__init__ - ~Servo.__module__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~Servo.ALL - ~Servo.CONTROLLER - ~Servo.CURRENT - ~Servo.DESIRED - ~Servo.ERROR_VECTOR - ~Servo.EYEINHAND_CAMERA - ~Servo.EYEINHAND_L_cVe_eJe - ~Servo.EYETOHAND_L_cVe_eJe - ~Servo.EYETOHAND_L_cVf_fJe - ~Servo.EYETOHAND_L_cVf_fVe_eJe - ~Servo.FEATURE_CURRENT - ~Servo.FEATURE_DESIRED - ~Servo.GAIN - ~Servo.INTERACTION_MATRIX - ~Servo.J1 - ~Servo.J1p - ~Servo.L - ~Servo.MEAN - ~Servo.MINIMUM - ~Servo.NONE - ~Servo.PSEUDO_INVERSE - ~Servo.TRANSPOSE - ~Servo.USER_DEFINED - ~Servo.desiredFeatureList - ~Servo.e - ~Servo.e1 - ~Servo.error - ~Servo.featureList - ~Servo.featureSelectionList - ~Servo.interactionMatrixType - ~Servo.inversionType - ~Servo.lambda - ~Servo.q_dot - ~Servo.rankJ1 - ~Servo.s - ~Servo.sStar - ~Servo.servoType - ~Servo.signInteractionMatrix - ~Servo.v - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.vs.ServoData.rst b/modules/python/doc/_autosummary/visp.vs.ServoData.rst deleted file mode 100644 index 6a0e6164d8..0000000000 --- a/modules/python/doc/_autosummary/visp.vs.ServoData.rst +++ /dev/null @@ -1,53 +0,0 @@ -ServoData -========= - -.. currentmodule:: visp.vs - -.. autoclass:: ServoData - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~ServoData.close - ~ServoData.open - ~ServoData.save - ~ServoData.setCmDeg - ~ServoData.setMeterRad - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~ServoData.__doc__ - ~ServoData.__init__ - ~ServoData.__module__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.vs.ServoDisplay.rst b/modules/python/doc/_autosummary/visp.vs.ServoDisplay.rst deleted file mode 100644 index e1caf760eb..0000000000 --- a/modules/python/doc/_autosummary/visp.vs.ServoDisplay.rst +++ /dev/null @@ -1,49 +0,0 @@ -ServoDisplay -============ - -.. currentmodule:: visp.vs - -.. autoclass:: ServoDisplay - :members: - :show-inheritance: - :member-order: groupwise - :inherited-members: pybind11_builtins.pybind11_object - :special-members: - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~ServoDisplay.display - - - - - - .. rubric:: Inherited Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Operators - - .. autosummary:: - :nosignatures: - - ~ServoDisplay.__doc__ - ~ServoDisplay.__init__ - ~ServoDisplay.__module__ - - - - - - \ No newline at end of file diff --git a/modules/python/doc/_autosummary/visp.vs.rst b/modules/python/doc/_autosummary/visp.vs.rst deleted file mode 100644 index 2e29641cf9..0000000000 --- a/modules/python/doc/_autosummary/visp.vs.rst +++ /dev/null @@ -1,35 +0,0 @@ -vs -== - -.. automodule:: visp.vs - - - - - - - - - - - - .. rubric:: Classes - - .. autosummary:: - :toctree: - :template: custom-class-template.rst - :nosignatures: - - AdaptiveGain - Servo - ServoData - ServoDisplay - - - - - - - - - diff --git a/modules/python/doc/api.rst b/modules/python/doc/api.rst deleted file mode 100644 index b6fa3e7b4d..0000000000 --- a/modules/python/doc/api.rst +++ /dev/null @@ -1,28 +0,0 @@ -API reference -============== - - -.. autosummary:: - :toctree: _autosummary - :recursive: - :template: custom-module-template.rst - - visp.core - visp.dnn_tracker - visp.gui - visp.imgproc - visp.io - visp.klt - visp.me - visp.sensor - visp.ar - visp.blob - visp.robot - visp.visual_features - visp.vs - visp.vision - visp.detection - visp.mbt - visp.tt - visp.tt_mi - From 81d826ad05e84dec9a60372de8393bc4ab25be5c Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Fri, 1 Dec 2023 16:03:43 +0100 Subject: [PATCH 148/169] Update git ignore for python documentation --- modules/python/.gitignore | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/python/.gitignore b/modules/python/.gitignore index ad78a1b413..b8307c6f89 100644 --- a/modules/python/.gitignore +++ b/modules/python/.gitignore @@ -4,7 +4,7 @@ build stubs/visp stubs/build *.eggs -docs/_build -docs/_autosummary -docs/generated -docs/api.rst +doc/_build +doc/_autosummary +doc/generated +doc/api.rst From 56e2f2c82a1379cfcab0da1af9b66fe4e0066cc3 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Fri, 1 Dec 2023 17:15:31 +0100 Subject: [PATCH 149/169] silence warnings generated by pybind overloads in doc --- modules/python/doc/CMakeLists.txt | 2 +- modules/python/doc/conf.py.in | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/modules/python/doc/CMakeLists.txt b/modules/python/doc/CMakeLists.txt index 3854633073..ec54df5cec 100644 --- a/modules/python/doc/CMakeLists.txt +++ b/modules/python/doc/CMakeLists.txt @@ -67,7 +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 sphinx-build - -q -b html + -b html -c "${BINARY_BUILD_DIR}" -d "${SPHINX_CACHE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}" diff --git a/modules/python/doc/conf.py.in b/modules/python/doc/conf.py.in index ef41fba344..07414349b4 100644 --- a/modules/python/doc/conf.py.in +++ b/modules/python/doc/conf.py.in @@ -16,6 +16,9 @@ # documentation root, use os.path.abspath to make it absolute, like shown here. import sys import os +from sphinx.util.logging import * + + sys.path.insert(0, os.path.abspath('../build')) @@ -336,3 +339,29 @@ texinfo_documents = [ # Example configuration for intersphinx: refer to the Python standard library. intersphinx_mapping = {"python": ("https://docs.python.org/", None)} + +from sphinx.util.logging import WarningLogRecordTranslator + +# Filter warning about Parameter names not matching function signature +# This is somethiing that is due to pybind overloads, so we cannot do anything about it +class FilterPybindArgWarnings(WarningLogRecordTranslator): + def filter(self, record): + if 'Parameter name' in record.msg and 'does not match any of the parameters' in record.msg: + return False + return super(FilterPybindArgWarnings, self).filter(record) + +# Filter warning about duplicate objects +class FilterNoIndexWarnings(WarningLogRecordTranslator): + def filter(self, record): + if 'use :no-index: for' in record.msg: + return False + return super(FilterNoIndexWarnings, self).filter(record) + + +def setup(app): + import logging + from sphinx.util.logging import NAMESPACE + logger = logging.getLogger(NAMESPACE) + for handler in logger.handlers: + handler.addFilter(FilterPybindArgWarnings(app)) + handler.addFilter(FilterNoIndexWarnings(app)) From bec1db776de7490f8a7391dac39e6e5ae5935259 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Fri, 1 Dec 2023 17:48:00 +0100 Subject: [PATCH 150/169] Documentation theming + scrolling --- modules/python/doc/conf.py.in | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/modules/python/doc/conf.py.in b/modules/python/doc/conf.py.in index 07414349b4..0f010247da 100644 --- a/modules/python/doc/conf.py.in +++ b/modules/python/doc/conf.py.in @@ -157,8 +157,30 @@ html_theme_options = { "repo_name": "visp", "features": [ "toc.follow", - "toc.integrate", + "toc.sticky", "navigation.instant" + ], + "palette": [ + { + "media": "(prefers-color-scheme: light)", + "scheme": "default", + "toggle": { + "icon": "material/toggle-switch-off-outline", + "name": "Switch to dark mode", + }, + "primary": "red", + "accent": "indigo" + }, + { + "media": "(prefers-color-scheme: dark)", + "scheme": "slate", + "toggle": { + "icon": "material/toggle-switch", + "name": "Switch to light mode", + }, + "primary": "red", + "accent": "indigo" + }, ] } @@ -358,6 +380,11 @@ class FilterNoIndexWarnings(WarningLogRecordTranslator): return super(FilterNoIndexWarnings, self).filter(record) +object_description_options = [ + ("py:.*", dict(include_fields_in_toc=False)), +] + + def setup(app): import logging from sphinx.util.logging import NAMESPACE From 4ff1376e3885153f0affbf23aae2424649ba1a03 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Mon, 4 Dec 2023 18:17:58 +0100 Subject: [PATCH 151/169] Fixing documentation, WIP for enums --- modules/python/doc/CMakeLists.txt | 1 + .../doc/_templates/custom-class-template.rst | 2 +- modules/python/doc/conf.py.in | 25 ++++++- .../visp_python_bindgen/doc_parser.py | 38 ++++++++-- .../visp_python_bindgen/enum_binding.py | 24 ++++-- .../generator/visp_python_bindgen/header.py | 75 ++++++++++++++----- 6 files changed, 134 insertions(+), 31 deletions(-) diff --git a/modules/python/doc/CMakeLists.txt b/modules/python/doc/CMakeLists.txt index ec54df5cec..ddb5eeafbd 100644 --- a/modules/python/doc/CMakeLists.txt +++ b/modules/python/doc/CMakeLists.txt @@ -70,6 +70,7 @@ add_custom_target(visp_python_bindings_doc -b html -c "${BINARY_BUILD_DIR}" -d "${SPHINX_CACHE_DIR}" + -j 8 "${CMAKE_CURRENT_SOURCE_DIR}" "${SPHINX_HTML_DIR}" COMMENT "Building Sphinx HTML documentation for ViSP's Python bindings" diff --git a/modules/python/doc/_templates/custom-class-template.rst b/modules/python/doc/_templates/custom-class-template.rst index 737f7c8986..96f82162f4 100644 --- a/modules/python/doc/_templates/custom-class-template.rst +++ b/modules/python/doc/_templates/custom-class-template.rst @@ -16,7 +16,7 @@ .. autosummary:: :nosignatures: {% for item in methods %} - {%- if not item.startswith('_') and item not in inherited_members %} + {%- if not item.startswith('_') and item not in inherited_members or item.startswith('__init__') %} ~{{ name }}.{{ item }} {%- endif -%} {%- endfor %} diff --git a/modules/python/doc/conf.py.in b/modules/python/doc/conf.py.in index 0f010247da..4acd6d19e5 100644 --- a/modules/python/doc/conf.py.in +++ b/modules/python/doc/conf.py.in @@ -31,7 +31,6 @@ sys.path.insert(0, os.path.abspath('../build')) extensions = [ "sphinx.ext.autodoc", "sphinx.ext.intersphinx", - "sphinx.ext.napoleon", "sphinx.ext.mathjax", "sphinx.ext.autosummary", "sphinx_immaterial", @@ -384,11 +383,31 @@ object_description_options = [ ("py:.*", dict(include_fields_in_toc=False)), ] +python_type_aliases = { + "_visp.": "visp.", +} + + +autodoc_excludes = [ +'__weakref__', '__doc__', '__module__', '__dict__', +'__dir__', '__delattr__', '__format__', '__init_subclass__', '__new__', +'__reduce__', '__reduce_ex__', '__repr__', '__setattr__', +'__sizeof__', '__str__', '__subclasshook__', '__getattribute__' +] +def autodoc_skip_member(app, what, name, obj, skip, options): + # Ref: https://stackoverflow.com/a/21449475/ + + exclude = name in autodoc_excludes + # return True if (skip or exclude) else None # Can interfere with subsequent skip functions. + return True if exclude else skip def setup(app): import logging from sphinx.util.logging import NAMESPACE logger = logging.getLogger(NAMESPACE) for handler in logger.handlers: - handler.addFilter(FilterPybindArgWarnings(app)) - handler.addFilter(FilterNoIndexWarnings(app)) + if isinstance(handler, WarningStreamHandler): + handler.addFilter(FilterPybindArgWarnings(app)) + handler.addFilter(FilterNoIndexWarnings(app)) + + app.connect('autodoc-skip-member', autodoc_skip_member) diff --git a/modules/python/generator/visp_python_bindgen/doc_parser.py b/modules/python/generator/visp_python_bindgen/doc_parser.py index eb0cc8ce15..b131d1d268 100644 --- a/modules/python/generator/visp_python_bindgen/doc_parser.py +++ b/modules/python/generator/visp_python_bindgen/doc_parser.py @@ -114,10 +114,16 @@ class MethodDocumentation(object): @dataclass class ClassDocumentation(object): documentation: str +@dataclass +class EnumDocumentation(object): + general_documentation: str + value_documentation: Dict[str, str] + @dataclass class DocElements(object): compounddefs: Dict[str, compounddefType] + enums: Dict[str, doxmlparser.memberdefType] methods: Dict[Tuple[str, MethodDocSignature], List[doxmlparser.memberdefType]] IGNORED_MIXED_CONTAINERS = [ @@ -130,6 +136,9 @@ class DocElements(object): 'date', ] +def escape_for_rst(text: str) -> str: + return text + def process_mixed_container(container: MixedContainer, level: int, level_string='') -> str: ''' :param level_string: the string being built for a single level (e.g. a line/paragraph of text) @@ -141,15 +150,15 @@ def process_mixed_container(container: MixedContainer, level: int, level_string= requires_space = not level_string.endswith(('\n', '\t', ' ')) and len(level_string) > 0 # Inline blocks if isinstance(container.value, str): - return level_string + container.value.replace('\n', '\n' + indent_str).strip() + return level_string + escape_for_rst(container.value.replace('\n', '\n' + indent_str).strip()) if container.name == 'text': - return container.value.replace('\n', '\n' + indent_str).strip() + return escape_for_rst(container.value.replace('\n', '\n' + indent_str).strip()) if container.name == 'bold': markup_start = '**' if not requires_space or len(level_string) == 0 else ' **' return level_string + markup_start + container.value.valueOf_ + '** ' if container.name == 'computeroutput': markup_start = '`' if not requires_space or len(level_string) == 0 else ' `' - return level_string + markup_start + container.value.valueOf_ + '` ' + return level_string + markup_start + escape_for_rst(container.value.valueOf_) + '` ' if container.name == 'emphasis': markup_start = '*' if not requires_space else ' *' return level_string + markup_start + container.value.valueOf_ + '* ' @@ -266,6 +275,7 @@ def __init__(self, path: Optional[Path], env_mapping: Dict[str, str]): else: self.xml_doc = doxmlparser.compound.parse(str(path), True, False) compounddefs_res = {} + enums_res = {} methods_res = {} for compounddef in self.xml_doc.get_compounddef(): compounddef: compounddefType = compounddef @@ -275,6 +285,7 @@ def __init__(self, path: Optional[Path], env_mapping: Dict[str, str]): section_defs: List[doxmlparser.sectiondefType] = compounddef.sectiondef for section_def in section_defs: member_defs: List[doxmlparser.memberdefType] = section_def.memberdef + enum_defs = [d for d in member_defs if d.kind == doxmlparser.compound.DoxMemberKind.ENUM and d.prot == 'public'] method_defs = [d for d in member_defs if d.kind == doxmlparser.compound.DoxMemberKind.FUNCTION and d.prot == 'public'] for method_def in method_defs: is_const = False if method_def.const == 'no' else True @@ -283,7 +294,6 @@ def __init__(self, path: Optional[Path], env_mapping: Dict[str, str]): param_types = [] for param in method_def.get_param(): t = ''.join(process_mixed_container(c, 0) for c in param.type_.content_) - param_types.append(t) if method_def.name == cls_name or ret_type != '': signature_str = f'{ret_type} {cls_name}::{method_def.name}({",".join(param_types)}) {{}}' @@ -302,7 +312,11 @@ def __init__(self, path: Optional[Path], env_mapping: Dict[str, str]): methods_res[key] = method_def else: methods_res[key] = method_def - self.elements = DocElements(compounddefs_res, methods_res) + + for enum_def in enum_defs: + enums_res[compounddef.get_compoundname() + '::' + enum_def.name] = enum_def + + self.elements = DocElements(compounddefs_res, enums_res, methods_res) def get_documentation_for_class(self, name: str, cpp_ref_to_python: Dict[str, str], specs: Dict[str, str]) -> Optional[ClassDocumentation]: compounddef = self.elements.compounddefs.get(name) @@ -311,6 +325,20 @@ def get_documentation_for_class(self, name: str, cpp_ref_to_python: Dict[str, st cls_str = to_cstring(self.generate_class_description_string(compounddef)) return ClassDocumentation(cls_str) + def get_documentation_for_enum(self, enum_name: str) -> Optional[EnumDocumentation]: + member_def = self.elements.enums.get(enum_name) + print(self.elements.enums) + if member_def is None: + return None + general_doc = to_cstring(self.generate_method_description_string(member_def)) + value_doc = {} + for enum_val in member_def.enumvalue: + enum_value: doxmlparser.enumvalueType = enum_val + brief = process_description(enum_value.briefdescription) + detailed = process_description(enum_value.detaileddescription) + value_doc[enum_value.name] = to_cstring(brief + '\n\n' + detailed) + return EnumDocumentation(general_doc, value_doc) + def generate_class_description_string(self, compounddef: compounddefType) -> str: brief = process_description(compounddef.get_briefdescription()) detailed = process_description(compounddef.get_detaileddescription()) diff --git a/modules/python/generator/visp_python_bindgen/enum_binding.py b/modules/python/generator/visp_python_bindgen/enum_binding.py index c5bfe4fa32..c353969dd9 100644 --- a/modules/python/generator/visp_python_bindgen/enum_binding.py +++ b/modules/python/generator/visp_python_bindgen/enum_binding.py @@ -46,7 +46,7 @@ from typing import TYPE_CHECKING if TYPE_CHECKING: - from visp_python_bindgen.header import SingleObjectBindings + from visp_python_bindgen.header import SingleObjectBindings, HeaderFile @dataclass class EnumRepr: @@ -173,7 +173,7 @@ def accumulate_data(scope: Union[NamespaceScope, ClassScope]): accumulate_data(root_scope) return final_data, temp_data -def get_enum_bindings(root_scope: NamespaceScope, mapping: Dict, submodule: Submodule) -> List[SingleObjectBindings]: +def get_enum_bindings(root_scope: NamespaceScope, mapping: Dict, submodule: Submodule, header: 'HeaderFile') -> List[SingleObjectBindings]: final_data, filtered_reprs = resolve_enums_and_typedefs(root_scope, mapping) @@ -183,6 +183,7 @@ def get_enum_bindings(root_scope: NamespaceScope, mapping: Dict, submodule: Subm result: List['SingleObjectBindings'] = [] final_reprs = [] for repr in final_data: + enum_config = submodule.get_enum_config(repr.name) if enum_config['ignore']: filtered_reprs.append(repr) @@ -191,13 +192,16 @@ def get_enum_bindings(root_scope: NamespaceScope, mapping: Dict, submodule: Subm final_reprs.append(repr) else: filtered_reprs.append(repr) - + doc_holder = header.documentation_holder for enum_repr in final_reprs: name_segments = enum_repr.name.split('::') py_name = name_segments[-1].replace('vp', '') # If an owner class is ignored, don't export this enum parent_ignored = False ignored_parent_name = None + enum_doc = None + if doc_holder is not None: + enum_doc = header.documentation_holder.get_documentation_for_enum(repr.name) for segment in name_segments[:-1]: full_segment_name = mapping.get(segment) @@ -213,11 +217,21 @@ def get_enum_bindings(root_scope: NamespaceScope, mapping: Dict, submodule: Subm owner_full_name = '::'.join(name_segments[:-1]) owner_py_ident = get_owner_py_ident(owner_full_name, root_scope) or 'submodule' py_ident = f'py{owner_py_ident}{py_name}' + py_args = ['py::arithmetic()'] + if enum_doc is not None: + if enum_doc.general_documentation is not None: + py_args = [enum_doc.general_documentation] + py_args - declaration = f'py::enum_<{enum_repr.name}> {py_ident}({owner_py_ident}, "{py_name}", py::arithmetic());' + py_args_str = ','.join(py_args) + declaration = f'py::enum_<{enum_repr.name}> {py_ident}({owner_py_ident}, "{py_name}", {py_args_str});' values = [] for enumerator in enum_repr.values: - values.append(f'{py_ident}.value("{enumerator.name}", {enum_repr.name}::{enumerator.name});') + maybe_value_doc = None + if enum_doc is not None: + maybe_value_doc = enum_doc.value_documentation.get(enumerator.name) + maybe_value_doc_str = f', {maybe_value_doc}' if maybe_value_doc else '' + + values.append(f'{py_ident}.value("{enumerator.name}", {enum_repr.name}::{enumerator.name}{maybe_value_doc_str});') values.append(f'{py_ident}.export_values();') enum_names = BoundObjectNames(py_ident, py_name, enum_repr.name, enum_repr.name) diff --git a/modules/python/generator/visp_python_bindgen/header.py b/modules/python/generator/visp_python_bindgen/header.py index 1edce4a977..90d00b10cb 100644 --- a/modules/python/generator/visp_python_bindgen/header.py +++ b/modules/python/generator/visp_python_bindgen/header.py @@ -184,7 +184,6 @@ def parse_data(self, bindings_container: BindingsContainer) -> None: ''' Update the bindings container passed in parameter with the bindings linked to this header file ''' - from visp_python_bindgen.enum_binding import get_enum_bindings # Fetch documentation if available if self.documentation_holder_path is not None: @@ -194,7 +193,7 @@ def parse_data(self, bindings_container: BindingsContainer) -> None: for cls in self.header_repr.namespace.classes: self.generate_class(bindings_container, cls, self.environment) - enum_bindings = get_enum_bindings(self.header_repr.namespace, self.environment.mapping, self.submodule) + enum_bindings = get_enum_bindings(self.header_repr.namespace, self.environment.mapping, self.submodule, self) for enum_binding in enum_bindings: bindings_container.add_bindings(enum_binding) @@ -202,6 +201,11 @@ def parse_data(self, bindings_container: BindingsContainer) -> None: self.parse_sub_namespace(bindings_container, self.header_repr.namespace) def parse_sub_namespace(self, bindings_container: BindingsContainer, ns: NamespaceScope, namespace_prefix = '', is_root=True) -> None: + ''' + Parse a subnamespace and all its subnamespaces. + In a namespace, only the functions are exported. + ''' + if not is_root and ns.name == '': # Anonymous namespace, only visible in header, so we ignore it return @@ -228,20 +232,59 @@ def parse_sub_namespace(self, bindings_container: BindingsContainer, ns: Namespa self.parse_sub_namespace(bindings_container, ns.namespaces[sub_ns], namespace_prefix + sub_ns + '::', False) def generate_class(self, bindings_container: BindingsContainer, cls: ClassScope, header_env: HeaderEnvironment) -> SingleObjectBindings: + ''' + Generate the bindings for a single class: + This method will generate one Python class per template instanciation. + If the class has no template argument, then a single python class is generated + + If it is templated, the mapping (template argument types => Python class name) must be provided in the JSON config file + ''' def generate_class_with_potiental_specialization(name_python: str, owner_specs: OrderedDict[str, str], cls_config: Dict) -> str: + ''' + Generate the bindings of a single class, handling a potential template specialization. + The handled information is: + - The inheritance of this class + - Its public fields that are not pointers + - Its constructors + - Most of its operators + - Its public methods + ''' python_ident = f'py{name_python}' name_cpp = get_typename(cls.class_decl.typename, owner_specs, header_env.mapping) class_doc = None + methods_dict: Dict[str, List[MethodBinding]] = {} - def add_to_method_dict(key, value): + def add_to_method_dict(key: str, value: MethodBinding): + ''' + Add a method binding to the dictionary containing all the methods bindings of the class. + This dict is a mapping str => List[MethodBinding] + ''' if key not in methods_dict: methods_dict[key] = [value] else: methods_dict[key].append(value) + + def add_method_doc_to_pyargs(method: types.Method, py_arg_strs: List[str]) -> List[str]: + if self.documentation_holder is not None: + method_name = get_name(method.name) + method_doc_signature = MethodDocSignature(method_name, + get_type(method.return_type, {}, header_env.mapping) or '', # Don't use specializations so that we can match with doc + [get_type(param.type, {}, header_env.mapping) for param in method.parameters], + method.const, method.static) + method_doc = self.documentation_holder.get_documentation_for_method(name_cpp_no_template, method_doc_signature, {}, owner_specs, param_names, []) + if method_doc is None: + logging.warning(f'Could not find documentation for {name_cpp}::{method_name}!') + return py_arg_strs + else: + return [method_doc.documentation] + py_arg_strs + else: + return py_arg_strs + if self.documentation_holder is not None: class_doc = self.documentation_holder.get_documentation_for_class(name_cpp_no_template, {}, owner_specs) else: logging.warning(f'Documentation not found when looking up {name_cpp_no_template}') + # Declaration # Add template specializations to cpp class name. e.g., vpArray2D becomes vpArray2D if the template T is double template_decl: Optional[types.TemplateDecl] = cls.class_decl.template @@ -302,16 +345,8 @@ def add_to_method_dict(key, value): params_strs = [get_type(param.type, owner_specs, header_env.mapping) for param in method.parameters] py_arg_strs = get_py_args(method.parameters, owner_specs, header_env.mapping) param_names = [param.name or 'arg' + str(i) for i, param in enumerate(method.parameters)] - if self.documentation_holder is not None: - method_doc_signature = MethodDocSignature(method_name, - get_type(method.return_type, {}, header_env.mapping) or '', # Don't use specializations so that we can match with doc - [get_type(param.type, {}, header_env.mapping) for param in method.parameters], - method.const, method.static) - method_doc = self.documentation_holder.get_documentation_for_method(name_cpp_no_template, method_doc_signature, {}, owner_specs, param_names, []) - if method_doc is None: - logging.warning(f'Could not find documentation for {name_cpp}::{method_name}!') - else: - py_arg_strs = [method_doc.documentation] + py_arg_strs + + py_arg_strs = add_method_doc_to_pyargs(method, py_arg_strs) ctor_str = f'''{python_ident}.{define_constructor(params_strs, py_arg_strs)};''' add_to_method_dict('__init__', MethodBinding(ctor_str, is_static=False, is_lambda=False, @@ -329,6 +364,10 @@ def add_to_method_dict(key, value): return_type_str = get_type(method.return_type, owner_specs, header_env.mapping) py_args = get_py_args(method.parameters, owner_specs, header_env.mapping) py_args = py_args + ['py::is_operator()'] + param_names = [param.name or 'arg' + str(i) for i, param in enumerate(method.parameters)] + + py_args = add_method_doc_to_pyargs(method, py_args) + if len(params_strs) > 1: logging.info(f'Found operator {name_cpp}{method_name} with more than one parameter, skipping') rejection = RejectedMethod(name_cpp, method, method_config, get_method_signature(method_name, return_type_str, params_strs), NotGeneratedReason.NotHandled) @@ -381,15 +420,17 @@ def add_to_method_dict(key, value): method_str, method_data = define_method(method, method_config, True, new_specs, self, header_env, class_def_names) add_to_method_dict(method_data.py_name, MethodBinding(method_str, is_static=method.static, - is_lambda=f'{name_cpp}::*' not in method_str, - is_operator=False, is_constructor=False, method_data=method_data)) + is_lambda=f'{name_cpp}::*' not in method_str, + is_operator=False, is_constructor=False, + method_data=method_data)) generated_methods.append(method_data) else: method_str, method_data = define_method(method, method_config, True, owner_specs, self, header_env, class_def_names) add_to_method_dict(method_data.py_name, MethodBinding(method_str, is_static=method.static, - is_lambda=f'{name_cpp}::*' not in method_str, - is_operator=False, is_constructor=False, method_data=method_data)) + is_lambda=f'{name_cpp}::*' not in method_str, + is_operator=False, is_constructor=False, + method_data=method_data)) generated_methods.append(method_data) # See https://github.com/pybind/pybind11/issues/974 From c483b27ed10cb91d4c622e696e158fdae74dcd8c Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Mon, 4 Dec 2023 23:02:04 +0100 Subject: [PATCH 152/169] documentation for enums --- .../visp_python_bindgen/doc_parser.py | 20 ++++++++++++++++--- .../visp_python_bindgen/enum_binding.py | 7 +++---- .../visp_python_bindgen/submodule.py | 2 ++ 3 files changed, 22 insertions(+), 7 deletions(-) diff --git a/modules/python/generator/visp_python_bindgen/doc_parser.py b/modules/python/generator/visp_python_bindgen/doc_parser.py index b131d1d268..d6e060dc6e 100644 --- a/modules/python/generator/visp_python_bindgen/doc_parser.py +++ b/modules/python/generator/visp_python_bindgen/doc_parser.py @@ -119,6 +119,21 @@ class EnumDocumentation(object): general_documentation: str value_documentation: Dict[str, str] + def get_overall_doc(self) -> str: + full_doc = '' + full_doc += self.general_documentation.strip('\n') + full_doc += '\n\nValues: \n\n' + for k,v in self.value_documentation.items(): + full_doc += '* ' + full_doc += '**' + k + '**' + if len(v.strip('\n').strip()) > 0: + full_doc += ': ' + v.strip('\n') + full_doc += '\n\n' + + return to_cstring(full_doc) + + def get_value_doc(self, k: str) -> Optional[str]: + return to_cstring(self.value_documentation.get(k) or '') @dataclass class DocElements(object): @@ -327,16 +342,15 @@ def get_documentation_for_class(self, name: str, cpp_ref_to_python: Dict[str, st def get_documentation_for_enum(self, enum_name: str) -> Optional[EnumDocumentation]: member_def = self.elements.enums.get(enum_name) - print(self.elements.enums) if member_def is None: return None - general_doc = to_cstring(self.generate_method_description_string(member_def)) + general_doc = self.generate_method_description_string(member_def) value_doc = {} for enum_val in member_def.enumvalue: enum_value: doxmlparser.enumvalueType = enum_val brief = process_description(enum_value.briefdescription) detailed = process_description(enum_value.detaileddescription) - value_doc[enum_value.name] = to_cstring(brief + '\n\n' + detailed) + value_doc[enum_value.name] = brief + '\n\n' + detailed return EnumDocumentation(general_doc, value_doc) def generate_class_description_string(self, compounddef: compounddefType) -> str: diff --git a/modules/python/generator/visp_python_bindgen/enum_binding.py b/modules/python/generator/visp_python_bindgen/enum_binding.py index c353969dd9..23f417ee1e 100644 --- a/modules/python/generator/visp_python_bindgen/enum_binding.py +++ b/modules/python/generator/visp_python_bindgen/enum_binding.py @@ -219,16 +219,15 @@ def get_enum_bindings(root_scope: NamespaceScope, mapping: Dict, submodule: Subm py_ident = f'py{owner_py_ident}{py_name}' py_args = ['py::arithmetic()'] if enum_doc is not None: - if enum_doc.general_documentation is not None: - py_args = [enum_doc.general_documentation] + py_args + py_args = [enum_doc.get_overall_doc()] + py_args py_args_str = ','.join(py_args) declaration = f'py::enum_<{enum_repr.name}> {py_ident}({owner_py_ident}, "{py_name}", {py_args_str});' values = [] for enumerator in enum_repr.values: maybe_value_doc = None - if enum_doc is not None: - maybe_value_doc = enum_doc.value_documentation.get(enumerator.name) + # if enum_doc is not None: + # maybe_value_doc = enum_doc.get_value_doc(enumerator.name) maybe_value_doc_str = f', {maybe_value_doc}' if maybe_value_doc else '' values.append(f'{py_ident}.value("{enumerator.name}", {enum_repr.name}::{enumerator.name}{maybe_value_doc_str});') diff --git a/modules/python/generator/visp_python_bindgen/submodule.py b/modules/python/generator/visp_python_bindgen/submodule.py index fa4feb4cb6..3e1f811aa7 100644 --- a/modules/python/generator/visp_python_bindgen/submodule.py +++ b/modules/python/generator/visp_python_bindgen/submodule.py @@ -131,6 +131,8 @@ def generate(self) -> None: namespace py = pybind11; void {self.generation_function_name()}(py::module_ &m) {{ +py::options options; +options.disable_enum_members_docstring(); /* * Submodule declaration From 0cf45b602b079fb78291858f96a130cd95f484f7 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Tue, 5 Dec 2023 17:28:34 +0100 Subject: [PATCH 153/169] Setup doc test --- modules/python/doc/_static/visp_icon.png | Bin 0 -> 10346 bytes modules/python/doc/conf.py.in | 7 +++- modules/python/doc/conversions.rst | 51 +++++++++++++++++++++++ modules/python/doc/index.rst | 42 ++----------------- 4 files changed, 61 insertions(+), 39 deletions(-) create mode 100644 modules/python/doc/_static/visp_icon.png create mode 100644 modules/python/doc/conversions.rst diff --git a/modules/python/doc/_static/visp_icon.png b/modules/python/doc/_static/visp_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..512ab9de571c468e14bda13b9c7380cde8480e10 GIT binary patch literal 10346 zcmW++1yqw?8{gRI?wYiSbcfVvDFLOsK^mlUG=GqgMjC{PG>CKyh;$>3ba&VH`i(Po z&JMiWd++o7>bd`^zfr)&qQU}!K)8ypW#0m?A;2>f0}c2sWzww+yr7vYE69SL{{7^& zB9nl3FkN2jeE@+t8UH=O-bIq0z?b8(?Oe~@4Ikr>aWG_y5l0*C8INUQnGL`9&-((^)B{id@xY}%jWxdVe=TMd z6g!O{r3QNbJeWflgZ+&kv7+L#g_IOA{J8THt>cyhOG_to14jSKoj^E%>T3l}_E^tP z1cyHK{v2sgZQ1|90R>|ztaECsuC4=_OBB#T{!0?~{M@iPc#LMd=>o3JoYY4j&ETDr zJ4z@Pp-#ZE^_q0a#|BH{4rhCpN`^Nh7~Z;e^9^Uv0fj%XYW_gjZ5;y@71dEmMP=a` z5fN`EVMOy2W|^0{qu^+cc-S*h_zShTfN+(35EeG2vJwg*y{KsB=g*(>v`YyoDKq#i zdOuEm`t*r75bEVc0rMQK$d-NoUKU>r^vcK0-{E=lGZt26km*NyVPS9Lkuy4m$*HOG z-~Ijh-I4f0Lj3$Hp!}!9w5Nk9)a_a|Oyvp8D@jn6IJT$OWjr-1yX5i>KNFK>Jq}j5 zG&pB#Y;uw$@O)e2mGAjBxuc^aF?`#|+cO27TU`8@!Ts)@DEaH3yMu9sz=J_2xzduFo zu!*JuAc}=Un&(H*MXVQp;tYtKFiqX&^26PSWrj z6$JvJ$2h#(_0B=Jz_A(0DN1^w)@EHl?<{5Y3B%SAm6V)V;tBTaH`;F{XK^|xdT2@t zPgvx#x*06mL6Dk(fgvF$XZZg9-iiKMFb|y=Ot(38wQhzYdYBg`o*Ie_!WwLNRAAkXenL``jBjh8KP3Ol7pR_|o~F8bRYQJ0STOV8bJFV~6oYDi z0po{fGGltZc(fJ0_(2#y`{M1@xf2nmrvazSU@&;O`BRs0@>1T+-Y4K%2L}gh@A#9G zlk=*o5`^O*gu!dVwsrbpk&%+*#Kg4%Vq!4XlyB{k`OVbs=Paw;;&5xS(YaS`!YH82 zF6@rVpdkuGW!o*5N#M=%mn6}dk8d^G57QBgy#)voj1UESQHhxun) z2>eIs>tmUf@uKP>(!eqa zJP}x&+57&AJPZsBxTfZ0Vnahi%joE+#Ig+BnOn)4%xvo}uZ+FJf#!o@h_rM^N-A$y zWcMmi*};&>i3vW30W)rHC>omi#qN|!;n+uUx^xw0*emxa9JKB#hpkR{=b2bYXec2$ zd7rttIROE|=+oaAaw$t{cBoUa18j70S>eyMx~$-(0wRd0BjctO?^`g`>dw@(T+g;o;%QDJgP&@wCf2 z1_s#8i>?QM^=c7m#+EFs=GSMr!6|GNG>-8#8+3}M8yn8Q)<$>SM|@82NU>09rMn_OLu(gK^sjhwzRMhPu-G;gT(<*UU4zn z3$+|3wOUsO6bqbE?Q(N7GqXZ;XsdDj{{FrhTV&2>s0Ilb)Y;jY{>p}xc0W-R47zs&Oo&5}N5jyYp zhRi=1Kuuf4PuX3FU?7&x{G|x!Fi@JBn$*?R;Th<>B`bp&J=xjWGZmTqnEU-m3a?EZ zi=$TbFU7ak2wdE}X)+K(zAzZs7_1UPmj`Uj)^N6g80#x(Jv~YQ>c6)UVIFQ1X_t~( z6%`?CYHN3X{zvT0FC=8r{JIeAw*roMhorb$CpNutL%Ps`)>pHmhu`G2Jv!;-lxnhi z@0qIQs{_TYj0CRbj~#Y+=mhlesIKx#0tX(0w5saRnuv%}M`p z?r&@K;=w@Em1$P7Tj-hw^=if}&L~o3LO|85y9oQEhyDHg*QoG0(Ly!_u;;xLKuI9i zH#gsEYm*r@xnq*W$hBeY4~tR`3|bmmGtb_71WYOPW`TbQsR{@TpM0I#g*nq)oQcK9 z#o-xJ<H8pX}_MDS|NwMqZY^!haWwpc9U^j37x` znWH5euf-nSL)Tu3TMXUrw(D>Qdk<;F!ZH6{N1&n5llsGA$hnpdwCE;hW(w=-rtGPz zkcuR7!Z18pSy>95a{ZoEcD++W7nfrY^MXf^^K6I9UugII5yGkcVH17SKbG<9lwEGr z+i>aNZ{NNJ2vHAqHFo3v{{8#cglAQK)*H{}X8^3~)>vX1)LO@KGBB8XH|r5}wB2D? z+}z;I{{WATb<@69h>RI421#y^W7Da~tE=-+LHZIC0=%HfO1e3m zJuqEqBKh|x;pP$ki&r$`Pl|(X`dGgdWd3ehm23cbt9HfRz7H2NrLQ0h%tmxSXpY zq{m!JPA=RgcyxL?VsmrzrGBy~5U9*qq$j8z6lld~Z@)=nM<24Zmtgq9Szo4RGm=9j1U*6!h@w=k> z3-#=Q=doCPax%$}zz1J4TG}J!qp+-2OcpIuwa2j4^Y;<7{_XYr%NLWQ*NH9MGksRK z(z272lcO#jLM#MSR8*$?RDEIO8f1{_>S_`DnF_1^{(g#QecH?4aM_vB_T!)WT(*zj zvl}m@c{K>9XtGWr+safJF;M2_=f_sfTNn5VcK7zYVt@3%mIXxJ@zs@rukR}ZfZBHR zc(ljkK&Bhf{4mkp(^YGW!hT;N=2ttmC7Xlh~&RWaImRh=Gfd^lPiB?umkR3 zmI$BuVv~mi8KirQ5D7yQn+1lBK^jlJq zUb2xVV&LNTwD_FqdV34^k}i5u&jvqyoSQR}gZK{_`Q$_zS1Q=pypWcWai+pBkdMK} z2tfd=CTKrh=Big&rDMp=oz}0znnHogv*#i_Iyt#cM$ix}u`oS-naD*hC5YMG-Cb=x zL?vi5oaKrg5Pr)x1fGaL zwKlaPA2vT`t{r>=1#kJhPF&|R>Rfe!muoYMi!YXwGzPK(3dQ7%+4sOx6i{0{L681q z2W~&-IXnx0zYQ1t?zP|sU-6-V^{ra(Jzp4ZXuKl8s3Be8S+z!sAAEaf=Y+z}N`pJ#_I&7U zYh?M*F8sdyfmlrMjATmR4*aMuUl2zt96V*o`_D{)?=7C;kU#=Stmdt#RaS&TqecroL{_&R3^n zW5c$xvT_lI0T6KB0l`0?HwRP_2&B~*KUBGKxz+D#-0!G0 zl4j-&w~p6-ByHep0JnOH)x?~HzoP{Gk z5xa;P+374f)LIW2@_HTKi^c7=Mn;f{()j$yackpdU_nIwVb5lr@y_A&HYh~rVHEI@tl)vaHl6i&!PF&=s9T(N&(D&+eWqP$}Q&Urbuwvol z>;*pX_Rl8Z5yIQsC7BeZ<>miDBLO8PW>8SjFB>u+A0Gqbpa+j*G5m7vm|wqM18f7> z9DV_TV4jE($tM`d_H1)Vg&>TqTzd~1(xPFhu3N6H%TCsEci6n*lOyP~Ae@JD{N0v7 zju6&IFCdVz=sE8=JTt&r?!98;p?RM|8vJ;#B@VXTg9#JcDM_Oc5fk6JK{JPb_NH#6s%N4^z!9Pc5ZHh%JxU!T+-S0peN--CbRJ`ivQ|MsOZa=eKIH*kU79@ z4vBj1W6ap{3;SPl3p&iMxc>q;7;qYEe{6ECYVHh3ZDWsQxLvSDAoFae!>m@0X+wG}y4s-s}o z;{6HGZrNt{n3$L=hexw{UuO6*1Y6ehDLtFb&-q-i`s={W~vw4xx zu+yoYk)0h!IhB1Usp?FlI4AJj8FyPy>3GH^;N2_A(JAqUDQ@Q_v0kJ0JfXc#{T~i` zv;>-;*{UD^`rbaIl+w9a;6>C>QCI-r1yONvaee4(={Z#$#c#5kJf^;B1;DEwvITvww{%Ru6Y$$PAzs^u^ot1-FfcM! zxI!7IE=@OxyL)2D`DO}qGO{zg%T9UhsswRfVxj3C(k~lTnS$r*?8$*8O-@S#WEd%+ z-MJ}nSU5OPN6wDV&bk49OE3HKzD}Ru6Cbnb;XS1BU#DuJ@!NjB_qfL`8t{(yuLG8<6 zNnFTCZ7_BhflOMbs$|H$#bFhfkBv&EpyOUwICky_0bG;TQ`X0#OOszxan#Wvt8Z0Q zKE4y%zVHPqvcd=ObA$jidDZ{;5fa61(Tjs)_1kf_Dp*TPOT*Zh20%jqVnY}e;sE-3 z2XHjNkl{tjX-l=Hogr#QTOn)0K*s_m*m>QjEt<#ryMFl<2`Oo-`}Qb3AaD=}&_dwd zL8f>)$?xHY_Y=h;CeH8c*U(3VMv)?D(CusEIMJUHZDUPXGhD~94Ixa5bOnL82o3(f z3R;o{UIt63!U)%#N}Zn+GWz;d(b3Tz6fyupUGGknY5?hg8kv2JQ^L=0Q+6l!XCt+1 zeet;?{r!sH%F1NDyoA`vu%|A({aQT;9GT z2evBA{uWV0gr6p<^5WtJSjzf%$rZ_I*pP6r(3mu6&Btlf6n1&(3AEAJd%WM~tMWN* zA3uH+p`@e)teKpa*3?=Wr;+a(ut(RsrIo;a0rr!KhzKZ}*nWWov~fZJ=(_;%V%CjT zX41aIC|FR2FDoZUIWa!&Uh$u3E^KllK4>xQ#~XB%?}r(;Kb=}SQD+tfN$wKH8r^rs zC0^(&oGT1VYM!{fZ7sr6p`au;b!td2EG%@LcdTFC|5N*~k(OHhN`QI=P;GNCBQzRS zL{W1S=JqEWpzN^l@Ycp{yHA7d4+qZY(+18`rBek}RRnxC!~R)o!pPG5NPxb?#YTdB zQ$#uOFfe|_#K&Lh9)_?N09vcg@^C@))KF+^KvaLb=$WG_&Zu3)))D6D$zcqd6v0Q( zcStZDKmYf5T58aeQ($JG<^!WH(|}fhDbx@FLT}W0d@dkBYBPNPW4M2C&^`J)@Q{)$ z9J6&fUXhxswZZq!Q7|-w8GEmW2mUeu!jt*N4=?oC$AbRFzA*-|=~QdGtL%x(URMXDMttqYDck z@9+IBt*kC&4olu4UwhW=xxd|_{$c@& z;Vb8%j#!aUX!sme{afqJb7p3Vw9lWLw5&Dc$D&@a=H^`)EFWoMi8GM;$wfEcGrf96 zHGx!9aCPMY3>AR!Z{NP<*4%C$vhIH7wNM=Z>|*6VGYiCu03pEx110)7=c1#rNXW=S zwtUXd&rJcq2O^;B$xQI`ny;V5{REX26?Y1etyhXK9`1#Pw)ayBzOE_!bPa_>(o+Gx zK^w%?|0`F(Ui&8iV)~Yg`D4>ju^ZGox?4QtMWc*#Vvo0&N_46}V!gw;Q4LT!o}QXoy*^n3eEoEvk88`_b=zHA z)6pTbUy{vvFjy9%7RG~zcR5+QaFZD`v*rcF>lHa&;a6()W8?d4SE#mZ|`=6 z0Vvx8;QSqE??LU=4tXViVVz9a@CYCA0YNbQS>yz*s+q>B(v`5Zt}exNh0*+rq5Z8kz91Dal-KFwPk7wLy zN+GP#VPCny^im;r+M)ZfPdgWzGdpd{SNRIO#up^MX-z*l7owRm>w&gk`0ljWBtiF! zjo(r4YSC`4x|ul84o@lA=Q~B24AW0lZFtdogr*>Rc>nZm`T4@emLWUj$mVRWf3uKi zx9zzUL6!f_sYLKAyidow1_$SvGX`cg1Sk)vm4nqX(8S{9**^kw1V4;!%CRvh{HLgU zSpT@NF$AwQNOZDVrI3l8nLQ?| z=pne~tXyWuFn!LZsS<0DvUF>Y{;=DwKf1uo0PpL}d1oLXuqJh3TiDbs0Z0ZC?0L9tE(arq%rP7llW**6p+98 zwmq`bKOPkwwoT}l#jNw;L+uEWf;c9M2GjkB-@*6YPO97W1TcVPO5t9B3P}oDl~`am4y|Z-4jUkx4t5Wph$JUKfcIouBd_1cBLaY`|8k)?CN~IfB+kh zRzd~vOjUmzEXY7LUdO`<_HUkvIEJ;yg-TP1^QB`n_@&&5bE9h+9bvaRv#q6%n9>=1 z6NWtkOWiFY8_*l@K6L0Qwsa*Syjz4|~8461; z^PGr5rQk+Ji{E4-@ibgrPrgRQaJEL7I6LPH;7^S%IY9XB@a(2$k0X?rqzcWvS2Dqw z5oe9`KC``}LFV+o33Bb4b@p+GRq{Krw0;K^j%14}{6n0Li@1|@l9r>Oam9h7%7Ula zF|68@mC9!ZTF(Z_y2cv=b<_9j=bzP%anQ-KFuDe9KS+?`55-yI^b+23!+Y~ISph+r zkd~(KFF8M)xSr_Vzw~Z%UCxd-E>@`L&-*qVM;CSH~2NZ0)8Dt$bV3adw};b5qj*L@-!@R?2T_Y2gr>U->PP#CiG;-r^sX#RJyv z(vBoPJBPK?qNgMV_nMA~)~0ZKrBW^HZb&*X_bf)yFCBV`9^$sn2pI;0V=tMJ?|@LU z!RSb%!bDw9@8&IFFi1&BI|YKL9(c}uQK=2~uV)-p|JAFnb1n@^UqrU@$_M*S`qkVc z{6;E2?!kE)yZZhTqvyp$gOWnIWtQPW%3wn9E91z-bs{okTqsL4V80|U&d+g5O^aZ} zfRE$>v}$U4`nKoA1WjR7{o|bC(?cNox60Z4q$K4&;f%5{pZZdl>xY*rz8^d;N$#>(n9Dn4XZXE@>eAEI2(qr5}I9Toh+m zx>rW$Sk_b>xi7|4b;N`2Hn@UO2;dB>e~!Xet>G)FadZ=BN%d8xT2(q$j1W2{1}d0N zR^`pj&7ylHq|x(Jr)kH|1o9;tTMR238#)LoqmUN$pn%(;YX-4^cx_RZPFkc^1!mw~ zm7TP|pKQVnqtL?nA?tk7RsruIwGTa0%YIYu@x|ojmWZc^2R#>8JRXhMYXJd)0KD%+ z=E>LI3St9`*)Ah8PXy4EkkB@Tux>CScG2lqf$Zp4O5 zhWO5v9*$ZPPh=w%59xu^0ek<>0uWU(nPR?S&bEX*OZ^%gR7u44^a*b@=2)jBAV2_~ zq8iX!e{Z8V#hD3%L~ZlDBoAecKcQ-8LSuc;vy>8{v-?C6kGaBSCWn%L|D$9k@MZis zR6sePlsZP)O&OooM~`BzRn4OM(n{YL8;GkQ=y(bJmZ!cW5RpZ-(kTXd`e4;eLEMVE z{B;rG9Os3r!@k>Qz7M#zPUQL8yeuhgv7+0%WG52}FU;n-3dE8k{A;OhMAk&Un7n=w zYI*$CIT&>98YrCRAE)|G4f6kaIFP~yOfM;*g(($DJ2>ob0yp7E`*k6}Bb(Ik(rd!x zYER>>S?Fu1qyXe-!;-F0uj~GgonLF}bU^;?<-uaA+S}fq|M1DWN`YR`yzO-Udb!3=`UuUZA>nn#4cpd-neQiKyc2+s#$I;q1P??6)GdICSr^!zmKVleq8m#??W2Q z5iv4fQYcM@?$&>H`$lnZ7W8~yWFHP+MV-E8sG@g=NPIpagdkE=$zT%x>Ai2!h4mZ^ zIcok33xkqTQ^y3~zNqsMPDrx(5|6*@TF?=e>PZMg|EiTWU*yt+!$8yU0^{i3ns=>X zi9|&08J_UwP+;b1#B6%eN zs39OFy)cxP?wSUsy5RDxIW+1TH$U5DdI%P0`q+{OM4dZtp6+i&%H!?d>7$cntTF6wCEXTq~7fr;=ho4|vNjniMWn~|_CJaSIrDtZ2 z=;`e(aCRw%$7Jt}~yRc3f+6SsjG#YxdON!3+_MvL4-CWNl59ItDlTYo6 z@>`YW${u;U{KjTM$ zdu7Hcfj=j+^`UwR< zy(_2{RiM(avF2-ATTTRuoMi*b)e`B?ie=L!Cj2w%O_*;3FD!RtVWiFECSY!=3H#^3 zbI-*s_?GHc)_lkEGHnQ*aA9#TBQ9#RViL1a)W?rm#MIRD@$as?d=5xSlPm1}^^Ie) z>klm3Ki)m312c_P$zP@v!K_P!4%LwpQsvrytzHF{Qu*pEz_AcuvY+dId;b2^nCX%Q z6l^q8v$1UPlzosTnKQJ#J?Nqw1*(&{#`e#UCJVr> z;1p49;yd%~LOa3+l<8o%h8d3D!>ZMSo6k7}BqaPE_eK5qj!tt2p0a>xsnn~D=;`Z= zpVRf<{>C^sx)4|PCu4v4?-Q<4am(*#XyZH;;%vNRA|}|Fn4RTsZ3lqxg8(|1E17F$ zX{mA$v=A_WlJ5mhQTflL=P~+OW`M&7U-+xn`xi`jo+@6&$d3M3!1N+t9b=6ORKU{Z zRBv&*-cJtLkpXKU%4SYB5v1bPnZB1JsxI6K+Sy=x`VUPxRM}$GcqKtLy&xwfF`1}% zRR9=20o2~E7NXfgj|Rg-2QK+3Ir%3L&Alq_6=JP@c?8NixptjY)0J`q-{}pi5q6*> zU~d0Wq6p_LX~!$s7risX!NFCE0j7+baBe$zLry`mhWGPTuYHwM z%FD@hB*7s16^*?z!svV9FYnX}kyPo;kLUxPq##8_MPT@QWC{318vC0M%25&2V^+$z zkCUgI4~+*SUw2Eoy2tQW)&4u;UC~FqsrKGn*?n_)b>-D7j<=}<%mFejUCvjM;^IsC zr^9T_bF6T1&_coJcrZFIKh0b7lMPR4;2cAKem(~frxF4)3a2fDH=tFt&EnD$mb>}q ziqgOwy6*dTI05un?C1mh7dF>b3?3F%7cf%(13b~i-GC1v|5{s1Tvt~IL`Vl?dl&kR zl;jpTu)f7Ak5w1X=KBOv&Bg;4VA_i$BqY27;^+AJ9@;Co%X45*42-S6*Vh-8mhM$` zn(A5!W}4N{-;wSmcdlX)&EPrBn6P1>0OxSN>vI4RzF=fnm;*i@p1i5)N`v`b5IL}t zz}^6{)<^lmGqY-4!MTG=Il)Xv0mAps6|ua8VfsL*1M91Efz2>rboms$%_w|Z;yDo8 zwb7?Lb^ZdeB88lWK4e48LVELL-iI(FxPcRF|37Ot3MF8+br^qw&?1AQ1jtDrfm4AX NMY%V!71E|5{{z*}v^oF) literal 0 HcmV?d00001 diff --git a/modules/python/doc/conf.py.in b/modules/python/doc/conf.py.in index 4acd6d19e5..9094ea25c6 100644 --- a/modules/python/doc/conf.py.in +++ b/modules/python/doc/conf.py.in @@ -33,6 +33,7 @@ extensions = [ "sphinx.ext.intersphinx", "sphinx.ext.mathjax", "sphinx.ext.autosummary", + "sphinx.ext.doctest", "sphinx_immaterial", # "sphinx_immaterial.apidoc.python.apigen" ] @@ -152,6 +153,7 @@ html_theme = 'sphinx_immaterial' # html_theme_options = {} html_theme_options = { "toc_title_is_page_title": True, + "navigation_depth": 2, "repo_url": "https://github.com/lagadic/visp", "repo_name": "visp", "features": [ @@ -205,7 +207,7 @@ html_theme_options = { # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = [] +html_static_path = ['_static'] # Add any extra paths that contain custom files (such as robots.txt or # .htaccess) here, relative to this directory. These files are copied @@ -283,6 +285,9 @@ latex_elements = { #'figure_align': 'htbp', } +html_logo = 'visp_icon.png' +html_favicon = 'visp_icon.png' + # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). diff --git a/modules/python/doc/conversions.rst b/modules/python/doc/conversions.rst new file mode 100644 index 0000000000..82829afc3f --- /dev/null +++ b/modules/python/doc/conversions.rst @@ -0,0 +1,51 @@ +Using ViSP with other libraries +=============================================== + +ViSP provides multiple types to manipulate mathematical objects, such as: + +* Vectors + + * :py:class:`visp.core.ColVector` + * :py:class:`visp.core.RowVector` + * :py:class:`visp.core.ThetaUVector` + +* Matrices + + * :py:class:`visp.core.Matrix` + * :py:class:`visp.core.RotationMatrix` + * :py:class:`visp.core.HomogeneousMatrix` + + +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 `_. +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:: + + 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 + + print(np.all(np_vec == list_representation)) + +.. testoutput:: + + True + + + + + + + + +Potential issues +-------------------- diff --git a/modules/python/doc/index.rst b/modules/python/doc/index.rst index 5906330dfa..a7f1e717d9 100644 --- a/modules/python/doc/index.rst +++ b/modules/python/doc/index.rst @@ -1,50 +1,16 @@ ViSP Python Documentation ============================ -Contents: +Welcome to the ViSP Python binding documentation! + -Todos and known issues -============================ .. currentmodule:: visp .. toctree:: :glob: + :maxdepth: 2 todos.rst + conversions.rst api.rst - -.. Core module -.. ============== - -.. .. automodule:: visp.core -.. :members: -.. :undoc-members: - -.. Visual servoing module -.. ======================= - -.. .. automodule:: visp.vs -.. :members: -.. :undoc-members: - -.. Vision module -.. ======================= - -.. .. automodule:: visp.vision -.. :members: -.. :undoc-members: - -.. Visual features -.. ======================= - -.. .. automodule:: visp.visual_features -.. :members: -.. :undoc-members: - -.. Input/output module -.. ==================== - -.. .. automodule:: visp.io -.. :members: -.. :undoc-members: From 823e01dfa0f35e84c0e0dfd2bd38755772f3d5d3 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Wed, 6 Dec 2023 01:12:48 +0100 Subject: [PATCH 154/169] fix some doc warnings, icon, and doctest --- modules/core/include/visp3/core/vpArray2D.h | 2 +- modules/gui/include/visp3/gui/vpPlot.h | 2 +- modules/python/doc/CMakeLists.txt | 2 ++ .../python/doc/_static/visp_icon_white.png | Bin 0 -> 6491 bytes modules/python/doc/conf.py.in | 6 ++--- modules/python/doc/conversions.rst | 20 +++++++-------- .../tracker/mbt/src/vpMbGenericTracker.cpp | 24 +++++++++--------- modules/tracker/mbt/src/vpMbTracker.cpp | 16 ++++++------ 8 files changed, 36 insertions(+), 36 deletions(-) create mode 100644 modules/python/doc/_static/visp_icon_white.png 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 0000000000000000000000000000000000000000..2611203027f23c966990250f3eefd3fb1af5b3f4 GIT binary patch literal 6491 zcmeHKdpK0<_up<~5*mp_X^e_wZe|QKZsV5AiG~#2WY5gTl$p`YFyqcpkx)cYDpILj z>bOTox=4|vI+PBj&`l#<)Jdn`9y*=Q^ZP!}@9BAd-~XC<_HDguecrV`?^<1^|GDhr5d}e3imSG7c>2@Pj#F5Ly%!4xu3lCl~-E z_qhy5&C6(H)2E$rQpI(WOfL6Vhu#r9@{j5p-h-*6V3+O>O<8X(=tV9OkCv1}Dl=w? zu+}zzKFQ{cD?3YuDok1l^u?zicVJ%~j{d0f;rE(TJx8#+-tmyG_72iPqw37EMmy;u zDe8f#R@dkC4KwgP_%h>xmfx~(olV-m#(&~a$U0GU%v~`mD5#}umwP{O|6CiHI0lWu%y_wJH=M*r?Uni>$3eG> zc3ksT9L;>JWA`498`?WkuP{~H7j$@T_q27Mzs4_Pd|O$&+6cCD^Rd=-6HoB!!!^0& z9!@4EbMd0xDad)2dwr6&A>GpKcV!Y#Dw0R-ujI-)?oG#fT7C@-iYzJRy4jUY5Tm z!QoJcp#Bc=a~hm^ksLU~0=!nxSbQ!HWb>I2PQnd`Qx5=a9VFo(YYQYoGocU;&kiGN zY{sBDY&(p_|usff1NVFJ7uXlK3vLX&Z190BVp;Y38hk6Dksg z)9`q)Sd0^saC|`so=Bxq@dOLJg#{MYzzU;yB2a?m3613t(-2+vCV*OYD^UW{)RatcB?-0&$Y znCyRPia5dlko7O$tO&V#9xiqm`TR6CpT%L* zrfw-#L<+?cw7>>ius|%?l4^xzQmoln(9(*^W(HfaK{oL_C=Z@c1oBvr90~@-kpRFKKW5=j;$7DxrzAeA)*#b(i#^95WGUQP}d41w_BypX8@IpH)% zhKC)-0!R2q!UzLJ!LR{b0~{WkFBbkY1uprTh7BqsTAACc$q!Fmg2t*p;JAFQz6CCw_Y0Jw8Z9Bc_?i?XJf7Fy{ zx~5h^Tc@9GDX!3_ zUzcj>zr7KMLh^NhDZ>&iu-_;n5;6F%!Q$l|Sp$m|aPOQmMYX#(Jl&QTC42PCI*X zWk^rqsUUoy=Sl^;WgRD@Uw2Cn`I@Jgugztg-AZgMGh*b`B;8>sQBZGZd)Nh}^d#Fr zkq5uL`Aa5?$1GjOroPvNM(JLmJ?1Z`cKt$ei`0h3dVY}&ea&N zseY5@azeO(6{|zn>*$p6U3Q&)j%F{CO*V(&*Bo=iwqt76aTVq}zPYt<7?}rsPIz_9 zm$OA67)K=@p#p(~JDY2^Wn^TW`XsBWs?wu(=_L~U!>^NXa4!)w0c3#_N=JFUv9WQ@ z=9*~T>??-AIXcSUz`)=xA)s0{3H58KF_5x5GFy!m74>l^y$Ob9%}9O?FyYDOe@xQ(#3VZr{GWctKH+g5oSa0w4K6-@qV7GTf1m7bQt`kY(Tn zj8XWq!#4-=^Ya@@El}o;K{J%{RHXHD&53gcn7a~~`7h5VDzqb$R&57ut-RipdeVC< z7?nM;^2*8tk53>_eo?Paqx?l^KD zMbdPC88L}&N+wLKq196fq;B4<~MBXXY7Bjk|aW5n5j2R9$r5n2OO z^vv5aTMLP2Ht&wRv;&^LW2UrT2VwMNr>Bw`O8HRT{>O^w=;kCOeS`L>+KOQgwh`lN2Ymjl2;rF)_g-YJ~0*bX*b0 z;c(VYFi`LGM?25QejK0h*pMD#8ZNWQDJlFk-)LX^f)z2$E6mqff`-^#6lLClEVW_- z_mQ^^F^!X^SF>gZDi165pq$dyEPqG6c>VhImTHq$MXBl0o0ZNlPaJIe>s5S+Q?_?x z!j2x^3wsZ+duXe5`}50wLx!39nYUC`KYQ{_Ir1IB!688`6q0mSbl%ilXg`@gKuU+3$D`4{x<=VR^B1v1 z@}cxo-ua%glWNJ>WsNgkd}R5}0VDmqx=oh)8Ai>I*XBj^ztAsS)+mmQOxd>VKDW?E zLrR#LwfXfG=GNx(=KXx7(Rv+)^eE-ZlHIQBLzW&4m}?|j;U{oA8Y{Fn8?g`MSGqjW zp$rcX^HfLY9Ei+LZJh+PQQ4iWc8u60CL>6!NhFg+4?c=RUR_XA)XMCet3O#AMf4J` zUxJ)8x9%vo+S+Qky&>&W)#&IbbgQTJX!)o4MHA@d10}vi3`v+?>(aX;s;EE5Vjb_K znVwJz$cqT{2W%I#d}d~Bz=rU82I4i3*Q>kG_&?3-QO$L{$ZxH`clr*NX>%`MdZ`XY<9^ov8$r3 ztJ7B&R?#S_-CBI*^h4!nM^ucVLWv3Bvw@pcCcyPH3k-{1Z)W%te1W#>vXH5wZmUm#CbEfmd4%-gA{OD@{`0i02=MiPH{G5{A2Ot0DksDIa zxS}xFUv-OV*dn{P{5oL%Ja*O+=L6=q=v}eZ14D{BtM40m9OhV6^*$4McMDWi#)0=k zN85Vc-*8`ejH~9_IGjx0l5l%zXDubUNmHra+V`N}MC48fj~Bg;^ioZyf>`fpRA|Z$ zYdXrw3|Zu=Le*>4YaUco#Op~Cj~s9=DSwsir{PfbTWP=c?-xhVk|wV}1adZ2iu8X- zEi5Z`?gEUApYMPwEHKtC8%>b2Z4|S#FxRynjQ2SOAod-hqH}?w2~E#Ol?(SS4eN>= zx}(av3)n7GEug2KDoaVe@cbf#Fk0RlYMkQTrm0|wl3YN4I_DaQYccaV5zV+yC{>o0 z!*7w^^X=;8k<7K_J`MygJwIim%wH~Z@V_s%$w{s{(_*sn(B!?%HJNDFT!fn88%jrf zB0}A4(XOpf!Ei08r&?UQu=1MCaffVO!~#cm#ckv0uI-LisDozv+AGtq495F3-;BM1 zY3d>s=x4OG zYG#qENMNdhwA15ZQh1uhHfosm%&39v^PF0HEjoh^ z*E!sc;(p~1{N@~Z>;$KvPu71v=JW841Lg8J|MU*z>qca}JE3Ya>R3S&*9YDr0Uoa2 KE)`Be(*FTS?hW1m literal 0 HcmV?d00001 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. From d9692b288e9f2944a4a0fb99f01028b94ce444eb Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Wed, 6 Dec 2023 12:39:04 +0100 Subject: [PATCH 155/169] Log pybind11 version in ViSP-third-party --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 661c8468cb..433a2e4868 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1524,7 +1524,7 @@ status("") status(" Python3 bindings:" BUILD_PYTHON_BINDINGS THEN "yes" ELSE "no") if(BUILD_PYTHON_BINDINGS) status(" Python3 interpreter:" PYTHON3INTERP_FOUND THEN "${PYTHON3_EXECUTABLE} (ver ${PYTHON3_VERSION_STRING})" ELSE "no") - status(" Pybind11:" USE_PYBIND11 THEN "${pybind11_DIR}" ELSE "no") + status(" Pybind11:" USE_PYBIND11 THEN "${pybind11_DIR} (${pybind11_VERSION})" ELSE "no") status(" Package version:" "${VISP_PYTHON_PACKAGE_VERSION}") status(" Wrapped modules:" "${VISP_PYTHON_BOUND_MODULES}") status(" Generated input config:" "${VISP_PYTHON_GENERATED_CONFIG_FILE}") From 65a98c71b038e6422c57d0681573d6f9777cf8ac Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Wed, 6 Dec 2023 17:50:28 +0100 Subject: [PATCH 156/169] More work on doc and testing --- modules/python/.gitignore | 2 +- .../bindings/include/core/pixel_meter.hpp | 54 ++++++++- modules/python/config/core.json | 105 +++++++++++++++++- modules/python/doc/CMakeLists.txt | 3 +- modules/python/doc/conf.py.in | 4 +- modules/python/doc/conversions.rst | 68 +++++++++++- modules/python/doc/index.rst | 1 - modules/python/doc/todos.rst | 5 - modules/python/test/test_core.py | 39 +++++++ 9 files changed, 266 insertions(+), 15 deletions(-) create mode 100644 modules/python/test/test_core.py diff --git a/modules/python/.gitignore b/modules/python/.gitignore index b8307c6f89..f015fe73c8 100644 --- a/modules/python/.gitignore +++ b/modules/python/.gitignore @@ -5,6 +5,6 @@ stubs/visp stubs/build *.eggs doc/_build -doc/_autosummary +doc/_autosummary/* doc/generated doc/api.rst diff --git a/modules/python/bindings/include/core/pixel_meter.hpp b/modules/python/bindings/include/core/pixel_meter.hpp index 51b26078a1..c55b272e2d 100644 --- a/modules/python/bindings/include/core/pixel_meter.hpp +++ b/modules/python/bindings/include/core/pixel_meter.hpp @@ -69,13 +69,39 @@ void bindings_vpPixelMeterConversion(py::class_ &pyPM) }, R"doc( Convert a set of 2D pixel coordinates to normalized coordinates. + :param cam: The camera intrinsics with which to convert pixels to normalized coordinates. + :param us: The pixel coordinates along the horizontal axis. + :param vs: The pixel coordinates along the vertical axis. :raises RuntimeError: If us and vs do not have the same dimensions and shape. :return: A tuple containing the x and y normalized coordinates of the input pixels. +Both arrays have the same shape as xs and ys. + +Example usage: + +.. testcode:: + + from visp.core import PixelMeterConversion, CameraParameters + import numpy as np + + h, w = 240, 320 + cam = CameraParameters(px=600, py=600, u0=320, v0=240) + + vs, us = np.meshgrid(range(h), range(w), indexing='ij') # vs and us are 2D arrays + vs.shape == (h, w) and us.shape == (h, w) + + xs, ys = PixelMeterConversion.convertPoints(cam, us, vs) + # xs and ys have the same shape as us and vs + assert xs.shape == (h, w) and ys.shape == (h, w) + + # Converting a numpy array to normalized coords has the same effect as calling on a single image point + u, v = 120, 120 + x, y = PixelMeterConversion.convertPoint(cam, u, v) + assert x == xs[v, u] and y == ys[v, u] )doc", py::arg("cam"), py::arg("us"), py::arg("vs")); } @@ -106,13 +132,39 @@ void bindings_vpMeterPixelConversion(py::class_ &pyMP) }, R"doc( Convert a set of 2D normalized coordinates to pixel coordinates. + :param cam: The camera intrinsics with which to convert normalized coordinates to pixels. + :param xs: The normalized coordinates along the horizontal axis. + :param ys: The normalized coordinates along the vertical axis. :raises RuntimeError: If xs and ys do not have the same dimensions and shape. -:return: A tuple containing the u,v pixel coordinates of the input normalized coordinates. +:return: A tuple containing the u,v pixel coordinate arrays of the input normalized coordinates. +Both arrays have the same shape as xs and ys. + +Example usage: + +.. testcode:: + + from visp.core import MeterPixelConversion, CameraParameters + import numpy as np + + cam = CameraParameters(px=600, py=600, u0=320, v0=240) + n = 20 + xs, ys = np.random.rand(n), np.random.rand(n) + + + us, vs = MeterPixelConversion.convertPoints(cam, xs, ys) + + # xs and ys have the same shape as us and vs + assert us.shape == (n,) and vs.shape == (n,) + + # Converting a numpy array to pixel coords has the same effect as calling on a single image point + x, y = xs[0], ys[0] + u, v = MeterPixelConversion.convertPoint(cam, x, y) + assert u == us[0] and v == vs[0] )doc", py::arg("cam"), py::arg("xs"), py::arg("ys")); } diff --git a/modules/python/config/core.json b/modules/python/config/core.json index 6d86ecdd7f..ff9937e676 100644 --- a/modules/python/config/core.json +++ b/modules/python/config/core.json @@ -651,10 +651,111 @@ ] }, "vpPixelMeterConversion": { - "additional_bindings": "bindings_vpPixelMeterConversion" + "additional_bindings": "bindings_vpPixelMeterConversion", + "methods": [ + { + "static": true, + "signature": "void convertEllipse(const vpCameraParameters&, const vpImagePoint&, double, double, double, double&, double&, double&, double&, double&)", + "use_default_param_policy": false, + "param_is_input": [true, true, true, true, true, false, false, false, false, false], + "param_is_output": [false, false, false, false, false, true, true, true, true, true] + }, + { + "static": true, + "signature": "void convertLine(const vpCameraParameters&, const double&, const double&, double&, double&)", + "use_default_param_policy": false, + "param_is_input": [true,true,true,false,false], + "param_is_output": [false,false,false,true,true] + }, + { + "static": true, + "signature": "void convertPoint(const vpCameraParameters&, const double&, const double&, double&, double&)", + "use_default_param_policy": false, + "param_is_input": [true,true,true,false,false], + "param_is_output": [false,false,false,true,true] + }, + { + "static": true, + "signature": "void convertPoint(const vpCameraParameters&, const vpImagePoint&, double&, double&)", + "use_default_param_policy": false, + "param_is_input": [true,true,false,false], + "param_is_output": [false,false,true,true] + }, + { + "static": true, + "signature": "void convertEllipse(const cv::Mat&, const cv::Mat&, const vpImagePoint&, double, double, double, double&, double&, double&, double&, double&)", + "ignore": true + }, + { + "static": true, + "signature": "void convertLine(const cv::Mat&, const double&, const double&, double&, double&)", + "ignore": true + }, + { + "static": true, + "signature": "void convertPoint(const cv::Mat&, const cv::Mat&, const double&, const double&, double&, double&)", + "ignore": true + }, + { + "static": true, + "signature": "void convertPoint(const cv::Mat&, const cv::Mat&, const vpImagePoint&, double&, double&)", + "ignore": true + } + ] + }, "vpMeterPixelConversion": { - "additional_bindings": "bindings_vpMeterPixelConversion" + "additional_bindings": "bindings_vpMeterPixelConversion", + "methods": [ + { + "static": true, + "signature": "void convertEllipse(const vpCameraParameters&, const vpImagePoint&, double, double, double, double&, double&, double&, double&, double&)", + "use_default_param_policy": false, + "param_is_input": [true, true, true, true, true, false, false, false, false, false], + "param_is_output": [false, false, false, false, false, true, true, true, true, true] + }, + { + "static": true, + "signature": "void convertLine(const vpCameraParameters&, const double&, const double&, double&, double&)", + "use_default_param_policy": false, + "param_is_input": [true,true,true,false,false], + "param_is_output": [false,false,false,true,true] + }, + { + "static": true, + "signature": "void convertPoint(const vpCameraParameters&, const double&, const double&, double&, double&)", + "use_default_param_policy": false, + "param_is_input": [true,true,true,false,false], + "param_is_output": [false,false,false,true,true] + }, + { + "static": true, + "signature": "void convertPoint(const vpCameraParameters&, const vpImagePoint&, double&, double&)", + "use_default_param_policy": false, + "param_is_input": [true,true,false,false], + "param_is_output": [false,false,true,true] + }, + { + "static": true, + "signature": "void convertEllipse(const cv::Mat&, const cv::Mat&, const vpImagePoint&, double, double, double, double&, double&, double&, double&, double&)", + "ignore": true + }, + { + "static": true, + "signature": "void convertLine(const cv::Mat&, const double&, const double&, double&, double&)", + "ignore": true + }, + { + "static": true, + "signature": "void convertPoint(const cv::Mat&, const cv::Mat&, const double&, const double&, double&, double&)", + "ignore": true + }, + { + "static": true, + "signature": "void convertPoint(const cv::Mat&, const cv::Mat&, const vpImagePoint&, double&, double&)", + "ignore": true + } + ] }, "vpCircle": { "methods": [ diff --git a/modules/python/doc/CMakeLists.txt b/modules/python/doc/CMakeLists.txt index 617632448a..0a5a3e3430 100644 --- a/modules/python/doc/CMakeLists.txt +++ b/modules/python/doc/CMakeLists.txt @@ -68,11 +68,12 @@ 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 + COMMAND ${PYTHON3_EXECUTABLE} -m sphinx -b html -c "${BINARY_BUILD_DIR}" -d "${SPHINX_CACHE_DIR}" -j 8 + -E "${CMAKE_CURRENT_SOURCE_DIR}" "${SPHINX_HTML_DIR}" COMMENT "Building Sphinx HTML documentation for ViSP's Python bindings" diff --git a/modules/python/doc/conf.py.in b/modules/python/doc/conf.py.in index 89a67434ee..46cfa401e6 100644 --- a/modules/python/doc/conf.py.in +++ b/modules/python/doc/conf.py.in @@ -66,7 +66,6 @@ nbsphinx_allow_errors = True # Continue through Jupyter errors autodoc_typehints = "both" # Sphinx-native method. Not as good as sphinx_autodoc_typehints add_module_names = False # Remove namespaces from class/method signatures -import visp # Add any paths that contain templates here, relative to this directory. templates_path = ["_templates"] @@ -153,7 +152,6 @@ html_theme = 'sphinx_immaterial' # html_theme_options = {} html_theme_options = { "toc_title_is_page_title": True, - "navigation_depth": 2, "repo_url": "https://github.com/lagadic/visp", "repo_name": "visp", "features": [ @@ -193,7 +191,7 @@ html_theme_options = { # html_title = None # A shorter title for the navigation bar. Default is the same as html_title. -# html_short_title = None +# html_short_title = 'ViSP documentation' # The name of an image file (relative to this directory) to place at the top # of the sidebar. diff --git a/modules/python/doc/conversions.rst b/modules/python/doc/conversions.rst index 33e393707a..43e386f1e0 100644 --- a/modules/python/doc/conversions.rst +++ b/modules/python/doc/conversions.rst @@ -22,8 +22,15 @@ they are a foreign concept to all the other Python libraries. 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: +From ViSP to NumPy +----------------------------------------- + + +Obtaining a view of a ViSP object +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +To reinterpret a supported ViSP object as a Numpy array, use either: .. doctest:: @@ -37,6 +44,65 @@ To reinterpret a supported ViSP object as a Numpy array, use either: >>> np.all(np_vec == list_representation) True + >>> vec *= 2.0 + >>> np.all(np_vec == list_representation) + False + +or + +.. doctest:: + + >>> 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 = np.array(vec, copy=False) # A 1D numpy array of size 3 + + >>> np.all(np_vec == list_representation) + True + + >>> vec *= 2.0 # Modifying the ViSP vector modifies the NumPy view + >>> np.all(np_vec == list_representation) + False + +To obtain a copy of the ViSP representation you can simply use: + +.. doctest:: + + >>> from visp.core import ColVector + >>> import numpy as np + + >>> vec = ColVector(3, 0) + >>> np_vec = vec.numpy().copy() # or np.array(vec, copy=True) + >>> np_vec[0] = 1 + + >>> np_vec[0] == vec[0] + False + +Note that with these methods, some ViSP objects cannot be modified. +That is the case for :py:class:`visp.core.HomogeneousMatrix` and :py:class:`visp.core.RotationMatrix`, where an undesired modification +may lead to an invalid representation (Such as a rotation matrix not conserving its properties) + +Thus, this code will not work: + +.. doctest:: + :options: +IGNORE_EXCEPTION_DETAIL + + >>> from visp.core import RotationMatrix, HomogeneousMatrix + >>> import numpy as np + + >>> R = RotationMatrix() + >>> R.numpy()[0, 1] = 1.0 + Traceback (most recent call last): + File "", line 1, in + ValueError: assignment destination is read-only + + >>> T = HomogeneousMatrix() + >>> R.numpy()[0, 1] = 1.0 + Traceback (most recent call last): + File "", line 1, in + ValueError: assignment destination is read-only diff --git a/modules/python/doc/index.rst b/modules/python/doc/index.rst index a7f1e717d9..d429468c8a 100644 --- a/modules/python/doc/index.rst +++ b/modules/python/doc/index.rst @@ -13,4 +13,3 @@ Welcome to the ViSP Python binding documentation! todos.rst conversions.rst - api.rst diff --git a/modules/python/doc/todos.rst b/modules/python/doc/todos.rst index d1c00348ce..cd33877295 100644 --- a/modules/python/doc/todos.rst +++ b/modules/python/doc/todos.rst @@ -36,12 +36,7 @@ Documentation ---------------- * Generate documentation for: - * Enums * Functions in namespaces etc. - * In classes - - * Constructors - * Operators * Reference python types in Documentation * Prefer Python examples instead of C++ ones ? diff --git a/modules/python/test/test_core.py b/modules/python/test/test_core.py new file mode 100644 index 0000000000..01ffdd0f37 --- /dev/null +++ b/modules/python/test/test_core.py @@ -0,0 +1,39 @@ +def test_pixel_meter_convert_points(): + from visp.core import PixelMeterConversion, CameraParameters + import numpy as np + + h, w = 240, 320 + cam = CameraParameters(px=600, py=600, u0=320, v0=240) + + vs, us = np.meshgrid(range(h), range(w), indexing='ij') # vs and us are 2D arrays + + xs, ys = PixelMeterConversion.convertPoints(cam, us, vs) + # xs and ys have the same shape as us and vs + assert xs.shape == (h, w) and ys.shape == (h, w) + + # Converting a numpy array to normalized coords has the same effect as calling on a single image point + for v in range(h): + for u in range(w): + x, y = PixelMeterConversion.convertPoint(cam, u, v) + + assert x == xs[v, u] and y == ys[v, u] + +def test_meter_pixel_convert_points(): + from visp.core import MeterPixelConversion, CameraParameters + import numpy as np + + h, w = 240, 320 + cam = CameraParameters(px=600, py=600, u0=320, v0=240) + + # We use xs and ys as pixel coordinates here, but it's not really true (it's just more convenient) + ys, xs = np.meshgrid(range(h), range(w), indexing='ij') # vs and us are 2D arrays + + us, vs = MeterPixelConversion.convertPoints(cam, xs, ys) + # xs and ys have the same shape as us and vs + assert us.shape == (h, w) and vs.shape == (h, w) + + # Converting a numpy array to normalized coords has the same effect as calling on a single image point + for y in range(h): + for x in range(w): + u, v = MeterPixelConversion.convertPoint(cam, x, y) + assert u == us[y, x] and v == vs[y, x] From 6176f35fe06074fa17b52424cb26305b0b982c3f Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Thu, 7 Dec 2023 12:45:08 +0100 Subject: [PATCH 157/169] refactor documentation structure --- modules/python/doc/index.rst | 5 +++-- modules/python/doc/rst/coming_from_cpp.rst | 2 ++ modules/python/doc/{todos.rst => rst/known_issues.rst} | 0 modules/python/doc/rst/python_api.rst | 8 ++++++++ modules/python/doc/{ => rst/python_api}/conversions.rst | 0 5 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 modules/python/doc/rst/coming_from_cpp.rst rename modules/python/doc/{todos.rst => rst/known_issues.rst} (100%) create mode 100644 modules/python/doc/rst/python_api.rst rename modules/python/doc/{ => rst/python_api}/conversions.rst (100%) diff --git a/modules/python/doc/index.rst b/modules/python/doc/index.rst index d429468c8a..110acd9d28 100644 --- a/modules/python/doc/index.rst +++ b/modules/python/doc/index.rst @@ -11,5 +11,6 @@ Welcome to the ViSP Python binding documentation! :glob: :maxdepth: 2 - todos.rst - conversions.rst + rst/coming_from_cpp.rst + rst/python_api.rst + rst/known_issues.rst diff --git a/modules/python/doc/rst/coming_from_cpp.rst b/modules/python/doc/rst/coming_from_cpp.rst new file mode 100644 index 0000000000..18b4191a6b --- /dev/null +++ b/modules/python/doc/rst/coming_from_cpp.rst @@ -0,0 +1,2 @@ +Differences with the C++ +============================== diff --git a/modules/python/doc/todos.rst b/modules/python/doc/rst/known_issues.rst similarity index 100% rename from modules/python/doc/todos.rst rename to modules/python/doc/rst/known_issues.rst diff --git a/modules/python/doc/rst/python_api.rst b/modules/python/doc/rst/python_api.rst new file mode 100644 index 0000000000..a49cb65a90 --- /dev/null +++ b/modules/python/doc/rst/python_api.rst @@ -0,0 +1,8 @@ +Python tips +==================== + +.. toctree:: + :glob: + :maxdepth: 2 + + python_api/conversions.rst diff --git a/modules/python/doc/conversions.rst b/modules/python/doc/rst/python_api/conversions.rst similarity index 100% rename from modules/python/doc/conversions.rst rename to modules/python/doc/rst/python_api/conversions.rst From 6e8a678a0113c802606bb82bdab4fac3873bc85d Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Thu, 7 Dec 2023 18:24:56 +0100 Subject: [PATCH 158/169] a lot of documentation --- modules/python/doc/CMakeLists.txt | 2 +- modules/python/doc/api.rst.in | 8 + modules/python/doc/conf.py.in | 15 +- modules/python/doc/index.rst | 78 ++++++++- modules/python/doc/requirements.txt | 1 + modules/python/doc/rst/coming_from_cpp.rst | 157 +++++++++++++++++- modules/python/doc/rst/dev/config.rst | 2 + .../python/doc/rst/dev/custom_bindings.rst | 2 + modules/python/doc/rst/dev/dev.rst | 13 ++ modules/python/doc/rst/dev/how.rst | 2 + modules/python/doc/rst/dev/python_side.rst | 2 + modules/python/doc/rst/known_issues.rst | 21 ++- .../python/doc/rst/python_api/conversions.rst | 2 +- .../python/doc/rst/python_api/python_api.rst | 10 ++ modules/python/doc/rst/tutorials/ibvs.rst | 2 + modules/python/doc/rst/tutorials/pbvs.rst | 2 + .../tutorials.rst} | 7 +- 17 files changed, 306 insertions(+), 20 deletions(-) create mode 100644 modules/python/doc/rst/dev/config.rst create mode 100644 modules/python/doc/rst/dev/custom_bindings.rst create mode 100644 modules/python/doc/rst/dev/dev.rst create mode 100644 modules/python/doc/rst/dev/how.rst create mode 100644 modules/python/doc/rst/dev/python_side.rst create mode 100644 modules/python/doc/rst/python_api/python_api.rst create mode 100644 modules/python/doc/rst/tutorials/ibvs.rst create mode 100644 modules/python/doc/rst/tutorials/pbvs.rst rename modules/python/doc/rst/{python_api.rst => tutorials/tutorials.rst} (55%) diff --git a/modules/python/doc/CMakeLists.txt b/modules/python/doc/CMakeLists.txt index 0a5a3e3430..66be5e73de 100644 --- a/modules/python/doc/CMakeLists.txt +++ b/modules/python/doc/CMakeLists.txt @@ -66,7 +66,7 @@ configure_file( ) add_custom_target(visp_python_bindings_doc - COMMAND ${PYTHON3_EXECUTABLE} -m pip install -r "${CMAKE_CURRENT_SOURCE_DIR}/requirements.txt" + COMMAND ${PYTHON3_EXECUTABLE} -m pip install -q -r "${CMAKE_CURRENT_SOURCE_DIR}/requirements.txt" COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMAKE_CURRENT_SOURCE_DIR}/_static" "${BINARY_BUILD_DIR}/_static" COMMAND ${PYTHON3_EXECUTABLE} -m sphinx -b html diff --git a/modules/python/doc/api.rst.in b/modules/python/doc/api.rst.in index 2d24c2efdb..004e63bc57 100644 --- a/modules/python/doc/api.rst.in +++ b/modules/python/doc/api.rst.in @@ -1,6 +1,14 @@ +.. _API reference: + API reference ============== +This API documentation is automatically generated by parsing the C++ documentation. + +.. warning:: + + Some documentation may be missing, and there may incorrect/missing links. If you are having issues, see the C++ documentation. + .. autosummary:: :toctree: _autosummary diff --git a/modules/python/doc/conf.py.in b/modules/python/doc/conf.py.in index 46cfa401e6..cd46bf0496 100644 --- a/modules/python/doc/conf.py.in +++ b/modules/python/doc/conf.py.in @@ -16,12 +16,8 @@ # documentation root, use os.path.abspath to make it absolute, like shown here. import sys import os -from sphinx.util.logging import * - -sys.path.insert(0, os.path.abspath('../build')) - # If your documentation needs a minimal Sphinx version, state it here. # needs_sphinx = '1.0' @@ -35,7 +31,7 @@ extensions = [ "sphinx.ext.autosummary", "sphinx.ext.doctest", "sphinx_immaterial", - # "sphinx_immaterial.apidoc.python.apigen" + "sphinx_design" ] # python_apigen_modules = { @@ -159,6 +155,7 @@ html_theme_options = { "toc.sticky", "navigation.instant" ], + "globaltoc_collapse": False, "palette": [ { "media": "(prefers-color-scheme: light)", @@ -282,7 +279,11 @@ latex_elements = { # Latex figure (float) alignment #'figure_align': 'htbp', } - +rst_prolog = """ +.. role:: python(code) + :language: python + :class: highlight +""" html_logo = '_static/visp_icon_white.png' html_favicon = '_static/visp_icon.png' @@ -364,7 +365,7 @@ texinfo_documents = [ # Example configuration for intersphinx: refer to the Python standard library. intersphinx_mapping = {"python": ("https://docs.python.org/", None)} -from sphinx.util.logging import WarningLogRecordTranslator +from sphinx.util.logging import WarningLogRecordTranslator, WarningStreamHandler # Filter warning about Parameter names not matching function signature # This is somethiing that is due to pybind overloads, so we cannot do anything about it diff --git a/modules/python/doc/index.rst b/modules/python/doc/index.rst index 110acd9d28..e227c22780 100644 --- a/modules/python/doc/index.rst +++ b/modules/python/doc/index.rst @@ -1,16 +1,82 @@ ViSP Python Documentation ============================ -Welcome to the ViSP Python binding documentation! - - - .. currentmodule:: visp .. toctree:: - :glob: :maxdepth: 2 + :hidden: rst/coming_from_cpp.rst - rst/python_api.rst + rst/python_api/python_api.rst + rst/tutorials/tutorials.rst + rst/dev/dev.rst + api.rst rst/known_issues.rst + + +Welcome to the ViSP Python binding documentation! + + ViSP is a modular C++ library that allows fast development of visual servoing applications. + ViSP is developed and maintained by the `Inria Rainbow (former Lagadic) team located `_ at Inria Rennes. + + + +Introduction +---------------------------- + +This documentation is specifically aimed at developers choosing to use ViSP in Python. + +Other, more general resources, are available: + +* If you are using C++, please see `the dedicated documentation `_ + +* The ViSP wiki can be found `here `_ + +* The ViSP source code available on `GitHub `_ + +* Results and demonstrations can be seen on the `ViSP YouTube channel `_ + + +Disclaimer +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +This documentation does not cover the full capabilities of ViSP. Please see the C++ documentation, which contains: + +* `Tutorials `_ on: + + * The core concepts: linear algebra, image processing, etc. + * Visual servoing with 3D, 2D or photometric features + * Object pose estimation and tracking + + * With the model-based tracker (MBT) :py:class:`visp.mbt.MbGenericTracker` + * With MegaPose, a deep learning approach to pose estimation :py:class:`visp.dnn_tracker.Megapose` + +* `Examples `_ + + * Demonstrating basic feature usage + * Servoing on specific robotics platforms + * Tracking + + +There are still issues with these generated bindings: see :ref:`Known issues` + + +Getting started +^^^^^^^^^^^^^^^^^^^^^^^ + +If you are transitioning from C++, please have a look at the :ref:`CPP guide` to understand the differences between the Python and C++ versions. + + +For general ViSP + Python guidance, see the :ref:`Python API guide`. + + +For tutorials on specific features: see :ref:`Tutorials`. + +Finally, if you wish to browse the full ViSP class documentation, go to the :ref:`API reference`. + + +Customizing, extending and contributing to the bindings +-------------------------------------------------------- + +If you wish to contribute, extend or modify the bindings for your own needs, please read the :ref:`Development guide` diff --git a/modules/python/doc/requirements.txt b/modules/python/doc/requirements.txt index 1e8f099944..fdb58ef4a2 100644 --- a/modules/python/doc/requirements.txt +++ b/modules/python/doc/requirements.txt @@ -1,3 +1,4 @@ sphinx sphinx-immaterial sphinxcontrib-jsmath +sphinx-design diff --git a/modules/python/doc/rst/coming_from_cpp.rst b/modules/python/doc/rst/coming_from_cpp.rst index 18b4191a6b..b358014430 100644 --- a/modules/python/doc/rst/coming_from_cpp.rst +++ b/modules/python/doc/rst/coming_from_cpp.rst @@ -1,2 +1,157 @@ -Differences with the C++ +.. _CPP guide: + +Differences with C++ ViSP ============================== + +In this section, we highlight the differences with writing ViSP code in C++. + +Module structure +----------------------------- + +The overall module structure remains the same. +What was, in C++, referred as :code:`visp3/core/*` can now be accessed as :python:`visp.core.*` in Python. +Note that before this works in Python, you need to :python:`import visp` + + +Naming convention +----------------------------- + +In C++, each class has the prefix `vp`. In Python, this prefix has been dropped as imports can be aliased and full names can be used. + +.. testcode:: + + import visp.core + from visp.core import Matrix as vpMatrix # if the name clashes with another lib + + m = vpMatrix() + vec = visp.core.ColVector(10) # Use the full name, explicit visp use + + + +Importing a class +---------------------------- + +The syntax to import a ViSP class into the current scope is different. + +In C++, including a header file pulls everything in it (functions and classes). + + +In the ViSP Python API, no distinction is made between the different headers: everything is at the same level in the package hierarchy. +In Python, you can import a single symbol. + +Thus, if a single header contains two symbols in ViSP, you will need to import both on the Python side. + +Below, the difference in syntax between C++ and Python on imports is illustrated: + +.. tab-set:: + + .. tab-item:: C++ + :sync: cpp + + .. code-block:: cpp + + #include + #include + #include + + + .. tab-item:: Python + :sync: python + + .. testcode:: + + from visp.core import ImageConvert + from visp.core import ColVector, Matrix # Grouping relevant imports + + +You can also import everything from a single submodule: + +.. tab-set:: + + .. tab-item:: C++ + :sync: cpp + + .. code-block:: cpp + + #include + + + .. tab-item:: Python + :sync: python + + .. testcode:: + + from visp.core import * + + +Changes in function parameters +-------------------------------------- + +For some functions, the Python API differs from the C++ one, mainly in the input arguments and return type. + +Due to python considering basic types as immutable, it is no longer possible to modify them passing their reference to a function call. + +Thus, we have made the choice to modify the functions such that these immutable types, if they are modified, are returned along with the original type. + +This encompasses other types, such as lists (std::vector), and dictionaries (maps) + + +Naively translating the use of :code:`convertPoint` from C++: + +.. testcode:: error_args + + from visp.core import PixelMeterConversion, CameraParameters + cam = CameraParameters(600, 600, 320, 240) + u, v = 240, 320 + x, y = 0, 0 + PixelMeterConversion.convertPoint(cam, u, v, x, y) # WRONG: C++-like version, using references to modify x and y + +Would lead to an error such as: + +.. testoutput:: error_args + :options: -ELLIPSIS, +NORMALIZE_WHITESPACE, +IGNORE_EXCEPTION_DETAIL + + Traceback (most recent call last): + File "", line 1, in + TypeError: convertPoint(): incompatible function arguments. The following argument types are supported: + 1. (cam: _visp.core.CameraParameters, u: float, v: float) -> Tuple[float, float] + 2. (cam: _visp.core.CameraParameters, iP: _visp.core.ImagePoint) -> Tuple[float, float] + + Invoked with: Camera parameters for perspective projection without distortion: + px = 600 py = 600 + u0 = 320 v0 = 240 + , 240, 320, 0, 0 + +Because this function has been modified to return a tuple of :code:`Tuple[float, float]` (the x and y values). +The x and y arguments are no longer accepted, as they are output only. + +Thus, the correct function call is: + +.. testcode:: error_args + + from visp.core import PixelMeterConversion, CameraParameters + cam = CameraParameters(600, 600, 320, 240) + u, v = 240, 320 + x, y = PixelMeterConversion.convertPoint(cam, u, v) + + +If you have such errors, it is recommended that you look at the Python :ref:`API reference` for the function and look at its signature. + + + +.. tab-set:: + + .. tab-item:: C++ + :sync: cpp + + .. code-block:: cpp + + #include + + + .. tab-item:: Python + :sync: python + + .. testcode:: + + from visp.core import * diff --git a/modules/python/doc/rst/dev/config.rst b/modules/python/doc/rst/dev/config.rst new file mode 100644 index 0000000000..e0775eebc1 --- /dev/null +++ b/modules/python/doc/rst/dev/config.rst @@ -0,0 +1,2 @@ +Configuration files +==================== diff --git a/modules/python/doc/rst/dev/custom_bindings.rst b/modules/python/doc/rst/dev/custom_bindings.rst new file mode 100644 index 0000000000..ec34cb9062 --- /dev/null +++ b/modules/python/doc/rst/dev/custom_bindings.rst @@ -0,0 +1,2 @@ +Adding a custom function binding +================================= diff --git a/modules/python/doc/rst/dev/dev.rst b/modules/python/doc/rst/dev/dev.rst new file mode 100644 index 0000000000..2ee80f093f --- /dev/null +++ b/modules/python/doc/rst/dev/dev.rst @@ -0,0 +1,13 @@ +.. _Development guide: + +Modifying and contributing to the bindings +==================== + +.. toctree:: + :glob: + :maxdepth: 2 + + how.rst + config.rst + custom_bindings.rst + python_side.rst diff --git a/modules/python/doc/rst/dev/how.rst b/modules/python/doc/rst/dev/how.rst new file mode 100644 index 0000000000..31bb1d3823 --- /dev/null +++ b/modules/python/doc/rst/dev/how.rst @@ -0,0 +1,2 @@ +How bindings are generated +=========================== diff --git a/modules/python/doc/rst/dev/python_side.rst b/modules/python/doc/rst/dev/python_side.rst new file mode 100644 index 0000000000..0122871cf6 --- /dev/null +++ b/modules/python/doc/rst/dev/python_side.rst @@ -0,0 +1,2 @@ +Adding a Python side improvement +================================= diff --git a/modules/python/doc/rst/known_issues.rst b/modules/python/doc/rst/known_issues.rst index cd33877295..d991af0d1e 100644 --- a/modules/python/doc/rst/known_issues.rst +++ b/modules/python/doc/rst/known_issues.rst @@ -1,7 +1,24 @@ -List of todos +.. _Known issues: + +Known issues ====================== -What remains to be done +We are aware of some issues remaining + + +No implicit conversion from ViSP types to Numpy +------------------------------------------------- + + +ViSP 3rd party types (such as cv::Mat) cannot be used from Python +------------------------------------------------- + +Cannot inherit from ViSP +------------------------------------------------ + + + + Changes to ViSP ------------------ diff --git a/modules/python/doc/rst/python_api/conversions.rst b/modules/python/doc/rst/python_api/conversions.rst index 43e386f1e0..d66db575d5 100644 --- a/modules/python/doc/rst/python_api/conversions.rst +++ b/modules/python/doc/rst/python_api/conversions.rst @@ -99,7 +99,7 @@ Thus, this code will not work: ValueError: assignment destination is read-only >>> T = HomogeneousMatrix() - >>> R.numpy()[0, 1] = 1.0 + >>> T.numpy()[0, 1] = 1.0 Traceback (most recent call last): File "", line 1, in ValueError: assignment destination is read-only diff --git a/modules/python/doc/rst/python_api/python_api.rst b/modules/python/doc/rst/python_api/python_api.rst new file mode 100644 index 0000000000..3e803a1885 --- /dev/null +++ b/modules/python/doc/rst/python_api/python_api.rst @@ -0,0 +1,10 @@ +.. _Python API guide: + +General ViSP + Python help +==================== + +.. toctree:: + :glob: + :maxdepth: 2 + + conversions.rst diff --git a/modules/python/doc/rst/tutorials/ibvs.rst b/modules/python/doc/rst/tutorials/ibvs.rst new file mode 100644 index 0000000000..9fe61b2ffe --- /dev/null +++ b/modules/python/doc/rst/tutorials/ibvs.rst @@ -0,0 +1,2 @@ +Simulated Image-Based visual servoing +=================================== diff --git a/modules/python/doc/rst/tutorials/pbvs.rst b/modules/python/doc/rst/tutorials/pbvs.rst new file mode 100644 index 0000000000..50e04a169a --- /dev/null +++ b/modules/python/doc/rst/tutorials/pbvs.rst @@ -0,0 +1,2 @@ +Simulated Pose-Based visual servoing +=================================== diff --git a/modules/python/doc/rst/python_api.rst b/modules/python/doc/rst/tutorials/tutorials.rst similarity index 55% rename from modules/python/doc/rst/python_api.rst rename to modules/python/doc/rst/tutorials/tutorials.rst index a49cb65a90..f26ab19243 100644 --- a/modules/python/doc/rst/python_api.rst +++ b/modules/python/doc/rst/tutorials/tutorials.rst @@ -1,8 +1,11 @@ -Python tips +.. _Tutorials: + +Tutorials ==================== .. toctree:: :glob: :maxdepth: 2 - python_api/conversions.rst + ibvs.rst + pbvs.rst From b8a3ecf3828cf51e74ca044823e94cb97ac484cc Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Fri, 8 Dec 2023 13:15:20 +0100 Subject: [PATCH 159/169] doc: more numpy examples --- modules/python/doc/index.rst | 33 ++++--- .../python/doc/rst/python_api/conversions.rst | 89 +++++++++++++++---- 2 files changed, 90 insertions(+), 32 deletions(-) diff --git a/modules/python/doc/index.rst b/modules/python/doc/index.rst index e227c22780..077870ee73 100644 --- a/modules/python/doc/index.rst +++ b/modules/python/doc/index.rst @@ -38,28 +38,29 @@ Other, more general resources, are available: * Results and demonstrations can be seen on the `ViSP YouTube channel `_ -Disclaimer -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.. note:: -This documentation does not cover the full capabilities of ViSP. Please see the C++ documentation, which contains: + This documentation does not cover the full capabilities of ViSP. Please see the C++ documentation, which contains: -* `Tutorials `_ on: + * `Tutorials `_ on: - * The core concepts: linear algebra, image processing, etc. - * Visual servoing with 3D, 2D or photometric features - * Object pose estimation and tracking + * The core concepts: linear algebra, image processing, etc. + * Visual servoing with 3D, 2D or photometric features + * Object pose estimation and tracking - * With the model-based tracker (MBT) :py:class:`visp.mbt.MbGenericTracker` - * With MegaPose, a deep learning approach to pose estimation :py:class:`visp.dnn_tracker.Megapose` + * With the model-based tracker (MBT) :py:class:`visp.mbt.MbGenericTracker` + * With MegaPose, a deep learning approach to pose estimation :py:class:`visp.dnn_tracker.MegaPose` -* `Examples `_ + * `Examples `_ - * Demonstrating basic feature usage - * Servoing on specific robotics platforms - * Tracking + * Demonstrating basic feature usage + * Servoing on specific robotics platforms + * Tracking -There are still issues with these generated bindings: see :ref:`Known issues` +.. warning:: + + There are still issues with these generated bindings: see :ref:`Known issues`. Getting started @@ -67,10 +68,8 @@ Getting started If you are transitioning from C++, please have a look at the :ref:`CPP guide` to understand the differences between the Python and C++ versions. - For general ViSP + Python guidance, see the :ref:`Python API guide`. - For tutorials on specific features: see :ref:`Tutorials`. Finally, if you wish to browse the full ViSP class documentation, go to the :ref:`API reference`. @@ -79,4 +78,4 @@ Finally, if you wish to browse the full ViSP class documentation, go to the :ref Customizing, extending and contributing to the bindings -------------------------------------------------------- -If you wish to contribute, extend or modify the bindings for your own needs, please read the :ref:`Development guide` +If you wish to contribute, extend or modify the bindings for your own needs, please read :ref:`Development guide` diff --git a/modules/python/doc/rst/python_api/conversions.rst b/modules/python/doc/rst/python_api/conversions.rst index d66db575d5..acdf5f5116 100644 --- a/modules/python/doc/rst/python_api/conversions.rst +++ b/modules/python/doc/rst/python_api/conversions.rst @@ -17,19 +17,28 @@ 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. +they are foreign to all the other Python libraries. 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. -From ViSP to NumPy +NumPy <-> ViSP ----------------------------------------- -Obtaining a view of a ViSP object + +Mapping between NumPy arrays and ViSP types +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + + + +Acquiring a view of a ViSP object ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +You can view + To reinterpret a supported ViSP object as a Numpy array, use either: .. doctest:: @@ -66,19 +75,10 @@ or >>> np.all(np_vec == list_representation) False -To obtain a copy of the ViSP representation you can simply use: - -.. doctest:: - - >>> from visp.core import ColVector - >>> import numpy as np + >>> np_vec[:2] = 0.0 # Modifying the NumPy array modifies the ViSP object + >>> vec[0] == 0.0 and vec[1] = 0.0 + True - >>> vec = ColVector(3, 0) - >>> np_vec = vec.numpy().copy() # or np.array(vec, copy=True) - >>> np_vec[0] = 1 - - >>> np_vec[0] == vec[0] - False Note that with these methods, some ViSP objects cannot be modified. That is the case for :py:class:`visp.core.HomogeneousMatrix` and :py:class:`visp.core.RotationMatrix`, where an undesired modification @@ -105,9 +105,68 @@ Thus, this code will not work: ValueError: assignment destination is read-only +Obtaining a copy of the data +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +To obtain a copy of the ViSP representation you can simply use: + +.. doctest:: + + >>> from visp.core import ColVector + >>> import numpy as np + + >>> vec = ColVector(3, 0) + >>> np_vec = vec.numpy().copy() # or np.array(vec, copy=True) + >>> np_vec[0] = 1 + + >>> np_vec[0] == vec[0] + False + + +Keep in mind that it may be preferable to use a copy of the data, especially if you are using both numpy and ViSP representations for different tasks at the same time + +For instance, the following code will lead to an undesired behaviour: + +.. testcode:: + + from visp.core import ColVector + import numpy as np + + def compute_velocity(velocity) -> None: + # Dummy function to illustrate in place + velocity *= 2.0 # This code modifies the content of velocity + + velocity = ColVector(6, 0.1) + iteration = 0 + # Store the velocities in a list + log_data: List[np.ndarray] = [] + + # Servoing loop + while iteration < 10: + compute_velocity(v) + log_data.append(v.numpy()) + iteration += 1 + + # Do some logging... + print(log_data[0]) + print(log_data[-1]) + +.. test_output:: + + array([0.1, 0.1, 0.1, 0.1, 0.1, 0.1]) + array([0.1, 0.1, 0.1, 0.1, 0.1, 0.1]) + + +Although we're multiplying the velocity by 2 at each iteration, +we can see that we have the same values for the first and last iterations. +In essence, this is because while we store 10 different NumPy arrays, they all share the same underlying storage. +This storage is, at each iteration, modified by the :python:`compute_velocity` function. +To remedy, you can either: +* Make a copy of the NumPy array at every iteration before storing it in the list +* Change the :python:`compute_velocity` to return a new :py:class:`visp.core.ColVector` From 4663d693194c5b1549a27296eb83c114d8381290 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Fri, 8 Dec 2023 15:20:14 +0100 Subject: [PATCH 160/169] Fixed bug where in place operators returned a new value --- .../python/doc/rst/python_api/conversions.rst | 78 +++++++++++-------- .../generator/visp_python_bindgen/header.py | 6 +- 2 files changed, 48 insertions(+), 36 deletions(-) diff --git a/modules/python/doc/rst/python_api/conversions.rst b/modules/python/doc/rst/python_api/conversions.rst index acdf5f5116..992cadf0d6 100644 --- a/modules/python/doc/rst/python_api/conversions.rst +++ b/modules/python/doc/rst/python_api/conversions.rst @@ -41,42 +41,51 @@ You can view To reinterpret a supported ViSP object as a Numpy array, use either: -.. doctest:: +.. testcode:: - >>> 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 - >>> np.all(np_vec == list_representation) - True + print(np.all(np_vec == list_representation)) + + + vec *= 2.0 + print(np.all(np_vec == list_representation)) - >>> vec *= 2.0 - >>> np.all(np_vec == list_representation) +.. testoutput:: + + True False + or -.. doctest:: +.. testcode:: - >>> 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 = np.array(vec, copy=False) # 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 = np.array(vec, copy=False) # A 1D numpy array of size 3 - >>> np.all(np_vec == list_representation) - True + print(np.all(np_vec == list_representation)) + # Modifying the ViSP vector modifies the NumPy view + vec *= 2.0 + print(np.all(np_vec == list_representation)) - >>> vec *= 2.0 # Modifying the ViSP vector modifies the NumPy view - >>> np.all(np_vec == list_representation) - False + # Modifying the NumPy array modifies the ViSP object + np_vec[:2] = 0.0 + print(vec[0] == 0.0 and vec[1] == 0.0) + +.. testoutput:: - >>> np_vec[:2] = 0.0 # Modifying the NumPy array modifies the ViSP object - >>> vec[0] == 0.0 and vec[1] = 0.0 + True + False True @@ -86,20 +95,23 @@ may lead to an invalid representation (Such as a rotation matrix not conserving Thus, this code will not work: -.. doctest:: - :options: +IGNORE_EXCEPTION_DETAIL +.. testcode:: - >>> from visp.core import RotationMatrix, HomogeneousMatrix - >>> import numpy as np + from visp.core import RotationMatrix, HomogeneousMatrix + import numpy as np + + R = RotationMatrix() + R.numpy()[0, 1] = 1.0 + + T = HomogeneousMatrix() + T.numpy()[0, 1] = 1.0 + +.. testoutput:: + :options: +IGNORE_EXCEPTION_DETAIL - >>> R = RotationMatrix() - >>> R.numpy()[0, 1] = 1.0 Traceback (most recent call last): File "", line 1, in ValueError: assignment destination is read-only - - >>> T = HomogeneousMatrix() - >>> T.numpy()[0, 1] = 1.0 Traceback (most recent call last): File "", line 1, in ValueError: assignment destination is read-only @@ -139,7 +151,7 @@ For instance, the following code will lead to an undesired behaviour: velocity = ColVector(6, 0.1) iteration = 0 # Store the velocities in a list - log_data: List[np.ndarray] = [] + log_data = [] # Servoing loop while iteration < 10: diff --git a/modules/python/generator/visp_python_bindgen/header.py b/modules/python/generator/visp_python_bindgen/header.py index 90d00b10cb..d9e9e9da0a 100644 --- a/modules/python/generator/visp_python_bindgen/header.py +++ b/modules/python/generator/visp_python_bindgen/header.py @@ -377,7 +377,7 @@ def add_method_doc_to_pyargs(method: types.Method, py_arg_strs: List[str]) -> Li for cpp_op, python_op_name in unary_return_ops.items(): if method_name == f'operator{cpp_op}': operator_str = f''' -{python_ident}.def("__{python_op_name}__", []({"const" if method_is_const else ""} {name_cpp}& self) {{ +{python_ident}.def("__{python_op_name}__", []({"const" if method_is_const else ""} {name_cpp}& self) -> {return_type_str} {{ return {cpp_op}self; }}, {", ".join(py_args)});''' add_to_method_dict(f'__{python_op_name}__', MethodBinding(operator_str, is_static=False, is_lambda=True, @@ -389,7 +389,7 @@ def add_method_doc_to_pyargs(method: types.Method, py_arg_strs: List[str]) -> Li for cpp_op, python_op_name in binary_return_ops.items(): if method_name == f'operator{cpp_op}': operator_str = f''' -{python_ident}.def("__{python_op_name}__", []({"const" if method_is_const else ""} {name_cpp}& self, {params_strs[0]} o) {{ +{python_ident}.def("__{python_op_name}__", []({"const" if method_is_const else ""} {name_cpp}& self, {params_strs[0]} o) -> {return_type_str} {{ return (self {cpp_op} o); }}, {", ".join(py_args)});''' add_to_method_dict(f'__{python_op_name}__', MethodBinding(operator_str, is_static=False, is_lambda=True, @@ -398,7 +398,7 @@ def add_method_doc_to_pyargs(method: types.Method, py_arg_strs: List[str]) -> Li for cpp_op, python_op_name in binary_in_place_ops.items(): if method_name == f'operator{cpp_op}': operator_str = f''' -{python_ident}.def("__{python_op_name}__", []({"const" if method_is_const else ""} {name_cpp}& self, {params_strs[0]} o) {{ +{python_ident}.def("__{python_op_name}__", []({"const" if method_is_const else ""} {name_cpp}& self, {params_strs[0]} o) -> {return_type_str} {{ self {cpp_op} o; return self; }}, {", ".join(py_args)});''' From f063903b2892c926dd1b75662fe2dcbe1d09d3cb Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Fri, 8 Dec 2023 17:53:07 +0100 Subject: [PATCH 161/169] fix conversion doc --- .../python/doc/rst/python_api/conversions.rst | 119 ++++++++++++++---- 1 file changed, 94 insertions(+), 25 deletions(-) diff --git a/modules/python/doc/rst/python_api/conversions.rst b/modules/python/doc/rst/python_api/conversions.rst index 992cadf0d6..412efba1d8 100644 --- a/modules/python/doc/rst/python_api/conversions.rst +++ b/modules/python/doc/rst/python_api/conversions.rst @@ -23,7 +23,7 @@ For most scientific computing libraries, the standard data representation is bas Since most libraries will accept and manipulate these arrays, ViSP provides conversion functions. -NumPy <-> ViSP +NumPy ↔ ViSP ----------------------------------------- @@ -31,13 +31,53 @@ NumPy <-> ViSP Mapping between NumPy arrays and ViSP types ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Here, we give the list of all supported NumPy-convertible types + +.. list-table:: Core math types + :header-rows: 1 + + * - Python type + - NumPy Shape and dtype + * - :py:class:`visp.core.Matrix` + - (N, M), np.float64 + * - :py:class:`visp.core.ColVector` + - (M,), np.float64 + * - :py:class:`visp.core.RowVector` + - (N,), np.float64 + * - :py:class:`visp.core.RotationMatrix` + - (3, 3), np.float64 + * - :py:class:`visp.core.HomogeneousMatrix` + - (4, 4), np.float64 + * - :py:class:`visp.core.ThetaUVector` + - (3,), np.float64 + +.. list-table:: Core image types + :header-rows: 1 + + * - C++ type + - Python type + - NumPy Shape and dtype + * - :code:`vpImage` + - :py:class:`visp.core.ImageGray` + - (H, W), np.uint8 + * - :code:`vpImage` + - :py:class:`visp.core.ImageUInt16` + - (H, W), np.uint16 + * - :code:`vpImage` + - :py:class:`visp.core.ImageRGBa` + - (H, W, 4), np.uint8 + * - :code:`vpImage` + - :py:class:`visp.core.ImageRGBf` + - (H, W, 3), np.float32 Acquiring a view of a ViSP object ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -You can view +It is possible to view a ViSP object as a NumPy array. When using a view, changes made to one representation is reflected in the other. + +See `the NumPy documentation `_ for more information. To reinterpret a supported ViSP object as a Numpy array, use either: @@ -117,21 +157,24 @@ Thus, this code will not work: ValueError: assignment destination is read-only -Obtaining a copy of the data +Copying to a NumPy array ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ To obtain a copy of the ViSP representation you can simply use: -.. doctest:: +.. testcode:: + + from visp.core import ColVector + import numpy as np + + vec = ColVector(3, 0) + np_vec = vec.numpy().copy() # or np.array(vec, copy=True) + np_vec[0] = 1 - >>> from visp.core import ColVector - >>> import numpy as np + print(np_vec[0] == vec[0]) - >>> vec = ColVector(3, 0) - >>> np_vec = vec.numpy().copy() # or np.array(vec, copy=True) - >>> np_vec[0] = 1 +.. testoutput:: - >>> np_vec[0] == vec[0] False @@ -144,43 +187,69 @@ For instance, the following code will lead to an undesired behaviour: from visp.core import ColVector import numpy as np - def compute_velocity(velocity) -> None: - # Dummy function to illustrate in place + def compute_velocity(velocity: ColVector) -> None: + # Dummy function to illustrate in place ops velocity *= 2.0 # This code modifies the content of velocity - velocity = ColVector(6, 0.1) + velocity = ColVector(6, 1.0) iteration = 0 # Store the velocities in a list log_data = [] # Servoing loop while iteration < 10: - compute_velocity(v) - log_data.append(v.numpy()) + compute_velocity(velocity) + log_data.append(velocity.numpy()) iteration += 1 # Do some logging... print(log_data[0]) print(log_data[-1]) -.. test_output:: +.. testoutput:: - array([0.1, 0.1, 0.1, 0.1, 0.1, 0.1]) - array([0.1, 0.1, 0.1, 0.1, 0.1, 0.1]) + [1024. 1024. 1024. 1024. 1024. 1024.] + [1024. 1024. 1024. 1024. 1024. 1024.] Although we're multiplying the velocity by 2 at each iteration, we can see that we have the same values for the first and last iterations. -In essence, this is because while we store 10 different NumPy arrays, they all share the same underlying storage. -This storage is, at each iteration, modified by the :python:`compute_velocity` function. -To remedy, you can either: +.. warning:: + + In essence, this is because while we store 10 different NumPy arrays, they all share the same underlying storage. + This storage is, at each iteration, modified by the :python:`compute_velocity` function. + +.. note:: + + To remedy this, you can either: + + * Make a copy of the NumPy array at every iteration before storing it in the list :python:`log_data.append(velocity.numpy().copy())` + * Change the :python:`compute_velocity` to return a new :py:class:`visp.core.ColVector` -* Make a copy of the NumPy array at every iteration before storing it in the list -* Change the :python:`compute_velocity` to return a new :py:class:`visp.core.ColVector` +Building a ViSP object from a NumPy array +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +In the above section, we have shown how to convert a ViSP representation to a NumPy array. + +To perform the inverse operation, a custom constructor is defined for each class that allows the Numpy -> ViSP conversion. + +This constructor performs a **copy** of the NumPy data into the newly created ViSP object. + +For instance, to build a new matrix + + +.. testsetup:: + + from visp.core import Matrix + import numpy as np + + +.. testcode:: + random_mat = np.random.rand(10, 10) # 10 x 10 random matrix -Potential issues --------------------- + mat = Matrix(random_mat) + print(mat.getRows(), mat.getCols()) From aa9571c103435d0f40b506f0a56c9c025a651b15 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Mon, 11 Dec 2023 18:10:56 +0100 Subject: [PATCH 162/169] Documenting realsense usage, Numpy indexing --- modules/python/bindings/include/mbt.hpp | 10 +- modules/python/doc/rst/coming_from_cpp.rst | 22 +--- .../python/doc/rst/dev/custom_bindings.rst | 3 + .../python/doc/rst/python_api/conversions.rst | 110 ++++++++++++++++-- .../python/doc/rst/python_api/python_api.rst | 3 +- .../rst/python_api/python_specific_fns.rst | 40 +++++++ 6 files changed, 159 insertions(+), 29 deletions(-) create mode 100644 modules/python/doc/rst/python_api/python_specific_fns.rst diff --git a/modules/python/bindings/include/mbt.hpp b/modules/python/bindings/include/mbt.hpp index 849a0984bc..2dc974c728 100644 --- a/modules/python/bindings/include/mbt.hpp +++ b/modules/python/bindings/include/mbt.hpp @@ -69,7 +69,15 @@ void bindings_vpMbGenericTracker(py::class_ &py mapOfVectorPtrs[p.first] = &(p.second); } self.track(mapOfImages, mapOfVectorPtrs, mapOfWidths, mapOfHeights); - }); + }, R"doc( +Perform tracking, with point clouds being represented as numpy arrays + +:param mapOfImages: Dictionary mapping from a camera name to a grayscale image + +:param: mapOfPointclouds: Dictionary mapping from a camera name to a point cloud. +A point cloud is represented as a H x W x 3 double NumPy array. + +)doc", py::arg("mapOfImages"), py::arg("mapOfPointclouds")); } #endif diff --git a/modules/python/doc/rst/coming_from_cpp.rst b/modules/python/doc/rst/coming_from_cpp.rst index b358014430..00f96b2db5 100644 --- a/modules/python/doc/rst/coming_from_cpp.rst +++ b/modules/python/doc/rst/coming_from_cpp.rst @@ -104,7 +104,8 @@ Naively translating the use of :code:`convertPoint` from C++: cam = CameraParameters(600, 600, 320, 240) u, v = 240, 320 x, y = 0, 0 - PixelMeterConversion.convertPoint(cam, u, v, x, y) # WRONG: C++-like version, using references to modify x and y + # WRONG: C++-like version, using references to modify x and y + PixelMeterConversion.convertPoint(cam, u, v, x, y) Would lead to an error such as: @@ -136,22 +137,3 @@ Thus, the correct function call is: If you have such errors, it is recommended that you look at the Python :ref:`API reference` for the function and look at its signature. - - - -.. tab-set:: - - .. tab-item:: C++ - :sync: cpp - - .. code-block:: cpp - - #include - - - .. tab-item:: Python - :sync: python - - .. testcode:: - - from visp.core import * diff --git a/modules/python/doc/rst/dev/custom_bindings.rst b/modules/python/doc/rst/dev/custom_bindings.rst index ec34cb9062..df29eb24e6 100644 --- a/modules/python/doc/rst/dev/custom_bindings.rst +++ b/modules/python/doc/rst/dev/custom_bindings.rst @@ -1,2 +1,5 @@ +.. _Custom binding: + + Adding a custom function binding ================================= diff --git a/modules/python/doc/rst/python_api/conversions.rst b/modules/python/doc/rst/python_api/conversions.rst index 412efba1d8..86a877bfc2 100644 --- a/modules/python/doc/rst/python_api/conversions.rst +++ b/modules/python/doc/rst/python_api/conversions.rst @@ -234,22 +234,118 @@ Building a ViSP object from a NumPy array In the above section, we have shown how to convert a ViSP representation to a NumPy array. -To perform the inverse operation, a custom constructor is defined for each class that allows the Numpy -> ViSP conversion. +To perform the inverse operation, a custom constructor is defined for each class that allows the Numpy → ViSP conversion. This constructor performs a **copy** of the NumPy data into the newly created ViSP object. For instance, to build a new matrix - -.. testsetup:: +.. testcode:: from visp.core import Matrix import numpy as np - -.. testcode:: - - random_mat = np.random.rand(10, 10) # 10 x 10 random matrix + random_mat = np.random.rand(5, 10) # 10 x 10 random matrix mat = Matrix(random_mat) print(mat.getRows(), mat.getCols()) + print(np.all(random_mat == mat)) + + # We built a matrix by copying the numpy array: modifying one does not impact the other + random_mat[:, 0] = 0 + print(np.all(random_mat == mat)) + +.. testoutput:: + + 5 10 + True + False + + +.. warning:: + + A way to build a ViSP object as a view of a NumPy array is still lacking + +Numpy-like indexing of ViSP arrays +^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + + +Using RealSense cameras with ViSP +--------------------------------------- + +In the C++ version of ViSP, a class is provided to work with Intel cameras such as the D435. +This class, that acts as a thin wrapper around the Realsense libraries, cannot be used in Python. + +Instead we recommend to use the Python wrapper provided by Intel, :code:`pyrealsense2`. + +You can install it with: + + python -m pip install pyrealsense2 + +This library allows us to acquire frames from the camera. +It is possible to convert them to a numpy representation, +and they can thus be used with ViSP. + +The code below demonstrates how to use the Realsense package with ViSP: + +.. code-block:: python + + import pyrealsense2 as rs + import numpy as np + from visp.core import CameraParameters + from visp.core import ImageRGBa, ImageUInt16, ImageGray + from visp.core import ImageConvert, Display + from visp.gui import DisplayX + + def cam_from_rs_profile(profile) -> CameraParameters: + '''Get camera intrinsics from the realsense framework''' + # Downcast to video_stream_profile and fetch intrinsics + intr = profile.as_video_stream_profile().get_intrinsics() + return CameraParameters(intr.fx, intr.fy, intr.ppx, intr.ppy) + + if __name__ == '__main__': + + # Initialize realsense2 + pipe = rs.pipeline() + config = rs.config() + fps = 60 + h, w = 480, 640 + config.enable_stream(rs.stream.depth, w, h, rs.format.z16, fps) + config.enable_stream(rs.stream.color, w, h, rs.format.rgba8, fps) + + cfg = pipe.start(config) + + I_gray = ImageGray(h, w) + display_gray = DisplayX() + display_gray.init(I_gray, 0, 0, 'Color') + I_depth_hist = ImageGray(h, w) + display_depth = DisplayX() + display_depth.init(I_depth_hist, 640, 0, 'Color') + + + # Retrieve intrinsics + cam_color = cam_from_rs_profile(cfg.get_stream(rs.stream.color)) + cam_depth = cam_from_rs_profile(cfg.get_stream(rs.stream.depth)) + + point_cloud_computer = rs.pointcloud() + while True: + frames = pipe.wait_for_frames() + color_frame = frames.get_color_frame() + depth_frame = frames.get_depth_frame() + # NumPy Representations of realsense frames + I_color_np = np.asanyarray(color_frame.as_frame().get_data()) + I_depth_np = np.asanyarray(depth_frame.as_frame().get_data()) + # ViSP representations + I_color = ImageRGBa(I_color_np) # This works because format is rs.format.rgba8, otherwise concat or conversion needed + I_depth = ImageUInt16(I_depth_np) + # Transform depth frame as point cloud and view it as an N x 3 numpy array + point_cloud = np.asanyarray(point_cloud_computer.calculate(depth_frame).get_vertices()).view((np.float32, 3)) + + ImageConvert.convert(I_color, I_gray) + ImageConvert.createDepthHistogram(I_depth, I_depth_hist) + + Display.display(I_gray) + Display.display(I_depth_hist) + Display.flush(I_gray) + Display.flush(I_depth_hist) diff --git a/modules/python/doc/rst/python_api/python_api.rst b/modules/python/doc/rst/python_api/python_api.rst index 3e803a1885..1723647565 100644 --- a/modules/python/doc/rst/python_api/python_api.rst +++ b/modules/python/doc/rst/python_api/python_api.rst @@ -1,6 +1,6 @@ .. _Python API guide: -General ViSP + Python help +Python specific features and help ==================== .. toctree:: @@ -8,3 +8,4 @@ General ViSP + Python help :maxdepth: 2 conversions.rst + python_specific_fns.rst diff --git a/modules/python/doc/rst/python_api/python_specific_fns.rst b/modules/python/doc/rst/python_api/python_specific_fns.rst new file mode 100644 index 0000000000..68dab97e67 --- /dev/null +++ b/modules/python/doc/rst/python_api/python_specific_fns.rst @@ -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. From 8aa16c95bc1f7ed90ef27c350a5320b815a3899f Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Tue, 12 Dec 2023 00:22:11 +0100 Subject: [PATCH 163/169] rework sphinx build --- modules/python/doc/CMakeLists.txt | 65 ++++++++++++++----- .../python/doc/rst/python_api/conversions.rst | 19 ++++++ 2 files changed, 69 insertions(+), 15 deletions(-) diff --git a/modules/python/doc/CMakeLists.txt b/modules/python/doc/CMakeLists.txt index 66be5e73de..b0b2ace936 100644 --- a/modules/python/doc/CMakeLists.txt +++ b/modules/python/doc/CMakeLists.txt @@ -1,15 +1,4 @@ - - -# configured documentation tools and intermediate build results -set(BINARY_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/_build") - -# Sphinx cache with pickled ReST documents -set(SPHINX_CACHE_DIR "${CMAKE_CURRENT_BINARY_DIR}/_doctrees") - -# HTML output directory -set(SPHINX_HTML_DIR "${VISP_DOC_DIR}/python") - -############################################################################# +############################################################################ # # ViSP, open source Visual Servoing Platform software. # Copyright (C) 2005 - 2023 by Inria. All rights reserved. @@ -44,9 +33,21 @@ set(SPHINX_HTML_DIR "${VISP_DOC_DIR}/python") # ############################################################################# +# configured documentation tools and intermediate build results +set(BINARY_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/_build") + +# Sphinx cache with pickled ReST documents +set(SPHINX_CACHE_DIR "${CMAKE_CURRENT_BINARY_DIR}/_doctrees") + +# HTML output directory +set(SPHINX_HTML_DIR "${VISP_DOC_DIR}/python") + +set(SPHINX_SOURCE_DIR "${${CMAKE_CURRENT_BINARY_DIR}/_src}") + # Sphinx Template directory set(SPHINX_TEMPLATE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/_templates") + configure_file( "${CMAKE_CURRENT_SOURCE_DIR}/conf.py.in" "${BINARY_BUILD_DIR}/conf.py" @@ -61,21 +62,55 @@ endforeach() configure_file( "${CMAKE_CURRENT_SOURCE_DIR}/api.rst.in" - "${CMAKE_CURRENT_SOURCE_DIR}/api.rst" + "${BINARY_BUILD_DIR}/api.rst" @ONLY ) +set(SPHINX_INPUT_SOURCE_DIRS + "_static" + "rst" + "_templates" +) + +set(generated_deps "") + +foreach(source_dir ${SPHINX_INPUT_SOURCE_DIRS}) + set(output_dir "${BINARY_BUILD_DIR}/${source_dir}") + add_custom_command( + OUTPUT "${output_dir}" + COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMAKE_CURRENT_SOURCE_DIR}/${source_dir}" "${output_dir}" + ) + list(APPEND generated_deps "${output_dir}") +endforeach() +add_custom_command( + OUTPUT "${BINARY_BUILD_DIR}/examples" + COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMAKE_CURRENT_SOURCE_DIR}/../examples" "${BINARY_BUILD_DIR}/examples" +) +list(APPEND generated_deps "${BINARY_BUILD_DIR}/examples") + +set(SPHINX_INPUT_SOURCE_FILES + "index.rst" +) +foreach(source_file ${SPHINX_INPUT_SOURCE_FILES}) + set(output_file "${BINARY_BUILD_DIR}/${source_file}") + add_custom_command( + OUTPUT "${output_file}" + COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/${source_file}" "${BINARY_BUILD_DIR}" + ) + list(APPEND generated_deps "${output_file}") +endforeach() + add_custom_target(visp_python_bindings_doc COMMAND ${PYTHON3_EXECUTABLE} -m pip install -q -r "${CMAKE_CURRENT_SOURCE_DIR}/requirements.txt" - COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMAKE_CURRENT_SOURCE_DIR}/_static" "${BINARY_BUILD_DIR}/_static" COMMAND ${PYTHON3_EXECUTABLE} -m sphinx -b html -c "${BINARY_BUILD_DIR}" -d "${SPHINX_CACHE_DIR}" -j 8 -E - "${CMAKE_CURRENT_SOURCE_DIR}" + "${BINARY_BUILD_DIR}" "${SPHINX_HTML_DIR}" + DEPENDS "${generated_deps}" COMMENT "Building Sphinx HTML documentation for ViSP's Python bindings" ) diff --git a/modules/python/doc/rst/python_api/conversions.rst b/modules/python/doc/rst/python_api/conversions.rst index 86a877bfc2..5197eceab7 100644 --- a/modules/python/doc/rst/python_api/conversions.rst +++ b/modules/python/doc/rst/python_api/conversions.rst @@ -269,6 +269,25 @@ For instance, to build a new matrix Numpy-like indexing of ViSP arrays ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +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.] Using RealSense cameras with ViSP From c30025e20d44105cb47a4a38f4addf8d49df383b Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Tue, 12 Dec 2023 18:39:30 +0100 Subject: [PATCH 164/169] fix copying files on make doc --- modules/python/CMakeLists.txt | 11 ++--- modules/python/doc/CMakeLists.txt | 42 +++++++++++++------ modules/python/doc/rst/dev/config.rst | 4 +- modules/python/doc/rst/dev/dev.rst | 2 +- modules/python/doc/rst/dev/how.rst | 2 +- .../python/doc/rst/python_api/conversions.rst | 2 +- .../python/doc/rst/python_api/python_api.rst | 2 +- .../rst/python_api/python_specific_fns.rst | 27 +----------- modules/python/doc/rst/tutorials/ibvs.rst | 5 ++- modules/python/doc/rst/tutorials/pbvs.rst | 2 +- 10 files changed, 49 insertions(+), 50 deletions(-) diff --git a/modules/python/CMakeLists.txt b/modules/python/CMakeLists.txt index a9dd7781b5..b5aa701ece 100644 --- a/modules/python/CMakeLists.txt +++ b/modules/python/CMakeLists.txt @@ -115,17 +115,18 @@ add_subdirectory(bindings) # Step 4: Copy stubs dir and install stubs for autocompletion add_subdirectory(stubs) -# Step 5: Build documentation -if(BUILD_PYTHON_BINDINGS_DOC) - add_subdirectory(doc) -endif() - # Global target: compile and install the Python bindings add_custom_target( visp_python_bindings DEPENDS visp_python_bindings_stubs ) +# Step 5: Build documentation +if(BUILD_PYTHON_BINDINGS_DOC) + add_subdirectory(doc) +endif() + + # Export Variables to parent cmake set(VISP_PYTHON_BOUND_MODULES "") foreach(module ${python_bound_modules}) diff --git a/modules/python/doc/CMakeLists.txt b/modules/python/doc/CMakeLists.txt index b0b2ace936..0e2dee9377 100644 --- a/modules/python/doc/CMakeLists.txt +++ b/modules/python/doc/CMakeLists.txt @@ -74,19 +74,37 @@ set(SPHINX_INPUT_SOURCE_DIRS set(generated_deps "") +# Copy all the source subdirectories: we're building in the cmake build folder, not in the cmake folder foreach(source_dir ${SPHINX_INPUT_SOURCE_DIRS}) set(output_dir "${BINARY_BUILD_DIR}/${source_dir}") + set(input_dir "${CMAKE_CURRENT_SOURCE_DIR}/${source_dir}") + file(GLOB_RECURSE files RELATIVE "${input_dir}" "${input_dir}/*") + foreach(f ${files}) + add_custom_command( + OUTPUT "${output_dir}/${f}" + COMMAND ${CMAKE_COMMAND} -E copy_if_different "${input_dir}/${f}" "${output_dir}/${f}" + MAIN_DEPENDENCY "${input_dir}/${f}" + COMMENT "Copying ${f}") + list(APPEND generated_deps "${input_dir}/${f}" "${output_dir}/${f}") + endforeach() +endforeach() + +set(output_dir "${BINARY_BUILD_DIR}/examples") +set(input_dir "${CMAKE_CURRENT_SOURCE_DIR}/../examples") +file(GLOB_RECURSE files RELATIVE "${input_dir}" "${input_dir}/*") +foreach(f ${files}) add_custom_command( - OUTPUT "${output_dir}" - COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMAKE_CURRENT_SOURCE_DIR}/${source_dir}" "${output_dir}" - ) - list(APPEND generated_deps "${output_dir}") + OUTPUT "${output_dir}/${f}" + COMMAND ${CMAKE_COMMAND} -E copy_if_different "${input_dir}/${f}" "${output_dir}/${f}" + MAIN_DEPENDENCY "${input_dir}/${f}" + COMMENT "Copying ${f}") + list(APPEND generated_deps "${input_dir}/${f}" "${output_dir}/${f}") endforeach() -add_custom_command( - OUTPUT "${BINARY_BUILD_DIR}/examples" - COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMAKE_CURRENT_SOURCE_DIR}/../examples" "${BINARY_BUILD_DIR}/examples" -) -list(APPEND generated_deps "${BINARY_BUILD_DIR}/examples") + + +message("${generated_deps}") + + set(SPHINX_INPUT_SOURCE_FILES "index.rst" @@ -95,7 +113,7 @@ foreach(source_file ${SPHINX_INPUT_SOURCE_FILES}) set(output_file "${BINARY_BUILD_DIR}/${source_file}") add_custom_command( OUTPUT "${output_file}" - COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/${source_file}" "${BINARY_BUILD_DIR}" + COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/${source_file}" "${BINARY_BUILD_DIR}" ) list(APPEND generated_deps "${output_file}") endforeach() @@ -110,8 +128,8 @@ add_custom_target(visp_python_bindings_doc -E "${BINARY_BUILD_DIR}" "${SPHINX_HTML_DIR}" - DEPENDS "${generated_deps}" + DEPENDS ${generated_deps} COMMENT "Building Sphinx HTML documentation for ViSP's Python bindings" ) -add_dependencies(visp_python_bindings_doc visp_python_bindings_install) +add_dependencies(visp_python_bindings_doc visp_python_bindings) diff --git a/modules/python/doc/rst/dev/config.rst b/modules/python/doc/rst/dev/config.rst index e0775eebc1..da5f06ad09 100644 --- a/modules/python/doc/rst/dev/config.rst +++ b/modules/python/doc/rst/dev/config.rst @@ -1,2 +1,4 @@ Configuration files -==================== +====================== + +JSON config file description diff --git a/modules/python/doc/rst/dev/dev.rst b/modules/python/doc/rst/dev/dev.rst index 2ee80f093f..e602fde58c 100644 --- a/modules/python/doc/rst/dev/dev.rst +++ b/modules/python/doc/rst/dev/dev.rst @@ -1,7 +1,7 @@ .. _Development guide: Modifying and contributing to the bindings -==================== +============================================ .. toctree:: :glob: diff --git a/modules/python/doc/rst/dev/how.rst b/modules/python/doc/rst/dev/how.rst index 31bb1d3823..ebc95a77d0 100644 --- a/modules/python/doc/rst/dev/how.rst +++ b/modules/python/doc/rst/dev/how.rst @@ -1,2 +1,2 @@ How bindings are generated -=========================== +===================================== diff --git a/modules/python/doc/rst/python_api/conversions.rst b/modules/python/doc/rst/python_api/conversions.rst index 5197eceab7..51747f4925 100644 --- a/modules/python/doc/rst/python_api/conversions.rst +++ b/modules/python/doc/rst/python_api/conversions.rst @@ -267,7 +267,7 @@ For instance, to build a new matrix A way to build a ViSP object as a view of a NumPy array is still lacking Numpy-like indexing of ViSP arrays -^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ViSP data types now support numpy-like indexing, and methods like slicing and iterating on values. diff --git a/modules/python/doc/rst/python_api/python_api.rst b/modules/python/doc/rst/python_api/python_api.rst index 1723647565..d24e43f007 100644 --- a/modules/python/doc/rst/python_api/python_api.rst +++ b/modules/python/doc/rst/python_api/python_api.rst @@ -1,7 +1,7 @@ .. _Python API guide: Python specific features and help -==================== +================================== .. toctree:: :glob: diff --git a/modules/python/doc/rst/python_api/python_specific_fns.rst b/modules/python/doc/rst/python_api/python_specific_fns.rst index 68dab97e67..7c33d258a3 100644 --- a/modules/python/doc/rst/python_api/python_specific_fns.rst +++ b/modules/python/doc/rst/python_api/python_specific_fns.rst @@ -3,32 +3,7 @@ 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.] - - +To add other custom functionalities :ref:`Custom binding`. Core module diff --git a/modules/python/doc/rst/tutorials/ibvs.rst b/modules/python/doc/rst/tutorials/ibvs.rst index 9fe61b2ffe..07e573259d 100644 --- a/modules/python/doc/rst/tutorials/ibvs.rst +++ b/modules/python/doc/rst/tutorials/ibvs.rst @@ -1,2 +1,5 @@ Simulated Image-Based visual servoing -=================================== +======================================= + +.. literalinclude:: /examples/ibvs-four-points.py + :language: python diff --git a/modules/python/doc/rst/tutorials/pbvs.rst b/modules/python/doc/rst/tutorials/pbvs.rst index 50e04a169a..14c51167d0 100644 --- a/modules/python/doc/rst/tutorials/pbvs.rst +++ b/modules/python/doc/rst/tutorials/pbvs.rst @@ -1,2 +1,2 @@ Simulated Pose-Based visual servoing -=================================== +====================================== From f09113e4953ff5350a56177a065c4f4952b69b56 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Wed, 13 Dec 2023 00:36:41 +0100 Subject: [PATCH 165/169] Add return_policy and keep alive options, log when returning a reference in generator --- modules/python/config/visual_features.json | 66 ++++++++++++++++++- .../visp_python_bindgen/gen_report.py | 25 ++++++- .../generator/visp_python_bindgen/methods.py | 49 ++++++++++++-- .../visp_python_bindgen/submodule.py | 8 ++- 4 files changed, 134 insertions(+), 14 deletions(-) diff --git a/modules/python/config/visual_features.json b/modules/python/config/visual_features.json index f221a84895..8e345d95d6 100644 --- a/modules/python/config/visual_features.json +++ b/modules/python/config/visual_features.json @@ -1,5 +1,7 @@ { - "ignored_headers": ["vpFeatureException.h"], + "ignored_headers": [ + "vpFeatureException.h" + ], "classes": { "vpGenericFeature": { "methods": [ @@ -20,8 +22,66 @@ } ] }, - "vpFeatureMomentDatabase": { + "vpFeatureMomentDatabase": {}, + "vpFeatureMomentCommon": { + "methods": [ + { + "static": false, + "signature": "vpFeatureMomentAlpha& getFeatureAlpha()", + "return_policy": "reference", + "keep_alive": [1, 0], + "returns_ref_ok": true + }, + { + "static": false, + "signature": "vpFeatureMomentAreaNormalized& getFeatureAn()", + "return_policy": "reference", + "keep_alive": [1,0], + "returns_ref_ok": true + }, + { + "static": false, + "signature": "vpFeatureMomentBasic& getFeatureMomentBasic()", + "return_policy": "reference", + "keep_alive": [1,0], + "returns_ref_ok": true + }, + { + "static": false, + "signature": "vpFeatureMomentCentered& getFeatureCentered()", + "return_policy": "reference", + "keep_alive": [1,0], + "returns_ref_ok": true + }, + { + "static": false, + "signature": "vpFeatureMomentCInvariant& getFeatureCInvariant()", + "return_policy": "reference", + "keep_alive": [1,0], + "returns_ref_ok": true + }, + { + "static": false, + "signature": "vpFeatureMomentGravityCenterNormalized& getFeatureGravityNormalized()", + "return_policy": "reference", + "keep_alive": [1,0], + "returns_ref_ok": true + }, + { + "static": false, + "signature": "vpFeatureMomentArea& getFeatureArea()", + "return_policy": "reference", + "keep_alive": [1,0], + "returns_ref_ok": true + }, + { + "static": false, + "signature": "vpFeatureMomentGravityCenter& getFeatureGravityCenter()", + "return_policy": "reference", + "keep_alive": [1,0], + "returns_ref_ok": true + } + ] } - } } diff --git a/modules/python/generator/visp_python_bindgen/gen_report.py b/modules/python/generator/visp_python_bindgen/gen_report.py index f01dc51e20..659772aed1 100644 --- a/modules/python/generator/visp_python_bindgen/gen_report.py +++ b/modules/python/generator/visp_python_bindgen/gen_report.py @@ -51,6 +51,8 @@ def __init__(self, submodule: 'Submodule'): self.submodule_name = submodule.name self.result = { 'ignored_headers': [], + 'returns_ref': [], + 'holds_pointer_or_ref': [], 'classes': {}, 'methods': {}, 'default_param_policy_methods': [], @@ -102,6 +104,24 @@ def add_default_policy_method(self, cls_name: str, method: types.Method, signatu 'possible_fixes': proposed_help } self.result['default_param_policy_methods'].append(report_dict) + def add_method_returning_ref(self, cls_name: str, method: types.Method, signature: str) -> None: + proposed_help = [ + { + 'static': method.static, + 'signature': signature, + 'return_policy': 'reference', + 'keep_alive': [[1, 0]], + 'returns_ref_ok': True + }, + ] + report_dict = { + 'reason': 'Method returns a reference: this can lead to memory leaks or unwarranted copies. Ensure that keep_alive and return_policy are correctly set. If ok, set return_ref_ok to True', + 'signature': signature, + 'static': method.static, + 'class': cls_name, + 'possible_fixes': proposed_help + } + self.result['returns_ref'].append(report_dict) def write(self, path: Path) -> None: print('=' * 50) @@ -109,8 +129,9 @@ def write(self, path: Path) -> None: stats = [ f'Ignored headers: {len(self.result["ignored_headers"])}', f'Ignored classes: {len(self.result["classes"].keys())}', - f'Not generated methods: {len(self.result["methods"].keys())}', - f'Method with default parameter policy: {len(self.result["default_param_policy_methods"])}', + f'Ignored methods: {len(self.result["methods"].keys())}', + f'Methods with default parameter policy: {len(self.result["default_param_policy_methods"])}', + f'Methods returning a reference: {len(self.result["returns_ref"])}', ] print('\n\t', '\n\t'.join(stats), '\n', sep='') with open(path, 'w') as report_file: diff --git a/modules/python/generator/visp_python_bindgen/methods.py b/modules/python/generator/visp_python_bindgen/methods.py index 62a555d47f..a688e8766e 100644 --- a/modules/python/generator/visp_python_bindgen/methods.py +++ b/modules/python/generator/visp_python_bindgen/methods.py @@ -231,6 +231,10 @@ def define_method(method: types.Method, method_config: Dict, is_class_method, sp py_method_name = method_config.get('custom_name') or method_name return_type = get_type(method.return_type, specs, header_env.mapping) + method_signature = get_method_signature(method_name, + get_type(method.return_type, {}, header_env.mapping), + [get_type(param.type, {}, header_env.mapping) for param in method.parameters]) + # Detect input and output parameters for a method use_default_param_policy = method_config['use_default_param_policy'] param_is_input, param_is_output = method_config['param_is_input'], method_config['param_is_output'] @@ -238,11 +242,34 @@ def define_method(method: types.Method, method_config: Dict, is_class_method, sp param_is_input = [True for _ in range(len(method.parameters))] param_is_output = list(map(lambda param: is_non_const_ref_to_immutable_type(param.type), method.parameters)) if any(param_is_output): # Emit a warning when using default policy - method_signature = get_method_signature(method_name, - get_type(method.return_type, {}, header_env.mapping), - [get_type(param.type, {}, header_env.mapping) for param in method.parameters]) header.submodule.report.add_default_policy_method(bound_object.cpp_no_template_name, method, method_signature, param_is_input, param_is_output) + + # Pybind arguments + # Only use py::arg for input values (error otherwise) py_arg_strs = [py_arg_strs[i] for i in range(len(params_strs)) if param_is_input[i]] + + pybind_options = py_arg_strs + # Custom return policy + return_policy = method_config.get('return_policy') + if return_policy is not None: + pybind_options.append(f'py::return_value_policy::{return_policy}') + + # Keep alive values: avoid memory leaks + keep_alives = method_config.get('keep_alive') + keep_alive_strs = [] + if keep_alives is not None: + def make_keep_alive_str(values) -> str: + assert len(values) == 2 and isinstance(values[0], int) and isinstance(values[1], int), 'Tried to make keep alive with incorrect values' + return f'py::keep_alive<{values[0]}, {values[1]}>()' + if not isinstance(keep_alives, list) or len(keep_alives) == 0: + raise RuntimeError(f'Keep alive value should be a list of int or a list of list of ints (multiple args kept alive), but got {keep_alives} for method {method_signature}') + if isinstance(keep_alives[0], int): + keep_alive_strs.append(make_keep_alive_str(keep_alives)) + else: + for keep_alive in keep_alives: + keep_alive_strs.append(make_keep_alive_str(keep_alive)) + pybind_options.extend(keep_alive_strs) + # Get parameter names param_names = [param.name or 'arg' + str(i) for i, param in enumerate(method.parameters)] input_param_names = [param_names[i] for i in range(len(param_is_input)) if param_is_input[i]] @@ -265,11 +292,19 @@ def define_method(method: types.Method, method_config: Dict, is_class_method, sp if method_doc is None: logging.warning(f'Could not find documentation for {bound_object.cpp_name}::{method_name}!') else: - py_arg_strs = [method_doc.documentation] + py_arg_strs + pybind_options = [method_doc.documentation] + pybind_options + + # If a function has refs to immutable params, we need to return them. + # Also true if user has specified input cpp params as output python params should_wrap_for_tuple_return = param_is_output is not None and any(param_is_output) + # Emit a warning when returnin a ref to an object: + # this can probably lead to memory leaks or unwanted object copies (and thus undesired behaviour down the line) + if not should_wrap_for_tuple_return and '&' in return_type and not (method_config.get('returns_ref_ok') or False): + header.submodule.report.add_method_returning_ref(bound_object.cpp_no_template_name, method, method_signature) + # Arguments that are inputs to the lambda function that wraps the ViSP function input_param_types = [params_strs[i] for i in range(len(param_is_input)) if param_is_input[i]] params_with_names = [t + ' ' + name for t, name in zip(input_param_types, input_param_names)] @@ -304,7 +339,7 @@ def define_method(method: types.Method, method_config: Dict, is_class_method, sp else: # When returning a tuple we need to explicitly convert references to pointer. # This is required since std::tuple will upcast the ref to its base class and try to store a copy of the object - # If a class is pure virtual, this is not possible and will a compilation error! + # If a class is pure virtual, this is not possible and will raise a compilation error! output_param_symbols.extend(['&' + name if is_ref else name for is_ref, name in zip(output_param_is_ref, output_param_names)]) return_str = f'std::make_tuple({", ".join(output_param_symbols)})' @@ -323,9 +358,9 @@ def define_method(method: types.Method, method_config: Dict, is_class_method, sp else: method_body_str = ref_to_function(bound_object.cpp_name + method_name, return_type, params_strs) - method_str = method_def(py_method_name, method_body_str, py_arg_strs, method.static if is_class_method else False) + method_str = method_def(py_method_name, method_body_str, pybind_options, method.static if is_class_method else False) method_str = f'{bound_object.python_ident}.{method_str};' - return method_str, MethodData(py_method_name, method, lambda_variant, py_arg_strs) + return method_str, MethodData(py_method_name, method, lambda_variant, pybind_options) def define_constructor(params: List[str], additional_args: List[str]) -> str: additional_args_str = ', '.join(additional_args) diff --git a/modules/python/generator/visp_python_bindgen/submodule.py b/modules/python/generator/visp_python_bindgen/submodule.py index 3e1f811aa7..05bcb42dbd 100644 --- a/modules/python/generator/visp_python_bindgen/submodule.py +++ b/modules/python/generator/visp_python_bindgen/submodule.py @@ -174,6 +174,7 @@ def get_user_defined_headers(self) -> List[str]: header_names = self.config['user_defined_headers'] return [f'#include "{header_name}"' for header_name in header_names] return [] + def get_required_headers(self) -> List[str]: if 'required_headers' in self.config: header_names = self.config['required_headers'] @@ -210,11 +211,14 @@ def get_enum_config(self, enum_name: str) -> Optional[Dict]: def get_method_config(self, class_name: Optional[str], method, owner_specs, header_mapping) -> Dict: res = { 'ignore': False, - 'use_default_param_policy': False, + 'use_default_param_policy': False, # Handling 'param_is_input': None, 'param_is_output': None, 'custom_name': None, - 'custom_code': None + 'custom_code': None, + 'keep_alive': None, + 'return_policy': None, + 'returns_ref_ok': False, } functions_container = None keys = ['classes', class_name, 'methods'] if class_name is not None else ['functions'] From e7b3d87bca6307545f7e7e737af30db223285a71 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Wed, 13 Dec 2023 17:53:06 +0100 Subject: [PATCH 166/169] Configuration doc, custom image representation, find and warn about reference holders --- .../python/bindings/include/core/images.hpp | 38 ++++ modules/python/config/core.json | 2 +- modules/python/doc/CMakeLists.txt | 20 +- modules/python/doc/index.rst | 2 +- modules/python/doc/rst/dev/config.rst | 191 +++++++++++++++++- .../python/doc/rst/dev/custom_bindings.rst | 2 - .../rst/python_api/python_specific_fns.rst | 9 +- .../rst/tutorials/tracking/realsense-mbt.rst | 11 + .../rst/tutorials/tracking/synthetic-mbt.rst | 12 ++ .../python/doc/rst/tutorials/tutorials.rst | 22 +- .../doc/rst/tutorials/{ => vs}/ibvs.rst | 0 .../doc/rst/tutorials/{ => vs}/pbvs.rst | 3 + .../visp_python_bindgen/gen_report.py | 15 ++ .../generator/visp_python_bindgen/header.py | 13 +- .../generator/visp_python_bindgen/utils.py | 3 + 15 files changed, 317 insertions(+), 26 deletions(-) create mode 100644 modules/python/doc/rst/tutorials/tracking/realsense-mbt.rst create mode 100644 modules/python/doc/rst/tutorials/tracking/synthetic-mbt.rst rename modules/python/doc/rst/tutorials/{ => vs}/ibvs.rst (100%) rename modules/python/doc/rst/tutorials/{ => vs}/pbvs.rst (51%) diff --git a/modules/python/bindings/include/core/images.hpp b/modules/python/bindings/include/core/images.hpp index 8d09c3d491..53e0a08e19 100644 --- a/modules/python/bindings/include/core/images.hpp +++ b/modules/python/bindings/include/core/images.hpp @@ -39,6 +39,7 @@ #include #include #include +#include namespace { @@ -120,6 +121,19 @@ Construct an image by **copying** a 2D numpy array. )doc", py::arg("np_array")); define_get_item_2d_image(pyImage); + + pyImage.def("__repr__", [](const vpImage &self) -> std::string { + std::stringstream ss; + ss << ""; + return ss.str(); + }); + + pyImage.def("_visp_repr", [](const vpImage &self) -> std::string { + std::stringstream ss; + ss << self; + return ss.str(); + }, R"doc(Get the full ViSP image string representation.)doc"); + } template @@ -153,6 +167,18 @@ where the 4 denotes the red, green, blue and alpha components of the image. )doc", py::arg("np_array")); define_get_item_2d_image(pyImage); + pyImage.def("__repr__", [](const vpImage &self) -> std::string { + std::stringstream ss; + ss << ""; + return ss.str(); + }); + + pyImage.def("_visp_repr", [](const vpImage &self) -> std::string { + std::stringstream ss; + ss << self; + return ss.str(); + }, R"doc(Get the full ViSP image string representation.)doc"); + } template typename std::enable_if::value, void>::type @@ -185,6 +211,18 @@ where the 3 denotes the red, green and blue components of the image. )doc", py::arg("np_array")); define_get_item_2d_image(pyImage); + + pyImage.def("__repr__", [](const vpImage &self) -> std::string { + std::stringstream ss; + ss << ""; + return ss.str(); + }); + + pyImage.def("_visp_repr", [](const vpImage &self) -> std::string { + std::stringstream ss; + ss << self; + return ss.str(); + }, R"doc(Get the full ViSP image string representation.)doc"); } #endif diff --git a/modules/python/config/core.json b/modules/python/config/core.json index ff9937e676..1701b70c7f 100644 --- a/modules/python/config/core.json +++ b/modules/python/config/core.json @@ -56,6 +56,7 @@ ] }, "vpImage": { + "ignore_repr": true, "additional_bindings": "bindings_vpImage", "use_buffer_protocol": true, "specializations": [ @@ -147,7 +148,6 @@ "use_buffer_protocol": true, "methods": [ - { "static": true, diff --git a/modules/python/doc/CMakeLists.txt b/modules/python/doc/CMakeLists.txt index 0e2dee9377..38432bcf50 100644 --- a/modules/python/doc/CMakeLists.txt +++ b/modules/python/doc/CMakeLists.txt @@ -81,10 +81,10 @@ foreach(source_dir ${SPHINX_INPUT_SOURCE_DIRS}) file(GLOB_RECURSE files RELATIVE "${input_dir}" "${input_dir}/*") foreach(f ${files}) add_custom_command( - OUTPUT "${output_dir}/${f}" - COMMAND ${CMAKE_COMMAND} -E copy_if_different "${input_dir}/${f}" "${output_dir}/${f}" - MAIN_DEPENDENCY "${input_dir}/${f}" - COMMENT "Copying ${f}") + OUTPUT "${output_dir}/${f}" + COMMAND ${CMAKE_COMMAND} -E copy_if_different "${input_dir}/${f}" "${output_dir}/${f}" + MAIN_DEPENDENCY "${input_dir}/${f}" + ) list(APPEND generated_deps "${input_dir}/${f}" "${output_dir}/${f}") endforeach() endforeach() @@ -94,18 +94,14 @@ set(input_dir "${CMAKE_CURRENT_SOURCE_DIR}/../examples") file(GLOB_RECURSE files RELATIVE "${input_dir}" "${input_dir}/*") foreach(f ${files}) add_custom_command( - OUTPUT "${output_dir}/${f}" - COMMAND ${CMAKE_COMMAND} -E copy_if_different "${input_dir}/${f}" "${output_dir}/${f}" - MAIN_DEPENDENCY "${input_dir}/${f}" - COMMENT "Copying ${f}") + OUTPUT "${output_dir}/${f}" + COMMAND ${CMAKE_COMMAND} -E copy_if_different "${input_dir}/${f}" "${output_dir}/${f}" + MAIN_DEPENDENCY "${input_dir}/${f}" + ) list(APPEND generated_deps "${input_dir}/${f}" "${output_dir}/${f}") endforeach() -message("${generated_deps}") - - - set(SPHINX_INPUT_SOURCE_FILES "index.rst" ) diff --git a/modules/python/doc/index.rst b/modules/python/doc/index.rst index 077870ee73..349222616f 100644 --- a/modules/python/doc/index.rst +++ b/modules/python/doc/index.rst @@ -70,7 +70,7 @@ If you are transitioning from C++, please have a look at the :ref:`CPP guide` to For general ViSP + Python guidance, see the :ref:`Python API guide`. -For tutorials on specific features: see :ref:`Tutorials`. +For tutorials and examples of specific features: see :ref:`Examples`. Finally, if you wish to browse the full ViSP class documentation, go to the :ref:`API reference`. diff --git a/modules/python/doc/rst/dev/config.rst b/modules/python/doc/rst/dev/config.rst index da5f06ad09..28e26282cd 100644 --- a/modules/python/doc/rst/dev/config.rst +++ b/modules/python/doc/rst/dev/config.rst @@ -1,4 +1,189 @@ -Configuration files -====================== +Modifying the bindings through JSON configuration files +======================================================== -JSON config file description +The bindings and the generated code can be customized through JSON configuration files. +These files will be read and interpreted by the generator code. + +They are located in the :code:`modules/python/config` folder of the ViSP source code. +After modifying them, you should retrigger the build of the python bindings. + +When something cannot be resolved through configuration files, you should revert to using a :ref:`Custom binding`. + + +Root configuration file +--------------------------------------- + +The general configuration file is generated by the build system (CMake), it contains the arguments to the generator script. + +It contains: + +* The list of include directories used when compiling ViSP C++. They are used to resolve include of 3rd parties and find the **vpConfig.h** file + +* A set of preprocessor macros that will be used when parsing C++ files with the generator. These are system and compiler dependent. + +* For each module (core, imgproc, etc.), the list of header files that should be parsed. + + +A module can be ignored through the **CMakeLists.txt** configuration of the python module. + +Each module has a dedicated JSON configuration file, located in the :code:`modules/python/config` folder. + + +Module configuration +-------------------------------------------- + +Configuration files have a top-down structure: First come the general module options, +then class/enum options, and for each of those, method/value configurations. + +Module-level options +^^^^^^^^^^^^^^^^^^^^^^ + +.. code-block:: json + + { + "required_headers": ["visp3/core/vpPoint.h"], + "ignored_headers": ["vpGEMM.h", "vpDebug.h"], + "ignored_classes": ["vpException", "vpImageException"], + "user_defined_headers": ["core.hpp"], + "enums": {}, + "classes": {}, + "functions": {} + } + + +.. list-table:: Parameters + :header-rows: 1 + + * - Name + - Type + - Explanation + * - :code:`required_headers` + - List of strings + - List of full header paths. These headers are forcefully included. Should be used if for some reason, the already included ViSP headers are not sufficient. + By default, each parsed header is added to the includes of this module's binding source (.cpp file compiled with PyBind). + * - :code:`ignored_headers` + - List of strings + - List of header file names, not including the module path. Each of these headers will be **completely** skipped. + No preprocessing, no parsing, no binding generation. Useful if a header generates errors on parsing. + * - :code:`ignored_classes` + - List of strings + - List of C++ class names (without any template argument). + These classes will be ignored (but still parsed, unlike with :code:`ignored_headers`) and no binding code generated. + * - :code:`user_defined_headers` + - List of strings + - Paths to user-defined bindings that will be called when generating the overall bindings + (see class options and :ref:`Custom binding`). These paths are relative to the **modules/python/bindings/include** folder. + If a file does not exist, an error will be raised at compile time. + * - :code:`enums` + - Dictionary + - Mapping from C++ enum name to an :ref:`enum configuration `. + * - :code:`classes` + - Dictionary + - Mapping from C++ class name (untemplated) to a :ref:`class configuration `. + * - :code:`functions` + - List of dictionaries + - List of :ref:`function configuration `. These are for free functions, not class methods. + + +.. warning:: + Exceptions are not handled: they should always be placed in :code:`ignored_classes`. + + When a ViSP exception is thrown to the Python interpreter, it is converted to a RuntimeError + + +.. _Enum options: +Enum-level options +^^^^^^^^^^^^^^^^^^^ + +If an enum does not appear in the configuration dictionary, it takes on the default values of each option. + +For enums there is only a single option: :code:`"ignore"`, which is a boolean. +If this flag is true, no binding is generated for this enum. The default value is **false**. + + +.. note:: + + By design, all exported ViSP enumerations are of the arithmetic kind. + It is thus possible to do :python:`Enum.value1 | Enum.value2`. + Not all enumerations should actually behave like this, + but it is not trivial to automatically determine which require arithmetic capabalities. + + A possible improvement would be to add an :code:`arithmetic` flag to the configuration options to handle this. + +.. _Class options: +Class-level options +^^^^^^^^^^^^^^^^^^^ + +If a class does not appear in the configuration dictionary, it takes on the default value of each option. + + +.. code-block:: json + "ignored_attributes": ["myAttribute"] + "additional_bindings": "bindings_vpArray2D", + "use_buffer_protocol": true, + "specializations": [ + { + "python_name": "ArrayDouble2D", + "arguments": ["double"] + } + ] + "ignore_repr": true, + "is_virtual": true, + "methods": {} + + +.. list-table:: Parameters + :header-rows: 1 + + * - Name + - Type + - Explanation + * - :code:`ignored_attributes` + - List of strings + - List of attribute names. Each of the corresponding attributes will be ignored when generating binding code. + By default, binding code is generated only for public fields that are not pointers or other hard to translate types. + * - :code:`additional_bindings` + - String + - Name of a C++ function, defined in **User-defined binding code**. + Should be visible from the module's .cpp file and have to correct signature. + This means that the header file in which it is defined should be included in :code:`user_defined_headers`. + See :ref:`Custom binding` for more info. + * - :code:`use_buffer_protocol` + - Boolean + - Whether to add the buffer protocol to this object. This is a PyBind specific thing, + and is helpful to automatically interpret an object of this class as an iterable/array (e.g., list) on the python side. + This should be defined by hand in user-defined bindings. See the + `Pybind documentation `_ + for more info. + + * - :code:`specializations` + - List of dictionaries + - Only required for templated classes. Templating does not exist in Python, and Pybind can only generate bindings for + classes that are fully specialized. Thus, it is required to declare the specializations. + A specialization contains: the Python name of the class as well as the C++ types that will replace the generic template typenames. + The C++ types should be in the same order as the template parameters. + * - :code:`ignore_repr` + - Boolean + - In python the :python:`__repr__` method is equivalent to the :code:`operator<<(std::ostream&, Cls& self)` function + allowing to print an object in the terminal. By default, the generator tries to find the C++ defined operator to generate a Python representation. + If this is not desired, set this flag to true. You can define a custom representation through custom bindings. + + .. warning:: + Long to string representations (matrices, images) can flood the terminal. + This is problematic if this happens when Pybind throws an error for an incorrect method call + * - :code:`is_virtual` + - Boolean + - Whether to force this class to be considered as purely virtual (cannot be instanciated in Python) + + .. note:: + While most purely virtual classes are correctly detected, classes that inherit from an abstract one + but do not implement its methods are not correctly detected, which will raise an error at compile time. + It is for these cases that this flag is required. + * - :code:`methods` + - List of dictionaries + - List of :ref:`function configuration `. + + +.. _Function options: +Function-level options +^^^^^^^^^^^^^^^^^^^ diff --git a/modules/python/doc/rst/dev/custom_bindings.rst b/modules/python/doc/rst/dev/custom_bindings.rst index df29eb24e6..bbe33b1e3d 100644 --- a/modules/python/doc/rst/dev/custom_bindings.rst +++ b/modules/python/doc/rst/dev/custom_bindings.rst @@ -1,5 +1,3 @@ .. _Custom binding: - - Adding a custom function binding ================================= diff --git a/modules/python/doc/rst/python_api/python_specific_fns.rst b/modules/python/doc/rst/python_api/python_specific_fns.rst index 7c33d258a3..9ddba3a843 100644 --- a/modules/python/doc/rst/python_api/python_specific_fns.rst +++ b/modules/python/doc/rst/python_api/python_specific_fns.rst @@ -9,7 +9,12 @@ To add other custom functionalities :ref:`Custom binding`. 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.core.PixelMeterConversion` and :py:class:`~visp.core.MeterPixelConversion` both +have a vectorised implementation of :code:`convertPoint`, called :code:`convertPoints`, accepting NumPy arrays + + +MBT module +----------------------- + * :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. diff --git a/modules/python/doc/rst/tutorials/tracking/realsense-mbt.rst b/modules/python/doc/rst/tutorials/tracking/realsense-mbt.rst new file mode 100644 index 0000000000..29a05095ef --- /dev/null +++ b/modules/python/doc/rst/tutorials/tracking/realsense-mbt.rst @@ -0,0 +1,11 @@ +Tracking an object with the model-based tracker and a Realsense camera +======================================================================= + +This example shows how to track a cube object with the model-based tracker, with a realsense camera. + +This tutorial requires the data from the corresponding `C++ tutorial `_. + + + +.. literalinclude:: /examples/realsense-mbt.py + :language: python diff --git a/modules/python/doc/rst/tutorials/tracking/synthetic-mbt.rst b/modules/python/doc/rst/tutorials/tracking/synthetic-mbt.rst new file mode 100644 index 0000000000..eb156f38c9 --- /dev/null +++ b/modules/python/doc/rst/tutorials/tracking/synthetic-mbt.rst @@ -0,0 +1,12 @@ +Tracking an object in a synthetic sequence with the model-based tracker +======================================================================= + +This example shows how to track a box object with the model-based tracker. + +The data is synthetic and acquired with Blender. + +It is based on the `Blender simulation tutorial `_ + + +.. literalinclude:: /examples/synthetic-data-mbt.py + :language: python diff --git a/modules/python/doc/rst/tutorials/tutorials.rst b/modules/python/doc/rst/tutorials/tutorials.rst index f26ab19243..b166c9d656 100644 --- a/modules/python/doc/rst/tutorials/tutorials.rst +++ b/modules/python/doc/rst/tutorials/tutorials.rst @@ -1,11 +1,25 @@ -.. _Tutorials: +.. _Examples: -Tutorials +Examples ==================== + +Visual servoing +----------------------- + +.. toctree:: + :glob: + :maxdepth: 2 + + vs/* + + + +Tracking +----------------------- + .. toctree:: :glob: :maxdepth: 2 - ibvs.rst - pbvs.rst + tracking/* diff --git a/modules/python/doc/rst/tutorials/ibvs.rst b/modules/python/doc/rst/tutorials/vs/ibvs.rst similarity index 100% rename from modules/python/doc/rst/tutorials/ibvs.rst rename to modules/python/doc/rst/tutorials/vs/ibvs.rst diff --git a/modules/python/doc/rst/tutorials/pbvs.rst b/modules/python/doc/rst/tutorials/vs/pbvs.rst similarity index 51% rename from modules/python/doc/rst/tutorials/pbvs.rst rename to modules/python/doc/rst/tutorials/vs/pbvs.rst index 14c51167d0..eab6fae1f4 100644 --- a/modules/python/doc/rst/tutorials/pbvs.rst +++ b/modules/python/doc/rst/tutorials/vs/pbvs.rst @@ -1,2 +1,5 @@ Simulated Pose-Based visual servoing ====================================== + +.. literalinclude:: /examples/pbvs-four-points.py + :language: python diff --git a/modules/python/generator/visp_python_bindgen/gen_report.py b/modules/python/generator/visp_python_bindgen/gen_report.py index 659772aed1..1eb606606f 100644 --- a/modules/python/generator/visp_python_bindgen/gen_report.py +++ b/modules/python/generator/visp_python_bindgen/gen_report.py @@ -123,12 +123,27 @@ def add_method_returning_ref(self, cls_name: str, method: types.Method, signatur } self.result['returns_ref'].append(report_dict) + def add_pointer_or_ref_holder(self, cls_name: str, fieldnames: List[str]) -> None: + proposed_help = [ + { + 'acknowledge_pointer_or_ref_fields': fieldnames + }, + ] + report_dict = { + 'reason': 'This class stores a pointer or a raw reference, when interfaced with python, methods that return this reference or pointer lead to double frees or memory leaks', + 'class': cls_name, + 'possible_fixes': proposed_help + } + self.result['holds_pointer_or_ref'].append(report_dict) + def write(self, path: Path) -> None: print('=' * 50) print(f'Statistics for module {self.submodule_name}:') stats = [ f'Ignored headers: {len(self.result["ignored_headers"])}', f'Ignored classes: {len(self.result["classes"].keys())}', + f'Unacknowledged pointer/ref holders: {len(self.result["holds_pointer_or_ref"])}', + f'Ignored methods: {len(self.result["methods"].keys())}', f'Methods with default parameter policy: {len(self.result["default_param_policy_methods"])}', f'Methods returning a reference: {len(self.result["returns_ref"])}', diff --git a/modules/python/generator/visp_python_bindgen/header.py b/modules/python/generator/visp_python_bindgen/header.py index d9e9e9da0a..faa19986aa 100644 --- a/modules/python/generator/visp_python_bindgen/header.py +++ b/modules/python/generator/visp_python_bindgen/header.py @@ -513,10 +513,21 @@ def add_method_doc_to_pyargs(method: types.Method, py_arg_strs: List[str]) -> Li logging.info(f'Parsing class "{name_cpp_no_template}"') if self.submodule.class_should_be_ignored(name_cpp_no_template): - self.submodule.report.add_non_generated_class(name_cpp_no_template, {}, 'Skipped by user') return '' cls_config = self.submodule.get_class_config(name_cpp_no_template) + + # Warning for potential double frees + acknowledged_pointer_fields = cls_config.get('acknowledge_pointer_or_ref_fields') or [] + refs_or_ptr_fields = list(filter(lambda tn: '&' in tn or '*' in tn, + map(lambda field: get_type(field.type, {}, header_env.mapping), + cls.fields))) + + # If some pointer or refs are not acknowledged as existing by user, emit a warning + if len(set(refs_or_ptr_fields).difference(set(acknowledged_pointer_fields))) > 0: + self.submodule.report.add_pointer_or_ref_holder(name_cpp_no_template, refs_or_ptr_fields) + + if cls.class_decl.template is None: name_python = name_cpp_no_template.replace('vp', '') return generate_class_with_potiental_specialization(name_python, {}, cls_config) diff --git a/modules/python/generator/visp_python_bindgen/utils.py b/modules/python/generator/visp_python_bindgen/utils.py index 91fcb89def..a8c9a79302 100644 --- a/modules/python/generator/visp_python_bindgen/utils.py +++ b/modules/python/generator/visp_python_bindgen/utils.py @@ -163,6 +163,9 @@ def get_typename(typename: types.PQName, owner_specs, header_env_mapping) -> str def segment_repr(segment: types.PQNameSegment) -> str: if isinstance(segment, types.FundamentalSpecifier): return segment.name + if isinstance(segment, types.AutoSpecifier): + return segment.name + segment_name = segment.name if segment.name in owner_specs: segment_name = owner_specs[segment.name] From 3b37e098d9cedea4512ff93fcec1f6ec0c15fc24 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Thu, 14 Dec 2023 00:57:16 +0100 Subject: [PATCH 167/169] Finish config documentation --- modules/python/doc/rst/dev/config.rst | 101 +++++++++++++++++++++++++- 1 file changed, 100 insertions(+), 1 deletion(-) diff --git a/modules/python/doc/rst/dev/config.rst b/modules/python/doc/rst/dev/config.rst index 28e26282cd..15dc915c80 100644 --- a/modules/python/doc/rst/dev/config.rst +++ b/modules/python/doc/rst/dev/config.rst @@ -186,4 +186,103 @@ If a class does not appear in the configuration dictionary, it takes on the defa .. _Function options: Function-level options -^^^^^^^^^^^^^^^^^^^ +^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +.. code-block:: json + { + "signature": "vpImage& fn(vpImage&, Type, double&)", + "static": false, + "ignore": false, + "use_default_param_policy": false, + "param_is_input": [true, true, false], + "param_is_output": [false, true, true], + "return_policy": "reference", + "keep_alive": [1, 0], + "returns_ref_ok": true, + "specializations": + [ + ["unsigned char"], + ["vpRGBa"] + ], + "custom_name": "function_name" + } + +.. list-table:: Parameters + :header-rows: 1 + + * - Name + - Type + - Explanation + * - :code:`signature` + - String + - Signature of the function for which the functions apply. + + * Signature does not include the name of the parameters + * The templated types should not be replaced with specializations. + * Spaces are stripped when matching with parsed signatures + * Signature does not include the *;* + + * - :code:`static` + - Boolean + - Whether this function is static. In the case of free functions (not related to a class), it should be false. + * - :code:`ignore` + - Boolean + - Whether the binding for this method should be skipped. Defaults to false. + + .. note:: + + If you provide an alternative to this function through custom bindings, + you should set this to true so that the default is ignored or no warning is emitted + + * - :code:`use_default_param_policy` + - Boolean + - Whether to use the default parameter policy. With this policy, + non-const references (**&**) to types that are immutable in Python (including STL containers) + are considered as both inputs and outputs. Defaults to false. + If true, no warning is emitted in the logs about parameter policy + + .. note:: + + This is required since we do not know whether + the references are used as inputs or outputs (or both) of the function. + + When a parameter is an output, it is either returned (it is the only output) or it is aggregated to a result tuple. + + + * - :code:`param_is_input` + - List of booleans + - For a function with n arguments, a list of n booleans. at index i, describes whether the i-eth parameter is an input. + If false, a default value is created. + Requires that the type is default constructible. + + .. warning:: + + The basic types (int, double, etc.) are left uninitialized. + + * - :code:`param_is_output` + - List of booleans + - For a function with n arguments, a list of n booleans. at index i, describes whether the i-eth parameter is an output. + if true it is added to the return tuple. + * - :code:`return_policy` + - String + - How C++ returns the type to Python. If there are issues about unwanted copies or memory freeing, configure this. + See `The Pybind documentation `_ + * - :code:`keep_alive` + - 2-tuple of ints or List of 2-tuples + - Dictates the lifetime of arguments and return types. + Each tuple indicates that the second argument should be kept alive until the first argument is deleted. + 0 indicates the return value, 1 indicates self. + See `The pybind documentation `_ + * - :code:`returns_ref_ok` + - Boolean + - If this function returns a ref, mark it as ok or not. Returning a ref may lead to double frees or copy depending on return policy. + Make sure that :code:`keep_alive` and :code:`return_policy` are correctly set if you get a warning in the log, then set this to true to ignore the warning. + * - :code:`specializations` + - List of list of strings + - Each list of string denotes a specialization, for a templated function. For each specialization, + each string is a typename that is used to instanciate the template. + The typenames should be in the same order ar the template specification of the function. + If there are multiple specializations, the function will be overloaded. + * - :code:`custom_name` + - String + - Rename this function to another name. Especially useful in the case of both static and member functions having the same name, which is forbidden by Pybind11. From 9a3eb1736b0fca394b0aa0a878fbcb5c427f1240 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Thu, 14 Dec 2023 14:13:12 +0100 Subject: [PATCH 168/169] Auto build parallel level for python documentation --- modules/python/doc/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/python/doc/CMakeLists.txt b/modules/python/doc/CMakeLists.txt index 38432bcf50..1d21183d24 100644 --- a/modules/python/doc/CMakeLists.txt +++ b/modules/python/doc/CMakeLists.txt @@ -120,7 +120,7 @@ add_custom_target(visp_python_bindings_doc -b html -c "${BINARY_BUILD_DIR}" -d "${SPHINX_CACHE_DIR}" - -j 8 + -j auto -E "${BINARY_BUILD_DIR}" "${SPHINX_HTML_DIR}" From f666a7e5d7fa20953417c3bad270c6fb2ab315cb Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Thu, 14 Dec 2023 18:32:29 +0100 Subject: [PATCH 169/169] Fix several warnings in Python doc generation --- modules/core/include/visp3/core/vpColVector.h | 2 +- modules/python/doc/rst/dev/config.rst | 6 + .../python/doc/rst/dev/custom_bindings.rst | 1 + modules/python/doc/rst/dev/dev.rst | 85 ++++++++++++++ modules/python/doc/rst/known_issues.rst | 104 +++--------------- .../visp_python_bindgen/doc_parser.py | 61 +++++++--- 6 files changed, 152 insertions(+), 107 deletions(-) diff --git a/modules/core/include/visp3/core/vpColVector.h b/modules/core/include/visp3/core/vpColVector.h index 56111c54f3..518b461043 100644 --- a/modules/core/include/visp3/core/vpColVector.h +++ b/modules/core/include/visp3/core/vpColVector.h @@ -319,7 +319,7 @@ class VISP_EXPORT vpColVector : public vpArray2D * ofs.close(); * } * \endcode - * produces `log.csvè file that contains: + * produces `log.csv` file that contains: * \code * 0 * 1 diff --git a/modules/python/doc/rst/dev/config.rst b/modules/python/doc/rst/dev/config.rst index 15dc915c80..50f9f58736 100644 --- a/modules/python/doc/rst/dev/config.rst +++ b/modules/python/doc/rst/dev/config.rst @@ -86,12 +86,14 @@ Module-level options .. warning:: + Exceptions are not handled: they should always be placed in :code:`ignored_classes`. When a ViSP exception is thrown to the Python interpreter, it is converted to a RuntimeError .. _Enum options: + Enum-level options ^^^^^^^^^^^^^^^^^^^ @@ -111,6 +113,7 @@ If this flag is true, no binding is generated for this enum. The default value i A possible improvement would be to add an :code:`arithmetic` flag to the configuration options to handle this. .. _Class options: + Class-level options ^^^^^^^^^^^^^^^^^^^ @@ -118,6 +121,7 @@ If a class does not appear in the configuration dictionary, it takes on the defa .. code-block:: json + "ignored_attributes": ["myAttribute"] "additional_bindings": "bindings_vpArray2D", "use_buffer_protocol": true, @@ -185,10 +189,12 @@ If a class does not appear in the configuration dictionary, it takes on the defa .. _Function options: + Function-level options ^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. code-block:: json + { "signature": "vpImage& fn(vpImage&, Type, double&)", "static": false, diff --git a/modules/python/doc/rst/dev/custom_bindings.rst b/modules/python/doc/rst/dev/custom_bindings.rst index bbe33b1e3d..583404dc52 100644 --- a/modules/python/doc/rst/dev/custom_bindings.rst +++ b/modules/python/doc/rst/dev/custom_bindings.rst @@ -1,3 +1,4 @@ .. _Custom binding: + Adding a custom function binding ================================= diff --git a/modules/python/doc/rst/dev/dev.rst b/modules/python/doc/rst/dev/dev.rst index e602fde58c..a3478c4bb0 100644 --- a/modules/python/doc/rst/dev/dev.rst +++ b/modules/python/doc/rst/dev/dev.rst @@ -11,3 +11,88 @@ Modifying and contributing to the bindings config.rst custom_bindings.rst python_side.rst + + + +Remaining work +----------------------- + +In this section, we list some remaining issues or work to be done. + + +Changes to ViSP C++ API +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +* Write initTracking for vpKltOpencv taking a vpImage as input. Ignore setInitialGuess. + +Code generation +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +* n-ary operators are not generated +* Matrix multiplication should be done through the @ operator (__matmul\__) +* Get operators for vpArray2D and the subclasses should be ignored, as they are reimplemented through custom bindings +* Classes that are not in the top level namespace are ignored. +* Inner classes are also ignored +* The default return policy for references is to copy, which is probably not the expected usage. ViSP sometimes returns references to STL containers, which have to be copied to Python +* Add parameters in config for: + + * GIL scope + +* Add callback for before_module and after_module so that we can define additional bindings by hand in the module. This is already done per class + +Documentation +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +* Generate documentation for: + + * Functions in namespaces etc. + +* Reference python types in Documentation +* Prefer Python examples instead of C++ ones ? + +To be written: +* Documentation for the overall workflow of the bindings generation + + +Python side +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +* UI + +* Add python sources to visp package + + * Matplotlib based plotter + + + +Errors when generating bindings +------------------------------------- + +When modifying the bindings, you may encounter errors. + +Here is a very non-exhaustive list of 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. + +Static and member methods have the same name +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +If, when importing visp in python, you encounter this message: + + ImportError: overloading a method with both static and instance methods is not supported; error while attempting to bind instance method visp.xxx() -> None + +Then it means that a class has both a static method and a member method with the same name. You should :ref:`rename either one through the config files `. + +Abstract class not detected +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +If you have this error: + + error: invalid new-expression of abstract class type ‘vpTemplateTrackerMI’ + return new Class{std::forward(args)...}; + In file included from /home/visp_ws/visp_build/modules/python/bindings/src/tt_mi.cpp:13:0: + /home/visp_ws/visp/modules/tracker/tt_mi/include/visp3/tt_mi/vpTemplateTrackerMI.h:46:19: note: because the following virtual functions are pure within ‘vpTemplateTrackerMI’: + class VISP_EXPORT vpTemplateTrackerMI : public vpTemplateTracker + +You should define the class (here vpTemplaterMI) as pure virtual in the config file (via the flag is_virtual). +This error occurs because some methods are defined as pure virtual in a parent class and are not defined in the class this class: Pure virtual class detection does not look in the class hierarchy but only at the present class. diff --git a/modules/python/doc/rst/known_issues.rst b/modules/python/doc/rst/known_issues.rst index d991af0d1e..a469289ba1 100644 --- a/modules/python/doc/rst/known_issues.rst +++ b/modules/python/doc/rst/known_issues.rst @@ -3,100 +3,28 @@ Known issues ====================== -We are aware of some issues remaining +We are aware of some remaining issues. +If you encounter another problem, please file an issue on Github. -No implicit conversion from ViSP types to Numpy -------------------------------------------------- - - -ViSP 3rd party types (such as cv::Mat) cannot be used from Python -------------------------------------------------- - -Cannot inherit from ViSP ------------------------------------------------- - - - - - -Changes to ViSP ------------------- - -* Write initTracking for vpKltOpencv taking a vpImage as input. Ignore setInitialGuess. - -Code generation -------------------- - -* There is an issue with vpFeatureMomentDatabse::get and vpMomentDatabase::get, ignored for now => a tester -* n ary operators -* Exclude get operators for vpArray2D ? -* Parse subnamespaces - - * Classes in subnamespaces are ignored +Usability +-------------------- -* Keep alive for numpy interfaces -* Keep alive very probably for mbt -* How should we handle parameters coming from external APIs ? e.g. realsense2, PCL. Can we interact with other bindings such as of opencv's -* Reimplement a framegrabber tutorial in python, with matplotlib -* Test return policy for lvalue references (automatic is copy, so this is problematic) -* Add parameters in config for: - - * Return policy (feature moments database) - * Keep alive - * GIL scope - -* Add callback for before_module and after_module so that we can define additional bindings by hand in the module. This is already done per class -* Add a way to replace a default method binding with a custom one (What about doc?) - -Documentation ----------------- -* Generate documentation for: - - * Functions in namespaces etc. - -* Reference python types in Documentation -* Prefer Python examples instead of C++ ones ? - - -To be written: -* Specific changes from C++ to Python API -* Documentation for the overall workflow of the bindings generation -* In code documentation for the generator -* Document config files - -* Failure cases - - * If you have this error: - error: invalid new-expression of abstract class type ‘vpTemplateTrackerMI’ - return new Class{std::forward(args)...}; - In file included from /home/visp_ws/visp_build/modules/python/bindings/src/tt_mi.cpp:13:0: - /home/visp_ws/visp/modules/tracker/tt_mi/include/visp3/tt_mi/vpTemplateTrackerMI.h:46:19: note: because the following virtual functions are pure within ‘vpTemplateTrackerMI’: - class VISP_EXPORT vpTemplateTrackerMI : public vpTemplateTracker - You should define the class (here vpTemplaterMI) as pure virtual in the config file (via the flag is_virtual). - This error occurs because some methods are defined as pure virtual in a parent class and are not defined in the class this class: Pure virtual class detection does not look in the class hierarchy but only at the present class. - -Packaging ------------------- - -* Root CMake - - * Build after doc if doc can be generated +No implicit conversion from ViSP types to Numpy +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Python side ------------------ -* Testing +Numpy array cannot be implicitely converted to a ViSP representation when calling a ViSP function. - * Test numpy arrays, partially done - * Test specific methods with specific returns - * Test keep alive if possible ? -* Generate some examples +ViSP 3rd party types (such as cv::Mat) cannot be used from Python +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - * Tracking (megapose/mbt) - * Frame grabbing - * UI +We do not interface with other bindings (as it is not trivial and may require specific Pybind ABI), and we do not wrap third party types. +Thus, alternatives must be provided by hand into the ViSP API (or wrapped through custom bindings) so that the functionalities can be used from Python -* Add python sources to visp package +Cannot inherit from a ViSP class in Python +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - * Matplotlib based plotter +Right now, it is not possible to inherit from a ViSP class with a Python class. Virtual methods cannot be overriden. +To remedy this, trampoline classes should be implemented into the generator, either fully automated (but that is a lot of complexity) +or by providing the trampoline by hand and adding a way to reference the trampoline class in the configuration file. diff --git a/modules/python/generator/visp_python_bindgen/doc_parser.py b/modules/python/generator/visp_python_bindgen/doc_parser.py index d6e060dc6e..4dd47d8325 100644 --- a/modules/python/generator/visp_python_bindgen/doc_parser.py +++ b/modules/python/generator/visp_python_bindgen/doc_parser.py @@ -152,31 +152,51 @@ class DocElements(object): ] def escape_for_rst(text: str) -> str: - return text + forbidden_chars = ['_', '*'] + res = text + for c in forbidden_chars: + res = res.replace(c, '\\' + c) + return res + -def process_mixed_container(container: MixedContainer, level: int, level_string='') -> str: + +def process_mixed_container(container: MixedContainer, level: int, level_string='', escape_rst=False) -> str: ''' :param level_string: the string being built for a single level (e.g. a line/paragraph of text) + This is equivalent to a left fold operation, + so don't forget to aggregate the results in level_string if you add another component ''' if container.name in IGNORED_MIXED_CONTAINERS: return level_string one_indent = ' ' * 2 indent_str = one_indent * level requires_space = not level_string.endswith(('\n', '\t', ' ')) and len(level_string) > 0 + + def process_markup(symbol: str) -> str: + text = symbol if not requires_space or len(level_string) == 0 else ' ' + symbol + for c in container.value.content_: + text = process_mixed_container(c, level, text, escape_rst=escape_rst) + text += symbol + ' ' + return text + # Inline blocks - if isinstance(container.value, str): - return level_string + escape_for_rst(container.value.replace('\n', '\n' + indent_str).strip()) + if isinstance(container.value, str) and container.name != 'verbatim': + content = container.value.replace('\n', '\n' + indent_str).strip() + if escape_rst: + content = escape_for_rst(content) + return level_string + content if container.name == 'text': - return escape_for_rst(container.value.replace('\n', '\n' + indent_str).strip()) + content = container.value.replace('\n', '\n' + indent_str).strip() + if escape_rst: + content = escape_for_rst(content) + return level_string + content if container.name == 'bold': - markup_start = '**' if not requires_space or len(level_string) == 0 else ' **' - return level_string + markup_start + container.value.valueOf_ + '** ' + return level_string + process_markup('**') if container.name == 'computeroutput': - markup_start = '`' if not requires_space or len(level_string) == 0 else ' `' - return level_string + markup_start + escape_for_rst(container.value.valueOf_) + '` ' + return level_string + process_markup('`') if container.name == 'emphasis': markup_start = '*' if not requires_space else ' *' - return level_string + markup_start + container.value.valueOf_ + '* ' + return level_string + process_markup('*') if container.name == 'sp': return level_string + ' ' if container.name == 'linebreak': @@ -204,7 +224,10 @@ def process_mixed_container(container: MixedContainer, level: int, level_string= return level_string + (' ' if requires_space else '') + container.value.valueOf_ + ' ' if container.name == 'verbatim': - raise NotImplementedError() + text = container.value + text = escape_for_rst(text) + text = '\n' * 2 + indent_str + '::\n\n' + indent_str + one_indent + text.strip().replace('\n', '\n' + indent_str + one_indent).strip() + '\n' * 2 + return level_string + text # Block types if container.name == 'simplesect': @@ -244,7 +267,7 @@ def process_mixed_container(container: MixedContainer, level: int, level_string= for h in line.highlight: c = '' for hh in h.content_: - c = process_mixed_container(hh, level, c) + c = process_mixed_container(hh, level, c, escape_rst=False) cs.append(c) s = ''.join(cs) lines.append(s) @@ -271,7 +294,7 @@ def process_paragraph(para: docParaType, level: int) -> str: res = '' contents: List[MixedContainer] = para.content_ for content_item in contents: - res = process_mixed_container(content_item, level, res) + res = process_mixed_container(content_item, level, res, escape_rst=True) return res def process_description(brief: Optional[descriptionType]) -> str: @@ -305,10 +328,10 @@ def __init__(self, path: Optional[Path], env_mapping: Dict[str, str]): for method_def in method_defs: is_const = False if method_def.const == 'no' else True is_static = False if method_def.static == 'no' else True - ret_type = ''.join(process_mixed_container(c, 0) for c in method_def.type_.content_).replace('vp_deprecated', '').replace('VISP_EXPORT', '') + ret_type = ''.join(process_mixed_container(c, 0, escape_rst=False) for c in method_def.type_.content_).replace('vp_deprecated', '').replace('VISP_EXPORT', '') param_types = [] for param in method_def.get_param(): - t = ''.join(process_mixed_container(c, 0) for c in param.type_.content_) + t = ''.join(process_mixed_container(c, 0, escape_rst=False) for c in param.type_.content_) param_types.append(t) if method_def.name == cls_name or ret_type != '': signature_str = f'{ret_type} {cls_name}::{method_def.name}({",".join(param_types)}) {{}}' @@ -368,20 +391,22 @@ def get_documentation_for_method(self, cls_name: str, signature: MethodDocSignat params_dict = self.get_method_params(method_def) cpp_return_str = self.get_method_return_str(method_def) + param_strs = [] for param_name in input_param_names: if param_name in params_dict: - param_strs.append(f':param {param_name}: {params_dict[param_name]}') + param_strs.append(f':param {escape_for_rst(param_name)}: {params_dict[param_name]}') param_str = '\n'.join(param_strs) + if len(output_param_names) > 0: return_str = ':return: A tuple containing:\n' # TODO: if we only return a single element, we should modify this if signature.ret != 'void' and signature.ret is not None: return_str += f'\n\t * {cpp_return_str}' for param_name in output_param_names: if param_name in params_dict: - return_str += f'\n\t * {param_name}: {params_dict[param_name]}' + return_str += f'\n\t * {escape_for_rst(param_name)}: {params_dict[param_name]}' else: - return_str += f'\n\t * {param_name}' + return_str += f'\n\t * {escape_for_rst(param_name)}' else: return_str = f':return: {cpp_return_str}' if len(cpp_return_str) > 0 else ''