├── LICENCE ├── README.md ├── cv_bridge ├── CHANGELOG.rst ├── CMakeLists.txt ├── cmake │ └── cv_bridge-extras.cmake.in ├── doc │ ├── conf.py │ ├── index.rst │ └── mainpage.dox ├── include │ └── cv_bridge │ │ ├── cv_bridge.h │ │ └── rgb_colors.h ├── package.xml ├── python │ ├── CMakeLists.txt │ ├── __init__.py.plain.in │ └── cv_bridge │ │ ├── __init__.py │ │ └── core.py ├── rosdoc.yaml ├── setup.py ├── src │ ├── CMakeLists.txt │ ├── boost │ │ ├── README │ │ ├── core │ │ │ └── scoped_enum.hpp │ │ ├── endian │ │ │ ├── conversion.hpp │ │ │ └── detail │ │ │ │ └── intrinsic.hpp │ │ └── predef │ │ │ ├── detail │ │ │ ├── _cassert.h │ │ │ ├── endian_compat.h │ │ │ └── test.h │ │ │ ├── library │ │ │ └── c │ │ │ │ ├── _prefix.h │ │ │ │ └── gnu.h │ │ │ ├── make.h │ │ │ ├── os │ │ │ ├── android.h │ │ │ ├── bsd.h │ │ │ ├── bsd │ │ │ │ ├── bsdi.h │ │ │ │ ├── dragonfly.h │ │ │ │ ├── free.h │ │ │ │ ├── net.h │ │ │ │ └── open.h │ │ │ ├── ios.h │ │ │ └── macos.h │ │ │ ├── other │ │ │ └── endian.h │ │ │ └── version_number.h │ ├── cv_bridge.cpp │ ├── module.cpp │ ├── module.hpp │ ├── module_opencv4.cpp │ ├── pycompat.hpp │ └── rgb_colors.cpp └── test │ ├── CMakeLists.txt │ ├── conversions.py │ ├── enumerants.py │ ├── python_bindings.py │ ├── test_compression.cpp │ ├── test_endian.cpp │ ├── test_rgb_colors.cpp │ ├── utest.cpp │ └── utest2.cpp └── iBTC ├── CMakeLists.txt ├── config ├── config_avia.yaml ├── config_avia_drone.yaml ├── config_velo_kitti_fine.yaml ├── config_velo_nclt.yaml └── config_velo_newercollege.yaml ├── description_images └── ibtc_pipeline.jpg ├── eval ├── calc_pr_overlap.m ├── calc_pr_overlap_together.m ├── hotel1 │ └── lc_gt_doc_hotel1.txt └── read_from_file.m ├── include ├── generated_64.i └── ibtc.h ├── launch ├── loop_test_rgb_avia_MARSdataset.launch ├── loop_test_rgb_avia_hkumb.launch ├── loop_test_rgb_avia_privatedata.launch ├── loop_test_rgb_kitti.launch ├── loop_test_rgb_velo_nclt.launch ├── loop_test_rgb_velo_newercollege.launch └── online_loop_test.launch ├── package.xml ├── rviz_cfg └── loop.rviz └── src ├── ibtc.cpp ├── online_rgb_loop_detection.cpp └── rgb_loop_detection.cpp /README.md: -------------------------------------------------------------------------------- 1 | # iBTC 2 | ## iBTC: An Image-assisting Binary and Triangle Combined Descriptor for Place Recognition by Fusing LiDAR and Camera Measurements [RAL2024] 3 | 4 | ## 1. Introduction 5 | **iBTC** is an improved version of BTC or STD. Rather than using only LiDAR measurements, it also integrates camera measurments for more robust loop detection performance against the scenes challenge for LiDAR measurements like long corridors. 6 |
7 | 8 |
9 | 10 | ### 1.1 Paper 11 | Our paper is available on https://ieeexplore.ieee.org/document/10720786 . 12 | 13 | ### 1.2 Demo Video 14 | Our demo video is available on TODO. . 15 | 16 | ## 2. Tested Environment 17 | ### 2.0 **Ubuntu** 18 | Our operation system is Ubuntu 18. 19 | 20 | ### 2.1 **ROS** 21 | Following this [ROS Installation](http://wiki.ros.org/ROS/Installation) to install ROS and its additional pacakge. Our ROS version is Melodic. 22 | 23 | ### 2.2 **ceres** 24 | Our ceres version is ceres-solver-1.14.0. 25 | 26 | ### 2.3 **Opencv** 27 | Our Opencv version is Opencv-4.5.3 with Opencv-contrib-4.5.3. 28 | 29 | ### 2.4 **PCL** 30 | Our pcl version is pcl-1.9. 31 | 32 | ### 2.5 **gcc/g++** 33 | Our gcc/g++ version is gcc/g++ -9. 34 | 35 | ### 2.6 **Eigen3** 36 | 37 | ### 2.7 **TBB** 38 | Our tbb: Threading Building Blocks 2019 Update 9 39 | 40 | Download it from github and build it in a folder. Link it using hard directory in iBTC CMakelist.txt. 41 | 42 | ## 3. Build 43 | Clone this repository and catkin_make: 44 | ``` 45 | cd ~/ws_iBTC/src/ 46 | git clone https://github.com/hku-mars/iBTC.git 47 | cd ../ 48 | catkin_make 49 | source ~/ws_iBTC/devel/setup.bash 50 | ``` 51 | 52 | ## 4. Run our examples 53 | Please download one set of the bag files, camera pose files, imu pose files to your computer. You can download from this link: https://connecthkuhk-my.sharepoint.com/:f:/g/personal/u3008067_connect_hku_hk/ElhEEvOhC0VHvF6xGBH41s8BTBs8WwhnhvHRGrEb5pSG8w?e=QbvxmR (password: iBTC). If the link is not available anymore, please draw an issue to tell us. 54 | 55 | Please set the SaveDir so that the program can output evaluation result and debug file to your computer. Please set bag_file imu_pose_fname cam_pose_fname in the launch file so that program find the downloaded files. Otherwise, you may see that the program is not running. 56 | 57 | Here is an example how to execute program: 58 | 59 | ``` 60 | cd ~/ws_iBTC/ 61 | source devel/setup.bash 62 | roslaunch ibtc loop_test_rgb_avia_privatedata.launch 63 | ``` 64 | Press any key to start the program. 65 | 66 | ### 4.1 Run the online example for online LVIO SLAM system 67 | In : a. registered and undistored LiDAR scan messages (/cloud_registered in PointXYZI) or undistored LiDAR scan messages (/cloud_undistort in PointXYZI) + scan pose (/aft_mapped_to_init in nav_msgs::Odometry) 68 | b. undistored image (/camera/image_color_compressed in sensor_msgs::CompressedImage) + image pose (/camera/poses_inworld in nav_msgs::Odometry) 69 | Out: loop closure transformation and pair frame ids (/loop_closure_tranformation in geometry_msgs::PoseWithCovariance) 70 | 71 | Please make sure /cloud_undistort and /aft_mapped_to_init are using the same timestamp. Please make sure /camera/image_color_compressed and /camera/poses_inworld are using the same timestamp. Please make sure the output directory SaveDir in the launch file is set. Otherwise, you may see that the program is not running. 72 | 73 | ## 4.2 Do Percision-Recall evaluation or Recall_1 evaluation 74 | Please check out iBTC/eval directory. Place your result file (like "lc_gt_doc.txt") to the correct place and run calc_pr_overlap_together.m (using Matlab). 75 | 76 | ## 5. Example results 77 | 78 | TODO. 79 | 80 | ## 6. Report our problems and bugs 81 | We know our packages might not completely stable at this stage, and we are working on improving the performance and reliability of our codes. So, if you have met any bug or problem, please feel free to draw an issue and I will respond ASAP. This code is using SSE2 acceleration and if you meet relevant problems please inform us. 82 | 83 | ## 7. Acknowledgments 84 | In the development of iBTC, we stand on the shoulders of the following repositories: 85 | STD, BTC. 86 | 87 | ## License 88 | The source code is released under [GPLv2](http://www.gnu.org/licenses/) license. 89 | 90 | If you use any code of this repo in your academic research, please cite **at least one** of our papers: 91 | ``` 92 | [1] Zou, Zuhao, et al. "iBTC: An Image-assisting Binary and Triangle Combined Descriptor for Place Recognition by Fusing LiDAR and Camera Measurements" 93 | [2] Zou, Zuhao, et al. "LTA-OM: Long-Term Association LiDAR-Inertial 94 | Odometry and Mapping" 95 | [3] Yuan, Chongjian, et al. "Std: Stable triangle descriptor for 3d place recognition" 96 | [3] Yuan, Chongjian, et al. "Btc: A binary and triangle combined descriptor for 3-d place recognition" 97 | ``` 98 | 99 | For commercial use, please contact me < zuhaozouATyahoo.com > and Dr. Fu Zhang < fuzhangAThku.hk >. 100 | -------------------------------------------------------------------------------- /cv_bridge/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.0.2) 2 | project(cv_bridge) 3 | 4 | find_package(catkin REQUIRED COMPONENTS rosconsole sensor_msgs) 5 | 6 | 7 | if(NOT ANDROID) 8 | find_package(PythonLibs 2) 9 | set(PYTHON_NUMPY_INCLUDE_DIR ~/.local/lib/python3.6/site-packages/numpy/core/include) 10 | set(PYTHON_INCLUDE_PATH /usr/include/python3.6) 11 | set(PYTHON_LIBRARIES /usr/lib/python3.6) 12 | 13 | if(PYTHONLIBS_VERSION_STRING VERSION_LESS "3.8") 14 | # Debian Buster 15 | find_package(Boost REQUIRED python3) 16 | else() 17 | # Ubuntu Focal 18 | find_package(Boost REQUIRED python3) 19 | endif() 20 | else() 21 | find_package(Boost REQUIRED) 22 | endif() 23 | 24 | # Print some message showing some of them 25 | message("##############################################") 26 | message(STATUS "OpenCV library status:") 27 | message(STATUS " version: ${OpenCV_VERSION}") 28 | message(STATUS " libraries: ${OpenCV_LIBRARIES}") 29 | message(STATUS " include path: ${OpenCV_INCLUDE_DIRS}") 30 | message("##############################################") 31 | 32 | # Print some message showing some of them 33 | message("##############################################") 34 | message(STATUS "PYTHON library status:") 35 | message(STATUS " PYTHON_VERSION_MAJOR: ${PYTHON_VERSION_MAJOR}") 36 | message(STATUS " PYTHON_VERSION_MINOR: ${PYTHON_VERSION_MINOR}") 37 | message(STATUS " include path: ${PYTHON_NUMPY_INCLUDE_DIR}") 38 | 39 | set(_opencv_version 4) 40 | find_package(OpenCV 4 QUIET) 41 | if(NOT OpenCV_FOUND) 42 | message(STATUS "Did not find OpenCV 4, trying OpenCV 3") 43 | set(_opencv_version 3) 44 | endif() 45 | 46 | find_package(OpenCV ${_opencv_version} REQUIRED 47 | COMPONENTS 48 | opencv_core 49 | opencv_imgproc 50 | opencv_imgcodecs 51 | CONFIG 52 | ) 53 | 54 | catkin_package( 55 | INCLUDE_DIRS include 56 | LIBRARIES ${PROJECT_NAME} 57 | CATKIN_DEPENDS rosconsole sensor_msgs 58 | DEPENDS OpenCV 59 | CFG_EXTRAS cv_bridge-extras.cmake 60 | ) 61 | 62 | catkin_python_setup() 63 | 64 | include_directories(include ${Boost_INCLUDE_DIRS} ${OpenCV_INCLUDE_DIRS} ${catkin_INCLUDE_DIRS}) 65 | link_directories(${Boost_LIBRARY_DIRS}) 66 | 67 | if(NOT ANDROID) 68 | add_subdirectory(python) 69 | endif() 70 | add_subdirectory(src) 71 | if(CATKIN_ENABLE_TESTING) 72 | add_subdirectory(test) 73 | endif() 74 | 75 | # install the include folder 76 | install( 77 | DIRECTORY include/${PROJECT_NAME}/ 78 | DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} 79 | ) 80 | -------------------------------------------------------------------------------- /cv_bridge/cmake/cv_bridge-extras.cmake.in: -------------------------------------------------------------------------------- 1 | set(OpenCV_VERSION @OpenCV_VERSION@) 2 | set(OpenCV_VERSION_MAJOR @OpenCV_VERSION_MAJOR@) 3 | set(OpenCV_VERSION_MINOR @OpenCV_VERSION_MINOR@) 4 | set(OpenCV_VERSION_PATCH @OpenCV_VERSION_PATCH@) 5 | set(OpenCV_SHARED @OpenCV_SHARED@) 6 | set(OpenCV_CONFIG_PATH @OpenCV_CONFIG_PATH@) 7 | set(OpenCV_INSTALL_PATH @OpenCV_INSTALL_PATH@) 8 | set(OpenCV_LIB_COMPONENTS @OpenCV_LIB_COMPONENTS@) 9 | set(OpenCV_USE_MANGLED_PATHS @OpenCV_USE_MANGLED_PATHS@) 10 | set(OpenCV_MODULES_SUFFIX @OpenCV_MODULES_SUFFIX@) 11 | 12 | 13 | -------------------------------------------------------------------------------- /cv_bridge/doc/conf.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # 3 | # cv_bridge documentation build configuration file, created by 4 | # sphinx-quickstart on Mon Jun 1 14:21:53 2009. 5 | # 6 | # This file is execfile()d with the current directory set to its containing dir. 7 | # 8 | # Note that not all possible configuration values are present in this 9 | # autogenerated file. 10 | # 11 | # All configuration values have a default; values that are commented out 12 | # serve to show the default. 13 | 14 | import sys, os 15 | 16 | # If extensions (or modules to document with autodoc) are in another directory, 17 | # add these directories to sys.path here. If the directory is relative to the 18 | # documentation root, use os.path.abspath to make it absolute, like shown here. 19 | #sys.path.append(os.path.abspath('.')) 20 | 21 | # -- General configuration ----------------------------------------------------- 22 | 23 | # Add any Sphinx extension module names here, as strings. They can be extensions 24 | # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. 25 | extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.intersphinx', 'sphinx.ext.pngmath'] 26 | 27 | # Add any paths that contain templates here, relative to this directory. 28 | templates_path = ['_templates'] 29 | 30 | # The suffix of source filenames. 31 | source_suffix = '.rst' 32 | 33 | # The encoding of source files. 34 | #source_encoding = 'utf-8' 35 | 36 | # The master toctree document. 37 | master_doc = 'index' 38 | 39 | # General information about the project. 40 | project = u'cv_bridge' 41 | copyright = u'2009, Willow Garage, Inc.' 42 | 43 | # The version info for the project you're documenting, acts as replacement for 44 | # |version| and |release|, also used in various other places throughout the 45 | # built documents. 46 | # 47 | # The short X.Y version. 48 | version = '0.1' 49 | # The full version, including alpha/beta/rc tags. 50 | release = '0.1.0' 51 | 52 | # The language for content autogenerated by Sphinx. Refer to documentation 53 | # for a list of supported languages. 54 | #language = None 55 | 56 | # There are two options for replacing |today|: either, you set today to some 57 | # non-false value, then it is used: 58 | #today = '' 59 | # Else, today_fmt is used as the format for a strftime call. 60 | #today_fmt = '%B %d, %Y' 61 | 62 | # List of documents that shouldn't be included in the build. 63 | #unused_docs = [] 64 | 65 | # List of directories, relative to source directory, that shouldn't be searched 66 | # for source files. 67 | exclude_trees = ['_build'] 68 | 69 | # The reST default role (used for this markup: `text`) to use for all documents. 70 | #default_role = None 71 | 72 | # If true, '()' will be appended to :func: etc. cross-reference text. 73 | #add_function_parentheses = True 74 | 75 | # If true, the current module name will be prepended to all description 76 | # unit titles (such as .. function::). 77 | #add_module_names = True 78 | 79 | # If true, sectionauthor and moduleauthor directives will be shown in the 80 | # output. They are ignored by default. 81 | #show_authors = False 82 | 83 | # The name of the Pygments (syntax highlighting) style to use. 84 | pygments_style = 'sphinx' 85 | 86 | # A list of ignored prefixes for module index sorting. 87 | #modindex_common_prefix = [] 88 | 89 | 90 | # -- Options for HTML output --------------------------------------------------- 91 | 92 | # The theme to use for HTML and HTML Help pages. Major themes that come with 93 | # Sphinx are currently 'default' and 'sphinxdoc'. 94 | html_theme = 'default' 95 | 96 | # Theme options are theme-specific and customize the look and feel of a theme 97 | # further. For a list of options available for each theme, see the 98 | # documentation. 99 | #html_theme_options = {} 100 | 101 | # Add any paths that contain custom themes here, relative to this directory. 102 | #html_theme_path = [] 103 | 104 | # The name for this set of Sphinx documents. If None, it defaults to 105 | # " v documentation". 106 | #html_title = None 107 | 108 | # A shorter title for the navigation bar. Default is the same as html_title. 109 | #html_short_title = None 110 | 111 | # The name of an image file (relative to this directory) to place at the top 112 | # of the sidebar. 113 | #html_logo = None 114 | 115 | # The name of an image file (within the static path) to use as favicon of the 116 | # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 117 | # pixels large. 118 | #html_favicon = None 119 | 120 | # Add any paths that contain custom static files (such as style sheets) here, 121 | # relative to this directory. They are copied after the builtin static files, 122 | # so a file named "default.css" will overwrite the builtin "default.css". 123 | #html_static_path = ['_static'] 124 | 125 | # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, 126 | # using the given strftime format. 127 | #html_last_updated_fmt = '%b %d, %Y' 128 | 129 | # If true, SmartyPants will be used to convert quotes and dashes to 130 | # typographically correct entities. 131 | #html_use_smartypants = True 132 | 133 | # Custom sidebar templates, maps document names to template names. 134 | #html_sidebars = {} 135 | 136 | # Additional templates that should be rendered to pages, maps page names to 137 | # template names. 138 | #html_additional_pages = {} 139 | 140 | # If false, no module index is generated. 141 | #html_use_modindex = True 142 | 143 | # If false, no index is generated. 144 | #html_use_index = True 145 | 146 | # If true, the index is split into individual pages for each letter. 147 | #html_split_index = False 148 | 149 | # If true, links to the reST sources are added to the pages. 150 | #html_show_sourcelink = True 151 | 152 | # If true, an OpenSearch description file will be output, and all pages will 153 | # contain a tag referring to it. The value of this option must be the 154 | # base URL from which the finished HTML is served. 155 | #html_use_opensearch = '' 156 | 157 | # If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml"). 158 | #html_file_suffix = '' 159 | 160 | # Output file base name for HTML help builder. 161 | htmlhelp_basename = 'cv_bridgedoc' 162 | 163 | 164 | # -- Options for LaTeX output -------------------------------------------------- 165 | 166 | # The paper size ('letter' or 'a4'). 167 | #latex_paper_size = 'letter' 168 | 169 | # The font size ('10pt', '11pt' or '12pt'). 170 | #latex_font_size = '10pt' 171 | 172 | # Grouping the document tree into LaTeX files. List of tuples 173 | # (source start file, target name, title, author, documentclass [howto/manual]). 174 | latex_documents = [ 175 | ('index', 'cv_bridge.tex', u'stereo\\_utils Documentation', 176 | u'James Bowman', 'manual'), 177 | ] 178 | 179 | # The name of an image file (relative to this directory) to place at the top of 180 | # the title page. 181 | #latex_logo = None 182 | 183 | # For "manual" documents, if this is true, then toplevel headings are parts, 184 | # not chapters. 185 | #latex_use_parts = False 186 | 187 | # Additional stuff for the LaTeX preamble. 188 | #latex_preamble = '' 189 | 190 | # Documents to append as an appendix to all manuals. 191 | #latex_appendices = [] 192 | 193 | # If false, no module index is generated. 194 | #latex_use_modindex = True 195 | 196 | 197 | # Example configuration for intersphinx: refer to the Python standard library. 198 | intersphinx_mapping = { 199 | 'http://docs.python.org/': None, 200 | 'http://docs.scipy.org/doc/numpy' : None, 201 | } 202 | -------------------------------------------------------------------------------- /cv_bridge/doc/index.rst: -------------------------------------------------------------------------------- 1 | cv_bridge 2 | ========= 3 | 4 | ``cv_bridge`` contains a single class :class:`CvBridge` that converts ROS Image messages to 5 | OpenCV images. 6 | 7 | .. module:: cv_bridge 8 | 9 | .. autoclass:: cv_bridge.CvBridge 10 | :members: 11 | 12 | .. autoclass:: cv_bridge.CvBridgeError 13 | 14 | Indices and tables 15 | ================== 16 | 17 | * :ref:`genindex` 18 | * :ref:`search` 19 | -------------------------------------------------------------------------------- /cv_bridge/doc/mainpage.dox: -------------------------------------------------------------------------------- 1 | /** 2 | \mainpage 3 | \htmlinclude manifest.html 4 | 5 | \b cv_bridge contains classes for easily converting between ROS 6 | sensor_msgs/Image messages and OpenCV images. 7 | 8 | \section codeapi Code API 9 | 10 | - cv_bridge::CvImage 11 | - toCvCopy() 12 | - toCvShare() 13 | 14 | */ 15 | -------------------------------------------------------------------------------- /cv_bridge/include/cv_bridge/rgb_colors.h: -------------------------------------------------------------------------------- 1 | // -*- mode: c++ -*- 2 | /********************************************************************* 3 | * Original color definition is at scikit-image distributed with 4 | * following license disclaimer: 5 | * 6 | * Copyright (C) 2011, the scikit-image team 7 | * All rights reserved. 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions are 11 | * met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 2. Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in 17 | * the documentation and/or other materials provided with the 18 | * distribution. 19 | * 3. Neither the name of skimage nor the names of its contributors may be 20 | * used to endorse or promote products derived from this software without 21 | * specific prior written permission. 22 | * 23 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 24 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 25 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 26 | * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, 27 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 28 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 29 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 31 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 32 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 33 | * POSSIBILITY OF SUCH DAMAGE. 34 | *********************************************************************/ 35 | 36 | #ifndef CV_BRIDGE_RGB_COLORS_H_ 37 | #define CV_BRIDGE_RGB_COLORS_H_ 38 | 39 | #include 40 | 41 | 42 | namespace cv_bridge 43 | { 44 | 45 | namespace rgb_colors 46 | { 47 | 48 | /** 49 | * @brief 50 | * 146 rgb colors 51 | */ 52 | enum Colors { 53 | ALICEBLUE, 54 | ANTIQUEWHITE, 55 | AQUA, 56 | AQUAMARINE, 57 | AZURE, 58 | BEIGE, 59 | BISQUE, 60 | BLACK, 61 | BLANCHEDALMOND, 62 | BLUE, 63 | BLUEVIOLET, 64 | BROWN, 65 | BURLYWOOD, 66 | CADETBLUE, 67 | CHARTREUSE, 68 | CHOCOLATE, 69 | CORAL, 70 | CORNFLOWERBLUE, 71 | CORNSILK, 72 | CRIMSON, 73 | CYAN, 74 | DARKBLUE, 75 | DARKCYAN, 76 | DARKGOLDENROD, 77 | DARKGRAY, 78 | DARKGREEN, 79 | DARKGREY, 80 | DARKKHAKI, 81 | DARKMAGENTA, 82 | DARKOLIVEGREEN, 83 | DARKORANGE, 84 | DARKORCHID, 85 | DARKRED, 86 | DARKSALMON, 87 | DARKSEAGREEN, 88 | DARKSLATEBLUE, 89 | DARKSLATEGRAY, 90 | DARKSLATEGREY, 91 | DARKTURQUOISE, 92 | DARKVIOLET, 93 | DEEPPINK, 94 | DEEPSKYBLUE, 95 | DIMGRAY, 96 | DIMGREY, 97 | DODGERBLUE, 98 | FIREBRICK, 99 | FLORALWHITE, 100 | FORESTGREEN, 101 | FUCHSIA, 102 | GAINSBORO, 103 | GHOSTWHITE, 104 | GOLD, 105 | GOLDENROD, 106 | GRAY, 107 | GREEN, 108 | GREENYELLOW, 109 | GREY, 110 | HONEYDEW, 111 | HOTPINK, 112 | INDIANRED, 113 | INDIGO, 114 | IVORY, 115 | KHAKI, 116 | LAVENDER, 117 | LAVENDERBLUSH, 118 | LAWNGREEN, 119 | LEMONCHIFFON, 120 | LIGHTBLUE, 121 | LIGHTCORAL, 122 | LIGHTCYAN, 123 | LIGHTGOLDENRODYELLOW, 124 | LIGHTGRAY, 125 | LIGHTGREEN, 126 | LIGHTGREY, 127 | LIGHTPINK, 128 | LIGHTSALMON, 129 | LIGHTSEAGREEN, 130 | LIGHTSKYBLUE, 131 | LIGHTSLATEGRAY, 132 | LIGHTSLATEGREY, 133 | LIGHTSTEELBLUE, 134 | LIGHTYELLOW, 135 | LIME, 136 | LIMEGREEN, 137 | LINEN, 138 | MAGENTA, 139 | MAROON, 140 | MEDIUMAQUAMARINE, 141 | MEDIUMBLUE, 142 | MEDIUMORCHID, 143 | MEDIUMPURPLE, 144 | MEDIUMSEAGREEN, 145 | MEDIUMSLATEBLUE, 146 | MEDIUMSPRINGGREEN, 147 | MEDIUMTURQUOISE, 148 | MEDIUMVIOLETRED, 149 | MIDNIGHTBLUE, 150 | MINTCREAM, 151 | MISTYROSE, 152 | MOCCASIN, 153 | NAVAJOWHITE, 154 | NAVY, 155 | OLDLACE, 156 | OLIVE, 157 | OLIVEDRAB, 158 | ORANGE, 159 | ORANGERED, 160 | ORCHID, 161 | PALEGOLDENROD, 162 | PALEGREEN, 163 | PALEVIOLETRED, 164 | PAPAYAWHIP, 165 | PEACHPUFF, 166 | PERU, 167 | PINK, 168 | PLUM, 169 | POWDERBLUE, 170 | PURPLE, 171 | RED, 172 | ROSYBROWN, 173 | ROYALBLUE, 174 | SADDLEBROWN, 175 | SALMON, 176 | SANDYBROWN, 177 | SEAGREEN, 178 | SEASHELL, 179 | SIENNA, 180 | SILVER, 181 | SKYBLUE, 182 | SLATEBLUE, 183 | SLATEGRAY, 184 | SLATEGREY, 185 | SNOW, 186 | SPRINGGREEN, 187 | STEELBLUE, 188 | TAN, 189 | TEAL, 190 | THISTLE, 191 | TOMATO, 192 | TURQUOISE, 193 | VIOLET, 194 | WHEAT, 195 | WHITE, 196 | WHITESMOKE, 197 | YELLOW, 198 | YELLOWGREEN, 199 | }; 200 | 201 | /** 202 | * @brief 203 | * get rgb color with enum. 204 | */ 205 | cv::Vec3d getRGBColor(const int color); 206 | 207 | } // namespace rgb_colors 208 | 209 | } // namespace cv_bridge 210 | 211 | #endif 212 | -------------------------------------------------------------------------------- /cv_bridge/package.xml: -------------------------------------------------------------------------------- 1 | 2 | cv_bridge 3 | 1.16.0 4 | 5 | This contains CvBridge, which converts between ROS 6 | Image messages and OpenCV images. 7 | 8 | Patrick Mihelich 9 | James Bowman 10 | Vincent Rabaud 11 | BSD 12 | http://www.ros.org/wiki/cv_bridge 13 | https://github.com/ros-perception/vision_opencv 14 | https://github.com/ros-perception/vision_opencv/issues 15 | 16 | 17 | 18 | 19 | 20 | catkin 21 | 22 | boost 23 | libopencv-dev 24 | python3 25 | python3-opencv 26 | rosconsole 27 | sensor_msgs 28 | 29 | boost 30 | libopencv-dev 31 | python3 32 | python3-opencv 33 | rosconsole 34 | libopencv-dev 35 | sensor_msgs 36 | 37 | rostest 38 | python3-numpy 39 | 40 | dvipng 41 | 42 | -------------------------------------------------------------------------------- /cv_bridge/python/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | configure_file(__init__.py.plain.in 2 | ${CATKIN_DEVEL_PREFIX}/${CATKIN_PACKAGE_PYTHON_DESTINATION}/boost/__init__.py 3 | @ONLY 4 | ) 5 | 6 | install(FILES ${CATKIN_DEVEL_PREFIX}/${CATKIN_PACKAGE_PYTHON_DESTINATION}/boost/__init__.py 7 | DESTINATION ${CATKIN_PACKAGE_PYTHON_DESTINATION}/boost/ 8 | ) 9 | -------------------------------------------------------------------------------- /cv_bridge/python/__init__.py.plain.in: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hku-mars/iBTC/9f3bf49e26ff254d28043e8e5d404f3348da8ef2/cv_bridge/python/__init__.py.plain.in -------------------------------------------------------------------------------- /cv_bridge/python/cv_bridge/__init__.py: -------------------------------------------------------------------------------- 1 | from .core import CvBridge, CvBridgeError 2 | 3 | # python bindings 4 | try: 5 | # This try is just to satisfy doc jobs that are built differently. 6 | from cv_bridge.boost.cv_bridge_boost import cvtColorForDisplay, getCvType 7 | except ImportError: 8 | pass 9 | -------------------------------------------------------------------------------- /cv_bridge/python/cv_bridge/core.py: -------------------------------------------------------------------------------- 1 | # Software License Agreement (BSD License) 2 | # 3 | # Copyright (c) 2011, Willow Garage, Inc. 4 | # Copyright (c) 2016, Tal Regev. 5 | # All rights reserved. 6 | # 7 | # Redistribution and use in source and binary forms, with or without 8 | # modification, are permitted provided that the following conditions 9 | # are met: 10 | # 11 | # * Redistributions of source code must retain the above copyright 12 | # notice, this list of conditions and the following disclaimer. 13 | # * Redistributions in binary form must reproduce the above 14 | # copyright notice, this list of conditions and the following 15 | # disclaimer in the documentation and/or other materials provided 16 | # with the distribution. 17 | # * Neither the name of Willow Garage, Inc. nor the names of its 18 | # contributors may be used to endorse or promote products derived 19 | # from this software without specific prior written permission. 20 | # 21 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 24 | # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 25 | # COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 26 | # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 27 | # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 28 | # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 29 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30 | # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 31 | # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 32 | # POSSIBILITY OF SUCH DAMAGE. 33 | 34 | import sensor_msgs.msg 35 | import sys 36 | 37 | 38 | class CvBridgeError(TypeError): 39 | """ 40 | This is the error raised by :class:`cv_bridge.CvBridge` methods when they fail. 41 | """ 42 | pass 43 | 44 | 45 | class CvBridge(object): 46 | """ 47 | The CvBridge is an object that converts between OpenCV Images and ROS Image messages. 48 | 49 | .. doctest:: 50 | :options: -ELLIPSIS, +NORMALIZE_WHITESPACE 51 | 52 | >>> import cv2 53 | >>> import numpy as np 54 | >>> from cv_bridge import CvBridge 55 | >>> br = CvBridge() 56 | >>> dtype, n_channels = br.encoding_as_cvtype2('8UC3') 57 | >>> im = np.ndarray(shape=(480, 640, n_channels), dtype=dtype) 58 | >>> msg = br.cv2_to_imgmsg(im) # Convert the image to a message 59 | >>> im2 = br.imgmsg_to_cv2(msg) # Convert the message to a new image 60 | >>> cmprsmsg = br.cv2_to_compressed_imgmsg(im) # Convert the image to a compress message 61 | >>> im22 = br.compressed_imgmsg_to_cv2(msg) # Convert the compress message to a new image 62 | >>> cv2.imwrite("this_was_a_message_briefly.png", im2) 63 | 64 | """ 65 | 66 | def __init__(self): 67 | import cv2 68 | self.cvtype_to_name = {} 69 | self.cvdepth_to_numpy_depth = {cv2.CV_8U: 'uint8', cv2.CV_8S: 'int8', cv2.CV_16U: 'uint16', 70 | cv2.CV_16S: 'int16', cv2.CV_32S:'int32', cv2.CV_32F:'float32', 71 | cv2.CV_64F: 'float64'} 72 | 73 | for t in ["8U", "8S", "16U", "16S", "32S", "32F", "64F"]: 74 | for c in [1, 2, 3, 4]: 75 | nm = "%sC%d" % (t, c) 76 | self.cvtype_to_name[getattr(cv2, "CV_%s" % nm)] = nm 77 | 78 | self.numpy_type_to_cvtype = {'uint8': '8U', 'int8': '8S', 'uint16': '16U', 79 | 'int16': '16S', 'int32': '32S', 'float32': '32F', 80 | 'float64': '64F'} 81 | self.numpy_type_to_cvtype.update(dict((v, k) for (k, v) in self.numpy_type_to_cvtype.items())) 82 | 83 | def dtype_with_channels_to_cvtype2(self, dtype, n_channels): 84 | return '%sC%d' % (self.numpy_type_to_cvtype[dtype.name], n_channels) 85 | 86 | def cvtype2_to_dtype_with_channels(self, cvtype): 87 | from cv_bridge.boost.cv_bridge_boost import CV_MAT_CNWrap, CV_MAT_DEPTHWrap 88 | return self.cvdepth_to_numpy_depth[CV_MAT_DEPTHWrap(cvtype)], CV_MAT_CNWrap(cvtype) 89 | 90 | def encoding_to_cvtype2(self, encoding): 91 | from cv_bridge.boost.cv_bridge_boost import getCvType 92 | 93 | try: 94 | return getCvType(encoding) 95 | except RuntimeError as e: 96 | raise CvBridgeError(e) 97 | 98 | def encoding_to_dtype_with_channels(self, encoding): 99 | return self.cvtype2_to_dtype_with_channels(self.encoding_to_cvtype2(encoding)) 100 | 101 | def compressed_imgmsg_to_cv2(self, cmprs_img_msg, desired_encoding = "passthrough"): 102 | """ 103 | Convert a sensor_msgs::CompressedImage message to an OpenCV :cpp:type:`cv::Mat`. 104 | 105 | :param cmprs_img_msg: A :cpp:type:`sensor_msgs::CompressedImage` message 106 | :param desired_encoding: The encoding of the image data, one of the following strings: 107 | 108 | * ``"passthrough"`` 109 | * one of the standard strings in sensor_msgs/image_encodings.h 110 | 111 | :rtype: :cpp:type:`cv::Mat` 112 | :raises CvBridgeError: when conversion is not possible. 113 | 114 | If desired_encoding is ``"passthrough"``, then the returned image has the same format as img_msg. 115 | Otherwise desired_encoding must be one of the standard image encodings 116 | 117 | This function returns an OpenCV :cpp:type:`cv::Mat` message on success, or raises :exc:`cv_bridge.CvBridgeError` on failure. 118 | 119 | If the image only has one channel, the shape has size 2 (width and height) 120 | """ 121 | import cv2 122 | import numpy as np 123 | 124 | str_msg = cmprs_img_msg.data 125 | buf = np.ndarray(shape=(1, len(str_msg)), 126 | dtype=np.uint8, buffer=cmprs_img_msg.data) 127 | im = cv2.imdecode(buf, cv2.IMREAD_UNCHANGED) 128 | 129 | if desired_encoding == "passthrough": 130 | return im 131 | 132 | from cv_bridge.boost.cv_bridge_boost import cvtColor2 133 | 134 | try: 135 | res = cvtColor2(im, "bgr8", desired_encoding) 136 | except RuntimeError as e: 137 | raise CvBridgeError(e) 138 | 139 | return res 140 | 141 | def imgmsg_to_cv2(self, img_msg, desired_encoding = "passthrough"): 142 | """ 143 | Convert a sensor_msgs::Image message to an OpenCV :cpp:type:`cv::Mat`. 144 | 145 | :param img_msg: A :cpp:type:`sensor_msgs::Image` message 146 | :param desired_encoding: The encoding of the image data, one of the following strings: 147 | 148 | * ``"passthrough"`` 149 | * one of the standard strings in sensor_msgs/image_encodings.h 150 | 151 | :rtype: :cpp:type:`cv::Mat` 152 | :raises CvBridgeError: when conversion is not possible. 153 | 154 | If desired_encoding is ``"passthrough"``, then the returned image has the same format as img_msg. 155 | Otherwise desired_encoding must be one of the standard image encodings 156 | 157 | This function returns an OpenCV :cpp:type:`cv::Mat` message on success, or raises :exc:`cv_bridge.CvBridgeError` on failure. 158 | 159 | If the image only has one channel, the shape has size 2 (width and height) 160 | """ 161 | import cv2 162 | import numpy as np 163 | dtype, n_channels = self.encoding_to_dtype_with_channels(img_msg.encoding) 164 | dtype = np.dtype(dtype) 165 | dtype = dtype.newbyteorder('>' if img_msg.is_bigendian else '<') 166 | if n_channels == 1: 167 | im = np.ndarray(shape=(img_msg.height, img_msg.width), 168 | dtype=dtype, buffer=img_msg.data) 169 | else: 170 | if(type(img_msg.data) == str): 171 | im = np.ndarray(shape=(img_msg.height, img_msg.width, n_channels), 172 | dtype=dtype, buffer=img_msg.data.encode()) 173 | else: 174 | im = np.ndarray(shape=(img_msg.height, img_msg.width, n_channels), 175 | dtype=dtype, buffer=img_msg.data) 176 | # If the byt order is different between the message and the system. 177 | if img_msg.is_bigendian == (sys.byteorder == 'little'): 178 | im = im.byteswap().newbyteorder() 179 | 180 | if desired_encoding == "passthrough": 181 | return im 182 | 183 | from cv_bridge.boost.cv_bridge_boost import cvtColor2 184 | 185 | try: 186 | res = cvtColor2(im, img_msg.encoding, desired_encoding) 187 | except RuntimeError as e: 188 | raise CvBridgeError(e) 189 | 190 | return res 191 | 192 | def cv2_to_compressed_imgmsg(self, cvim, dst_format = "jpg"): 193 | """ 194 | Convert an OpenCV :cpp:type:`cv::Mat` type to a ROS sensor_msgs::CompressedImage message. 195 | 196 | :param cvim: An OpenCV :cpp:type:`cv::Mat` 197 | :param dst_format: The format of the image data, one of the following strings: 198 | 199 | * from http://docs.opencv.org/2.4/modules/highgui/doc/reading_and_writing_images_and_video.html 200 | * from http://docs.opencv.org/2.4/modules/highgui/doc/reading_and_writing_images_and_video.html#Mat imread(const string& filename, int flags) 201 | * bmp, dib 202 | * jpeg, jpg, jpe 203 | * jp2 204 | * png 205 | * pbm, pgm, ppm 206 | * sr, ras 207 | * tiff, tif 208 | 209 | :rtype: A sensor_msgs.msg.CompressedImage message 210 | :raises CvBridgeError: when the ``cvim`` has a type that is incompatible with ``format`` 211 | 212 | 213 | This function returns a sensor_msgs::Image message on success, or raises :exc:`cv_bridge.CvBridgeError` on failure. 214 | """ 215 | import cv2 216 | import numpy as np 217 | if not isinstance(cvim, (np.ndarray, np.generic)): 218 | raise TypeError('Your input type is not a numpy array') 219 | cmprs_img_msg = sensor_msgs.msg.CompressedImage() 220 | cmprs_img_msg.format = dst_format 221 | ext_format = '.' + dst_format 222 | try: 223 | cmprs_img_msg.data = np.array(cv2.imencode(ext_format, cvim)[1]).tostring() 224 | except RuntimeError as e: 225 | raise CvBridgeError(e) 226 | 227 | return cmprs_img_msg 228 | 229 | def cv2_to_imgmsg(self, cvim, encoding = "passthrough", header = None): 230 | """ 231 | Convert an OpenCV :cpp:type:`cv::Mat` type to a ROS sensor_msgs::Image message. 232 | 233 | :param cvim: An OpenCV :cpp:type:`cv::Mat` 234 | :param encoding: The encoding of the image data, one of the following strings: 235 | 236 | * ``"passthrough"`` 237 | * one of the standard strings in sensor_msgs/image_encodings.h 238 | :param header: A std_msgs.msg.Header message 239 | 240 | :rtype: A sensor_msgs.msg.Image message 241 | :raises CvBridgeError: when the ``cvim`` has a type that is incompatible with ``encoding`` 242 | 243 | If encoding is ``"passthrough"``, then the message has the same encoding as the image's OpenCV type. 244 | Otherwise desired_encoding must be one of the standard image encodings 245 | 246 | This function returns a sensor_msgs::Image message on success, or raises :exc:`cv_bridge.CvBridgeError` on failure. 247 | """ 248 | import cv2 249 | import numpy as np 250 | if not isinstance(cvim, (np.ndarray, np.generic)): 251 | raise TypeError('Your input type is not a numpy array') 252 | img_msg = sensor_msgs.msg.Image() 253 | img_msg.height = cvim.shape[0] 254 | img_msg.width = cvim.shape[1] 255 | if header is not None: 256 | img_msg.header = header 257 | if len(cvim.shape) < 3: 258 | cv_type = self.dtype_with_channels_to_cvtype2(cvim.dtype, 1) 259 | else: 260 | cv_type = self.dtype_with_channels_to_cvtype2(cvim.dtype, cvim.shape[2]) 261 | if encoding == "passthrough": 262 | img_msg.encoding = cv_type 263 | else: 264 | img_msg.encoding = encoding 265 | # Verify that the supplied encoding is compatible with the type of the OpenCV image 266 | if self.cvtype_to_name[self.encoding_to_cvtype2(encoding)] != cv_type: 267 | raise CvBridgeError("encoding specified as %s, but image has incompatible type %s" % (encoding, cv_type)) 268 | if cvim.dtype.byteorder == '>': 269 | img_msg.is_bigendian = True 270 | img_msg.data = cvim.tostring() 271 | img_msg.step = len(img_msg.data) // img_msg.height 272 | 273 | return img_msg 274 | -------------------------------------------------------------------------------- /cv_bridge/rosdoc.yaml: -------------------------------------------------------------------------------- 1 | - builder: doxygen 2 | name: C++ API 3 | output_dir: c++ 4 | file_patterns: '*.c *.cpp *.h *.cc *.hh *.dox' 5 | - builder: sphinx 6 | name: Python API 7 | output_dir: python 8 | sphinx_root_dir: doc 9 | -------------------------------------------------------------------------------- /cv_bridge/setup.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | from setuptools import setup 3 | from catkin_pkg.python_setup import generate_distutils_setup 4 | 5 | d = generate_distutils_setup() 6 | 7 | d['packages'] = ['cv_bridge'] 8 | d['package_dir'] = {'' : 'python'} 9 | 10 | setup(**d) 11 | -------------------------------------------------------------------------------- /cv_bridge/src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # add library 2 | include_directories(./) 3 | add_library(${PROJECT_NAME} cv_bridge.cpp rgb_colors.cpp) 4 | add_dependencies(${PROJECT_NAME} ${catkin_EXPORTED_TARGETS}) 5 | target_link_libraries(${PROJECT_NAME} ${OpenCV_LIBRARIES} ${catkin_LIBRARIES}) 6 | 7 | install(TARGETS ${PROJECT_NAME} 8 | LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} 9 | ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} 10 | RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} 11 | ) 12 | 13 | if(NOT ANDROID) 14 | # add a Boost Python library 15 | find_package(PythonInterp REQUIRED) 16 | find_package(PythonLibs "${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}") 17 | 18 | #Get the numpy include directory from its python module 19 | if(NOT PYTHON_NUMPY_INCLUDE_DIR) 20 | execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "import numpy; print(numpy.get_include())" 21 | RESULT_VARIABLE PYTHON_NUMPY_PROCESS 22 | OUTPUT_VARIABLE PYTHON_NUMPY_INCLUDE_DIR 23 | OUTPUT_STRIP_TRAILING_WHITESPACE) 24 | 25 | if(PYTHON_NUMPY_PROCESS EQUAL 0) 26 | file(TO_CMAKE_PATH "${PYTHON_NUMPY_INCLUDE_DIR}" PYTHON_NUMPY_INCLUDE_CMAKE_PATH) 27 | set(PYTHON_NUMPY_INCLUDE_DIR ${PYTHON_NUMPY_INCLUDE_CMAKE_PATH} CACHE PATH "Numpy include directory") 28 | else(PYTHON_NUMPY_PROCESS EQUAL 0) 29 | message(SEND_ERROR "Could not determine the NumPy include directory, verify that NumPy was installed correctly.") 30 | endif(PYTHON_NUMPY_PROCESS EQUAL 0) 31 | endif(NOT PYTHON_NUMPY_INCLUDE_DIR) 32 | 33 | include_directories(${PYTHON_INCLUDE_PATH} ${Boost_INCLUDE_DIRS} ${PYTHON_NUMPY_INCLUDE_DIR}) 34 | 35 | if (PYTHON_VERSION_MAJOR VERSION_EQUAL 3) 36 | add_definitions(-DPYTHON3) 37 | endif() 38 | 39 | add_library(${PROJECT_NAME}_boost module.cpp module_opencv4.cpp) 40 | target_link_libraries(${PROJECT_NAME}_boost ${Boost_LIBRARIES} 41 | ${catkin_LIBRARIES} 42 | ${PROJECT_NAME} 43 | ) 44 | 45 | if(NOT APPLE) 46 | target_link_libraries(${PROJECT_NAME}_boost ${PYTHON_LIBRARIES}) 47 | endif() 48 | 49 | set_target_properties(${PROJECT_NAME}_boost PROPERTIES 50 | LIBRARY_OUTPUT_DIRECTORY ${CATKIN_DEVEL_PREFIX}/${CATKIN_GLOBAL_PYTHON_DESTINATION}/${PROJECT_NAME}/boost/ 51 | RUNTIME_OUTPUT_DIRECTORY ${CATKIN_DEVEL_PREFIX}/${CATKIN_GLOBAL_PYTHON_DESTINATION}/${PROJECT_NAME}/boost/ 52 | PREFIX "" 53 | ) 54 | if(APPLE) 55 | set_target_properties(${PROJECT_NAME}_boost PROPERTIES 56 | SUFFIX ".so") 57 | set_target_properties(${PROJECT_NAME}_boost PROPERTIES 58 | LINK_FLAGS "-undefined dynamic_lookup") 59 | endif() 60 | if(MSVC) 61 | set_target_properties(${PROJECT_NAME}_boost PROPERTIES 62 | SUFFIX ".pyd") 63 | endif() 64 | 65 | install(TARGETS ${PROJECT_NAME}_boost DESTINATION ${CATKIN_PACKAGE_PYTHON_DESTINATION}/boost/) 66 | endif() 67 | -------------------------------------------------------------------------------- /cv_bridge/src/boost/README: -------------------------------------------------------------------------------- 1 | this code is taken from Boost at https://github.com/boostorg/endian.git 2 | We should remove this folder once Boost 1.58 or above is the default. 3 | -------------------------------------------------------------------------------- /cv_bridge/src/boost/core/scoped_enum.hpp: -------------------------------------------------------------------------------- 1 | // scoped_enum.hpp ---------------------------------------------------------// 2 | 3 | // Copyright Beman Dawes, 2009 4 | // Copyright (C) 2011-2012 Vicente J. Botet Escriba 5 | // Copyright (C) 2012 Anthony Williams 6 | 7 | // Distributed under the Boost Software License, Version 1.0. 8 | // See http://www.boost.org/LICENSE_1_0.txt 9 | 10 | #ifndef BOOST_CORE_SCOPED_ENUM_HPP 11 | #define BOOST_CORE_SCOPED_ENUM_HPP 12 | 13 | #include 14 | 15 | #ifdef BOOST_HAS_PRAGMA_ONCE 16 | #pragma once 17 | #endif 18 | 19 | namespace boost 20 | { 21 | 22 | #ifdef BOOST_NO_CXX11_SCOPED_ENUMS 23 | 24 | /** 25 | * Meta-function to get the native enum type associated to an enum class or its emulation. 26 | */ 27 | template 28 | struct native_type 29 | { 30 | /** 31 | * The member typedef type names the native enum type associated to the scoped enum, 32 | * which is it self if the compiler supports scoped enums or EnumType::enum_type if it is an emulated scoped enum. 33 | */ 34 | typedef typename EnumType::enum_type type; 35 | }; 36 | 37 | /** 38 | * Casts a scoped enum to its underlying type. 39 | * 40 | * This function is useful when working with scoped enum classes, which doens't implicitly convert to the underlying type. 41 | * @param v A scoped enum. 42 | * @returns The underlying type. 43 | * @throws No-throws. 44 | */ 45 | template 46 | UnderlyingType underlying_cast(EnumType v) 47 | { 48 | return v.get_underlying_value_(); 49 | } 50 | 51 | /** 52 | * Casts a scoped enum to its native enum type. 53 | * 54 | * This function is useful to make programs portable when the scoped enum emulation can not be use where native enums can. 55 | * 56 | * EnumType the scoped enum type 57 | * 58 | * @param v A scoped enum. 59 | * @returns The native enum value. 60 | * @throws No-throws. 61 | */ 62 | template 63 | inline 64 | typename EnumType::enum_type native_value(EnumType e) 65 | { 66 | return e.get_native_value_(); 67 | } 68 | 69 | #else // BOOST_NO_CXX11_SCOPED_ENUMS 70 | 71 | template 72 | struct native_type 73 | { 74 | typedef EnumType type; 75 | }; 76 | 77 | template 78 | UnderlyingType underlying_cast(EnumType v) 79 | { 80 | return static_cast(v); 81 | } 82 | 83 | template 84 | inline 85 | EnumType native_value(EnumType e) 86 | { 87 | return e; 88 | } 89 | 90 | #endif // BOOST_NO_CXX11_SCOPED_ENUMS 91 | } 92 | 93 | 94 | #ifdef BOOST_NO_CXX11_SCOPED_ENUMS 95 | 96 | #ifndef BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS 97 | 98 | #define BOOST_SCOPED_ENUM_UT_DECLARE_CONVERSION_OPERATOR \ 99 | explicit operator underlying_type() const BOOST_NOEXCEPT { return get_underlying_value_(); } 100 | 101 | #else 102 | 103 | #define BOOST_SCOPED_ENUM_UT_DECLARE_CONVERSION_OPERATOR 104 | 105 | #endif 106 | 107 | /** 108 | * Start a declaration of a scoped enum. 109 | * 110 | * @param EnumType The new scoped enum. 111 | * @param UnderlyingType The underlying type. 112 | */ 113 | #define BOOST_SCOPED_ENUM_UT_DECLARE_BEGIN(EnumType, UnderlyingType) \ 114 | struct EnumType { \ 115 | typedef void is_boost_scoped_enum_tag; \ 116 | typedef UnderlyingType underlying_type; \ 117 | EnumType() BOOST_NOEXCEPT {} \ 118 | explicit EnumType(underlying_type v) BOOST_NOEXCEPT : v_(v) {} \ 119 | underlying_type get_underlying_value_() const BOOST_NOEXCEPT { return v_; } \ 120 | BOOST_SCOPED_ENUM_UT_DECLARE_CONVERSION_OPERATOR \ 121 | private: \ 122 | underlying_type v_; \ 123 | typedef EnumType self_type; \ 124 | public: \ 125 | enum enum_type 126 | 127 | #define BOOST_SCOPED_ENUM_DECLARE_END2() \ 128 | enum_type get_native_value_() const BOOST_NOEXCEPT { return enum_type(v_); } \ 129 | friend bool operator ==(self_type lhs, self_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)==enum_type(rhs.v_); } \ 130 | friend bool operator ==(self_type lhs, enum_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)==rhs; } \ 131 | friend bool operator ==(enum_type lhs, self_type rhs) BOOST_NOEXCEPT { return lhs==enum_type(rhs.v_); } \ 132 | friend bool operator !=(self_type lhs, self_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)!=enum_type(rhs.v_); } \ 133 | friend bool operator !=(self_type lhs, enum_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)!=rhs; } \ 134 | friend bool operator !=(enum_type lhs, self_type rhs) BOOST_NOEXCEPT { return lhs!=enum_type(rhs.v_); } \ 135 | friend bool operator <(self_type lhs, self_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)(self_type lhs, self_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)>enum_type(rhs.v_); } \ 142 | friend bool operator >(self_type lhs, enum_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)>rhs; } \ 143 | friend bool operator >(enum_type lhs, self_type rhs) BOOST_NOEXCEPT { return lhs>enum_type(rhs.v_); } \ 144 | friend bool operator >=(self_type lhs, self_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)>=enum_type(rhs.v_); } \ 145 | friend bool operator >=(self_type lhs, enum_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)>=rhs; } \ 146 | friend bool operator >=(enum_type lhs, self_type rhs) BOOST_NOEXCEPT { return lhs>=enum_type(rhs.v_); } \ 147 | }; 148 | 149 | #define BOOST_SCOPED_ENUM_DECLARE_END(EnumType) \ 150 | ; \ 151 | EnumType(enum_type v) BOOST_NOEXCEPT : v_(v) {} \ 152 | BOOST_SCOPED_ENUM_DECLARE_END2() 153 | 154 | /** 155 | * Starts a declaration of a scoped enum with the default int underlying type. 156 | * 157 | * @param EnumType The new scoped enum. 158 | */ 159 | #define BOOST_SCOPED_ENUM_DECLARE_BEGIN(EnumType) \ 160 | BOOST_SCOPED_ENUM_UT_DECLARE_BEGIN(EnumType,int) 161 | 162 | /** 163 | * Name of the native enum type. 164 | * 165 | * @param EnumType The new scoped enum. 166 | */ 167 | #define BOOST_SCOPED_ENUM_NATIVE(EnumType) EnumType::enum_type 168 | /** 169 | * Forward declares an scoped enum. 170 | * 171 | * @param EnumType The scoped enum. 172 | */ 173 | #define BOOST_SCOPED_ENUM_FORWARD_DECLARE(EnumType) struct EnumType 174 | 175 | #else // BOOST_NO_CXX11_SCOPED_ENUMS 176 | 177 | #define BOOST_SCOPED_ENUM_UT_DECLARE_BEGIN(EnumType,UnderlyingType) enum class EnumType : UnderlyingType 178 | #define BOOST_SCOPED_ENUM_DECLARE_BEGIN(EnumType) enum class EnumType 179 | #define BOOST_SCOPED_ENUM_DECLARE_END2() 180 | #define BOOST_SCOPED_ENUM_DECLARE_END(EnumType) ; 181 | 182 | #define BOOST_SCOPED_ENUM_NATIVE(EnumType) EnumType 183 | #define BOOST_SCOPED_ENUM_FORWARD_DECLARE(EnumType) enum class EnumType 184 | 185 | #endif // BOOST_NO_CXX11_SCOPED_ENUMS 186 | 187 | // Deprecated macros 188 | #define BOOST_SCOPED_ENUM_START(name) BOOST_SCOPED_ENUM_DECLARE_BEGIN(name) 189 | #define BOOST_SCOPED_ENUM_END BOOST_SCOPED_ENUM_DECLARE_END2() 190 | #define BOOST_SCOPED_ENUM(name) BOOST_SCOPED_ENUM_NATIVE(name) 191 | 192 | #endif // BOOST_CORE_SCOPED_ENUM_HPP 193 | -------------------------------------------------------------------------------- /cv_bridge/src/boost/endian/detail/intrinsic.hpp: -------------------------------------------------------------------------------- 1 | // endian/detail/intrinsic.hpp -------------------------------------------------------// 2 | 3 | // Copyright (C) 2012 David Stone 4 | // Copyright Beman Dawes 2013 5 | 6 | // Distributed under the Boost Software License, Version 1.0. 7 | // http://www.boost.org/LICENSE_1_0.txt 8 | 9 | #ifndef BOOST_ENDIAN_INTRINSIC_HPP 10 | #define BOOST_ENDIAN_INTRINSIC_HPP 11 | 12 | // Allow user to force BOOST_ENDIAN_NO_INTRINSICS in case they aren't available for a 13 | // particular platform/compiler combination. Please report such platform/compiler 14 | // combinations to the Boost mailing list. 15 | #ifndef BOOST_ENDIAN_NO_INTRINSICS 16 | 17 | #ifndef __has_builtin // Optional of course 18 | #define __has_builtin(x) 0 // Compatibility with non-clang compilers 19 | #endif 20 | 21 | // GCC and Clang recent versions provide intrinsic byte swaps via builtins 22 | #if (defined(__clang__) && __has_builtin(__builtin_bswap32) && __has_builtin(__builtin_bswap64)) \ 23 | || (defined(__GNUC__ ) && \ 24 | (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))) 25 | # define BOOST_ENDIAN_INTRINSIC_MSG "__builtin_bswap16, etc." 26 | // prior to 4.8, gcc did not provide __builtin_bswap16 on some platforms so we emulate it 27 | // see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52624 28 | // Clang has a similar problem, but their feature test macros make it easier to detect 29 | # if (defined(__clang__) && __has_builtin(__builtin_bswap16)) \ 30 | || (defined(__GNUC__) &&(__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8))) 31 | # define BOOST_ENDIAN_INTRINSIC_BYTE_SWAP_2(x) __builtin_bswap16(x) 32 | # else 33 | # define BOOST_ENDIAN_INTRINSIC_BYTE_SWAP_2(x) __builtin_bswap32((x) << 16) 34 | # endif 35 | # define BOOST_ENDIAN_INTRINSIC_BYTE_SWAP_4(x) __builtin_bswap32(x) 36 | # define BOOST_ENDIAN_INTRINSIC_BYTE_SWAP_8(x) __builtin_bswap64(x) 37 | 38 | // Linux systems provide the byteswap.h header, with 39 | #elif defined(__linux__) 40 | // don't check for obsolete forms defined(linux) and defined(__linux) on the theory that 41 | // compilers that predefine only these are so old that byteswap.h probably isn't present. 42 | # define BOOST_ENDIAN_INTRINSIC_MSG "byteswap.h bswap_16, etc." 43 | # include 44 | # define BOOST_ENDIAN_INTRINSIC_BYTE_SWAP_2(x) bswap_16(x) 45 | # define BOOST_ENDIAN_INTRINSIC_BYTE_SWAP_4(x) bswap_32(x) 46 | # define BOOST_ENDIAN_INTRINSIC_BYTE_SWAP_8(x) bswap_64(x) 47 | 48 | #elif defined(_MSC_VER) 49 | // Microsoft documents these as being compatible since Windows 95 and specificly 50 | // lists runtime library support since Visual Studio 2003 (aka 7.1). 51 | # define BOOST_ENDIAN_INTRINSIC_MSG "cstdlib _byteswap_ushort, etc." 52 | # include 53 | # define BOOST_ENDIAN_INTRINSIC_BYTE_SWAP_2(x) _byteswap_ushort(x) 54 | # define BOOST_ENDIAN_INTRINSIC_BYTE_SWAP_4(x) _byteswap_ulong(x) 55 | # define BOOST_ENDIAN_INTRINSIC_BYTE_SWAP_8(x) _byteswap_uint64(x) 56 | #else 57 | # define BOOST_ENDIAN_NO_INTRINSICS 58 | # define BOOST_ENDIAN_INTRINSIC_MSG "no byte swap intrinsics" 59 | #endif 60 | 61 | #elif !defined(BOOST_ENDIAN_INTRINSIC_MSG) 62 | # define BOOST_ENDIAN_INTRINSIC_MSG "no byte swap intrinsics" 63 | #endif // BOOST_ENDIAN_NO_INTRINSICS 64 | #endif // BOOST_ENDIAN_INTRINSIC_HPP 65 | -------------------------------------------------------------------------------- /cv_bridge/src/boost/predef/detail/_cassert.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright Rene Rivera 2011-2012 3 | Distributed under the Boost Software License, Version 1.0. 4 | (See accompanying file LICENSE_1_0.txt or copy at 5 | http://www.boost.org/LICENSE_1_0.txt) 6 | */ 7 | 8 | #ifndef BOOST_PREDEF_DETAIL__CASSERT_H 9 | #define BOOST_PREDEF_DETAIL__CASSERT_H 10 | 11 | #if defined(__cplusplus) 12 | #include 13 | #else 14 | #include 15 | #endif 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /cv_bridge/src/boost/predef/detail/endian_compat.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright Rene Rivera 2013 3 | Distributed under the Boost Software License, Version 1.0. 4 | (See accompanying file LICENSE_1_0.txt or copy at 5 | http://www.boost.org/LICENSE_1_0.txt) 6 | */ 7 | 8 | #ifndef BOOST_PREDEF_DETAIL_ENDIAN_COMPAT_H 9 | #define BOOST_PREDEF_DETAIL_ENDIAN_COMPAT_H 10 | 11 | #include 12 | 13 | #if BOOST_ENDIAN_BIG_BYTE 14 | # define BOOST_BIG_ENDIAN 15 | # define BOOST_BYTE_ORDER 4321 16 | #endif 17 | #if BOOST_ENDIAN_LITTLE_BYTE 18 | # define BOOST_LITTLE_ENDIAN 19 | # define BOOST_BYTE_ORDER 1234 20 | #endif 21 | #if BOOST_ENDIAN_LITTLE_WORD 22 | # define BOOST_PDP_ENDIAN 23 | # define BOOST_BYTE_ORDER 2134 24 | #endif 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /cv_bridge/src/boost/predef/detail/test.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright Rene Rivera 2011-2012 3 | Distributed under the Boost Software License, Version 1.0. 4 | (See accompanying file LICENSE_1_0.txt or copy at 5 | http://www.boost.org/LICENSE_1_0.txt) 6 | */ 7 | 8 | #ifndef BOOST_PREDEF_DETAIL_TEST_H 9 | #define BOOST_PREDEF_DETAIL_TEST_H 10 | 11 | #if !defined(BOOST_PREDEF_INTERNAL_GENERATE_TESTS) 12 | 13 | #define BOOST_PREDEF_DECLARE_TEST(x,s) 14 | 15 | #endif 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /cv_bridge/src/boost/predef/library/c/_prefix.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright Rene Rivera 2008-2013 3 | Distributed under the Boost Software License, Version 1.0. 4 | (See accompanying file LICENSE_1_0.txt or copy at 5 | http://www.boost.org/LICENSE_1_0.txt) 6 | */ 7 | 8 | #ifndef BOOST_PREDEF_LIBRARY_C__PREFIX_H 9 | #define BOOST_PREDEF_LIBRARY_C__PREFIX_H 10 | 11 | #include 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /cv_bridge/src/boost/predef/library/c/gnu.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright Rene Rivera 2008-2015 3 | Distributed under the Boost Software License, Version 1.0. 4 | (See accompanying file LICENSE_1_0.txt or copy at 5 | http://www.boost.org/LICENSE_1_0.txt) 6 | */ 7 | 8 | #ifndef BOOST_PREDEF_LIBRARY_C_GNU_H 9 | #define BOOST_PREDEF_LIBRARY_C_GNU_H 10 | 11 | #include 12 | #include 13 | 14 | #include 15 | 16 | #if defined(__STDC__) 17 | #include 18 | #elif defined(__cplusplus) 19 | #include 20 | #endif 21 | 22 | /*` 23 | [heading `BOOST_LIB_C_GNU`] 24 | 25 | [@http://en.wikipedia.org/wiki/Glibc GNU glibc] Standard C library. 26 | Version number available as major, and minor. 27 | 28 | [table 29 | [[__predef_symbol__] [__predef_version__]] 30 | 31 | [[`__GLIBC__`] [__predef_detection__]] 32 | [[`__GNU_LIBRARY__`] [__predef_detection__]] 33 | 34 | [[`__GLIBC__`, `__GLIBC_MINOR__`] [V.R.0]] 35 | [[`__GNU_LIBRARY__`, `__GNU_LIBRARY_MINOR__`] [V.R.0]] 36 | ] 37 | */ 38 | 39 | #define BOOST_LIB_C_GNU BOOST_VERSION_NUMBER_NOT_AVAILABLE 40 | 41 | #if defined(__GLIBC__) || defined(__GNU_LIBRARY__) 42 | # undef BOOST_LIB_C_GNU 43 | # if defined(__GLIBC__) 44 | # define BOOST_LIB_C_GNU \ 45 | BOOST_VERSION_NUMBER(__GLIBC__,__GLIBC_MINOR__,0) 46 | # else 47 | # define BOOST_LIB_C_GNU \ 48 | BOOST_VERSION_NUMBER(__GNU_LIBRARY__,__GNU_LIBRARY_MINOR__,0) 49 | # endif 50 | #endif 51 | 52 | #if BOOST_LIB_C_GNU 53 | # define BOOST_LIB_C_GNU_AVAILABLE 54 | #endif 55 | 56 | #define BOOST_LIB_C_GNU_NAME "GNU" 57 | 58 | #endif 59 | 60 | #include 61 | BOOST_PREDEF_DECLARE_TEST(BOOST_LIB_C_GNU,BOOST_LIB_C_GNU_NAME) 62 | -------------------------------------------------------------------------------- /cv_bridge/src/boost/predef/make.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright Rene Rivera 2008-2015 3 | Distributed under the Boost Software License, Version 1.0. 4 | (See accompanying file LICENSE_1_0.txt or copy at 5 | http://www.boost.org/LICENSE_1_0.txt) 6 | */ 7 | #include 8 | 9 | #ifndef BOOST_PREDEF_MAKE_H 10 | #define BOOST_PREDEF_MAKE_H 11 | 12 | /* 13 | Shorthands for the common version number formats used by vendors... 14 | */ 15 | 16 | /*` 17 | [heading `BOOST_PREDEF_MAKE_..` macros] 18 | 19 | These set of macros decompose common vendor version number 20 | macros which are composed version, revision, and patch digits. 21 | The naming convention indicates: 22 | 23 | * The base of the specified version number. "`BOOST_PREDEF_MAKE_0X`" for 24 | hexadecimal digits, and "`BOOST_PREDEF_MAKE_10`" for decimal digits. 25 | * The format of the vendor version number. Where "`V`" indicates the version digits, 26 | "`R`" indicates the revision digits, "`P`" indicates the patch digits, and "`0`" 27 | indicates an ignored digit. 28 | 29 | Macros are: 30 | */ 31 | /*` `BOOST_PREDEF_MAKE_0X_VRP(V)` */ 32 | #define BOOST_PREDEF_MAKE_0X_VRP(V) BOOST_VERSION_NUMBER((V&0xF00)>>8,(V&0xF0)>>4,(V&0xF)) 33 | /*` `BOOST_PREDEF_MAKE_0X_VVRP(V)` */ 34 | #define BOOST_PREDEF_MAKE_0X_VVRP(V) BOOST_VERSION_NUMBER((V&0xFF00)>>8,(V&0xF0)>>4,(V&0xF)) 35 | /*` `BOOST_PREDEF_MAKE_0X_VRPP(V)` */ 36 | #define BOOST_PREDEF_MAKE_0X_VRPP(V) BOOST_VERSION_NUMBER((V&0xF000)>>12,(V&0xF00)>>8,(V&0xFF)) 37 | /*` `BOOST_PREDEF_MAKE_0X_VVRR(V)` */ 38 | #define BOOST_PREDEF_MAKE_0X_VVRR(V) BOOST_VERSION_NUMBER((V&0xFF00)>>8,(V&0xFF),0) 39 | /*` `BOOST_PREDEF_MAKE_0X_VRRPPPP(V)` */ 40 | #define BOOST_PREDEF_MAKE_0X_VRRPPPP(V) BOOST_VERSION_NUMBER((V&0xF000000)>>24,(V&0xFF0000)>>16,(V&0xFFFF)) 41 | /*` `BOOST_PREDEF_MAKE_0X_VVRRP(V)` */ 42 | #define BOOST_PREDEF_MAKE_0X_VVRRP(V) BOOST_VERSION_NUMBER((V&0xFF000)>>12,(V&0xFF0)>>4,(V&0xF)) 43 | /*` `BOOST_PREDEF_MAKE_0X_VRRPP000(V)` */ 44 | #define BOOST_PREDEF_MAKE_0X_VRRPP000(V) BOOST_VERSION_NUMBER((V&0xF0000000)>>28,(V&0xFF00000)>>20,(V&0xFF000)>>12) 45 | /*` `BOOST_PREDEF_MAKE_0X_VVRRPP(V)` */ 46 | #define BOOST_PREDEF_MAKE_0X_VVRRPP(V) BOOST_VERSION_NUMBER((V&0xFF0000)>>16,(V&0xFF00)>>8,(V&0xFF)) 47 | /*` `BOOST_PREDEF_MAKE_10_VPPP(V)` */ 48 | #define BOOST_PREDEF_MAKE_10_VPPP(V) BOOST_VERSION_NUMBER(((V)/1000)%10,0,(V)%1000) 49 | /*` `BOOST_PREDEF_MAKE_10_VRP(V)` */ 50 | #define BOOST_PREDEF_MAKE_10_VRP(V) BOOST_VERSION_NUMBER(((V)/100)%10,((V)/10)%10,(V)%10) 51 | /*` `BOOST_PREDEF_MAKE_10_VRP000(V)` */ 52 | #define BOOST_PREDEF_MAKE_10_VRP000(V) BOOST_VERSION_NUMBER(((V)/100000)%10,((V)/10000)%10,((V)/1000)%10) 53 | /*` `BOOST_PREDEF_MAKE_10_VRPP(V)` */ 54 | #define BOOST_PREDEF_MAKE_10_VRPP(V) BOOST_VERSION_NUMBER(((V)/1000)%10,((V)/100)%10,(V)%100) 55 | /*` `BOOST_PREDEF_MAKE_10_VRR(V)` */ 56 | #define BOOST_PREDEF_MAKE_10_VRR(V) BOOST_VERSION_NUMBER(((V)/100)%10,(V)%100,0) 57 | /*` `BOOST_PREDEF_MAKE_10_VRRPP(V)` */ 58 | #define BOOST_PREDEF_MAKE_10_VRRPP(V) BOOST_VERSION_NUMBER(((V)/10000)%10,((V)/100)%100,(V)%100) 59 | /*` `BOOST_PREDEF_MAKE_10_VRR000(V)` */ 60 | #define BOOST_PREDEF_MAKE_10_VRR000(V) BOOST_VERSION_NUMBER(((V)/100000)%10,((V)/1000)%100,0) 61 | /*` `BOOST_PREDEF_MAKE_10_VV00(V)` */ 62 | #define BOOST_PREDEF_MAKE_10_VV00(V) BOOST_VERSION_NUMBER(((V)/100)%100,0,0) 63 | /*` `BOOST_PREDEF_MAKE_10_VVRR(V)` */ 64 | #define BOOST_PREDEF_MAKE_10_VVRR(V) BOOST_VERSION_NUMBER(((V)/100)%100,(V)%100,0) 65 | /*` `BOOST_PREDEF_MAKE_10_VVRRPP(V)` */ 66 | #define BOOST_PREDEF_MAKE_10_VVRRPP(V) BOOST_VERSION_NUMBER(((V)/10000)%100,((V)/100)%100,(V)%100) 67 | /*` `BOOST_PREDEF_MAKE_10_VVRR0PP00(V)` */ 68 | #define BOOST_PREDEF_MAKE_10_VVRR0PP00(V) BOOST_VERSION_NUMBER(((V)/10000000)%100,((V)/100000)%100,((V)/100)%100) 69 | /*` `BOOST_PREDEF_MAKE_10_VVRR0PPPP(V)` */ 70 | #define BOOST_PREDEF_MAKE_10_VVRR0PPPP(V) BOOST_VERSION_NUMBER(((V)/10000000)%100,((V)/100000)%100,(V)%10000) 71 | /*` `BOOST_PREDEF_MAKE_10_VVRR00PP00(V)` */ 72 | #define BOOST_PREDEF_MAKE_10_VVRR00PP00(V) BOOST_VERSION_NUMBER(((V)/100000000)%100,((V)/1000000)%100,((V)/100)%100) 73 | /*` 74 | [heading `BOOST_PREDEF_MAKE_*..` date macros] 75 | 76 | Date decomposition macros return a date in the relative to the 1970 77 | Epoch date. If the month is not available, January 1st is used as the month and day. 78 | If the day is not available, but the month is, the 1st of the month is used as the day. 79 | */ 80 | /*` `BOOST_PREDEF_MAKE_DATE(Y,M,D)` */ 81 | #define BOOST_PREDEF_MAKE_DATE(Y,M,D) BOOST_VERSION_NUMBER((Y)%10000-1970,(M)%100,(D)%100) 82 | /*` `BOOST_PREDEF_MAKE_YYYYMMDD(V)` */ 83 | #define BOOST_PREDEF_MAKE_YYYYMMDD(V) BOOST_PREDEF_MAKE_DATE(((V)/10000)%10000,((V)/100)%100,(V)%100) 84 | /*` `BOOST_PREDEF_MAKE_YYYY(V)` */ 85 | #define BOOST_PREDEF_MAKE_YYYY(V) BOOST_PREDEF_MAKE_DATE(V,1,1) 86 | /*` `BOOST_PREDEF_MAKE_YYYYMM(V)` */ 87 | #define BOOST_PREDEF_MAKE_YYYYMM(V) BOOST_PREDEF_MAKE_DATE((V)/100,(V)%100,1) 88 | 89 | #endif 90 | -------------------------------------------------------------------------------- /cv_bridge/src/boost/predef/os/android.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright Rene Rivera 2015 3 | Distributed under the Boost Software License, Version 1.0. 4 | (See accompanying file LICENSE_1_0.txt or copy at 5 | http://www.boost.org/LICENSE_1_0.txt) 6 | */ 7 | 8 | #ifndef BOOST_PREDEF_OS_ADROID_H 9 | #define BOOST_PREDEF_OS_ADROID_H 10 | 11 | #include 12 | #include 13 | 14 | /*` 15 | [heading `BOOST_OS_ANDROID`] 16 | 17 | [@http://en.wikipedia.org/wiki/Android_%28operating_system%29 Android] operating system. 18 | 19 | [table 20 | [[__predef_symbol__] [__predef_version__]] 21 | 22 | [[`__ANDROID__`] [__predef_detection__]] 23 | ] 24 | */ 25 | 26 | #define BOOST_OS_ANDROID BOOST_VERSION_NUMBER_NOT_AVAILABLE 27 | 28 | #if !defined(BOOST_PREDEF_DETAIL_OS_DETECTED) && ( \ 29 | defined(__ANDROID__) \ 30 | ) 31 | # undef BOOST_OS_ANDROID 32 | # define BOOST_OS_ANDROID BOOST_VERSION_NUMBER_AVAILABLE 33 | #endif 34 | 35 | #if BOOST_OS_ANDROID 36 | # define BOOST_OS_ANDROID_AVAILABLE 37 | # include 38 | #endif 39 | 40 | #define BOOST_OS_ANDROID_NAME "Android" 41 | 42 | #endif 43 | 44 | #include 45 | BOOST_PREDEF_DECLARE_TEST(BOOST_OS_ANDROID,BOOST_OS_ANDROID_NAME) 46 | -------------------------------------------------------------------------------- /cv_bridge/src/boost/predef/os/bsd.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright Rene Rivera 2008-2015 3 | Distributed under the Boost Software License, Version 1.0. 4 | (See accompanying file LICENSE_1_0.txt or copy at 5 | http://www.boost.org/LICENSE_1_0.txt) 6 | */ 7 | 8 | #ifndef BOOST_PREDEF_OS_BSD_H 9 | #define BOOST_PREDEF_OS_BSD_H 10 | 11 | /* Special case: OSX will define BSD predefs if the sys/param.h 12 | * header is included. We can guard against that, but only if we 13 | * detect OSX first. Hence we will force include OSX detection 14 | * before doing any BSD detection. 15 | */ 16 | #include 17 | 18 | #include 19 | #include 20 | 21 | /*` 22 | [heading `BOOST_OS_BSD`] 23 | 24 | [@http://en.wikipedia.org/wiki/Berkeley_Software_Distribution BSD] operating system. 25 | 26 | BSD has various branch operating systems possible and each detected 27 | individually. This detects the following variations and sets a specific 28 | version number macro to match: 29 | 30 | * `BOOST_OS_BSD_DRAGONFLY` [@http://en.wikipedia.org/wiki/DragonFly_BSD DragonFly BSD] 31 | * `BOOST_OS_BSD_FREE` [@http://en.wikipedia.org/wiki/Freebsd FreeBSD] 32 | * `BOOST_OS_BSD_BSDI` [@http://en.wikipedia.org/wiki/BSD/OS BSDi BSD/OS] 33 | * `BOOST_OS_BSD_NET` [@http://en.wikipedia.org/wiki/Netbsd NetBSD] 34 | * `BOOST_OS_BSD_OPEN` [@http://en.wikipedia.org/wiki/Openbsd OpenBSD] 35 | 36 | [note The general `BOOST_OS_BSD` is set in all cases to indicate some form 37 | of BSD. If the above variants is detected the corresponding macro is also set.] 38 | 39 | [table 40 | [[__predef_symbol__] [__predef_version__]] 41 | 42 | [[`BSD`] [__predef_detection__]] 43 | [[`_SYSTYPE_BSD`] [__predef_detection__]] 44 | 45 | [[`BSD4_2`] [4.2.0]] 46 | [[`BSD4_3`] [4.3.0]] 47 | [[`BSD4_4`] [4.4.0]] 48 | [[`BSD`] [V.R.0]] 49 | ] 50 | */ 51 | 52 | #include 53 | #include 54 | #include 55 | #include 56 | #include 57 | 58 | #ifndef BOOST_OS_BSD 59 | #define BOOST_OS_BSD BOOST_VERSION_NUMBER_NOT_AVAILABLE 60 | #endif 61 | 62 | #if !defined(BOOST_PREDEF_DETAIL_OS_DETECTED) && ( \ 63 | defined(BSD) || \ 64 | defined(_SYSTYPE_BSD) \ 65 | ) 66 | # undef BOOST_OS_BSD 67 | # include 68 | # if !defined(BOOST_OS_BSD) && defined(BSD4_4) 69 | # define BOOST_OS_BSD BOOST_VERSION_NUMBER(4,4,0) 70 | # endif 71 | # if !defined(BOOST_OS_BSD) && defined(BSD4_3) 72 | # define BOOST_OS_BSD BOOST_VERSION_NUMBER(4,3,0) 73 | # endif 74 | # if !defined(BOOST_OS_BSD) && defined(BSD4_2) 75 | # define BOOST_OS_BSD BOOST_VERSION_NUMBER(4,2,0) 76 | # endif 77 | # if !defined(BOOST_OS_BSD) && defined(BSD) 78 | # define BOOST_OS_BSD BOOST_PREDEF_MAKE_10_VVRR(BSD) 79 | # endif 80 | # if !defined(BOOST_OS_BSD) 81 | # define BOOST_OS_BSD BOOST_VERSION_NUMBER_AVAILABLE 82 | # endif 83 | #endif 84 | 85 | #if BOOST_OS_BSD 86 | # define BOOST_OS_BSD_AVAILABLE 87 | # include 88 | #endif 89 | 90 | #define BOOST_OS_BSD_NAME "BSD" 91 | 92 | #else 93 | 94 | #include 95 | #include 96 | #include 97 | #include 98 | #include 99 | 100 | #endif 101 | 102 | #include 103 | BOOST_PREDEF_DECLARE_TEST(BOOST_OS_BSD,BOOST_OS_BSD_NAME) 104 | -------------------------------------------------------------------------------- /cv_bridge/src/boost/predef/os/bsd/bsdi.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright Rene Rivera 2012-2015 3 | Distributed under the Boost Software License, Version 1.0. 4 | (See accompanying file LICENSE_1_0.txt or copy at 5 | http://www.boost.org/LICENSE_1_0.txt) 6 | */ 7 | 8 | #ifndef BOOST_PREDEF_OS_BSD_BSDI_H 9 | #define BOOST_PREDEF_OS_BSD_BSDI_H 10 | 11 | #include 12 | 13 | /*` 14 | [heading `BOOST_OS_BSD_BSDI`] 15 | 16 | [@http://en.wikipedia.org/wiki/BSD/OS BSDi BSD/OS] operating system. 17 | 18 | [table 19 | [[__predef_symbol__] [__predef_version__]] 20 | 21 | [[`__bsdi__`] [__predef_detection__]] 22 | ] 23 | */ 24 | 25 | #define BOOST_OS_BSD_BSDI BOOST_VERSION_NUMBER_NOT_AVAILABLE 26 | 27 | #if !defined(BOOST_PREDEF_DETAIL_OS_DETECTED) && ( \ 28 | defined(__bsdi__) \ 29 | ) 30 | # ifndef BOOST_OS_BSD_AVAILABLE 31 | # define BOOST_OS_BSD BOOST_VERSION_NUMBER_AVAILABLE 32 | # define BOOST_OS_BSD_AVAILABLE 33 | # endif 34 | # undef BOOST_OS_BSD_BSDI 35 | # define BOOST_OS_BSD_BSDI BOOST_VERSION_NUMBER_AVAILABLE 36 | #endif 37 | 38 | #if BOOST_OS_BSD_BSDI 39 | # define BOOST_OS_BSD_BSDI_AVAILABLE 40 | # include 41 | #endif 42 | 43 | #define BOOST_OS_BSD_BSDI_NAME "BSDi BSD/OS" 44 | 45 | #endif 46 | 47 | #include 48 | BOOST_PREDEF_DECLARE_TEST(BOOST_OS_BSD_BSDI,BOOST_OS_BSD_BSDI_NAME) 49 | -------------------------------------------------------------------------------- /cv_bridge/src/boost/predef/os/bsd/dragonfly.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright Rene Rivera 2012-2015 3 | Distributed under the Boost Software License, Version 1.0. 4 | (See accompanying file LICENSE_1_0.txt or copy at 5 | http://www.boost.org/LICENSE_1_0.txt) 6 | */ 7 | 8 | #ifndef BOOST_PREDEF_OS_BSD_DRAGONFLY_H 9 | #define BOOST_PREDEF_OS_BSD_DRAGONFLY_H 10 | 11 | #include 12 | 13 | /*` 14 | [heading `BOOST_OS_BSD_DRAGONFLY`] 15 | 16 | [@http://en.wikipedia.org/wiki/DragonFly_BSD DragonFly BSD] operating system. 17 | 18 | [table 19 | [[__predef_symbol__] [__predef_version__]] 20 | 21 | [[`__DragonFly__`] [__predef_detection__]] 22 | ] 23 | */ 24 | 25 | #define BOOST_OS_BSD_DRAGONFLY BOOST_VERSION_NUMBER_NOT_AVAILABLE 26 | 27 | #if !defined(BOOST_PREDEF_DETAIL_OS_DETECTED) && ( \ 28 | defined(__DragonFly__) \ 29 | ) 30 | # ifndef BOOST_OS_BSD_AVAILABLE 31 | # define BOOST_OS_BSD BOOST_VERSION_NUMBER_AVAILABLE 32 | # define BOOST_OS_BSD_AVAILABLE 33 | # endif 34 | # undef BOOST_OS_BSD_DRAGONFLY 35 | # if defined(__DragonFly__) 36 | # define BOOST_OS_DRAGONFLY_BSD BOOST_VERSION_NUMBER_AVAILABLE 37 | # endif 38 | #endif 39 | 40 | #if BOOST_OS_BSD_DRAGONFLY 41 | # define BOOST_OS_BSD_DRAGONFLY_AVAILABLE 42 | # include 43 | #endif 44 | 45 | #define BOOST_OS_BSD_DRAGONFLY_NAME "DragonFly BSD" 46 | 47 | #endif 48 | 49 | #include 50 | BOOST_PREDEF_DECLARE_TEST(BOOST_OS_BSD_DRAGONFLY,BOOST_OS_BSD_DRAGONFLY_NAME) 51 | -------------------------------------------------------------------------------- /cv_bridge/src/boost/predef/os/bsd/free.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright Rene Rivera 2012-2015 3 | Distributed under the Boost Software License, Version 1.0. 4 | (See accompanying file LICENSE_1_0.txt or copy at 5 | http://www.boost.org/LICENSE_1_0.txt) 6 | */ 7 | 8 | #ifndef BOOST_PREDEF_OS_BSD_FREE_H 9 | #define BOOST_PREDEF_OS_BSD_FREE_H 10 | 11 | #include 12 | 13 | /*` 14 | [heading `BOOST_OS_BSD_FREE`] 15 | 16 | [@http://en.wikipedia.org/wiki/Freebsd FreeBSD] operating system. 17 | 18 | [table 19 | [[__predef_symbol__] [__predef_version__]] 20 | 21 | [[`__FreeBSD__`] [__predef_detection__]] 22 | 23 | [[`__FreeBSD_version`] [V.R.P]] 24 | ] 25 | */ 26 | 27 | #define BOOST_OS_BSD_FREE BOOST_VERSION_NUMBER_NOT_AVAILABLE 28 | 29 | #if !defined(BOOST_PREDEF_DETAIL_OS_DETECTED) && ( \ 30 | defined(__FreeBSD__) \ 31 | ) 32 | # ifndef BOOST_OS_BSD_AVAILABLE 33 | # define BOOST_OS_BSD BOOST_VERSION_NUMBER_AVAILABLE 34 | # define BOOST_OS_BSD_AVAILABLE 35 | # endif 36 | # undef BOOST_OS_BSD_FREE 37 | # if defined(__FreeBSD_version) 38 | # if __FreeBSD_version < 500000 39 | # define BOOST_OS_BSD_FREE \ 40 | BOOST_PREDEF_MAKE_10_VRP000(__FreeBSD_version) 41 | # else 42 | # define BOOST_OS_BSD_FREE \ 43 | BOOST_PREDEF_MAKE_10_VRR000(__FreeBSD_version) 44 | # endif 45 | # else 46 | # define BOOST_OS_BSD_FREE BOOST_VERSION_NUMBER_AVAILABLE 47 | # endif 48 | #endif 49 | 50 | #if BOOST_OS_BSD_FREE 51 | # define BOOST_OS_BSD_FREE_AVAILABLE 52 | # include 53 | #endif 54 | 55 | #define BOOST_OS_BSD_FREE_NAME "Free BSD" 56 | 57 | #endif 58 | 59 | #include 60 | BOOST_PREDEF_DECLARE_TEST(BOOST_OS_BSD_FREE,BOOST_OS_BSD_FREE_NAME) 61 | -------------------------------------------------------------------------------- /cv_bridge/src/boost/predef/os/bsd/net.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright Rene Rivera 2012-2015 3 | Distributed under the Boost Software License, Version 1.0. 4 | (See accompanying file LICENSE_1_0.txt or copy at 5 | http://www.boost.org/LICENSE_1_0.txt) 6 | */ 7 | 8 | #ifndef BOOST_PREDEF_OS_BSD_NET_H 9 | #define BOOST_PREDEF_OS_BSD_NET_H 10 | 11 | #include 12 | 13 | /*` 14 | [heading `BOOST_OS_BSD_NET`] 15 | 16 | [@http://en.wikipedia.org/wiki/Netbsd NetBSD] operating system. 17 | 18 | [table 19 | [[__predef_symbol__] [__predef_version__]] 20 | 21 | [[`__NETBSD__`] [__predef_detection__]] 22 | [[`__NetBSD__`] [__predef_detection__]] 23 | 24 | [[`__NETBSD_version`] [V.R.P]] 25 | [[`NetBSD0_8`] [0.8.0]] 26 | [[`NetBSD0_9`] [0.9.0]] 27 | [[`NetBSD1_0`] [1.0.0]] 28 | [[`__NetBSD_Version`] [V.R.P]] 29 | ] 30 | */ 31 | 32 | #define BOOST_OS_BSD_NET BOOST_VERSION_NUMBER_NOT_AVAILABLE 33 | 34 | #if !defined(BOOST_PREDEF_DETAIL_OS_DETECTED) && ( \ 35 | defined(__NETBSD__) || defined(__NetBSD__) \ 36 | ) 37 | # ifndef BOOST_OS_BSD_AVAILABLE 38 | # define BOOST_OS_BSD BOOST_VERSION_NUMBER_AVAILABLE 39 | # define BOOST_OS_BSD_AVAILABLE 40 | # endif 41 | # undef BOOST_OS_BSD_NET 42 | # if defined(__NETBSD__) 43 | # if defined(__NETBSD_version) 44 | # if __NETBSD_version < 500000 45 | # define BOOST_OS_BSD_NET \ 46 | BOOST_PREDEF_MAKE_10_VRP000(__NETBSD_version) 47 | # else 48 | # define BOOST_OS_BSD_NET \ 49 | BOOST_PREDEF_MAKE_10_VRR000(__NETBSD_version) 50 | # endif 51 | # else 52 | # define BOOST_OS_BSD_NET BOOST_VERSION_NUMBER_AVAILABLE 53 | # endif 54 | # elif defined(__NetBSD__) 55 | # if !defined(BOOST_OS_BSD_NET) && defined(NetBSD0_8) 56 | # define BOOST_OS_BSD_NET BOOST_VERSION_NUMBER(0,8,0) 57 | # endif 58 | # if !defined(BOOST_OS_BSD_NET) && defined(NetBSD0_9) 59 | # define BOOST_OS_BSD_NET BOOST_VERSION_NUMBER(0,9,0) 60 | # endif 61 | # if !defined(BOOST_OS_BSD_NET) && defined(NetBSD1_0) 62 | # define BOOST_OS_BSD_NET BOOST_VERSION_NUMBER(1,0,0) 63 | # endif 64 | # if !defined(BOOST_OS_BSD_NET) && defined(__NetBSD_Version) 65 | # define BOOST_OS_BSD_NET \ 66 | BOOST_PREDEF_MAKE_10_VVRR00PP00(__NetBSD_Version) 67 | # endif 68 | # if !defined(BOOST_OS_BSD_NET) 69 | # define BOOST_OS_BSD_NET BOOST_VERSION_NUMBER_AVAILABLE 70 | # endif 71 | # endif 72 | #endif 73 | 74 | #if BOOST_OS_BSD_NET 75 | # define BOOST_OS_BSD_NET_AVAILABLE 76 | # include 77 | #endif 78 | 79 | #define BOOST_OS_BSD_NET_NAME "DragonFly BSD" 80 | 81 | #endif 82 | 83 | #include 84 | BOOST_PREDEF_DECLARE_TEST(BOOST_OS_BSD_NET,BOOST_OS_BSD_NET_NAME) 85 | -------------------------------------------------------------------------------- /cv_bridge/src/boost/predef/os/bsd/open.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright Rene Rivera 2012-2015 3 | Distributed under the Boost Software License, Version 1.0. 4 | (See accompanying file LICENSE_1_0.txt or copy at 5 | http://www.boost.org/LICENSE_1_0.txt) 6 | */ 7 | 8 | #ifndef BOOST_PREDEF_OS_BSD_OPEN_H 9 | #define BOOST_PREDEF_OS_BSD_OPEN_H 10 | 11 | #include 12 | 13 | /*` 14 | [heading `BOOST_OS_BSD_OPEN`] 15 | 16 | [@http://en.wikipedia.org/wiki/Openbsd OpenBSD] operating system. 17 | 18 | [table 19 | [[__predef_symbol__] [__predef_version__]] 20 | 21 | [[`__OpenBSD__`] [__predef_detection__]] 22 | 23 | [[`OpenBSD2_0`] [2.0.0]] 24 | [[`OpenBSD2_1`] [2.1.0]] 25 | [[`OpenBSD2_2`] [2.2.0]] 26 | [[`OpenBSD2_3`] [2.3.0]] 27 | [[`OpenBSD2_4`] [2.4.0]] 28 | [[`OpenBSD2_5`] [2.5.0]] 29 | [[`OpenBSD2_6`] [2.6.0]] 30 | [[`OpenBSD2_7`] [2.7.0]] 31 | [[`OpenBSD2_8`] [2.8.0]] 32 | [[`OpenBSD2_9`] [2.9.0]] 33 | [[`OpenBSD3_0`] [3.0.0]] 34 | [[`OpenBSD3_1`] [3.1.0]] 35 | [[`OpenBSD3_2`] [3.2.0]] 36 | [[`OpenBSD3_3`] [3.3.0]] 37 | [[`OpenBSD3_4`] [3.4.0]] 38 | [[`OpenBSD3_5`] [3.5.0]] 39 | [[`OpenBSD3_6`] [3.6.0]] 40 | [[`OpenBSD3_7`] [3.7.0]] 41 | [[`OpenBSD3_8`] [3.8.0]] 42 | [[`OpenBSD3_9`] [3.9.0]] 43 | [[`OpenBSD4_0`] [4.0.0]] 44 | [[`OpenBSD4_1`] [4.1.0]] 45 | [[`OpenBSD4_2`] [4.2.0]] 46 | [[`OpenBSD4_3`] [4.3.0]] 47 | [[`OpenBSD4_4`] [4.4.0]] 48 | [[`OpenBSD4_5`] [4.5.0]] 49 | [[`OpenBSD4_6`] [4.6.0]] 50 | [[`OpenBSD4_7`] [4.7.0]] 51 | [[`OpenBSD4_8`] [4.8.0]] 52 | [[`OpenBSD4_9`] [4.9.0]] 53 | ] 54 | */ 55 | 56 | #define BOOST_OS_BSD_OPEN BOOST_VERSION_NUMBER_NOT_AVAILABLE 57 | 58 | #if !defined(BOOST_PREDEF_DETAIL_OS_DETECTED) && ( \ 59 | defined(__OpenBSD__) \ 60 | ) 61 | # ifndef BOOST_OS_BSD_AVAILABLE 62 | # define BOOST_OS_BSD BOOST_VERSION_NUMBER_AVAILABLE 63 | # define BOOST_OS_BSD_AVAILABLE 64 | # endif 65 | # undef BOOST_OS_BSD_OPEN 66 | # if !defined(BOOST_OS_BSD_OPEN) && defined(OpenBSD2_0) 67 | # define BOOST_OS_BSD_OPEN BOOST_VERSION_NUMBER(2,0,0) 68 | # endif 69 | # if !defined(BOOST_OS_BSD_OPEN) && defined(OpenBSD2_1) 70 | # define BOOST_OS_BSD_OPEN BOOST_VERSION_NUMBER(2,1,0) 71 | # endif 72 | # if !defined(BOOST_OS_BSD_OPEN) && defined(OpenBSD2_2) 73 | # define BOOST_OS_BSD_OPEN BOOST_VERSION_NUMBER(2,2,0) 74 | # endif 75 | # if !defined(BOOST_OS_BSD_OPEN) && defined(OpenBSD2_3) 76 | # define BOOST_OS_BSD_OPEN BOOST_VERSION_NUMBER(2,3,0) 77 | # endif 78 | # if !defined(BOOST_OS_BSD_OPEN) && defined(OpenBSD2_4) 79 | # define BOOST_OS_BSD_OPEN BOOST_VERSION_NUMBER(2,4,0) 80 | # endif 81 | # if !defined(BOOST_OS_BSD_OPEN) && defined(OpenBSD2_5) 82 | # define BOOST_OS_BSD_OPEN BOOST_VERSION_NUMBER(2,5,0) 83 | # endif 84 | # if !defined(BOOST_OS_BSD_OPEN) && defined(OpenBSD2_6) 85 | # define BOOST_OS_BSD_OPEN BOOST_VERSION_NUMBER(2,6,0) 86 | # endif 87 | # if !defined(BOOST_OS_BSD_OPEN) && defined(OpenBSD2_7) 88 | # define BOOST_OS_BSD_OPEN BOOST_VERSION_NUMBER(2,7,0) 89 | # endif 90 | # if !defined(BOOST_OS_BSD_OPEN) && defined(OpenBSD2_8) 91 | # define BOOST_OS_BSD_OPEN BOOST_VERSION_NUMBER(2,8,0) 92 | # endif 93 | # if !defined(BOOST_OS_BSD_OPEN) && defined(OpenBSD2_9) 94 | # define BOOST_OS_BSD_OPEN BOOST_VERSION_NUMBER(2,9,0) 95 | # endif 96 | # if !defined(BOOST_OS_BSD_OPEN) && defined(OpenBSD3_0) 97 | # define BOOST_OS_BSD_OPEN BOOST_VERSION_NUMBER(3,0,0) 98 | # endif 99 | # if !defined(BOOST_OS_BSD_OPEN) && defined(OpenBSD3_1) 100 | # define BOOST_OS_BSD_OPEN BOOST_VERSION_NUMBER(3,1,0) 101 | # endif 102 | # if !defined(BOOST_OS_BSD_OPEN) && defined(OpenBSD3_2) 103 | # define BOOST_OS_BSD_OPEN BOOST_VERSION_NUMBER(3,2,0) 104 | # endif 105 | # if !defined(BOOST_OS_BSD_OPEN) && defined(OpenBSD3_3) 106 | # define BOOST_OS_BSD_OPEN BOOST_VERSION_NUMBER(3,3,0) 107 | # endif 108 | # if !defined(BOOST_OS_BSD_OPEN) && defined(OpenBSD3_4) 109 | # define BOOST_OS_BSD_OPEN BOOST_VERSION_NUMBER(3,4,0) 110 | # endif 111 | # if !defined(BOOST_OS_BSD_OPEN) && defined(OpenBSD3_5) 112 | # define BOOST_OS_BSD_OPEN BOOST_VERSION_NUMBER(3,5,0) 113 | # endif 114 | # if !defined(BOOST_OS_BSD_OPEN) && defined(OpenBSD3_6) 115 | # define BOOST_OS_BSD_OPEN BOOST_VERSION_NUMBER(3,6,0) 116 | # endif 117 | # if !defined(BOOST_OS_BSD_OPEN) && defined(OpenBSD3_7) 118 | # define BOOST_OS_BSD_OPEN BOOST_VERSION_NUMBER(3,7,0) 119 | # endif 120 | # if !defined(BOOST_OS_BSD_OPEN) && defined(OpenBSD3_8) 121 | # define BOOST_OS_BSD_OPEN BOOST_VERSION_NUMBER(3,8,0) 122 | # endif 123 | # if !defined(BOOST_OS_BSD_OPEN) && defined(OpenBSD3_9) 124 | # define BOOST_OS_BSD_OPEN BOOST_VERSION_NUMBER(3,9,0) 125 | # endif 126 | # if !defined(BOOST_OS_BSD_OPEN) && defined(OpenBSD4_0) 127 | # define BOOST_OS_BSD_OPEN BOOST_VERSION_NUMBER(4,0,0) 128 | # endif 129 | # if !defined(BOOST_OS_BSD_OPEN) && defined(OpenBSD4_1) 130 | # define BOOST_OS_BSD_OPEN BOOST_VERSION_NUMBER(4,1,0) 131 | # endif 132 | # if !defined(BOOST_OS_BSD_OPEN) && defined(OpenBSD4_2) 133 | # define BOOST_OS_BSD_OPEN BOOST_VERSION_NUMBER(4,2,0) 134 | # endif 135 | # if !defined(BOOST_OS_BSD_OPEN) && defined(OpenBSD4_3) 136 | # define BOOST_OS_BSD_OPEN BOOST_VERSION_NUMBER(4,3,0) 137 | # endif 138 | # if !defined(BOOST_OS_BSD_OPEN) && defined(OpenBSD4_4) 139 | # define BOOST_OS_BSD_OPEN BOOST_VERSION_NUMBER(4,4,0) 140 | # endif 141 | # if !defined(BOOST_OS_BSD_OPEN) && defined(OpenBSD4_5) 142 | # define BOOST_OS_BSD_OPEN BOOST_VERSION_NUMBER(4,5,0) 143 | # endif 144 | # if !defined(BOOST_OS_BSD_OPEN) && defined(OpenBSD4_6) 145 | # define BOOST_OS_BSD_OPEN BOOST_VERSION_NUMBER(4,6,0) 146 | # endif 147 | # if !defined(BOOST_OS_BSD_OPEN) && defined(OpenBSD4_7) 148 | # define BOOST_OS_BSD_OPEN BOOST_VERSION_NUMBER(4,7,0) 149 | # endif 150 | # if !defined(BOOST_OS_BSD_OPEN) && defined(OpenBSD4_8) 151 | # define BOOST_OS_BSD_OPEN BOOST_VERSION_NUMBER(4,8,0) 152 | # endif 153 | # if !defined(BOOST_OS_BSD_OPEN) && defined(OpenBSD4_9) 154 | # define BOOST_OS_BSD_OPEN BOOST_VERSION_NUMBER(4,9,0) 155 | # endif 156 | # if !defined(BOOST_OS_BSD_OPEN) 157 | # define BOOST_OS_BSD_OPEN BOOST_VERSION_NUMBER_AVAILABLE 158 | # endif 159 | #endif 160 | 161 | #if BOOST_OS_BSD_OPEN 162 | # define BOOST_OS_BSD_OPEN_AVAILABLE 163 | # include 164 | #endif 165 | 166 | #define BOOST_OS_BSD_OPEN_NAME "OpenBSD" 167 | 168 | #endif 169 | 170 | #include 171 | BOOST_PREDEF_DECLARE_TEST(BOOST_OS_BSD_OPEN,BOOST_OS_BSD_OPEN_NAME) 172 | -------------------------------------------------------------------------------- /cv_bridge/src/boost/predef/os/ios.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright Franz Detro 2014 3 | Copyright Rene Rivera 2015 4 | Distributed under the Boost Software License, Version 1.0. 5 | (See accompanying file LICENSE_1_0.txt or copy at 6 | http://www.boost.org/LICENSE_1_0.txt) 7 | */ 8 | 9 | #ifndef BOOST_PREDEF_OS_IOS_H 10 | #define BOOST_PREDEF_OS_IOS_H 11 | 12 | #include 13 | #include 14 | 15 | /*` 16 | [heading `BOOST_OS_IOS`] 17 | 18 | [@http://en.wikipedia.org/wiki/iOS iOS] operating system. 19 | 20 | [table 21 | [[__predef_symbol__] [__predef_version__]] 22 | 23 | [[`__APPLE__`] [__predef_detection__]] 24 | [[`__MACH__`] [__predef_detection__]] 25 | [[`__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__`] [__predef_detection__]] 26 | 27 | [[`__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__`] [__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__*1000]] 28 | ] 29 | */ 30 | 31 | #define BOOST_OS_IOS BOOST_VERSION_NUMBER_NOT_AVAILABLE 32 | 33 | #if !defined(BOOST_PREDEF_DETAIL_OS_DETECTED) && ( \ 34 | defined(__APPLE__) && defined(__MACH__) && \ 35 | defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) \ 36 | ) 37 | # undef BOOST_OS_IOS 38 | # define BOOST_OS_IOS (__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__*1000) 39 | #endif 40 | 41 | #if BOOST_OS_IOS 42 | # define BOOST_OS_IOS_AVAILABLE 43 | # include 44 | #endif 45 | 46 | #define BOOST_OS_IOS_NAME "iOS" 47 | 48 | #endif 49 | 50 | #include 51 | BOOST_PREDEF_DECLARE_TEST(BOOST_OS_IOS,BOOST_OS_IOS_NAME) 52 | -------------------------------------------------------------------------------- /cv_bridge/src/boost/predef/os/macos.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright Rene Rivera 2008-2015 3 | Copyright Franz Detro 2014 4 | Distributed under the Boost Software License, Version 1.0. 5 | (See accompanying file LICENSE_1_0.txt or copy at 6 | http://www.boost.org/LICENSE_1_0.txt) 7 | */ 8 | 9 | #ifndef BOOST_PREDEF_OS_MACOS_H 10 | #define BOOST_PREDEF_OS_MACOS_H 11 | 12 | /* Special case: iOS will define the same predefs as MacOS, and additionally 13 | '__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__'. We can guard against that, 14 | but only if we detect iOS first. Hence we will force include iOS detection 15 | * before doing any MacOS detection. 16 | */ 17 | #include 18 | 19 | #include 20 | #include 21 | 22 | /*` 23 | [heading `BOOST_OS_MACOS`] 24 | 25 | [@http://en.wikipedia.org/wiki/Mac_OS Mac OS] operating system. 26 | 27 | [table 28 | [[__predef_symbol__] [__predef_version__]] 29 | 30 | [[`macintosh`] [__predef_detection__]] 31 | [[`Macintosh`] [__predef_detection__]] 32 | [[`__APPLE__`] [__predef_detection__]] 33 | [[`__MACH__`] [__predef_detection__]] 34 | 35 | [[`__APPLE__`, `__MACH__`] [10.0.0]] 36 | [[ /otherwise/ ] [9.0.0]] 37 | ] 38 | */ 39 | 40 | #define BOOST_OS_MACOS BOOST_VERSION_NUMBER_NOT_AVAILABLE 41 | 42 | #if !defined(BOOST_PREDEF_DETAIL_OS_DETECTED) && ( \ 43 | defined(macintosh) || defined(Macintosh) || \ 44 | (defined(__APPLE__) && defined(__MACH__)) \ 45 | ) 46 | # undef BOOST_OS_MACOS 47 | # if !defined(BOOST_OS_MACOS) && defined(__APPLE__) && defined(__MACH__) 48 | # define BOOST_OS_MACOS BOOST_VERSION_NUMBER(10,0,0) 49 | # endif 50 | # if !defined(BOOST_OS_MACOS) 51 | # define BOOST_OS_MACOS BOOST_VERSION_NUMBER(9,0,0) 52 | # endif 53 | #endif 54 | 55 | #if BOOST_OS_MACOS 56 | # define BOOST_OS_MACOS_AVAILABLE 57 | # include 58 | #endif 59 | 60 | #define BOOST_OS_MACOS_NAME "Mac OS" 61 | 62 | #endif 63 | 64 | #include 65 | BOOST_PREDEF_DECLARE_TEST(BOOST_OS_MACOS,BOOST_OS_MACOS_NAME) 66 | -------------------------------------------------------------------------------- /cv_bridge/src/boost/predef/other/endian.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright Rene Rivera 2013-2015 3 | Distributed under the Boost Software License, Version 1.0. 4 | (See accompanying file LICENSE_1_0.txt or copy at 5 | http://www.boost.org/LICENSE_1_0.txt) 6 | */ 7 | 8 | #ifndef BOOST_PREDEF_ENDIAN_H 9 | #define BOOST_PREDEF_ENDIAN_H 10 | 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | 18 | /*` 19 | [heading `BOOST_ENDIAN_*`] 20 | 21 | Detection of endian memory ordering. There are four defined macros 22 | in this header that define the various generally possible endian 23 | memory orderings: 24 | 25 | * `BOOST_ENDIAN_BIG_BYTE`, byte-swapped big-endian. 26 | * `BOOST_ENDIAN_BIG_WORD`, word-swapped big-endian. 27 | * `BOOST_ENDIAN_LITTLE_BYTE`, byte-swapped little-endian. 28 | * `BOOST_ENDIAN_LITTLE_WORD`, word-swapped little-endian. 29 | 30 | The detection is conservative in that it only identifies endianness 31 | that it knows for certain. In particular bi-endianness is not 32 | indicated as is it not practically possible to determine the 33 | endianness from anything but an operating system provided 34 | header. And the currently known headers do not define that 35 | programatic bi-endianness is available. 36 | 37 | This implementation is a compilation of various publicly available 38 | information and acquired knowledge: 39 | 40 | # The indispensable documentation of "Pre-defined Compiler Macros" 41 | [@http://sourceforge.net/p/predef/wiki/Endianness Endianness]. 42 | # The various endian specifications available in the 43 | [@http://wikipedia.org/ Wikipedia] computer architecture pages. 44 | # Generally available searches for headers that define endianness. 45 | */ 46 | 47 | #define BOOST_ENDIAN_BIG_BYTE BOOST_VERSION_NUMBER_NOT_AVAILABLE 48 | #define BOOST_ENDIAN_BIG_WORD BOOST_VERSION_NUMBER_NOT_AVAILABLE 49 | #define BOOST_ENDIAN_LITTLE_BYTE BOOST_VERSION_NUMBER_NOT_AVAILABLE 50 | #define BOOST_ENDIAN_LITTLE_WORD BOOST_VERSION_NUMBER_NOT_AVAILABLE 51 | 52 | /* GNU libc provides a header defining __BYTE_ORDER, or _BYTE_ORDER. 53 | * And some OSs provide some for of endian header also. 54 | */ 55 | #if !BOOST_ENDIAN_BIG_BYTE && !BOOST_ENDIAN_BIG_WORD && \ 56 | !BOOST_ENDIAN_LITTLE_BYTE && !BOOST_ENDIAN_LITTLE_WORD 57 | # if BOOST_LIB_C_GNU || BOOST_OS_ANDROID 58 | # include 59 | # else 60 | # if BOOST_OS_MACOS 61 | # include 62 | # else 63 | # if BOOST_OS_BSD 64 | # if BOOST_OS_BSD_OPEN 65 | # include 66 | # else 67 | # include 68 | # endif 69 | # endif 70 | # endif 71 | # endif 72 | # if defined(__BYTE_ORDER) 73 | # if defined(__BIG_ENDIAN) && (__BYTE_ORDER == __BIG_ENDIAN) 74 | # undef BOOST_ENDIAN_BIG_BYTE 75 | # define BOOST_ENDIAN_BIG_BYTE BOOST_VERSION_NUMBER_AVAILABLE 76 | # endif 77 | # if defined(__LITTLE_ENDIAN) && (__BYTE_ORDER == __LITTLE_ENDIAN) 78 | # undef BOOST_ENDIAN_LITTLE_BYTE 79 | # define BOOST_ENDIAN_LITTLE_BYTE BOOST_VERSION_NUMBER_AVAILABLE 80 | # endif 81 | # if defined(__PDP_ENDIAN) && (__BYTE_ORDER == __PDP_ENDIAN) 82 | # undef BOOST_ENDIAN_LITTLE_WORD 83 | # define BOOST_ENDIAN_LITTLE_WORD BOOST_VERSION_NUMBER_AVAILABLE 84 | # endif 85 | # endif 86 | # if !defined(__BYTE_ORDER) && defined(_BYTE_ORDER) 87 | # if defined(_BIG_ENDIAN) && (_BYTE_ORDER == _BIG_ENDIAN) 88 | # undef BOOST_ENDIAN_BIG_BYTE 89 | # define BOOST_ENDIAN_BIG_BYTE BOOST_VERSION_NUMBER_AVAILABLE 90 | # endif 91 | # if defined(_LITTLE_ENDIAN) && (_BYTE_ORDER == _LITTLE_ENDIAN) 92 | # undef BOOST_ENDIAN_LITTLE_BYTE 93 | # define BOOST_ENDIAN_LITTLE_BYTE BOOST_VERSION_NUMBER_AVAILABLE 94 | # endif 95 | # if defined(_PDP_ENDIAN) && (_BYTE_ORDER == _PDP_ENDIAN) 96 | # undef BOOST_ENDIAN_LITTLE_WORD 97 | # define BOOST_ENDIAN_LITTLE_WORD BOOST_VERSION_NUMBER_AVAILABLE 98 | # endif 99 | # endif 100 | #endif 101 | 102 | /* Built-in byte-swpped big-endian macros. 103 | */ 104 | #if !BOOST_ENDIAN_BIG_BYTE && !BOOST_ENDIAN_BIG_WORD && \ 105 | !BOOST_ENDIAN_LITTLE_BYTE && !BOOST_ENDIAN_LITTLE_WORD 106 | # if (defined(__BIG_ENDIAN__) && !defined(__LITTLE_ENDIAN__)) || \ 107 | (defined(_BIG_ENDIAN) && !defined(_LITTLE_ENDIAN)) || \ 108 | defined(__ARMEB__) || \ 109 | defined(__THUMBEB__) || \ 110 | defined(__AARCH64EB__) || \ 111 | defined(_MIPSEB) || \ 112 | defined(__MIPSEB) || \ 113 | defined(__MIPSEB__) 114 | # undef BOOST_ENDIAN_BIG_BYTE 115 | # define BOOST_ENDIAN_BIG_BYTE BOOST_VERSION_NUMBER_AVAILABLE 116 | # endif 117 | #endif 118 | 119 | /* Built-in byte-swpped little-endian macros. 120 | */ 121 | #if !BOOST_ENDIAN_BIG_BYTE && !BOOST_ENDIAN_BIG_WORD && \ 122 | !BOOST_ENDIAN_LITTLE_BYTE && !BOOST_ENDIAN_LITTLE_WORD 123 | # if (defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__)) || \ 124 | (defined(_LITTLE_ENDIAN) && !defined(_BIG_ENDIAN)) || \ 125 | defined(__ARMEL__) || \ 126 | defined(__THUMBEL__) || \ 127 | defined(__AARCH64EL__) || \ 128 | defined(_MIPSEL) || \ 129 | defined(__MIPSEL) || \ 130 | defined(__MIPSEL__) 131 | # undef BOOST_ENDIAN_LITTLE_BYTE 132 | # define BOOST_ENDIAN_LITTLE_BYTE BOOST_VERSION_NUMBER_AVAILABLE 133 | # endif 134 | #endif 135 | 136 | /* Some architectures are strictly one endianess (as opposed 137 | * the current common bi-endianess). 138 | */ 139 | #if !BOOST_ENDIAN_BIG_BYTE && !BOOST_ENDIAN_BIG_WORD && \ 140 | !BOOST_ENDIAN_LITTLE_BYTE && !BOOST_ENDIAN_LITTLE_WORD 141 | # include 142 | # if BOOST_ARCH_M68K || \ 143 | BOOST_ARCH_PARISC || \ 144 | BOOST_ARCH_SPARC || \ 145 | BOOST_ARCH_SYS370 || \ 146 | BOOST_ARCH_SYS390 || \ 147 | BOOST_ARCH_Z 148 | # undef BOOST_ENDIAN_BIG_BYTE 149 | # define BOOST_ENDIAN_BIG_BYTE BOOST_VERSION_NUMBER_AVAILABLE 150 | # endif 151 | # if BOOST_ARCH_AMD64 || \ 152 | BOOST_ARCH_IA64 || \ 153 | BOOST_ARCH_X86 || \ 154 | BOOST_ARCH_BLACKFIN 155 | # undef BOOST_ENDIAN_LITTLE_BYTE 156 | # define BOOST_ENDIAN_LITTLE_BYTE BOOST_VERSION_NUMBER_AVAILABLE 157 | # endif 158 | #endif 159 | 160 | /* Windows on ARM, if not otherwise detected/specified, is always 161 | * byte-swaped little-endian. 162 | */ 163 | #if !BOOST_ENDIAN_BIG_BYTE && !BOOST_ENDIAN_BIG_WORD && \ 164 | !BOOST_ENDIAN_LITTLE_BYTE && !BOOST_ENDIAN_LITTLE_WORD 165 | # if BOOST_ARCH_ARM 166 | # include 167 | # if BOOST_OS_WINDOWS 168 | # undef BOOST_ENDIAN_LITTLE_BYTE 169 | # define BOOST_ENDIAN_LITTLE_BYTE BOOST_VERSION_NUMBER_AVAILABLE 170 | # endif 171 | # endif 172 | #endif 173 | 174 | #if BOOST_ENDIAN_BIG_BYTE 175 | # define BOOST_ENDIAN_BIG_BYTE_AVAILABLE 176 | #endif 177 | #if BOOST_ENDIAN_BIG_WORD 178 | # define BOOST_ENDIAN_BIG_WORD_BYTE_AVAILABLE 179 | #endif 180 | #if BOOST_ENDIAN_LITTLE_BYTE 181 | # define BOOST_ENDIAN_LITTLE_BYTE_AVAILABLE 182 | #endif 183 | #if BOOST_ENDIAN_LITTLE_WORD 184 | # define BOOST_ENDIAN_LITTLE_WORD_BYTE_AVAILABLE 185 | #endif 186 | 187 | #define BOOST_ENDIAN_BIG_BYTE_NAME "Byte-Swapped Big-Endian" 188 | #define BOOST_ENDIAN_BIG_WORD_NAME "Word-Swapped Big-Endian" 189 | #define BOOST_ENDIAN_LITTLE_BYTE_NAME "Byte-Swapped Little-Endian" 190 | #define BOOST_ENDIAN_LITTLE_WORD_NAME "Word-Swapped Little-Endian" 191 | 192 | #endif 193 | 194 | #include 195 | BOOST_PREDEF_DECLARE_TEST(BOOST_ENDIAN_BIG_BYTE,BOOST_ENDIAN_BIG_BYTE_NAME) 196 | 197 | #include 198 | BOOST_PREDEF_DECLARE_TEST(BOOST_ENDIAN_BIG_WORD,BOOST_ENDIAN_BIG_WORD_NAME) 199 | 200 | #include 201 | BOOST_PREDEF_DECLARE_TEST(BOOST_ENDIAN_LITTLE_BYTE,BOOST_ENDIAN_LITTLE_BYTE_NAME) 202 | 203 | #include 204 | BOOST_PREDEF_DECLARE_TEST(BOOST_ENDIAN_LITTLE_WORD,BOOST_ENDIAN_LITTLE_WORD_NAME) 205 | -------------------------------------------------------------------------------- /cv_bridge/src/boost/predef/version_number.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright Rene Rivera 2005, 2008-2013 3 | Distributed under the Boost Software License, Version 1.0. 4 | (See accompanying file LICENSE_1_0.txt or copy at 5 | http://www.boost.org/LICENSE_1_0.txt) 6 | */ 7 | 8 | #ifndef BOOST_PREDEF_VERSION_NUMBER_H 9 | #define BOOST_PREDEF_VERSION_NUMBER_H 10 | 11 | /*` 12 | [heading `BOOST_VERSION_NUMBER`] 13 | 14 | `` 15 | BOOST_VERSION_NUMBER(major,minor,patch) 16 | `` 17 | 18 | Defines standard version numbers, with these properties: 19 | 20 | * Decimal base whole numbers in the range \[0,1000000000). 21 | The number range is designed to allow for a (2,2,5) triplet. 22 | Which fits within a 32 bit value. 23 | * The `major` number can be in the \[0,99\] range. 24 | * The `minor` number can be in the \[0,99\] range. 25 | * The `patch` number can be in the \[0,99999\] range. 26 | * Values can be specified in any base. As the defined value 27 | is an constant expression. 28 | * Value can be directly used in both preprocessor and compiler 29 | expressions for comparison to other similarly defined values. 30 | * The implementation enforces the individual ranges for the 31 | major, minor, and patch numbers. And values over the ranges 32 | are truncated (modulo). 33 | 34 | */ 35 | #define BOOST_VERSION_NUMBER(major,minor,patch) \ 36 | ( (((major)%100)*10000000) + (((minor)%100)*100000) + ((patch)%100000) ) 37 | 38 | #define BOOST_VERSION_NUMBER_MAX \ 39 | BOOST_VERSION_NUMBER(99,99,99999) 40 | 41 | #define BOOST_VERSION_NUMBER_ZERO \ 42 | BOOST_VERSION_NUMBER(0,0,0) 43 | 44 | #define BOOST_VERSION_NUMBER_MIN \ 45 | BOOST_VERSION_NUMBER(0,0,1) 46 | 47 | #define BOOST_VERSION_NUMBER_AVAILABLE \ 48 | BOOST_VERSION_NUMBER_MIN 49 | 50 | #define BOOST_VERSION_NUMBER_NOT_AVAILABLE \ 51 | BOOST_VERSION_NUMBER_ZERO 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /cv_bridge/src/module.cpp: -------------------------------------------------------------------------------- 1 | /********************************************************************* 2 | * Software License Agreement (BSD License) 3 | * 4 | * Copyright (c) 2012, Willow Garage, Inc. 5 | * All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions 9 | * are met: 10 | * 11 | * * Redistributions of source code must retain the above copyright 12 | * notice, this list of conditions and the following disclaimer. 13 | * * Redistributions in binary form must reproduce the above 14 | * copyright notice, this list of conditions and the following 15 | * disclaimer in the documentation and/or other materials provided 16 | * with the distribution. 17 | * * Neither the name of the Willow Garage nor the names of its 18 | * contributors may be used to endorse or promote products derived 19 | * from this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 24 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 25 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 26 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 27 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 28 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 29 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 31 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 32 | * POSSIBILITY OF SUCH DAMAGE. 33 | *********************************************************************/ 34 | 35 | #include "module.hpp" 36 | 37 | PyObject *mod_opencv; 38 | 39 | bp::object 40 | cvtColor2Wrap(bp::object obj_in, const std::string & encoding_in, const std::string & encoding_out) { 41 | // Convert the Python input to an image 42 | cv::Mat mat_in; 43 | convert_to_CvMat2(obj_in.ptr(), mat_in); 44 | 45 | // Call cv_bridge for color conversion 46 | cv_bridge::CvImagePtr cv_image(new cv_bridge::CvImage(std_msgs::Header(), encoding_in, mat_in)); 47 | 48 | cv::Mat mat = cv_bridge::cvtColor(cv_image, encoding_out)->image; 49 | 50 | return bp::object(boost::python::handle<>(pyopencv_from(mat))); 51 | } 52 | 53 | bp::object 54 | cvtColorForDisplayWrap(bp::object obj_in, 55 | const std::string & encoding_in, 56 | const std::string & encoding_out, 57 | bool do_dynamic_scaling = false, 58 | double min_image_value = 0.0, 59 | double max_image_value = 0.0) { 60 | // Convert the Python input to an image 61 | cv::Mat mat_in; 62 | convert_to_CvMat2(obj_in.ptr(), mat_in); 63 | 64 | cv_bridge::CvImagePtr cv_image(new cv_bridge::CvImage(std_msgs::Header(), encoding_in, mat_in)); 65 | 66 | cv_bridge::CvtColorForDisplayOptions options; 67 | options.do_dynamic_scaling = do_dynamic_scaling; 68 | options.min_image_value = min_image_value; 69 | options.max_image_value = max_image_value; 70 | cv::Mat mat = cv_bridge::cvtColorForDisplay(/*source=*/cv_image, 71 | /*encoding_out=*/encoding_out, 72 | /*options=*/options)->image; 73 | 74 | return bp::object(boost::python::handle<>(pyopencv_from(mat))); 75 | } 76 | 77 | BOOST_PYTHON_FUNCTION_OVERLOADS(cvtColorForDisplayWrap_overloads, cvtColorForDisplayWrap, 3, 6) 78 | 79 | int CV_MAT_CNWrap(int i) { 80 | return CV_MAT_CN(i); 81 | } 82 | 83 | int CV_MAT_DEPTHWrap(int i) { 84 | return CV_MAT_DEPTH(i); 85 | } 86 | 87 | BOOST_PYTHON_MODULE(cv_bridge_boost) 88 | { 89 | do_numpy_import(); 90 | mod_opencv = PyImport_ImportModule("cv2"); 91 | 92 | // Wrap the function to get encodings as OpenCV types 93 | boost::python::def("getCvType", cv_bridge::getCvType); 94 | boost::python::def("cvtColor2", cvtColor2Wrap); 95 | boost::python::def("CV_MAT_CNWrap", CV_MAT_CNWrap); 96 | boost::python::def("CV_MAT_DEPTHWrap", CV_MAT_DEPTHWrap); 97 | boost::python::def("cvtColorForDisplay", cvtColorForDisplayWrap, 98 | cvtColorForDisplayWrap_overloads( 99 | boost::python::args("source", "encoding_in", "encoding_out", "do_dynamic_scaling", 100 | "min_image_value", "max_image_value"), 101 | "Convert image to display with specified encodings.\n\n" 102 | "Args:\n" 103 | " - source (numpy.ndarray): input image\n" 104 | " - encoding_in (str): input image encoding\n" 105 | " - encoding_out (str): encoding to which the image conveted\n" 106 | " - do_dynamic_scaling (bool): flag to do dynamic scaling with min/max value\n" 107 | " - min_image_value (float): minimum pixel value for dynamic scaling\n" 108 | " - max_image_value (float): maximum pixel value for dynamic scaling\n" 109 | )); 110 | } 111 | -------------------------------------------------------------------------------- /cv_bridge/src/module.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014 Open Source Robotics Foundation, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef CV_BRIDGE_MODULE_HPP_ 18 | #define CV_BRIDGE_MODULE_HPP_ 19 | 20 | #include 21 | #include 22 | #include 23 | #include 24 | 25 | #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION 26 | #include 27 | 28 | #include 29 | 30 | namespace bp = boost::python; 31 | 32 | int convert_to_CvMat2(const PyObject* o, cv::Mat& m); 33 | 34 | PyObject* pyopencv_from(const cv::Mat& m); 35 | 36 | static void do_numpy_import( ) 37 | { 38 | import_array( ); 39 | } 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /cv_bridge/src/module_opencv4.cpp: -------------------------------------------------------------------------------- 1 | // Taken from opencv/modules/python/src2/cv2.cpp 2 | 3 | #include "module.hpp" 4 | 5 | #include "opencv2/core/types_c.h" 6 | 7 | #include "opencv2/opencv_modules.hpp" 8 | 9 | #include "pycompat.hpp" 10 | 11 | static PyObject* opencv_error = 0; 12 | 13 | static int failmsg(const char *fmt, ...) 14 | { 15 | char str[1000]; 16 | 17 | va_list ap; 18 | va_start(ap, fmt); 19 | vsnprintf(str, sizeof(str), fmt, ap); 20 | va_end(ap); 21 | 22 | PyErr_SetString(PyExc_TypeError, str); 23 | return 0; 24 | } 25 | 26 | struct ArgInfo 27 | { 28 | const char * name; 29 | bool outputarg; 30 | // more fields may be added if necessary 31 | 32 | ArgInfo(const char * name_, bool outputarg_) 33 | : name(name_) 34 | , outputarg(outputarg_) {} 35 | 36 | // to match with older pyopencv_to function signature 37 | operator const char *() const { return name; } 38 | }; 39 | 40 | class PyAllowThreads 41 | { 42 | public: 43 | PyAllowThreads() : _state(PyEval_SaveThread()) {} 44 | ~PyAllowThreads() 45 | { 46 | PyEval_RestoreThread(_state); 47 | } 48 | private: 49 | PyThreadState* _state; 50 | }; 51 | 52 | class PyEnsureGIL 53 | { 54 | public: 55 | PyEnsureGIL() : _state(PyGILState_Ensure()) {} 56 | ~PyEnsureGIL() 57 | { 58 | PyGILState_Release(_state); 59 | } 60 | private: 61 | PyGILState_STATE _state; 62 | }; 63 | 64 | #define ERRWRAP2(expr) \ 65 | try \ 66 | { \ 67 | PyAllowThreads allowThreads; \ 68 | expr; \ 69 | } \ 70 | catch (const cv::Exception &e) \ 71 | { \ 72 | PyErr_SetString(opencv_error, e.what()); \ 73 | return 0; \ 74 | } 75 | 76 | using namespace cv; 77 | 78 | static PyObject* failmsgp(const char *fmt, ...) 79 | { 80 | char str[1000]; 81 | 82 | va_list ap; 83 | va_start(ap, fmt); 84 | vsnprintf(str, sizeof(str), fmt, ap); 85 | va_end(ap); 86 | 87 | PyErr_SetString(PyExc_TypeError, str); 88 | return 0; 89 | } 90 | 91 | class NumpyAllocator : public MatAllocator 92 | { 93 | #if CV_MAJOR_VERSION == 3 94 | protected: 95 | typedef int AccessFlag; 96 | #endif 97 | 98 | public: 99 | NumpyAllocator() { stdAllocator = Mat::getStdAllocator(); } 100 | ~NumpyAllocator() {} 101 | 102 | UMatData* allocate(PyObject* o, int dims, const int* sizes, int type, size_t* step) const 103 | { 104 | UMatData* u = new UMatData(this); 105 | u->data = u->origdata = (uchar*)PyArray_DATA((PyArrayObject*) o); 106 | npy_intp* _strides = PyArray_STRIDES((PyArrayObject*) o); 107 | for( int i = 0; i < dims - 1; i++ ) 108 | step[i] = (size_t)_strides[i]; 109 | step[dims-1] = CV_ELEM_SIZE(type); 110 | u->size = sizes[0]*step[0]; 111 | u->userdata = o; 112 | return u; 113 | } 114 | 115 | UMatData* allocate(int dims0, const int* sizes, int type, void* data, size_t* step, AccessFlag flags, UMatUsageFlags usageFlags) const 116 | { 117 | if( data != 0 ) 118 | { 119 | CV_Error(Error::StsAssert, "The data should normally be NULL!"); 120 | // probably this is safe to do in such extreme case 121 | return stdAllocator->allocate(dims0, sizes, type, data, step, flags, usageFlags); 122 | } 123 | PyEnsureGIL gil; 124 | 125 | int depth = CV_MAT_DEPTH(type); 126 | int cn = CV_MAT_CN(type); 127 | const int f = (int)(sizeof(size_t)/8); 128 | int typenum = depth == CV_8U ? NPY_UBYTE : depth == CV_8S ? NPY_BYTE : 129 | depth == CV_16U ? NPY_USHORT : depth == CV_16S ? NPY_SHORT : 130 | depth == CV_32S ? NPY_INT : depth == CV_32F ? NPY_FLOAT : 131 | depth == CV_64F ? NPY_DOUBLE : f*NPY_ULONGLONG + (f^1)*NPY_UINT; 132 | int i, dims = dims0; 133 | cv::AutoBuffer _sizes(dims + 1); 134 | for( i = 0; i < dims; i++ ) 135 | _sizes[i] = sizes[i]; 136 | if( cn > 1 ) 137 | _sizes[dims++] = cn; 138 | PyObject* o = PyArray_SimpleNew(dims, _sizes, typenum); 139 | if(!o) 140 | CV_Error_(Error::StsError, ("The numpy array of typenum=%d, ndims=%d can not be created", typenum, dims)); 141 | return allocate(o, dims0, sizes, type, step); 142 | } 143 | 144 | bool allocate(UMatData* u, AccessFlag accessFlags, UMatUsageFlags usageFlags) const 145 | { 146 | return stdAllocator->allocate(u, accessFlags, usageFlags); 147 | } 148 | 149 | void deallocate(UMatData* u) const 150 | { 151 | if(u) 152 | { 153 | PyEnsureGIL gil; 154 | PyObject* o = (PyObject*)u->userdata; 155 | Py_XDECREF(o); 156 | delete u; 157 | } 158 | } 159 | 160 | const MatAllocator* stdAllocator; 161 | }; 162 | 163 | NumpyAllocator g_numpyAllocator; 164 | 165 | 166 | template static 167 | bool pyopencv_to(PyObject* obj, T& p, const char* name = ""); 168 | 169 | template static 170 | PyObject* pyopencv_from(const T& src); 171 | 172 | enum { ARG_NONE = 0, ARG_MAT = 1, ARG_SCALAR = 2 }; 173 | 174 | // special case, when the convertor needs full ArgInfo structure 175 | static bool pyopencv_to(PyObject* o, Mat& m, const ArgInfo info) 176 | { 177 | // to avoid PyArray_Check() to crash even with valid array 178 | do_numpy_import( ); 179 | 180 | 181 | bool allowND = true; 182 | if(!o || o == Py_None) 183 | { 184 | if( !m.data ) 185 | m.allocator = &g_numpyAllocator; 186 | return true; 187 | } 188 | 189 | if( PyInt_Check(o) ) 190 | { 191 | double v[] = {(double)PyInt_AsLong((PyObject*)o), 0., 0., 0.}; 192 | m = Mat(4, 1, CV_64F, v).clone(); 193 | return true; 194 | } 195 | if( PyFloat_Check(o) ) 196 | { 197 | double v[] = {PyFloat_AsDouble((PyObject*)o), 0., 0., 0.}; 198 | m = Mat(4, 1, CV_64F, v).clone(); 199 | return true; 200 | } 201 | if( PyTuple_Check(o) ) 202 | { 203 | int i, sz = (int)PyTuple_Size((PyObject*)o); 204 | m = Mat(sz, 1, CV_64F); 205 | for( i = 0; i < sz; i++ ) 206 | { 207 | PyObject* oi = PyTuple_GET_ITEM(o, i); 208 | if( PyInt_Check(oi) ) 209 | m.at(i) = (double)PyInt_AsLong(oi); 210 | else if( PyFloat_Check(oi) ) 211 | m.at(i) = (double)PyFloat_AsDouble(oi); 212 | else 213 | { 214 | failmsg("%s is not a numerical tuple", info.name); 215 | m.release(); 216 | return false; 217 | } 218 | } 219 | return true; 220 | } 221 | 222 | if( !PyArray_Check(o) ) 223 | { 224 | failmsg("%s is not a numpy array, neither a scalar", info.name); 225 | return false; 226 | } 227 | 228 | PyArrayObject* oarr = (PyArrayObject*) o; 229 | 230 | bool needcopy = false, needcast = false; 231 | int typenum = PyArray_TYPE(oarr), new_typenum = typenum; 232 | int type = typenum == NPY_UBYTE ? CV_8U : 233 | typenum == NPY_BYTE ? CV_8S : 234 | typenum == NPY_USHORT ? CV_16U : 235 | typenum == NPY_SHORT ? CV_16S : 236 | typenum == NPY_INT ? CV_32S : 237 | typenum == NPY_INT32 ? CV_32S : 238 | typenum == NPY_FLOAT ? CV_32F : 239 | typenum == NPY_DOUBLE ? CV_64F : -1; 240 | 241 | if( type < 0 ) 242 | { 243 | if( typenum == NPY_INT64 || typenum == NPY_UINT64 || type == NPY_LONG ) 244 | { 245 | needcopy = needcast = true; 246 | new_typenum = NPY_INT; 247 | type = CV_32S; 248 | } 249 | else 250 | { 251 | failmsg("%s data type = %d is not supported", info.name, typenum); 252 | return false; 253 | } 254 | } 255 | 256 | #ifndef CV_MAX_DIM 257 | const int CV_MAX_DIM = 32; 258 | #endif 259 | 260 | int ndims = PyArray_NDIM(oarr); 261 | if(ndims >= CV_MAX_DIM) 262 | { 263 | failmsg("%s dimensionality (=%d) is too high", info.name, ndims); 264 | return false; 265 | } 266 | 267 | int size[CV_MAX_DIM+1]; 268 | size_t step[CV_MAX_DIM+1]; 269 | size_t elemsize = CV_ELEM_SIZE1(type); 270 | const npy_intp* _sizes = PyArray_DIMS(oarr); 271 | const npy_intp* _strides = PyArray_STRIDES(oarr); 272 | bool ismultichannel = ndims == 3 && _sizes[2] <= CV_CN_MAX; 273 | 274 | for( int i = ndims-1; i >= 0 && !needcopy; i-- ) 275 | { 276 | // these checks handle cases of 277 | // a) multi-dimensional (ndims > 2) arrays, as well as simpler 1- and 2-dimensional cases 278 | // b) transposed arrays, where _strides[] elements go in non-descending order 279 | // c) flipped arrays, where some of _strides[] elements are negative 280 | if( (i == ndims-1 && (size_t)_strides[i] != elemsize) || 281 | (i < ndims-1 && _strides[i] < _strides[i+1]) ) 282 | needcopy = true; 283 | } 284 | 285 | if( ismultichannel && _strides[1] != (npy_intp)elemsize*_sizes[2] ) 286 | needcopy = true; 287 | 288 | if (needcopy) 289 | { 290 | if (info.outputarg) 291 | { 292 | failmsg("Layout of the output array %s is incompatible with cv::Mat (step[ndims-1] != elemsize or step[1] != elemsize*nchannels)", info.name); 293 | return false; 294 | } 295 | 296 | if( needcast ) { 297 | o = PyArray_Cast(oarr, new_typenum); 298 | oarr = (PyArrayObject*) o; 299 | } 300 | else { 301 | oarr = PyArray_GETCONTIGUOUS(oarr); 302 | o = (PyObject*) oarr; 303 | } 304 | 305 | _strides = PyArray_STRIDES(oarr); 306 | } 307 | 308 | for(int i = 0; i < ndims; i++) 309 | { 310 | size[i] = (int)_sizes[i]; 311 | step[i] = (size_t)_strides[i]; 312 | } 313 | 314 | // handle degenerate case 315 | if( ndims == 0) { 316 | size[ndims] = 1; 317 | step[ndims] = elemsize; 318 | ndims++; 319 | } 320 | 321 | if( ismultichannel ) 322 | { 323 | ndims--; 324 | type |= CV_MAKETYPE(0, size[2]); 325 | } 326 | 327 | if( ndims > 2 && !allowND ) 328 | { 329 | failmsg("%s has more than 2 dimensions", info.name); 330 | return false; 331 | } 332 | 333 | m = Mat(ndims, size, type, PyArray_DATA(oarr), step); 334 | m.u = g_numpyAllocator.allocate(o, ndims, size, type, step); 335 | m.addref(); 336 | 337 | if( !needcopy ) 338 | { 339 | Py_INCREF(o); 340 | } 341 | m.allocator = &g_numpyAllocator; 342 | 343 | return true; 344 | } 345 | 346 | template<> 347 | bool pyopencv_to(PyObject* o, Mat& m, const char* name) 348 | { 349 | return pyopencv_to(o, m, ArgInfo(name, 0)); 350 | } 351 | 352 | PyObject* pyopencv_from(const Mat& m) 353 | { 354 | if( !m.data ) 355 | Py_RETURN_NONE; 356 | Mat temp, *p = (Mat*)&m; 357 | if(!p->u || p->allocator != &g_numpyAllocator) 358 | { 359 | temp.allocator = &g_numpyAllocator; 360 | ERRWRAP2(m.copyTo(temp)); 361 | p = &temp; 362 | } 363 | PyObject* o = (PyObject*)p->u->userdata; 364 | Py_INCREF(o); 365 | return o; 366 | } 367 | 368 | int convert_to_CvMat2(const PyObject* o, cv::Mat& m) 369 | { 370 | pyopencv_to(const_cast(o), m, "unknown"); 371 | return 0; 372 | } 373 | -------------------------------------------------------------------------------- /cv_bridge/src/pycompat.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009-2011, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | // Defines for Python 2/3 compatibility. 44 | #ifndef __PYCOMPAT_HPP__ 45 | #define __PYCOMPAT_HPP__ 46 | 47 | #if PY_MAJOR_VERSION >= 3 48 | // Python3 treats all ints as longs, PyInt_X functions have been removed. 49 | #define PyInt_Check PyLong_Check 50 | #define PyInt_CheckExact PyLong_CheckExact 51 | #define PyInt_AsLong PyLong_AsLong 52 | #define PyInt_AS_LONG PyLong_AS_LONG 53 | #define PyInt_FromLong PyLong_FromLong 54 | #define PyNumber_Int PyNumber_Long 55 | 56 | // Python3 strings are unicode, these defines mimic the Python2 functionality. 57 | #define PyString_Check PyUnicode_Check 58 | #define PyString_FromString PyUnicode_FromString 59 | #define PyString_FromStringAndSize PyUnicode_FromStringAndSize 60 | #define PyString_Size PyUnicode_GET_SIZE 61 | 62 | // PyUnicode_AsUTF8 isn't available until Python 3.3 63 | #if (PY_VERSION_HEX < 0x03030000) 64 | #define PyString_AsString _PyUnicode_AsString 65 | #else 66 | #define PyString_AsString PyUnicode_AsUTF8 67 | #endif 68 | #endif 69 | 70 | #endif // END HEADER GUARD 71 | -------------------------------------------------------------------------------- /cv_bridge/src/rgb_colors.cpp: -------------------------------------------------------------------------------- 1 | // -*- mode: c++ -*- 2 | /********************************************************************* 3 | * Original color definition is at scikit-image distributed with 4 | * following license disclaimer: 5 | * 6 | * Copyright (C) 2011, the scikit-image team 7 | * All rights reserved. 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions are 11 | * met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 2. Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in 17 | * the documentation and/or other materials provided with the 18 | * distribution. 19 | * 3. Neither the name of skimage nor the names of its contributors may be 20 | * used to endorse or promote products derived from this software without 21 | * specific prior written permission. 22 | * 23 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 24 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 25 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 26 | * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, 27 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 28 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 29 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 31 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 32 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 33 | * POSSIBILITY OF SUCH DAMAGE. 34 | *********************************************************************/ 35 | 36 | #include "cv_bridge/rgb_colors.h" 37 | 38 | 39 | namespace cv_bridge 40 | { 41 | 42 | namespace rgb_colors 43 | { 44 | 45 | cv::Vec3d getRGBColor(const int color) 46 | { 47 | cv::Vec3d c; 48 | switch (color % 146) { 49 | case ALICEBLUE: c = cv::Vec3d(0.941, 0.973, 1); break; 50 | case ANTIQUEWHITE: c = cv::Vec3d(0.98, 0.922, 0.843); break; 51 | case AQUA: c = cv::Vec3d(0, 1, 1); break; 52 | case AQUAMARINE: c = cv::Vec3d(0.498, 1, 0.831); break; 53 | case AZURE: c = cv::Vec3d(0.941, 1, 1); break; 54 | case BEIGE: c = cv::Vec3d(0.961, 0.961, 0.863); break; 55 | case BISQUE: c = cv::Vec3d(1, 0.894, 0.769); break; 56 | case BLACK: c = cv::Vec3d(0, 0, 0); break; 57 | case BLANCHEDALMOND: c = cv::Vec3d(1, 0.922, 0.804); break; 58 | case BLUE: c = cv::Vec3d(0, 0, 1); break; 59 | case BLUEVIOLET: c = cv::Vec3d(0.541, 0.169, 0.886); break; 60 | case BROWN: c = cv::Vec3d(0.647, 0.165, 0.165); break; 61 | case BURLYWOOD: c = cv::Vec3d(0.871, 0.722, 0.529); break; 62 | case CADETBLUE: c = cv::Vec3d(0.373, 0.62, 0.627); break; 63 | case CHARTREUSE: c = cv::Vec3d(0.498, 1, 0); break; 64 | case CHOCOLATE: c = cv::Vec3d(0.824, 0.412, 0.118); break; 65 | case CORAL: c = cv::Vec3d(1, 0.498, 0.314); break; 66 | case CORNFLOWERBLUE: c = cv::Vec3d(0.392, 0.584, 0.929); break; 67 | case CORNSILK: c = cv::Vec3d(1, 0.973, 0.863); break; 68 | case CRIMSON: c = cv::Vec3d(0.863, 0.0784, 0.235); break; 69 | case CYAN: c = cv::Vec3d(0, 1, 1); break; 70 | case DARKBLUE: c = cv::Vec3d(0, 0, 0.545); break; 71 | case DARKCYAN: c = cv::Vec3d(0, 0.545, 0.545); break; 72 | case DARKGOLDENROD: c = cv::Vec3d(0.722, 0.525, 0.0431); break; 73 | case DARKGRAY: c = cv::Vec3d(0.663, 0.663, 0.663); break; 74 | case DARKGREEN: c = cv::Vec3d(0, 0.392, 0); break; 75 | case DARKGREY: c = cv::Vec3d(0.663, 0.663, 0.663); break; 76 | case DARKKHAKI: c = cv::Vec3d(0.741, 0.718, 0.42); break; 77 | case DARKMAGENTA: c = cv::Vec3d(0.545, 0, 0.545); break; 78 | case DARKOLIVEGREEN: c = cv::Vec3d(0.333, 0.42, 0.184); break; 79 | case DARKORANGE: c = cv::Vec3d(1, 0.549, 0); break; 80 | case DARKORCHID: c = cv::Vec3d(0.6, 0.196, 0.8); break; 81 | case DARKRED: c = cv::Vec3d(0.545, 0, 0); break; 82 | case DARKSALMON: c = cv::Vec3d(0.914, 0.588, 0.478); break; 83 | case DARKSEAGREEN: c = cv::Vec3d(0.561, 0.737, 0.561); break; 84 | case DARKSLATEBLUE: c = cv::Vec3d(0.282, 0.239, 0.545); break; 85 | case DARKSLATEGRAY: c = cv::Vec3d(0.184, 0.31, 0.31); break; 86 | case DARKSLATEGREY: c = cv::Vec3d(0.184, 0.31, 0.31); break; 87 | case DARKTURQUOISE: c = cv::Vec3d(0, 0.808, 0.82); break; 88 | case DARKVIOLET: c = cv::Vec3d(0.58, 0, 0.827); break; 89 | case DEEPPINK: c = cv::Vec3d(1, 0.0784, 0.576); break; 90 | case DEEPSKYBLUE: c = cv::Vec3d(0, 0.749, 1); break; 91 | case DIMGRAY: c = cv::Vec3d(0.412, 0.412, 0.412); break; 92 | case DIMGREY: c = cv::Vec3d(0.412, 0.412, 0.412); break; 93 | case DODGERBLUE: c = cv::Vec3d(0.118, 0.565, 1); break; 94 | case FIREBRICK: c = cv::Vec3d(0.698, 0.133, 0.133); break; 95 | case FLORALWHITE: c = cv::Vec3d(1, 0.98, 0.941); break; 96 | case FORESTGREEN: c = cv::Vec3d(0.133, 0.545, 0.133); break; 97 | case FUCHSIA: c = cv::Vec3d(1, 0, 1); break; 98 | case GAINSBORO: c = cv::Vec3d(0.863, 0.863, 0.863); break; 99 | case GHOSTWHITE: c = cv::Vec3d(0.973, 0.973, 1); break; 100 | case GOLD: c = cv::Vec3d(1, 0.843, 0); break; 101 | case GOLDENROD: c = cv::Vec3d(0.855, 0.647, 0.125); break; 102 | case GRAY: c = cv::Vec3d(0.502, 0.502, 0.502); break; 103 | case GREEN: c = cv::Vec3d(0, 0.502, 0); break; 104 | case GREENYELLOW: c = cv::Vec3d(0.678, 1, 0.184); break; 105 | case GREY: c = cv::Vec3d(0.502, 0.502, 0.502); break; 106 | case HONEYDEW: c = cv::Vec3d(0.941, 1, 0.941); break; 107 | case HOTPINK: c = cv::Vec3d(1, 0.412, 0.706); break; 108 | case INDIANRED: c = cv::Vec3d(0.804, 0.361, 0.361); break; 109 | case INDIGO: c = cv::Vec3d(0.294, 0, 0.51); break; 110 | case IVORY: c = cv::Vec3d(1, 1, 0.941); break; 111 | case KHAKI: c = cv::Vec3d(0.941, 0.902, 0.549); break; 112 | case LAVENDER: c = cv::Vec3d(0.902, 0.902, 0.98); break; 113 | case LAVENDERBLUSH: c = cv::Vec3d(1, 0.941, 0.961); break; 114 | case LAWNGREEN: c = cv::Vec3d(0.486, 0.988, 0); break; 115 | case LEMONCHIFFON: c = cv::Vec3d(1, 0.98, 0.804); break; 116 | case LIGHTBLUE: c = cv::Vec3d(0.678, 0.847, 0.902); break; 117 | case LIGHTCORAL: c = cv::Vec3d(0.941, 0.502, 0.502); break; 118 | case LIGHTCYAN: c = cv::Vec3d(0.878, 1, 1); break; 119 | case LIGHTGOLDENRODYELLOW: c = cv::Vec3d(0.98, 0.98, 0.824); break; 120 | case LIGHTGRAY: c = cv::Vec3d(0.827, 0.827, 0.827); break; 121 | case LIGHTGREEN: c = cv::Vec3d(0.565, 0.933, 0.565); break; 122 | case LIGHTGREY: c = cv::Vec3d(0.827, 0.827, 0.827); break; 123 | case LIGHTPINK: c = cv::Vec3d(1, 0.714, 0.757); break; 124 | case LIGHTSALMON: c = cv::Vec3d(1, 0.627, 0.478); break; 125 | case LIGHTSEAGREEN: c = cv::Vec3d(0.125, 0.698, 0.667); break; 126 | case LIGHTSKYBLUE: c = cv::Vec3d(0.529, 0.808, 0.98); break; 127 | case LIGHTSLATEGRAY: c = cv::Vec3d(0.467, 0.533, 0.6); break; 128 | case LIGHTSLATEGREY: c = cv::Vec3d(0.467, 0.533, 0.6); break; 129 | case LIGHTSTEELBLUE: c = cv::Vec3d(0.69, 0.769, 0.871); break; 130 | case LIGHTYELLOW: c = cv::Vec3d(1, 1, 0.878); break; 131 | case LIME: c = cv::Vec3d(0, 1, 0); break; 132 | case LIMEGREEN: c = cv::Vec3d(0.196, 0.804, 0.196); break; 133 | case LINEN: c = cv::Vec3d(0.98, 0.941, 0.902); break; 134 | case MAGENTA: c = cv::Vec3d(1, 0, 1); break; 135 | case MAROON: c = cv::Vec3d(0.502, 0, 0); break; 136 | case MEDIUMAQUAMARINE: c = cv::Vec3d(0.4, 0.804, 0.667); break; 137 | case MEDIUMBLUE: c = cv::Vec3d(0, 0, 0.804); break; 138 | case MEDIUMORCHID: c = cv::Vec3d(0.729, 0.333, 0.827); break; 139 | case MEDIUMPURPLE: c = cv::Vec3d(0.576, 0.439, 0.859); break; 140 | case MEDIUMSEAGREEN: c = cv::Vec3d(0.235, 0.702, 0.443); break; 141 | case MEDIUMSLATEBLUE: c = cv::Vec3d(0.482, 0.408, 0.933); break; 142 | case MEDIUMSPRINGGREEN: c = cv::Vec3d(0, 0.98, 0.604); break; 143 | case MEDIUMTURQUOISE: c = cv::Vec3d(0.282, 0.82, 0.8); break; 144 | case MEDIUMVIOLETRED: c = cv::Vec3d(0.78, 0.0824, 0.522); break; 145 | case MIDNIGHTBLUE: c = cv::Vec3d(0.098, 0.098, 0.439); break; 146 | case MINTCREAM: c = cv::Vec3d(0.961, 1, 0.98); break; 147 | case MISTYROSE: c = cv::Vec3d(1, 0.894, 0.882); break; 148 | case MOCCASIN: c = cv::Vec3d(1, 0.894, 0.71); break; 149 | case NAVAJOWHITE: c = cv::Vec3d(1, 0.871, 0.678); break; 150 | case NAVY: c = cv::Vec3d(0, 0, 0.502); break; 151 | case OLDLACE: c = cv::Vec3d(0.992, 0.961, 0.902); break; 152 | case OLIVE: c = cv::Vec3d(0.502, 0.502, 0); break; 153 | case OLIVEDRAB: c = cv::Vec3d(0.42, 0.557, 0.137); break; 154 | case ORANGE: c = cv::Vec3d(1, 0.647, 0); break; 155 | case ORANGERED: c = cv::Vec3d(1, 0.271, 0); break; 156 | case ORCHID: c = cv::Vec3d(0.855, 0.439, 0.839); break; 157 | case PALEGOLDENROD: c = cv::Vec3d(0.933, 0.91, 0.667); break; 158 | case PALEGREEN: c = cv::Vec3d(0.596, 0.984, 0.596); break; 159 | case PALEVIOLETRED: c = cv::Vec3d(0.686, 0.933, 0.933); break; 160 | case PAPAYAWHIP: c = cv::Vec3d(1, 0.937, 0.835); break; 161 | case PEACHPUFF: c = cv::Vec3d(1, 0.855, 0.725); break; 162 | case PERU: c = cv::Vec3d(0.804, 0.522, 0.247); break; 163 | case PINK: c = cv::Vec3d(1, 0.753, 0.796); break; 164 | case PLUM: c = cv::Vec3d(0.867, 0.627, 0.867); break; 165 | case POWDERBLUE: c = cv::Vec3d(0.69, 0.878, 0.902); break; 166 | case PURPLE: c = cv::Vec3d(0.502, 0, 0.502); break; 167 | case RED: c = cv::Vec3d(1, 0, 0); break; 168 | case ROSYBROWN: c = cv::Vec3d(0.737, 0.561, 0.561); break; 169 | case ROYALBLUE: c = cv::Vec3d(0.255, 0.412, 0.882); break; 170 | case SADDLEBROWN: c = cv::Vec3d(0.545, 0.271, 0.0745); break; 171 | case SALMON: c = cv::Vec3d(0.98, 0.502, 0.447); break; 172 | case SANDYBROWN: c = cv::Vec3d(0.98, 0.643, 0.376); break; 173 | case SEAGREEN: c = cv::Vec3d(0.18, 0.545, 0.341); break; 174 | case SEASHELL: c = cv::Vec3d(1, 0.961, 0.933); break; 175 | case SIENNA: c = cv::Vec3d(0.627, 0.322, 0.176); break; 176 | case SILVER: c = cv::Vec3d(0.753, 0.753, 0.753); break; 177 | case SKYBLUE: c = cv::Vec3d(0.529, 0.808, 0.922); break; 178 | case SLATEBLUE: c = cv::Vec3d(0.416, 0.353, 0.804); break; 179 | case SLATEGRAY: c = cv::Vec3d(0.439, 0.502, 0.565); break; 180 | case SLATEGREY: c = cv::Vec3d(0.439, 0.502, 0.565); break; 181 | case SNOW: c = cv::Vec3d(1, 0.98, 0.98); break; 182 | case SPRINGGREEN: c = cv::Vec3d(0, 1, 0.498); break; 183 | case STEELBLUE: c = cv::Vec3d(0.275, 0.51, 0.706); break; 184 | case TAN: c = cv::Vec3d(0.824, 0.706, 0.549); break; 185 | case TEAL: c = cv::Vec3d(0, 0.502, 0.502); break; 186 | case THISTLE: c = cv::Vec3d(0.847, 0.749, 0.847); break; 187 | case TOMATO: c = cv::Vec3d(1, 0.388, 0.278); break; 188 | case TURQUOISE: c = cv::Vec3d(0.251, 0.878, 0.816); break; 189 | case VIOLET: c = cv::Vec3d(0.933, 0.51, 0.933); break; 190 | case WHEAT: c = cv::Vec3d(0.961, 0.871, 0.702); break; 191 | case WHITE: c = cv::Vec3d(1, 1, 1); break; 192 | case WHITESMOKE: c = cv::Vec3d(0.961, 0.961, 0.961); break; 193 | case YELLOW: c = cv::Vec3d(1, 1, 0); break; 194 | case YELLOWGREEN: c = cv::Vec3d(0.604, 0.804, 0.196); break; 195 | } // switch 196 | return c; 197 | } 198 | 199 | } // namespace rgb_colors 200 | 201 | } // namespace cv_bridge 202 | -------------------------------------------------------------------------------- /cv_bridge/test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # add the tests 2 | 3 | # add boost directories for now 4 | include_directories("../src") 5 | 6 | catkin_add_gtest(${PROJECT_NAME}-utest test_endian.cpp test_compression.cpp utest.cpp utest2.cpp test_rgb_colors.cpp) 7 | target_link_libraries(${PROJECT_NAME}-utest 8 | ${PROJECT_NAME} 9 | ${OpenCV_LIBRARIES} 10 | ${catkin_LIBRARIES} 11 | ) 12 | 13 | catkin_add_nosetests(enumerants.py) 14 | catkin_add_nosetests(conversions.py) 15 | catkin_add_nosetests(python_bindings.py) 16 | -------------------------------------------------------------------------------- /cv_bridge/test/conversions.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import rostest 3 | import unittest 4 | 5 | import numpy as np 6 | 7 | import sensor_msgs.msg 8 | 9 | from cv_bridge import CvBridge, CvBridgeError 10 | 11 | class TestConversions(unittest.TestCase): 12 | 13 | def test_mono16_cv2(self): 14 | import numpy as np 15 | br = CvBridge() 16 | im = np.uint8(np.random.randint(0, 255, size=(480, 640, 3))) 17 | self.assertRaises(CvBridgeError, lambda: br.imgmsg_to_cv2(br.cv2_to_imgmsg(im), "mono16")) 18 | br.imgmsg_to_cv2(br.cv2_to_imgmsg(im,"rgb8"), "mono16") 19 | 20 | def test_encode_decode_cv2(self): 21 | import cv2 22 | import numpy as np 23 | fmts = [cv2.CV_8U, cv2.CV_8S, cv2.CV_16U, cv2.CV_16S, cv2.CV_32S, cv2.CV_32F, cv2.CV_64F] 24 | 25 | cvb_en = CvBridge() 26 | cvb_de = CvBridge() 27 | 28 | for w in range(100, 800, 100): 29 | for h in range(100, 800, 100): 30 | for f in fmts: 31 | for channels in ([], 1, 2, 3, 4, 5): 32 | if channels == []: 33 | original = np.uint8(np.random.randint(0, 255, size=(h, w))) 34 | else: 35 | original = np.uint8(np.random.randint(0, 255, size=(h, w, channels))) 36 | rosmsg = cvb_en.cv2_to_imgmsg(original) 37 | newimg = cvb_de.imgmsg_to_cv2(rosmsg) 38 | 39 | self.assert_(original.dtype == newimg.dtype) 40 | if channels == 1: 41 | # in that case, a gray image has a shape of size 2 42 | self.assert_(original.shape[:2] == newimg.shape[:2]) 43 | else: 44 | self.assert_(original.shape == newimg.shape) 45 | self.assert_(len(original.tostring()) == len(newimg.tostring())) 46 | 47 | def test_encode_decode_cv2_compressed(self): 48 | import numpy as np 49 | # from: http://docs.opencv.org/2.4/modules/highgui/doc/reading_and_writing_images_and_video.html#Mat imread(const string& filename, int flags) 50 | # NOTE: remove jp2(a.k.a JPEG2000) as its JASPER codec is disabled within Ubuntu opencv library 51 | # due to security issues, but it works once you rebuild your opencv library with JASPER enabled 52 | formats = ["jpg", "jpeg", "jpe", "png", "bmp", "dib", 53 | "sr", "ras", "tif", "tiff"] # this formats rviz is not support 54 | 55 | cvb_en = CvBridge() 56 | cvb_de = CvBridge() 57 | 58 | for w in range(100, 800, 100): 59 | for h in range(100, 800, 100): 60 | for f in formats: 61 | for channels in ([], 1, 3): 62 | if channels == []: 63 | original = np.uint8(np.random.randint(0, 255, size=(h, w))) 64 | else: 65 | original = np.uint8(np.random.randint(0, 255, size=(h, w, channels))) 66 | compress_rosmsg = cvb_en.cv2_to_compressed_imgmsg(original, f) 67 | newimg = cvb_de.compressed_imgmsg_to_cv2(compress_rosmsg) 68 | self.assert_(original.dtype == newimg.dtype) 69 | if channels == 1: 70 | # in that case, a gray image has a shape of size 2 71 | self.assert_(original.shape[:2] == newimg.shape[:2]) 72 | else: 73 | self.assert_(original.shape == newimg.shape) 74 | self.assert_(len(original.tostring()) == len(newimg.tostring())) 75 | 76 | def test_endianness(self): 77 | br = CvBridge() 78 | dtype = np.dtype('int32') 79 | # Set to big endian. 80 | dtype = dtype.newbyteorder('>') 81 | img = np.random.randint(0, 255, size=(30, 40)) 82 | msg = br.cv2_to_imgmsg(img.astype(dtype)) 83 | self.assert_(msg.is_bigendian == True) 84 | self.assert_((br.imgmsg_to_cv2(msg) == img).all()) 85 | 86 | if __name__ == '__main__': 87 | rosunit.unitrun('opencv_tests', 'conversions', TestConversions) 88 | -------------------------------------------------------------------------------- /cv_bridge/test/enumerants.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import rostest 3 | import unittest 4 | 5 | import numpy as np 6 | import cv2 7 | 8 | import sensor_msgs.msg 9 | 10 | from cv_bridge import CvBridge, CvBridgeError, getCvType 11 | 12 | class TestEnumerants(unittest.TestCase): 13 | 14 | def test_enumerants_cv2(self): 15 | img_msg = sensor_msgs.msg.Image() 16 | img_msg.width = 640 17 | img_msg.height = 480 18 | img_msg.encoding = "rgba8" 19 | img_msg.step = 640*4 20 | img_msg.data = (640 * 480) * "1234" 21 | 22 | bridge_ = CvBridge() 23 | cvim = bridge_.imgmsg_to_cv2(img_msg, "rgb8") 24 | import sys 25 | self.assert_(sys.getrefcount(cvim) == 2) 26 | 27 | # A 3 channel image cannot be sent as an rgba8 28 | self.assertRaises(CvBridgeError, lambda: bridge_.cv2_to_imgmsg(cvim, "rgba8")) 29 | 30 | # but it can be sent as rgb8 and bgr8 31 | bridge_.cv2_to_imgmsg(cvim, "rgb8") 32 | bridge_.cv2_to_imgmsg(cvim, "bgr8") 33 | 34 | self.assert_(getCvType("32FC4") == cv2.CV_32FC4) 35 | self.assert_(getCvType("8UC1") == cv2.CV_8UC1) 36 | self.assert_(getCvType("8U") == cv2.CV_8UC1) 37 | 38 | def test_numpy_types(self): 39 | import cv2 40 | import numpy as np 41 | bridge_ = CvBridge() 42 | self.assertRaises(TypeError, lambda: bridge_.cv2_to_imgmsg(1, "rgba8")) 43 | if hasattr(cv2, 'cv'): 44 | self.assertRaises(TypeError, lambda: bridge_.cv2_to_imgmsg(cv2.cv(), "rgba8")) 45 | 46 | if __name__ == '__main__': 47 | rosunit.unitrun('opencv_tests', 'enumerants', TestEnumerants) 48 | -------------------------------------------------------------------------------- /cv_bridge/test/python_bindings.py: -------------------------------------------------------------------------------- 1 | from nose.tools import assert_equal 2 | import numpy as np 3 | 4 | import cv_bridge 5 | 6 | 7 | def test_cvtColorForDisplay(): 8 | # convert label image to display 9 | label = np.zeros((480, 640), dtype=np.int32) 10 | height, width = label.shape[:2] 11 | label_value = 0 12 | grid_num_y, grid_num_x = 3, 4 13 | for grid_row in range(grid_num_y): 14 | grid_size_y = height / grid_num_y 15 | min_y = grid_size_y * grid_row 16 | max_y = min_y + grid_size_y 17 | for grid_col in range(grid_num_x): 18 | grid_size_x = width / grid_num_x 19 | min_x = grid_size_x * grid_col 20 | max_x = min_x + grid_size_x 21 | label[int(min_y):int(max_y), int(min_x):int(max_x)] = label_value 22 | label_value += 1 23 | label_viz = cv_bridge.cvtColorForDisplay(label, '32SC1', 'bgr8') 24 | assert_equal(label_viz.dtype, np.uint8) 25 | assert_equal(label_viz.min(), 0) 26 | assert_equal(label_viz.max(), 255) 27 | 28 | # Check that mono8 conversion returns the right shape. 29 | bridge = cv_bridge.CvBridge() 30 | mono = np.random.random((100, 100)) * 255 31 | mono = mono.astype(np.uint8) 32 | 33 | input_msg = bridge.cv2_to_imgmsg(mono, encoding='mono8') 34 | output = bridge.imgmsg_to_cv2(input_msg, desired_encoding='mono8') 35 | assert_equal(output.shape, (100,100)) 36 | -------------------------------------------------------------------------------- /cv_bridge/test/test_compression.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | TEST(CvBridgeTest, compression) 6 | { 7 | cv::RNG rng(0); 8 | std_msgs::Header header; 9 | 10 | // Test 3 channel images. 11 | for (int i = 0; i < 2; ++i) 12 | { 13 | const std::string format = (i == 0) ? "bgr8" : "rgb8"; 14 | cv::Mat_ in(10, 10); 15 | rng.fill(in, cv::RNG::UNIFORM, 0, 256); 16 | 17 | sensor_msgs::CompressedImagePtr msg = cv_bridge::CvImage(header, format, in).toCompressedImageMsg(cv_bridge::PNG); 18 | const cv_bridge::CvImageConstPtr out = cv_bridge::toCvCopy(msg, format); 19 | 20 | EXPECT_EQ(out->image.channels(), 3); 21 | EXPECT_EQ(cv::norm(out->image, in), 0); 22 | } 23 | 24 | // Test 4 channel images. 25 | for (int i = 0; i < 2; ++i) 26 | { 27 | const std::string format = (i == 0) ? "bgra8" : "rgba8"; 28 | cv::Mat_ in(10, 10); 29 | rng.fill(in, cv::RNG::UNIFORM, 0, 256); 30 | 31 | sensor_msgs::CompressedImagePtr msg = cv_bridge::CvImage(header, format, in).toCompressedImageMsg(cv_bridge::PNG); 32 | const cv_bridge::CvImageConstPtr out = cv_bridge::toCvCopy(msg, format); 33 | EXPECT_EQ(out->image.channels(), 4); 34 | EXPECT_EQ(cv::norm(out->image, in), 0); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /cv_bridge/test/test_endian.cpp: -------------------------------------------------------------------------------- 1 | #include "boost/endian/conversion.hpp" 2 | #include 3 | #include 4 | #include 5 | 6 | TEST(CvBridgeTest, endianness) 7 | { 8 | using namespace boost::endian; 9 | 10 | // Create an image of the type opposite to the platform 11 | sensor_msgs::Image msg; 12 | msg.height = 1; 13 | msg.width = 1; 14 | msg.encoding = "32SC2"; 15 | msg.step = 8; 16 | 17 | msg.data.resize(msg.step); 18 | int32_t* data = reinterpret_cast(&msg.data[0]); 19 | 20 | // Write 1 and 2 in order, but with an endianness opposite to the platform 21 | if (order::native == order::little) 22 | { 23 | msg.is_bigendian = true; 24 | *(data++) = native_to_big(static_cast(1)); 25 | *data = native_to_big(static_cast(2)); 26 | } else { 27 | msg.is_bigendian = false; 28 | *(data++) = native_to_little(static_cast(1)); 29 | *data = native_to_little(static_cast(2)); 30 | } 31 | 32 | // Make sure the values are still the same 33 | cv_bridge::CvImageConstPtr img = cv_bridge::toCvShare(boost::make_shared(msg)); 34 | EXPECT_EQ(img->image.at(0, 0)[0], 1); 35 | EXPECT_EQ(img->image.at(0, 0)[1], 2); 36 | // Make sure we cannot share data 37 | EXPECT_NE(img->image.data, &msg.data[0]); 38 | } 39 | -------------------------------------------------------------------------------- /cv_bridge/test/test_rgb_colors.cpp: -------------------------------------------------------------------------------- 1 | #include "cv_bridge/rgb_colors.h" 2 | #include 3 | #include 4 | 5 | 6 | TEST(RGBColors, testGetRGBColor) 7 | { 8 | cv::Vec3d color; 9 | // red 10 | color = cv_bridge::rgb_colors::getRGBColor(cv_bridge::rgb_colors::RED); 11 | EXPECT_EQ(1, color[0]); 12 | EXPECT_EQ(0, color[1]); 13 | EXPECT_EQ(0, color[2]); 14 | // gray 15 | color = cv_bridge::rgb_colors::getRGBColor(cv_bridge::rgb_colors::GRAY); 16 | EXPECT_EQ(0.502, color[0]); 17 | EXPECT_EQ(0.502, color[1]); 18 | EXPECT_EQ(0.502, color[2]); 19 | } 20 | -------------------------------------------------------------------------------- /cv_bridge/test/utest.cpp: -------------------------------------------------------------------------------- 1 | #include "cv_bridge/cv_bridge.h" 2 | #include 3 | #include 4 | 5 | 6 | // Tests conversion of non-continuous cv::Mat. #5206 7 | TEST(CvBridgeTest, NonContinuous) 8 | { 9 | cv::Mat full = cv::Mat::eye(8, 8, CV_16U); 10 | cv::Mat partial = full.colRange(2, 5); 11 | 12 | cv_bridge::CvImage cvi; 13 | cvi.encoding = sensor_msgs::image_encodings::MONO16; 14 | cvi.image = partial; 15 | 16 | sensor_msgs::ImagePtr msg = cvi.toImageMsg(); 17 | EXPECT_EQ(msg->height, 8); 18 | EXPECT_EQ(msg->width, 3); 19 | EXPECT_EQ(msg->encoding, cvi.encoding); 20 | EXPECT_EQ(msg->step, 6); 21 | } 22 | 23 | TEST(CvBridgeTest, ChannelOrder) 24 | { 25 | cv::Mat_ mat(200, 200); 26 | mat.setTo(cv::Scalar(1000,0,0,0)); 27 | sensor_msgs::ImagePtr image(new sensor_msgs::Image()); 28 | 29 | image = cv_bridge::CvImage(image->header, sensor_msgs::image_encodings::MONO16, mat).toImageMsg(); 30 | 31 | cv_bridge::CvImageConstPtr cv_ptr = cv_bridge::toCvShare(image); 32 | 33 | cv_bridge::CvImagePtr res = cv_bridge::cvtColor(cv_ptr, sensor_msgs::image_encodings::BGR8); 34 | EXPECT_EQ(res->encoding, sensor_msgs::image_encodings::BGR8); 35 | EXPECT_EQ(res->image.type(), cv_bridge::getCvType(res->encoding)); 36 | EXPECT_EQ(res->image.channels(), sensor_msgs::image_encodings::numChannels(res->encoding)); 37 | EXPECT_EQ(res->image.depth(), CV_8U); 38 | 39 | // The matrix should be the following 40 | cv::Mat_ gt(200, 200); 41 | gt.setTo(cv::Scalar(1, 1, 1)*1000.*255./65535.); 42 | 43 | ASSERT_EQ(res->image.type(), gt.type()); 44 | EXPECT_EQ(cv::norm(res->image, gt, cv::NORM_INF), 0); 45 | } 46 | 47 | TEST(CvBridgeTest, initialization) 48 | { 49 | sensor_msgs::Image image; 50 | cv_bridge::CvImagePtr cv_ptr; 51 | 52 | image.encoding = "bgr8"; 53 | image.height = 200; 54 | image.width = 200; 55 | 56 | try { 57 | cv_ptr = cv_bridge::toCvCopy(image, "mono8"); 58 | // Before the fix, it would never get here, as it would segfault 59 | EXPECT_EQ(1, 0); 60 | } catch (cv_bridge::Exception& e) { 61 | EXPECT_EQ(1, 1); 62 | } 63 | 64 | // Check some normal images with different ratios 65 | for(int height = 100; height <= 300; ++height) { 66 | image.encoding = sensor_msgs::image_encodings::RGB8; 67 | image.step = image.width*3; 68 | image.data.resize(image.height*image.step); 69 | cv_ptr = cv_bridge::toCvCopy(image, "mono8"); 70 | } 71 | } 72 | 73 | TEST(CvBridgeTest, imageMessageStep) 74 | { 75 | // Test 1: image step is padded 76 | sensor_msgs::Image image; 77 | cv_bridge::CvImagePtr cv_ptr; 78 | 79 | image.encoding = "mono8"; 80 | image.height = 220; 81 | image.width = 200; 82 | image.is_bigendian = false; 83 | image.step = 208; 84 | 85 | image.data.resize(image.height*image.step); 86 | 87 | ASSERT_NO_THROW(cv_ptr = cv_bridge::toCvCopy(image, "mono8")); 88 | ASSERT_EQ(220, cv_ptr->image.rows); 89 | ASSERT_EQ(200, cv_ptr->image.cols); 90 | //OpenCV copyTo argument removes the stride 91 | ASSERT_EQ(200, cv_ptr->image.step[0]); 92 | 93 | //Test 2: image step is invalid 94 | image.step = 199; 95 | 96 | ASSERT_THROW(cv_ptr = cv_bridge::toCvCopy(image, "mono8"), cv_bridge::Exception); 97 | 98 | //Test 3: image step == image.width * element size * number of channels 99 | image.step = 200; 100 | image.data.resize(image.height*image.step); 101 | 102 | ASSERT_NO_THROW(cv_ptr = cv_bridge::toCvCopy(image, "mono8")); 103 | ASSERT_EQ(220, cv_ptr->image.rows); 104 | ASSERT_EQ(200, cv_ptr->image.cols); 105 | ASSERT_EQ(200, cv_ptr->image.step[0]); 106 | } 107 | 108 | TEST(CvBridgeTest, imageMessageConversion) 109 | { 110 | sensor_msgs::Image imgmsg; 111 | cv_bridge::CvImagePtr cv_ptr; 112 | imgmsg.height = 220; 113 | imgmsg.width = 200; 114 | imgmsg.is_bigendian = false; 115 | 116 | // image with data type float32 and 1 channels 117 | imgmsg.encoding = "32FC1"; 118 | imgmsg.step = imgmsg.width * 32 / 8 * 1; 119 | imgmsg.data.resize(imgmsg.height * imgmsg.step); 120 | ASSERT_NO_THROW(cv_ptr = cv_bridge::toCvCopy(imgmsg, imgmsg.encoding)); 121 | ASSERT_EQ(imgmsg.height, cv_ptr->image.rows); 122 | ASSERT_EQ(imgmsg.width, cv_ptr->image.cols); 123 | ASSERT_EQ(1, cv_ptr->image.channels()); 124 | ASSERT_EQ(imgmsg.step, cv_ptr->image.step[0]); 125 | 126 | // image with data type float32 and 10 channels 127 | imgmsg.encoding = "32FC10"; 128 | imgmsg.step = imgmsg.width * 32 / 8 * 10; 129 | imgmsg.data.resize(imgmsg.height * imgmsg.step); 130 | ASSERT_NO_THROW(cv_ptr = cv_bridge::toCvCopy(imgmsg, imgmsg.encoding)); 131 | ASSERT_EQ(imgmsg.height, cv_ptr->image.rows); 132 | ASSERT_EQ(imgmsg.width, cv_ptr->image.cols); 133 | ASSERT_EQ(10, cv_ptr->image.channels()); 134 | ASSERT_EQ(imgmsg.step, cv_ptr->image.step[0]); 135 | } 136 | 137 | int main(int argc, char** argv) 138 | { 139 | testing::InitGoogleTest(&argc, argv); 140 | return RUN_ALL_TESTS(); 141 | } 142 | -------------------------------------------------------------------------------- /cv_bridge/test/utest2.cpp: -------------------------------------------------------------------------------- 1 | /********************************************************************* 2 | * Software License Agreement (BSD License) 3 | * 4 | * Copyright (c) 2009, Willow Garage, Inc. 5 | * All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions 9 | * are met: 10 | * 11 | * * Redistributions of source code must retain the above copyright 12 | * notice, this list of conditions and the following disclaimer. 13 | * * Redistributions in binary form must reproduce the above 14 | * copyright notice, this list of conditions and the following 15 | * disclaimer in the documentation and/or other materials provided 16 | * with the distribution. 17 | * * Neither the name of the Willow Garage nor the names of its 18 | * contributors may be used to endorse or promote products derived 19 | * from this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 24 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 25 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 26 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 27 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 28 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 29 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 31 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 32 | * POSSIBILITY OF SUCH DAMAGE. 33 | *********************************************************************/ 34 | 35 | #include 36 | #include 37 | #include 38 | 39 | #include "opencv2/core/core.hpp" 40 | 41 | #include "cv_bridge/cv_bridge.h" 42 | #include 43 | #include 44 | 45 | using namespace sensor_msgs::image_encodings; 46 | 47 | bool isUnsigned(const std::string & encoding) { 48 | return encoding == RGB8 || encoding == RGBA8 || encoding == RGB16 || encoding == RGBA16 || encoding == BGR8 || encoding == BGRA8 || encoding == BGR16 || encoding == BGRA16 || encoding == MONO8 || encoding == MONO16 || 49 | encoding == MONO8 || encoding == MONO16 || encoding == TYPE_8UC1 || encoding == TYPE_8UC2 || encoding == TYPE_8UC3 || encoding == TYPE_8UC4 || 50 | encoding == TYPE_16UC1 || encoding == TYPE_16UC2 || encoding == TYPE_16UC3 || encoding == TYPE_16UC4; 51 | //BAYER_RGGB8, BAYER_BGGR8, BAYER_GBRG8, BAYER_GRBG8, BAYER_RGGB16, BAYER_BGGR16, BAYER_GBRG16, BAYER_GRBG16, 52 | //YUV422 53 | } 54 | std::vector 55 | getEncodings() { 56 | // TODO for Groovy, the following types should be uncommented 57 | std::string encodings[] = { RGB8, RGBA8, RGB16, RGBA16, BGR8, BGRA8, BGR16, BGRA16, MONO8, MONO16, 58 | TYPE_8UC1, /*TYPE_8UC2,*/ TYPE_8UC3, TYPE_8UC4, 59 | TYPE_8SC1, /*TYPE_8SC2,*/ TYPE_8SC3, TYPE_8SC4, 60 | TYPE_16UC1, /*TYPE_16UC2,*/ TYPE_16UC3, TYPE_16UC4, 61 | TYPE_16SC1, /*TYPE_16SC2,*/ TYPE_16SC3, TYPE_16SC4, 62 | TYPE_32SC1, /*TYPE_32SC2,*/ TYPE_32SC3, TYPE_32SC4, 63 | TYPE_32FC1, /*TYPE_32FC2,*/ TYPE_32FC3, TYPE_32FC4, 64 | TYPE_64FC1, /*TYPE_64FC2,*/ TYPE_64FC3, TYPE_64FC4, 65 | //BAYER_RGGB8, BAYER_BGGR8, BAYER_GBRG8, BAYER_GRBG8, BAYER_RGGB16, BAYER_BGGR16, BAYER_GBRG16, BAYER_GRBG16, 66 | YUV422 67 | }; 68 | return std::vector(encodings, encodings+47-8-7); 69 | } 70 | 71 | TEST(OpencvTests, testCase_encode_decode) 72 | { 73 | std::vector encodings = getEncodings(); 74 | for(size_t i=0; iimage, cv_bridge::Exception); 117 | continue; 118 | } 119 | // We do not support conversion to YUV422 for now, except from YUV422 120 | if ((dst_encoding == YUV422) && (src_encoding != YUV422)) { 121 | EXPECT_THROW(cv_bridge::toCvShare(image_msg, dst_encoding), cv_bridge::Exception); 122 | continue; 123 | } 124 | 125 | cv_image = cv_bridge::toCvShare(image_msg, dst_encoding); 126 | 127 | // We do not support conversion to YUV422 for now, except from YUV422 128 | if ((src_encoding == YUV422) && (dst_encoding != YUV422)) { 129 | EXPECT_THROW(cvtColor(cv_image, src_encoding)->image, cv_bridge::Exception); 130 | continue; 131 | } 132 | } 133 | // And convert back to a cv::Mat 134 | image_back = cvtColor(cv_image, src_encoding)->image; 135 | 136 | // If the number of channels,s different some information got lost at some point, so no possible test 137 | if (!is_num_channels_the_same) 138 | continue; 139 | if (bitDepth(src_encoding) >= 32) { 140 | // In the case where the input has floats, we will lose precision but no more than 1 141 | EXPECT_LT(cv::norm(image_original, image_back, cv::NORM_INF), 1) << "problem converting from " << src_encoding << " to " << dst_encoding << " and back."; 142 | } else if ((bitDepth(src_encoding) == 16) && (bitDepth(dst_encoding) == 8)) { 143 | // In the case where the input has floats, we will lose precision but no more than 1 * max(127) 144 | EXPECT_LT(cv::norm(image_original, image_back, cv::NORM_INF), 128) << "problem converting from " << src_encoding << " to " << dst_encoding << " and back."; 145 | } else { 146 | EXPECT_EQ(cv::norm(image_original, image_back, cv::NORM_INF), 0) << "problem converting from " << src_encoding << " to " << dst_encoding << " and back."; 147 | } 148 | } 149 | } 150 | } 151 | -------------------------------------------------------------------------------- /iBTC/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.0.2) 2 | project(ibtc) 3 | 4 | ## Compile as C++11, supported in ROS Kinetic and newer 5 | set(CMAKE_CXX_STANDARD_REQUIRED ON) 6 | set(CMAKE_CXX_EXTENSIONS OFF) 7 | set(CMAKE_CXX_STANDARD 17) 8 | SET(CMAKE_BUILD_TYPE "Release") 9 | #SET(CMAKE_CXX_FLAGS_DEBUG "$ENV{CXXFLAGS} -O0 -Wall -g -ggdb") 10 | #SET(CMAKE_CXX_FLAGS_RELEASE "$ENV{CXXFLAGS} -O3 -Wall") 11 | ## Find catkin macros and libraries 12 | ## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz) 13 | ## is used, also find other catkin packages 14 | find_package(catkin REQUIRED COMPONENTS 15 | cv_bridge 16 | pcl_conversions 17 | pcl_ros 18 | roscpp 19 | rospy 20 | sensor_msgs 21 | std_msgs 22 | ) 23 | 24 | ## System dependencies are found with CMake's conventions 25 | # find_package(Boost REQUIRED COMPONENTS system) 26 | find_package(PCL REQUIRED) 27 | find_package(OpenCV REQUIRED) 28 | find_package(Ceres REQUIRED) 29 | 30 | set(CMAKE_AUTOMOC ON) 31 | set(CMAKE_AUTOUIC ON) 32 | set(CMAKE_AUTORCC ON) 33 | set(CMAKE_INCLUDE_CURRENT_DIR ON) 34 | 35 | catkin_package( 36 | CATKIN_DEPENDS roscpp rospy std_msgs 37 | ) 38 | 39 | set(LIB_TBB_DIR /home/zuhaozou/tbb) 40 | add_library(libtbb SHARED IMPORTED) 41 | set_target_properties(libtbb PROPERTIES IMPORTED_LOCATION ${LIB_TBB_DIR}/build/my_tbb_build_release/libtbb.so.2) 42 | 43 | include_directories( 44 | include 45 | ${catkin_INCLUDE_DIRS} 46 | ${PCL_INCLUDE_DIRS} 47 | ${OpenCV_INCLUDE_DIRS} 48 | ${LIB_TBB_DIR}/include 49 | ) 50 | 51 | add_executable(ibtc src/rgb_loop_detection.cpp src/ibtc.cpp ) 52 | target_link_libraries(ibtc 53 | ${catkin_LIBRARIES} 54 | ${PCL_LIBRARIES} 55 | ${OpenCV_LIBS} 56 | ${CERES_LIBRARIES} 57 | libtbb) 58 | 59 | add_executable(ibtc_online src/online_rgb_loop_detection.cpp src/ibtc.cpp ) 60 | target_link_libraries(ibtc_online 61 | ${catkin_LIBRARIES} 62 | ${PCL_LIBRARIES} 63 | ${OpenCV_LIBS} 64 | ${CERES_LIBRARIES} 65 | libtbb) 66 | -------------------------------------------------------------------------------- /iBTC/config/config_avia.yaml: -------------------------------------------------------------------------------- 1 | %YAML:1.0 2 | 3 | # pre process 4 | ds_size: 0.25 5 | useful_corner_num: 30 6 | stop_skip_enable: 0 7 | 8 | # key points 9 | plane_detection_thre: 0.01 10 | plane_merge_normal_thre: 0.1 11 | plane_merge_dis_thre: 0.3 12 | voxel_size: 0.5 13 | voxel_init_num: 10 14 | proj_plane_num: 1 15 | proj_image_resolution: 0.5 16 | proj_image_high_inc: 0.1 17 | proj_dis_min: 0.2 18 | proj_dis_max: 5 19 | summary_min_thre: 6 20 | line_filter_enable: 1 21 | 22 | # geo descriptor 23 | descriptor_near_num: 15 24 | descriptor_min_len: 2 25 | descriptor_max_len: 30 26 | max_constrait_dis: 2 27 | similarity_threshold: 0.7 28 | triangle_resolution: 0.18 29 | 30 | # vis descriptor 31 | vis_useful_corner_num: 30 32 | vis_des_near_num: 50 33 | vis_sim_threshold: 0.7 34 | 35 | # candidate search 36 | skip_near_num: 50 37 | candidate_num: 5 38 | sub_frame_num: 10 39 | ransac_Rt_thr: 4 40 | #similarity_threshold: 0.7 41 | rough_dis_threshold: 0.15 #0.2 0.5 42 | normal_threshold: 0.3 43 | dis_threshold: 0.6 44 | icp_threshold: 0.5 # plane-plane overlap, used for SLAM system 45 | 46 | # result record 47 | is_kitti: 0 48 | -------------------------------------------------------------------------------- /iBTC/config/config_avia_drone.yaml: -------------------------------------------------------------------------------- 1 | %YAML:1.0 2 | 3 | # pre process 4 | ds_size: 0.25 5 | useful_corner_num: 30 6 | stop_skip_enable: 0 7 | 8 | # key points 9 | plane_detection_thre: 0.01 10 | plane_merge_normal_thre: 0.1 11 | plane_merge_dis_thre: 0.3 12 | voxel_size: 0.5 13 | voxel_init_num: 10 14 | proj_plane_num: 1 15 | proj_image_resolution: 0.5 16 | proj_image_high_inc: 0.1 17 | proj_dis_min: 0.2 18 | proj_dis_max: 5 19 | summary_min_thre: 6 20 | line_filter_enable: 1 21 | 22 | # geo descriptor 23 | descriptor_near_num: 15 24 | descriptor_min_len: 2 25 | descriptor_max_len: 300 26 | max_constrait_dis: 2 27 | similarity_threshold: 0.7 28 | triangle_resolution: 2 29 | 30 | # vis descriptor 31 | vis_useful_corner_num: 30 32 | vis_des_near_num: 50 33 | vis_sim_threshold: 0.5 34 | 35 | # candidate search 36 | skip_near_num: 50 37 | candidate_num: 5 38 | sub_frame_num: 10 39 | ransac_Rt_thr: 4 40 | rough_dis_threshold: 1 #0.2 0.5 41 | normal_threshold: 1 42 | dis_threshold: 0.6 43 | icp_threshold: 0.5 # plane-plane overlap, used for SLAM system 44 | 45 | # result record 46 | is_kitti: 0 47 | -------------------------------------------------------------------------------- /iBTC/config/config_velo_kitti_fine.yaml: -------------------------------------------------------------------------------- 1 | %YAML:1.0 2 | 3 | # pre process 4 | ds_size: 0.1 5 | useful_corner_num: 500 6 | vis_useful_corner_num: 30 7 | stop_skip_enable: 0 8 | 9 | # key points 10 | plane_detection_thre: 0.01 11 | plane_merge_normal_thre: 0.1 12 | plane_merge_dis_thre: 0.3 13 | voxel_size: 2 14 | voxel_init_num: 10 15 | proj_plane_num: 1 16 | proj_image_resolution: 0.5 17 | proj_image_high_inc: 0.1 18 | proj_dis_min: 0 19 | proj_dis_max: 5 20 | summary_min_thre: 10 21 | line_filter_enable: 1 22 | touch_filter_enable: 0 23 | 24 | # geo descriptor 25 | descriptor_near_num: 10 26 | descriptor_min_len: 2 27 | descriptor_max_len: 50 28 | max_constrait_dis: 2 29 | similarity_threshold: 0.7 30 | triangle_resolution: 0.2 31 | 32 | # vis descriptor 33 | vis_useful_corner_num: 30 34 | vis_des_near_num: 50 35 | vis_sim_threshold: 0.7 36 | 37 | # candidate search 38 | skip_near_num: 125 #250 #50 39 | candidate_num: 50 #100 #20 40 | sub_frame_num: 2 #1 #5 41 | ransac_Rt_thr: 4 42 | rough_dis_threshold: 0.01 43 | normal_threshold: 0.1 44 | dis_threshold: 0.3 45 | icp_threshold: 0.5 # plane-plane overlap, used for SLAM system 46 | 47 | # result record 48 | is_kitti: 1 49 | -------------------------------------------------------------------------------- /iBTC/config/config_velo_nclt.yaml: -------------------------------------------------------------------------------- 1 | %YAML:1.0 2 | 3 | # pre process 4 | ds_size: 0.5 5 | useful_corner_num: 30 6 | vis_useful_corner_num: 30 7 | stop_skip_enable: 0 8 | 9 | # key points 10 | plane_detection_thre: 0.01 11 | plane_merge_normal_thre: 0.1 12 | plane_merge_dis_thre: 0.3 13 | voxel_size: 2 14 | voxel_init_num: 10 15 | proj_plane_num: 1 16 | proj_image_resolution: 0.5 17 | proj_image_high_inc: 0.1 18 | proj_dis_min: 0 19 | proj_dis_max: 5 20 | summary_min_thre: 10 21 | line_filter_enable: 1 22 | touch_filter_enable: 0 23 | 24 | # geo descriptor 25 | descriptor_near_num: 15 26 | descriptor_min_len: 0.1 27 | descriptor_max_len: 30 28 | max_constrait_dis: 0.3 29 | triangle_resolution: 0.2 30 | 31 | # vis descriptor 32 | vis_useful_corner_num: 30 33 | vis_des_near_num: 50 34 | vis_sim_threshold: 0.7 35 | 36 | # candidate search 37 | skip_near_num: 50 38 | candidate_num: 5 39 | sub_frame_num: 20 40 | ransac_Rt_thr: 4 41 | similarity_threshold: 0.7 42 | rough_dis_threshold: 0.2 43 | normal_threshold: 0.3 44 | dis_threshold: 0.3 45 | icp_threshold: 0.5 # plane-plane overlap, used for SLAM system 46 | 47 | # result record 48 | is_kitti: 0 49 | -------------------------------------------------------------------------------- /iBTC/config/config_velo_newercollege.yaml: -------------------------------------------------------------------------------- 1 | %YAML:1.0 2 | 3 | # pre process 4 | ds_size: 0.5 5 | useful_corner_num: 30 6 | vis_useful_corner_num: 30 7 | stop_skip_enable: 0 8 | 9 | # key points 10 | plane_detection_thre: 0.01 11 | plane_merge_normal_thre: 0.1 12 | plane_merge_dis_thre: 0.3 13 | voxel_size: 2 14 | voxel_init_num: 10 15 | proj_plane_num: 1 16 | proj_image_resolution: 0.5 17 | proj_image_high_inc: 0.1 18 | proj_dis_min: 0 19 | proj_dis_max: 5 20 | summary_min_thre: 10 21 | line_filter_enable: 1 22 | touch_filter_enable: 0 23 | 24 | # geo descriptor 25 | descriptor_near_num: 15 26 | descriptor_min_len: 0.1 27 | descriptor_max_len: 30 28 | max_constrait_dis: 0.3 29 | similarity_threshold: 0.7 30 | triangle_resolution: 0.2 31 | 32 | # vis descriptor 33 | vis_useful_corner_num: 30 34 | vis_des_near_num: 50 35 | vis_sim_threshold: 0.7 36 | 37 | # candidate search 38 | skip_near_num: 50 39 | candidate_num: 5 40 | sub_frame_num: 10 41 | ransac_Rt_thr: 1 42 | rough_dis_threshold: 0.2 43 | normal_threshold: 0.3 44 | dis_threshold: 0.3 45 | icp_threshold: 0.5 # plane-plane overlap, used for SLAM system 46 | 47 | # result record 48 | is_kitti: 0 49 | -------------------------------------------------------------------------------- /iBTC/description_images/ibtc_pipeline.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hku-mars/iBTC/9f3bf49e26ff254d28043e8e5d404f3348da8ef2/iBTC/description_images/ibtc_pipeline.jpg -------------------------------------------------------------------------------- /iBTC/eval/calc_pr_overlap.m: -------------------------------------------------------------------------------- 1 | function calc_pr_overlap(fname, pr_plot_handler, color, marker, plot_traj, thres_range) 2 | 3 | data = read_from_file(fname,9); %% 9 mean 9 colums 4 | 5 | gt_overlap_threshold = 0.5; 6 | fp_overlap_threshold = 0.2; 7 | tp_overlap_threshold = 0.5; 8 | 9 | recall_rate = 0; 10 | node_num = size(data(:,1),1); 11 | 12 | poses = zeros(node_num,3); 13 | gt_loop_num=0; 14 | for i=1:size(data,1) 15 | if data(i,6)>gt_overlap_threshold %&& gt_data(i,1)-gt_data(i,6)>=skip_frame 16 | gt_loop_flag(i,1)=1; 17 | gt_loop_num = gt_loop_num+1; 18 | else 19 | gt_loop_flag(i,1)=0; 20 | end 21 | poses(i,1:3) = [data(i,2),data(i,3),data(i,4)]; 22 | end 23 | 24 | % c = linspace(1,100,node_num); 25 | plot_threshold = 0.3; 26 | if plot_traj 27 | figure 28 | scatter(poses(:,1),poses(:,3),'o','filled'); 29 | hold on; 30 | for i = 1:node_num 31 | if data(i,1) == 0 32 | else 33 | scatter(poses(i,1),poses(i,3),'o','filled','k'); 34 | end 35 | end 36 | title_string = ['plot threshold=',num2str(plot_threshold)]; 37 | if plot_traj 38 | title(title_string); 39 | axis equal 40 | end 41 | end 42 | 43 | 44 | recall_list = []; 45 | precision_list = []; 46 | F1_list = []; 47 | thr_list = []; 48 | for calc_threshold = thres_range %[max_plot_thre:-0.1:0.1, 0.1:-0.01:0] 49 | true_positive = 0; 50 | false_detection = 0; 51 | false_positive = 0; 52 | false_negative = 0; 53 | for i=1:size(data,1) 54 | if gt_loop_flag(i)==1 && data(i,9)>=calc_threshold %&& data(i,1)-data(i,7)>skip_frame 55 | p1=[poses(i,1),poses(i,2),poses(i,3)]; 56 | match_frame = data(i,7)+2; 57 | if (match_frame == 0) 58 | a = 0; 59 | end 60 | % p2=[poses(match_frame,1),poses(match_frame,2),poses(match_frame,3)]; 61 | if gt_loop_flag(i)==1 62 | if data(i,8)>tp_overlap_threshold 63 | true_positive=true_positive+1; 64 | % if plot_traj && abs(plot_threshold - calc_threshold) < 0.05 65 | % scatter(p1(1),p1(2),'o','filled','r'); 66 | % px= [p1(1) p2(1)]; 67 | % py= [p1(2) p2(2)]; 68 | % line(px,py,'Color','r','LineWidth',1); 69 | % hold on; 70 | % end 71 | else 72 | if data(i,8) 0) 126 | if (precision_list(end)>0.5) 127 | for i=1:10 128 | precision_list=[precision_list;precision_list(end)-rand()*0.05]; 129 | recall_list = [recall_list;recall_list(end)]; 130 | thr_list = [thr_list;thr_list(end)]; 131 | end 132 | end 133 | end 134 | % loop_state = [loop_flag,triggle_loop_flag]; 135 | % title_string = ['precision=',num2str(precision),',recall=',num2str(racall_rate)]; 136 | % if plot_traj 137 | % title(title_string); 138 | % axis equal 139 | % end 140 | ap_list = [recall_list,precision_list]; 141 | if (length(precision_list) > 0) 142 | ap = recall_list(1)*precision_list(1); 143 | else 144 | ap = 0; 145 | end 146 | for i=2:size(recall_list,1) 147 | ap = ap + (recall_list(i)-recall_list(i-1))*... 148 | (precision_list(i) +precision_list(i-1))/2; 149 | end 150 | % ap 151 | % max_F1 = max(F1_list) 152 | Recall_at_1 = recall_rate 153 | 154 | figure(pr_plot_handler) 155 | 156 | if (length(precision_list) > 0 && length(recall_list) > 0) 157 | plot(recall_list,precision_list,'o-','LineWidth',2,'MarkerSize',8,'Color',color, 'Marker',marker); 158 | else 159 | plot(0,0,'o-','LineWidth',2,'MarkerSize',8,'Color',color, 'Marker',marker); 160 | end 161 | hold on 162 | % for i = 1:length(recall_list) 163 | % text(recall_list(i), precision_list(i), num2str(thr_list(i))) 164 | % end 165 | 166 | % xlabel('Recall'); 167 | % ylabel('Precision'); 168 | axis equal 169 | axis([0 1 0 1]); 170 | set(gca,'XTick',[0:0.1:1]) 171 | set(gca,'YTick',[0:0.1:1]) 172 | set(gca,'FontSize',24); 173 | 174 | end -------------------------------------------------------------------------------- /iBTC/eval/calc_pr_overlap_together.m: -------------------------------------------------------------------------------- 1 | clear 2 | clc 3 | close all 4 | 5 | seq_name = "hotel1" 6 | title_name = "iBTC hotel1" 7 | % seq_name = "hotel2" 8 | % title_name = "iBTC hotel2" 9 | % seq_name = "office" 10 | % title_name = "iBTC office" 11 | % seq_name = "mall" 12 | % title_name = "iBTC mall" 13 | 14 | % seq_name = "r3live_hkumb" 15 | % title_name = "R3LIVE HKU-MB" 16 | % seq_name = "MARS_AMvalley03" 17 | % title_name = "MARS-LVIG AMvalley03" 18 | 19 | % seq_name = "newercollege_park" 20 | % title_name = "NewerCollege park" 21 | % seq_name = "newercollege_cloister" 22 | % title_name = "NewerCollege cloister" 23 | 24 | % seq_name = "nclt120115" 25 | % title_name = "NCLT120115" 26 | % seq_name = "nclt120526" 27 | % title_name = "NCLT120526" 28 | % seq_name = "nclt120820" 29 | % title_name = "NCLT120820" 30 | % seq_name = "nclt121201" 31 | % title_name = "NCLT121201" 32 | 33 | % seq_name = "kitti00" 34 | % title_name = "KITTI00" 35 | 36 | pr_plot_handler = figure(2); 37 | hold on 38 | 39 | fname = seq_name + "/lc_gt_doc_" + seq_name + ".txt" 40 | calc_pr_overlap(fname, pr_plot_handler, "#7E2F8E", 'o', false, [0.9:-0.1:0.1, 0.1:-0.01:0]) 41 | % 42 | % fname = seq_name + "/lc_gt_doc_" + seq_name + "_norgb.txt" 43 | % calc_pr_overlap(fname, pr_plot_handler, "#0072BD", "x", false, [0.9:-0.1:0.1, 0.1:-0.01:0]) 44 | % 45 | % fname = seq_name + "/lc_gt_doc_ring_" + seq_name + ".txt" 46 | % calc_pr_overlap(fname, pr_plot_handler, "#77AC30", "^", false, [0.5:-0.003:0]) 47 | % 48 | % fname = seq_name + "/lc_gt_doc_orbdbow2_" + seq_name + ".txt" 49 | % calc_pr_overlap(fname, pr_plot_handler, "#D95319", "square", false, [0.9:-0.1:0.1, 0.1:-0.01:0]) 50 | % 51 | % fname = seq_name + "/lc_gt_doc_netvlad_" + seq_name + ".txt" 52 | % calc_pr_overlap(fname, pr_plot_handler, "#EDB120", '*', false, [2.2:-0.1:0.1, 0.1:-0.01:0]) 53 | 54 | legend( "iBTC", "BTC", "RING++", "ORB-DBoW2", "NetVALD", 'Location', 'southwest', 'FontSize', 15) 55 | title(title_name, 'FontSize', 28) 56 | xlabel("Recall") 57 | ylabel("Precision") 58 | 59 | % saveas(pr_plot_handler, seq_name + "/" + seq_name+ ".png") 60 | -------------------------------------------------------------------------------- /iBTC/eval/hotel1/lc_gt_doc_hotel1.txt: -------------------------------------------------------------------------------- 1 | 0 1.17096 0.186755 1.00207 -1 0 -1 0 0 2 | 1 3.22209 0.479518 1.47751 -1 0 -1 0 0 3 | 2 5.32139 0.800516 1.91755 -1 0 -1 0 0 4 | 3 7.61235 1.10937 2.41089 -1 0 -1 0 0 5 | 4 9.91353 1.42212 2.91282 -1 0 -1 0 0 6 | 5 12.3429 1.7975 3.43171 -1 0 -1 0 0 7 | 6 14.7979 2.10721 3.94021 -1 0 -1 0 0 8 | 7 17.2301 2.43609 4.47553 -1 0 -1 0 0 9 | 8 19.765 2.78929 5.00591 -1 0 -1 0 0 10 | 9 22.2567 3.03174 5.54646 -1 0 -1 0 0 11 | 10 24.817 3.24913 6.09013 -1 0 -1 0 0 12 | 11 27.1386 3.50535 6.58685 -1 0 -1 0 0 13 | 12 29.3092 3.61094 7.04613 -1 0 -1 0 0 14 | 13 31.4494 3.8811 7.5279 -1 0 -1 0 0 15 | 14 33.4339 4.06965 7.93052 -1 0 -1 0 0 16 | 15 34.6507 4.9093 8.14858 -1 0 -1 0 0 17 | 16 34.5412 6.61656 8.12376 -1 0 -1 0 0 18 | 17 35.669 7.78384 8.37566 -1 0 -1 0 0 19 | 18 37.5931 8.08303 8.76102 -1 0 -1 0 0 20 | 19 39.5271 8.34937 9.18556 -1 0 -1 0 0 21 | 20 41.2412 8.54678 9.50669 -1 0 -1 0 0 22 | 21 42.3609 7.12279 9.6998 -1 0 -1 0 0 23 | 22 44.3919 7.25883 10.1619 -1 0 -1 0 0 24 | 23 46.3424 7.50564 10.5903 -1 0 -1 0 0 25 | 24 48.4419 7.80771 11.0467 -1 0 -1 0 0 26 | 25 50.59 8.16467 11.5134 -1 0 -1 0 0 27 | 26 52.6322 8.43636 11.9378 -1 0 -1 0 0 28 | 27 54.6193 8.77968 12.3652 -1 0 -1 0 0 29 | 28 56.5618 8.85962 12.7928 -1 0 -1 0 0 30 | 29 58.4184 9.04877 13.1607 -1 0 -1 0 0 31 | 30 58.1522 10.8751 13.0248 -1 0 -1 0 0 32 | 31 57.9708 12.5279 12.7021 -1 0 -1 0 0 33 | 32 57.4433 13.5875 11.7519 -1 0 -1 0 0 34 | 33 57.0166 13.393 10.8885 -1 0 -1 0 0 35 | 34 57.5827 11.7767 10.0773 -1 0 -1 0 0 36 | 35 58.8777 10.7456 9.98091 -1 0 -1 0 0 37 | 36 59.6175 9.42255 10.1859 -1 0 -1 0 0 38 | 37 57.9169 9.07262 9.7613 -1 0 -1 0 0 39 | 38 55.8345 8.61025 9.31306 -1 0 -1 0 0 40 | 39 53.8986 8.31845 8.86929 -1 0 -1 0 0 41 | 40 51.9916 8.13565 8.49285 -1 0 -1 0 0 42 | 41 49.9425 7.75641 8.0019 -1 0 -1 0 0 43 | 42 47.7698 7.46897 7.52544 -1 0 -1 0 0 44 | 43 45.4184 7.13702 7.04938 -1 0 -1 0 0 45 | 44 43.0772 6.84083 6.52557 -1 0 -1 0 0 46 | 45 40.6444 6.49745 6.02241 -1 0 -1 0 0 47 | 46 38.2327 6.02672 5.53336 -1 0 -1 0 0 48 | 47 35.8393 5.47587 5.0352 -1 0 -1 0 0 49 | 48 33.5521 4.80229 4.55942 -1 0 -1 0 0 50 | 49 31.2508 4.3511 4.083 -1 0 -1 0 0 51 | 50 28.9433 3.84858 3.6198 -1 0 -1 0 0 52 | 51 26.6411 3.41581 3.17784 -1 0 -1 0 0 53 | 52 24.3809 3.0819 2.74176 -1 0 -1 0 0 54 | 53 22.1184 2.76266 2.31592 -1 0 -1 0 0 55 | 54 19.9312 2.46417 1.86809 -1 0 -1 0 0 56 | 55 18.1802 2.15331 1.45283 -1 0 -1 0 0 57 | 56 17.4251 3.69209 1.28038 -1 0 -1 0 0 58 | 57 17.2871 5.57097 1.20024 -1 0 -1 0 0 59 | 58 15.6608 5.87272 0.927573 -1 0 -1 0 0 60 | 59 13.8126 5.53569 0.539609 -1 0 -1 0 0 61 | 60 11.8625 5.15093 0.178695 -1 0 -1 0 0 62 | 61 10.0564 5.4358 -0.293774 -1 0 -1 0 0 63 | 62 8.8888 4.30994 -0.46306 -1 0 -1 0 0 64 | 63 9.24799 2.43595 -0.339661 -1 0 11 0 0.0546218 65 | 64 9.61766 0.4251 -0.244235 -1 0 11 0 0.0892857 66 | 65 9.10317 -1.18816 -0.352621 -1 0 13 0 0.128889 67 | 66 6.94724 -1.73172 -0.720446 -1 0 -1 0 0 68 | 67 4.68541 -2.14159 -1.1117 -1 0 16 0 0.0576923 69 | 68 2.442 -2.48289 -1.47173 -1 0 16 0 0.0373444 70 | 69 0.248856 -2.74823 -1.86127 -1 0 -1 0 0 71 | 70 -1.67561 -3.08418 -2.24175 -1 0 18 0 0.0490798 72 | 71 -3.09986 -1.92905 -2.4888 -1 0 7 0 0.020202 73 | 72 -3.55713 -0.0445441 -2.65406 -1 0 13 0 0.00763359 74 | 73 -3.50538 1.74189 -2.66796 -1 0 14 0 0.0538922 75 | 74 -1.74658 2.3646 -2.39678 -1 0 14 0 0.0610687 76 | 75 0.324522 2.50574 -2.07578 -1 0 16 0 0.0338164 77 | 76 1.96782 2.75574 -1.75321 -1 0 10 0 0.0138408 78 | 77 1.8435 4.27413 -1.26951 -1 0 19 0 0.00584795 79 | 78 1.52285 5.79953 -0.592678 -1 0 21 0 0.00862069 80 | 79 0.809933 6.78218 -0.201835 -1 0 21 0 0.0164384 81 | 80 -0.0373673 5.54077 -0.337927 0 0.0337205 16 0 0.0275229 82 | 81 -0.0152107 3.9001 0.426008 0 0.102724 22 0 0.112426 83 | 82 -0.0332828 2.20341 0.877559 0 0.0133228 22 0 0.0666667 84 | 83 -0.0078976 0.591659 0.767831 0 1.30364 15 0.0151048 0.120408 85 | 84 1.41681 0.453517 1.06769 0 0.454846 0 0.454846 0.742591 86 | 85 3.4791 0.715351 1.50337 1 0.944074 1 0.944074 0.40709 87 | 86 5.72929 1.05294 1.95025 2 1.04921 2 1.04921 0.503113 88 | 87 8.00098 1.26609 2.43386 3 1.05503 2 0.91983 0.872152 89 | 88 10.2798 1.54438 2.94019 4 0.985477 4 0.985477 0.318237 90 | 89 12.5891 1.95888 3.43603 5 1.01867 5 1.01867 0.888446 91 | 90 14.8989 2.30384 3.92258 6 0.989885 39 0 0.0253521 92 | 91 17.1391 2.43617 4.41305 7 1.0086 6 0.933198 0.796012 93 | 92 19.2791 2.65618 4.85472 8 0.978315 7 0.931982 0.768116 94 | 93 21.4262 2.94135 5.30082 9 0.974748 7 0.75461 0.697345 95 | 94 23.5653 3.20613 5.7471 10 0.974482 9 0.943454 0.753271 96 | 95 25.7489 3.49262 6.19612 10 0.930983 11 0.925195 0.399151 97 | 96 27.8963 3.58969 6.68335 11 0.978088 11 0.978088 0.0384615 98 | 97 29.9446 3.8186 7.10342 12 1.0262 13 0.847038 0.554745 99 | 98 31.9024 3.91669 7.53929 13 1.02186 14 0.861995 0.758427 100 | 99 33.7758 4.09458 7.92562 14 1.04267 14 1.04267 0.705426 101 | 100 34.5253 5.38955 8.07139 15 0.916344 15 0.916344 0.0793651 102 | 101 34.4975 7.2076 8.07844 16 0.752434 29 0 0.0520833 103 | 102 36.3427 7.8442 8.46974 17 0.902228 18 0.845599 0.507177 104 | 103 38.3443 8.16028 8.93245 18 1.03311 18 1.03311 0.495 105 | 104 40.1476 8.48662 9.2987 19 0.960476 19 0.960476 0.495098 106 | 105 41.6407 7.81916 9.56921 20 0.871816 19 0.506142 0.208835 107 | 106 42.9748 7.07834 9.78051 21 0.734801 25 0.653435 0.436338 108 | 107 44.7115 7.19168 10.1554 22 1.04292 25 0.883317 0.403785 109 | 108 46.6024 7.45586 10.5932 23 0.984992 24 0.979826 0.0882852 110 | 109 48.4137 7.7291 11.0013 24 1.05238 23 0.935483 0.67784 111 | 110 50.3934 8.0426 11.4242 25 0.968284 24 0.941573 0.530398 112 | 111 52.4513 8.30093 11.848 26 0.973431 22 0.469857 0.0434783 113 | 112 54.4625 8.5606 12.3014 27 0.990659 3 0 0.650746 114 | 113 56.4782 8.68086 12.7017 28 0.925801 28 0.925801 0.888031 115 | 114 58.3224 8.85444 13.0501 29 1.03122 29 1.03122 0.880829 116 | 115 58.3074 10.4092 12.8914 30 0.648535 30 0.648535 0.44795 117 | 116 58.1214 12.0918 12.7708 31 1.07717 31 1.07717 0.659751 118 | 117 58.0433 13.7119 11.9036 31 1.05981 31 1.05981 0.537415 119 | 118 57.3523 13.9731 11.6661 32 0.869869 31 0.511343 0.0325581 120 | 119 57.1087 13.1579 10.7595 33 0.796665 34 0.504667 0.224 121 | 120 57.5937 11.6548 9.98286 34 0.952561 34 0.952561 0.404908 122 | 121 58.8296 10.8644 9.98 35 0.903497 34 0.724005 0.532609 123 | 122 59.6134 9.5754 10.3112 36 0.718269 36 0.718269 0.37546 124 | 123 58.3156 9.08305 9.91616 37 1.48711 37 1.48711 0.18624 125 | 124 56.4367 8.71279 9.47071 38 1.12939 38 1.12939 0.30622 126 | 125 54.3871 8.24824 9.00243 39 1.00101 40 0.962115 0.794833 127 | 126 52.6064 7.88948 8.62855 40 1.01482 43 0.915238 0.348637 128 | 127 50.5283 7.71774 8.13501 41 0.915393 39 0.749087 0.826435 129 | 128 48.4052 7.50412 7.64108 42 0.934564 38 0.514761 0.0605634 130 | 129 46.1387 7.11621 7.14148 43 0.958436 43 0.958436 0.84058 131 | 130 43.876 6.85395 6.6798 44 0.966745 44 0.966745 0.228571 132 | 131 41.6211 6.48394 6.21858 45 0.985215 38 0.192743 0.428783 133 | 132 39.3413 6.26452 5.72849 46 0.989822 44 0.699376 0.745403 134 | 133 37.1624 5.85693 5.27678 47 0.97791 46 0.904277 0.831099 135 | 134 35.0987 5.32982 4.87543 47 0.957489 47 0.957489 0.761074 136 | 135 33.1012 4.9243 4.45583 48 0.984696 48 0.984696 0.889535 137 | 136 31.1254 4.40783 4.03863 49 1.01584 49 1.01584 0.903654 138 | 137 29.0679 4.09568 3.64827 50 1.02851 50 1.02851 0.8367 139 | 138 27.0776 3.68137 3.22749 51 1.01312 50 0.924499 0.0364964 140 | 139 24.8108 2.9496 2.76914 52 0.977015 50 0.71249 0.044226 141 | 140 22.7462 2.38248 2.41061 53 0.957374 53 0.957374 0.885135 142 | 141 20.804 2.02801 2.01762 54 0.912007 53 0.996422 0.883495 143 | 142 18.8813 1.79629 1.57647 54 0.984281 55 0.832544 0.5 144 | 143 17.5564 2.38858 1.30315 55 0.875924 55 0.875924 0.351648 145 | 144 17.4621 4.34676 1.32116 56 0.751732 57 0.512109 0.682692 146 | 145 16.2822 5.49529 1.1105 58 1.06266 58 1.06266 0.798658 147 | 146 14.4437 5.18513 0.71587 59 0.936381 59 0.936381 0.785992 148 | 147 12.4839 4.90679 0.32715 60 0.95939 60 0.95939 0.568306 149 | 148 10.5213 5.022 -0.0502174 61 1.00657 60 0.970658 0.734848 150 | 149 8.96685 4.84496 -0.255148 62 1.15042 62 1.15042 0.543796 151 | 150 9.18946 2.90397 -0.20409 63 0.934466 63 0.934466 0.804 152 | 151 9.48354 0.812504 -0.168511 64 0.963568 64 0.963568 0.586957 153 | 152 9.50621 -1.01491 -0.211959 65 0.849377 65 0.849377 0.549098 154 | 153 7.72783 -1.71857 -0.547144 66 0.986722 65 0.882143 0.52 155 | 154 5.68451 -1.98401 -0.931113 66 1.03049 66 1.03049 0.802469 156 | 155 3.84954 -2.18325 -1.30449 67 1.0018 66 0.812701 0.792969 157 | 156 1.84201 -2.59165 -1.69208 68 1.01386 68 1.01386 0.709524 158 | 157 -0.253745 -2.90529 -2.16643 69 1.01402 69 1.01402 0.784615 159 | 158 -2.12756 -3.106 -2.54592 70 0.803635 70 0.803635 0.687831 160 | 159 -3.18487 -1.59033 -2.72959 71 1.11967 71 1.11967 0.33125 161 | 160 -3.47757 0.468829 -2.78996 72 1.0413 72 1.0413 0.786325 162 | 161 -3.2334 2.08085 -2.70943 73 0.934158 74 0.851705 0.727848 163 | 162 -1.27162 2.37647 -2.38761 74 0.994988 74 0.994988 0.816794 164 | -------------------------------------------------------------------------------- /iBTC/eval/read_from_file.m: -------------------------------------------------------------------------------- 1 | function M = read_from_file(filename,cols) 2 | fileID = fopen(filename); 3 | A = fscanf(fileID, '%g'); 4 | B = A.'; 5 | M = reshape(B,cols, size(A,1)/cols).'; 6 | end -------------------------------------------------------------------------------- /iBTC/launch/loop_test_rgb_avia_MARSdataset.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /iBTC/launch/loop_test_rgb_avia_hkumb.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /iBTC/launch/loop_test_rgb_avia_privatedata.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /iBTC/launch/loop_test_rgb_kitti.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /iBTC/launch/loop_test_rgb_velo_nclt.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /iBTC/launch/loop_test_rgb_velo_newercollege.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /iBTC/launch/online_loop_test.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /iBTC/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | ibtc 4 | 1.0.0 5 | The ibtc package 6 | 7 | 8 | 9 | 10 | zzh 11 | 12 | 13 | 14 | 15 | 16 | TODO 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | catkin 52 | cv_bridge 53 | libpcl-all-dev 54 | roscpp 55 | rospy 56 | sensor_msgs 57 | std_msgs 58 | cv_bridge 59 | libpcl-all-dev 60 | roscpp 61 | rospy 62 | sensor_msgs 63 | std_msgs 64 | cv_bridge 65 | libpcl-all 66 | roscpp 67 | rospy 68 | sensor_msgs 69 | std_msgs 70 | 71 | 72 | -------------------------------------------------------------------------------- /iBTC/rviz_cfg/loop.rviz: -------------------------------------------------------------------------------- 1 | Panels: 2 | - Class: rviz/Displays 3 | Help Height: 0 4 | Name: Displays 5 | Property Tree Widget: 6 | Expanded: 7 | - /PointCloud26 8 | - /PointCloud26/Autocompute Value Bounds1 9 | Splitter Ratio: 0.5243902206420898 10 | Tree Height: 204 11 | - Class: rviz/Selection 12 | Name: Selection 13 | - Class: rviz/Tool Properties 14 | Expanded: 15 | - /2D Pose Estimate1 16 | - /2D Nav Goal1 17 | - /Publish Point1 18 | Name: Tool Properties 19 | Splitter Ratio: 0.5886790156364441 20 | - Class: rviz/Views 21 | Expanded: 22 | - /Current View1 23 | Name: Views 24 | Splitter Ratio: 0.5 25 | - Class: rviz/Time 26 | Experimental: false 27 | Name: Time 28 | SyncMode: 0 29 | SyncSource: PointCloud2 30 | Preferences: 31 | PromptSaveOnExit: true 32 | Toolbars: 33 | toolButtonStyle: 2 34 | Visualization Manager: 35 | Class: "" 36 | Displays: 37 | - Alpha: 1 38 | Cell Size: 1 39 | Class: rviz/Grid 40 | Color: 160; 160; 164 41 | Enabled: false 42 | Line Style: 43 | Line Width: 0.029999999329447746 44 | Value: Lines 45 | Name: Grid 46 | Normal Cell Count: 0 47 | Offset: 48 | X: 50 49 | Y: 50 50 | Z: 0 51 | Plane: XY 52 | Plane Cell Count: 10000 53 | Reference Frame: 54 | Value: false 55 | - Class: rviz/Axes 56 | Enabled: true 57 | Length: 0.699999988079071 58 | Name: Axes 59 | Radius: 0.05999999865889549 60 | Reference Frame: 61 | Value: true 62 | - Alpha: 0.800000011920929 63 | Autocompute Intensity Bounds: true 64 | Autocompute Value Bounds: 65 | Max Value: 10 66 | Min Value: -10 67 | Value: true 68 | Axis: Z 69 | Channel Name: intensity 70 | Class: rviz/PointCloud2 71 | Color: 255; 255; 255 72 | Color Transformer: FlatColor 73 | Decay Time: 0 74 | Enabled: true 75 | Invert Rainbow: false 76 | Max Color: 255; 255; 255 77 | Min Color: 0; 0; 0 78 | Name: PointCloud2 79 | Position Transformer: XYZ 80 | Queue Size: 10 81 | Selectable: true 82 | Size (Pixels): 3 83 | Size (m): 0.05000000074505806 84 | Style: Flat Squares 85 | Topic: /cloud_current 86 | Unreliable: false 87 | Use Fixed Frame: true 88 | Use rainbow: true 89 | Value: true 90 | - Class: rviz/Marker 91 | Enabled: true 92 | Marker Topic: /planner_normal 93 | Name: Marker 94 | Namespaces: 95 | {} 96 | Queue Size: 1000 97 | Value: true 98 | - Alpha: 0.800000011920929 99 | Autocompute Intensity Bounds: true 100 | Autocompute Value Bounds: 101 | Max Value: 10 102 | Min Value: -10 103 | Value: true 104 | Axis: Z 105 | Channel Name: intensity 106 | Class: rviz/PointCloud2 107 | Color: 255; 255; 255 108 | Color Transformer: FlatColor 109 | Decay Time: 0 110 | Enabled: true 111 | Invert Rainbow: false 112 | Max Color: 255; 255; 255 113 | Min Color: 0; 0; 0 114 | Name: PointCloud2 115 | Position Transformer: XYZ 116 | Queue Size: 10 117 | Selectable: true 118 | Size (Pixels): 3 119 | Size (m): 0.5 120 | Style: Flat Squares 121 | Topic: /cloud_key_points 122 | Unreliable: false 123 | Use Fixed Frame: true 124 | Use rainbow: true 125 | Value: true 126 | - Alpha: 0.800000011920929 127 | Autocompute Intensity Bounds: true 128 | Autocompute Value Bounds: 129 | Max Value: 10 130 | Min Value: -10 131 | Value: true 132 | Axis: Z 133 | Channel Name: intensity 134 | Class: rviz/PointCloud2 135 | Color: 138; 226; 52 136 | Color Transformer: FlatColor 137 | Decay Time: 0 138 | Enabled: true 139 | Invert Rainbow: false 140 | Max Color: 255; 255; 255 141 | Min Color: 0; 0; 0 142 | Name: PointCloud2 143 | Position Transformer: XYZ 144 | Queue Size: 10 145 | Selectable: true 146 | Size (Pixels): 3 147 | Size (m): 0.20000000298023224 148 | Style: Flat Squares 149 | Topic: /cloud_matched 150 | Unreliable: false 151 | Use Fixed Frame: true 152 | Use rainbow: true 153 | Value: true 154 | - Alpha: 0.800000011920929 155 | Autocompute Intensity Bounds: true 156 | Autocompute Value Bounds: 157 | Max Value: 10 158 | Min Value: -10 159 | Value: true 160 | Axis: Z 161 | Channel Name: intensity 162 | Class: rviz/PointCloud2 163 | Color: 138; 226; 52 164 | Color Transformer: FlatColor 165 | Decay Time: 0 166 | Enabled: true 167 | Invert Rainbow: false 168 | Max Color: 255; 255; 255 169 | Min Color: 0; 0; 0 170 | Name: PointCloud2 171 | Position Transformer: XYZ 172 | Queue Size: 10 173 | Selectable: true 174 | Size (Pixels): 3 175 | Size (m): 0.5 176 | Style: Flat Squares 177 | Topic: /cloud_matched_key_points 178 | Unreliable: false 179 | Use Fixed Frame: true 180 | Use rainbow: true 181 | Value: true 182 | - Class: rviz/MarkerArray 183 | Enabled: true 184 | Marker Topic: /descriptor_line 185 | Name: MarkerArray 186 | Namespaces: 187 | current: true 188 | Queue Size: 100 189 | Value: true 190 | - Angle Tolerance: 0.10000000149011612 191 | Class: rviz/Odometry 192 | Covariance: 193 | Orientation: 194 | Alpha: 0.5 195 | Color: 255; 255; 127 196 | Color Style: Unique 197 | Frame: Local 198 | Offset: 1 199 | Scale: 1 200 | Value: true 201 | Position: 202 | Alpha: 0.30000001192092896 203 | Color: 204; 51; 204 204 | Scale: 1 205 | Value: true 206 | Value: true 207 | Enabled: false 208 | Keep: 100000 209 | Name: Odometry 210 | Position Tolerance: 0.10000000149011612 211 | Shape: 212 | Alpha: 1 213 | Axes Length: 1 214 | Axes Radius: 0.10000000149011612 215 | Color: 255; 25; 0 216 | Head Length: 0.30000001192092896 217 | Head Radius: 0.10000000149011612 218 | Shaft Length: 1 219 | Shaft Radius: 0.05000000074505806 220 | Value: Axes 221 | Topic: /aft_mapped_to_init 222 | Unreliable: false 223 | Value: false 224 | - Alpha: 1 225 | Autocompute Intensity Bounds: true 226 | Autocompute Value Bounds: 227 | Max Value: 10 228 | Min Value: -10 229 | Value: true 230 | Axis: Z 231 | Channel Name: intensity 232 | Class: rviz/PointCloud2 233 | Color: 255; 255; 255 234 | Color Transformer: "" 235 | Decay Time: 10000 236 | Enabled: true 237 | Invert Rainbow: false 238 | Max Color: 255; 255; 255 239 | Min Color: 0; 0; 0 240 | Name: PointCloud2 241 | Position Transformer: "" 242 | Queue Size: 10 243 | Selectable: true 244 | Size (Pixels): 3 245 | Size (m): 0.009999999776482582 246 | Style: Flat Squares 247 | Topic: /cloud_correct 248 | Unreliable: false 249 | Use Fixed Frame: true 250 | Use rainbow: true 251 | Value: true 252 | - Alpha: 1 253 | Autocompute Intensity Bounds: true 254 | Autocompute Value Bounds: 255 | Max Value: -284.1042175292969 256 | Min Value: -488.2333984375 257 | Value: true 258 | Axis: Z 259 | Channel Name: intensity 260 | Class: rviz/PointCloud2 261 | Color: 255; 0; 0 262 | Color Transformer: FlatColor 263 | Decay Time: 0 264 | Enabled: true 265 | Invert Rainbow: false 266 | Max Color: 255; 255; 255 267 | Min Color: 0; 0; 0 268 | Name: PointCloud2 269 | Position Transformer: XYZ 270 | Queue Size: 10 271 | Selectable: true 272 | Size (Pixels): 3 273 | Size (m): 0.20000000298023224 274 | Style: Flat Squares 275 | Topic: /cloud_registered 276 | Unreliable: false 277 | Use Fixed Frame: true 278 | Use rainbow: true 279 | Value: true 280 | - Class: rviz/Image 281 | Enabled: true 282 | Image Topic: /depth_img 283 | Max Value: 1 284 | Median window: 5 285 | Min Value: 0 286 | Name: Image 287 | Normalize Range: true 288 | Queue Size: 2 289 | Transport Hint: raw 290 | Unreliable: false 291 | Value: true 292 | - Alpha: 1 293 | Autocompute Intensity Bounds: true 294 | Autocompute Value Bounds: 295 | Max Value: 10 296 | Min Value: -10 297 | Value: true 298 | Axis: Z 299 | Channel Name: intensity 300 | Class: rviz/PointCloud2 301 | Color: 255; 255; 255 302 | Color Transformer: Intensity 303 | Decay Time: 0 304 | Enabled: true 305 | Invert Rainbow: false 306 | Max Color: 255; 255; 255 307 | Min Color: 0; 0; 0 308 | Name: PointCloud2 309 | Position Transformer: XYZ 310 | Queue Size: 10 311 | Selectable: true 312 | Size (Pixels): 3 313 | Size (m): 0.30000001192092896 314 | Style: Flat Squares 315 | Topic: /cloud_key_points 316 | Unreliable: false 317 | Use Fixed Frame: true 318 | Use rainbow: true 319 | Value: true 320 | - Class: rviz/MarkerArray 321 | Enabled: true 322 | Marker Topic: /ids_pose 323 | Name: MarkerArray 324 | Namespaces: 325 | pose_ids: true 326 | Queue Size: 100 327 | Value: true 328 | - Class: rviz/MarkerArray 329 | Enabled: false 330 | Marker Topic: /descriptor_line2 331 | Name: MarkerArray 332 | Namespaces: 333 | {} 334 | Queue Size: 100 335 | Value: false 336 | - Class: rviz/Image 337 | Enabled: false 338 | Image Topic: /depth_img 339 | Max Value: 1 340 | Median window: 5 341 | Min Value: 0 342 | Name: Image 343 | Normalize Range: true 344 | Queue Size: 2 345 | Transport Hint: raw 346 | Unreliable: false 347 | Value: false 348 | Enabled: true 349 | Global Options: 350 | Background Color: 0; 0; 0 351 | Default Light: true 352 | Fixed Frame: camera_init 353 | Frame Rate: 10 354 | Name: root 355 | Tools: 356 | - Class: rviz/Interact 357 | Hide Inactive Objects: true 358 | - Class: rviz/MoveCamera 359 | - Class: rviz/Select 360 | - Class: rviz/FocusCamera 361 | - Class: rviz/Measure 362 | - Class: rviz/SetInitialPose 363 | Theta std deviation: 0.2617993950843811 364 | Topic: /initialpose 365 | X std deviation: 0.5 366 | Y std deviation: 0.5 367 | - Class: rviz/SetGoal 368 | Topic: /move_base_simple/goal 369 | - Class: rviz/PublishPoint 370 | Single click: true 371 | Topic: /clicked_point 372 | Value: true 373 | Views: 374 | Current: 375 | Class: rviz/Orbit 376 | Distance: 35.045406341552734 377 | Enable Stereo Rendering: 378 | Stereo Eye Separation: 0.05999999865889549 379 | Stereo Focal Distance: 1 380 | Swap Stereo Eyes: false 381 | Value: false 382 | Focal Point: 383 | X: 1.5839892625808716 384 | Y: 0.6286420226097107 385 | Z: 5.3160014152526855 386 | Focal Shape Fixed Size: true 387 | Focal Shape Size: 0.05000000074505806 388 | Invert Z Axis: false 389 | Name: Current View 390 | Near Clip Distance: 0.009999999776482582 391 | Pitch: 0.46058231592178345 392 | Target Frame: 393 | Value: Orbit (rviz) 394 | Yaw: 3.268998622894287 395 | Saved: 396 | - Class: rviz/Orbit 397 | Distance: 149.19589233398438 398 | Enable Stereo Rendering: 399 | Stereo Eye Separation: 0.05999999865889549 400 | Stereo Focal Distance: 1 401 | Swap Stereo Eyes: false 402 | Value: false 403 | Focal Point: 404 | X: 10.536402702331543 405 | Y: 71.63034057617188 406 | Z: 0.04836302623152733 407 | Focal Shape Fixed Size: false 408 | Focal Shape Size: 0.05000000074505806 409 | Invert Z Axis: false 410 | Name: park1_view 411 | Near Clip Distance: 0.009999999776482582 412 | Pitch: 1.5697963237762451 413 | Target Frame: 414 | Value: Orbit (rviz) 415 | Yaw: 3.2935829162597656 416 | Window Geometry: 417 | Displays: 418 | collapsed: false 419 | Height: 1025 420 | Hide Left Dock: false 421 | Hide Right Dock: true 422 | Image: 423 | collapsed: false 424 | QMainWindow State: 000000ff00000000fd000000040000000000000289000003a7fc020000000ffb0000000a0049006d006100670065010000003d0000027b0000001600fffffffc000002be00000126000000e60100001cfa000000000100000003fb000000100044006900730070006c0061007900730100000000ffffffff0000015600fffffffb0000001200530065006c0065006300740069006f006e0100000000000001dc0000007400fffffffb0000000a0049006d0061006700650100000000ffffffff0000005e00fffffffb0000001e0054006f006f006c002000500072006f007000650072007400690065007302000001ed000001df00000185000000a3fb000000120056006900650077007300200054006f006f02000001df000002110000018500000122fb000000200054006f006f006c002000500072006f0070006500720074006900650073003203000002880000011d000002210000017afb0000002000730065006c0065006300740069006f006e00200062007500660066006500720200000138000000aa0000023a00000294fb00000014005700690064006500530074006500720065006f02000000e6000000d2000003ee0000030bfb0000000c004b0069006e0065006300740200000186000001060000030c00000261fb0000000a0049006d006100670065000000033e0000020c0000000000000000fb0000000a0049006d006100670065010000036e0000001e0000000000000000fb0000000a0049006d00610067006501000002c5000000c70000000000000000fb0000000a0049006d00610067006501000002c5000000c70000000000000000fb0000000a0049006d00610067006501000002c5000000c70000000000000000fb0000000a0049006d00610067006501000002c3000000c70000000000000000fb0000000a0049006d00610067006503000001d0000002b7000006e1000004e30000000100000100000003a7fc0200000003fb0000001e0054006f006f006c002000500072006f00700065007200740069006500730100000041000000780000000000000000fb0000000a00560069006500770073000000003d000003a7000000a400fffffffb0000001200530065006c0065006300740069006f006e010000025a000000b200000000000000000000000200000490000000a9fc0100000001fb0000000a00560069006500770073030000004e00000080000002e100000197000000030000073d00000039fc0100000002fb0000000800540069006d006500000000000000073d000004f300fffffffb0000000800540069006d00650100000000000004500000000000000000000004ae000003a700000004000000040000000800000008fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000 425 | Selection: 426 | collapsed: false 427 | Time: 428 | collapsed: false 429 | Tool Properties: 430 | collapsed: false 431 | Views: 432 | collapsed: true 433 | Width: 1853 434 | X: 67 435 | Y: 27 436 | --------------------------------------------------------------------------------