[ros-vision-opencv] 01/04: Imported Upstream version 1.11.9
Jochen Sprickerhof
jspricke-guest at moszumanska.debian.org
Mon Nov 30 09:20:24 UTC 2015
This is an automated email from the git hooks/post-receive script.
jspricke-guest pushed a commit to branch master
in repository ros-vision-opencv.
commit e1fac4189653fd70433f3ba3f98754fac334a291
Author: Jochen Sprickerhof <git at jochen.sprickerhof.de>
Date: Mon Nov 30 10:02:50 2015 +0100
Imported Upstream version 1.11.9
---
.travis.yml | 81 ++--
README.rst | 7 +
cv_bridge/CHANGELOG.rst | 10 +
cv_bridge/include/cv_bridge/cv_bridge.h | 78 +++-
cv_bridge/package.xml | 2 +-
cv_bridge/src/CMakeLists.txt | 3 +-
cv_bridge/src/boost/README | 2 +
cv_bridge/src/boost/core/scoped_enum.hpp | 192 ++++++++
cv_bridge/src/boost/endian/conversion.hpp | 488 +++++++++++++++++++++
cv_bridge/src/boost/endian/detail/intrinsic.hpp | 64 +++
cv_bridge/src/boost/predef/detail/_cassert.h | 17 +
cv_bridge/src/boost/predef/detail/endian_compat.h | 26 ++
cv_bridge/src/boost/predef/detail/test.h | 17 +
cv_bridge/src/boost/predef/library/c/_prefix.h | 13 +
cv_bridge/src/boost/predef/library/c/gnu.h | 61 +++
cv_bridge/src/boost/predef/make.h | 89 ++++
cv_bridge/src/boost/predef/os/android.h | 45 ++
cv_bridge/src/boost/predef/os/bsd.h | 103 +++++
cv_bridge/src/boost/predef/os/bsd/bsdi.h | 48 ++
cv_bridge/src/boost/predef/os/bsd/dragonfly.h | 50 +++
cv_bridge/src/boost/predef/os/bsd/free.h | 60 +++
cv_bridge/src/boost/predef/os/bsd/net.h | 84 ++++
cv_bridge/src/boost/predef/os/bsd/open.h | 171 ++++++++
cv_bridge/src/boost/predef/os/ios.h | 51 +++
cv_bridge/src/boost/predef/os/macos.h | 65 +++
cv_bridge/src/boost/predef/other/endian.h | 204 +++++++++
cv_bridge/src/boost/predef/version_number.h | 53 +++
cv_bridge/src/cv_bridge.cpp | 291 +++++++++++-
cv_bridge/test/CMakeLists.txt | 6 +-
cv_bridge/test/test_endian.cpp | 38 ++
cv_bridge/test/utest.cpp | 24 +
cv_bridge/test/utest2.cpp | 14 +-
image_geometry/CHANGELOG.rst | 6 +
image_geometry/CMakeLists.txt | 2 +-
image_geometry/package.xml | 2 +-
image_geometry/src/pinhole_camera_model.cpp | 2 +-
opencv_apps/CHANGELOG.rst | 6 +
opencv_apps/CMakeLists.txt | 12 +-
opencv_apps/nodelet_plugins.xml | 8 +
opencv_apps/package.xml | 2 +-
opencv_apps/src/node/simple_compressed_example.cpp | 55 +++
opencv_apps/src/node/simple_example.cpp | 55 +++
.../src/nodelet/contour_moments_nodelet.cpp | 18 +-
opencv_apps/src/nodelet/convex_hull_nodelet.cpp | 18 +-
opencv_apps/src/nodelet/edge_detection_nodelet.cpp | 24 +-
opencv_apps/src/nodelet/face_detection_nodelet.cpp | 18 +-
opencv_apps/src/nodelet/fback_flow_nodelet.cpp | 16 +-
opencv_apps/src/nodelet/find_contours_nodelet.cpp | 8 +-
.../src/nodelet/general_contours_nodelet.cpp | 18 +-
.../src/nodelet/goodfeature_track_nodelet.cpp | 16 +-
opencv_apps/src/nodelet/hough_circles_nodelet.cpp | 20 +-
opencv_apps/src/nodelet/hough_lines_nodelet.cpp | 18 +-
opencv_apps/src/nodelet/lk_flow_nodelet.cpp | 16 +-
opencv_apps/src/nodelet/phase_corr_nodelet.cpp | 18 +-
.../nodelet/simple_compressed_example_nodelet.cpp | 121 +++++
opencv_apps/src/nodelet/simple_example_nodelet.cpp | 122 ++++++
opencv_tests/CHANGELOG.rst | 3 +
opencv_tests/package.xml | 2 +-
vision_opencv/CHANGELOG.rst | 5 +
vision_opencv/package.xml | 4 +-
60 files changed, 2918 insertions(+), 154 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index 41cce59..226873f 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,45 +1,56 @@
-# Travis Continuous Integration Configuration File, based on ..
-language:
- - cpp
- - python
-python:
- - "2.7"
-compiler:
- - gcc
+sudo: required
+dist: trusty
+language: generic
env:
- - OPENCV_VERSION=2 ROS_DISTRO=hydro
- - OPENCV_VERSION=3 ROS_DISTRO=hydro
-before_install: # Use this to prepare the system to install prerequisites or dependencies
- # Define some config vars
+ - OPENCV_VERSION=2 ROS_DISTRO=indigo
+ - OPENCV_VERSION=3 ROS_DISTRO=indigo
+# Install system dependencies, namely ROS.
+before_install:
+ # Define some config vars.
+ - export ROS_CI_DESKTOP=`lsb_release -cs` # e.g. [precise|trusty]
- export CI_SOURCE_PATH=$(pwd)
- export REPOSITORY_NAME=${PWD##*/}
- - echo "Testing branch $TRAVIS_BRANCH of $REPOSITORY_NAME"
- - sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu precise main" > /etc/apt/sources.list.d/ros-latest.list'
+ - export ROSINSTALL_FILE=$CI_SOURCE_PATH/dependencies.rosinstall
+ - export CATKIN_OPTIONS=$CI_SOURCE_PATH/catkin.options
+ - export ROS_PARALLEL_JOBS='-j8 -l6'
+ # Install ROS
+ - sudo sh -c "echo \"deb http://packages.ros.org/ros/ubuntu $ROS_CI_DESKTOP main\" > /etc/apt/sources.list.d/ros-latest.list"
- wget http://packages.ros.org/ros.key -O - | sudo apt-key add -
- sudo apt-get update -qq
- - sudo apt-get install -qq -y python-rosdep python-rosinstall python-catkin-tools ros-$ROS_DISTRO-catkin
- # MongoDB hack - I don't fully understand this but its for moveit_warehouse
- - sudo apt-get remove -y mongodb mongodb-10gen
- - sudo apt-get install -y mongodb-clients mongodb-server -o Dpkg::Options::="--force-confdef" # default actions
- # Setup rosdep
+ # Install ROS
+ - sudo apt-get install -y python-catkin-pkg python-catkin-tools python-rosdep python-wstool ros-$ROS_DISTRO-catkin
+ - source /opt/ros/$ROS_DISTRO/setup.bash
+ # Setup for rosdep
- sudo rosdep init
- rosdep update
-install: # Use this to install any prerequisites or dependencies necessary to run your build
- # Create workspace
- - mkdir -p ~/ros/ws_$REPOSITORY_NAME/src
- - cd ~/ros/ws_$REPOSITORY_NAME
- - wstool init src
- #- wstool set hogehoge http://github.com/hogehoge/hogehoge --git -t src
- #- wstool update -j10 -t src
- - ln -s $CI_SOURCE_PATH src/$REPOSITORY_NAME # Link the repo we are testing to the new workspace
- - if [ $OPENCV_VERSION == 2 ]; then sed -i 's at libopencv-dev@opencv2@' src/$REPOSITORY_NAME/*/package.xml ; fi
- - if [ $OPENCV_VERSION == 3 ]; then sed -i 's at libopencv-dev@opencv3@' src/$REPOSITORY_NAME/*/package.xml ; fi
- # Install dependencies for source repos
- - rosdep install -r -n --from-paths . --ignore-src --rosdistro $ROS_DISTRO -y
-before_script: # Use this to prepare your build for testing e.g. copy database configurations, environment variables, etc.
+
+# Create a catkin workspace with the package under test.
+install:
+ - mkdir -p ~/catkin_ws/src
+
+ # Add the package under test to the workspace.
+ - cd ~/catkin_ws/src
+ - ln -s $CI_SOURCE_PATH . # Link the repo we are testing to the new workspace
+
+ - if [ $OPENCV_VERSION == 3 ]; then sed -i 's at libopencv-dev@opencv3@' $REPOSITORY_NAME/*/package.xml ; fi
+
+# Install all dependencies, using wstool and rosdep.
+# wstool looks for a ROSINSTALL_FILE defined in before_install.
+before_script:
+ # source dependencies: install using wstool.
+ - cd ~/catkin_ws/src
+ - wstool init
+ - if [[ -f $ROSINSTALL_FILE ]] ; then wstool merge $ROSINSTALL_FILE ; fi
+ - wstool up
+
+ # package depdencies: install using rosdep.
+ - cd ~/catkin_ws
+ - rosdep install -y -r --from-paths src --ignore-src --rosdistro $ROS_DISTRO
+
+# Compile and test.
+script:
- source /opt/ros/$ROS_DISTRO/setup.bash
-script: # All commands must exit with code 0 on success. Anything else is considered failure.
- - cd ~/ros/ws_$REPOSITORY_NAME
+ - cd ~/catkin_ws
- catkin build -p1 -j1
- catkin run_tests -p1 -j1
- catkin_test_results --all build
@@ -48,4 +59,4 @@ script: # All commands must exit with code 0 on success. Anything else is consid
- catkin build -p1 -j1
after_failure:
- find ${HOME}/.ros/test_results -type f -exec echo "== {} ==" \; -exec cat {} \;
- - for file in ${HOME}/.ros/log/rostest-*; do echo "=== $file ==="; cat $file; done
\ No newline at end of file
+ - for file in ${HOME}/.ros/log/rostest-*; do echo "=== $file ==="; cat $file; done
diff --git a/README.rst b/README.rst
new file mode 100644
index 0000000..d9387bf
--- /dev/null
+++ b/README.rst
@@ -0,0 +1,7 @@
+vision_opencv
+=============
+
+.. image:: https://travis-ci.org/ros-perception/vision_opencv.svg?branch=indigo
+ :target: https://travis-ci.org/ros-perception/vision_opencv
+
+Packages for interfacing ROS with OpenCV, a library of programming functions for real time computer vision.
diff --git a/cv_bridge/CHANGELOG.rst b/cv_bridge/CHANGELOG.rst
index 3bdbbc9..c894de4 100644
--- a/cv_bridge/CHANGELOG.rst
+++ b/cv_bridge/CHANGELOG.rst
@@ -2,6 +2,16 @@
Changelog for package cv_bridge
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+1.11.9 (2015-11-29)
+-------------------
+* deal with endianness
+* add cvtColorForDisplay
+* Improved efficiency by using toCvShare instead of toCvCopy.
+* Add format enum for easy use and choose format.
+* fix compilation warnings
+* start to extend the cv_bridge with cvCompressedImage class, that will convert from cv::Mat opencv images to CompressedImage ros messages and vice versa
+* Contributors: Carlos Costa, Vincent Rabaud, talregev
+
1.11.8 (2015-07-15)
-------------------
* Simplify some OpenCV3 distinction
diff --git a/cv_bridge/include/cv_bridge/cv_bridge.h b/cv_bridge/include/cv_bridge/cv_bridge.h
index 3642dfc..b9ada6f 100644
--- a/cv_bridge/include/cv_bridge/cv_bridge.h
+++ b/cv_bridge/include/cv_bridge/cv_bridge.h
@@ -1,7 +1,8 @@
/*********************************************************************
* Software License Agreement (BSD License)
*
-* Copyright (c) 2011, Willow Garage, Inc.
+* Copyright (c) 2011, Willow Garage, Inc,
+* Copyright (c) 2015, Tal Regev.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -36,8 +37,12 @@
#define CV_BRIDGE_CV_BRIDGE_H
#include <sensor_msgs/Image.h>
+#include <sensor_msgs/CompressedImage.h>
+#include <sensor_msgs/image_encodings.h>
#include <ros/static_assert.h>
#include <opencv2/core/core.hpp>
+#include <opencv2/imgproc/imgproc.hpp>
+#include <opencv2/imgproc/types_c.h>
#include <stdexcept>
namespace cv_bridge {
@@ -53,6 +58,17 @@ class CvImage;
typedef boost::shared_ptr<CvImage> CvImagePtr;
typedef boost::shared_ptr<CvImage const> CvImageConstPtr;
+//from: http://docs.opencv.org/modules/highgui/doc/reading_and_writing_images_and_video.html#Mat imread(const string& filename, int flags)
+typedef enum {
+ BMP, DIP,
+ JPG, JPEG, JPE,
+ JP2,
+ PNG,
+ PBM, PGM, PPM,
+ SR, RAS,
+ TIFF, TIF,
+} Format;
+
/**
* \brief Image message class that is interoperable with sensor_msgs/Image but uses a
* more convenient cv::Mat representation for the image data.
@@ -86,6 +102,15 @@ public:
sensor_msgs::ImagePtr toImageMsg() const;
/**
+ * dst_format is compress the image to desire format.
+ * Default value is empty string that will convert to jpg format.
+ * can be: jpg, jp2, bmp, png, tif at the moment
+ * support this format from opencv:
+ * http://docs.opencv.org/modules/highgui/doc/reading_and_writing_images_and_video.html#Mat imread(const string& filename, int flags)
+ */
+ sensor_msgs::CompressedImagePtr toCompressedImageMsg(const Format dst_format = JPG) const;
+
+ /**
* \brief Copy the message data to a ROS sensor_msgs::Image message.
*
* This overload is intended mainly for aggregate messages such as stereo_msgs::DisparityImage,
@@ -93,6 +118,16 @@ public:
*/
void toImageMsg(sensor_msgs::Image& ros_image) const;
+ /**
+ * dst_format is compress the image to desire format.
+ * Default value is empty string that will convert to jpg format.
+ * can be: jpg, jp2, bmp, png, tif at the moment
+ * support this format from opencv:
+ * http://docs.opencv.org/modules/highgui/doc/reading_and_writing_images_and_video.html#Mat imread(const string& filename, int flags)
+ */
+ void toCompressedImageMsg(sensor_msgs::CompressedImage& ros_image, const Format dst_format = JPG) const;
+
+
typedef boost::shared_ptr<CvImage> Ptr;
typedef boost::shared_ptr<CvImage const> ConstPtr;
@@ -107,6 +142,7 @@ protected:
/// @endcond
};
+
/**
* \brief Convert a sensor_msgs::Image message to an OpenCV-compatible CvImage, copying the
* image data.
@@ -126,6 +162,9 @@ protected:
CvImagePtr toCvCopy(const sensor_msgs::ImageConstPtr& source,
const std::string& encoding = std::string());
+CvImagePtr toCvCopy(const sensor_msgs::CompressedImageConstPtr& source,
+ const std::string& encoding = std::string());
+
/**
* \brief Convert a sensor_msgs::Image message to an OpenCV-compatible CvImage, copying the
* image data.
@@ -148,6 +187,9 @@ CvImagePtr toCvCopy(const sensor_msgs::ImageConstPtr& source,
CvImagePtr toCvCopy(const sensor_msgs::Image& source,
const std::string& encoding = std::string());
+CvImagePtr toCvCopy(const sensor_msgs::CompressedImage& source,
+ const std::string& encoding = std::string());
+
/**
* \brief Convert an immutable sensor_msgs::Image message to an OpenCV-compatible CvImage, sharing
* the image data if possible.
@@ -206,6 +248,39 @@ CvImagePtr cvtColor(const CvImageConstPtr& source,
const std::string& encoding);
/**
+ * \brief Converts an immutable sensor_msgs::Image message to another CvImage for display purposes,
+ * using practical conversion rules if needed.
+ *
+ * Data will be shared between input and output if possible.
+ *
+ * Recall: sensor_msgs::image_encodings::isColor and isMono tell whether an image contains R,G,B,A, mono
+ * (or any combination/subset) with 8 or 16 bit depth.
+ *
+ * The following rules apply:
+ * - if the output encoding is empty, the fact that the input image is mono or multiple-channel is
+ * preserved in the ouput image. The bit depth will be 8.
+ * - if the output encoding is not empty, it must have sensor_msgs::image_encodings::isColor and
+ * isMono return true. It must also be 8 bit in depth
+ * - if the input encoding is an OpenCV format (e.g. 8UC1), and if we have 1,3 or 4 channels, it is
+ * respectively converted to mono, BGR or BGRA.
+ *
+ * \param source A shared_ptr to a sensor_msgs::Image message
+ * \param encoding Either an encoding string that returns true in sensor_msgs::image_encodings::isColor
+ * isMono or the mpty string. If it is the empty string,
+ *
+ * \param do_dynamic_scaling If true, the image is dynamically scaled between its minimum and maximum value
+ * before being converted to its final encoding.
+ * \param min_image_value Independently from do_dynamic_scaling, if min_image_value and max_image_value are
+ * different, the image is scaled between these two values before being converted to its final encoding.
+ * \param max_image_value Maximum image value
+ */
+CvImageConstPtr cvtColorForDisplay(const CvImageConstPtr& source,
+ const std::string& encoding_out = std::string(),
+ bool do_dynamic_scaling = false,
+ double min_image_value = 0.0,
+ double max_image_value = 0.0);
+
+/**
* \brief Get the OpenCV type enum corresponding to the encoding.
*
* For example, "bgr8" -> CV_8UC3.
@@ -215,7 +290,6 @@ int getCvType(const std::string& encoding);
} // namespace cv_bridge
-
// CvImage as a first class message type
// The rest of this file hooks into the roscpp serialization API to make CvImage
diff --git a/cv_bridge/package.xml b/cv_bridge/package.xml
index bc369c7..a503c30 100644
--- a/cv_bridge/package.xml
+++ b/cv_bridge/package.xml
@@ -1,6 +1,6 @@
<package>
<name>cv_bridge</name>
- <version>1.11.8</version>
+ <version>1.11.9</version>
<description>
This contains CvBridge, which converts between ROS
Image messages and OpenCV images.
diff --git a/cv_bridge/src/CMakeLists.txt b/cv_bridge/src/CMakeLists.txt
index e286b61..806cd05 100644
--- a/cv_bridge/src/CMakeLists.txt
+++ b/cv_bridge/src/CMakeLists.txt
@@ -1,6 +1,7 @@
# add library
+include_directories(./)
add_library(${PROJECT_NAME} cv_bridge.cpp)
-add_dependencies(${PROJECT_NAME} sensor_msgs_gencpp)
+add_dependencies(${PROJECT_NAME} ${catkin_EXPORTED_TARGETS})
target_link_libraries(${PROJECT_NAME} ${OpenCV_LIBRARIES} ${catkin_LIBRARIES})
install(TARGETS ${PROJECT_NAME} DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION})
diff --git a/cv_bridge/src/boost/README b/cv_bridge/src/boost/README
new file mode 100644
index 0000000..f3a3d3c
--- /dev/null
+++ b/cv_bridge/src/boost/README
@@ -0,0 +1,2 @@
+this code is taken from Boost at https://github.com/boostorg/endian.git
+We should remove this folder once Boost 1.58 or above is the default.
diff --git a/cv_bridge/src/boost/core/scoped_enum.hpp b/cv_bridge/src/boost/core/scoped_enum.hpp
new file mode 100644
index 0000000..78c548b
--- /dev/null
+++ b/cv_bridge/src/boost/core/scoped_enum.hpp
@@ -0,0 +1,192 @@
+// scoped_enum.hpp ---------------------------------------------------------//
+
+// Copyright Beman Dawes, 2009
+// Copyright (C) 2011-2012 Vicente J. Botet Escriba
+// Copyright (C) 2012 Anthony Williams
+
+// Distributed under the Boost Software License, Version 1.0.
+// See http://www.boost.org/LICENSE_1_0.txt
+
+#ifndef BOOST_CORE_SCOPED_ENUM_HPP
+#define BOOST_CORE_SCOPED_ENUM_HPP
+
+#include <boost/config.hpp>
+
+#ifdef BOOST_HAS_PRAGMA_ONCE
+#pragma once
+#endif
+
+namespace boost
+{
+
+#ifdef BOOST_NO_CXX11_SCOPED_ENUMS
+
+ /**
+ * Meta-function to get the native enum type associated to an enum class or its emulation.
+ */
+ template <typename EnumType>
+ struct native_type
+ {
+ /**
+ * The member typedef type names the native enum type associated to the scoped enum,
+ * which is it self if the compiler supports scoped enums or EnumType::enum_type if it is an emulated scoped enum.
+ */
+ typedef typename EnumType::enum_type type;
+ };
+
+ /**
+ * Casts a scoped enum to its underlying type.
+ *
+ * This function is useful when working with scoped enum classes, which doens't implicitly convert to the underlying type.
+ * @param v A scoped enum.
+ * @returns The underlying type.
+ * @throws No-throws.
+ */
+ template <typename UnderlyingType, typename EnumType>
+ UnderlyingType underlying_cast(EnumType v)
+ {
+ return v.get_underlying_value_();
+ }
+
+ /**
+ * Casts a scoped enum to its native enum type.
+ *
+ * This function is useful to make programs portable when the scoped enum emulation can not be use where native enums can.
+ *
+ * EnumType the scoped enum type
+ *
+ * @param v A scoped enum.
+ * @returns The native enum value.
+ * @throws No-throws.
+ */
+ template <typename EnumType>
+ inline
+ typename EnumType::enum_type native_value(EnumType e)
+ {
+ return e.get_native_value_();
+ }
+
+#else // BOOST_NO_CXX11_SCOPED_ENUMS
+
+ template <typename EnumType>
+ struct native_type
+ {
+ typedef EnumType type;
+ };
+
+ template <typename UnderlyingType, typename EnumType>
+ UnderlyingType underlying_cast(EnumType v)
+ {
+ return static_cast<UnderlyingType>(v);
+ }
+
+ template <typename EnumType>
+ inline
+ EnumType native_value(EnumType e)
+ {
+ return e;
+ }
+
+#endif // BOOST_NO_CXX11_SCOPED_ENUMS
+}
+
+
+#ifdef BOOST_NO_CXX11_SCOPED_ENUMS
+
+#ifndef BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
+
+#define BOOST_SCOPED_ENUM_UT_DECLARE_CONVERSION_OPERATOR \
+ explicit operator underlying_type() const BOOST_NOEXCEPT { return get_underlying_value_(); }
+
+#else
+
+#define BOOST_SCOPED_ENUM_UT_DECLARE_CONVERSION_OPERATOR
+
+#endif
+
+/**
+ * Start a declaration of a scoped enum.
+ *
+ * @param EnumType The new scoped enum.
+ * @param UnderlyingType The underlying type.
+ */
+#define BOOST_SCOPED_ENUM_UT_DECLARE_BEGIN(EnumType, UnderlyingType) \
+ struct EnumType { \
+ typedef void is_boost_scoped_enum_tag; \
+ typedef UnderlyingType underlying_type; \
+ EnumType() BOOST_NOEXCEPT {} \
+ explicit EnumType(underlying_type v) BOOST_NOEXCEPT : v_(v) {} \
+ underlying_type get_underlying_value_() const BOOST_NOEXCEPT { return v_; } \
+ BOOST_SCOPED_ENUM_UT_DECLARE_CONVERSION_OPERATOR \
+ private: \
+ underlying_type v_; \
+ typedef EnumType self_type; \
+ public: \
+ enum enum_type
+
+#define BOOST_SCOPED_ENUM_DECLARE_END2() \
+ enum_type get_native_value_() const BOOST_NOEXCEPT { return enum_type(v_); } \
+ friend bool operator ==(self_type lhs, self_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)==enum_type(rhs.v_); } \
+ friend bool operator ==(self_type lhs, enum_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)==rhs; } \
+ friend bool operator ==(enum_type lhs, self_type rhs) BOOST_NOEXCEPT { return lhs==enum_type(rhs.v_); } \
+ friend bool operator !=(self_type lhs, self_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)!=enum_type(rhs.v_); } \
+ friend bool operator !=(self_type lhs, enum_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)!=rhs; } \
+ friend bool operator !=(enum_type lhs, self_type rhs) BOOST_NOEXCEPT { return lhs!=enum_type(rhs.v_); } \
+ friend bool operator <(self_type lhs, self_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)<enum_type(rhs.v_); } \
+ friend bool operator <(self_type lhs, enum_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)<rhs; } \
+ friend bool operator <(enum_type lhs, self_type rhs) BOOST_NOEXCEPT { return lhs<enum_type(rhs.v_); } \
+ friend bool operator <=(self_type lhs, self_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)<=enum_type(rhs.v_); } \
+ friend bool operator <=(self_type lhs, enum_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)<=rhs; } \
+ friend bool operator <=(enum_type lhs, self_type rhs) BOOST_NOEXCEPT { return lhs<=enum_type(rhs.v_); } \
+ friend bool operator >(self_type lhs, self_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)>enum_type(rhs.v_); } \
+ friend bool operator >(self_type lhs, enum_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)>rhs; } \
+ friend bool operator >(enum_type lhs, self_type rhs) BOOST_NOEXCEPT { return lhs>enum_type(rhs.v_); } \
+ friend bool operator >=(self_type lhs, self_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)>=enum_type(rhs.v_); } \
+ friend bool operator >=(self_type lhs, enum_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)>=rhs; } \
+ friend bool operator >=(enum_type lhs, self_type rhs) BOOST_NOEXCEPT { return lhs>=enum_type(rhs.v_); } \
+ };
+
+#define BOOST_SCOPED_ENUM_DECLARE_END(EnumType) \
+ ; \
+ EnumType(enum_type v) BOOST_NOEXCEPT : v_(v) {} \
+ BOOST_SCOPED_ENUM_DECLARE_END2()
+
+/**
+ * Starts a declaration of a scoped enum with the default int underlying type.
+ *
+ * @param EnumType The new scoped enum.
+ */
+#define BOOST_SCOPED_ENUM_DECLARE_BEGIN(EnumType) \
+ BOOST_SCOPED_ENUM_UT_DECLARE_BEGIN(EnumType,int)
+
+/**
+ * Name of the native enum type.
+ *
+ * @param EnumType The new scoped enum.
+ */
+#define BOOST_SCOPED_ENUM_NATIVE(EnumType) EnumType::enum_type
+/**
+ * Forward declares an scoped enum.
+ *
+ * @param EnumType The scoped enum.
+ */
+#define BOOST_SCOPED_ENUM_FORWARD_DECLARE(EnumType) struct EnumType
+
+#else // BOOST_NO_CXX11_SCOPED_ENUMS
+
+#define BOOST_SCOPED_ENUM_UT_DECLARE_BEGIN(EnumType,UnderlyingType) enum class EnumType : UnderlyingType
+#define BOOST_SCOPED_ENUM_DECLARE_BEGIN(EnumType) enum class EnumType
+#define BOOST_SCOPED_ENUM_DECLARE_END2()
+#define BOOST_SCOPED_ENUM_DECLARE_END(EnumType) ;
+
+#define BOOST_SCOPED_ENUM_NATIVE(EnumType) EnumType
+#define BOOST_SCOPED_ENUM_FORWARD_DECLARE(EnumType) enum class EnumType
+
+#endif // BOOST_NO_CXX11_SCOPED_ENUMS
+
+// Deprecated macros
+#define BOOST_SCOPED_ENUM_START(name) BOOST_SCOPED_ENUM_DECLARE_BEGIN(name)
+#define BOOST_SCOPED_ENUM_END BOOST_SCOPED_ENUM_DECLARE_END2()
+#define BOOST_SCOPED_ENUM(name) BOOST_SCOPED_ENUM_NATIVE(name)
+
+#endif // BOOST_CORE_SCOPED_ENUM_HPP
diff --git a/cv_bridge/src/boost/endian/conversion.hpp b/cv_bridge/src/boost/endian/conversion.hpp
new file mode 100644
index 0000000..7c145d9
--- /dev/null
+++ b/cv_bridge/src/boost/endian/conversion.hpp
@@ -0,0 +1,488 @@
+// boost/endian/conversion.hpp -------------------------------------------------------//
+
+// Copyright Beman Dawes 2010, 2011, 2014
+
+// Distributed under the Boost Software License, Version 1.0.
+// http://www.boost.org/LICENSE_1_0.txt
+
+#ifndef BOOST_ENDIAN_CONVERSION_HPP
+#define BOOST_ENDIAN_CONVERSION_HPP
+
+#include <boost/config.hpp>
+#include <boost/predef/detail/endian_compat.h>
+#include <boost/cstdint.hpp>
+#include <boost/endian/detail/intrinsic.hpp>
+#include <boost/core/scoped_enum.hpp>
+#include <boost/static_assert.hpp>
+#include <algorithm>
+#include <cstring> // for memcpy
+
+//------------------------------------- synopsis ---------------------------------------//
+
+namespace boost
+{
+namespace endian
+{
+ BOOST_SCOPED_ENUM_START(order)
+ {
+ big, little,
+# ifdef BOOST_BIG_ENDIAN
+ native = big
+# else
+ native = little
+# endif
+ }; BOOST_SCOPED_ENUM_END
+
+//--------------------------------------------------------------------------------------//
+// //
+// return-by-value interfaces //
+// suggested by Phil Endecott //
+// //
+// user-defined types (UDTs) //
+// //
+// All return-by-value conversion function templates are required to be implemented in //
+// terms of an unqualified call to "endian_reverse(x)", a function returning the //
+// value of x with endianness reversed. This provides a customization point for any //
+// UDT that provides a "endian_reverse" free-function meeting the requirements. //
+// It must be defined in the same namespace as the UDT itself so that it will be found //
+// by argument dependent lookup (ADL). //
+// //
+//--------------------------------------------------------------------------------------//
+
+ // customization for exact-length arithmetic types. See doc/conversion.html/#FAQ.
+ // Note: The omission of an overloads for the arithmetic type (typically long, or
+ // long long) not assigned to one of the exact length typedefs is a deliberate
+ // design decision. Such overloads would be non-portable and thus error prone.
+
+ inline int8_t endian_reverse(int8_t x) BOOST_NOEXCEPT;
+ inline int16_t endian_reverse(int16_t x) BOOST_NOEXCEPT;
+ inline int32_t endian_reverse(int32_t x) BOOST_NOEXCEPT;
+ inline int64_t endian_reverse(int64_t x) BOOST_NOEXCEPT;
+ inline uint8_t endian_reverse(uint8_t x) BOOST_NOEXCEPT;
+ inline uint16_t endian_reverse(uint16_t x) BOOST_NOEXCEPT;
+ inline uint32_t endian_reverse(uint32_t x) BOOST_NOEXCEPT;
+ inline uint64_t endian_reverse(uint64_t x) BOOST_NOEXCEPT;
+
+ // reverse byte order unless native endianness is big
+ template <class EndianReversible >
+ inline EndianReversible big_to_native(EndianReversible x) BOOST_NOEXCEPT;
+ // Returns: x if native endian order is big, otherwise endian_reverse(x)
+ template <class EndianReversible >
+ inline EndianReversible native_to_big(EndianReversible x) BOOST_NOEXCEPT;
+ // Returns: x if native endian order is big, otherwise endian_reverse(x)
+
+ // reverse byte order unless native endianness is little
+ template <class EndianReversible >
+ inline EndianReversible little_to_native(EndianReversible x) BOOST_NOEXCEPT;
+ // Returns: x if native endian order is little, otherwise endian_reverse(x)
+ template <class EndianReversible >
+ inline EndianReversible native_to_little(EndianReversible x) BOOST_NOEXCEPT;
+ // Returns: x if native endian order is little, otherwise endian_reverse(x)
+
+ // generic conditional reverse byte order
+ template <BOOST_SCOPED_ENUM(order) From, BOOST_SCOPED_ENUM(order) To,
+ class EndianReversible>
+ inline EndianReversible conditional_reverse(EndianReversible from) BOOST_NOEXCEPT;
+ // Returns: If From == To have different values, from.
+ // Otherwise endian_reverse(from).
+ // Remarks: The From == To test, and as a consequence which form the return takes, is
+ // is determined at compile time.
+
+ // runtime conditional reverse byte order
+ template <class EndianReversible >
+ inline EndianReversible conditional_reverse(EndianReversible from,
+ BOOST_SCOPED_ENUM(order) from_order, BOOST_SCOPED_ENUM(order) to_order)
+ BOOST_NOEXCEPT;
+ // Returns: from_order == to_order ? from : endian_reverse(from).
+
+ //------------------------------------------------------------------------------------//
+
+
+ // Q: What happended to bswap, htobe, and the other synonym functions based on names
+ // popularized by BSD, OS X, and Linux?
+ // A: Turned out these may be implemented as macros on some systems. Ditto POSIX names
+ // for such functionality. Since macros would cause endless problems with functions
+ // of the same names, and these functions are just synonyms anyhow, they have been
+ // removed.
+
+
+ //------------------------------------------------------------------------------------//
+ // //
+ // reverse in place interfaces //
+ // //
+ // user-defined types (UDTs) //
+ // //
+ // All reverse in place function templates are required to be implemented in terms //
+ // of an unqualified call to "endian_reverse_inplace(x)", a function reversing //
+ // the endianness of x, which is a non-const reference. This provides a //
+ // customization point for any UDT that provides a "reverse_inplace" free-function //
+ // meeting the requirements. The free-function must be declared in the same //
+ // namespace as the UDT itself so that it will be found by argument-dependent //
+ // lookup (ADL). //
+ // //
+ //------------------------------------------------------------------------------------//
+
+ // reverse in place
+ template <class EndianReversible>
+ inline void endian_reverse_inplace(EndianReversible& x) BOOST_NOEXCEPT;
+ // Effects: x = endian_reverse(x)
+
+ // reverse in place unless native endianness is big
+ template <class EndianReversibleInplace>
+ inline void big_to_native_inplace(EndianReversibleInplace& x) BOOST_NOEXCEPT;
+ // Effects: none if native byte-order is big, otherwise endian_reverse_inplace(x)
+ template <class EndianReversibleInplace>
+ inline void native_to_big_inplace(EndianReversibleInplace& x) BOOST_NOEXCEPT;
+ // Effects: none if native byte-order is big, otherwise endian_reverse_inplace(x)
+
+ // reverse in place unless native endianness is little
+ template <class EndianReversibleInplace>
+ inline void little_to_native_inplace(EndianReversibleInplace& x) BOOST_NOEXCEPT;
+ // Effects: none if native byte-order is little, otherwise endian_reverse_inplace(x);
+ template <class EndianReversibleInplace>
+ inline void native_to_little_inplace(EndianReversibleInplace& x) BOOST_NOEXCEPT;
+ // Effects: none if native byte-order is little, otherwise endian_reverse_inplace(x);
+
+ // generic conditional reverse in place
+ template <BOOST_SCOPED_ENUM(order) From, BOOST_SCOPED_ENUM(order) To,
+ class EndianReversibleInplace>
+ inline void conditional_reverse_inplace(EndianReversibleInplace& x) BOOST_NOEXCEPT;
+
+ // runtime reverse in place
+ template <class EndianReversibleInplace>
+ inline void conditional_reverse_inplace(EndianReversibleInplace& x,
+ BOOST_SCOPED_ENUM(order) from_order, BOOST_SCOPED_ENUM(order) to_order)
+ BOOST_NOEXCEPT;
+
+//----------------------------------- end synopsis -------------------------------------//
+
+ namespace detail
+ {
+ // generic reverse function template implementation approach using std::reverse
+ // suggested by Mathias Gaunard. Primary motivation for inclusion is to have an
+ // independent implementation to test against.
+
+ template <class T>
+ inline T std_endian_reverse(T x) BOOST_NOEXCEPT
+ {
+ T tmp(x);
+ std::reverse(
+ reinterpret_cast<unsigned char*>(&tmp),
+ reinterpret_cast<unsigned char*>(&tmp) + sizeof(T));
+ return tmp;
+ }
+
+ // conditional unaligned reverse copy, patterned after std::reverse_copy
+ template <class T>
+ inline void big_reverse_copy(T from, char* to) BOOST_NOEXCEPT;
+ template <class T>
+ inline void big_reverse_copy(const char* from, T& to) BOOST_NOEXCEPT;
+ template <class T>
+ inline void little_reverse_copy(T from, char* to) BOOST_NOEXCEPT;
+ template <class T>
+ inline void little_reverse_copy(const char* from, T& to) BOOST_NOEXCEPT;
+ } // namespace detail
+
+//--------------------------------------------------------------------------------------//
+// //
+// return-by-value implementation //
+// //
+// -- portable approach suggested by tymofey, with avoidance of undefined behavior //
+// as suggested by Giovanni Piero Deretta, with a further refinement suggested //
+// by Pyry Jahkola. //
+// -- intrinsic approach suggested by reviewers, and by David Stone, who provided //
+// his Boost licensed macro implementation (detail/intrinsic.hpp) //
+// //
+//--------------------------------------------------------------------------------------//
+
+ inline int8_t endian_reverse(int8_t x) BOOST_NOEXCEPT
+ {
+ return x;
+ }
+
+ inline int16_t endian_reverse(int16_t x) BOOST_NOEXCEPT
+ {
+# ifdef BOOST_ENDIAN_NO_INTRINSICS
+ return (static_cast<uint16_t>(x) << 8)
+ | (static_cast<uint16_t>(x) >> 8);
+# else
+ return BOOST_ENDIAN_INTRINSIC_BYTE_SWAP_2(static_cast<uint16_t>(x));
+# endif
+ }
+
+ inline int32_t endian_reverse(int32_t x) BOOST_NOEXCEPT
+ {
+# ifdef BOOST_ENDIAN_NO_INTRINSICS
+ uint32_t step16;
+ step16 = static_cast<uint32_t>(x) << 16 | static_cast<uint32_t>(x) >> 16;
+ return
+ ((static_cast<uint32_t>(step16) << 8) & 0xff00ff00)
+ | ((static_cast<uint32_t>(step16) >> 8) & 0x00ff00ff);
+# else
+ return BOOST_ENDIAN_INTRINSIC_BYTE_SWAP_4(static_cast<uint32_t>(x));
+# endif
+ }
+
+ inline int64_t endian_reverse(int64_t x) BOOST_NOEXCEPT
+ {
+# ifdef BOOST_ENDIAN_NO_INTRINSICS
+ uint64_t step32, step16;
+ step32 = static_cast<uint64_t>(x) << 32 | static_cast<uint64_t>(x) >> 32;
+ step16 = (step32 & 0x0000FFFF0000FFFFULL) << 16
+ | (step32 & 0xFFFF0000FFFF0000ULL) >> 16;
+ return static_cast<int64_t>((step16 & 0x00FF00FF00FF00FFULL) << 8
+ | (step16 & 0xFF00FF00FF00FF00ULL) >> 8);
+# else
+ return BOOST_ENDIAN_INTRINSIC_BYTE_SWAP_8(static_cast<uint64_t>(x));
+# endif
+ }
+
+ inline uint8_t endian_reverse(uint8_t x) BOOST_NOEXCEPT
+ {
+ return x;
+ }
+
+ inline uint16_t endian_reverse(uint16_t x) BOOST_NOEXCEPT
+ {
+# ifdef BOOST_ENDIAN_NO_INTRINSICS
+ return (x << 8)
+ | (x >> 8);
+# else
+ return BOOST_ENDIAN_INTRINSIC_BYTE_SWAP_2(x);
+# endif
+ }
+
+ inline uint32_t endian_reverse(uint32_t x) BOOST_NOEXCEPT
+ {
+# ifdef BOOST_ENDIAN_NO_INTRINSICS
+ uint32_t step16;
+ step16 = x << 16 | x >> 16;
+ return
+ ((step16 << 8) & 0xff00ff00)
+ | ((step16 >> 8) & 0x00ff00ff);
+# else
+ return BOOST_ENDIAN_INTRINSIC_BYTE_SWAP_4(x);
+# endif
+ }
+
+ inline uint64_t endian_reverse(uint64_t x) BOOST_NOEXCEPT
+ {
+# ifdef BOOST_ENDIAN_NO_INTRINSICS
+ uint64_t step32, step16;
+ step32 = x << 32 | x >> 32;
+ step16 = (step32 & 0x0000FFFF0000FFFFULL) << 16
+ | (step32 & 0xFFFF0000FFFF0000ULL) >> 16;
+ return (step16 & 0x00FF00FF00FF00FFULL) << 8
+ | (step16 & 0xFF00FF00FF00FF00ULL) >> 8;
+# else
+ return BOOST_ENDIAN_INTRINSIC_BYTE_SWAP_8(x);
+# endif
+ }
+
+ template <class EndianReversible >
+ inline EndianReversible big_to_native(EndianReversible x) BOOST_NOEXCEPT
+ {
+# ifdef BOOST_BIG_ENDIAN
+ return x;
+# else
+ return endian_reverse(x);
+# endif
+ }
+
+ template <class EndianReversible >
+ inline EndianReversible native_to_big(EndianReversible x) BOOST_NOEXCEPT
+ {
+# ifdef BOOST_BIG_ENDIAN
+ return x;
+# else
+ return endian_reverse(x);
+# endif
+ }
+
+ template <class EndianReversible >
+ inline EndianReversible little_to_native(EndianReversible x) BOOST_NOEXCEPT
+ {
+# ifdef BOOST_LITTLE_ENDIAN
+ return x;
+# else
+ return endian_reverse(x);
+# endif
+ }
+
+ template <class EndianReversible >
+ inline EndianReversible native_to_little(EndianReversible x) BOOST_NOEXCEPT
+ {
+# ifdef BOOST_LITTLE_ENDIAN
+ return x;
+# else
+ return endian_reverse(x);
+# endif
+ }
+
+ namespace detail
+ {
+ // Primary template and specializations to support endian_reverse().
+ // See rationale in endian_reverse() below.
+ template <BOOST_SCOPED_ENUM(order) From, BOOST_SCOPED_ENUM(order) To,
+ class EndianReversible>
+ class value_converter ; // primary template
+ template <class T> class value_converter <order::big, order::big, T>
+ {public: T operator()(T x) BOOST_NOEXCEPT {return x;}};
+ template <class T> class value_converter <order::little, order::little, T>
+ {public: T operator()(T x) BOOST_NOEXCEPT {return x;}};
+ template <class T> class value_converter <order::big, order::little, T>
+ {public: T operator()(T x) BOOST_NOEXCEPT {return endian_reverse(x);}};
+ template <class T> class value_converter <order::little, order::big, T>
+ {public: T operator()(T x) BOOST_NOEXCEPT {return endian_reverse(x);}};
+ }
+
+ // generic conditional reverse
+ template <BOOST_SCOPED_ENUM(order) From, BOOST_SCOPED_ENUM(order) To,
+ class EndianReversible>
+ inline EndianReversible conditional_reverse(EndianReversible from) BOOST_NOEXCEPT {
+ // work around lack of function template partial specialization by instantiating
+ // a function object of a class that is partially specialized on the two order
+ // template parameters, and then calling its operator().
+ detail::value_converter <From, To, EndianReversible> tmp;
+ return tmp(from);
+ }
+
+ // runtime conditional reverse
+ template <class EndianReversible >
+ inline EndianReversible conditional_reverse(EndianReversible from,
+ BOOST_SCOPED_ENUM(order) from_order, BOOST_SCOPED_ENUM(order) to_order) BOOST_NOEXCEPT
+ {
+ return from_order == to_order ? from : endian_reverse(from);
+ }
+
+//--------------------------------------------------------------------------------------//
+// reverse-in-place implementation //
+//--------------------------------------------------------------------------------------//
+
+ // reverse in place
+ template <class EndianReversible>
+ inline void endian_reverse_inplace(EndianReversible& x) BOOST_NOEXCEPT
+ {
+ x = endian_reverse(x);
+ }
+
+ template <class EndianReversibleInplace>
+# ifdef BOOST_BIG_ENDIAN
+ inline void big_to_native_inplace(EndianReversibleInplace&) BOOST_NOEXCEPT {}
+# else
+ inline void big_to_native_inplace(EndianReversibleInplace& x) BOOST_NOEXCEPT
+ { endian_reverse_inplace(x); }
+# endif
+ template <class EndianReversibleInplace>
+# ifdef BOOST_BIG_ENDIAN
+ inline void native_to_big_inplace(EndianReversibleInplace&) BOOST_NOEXCEPT {}
+# else
+ inline void native_to_big_inplace(EndianReversibleInplace& x) BOOST_NOEXCEPT
+ {
+ endian_reverse_inplace(x);
+ }
+# endif
+
+ template <class EndianReversibleInplace>
+# ifdef BOOST_LITTLE_ENDIAN
+ inline void little_to_native_inplace(EndianReversibleInplace&) BOOST_NOEXCEPT {}
+# else
+ inline void little_to_native_inplace(EndianReversibleInplace& x) BOOST_NOEXCEPT
+ { endian_reverse_inplace(x); }
+# endif
+ template <class EndianReversibleInplace>
+# ifdef BOOST_LITTLE_ENDIAN
+ inline void native_to_little_inplace(EndianReversibleInplace&) BOOST_NOEXCEPT {}
+# else
+ inline void native_to_little_inplace(EndianReversibleInplace& x) BOOST_NOEXCEPT
+ {
+ endian_reverse_inplace(x);
+ }
+# endif
+
+ namespace detail
+ {
+ // Primary template and specializations support generic
+ // endian_reverse_inplace().
+ // See rationale in endian_reverse_inplace() below.
+ template <BOOST_SCOPED_ENUM(order) From, BOOST_SCOPED_ENUM(order) To,
+ class EndianReversibleInplace>
+ class converter; // primary template
+ template <class T> class converter<order::big, order::big, T>
+ {public: void operator()(T&) BOOST_NOEXCEPT {/*no effect*/}};
+ template <class T> class converter<order::little, order::little, T>
+ {public: void operator()(T&) BOOST_NOEXCEPT {/*no effect*/}};
+ template <class T> class converter<order::big, order::little, T>
+ {public: void operator()(T& x) BOOST_NOEXCEPT { endian_reverse_inplace(x); }};
+ template <class T> class converter<order::little, order::big, T>
+ {public: void operator()(T& x) BOOST_NOEXCEPT { endian_reverse_inplace(x); }};
+ } // namespace detail
+
+ // generic conditional reverse in place
+ template <BOOST_SCOPED_ENUM(order) From, BOOST_SCOPED_ENUM(order) To,
+ class EndianReversibleInplace>
+ inline void conditional_reverse_inplace(EndianReversibleInplace& x) BOOST_NOEXCEPT
+ {
+ // work around lack of function template partial specialization by instantiating
+ // a function object of a class that is partially specialized on the two order
+ // template parameters, and then calling its operator().
+ detail::converter<From, To, EndianReversibleInplace> tmp;
+ tmp(x); // call operator ()
+ }
+
+ // runtime reverse in place
+ template <class EndianReversibleInplace>
+ inline void conditional_reverse_inplace(EndianReversibleInplace& x,
+ BOOST_SCOPED_ENUM(order) from_order, BOOST_SCOPED_ENUM(order) to_order)
+ BOOST_NOEXCEPT
+ {
+ if (from_order != to_order)
+ endian_reverse_inplace(x);
+ }
+
+
+ namespace detail
+ {
+ template <class T>
+ inline void big_reverse_copy(T from, char* to) BOOST_NOEXCEPT
+ {
+# ifdef BOOST_BIG_ENDIAN
+ std::memcpy(to, reinterpret_cast<const char*>(&from), sizeof(T));
+# else
+ std::reverse_copy(reinterpret_cast<const char*>(&from),
+ reinterpret_cast<const char*>(&from) + sizeof(T), to);
+# endif
+ }
+ template <class T>
+ inline void big_reverse_copy(const char* from, T& to) BOOST_NOEXCEPT
+ {
+# ifdef BOOST_BIG_ENDIAN
+ std::memcpy(reinterpret_cast<char*>(&to), from, sizeof(T));
+# else
+ std::reverse_copy(from, from + sizeof(T), reinterpret_cast<char*>(&to));
+# endif
+ }
+ template <class T>
+ inline void little_reverse_copy(T from, char* to) BOOST_NOEXCEPT
+ {
+# ifdef BOOST_LITTLE_ENDIAN
+ std::memcpy(to, reinterpret_cast<const char*>(&from), sizeof(T));
+# else
+ std::reverse_copy(reinterpret_cast<const char*>(&from),
+ reinterpret_cast<const char*>(&from) + sizeof(T), to);
+# endif
+ }
+ template <class T>
+ inline void little_reverse_copy(const char* from, T& to) BOOST_NOEXCEPT
+ {
+# ifdef BOOST_LITTLE_ENDIAN
+ std::memcpy(reinterpret_cast<char*>(&to), from, sizeof(T));
+# else
+ std::reverse_copy(from, from + sizeof(T), reinterpret_cast<char*>(&to));
+# endif
+ }
+ } // namespace detail
+} // namespace endian
+} // namespace boost
+
+#endif // BOOST_ENDIAN_CONVERSION_HPP
diff --git a/cv_bridge/src/boost/endian/detail/intrinsic.hpp b/cv_bridge/src/boost/endian/detail/intrinsic.hpp
new file mode 100644
index 0000000..6ead681
--- /dev/null
+++ b/cv_bridge/src/boost/endian/detail/intrinsic.hpp
@@ -0,0 +1,64 @@
+// endian/detail/intrinsic.hpp -------------------------------------------------------//
+
+// Copyright (C) 2012 David Stone
+// Copyright Beman Dawes 2013
+
+// Distributed under the Boost Software License, Version 1.0.
+// http://www.boost.org/LICENSE_1_0.txt
+
+#ifndef BOOST_ENDIAN_INTRINSIC_HPP
+#define BOOST_ENDIAN_INTRINSIC_HPP
+
+// Allow user to force BOOST_ENDIAN_NO_INTRINSICS in case they aren't available for a
+// particular platform/compiler combination. Please report such platform/compiler
+// combinations to the Boost mailing list.
+#ifndef BOOST_ENDIAN_NO_INTRINSICS
+
+#ifndef __has_builtin // Optional of course
+ #define __has_builtin(x) 0 // Compatibility with non-clang compilers
+#endif
+
+// GCC and Clang recent versions provide intrinsic byte swaps via builtins
+#if (defined(__clang__) && __has_builtin(__builtin_bswap32) && __has_builtin(__builtin_bswap64)) \
+ || (defined(__GNUC__ ) && \
+ (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)))
+# define BOOST_ENDIAN_INTRINSIC_MSG "__builtin_bswap16, etc."
+// prior to 4.8, gcc did not provide __builtin_bswap16 on some platforms so we emulate it
+// see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52624
+// Clang has a similar problem, but their feature test macros make it easier to detect
+# if (defined(__clang__) && __has_builtin(__builtin_bswap16)) \
+ || (defined(__GNUC__) &&(__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)))
+# define BOOST_ENDIAN_INTRINSIC_BYTE_SWAP_2(x) __builtin_bswap16(x)
+# else
+# define BOOST_ENDIAN_INTRINSIC_BYTE_SWAP_2(x) __builtin_bswap32((x) << 16)
+# endif
+# define BOOST_ENDIAN_INTRINSIC_BYTE_SWAP_4(x) __builtin_bswap32(x)
+# define BOOST_ENDIAN_INTRINSIC_BYTE_SWAP_8(x) __builtin_bswap64(x)
+
+// Linux systems provide the byteswap.h header, with
+#elif defined(__linux__)
+// don't check for obsolete forms defined(linux) and defined(__linux) on the theory that
+// compilers that predefine only these are so old that byteswap.h probably isn't present.
+# define BOOST_ENDIAN_INTRINSIC_MSG "byteswap.h bswap_16, etc."
+# include <byteswap.h>
+# define BOOST_ENDIAN_INTRINSIC_BYTE_SWAP_2(x) bswap_16(x)
+# define BOOST_ENDIAN_INTRINSIC_BYTE_SWAP_4(x) bswap_32(x)
+# define BOOST_ENDIAN_INTRINSIC_BYTE_SWAP_8(x) bswap_64(x)
+
+#elif defined(_MSC_VER)
+// Microsoft documents these as being compatible since Windows 95 and specificly
+// lists runtime library support since Visual Studio 2003 (aka 7.1).
+# define BOOST_ENDIAN_INTRINSIC_MSG "cstdlib _byteswap_ushort, etc."
+# include <cstdlib>
+# define BOOST_ENDIAN_INTRINSIC_BYTE_SWAP_2(x) _byteswap_ushort(x)
+# define BOOST_ENDIAN_INTRINSIC_BYTE_SWAP_4(x) _byteswap_ulong(x)
+# define BOOST_ENDIAN_INTRINSIC_BYTE_SWAP_8(x) _byteswap_uint64(x)
+#else
+# define BOOST_ENDIAN_NO_INTRINSICS
+# define BOOST_ENDIAN_INTRINSIC_MSG "no byte swap intrinsics"
+#endif
+
+#elif !defined(BOOST_ENDIAN_INTRINSIC_MSG)
+# define BOOST_ENDIAN_INTRINSIC_MSG "no byte swap intrinsics"
+#endif // BOOST_ENDIAN_NO_INTRINSICS
+#endif // BOOST_ENDIAN_INTRINSIC_HPP
diff --git a/cv_bridge/src/boost/predef/detail/_cassert.h b/cv_bridge/src/boost/predef/detail/_cassert.h
new file mode 100644
index 0000000..940e944
--- /dev/null
+++ b/cv_bridge/src/boost/predef/detail/_cassert.h
@@ -0,0 +1,17 @@
+/*
+Copyright Rene Rivera 2011-2012
+Distributed under the Boost Software License, Version 1.0.
+(See accompanying file LICENSE_1_0.txt or copy at
+http://www.boost.org/LICENSE_1_0.txt)
+*/
+
+#ifndef BOOST_PREDEF_DETAIL__CASSERT_H
+#define BOOST_PREDEF_DETAIL__CASSERT_H
+
+#if defined(__cplusplus)
+#include <cassert>
+#else
+#include <assert.h>
+#endif
+
+#endif
diff --git a/cv_bridge/src/boost/predef/detail/endian_compat.h b/cv_bridge/src/boost/predef/detail/endian_compat.h
new file mode 100644
index 0000000..7725e68
--- /dev/null
+++ b/cv_bridge/src/boost/predef/detail/endian_compat.h
@@ -0,0 +1,26 @@
+/*
+Copyright Rene Rivera 2013
+Distributed under the Boost Software License, Version 1.0.
+(See accompanying file LICENSE_1_0.txt or copy at
+http://www.boost.org/LICENSE_1_0.txt)
+*/
+
+#ifndef BOOST_PREDEF_DETAIL_ENDIAN_COMPAT_H
+#define BOOST_PREDEF_DETAIL_ENDIAN_COMPAT_H
+
+#include <boost/predef/other/endian.h>
+
+#if BOOST_ENDIAN_BIG_BYTE
+# define BOOST_BIG_ENDIAN
+# define BOOST_BYTE_ORDER 4321
+#endif
+#if BOOST_ENDIAN_LITTLE_BYTE
+# define BOOST_LITTLE_ENDIAN
+# define BOOST_BYTE_ORDER 1234
+#endif
+#if BOOST_ENDIAN_LITTLE_WORD
+# define BOOST_PDP_ENDIAN
+# define BOOST_BYTE_ORDER 2134
+#endif
+
+#endif
diff --git a/cv_bridge/src/boost/predef/detail/test.h b/cv_bridge/src/boost/predef/detail/test.h
new file mode 100644
index 0000000..546a9e4
--- /dev/null
+++ b/cv_bridge/src/boost/predef/detail/test.h
@@ -0,0 +1,17 @@
+/*
+Copyright Rene Rivera 2011-2012
+Distributed under the Boost Software License, Version 1.0.
+(See accompanying file LICENSE_1_0.txt or copy at
+http://www.boost.org/LICENSE_1_0.txt)
+*/
+
+#ifndef BOOST_PREDEF_DETAIL_TEST_H
+#define BOOST_PREDEF_DETAIL_TEST_H
+
+#if !defined(BOOST_PREDEF_INTERNAL_GENERATE_TESTS)
+
+#define BOOST_PREDEF_DECLARE_TEST(x,s)
+
+#endif
+
+#endif
diff --git a/cv_bridge/src/boost/predef/library/c/_prefix.h b/cv_bridge/src/boost/predef/library/c/_prefix.h
new file mode 100644
index 0000000..12bcb0f
--- /dev/null
+++ b/cv_bridge/src/boost/predef/library/c/_prefix.h
@@ -0,0 +1,13 @@
+/*
+Copyright Rene Rivera 2008-2013
+Distributed under the Boost Software License, Version 1.0.
+(See accompanying file LICENSE_1_0.txt or copy at
+http://www.boost.org/LICENSE_1_0.txt)
+*/
+
+#ifndef BOOST_PREDEF_LIBRARY_C__PREFIX_H
+#define BOOST_PREDEF_LIBRARY_C__PREFIX_H
+
+#include <boost/predef/detail/_cassert.h>
+
+#endif
diff --git a/cv_bridge/src/boost/predef/library/c/gnu.h b/cv_bridge/src/boost/predef/library/c/gnu.h
new file mode 100644
index 0000000..9e4ca89
--- /dev/null
+++ b/cv_bridge/src/boost/predef/library/c/gnu.h
@@ -0,0 +1,61 @@
+/*
+Copyright Rene Rivera 2008-2015
+Distributed under the Boost Software License, Version 1.0.
+(See accompanying file LICENSE_1_0.txt or copy at
+http://www.boost.org/LICENSE_1_0.txt)
+*/
+
+#ifndef BOOST_PREDEF_LIBRARY_C_GNU_H
+#define BOOST_PREDEF_LIBRARY_C_GNU_H
+
+#include <boost/predef/version_number.h>
+#include <boost/predef/make.h>
+
+#include <boost/predef/library/c/_prefix.h>
+
+#if defined(__STDC__)
+#include <stddef.h>
+#elif defined(__cplusplus)
+#include <cstddef>
+#endif
+
+/*`
+[heading `BOOST_LIB_C_GNU`]
+
+[@http://en.wikipedia.org/wiki/Glibc GNU glibc] Standard C library.
+Version number available as major, and minor.
+
+[table
+ [[__predef_symbol__] [__predef_version__]]
+
+ [[`__GLIBC__`] [__predef_detection__]]
+ [[`__GNU_LIBRARY__`] [__predef_detection__]]
+
+ [[`__GLIBC__`, `__GLIBC_MINOR__`] [V.R.0]]
+ [[`__GNU_LIBRARY__`, `__GNU_LIBRARY_MINOR__`] [V.R.0]]
+ ]
+ */
+
+#define BOOST_LIB_C_GNU BOOST_VERSION_NUMBER_NOT_AVAILABLE
+
+#if defined(__GLIBC__) || defined(__GNU_LIBRARY__)
+# undef BOOST_LIB_C_GNU
+# if defined(__GLIBC__)
+# define BOOST_LIB_C_GNU \
+ BOOST_VERSION_NUMBER(__GLIBC__,__GLIBC_MINOR__,0)
+# else
+# define BOOST_LIB_C_GNU \
+ BOOST_VERSION_NUMBER(__GNU_LIBRARY__,__GNU_LIBRARY_MINOR__,0)
+# endif
+#endif
+
+#if BOOST_LIB_C_GNU
+# define BOOST_LIB_C_GNU_AVAILABLE
+#endif
+
+#define BOOST_LIB_C_GNU_NAME "GNU"
+
+#endif
+
+#include <boost/predef/detail/test.h>
+BOOST_PREDEF_DECLARE_TEST(BOOST_LIB_C_GNU,BOOST_LIB_C_GNU_NAME)
diff --git a/cv_bridge/src/boost/predef/make.h b/cv_bridge/src/boost/predef/make.h
new file mode 100644
index 0000000..4f2f9ee
--- /dev/null
+++ b/cv_bridge/src/boost/predef/make.h
@@ -0,0 +1,89 @@
+/*
+Copyright Rene Rivera 2008-2015
+Distributed under the Boost Software License, Version 1.0.
+(See accompanying file LICENSE_1_0.txt or copy at
+http://www.boost.org/LICENSE_1_0.txt)
+*/
+#include <boost/predef/detail/test.h>
+
+#ifndef BOOST_PREDEF_MAKE_H
+#define BOOST_PREDEF_MAKE_H
+
+/*
+Shorthands for the common version number formats used by vendors...
+*/
+
+/*`
+[heading `BOOST_PREDEF_MAKE_..` macros]
+
+These set of macros decompose common vendor version number
+macros which are composed version, revision, and patch digits.
+The naming convention indicates:
+
+* The base of the specified version number. "`BOOST_PREDEF_MAKE_0X`" for
+ hexadecimal digits, and "`BOOST_PREDEF_MAKE_10`" for decimal digits.
+* The format of the vendor version number. Where "`V`" indicates the version digits,
+ "`R`" indicates the revision digits, "`P`" indicates the patch digits, and "`0`"
+ indicates an ignored digit.
+
+Macros are:
+*/
+/*` `BOOST_PREDEF_MAKE_0X_VRP(V)` */
+#define BOOST_PREDEF_MAKE_0X_VRP(V) BOOST_VERSION_NUMBER((V&0xF00)>>8,(V&0xF0)>>4,(V&0xF))
+/*` `BOOST_PREDEF_MAKE_0X_VVRP(V)` */
+#define BOOST_PREDEF_MAKE_0X_VVRP(V) BOOST_VERSION_NUMBER((V&0xFF00)>>8,(V&0xF0)>>4,(V&0xF))
+/*` `BOOST_PREDEF_MAKE_0X_VRPP(V)` */
+#define BOOST_PREDEF_MAKE_0X_VRPP(V) BOOST_VERSION_NUMBER((V&0xF000)>>12,(V&0xF00)>>8,(V&0xFF))
+/*` `BOOST_PREDEF_MAKE_0X_VVRR(V)` */
+#define BOOST_PREDEF_MAKE_0X_VVRR(V) BOOST_VERSION_NUMBER((V&0xFF00)>>8,(V&0xFF),0)
+/*` `BOOST_PREDEF_MAKE_0X_VRRPPPP(V)` */
+#define BOOST_PREDEF_MAKE_0X_VRRPPPP(V) BOOST_VERSION_NUMBER((V&0xF000000)>>24,(V&0xFF0000)>>16,(V&0xFFFF))
+/*` `BOOST_PREDEF_MAKE_0X_VVRRP(V)` */
+#define BOOST_PREDEF_MAKE_0X_VVRRP(V) BOOST_VERSION_NUMBER((V&0xFF000)>>12,(V&0xFF0)>>4,(V&0xF))
+/*` `BOOST_PREDEF_MAKE_0X_VRRPP000(V)` */
+#define BOOST_PREDEF_MAKE_0X_VRRPP000(V) BOOST_VERSION_NUMBER((V&0xF0000000)>>28,(V&0xFF00000)>>20,(V&0xFF000)>>12)
+/*` `BOOST_PREDEF_MAKE_0X_VVRRPP(V)` */
+#define BOOST_PREDEF_MAKE_0X_VVRRPP(V) BOOST_VERSION_NUMBER((V&0xFF0000)>>16,(V&0xFF00)>>8,(V&0xFF))
+/*` `BOOST_PREDEF_MAKE_10_VPPP(V)` */
+#define BOOST_PREDEF_MAKE_10_VPPP(V) BOOST_VERSION_NUMBER(((V)/1000)%10,0,(V)%1000)
+/*` `BOOST_PREDEF_MAKE_10_VRP(V)` */
+#define BOOST_PREDEF_MAKE_10_VRP(V) BOOST_VERSION_NUMBER(((V)/100)%10,((V)/10)%10,(V)%10)
+/*` `BOOST_PREDEF_MAKE_10_VRP000(V)` */
+#define BOOST_PREDEF_MAKE_10_VRP000(V) BOOST_VERSION_NUMBER(((V)/100000)%10,((V)/10000)%10,((V)/1000)%10)
+/*` `BOOST_PREDEF_MAKE_10_VRPP(V)` */
+#define BOOST_PREDEF_MAKE_10_VRPP(V) BOOST_VERSION_NUMBER(((V)/1000)%10,((V)/100)%10,(V)%100)
+/*` `BOOST_PREDEF_MAKE_10_VRR(V)` */
+#define BOOST_PREDEF_MAKE_10_VRR(V) BOOST_VERSION_NUMBER(((V)/100)%10,(V)%100,0)
+/*` `BOOST_PREDEF_MAKE_10_VRRPP(V)` */
+#define BOOST_PREDEF_MAKE_10_VRRPP(V) BOOST_VERSION_NUMBER(((V)/10000)%10,((V)/100)%100,(V)%100)
+/*` `BOOST_PREDEF_MAKE_10_VRR000(V)` */
+#define BOOST_PREDEF_MAKE_10_VRR000(V) BOOST_VERSION_NUMBER(((V)/100000)%10,((V)/1000)%100,0)
+/*` `BOOST_PREDEF_MAKE_10_VV00(V)` */
+#define BOOST_PREDEF_MAKE_10_VV00(V) BOOST_VERSION_NUMBER(((V)/100)%100,0,0)
+/*` `BOOST_PREDEF_MAKE_10_VVRR(V)` */
+#define BOOST_PREDEF_MAKE_10_VVRR(V) BOOST_VERSION_NUMBER(((V)/100)%100,(V)%100,0)
+/*` `BOOST_PREDEF_MAKE_10_VVRRPP(V)` */
+#define BOOST_PREDEF_MAKE_10_VVRRPP(V) BOOST_VERSION_NUMBER(((V)/10000)%100,((V)/100)%100,(V)%100)
+/*` `BOOST_PREDEF_MAKE_10_VVRR0PP00(V)` */
+#define BOOST_PREDEF_MAKE_10_VVRR0PP00(V) BOOST_VERSION_NUMBER(((V)/10000000)%100,((V)/100000)%100,((V)/100)%100)
+/*` `BOOST_PREDEF_MAKE_10_VVRR0PPPP(V)` */
+#define BOOST_PREDEF_MAKE_10_VVRR0PPPP(V) BOOST_VERSION_NUMBER(((V)/10000000)%100,((V)/100000)%100,(V)%10000)
+/*` `BOOST_PREDEF_MAKE_10_VVRR00PP00(V)` */
+#define BOOST_PREDEF_MAKE_10_VVRR00PP00(V) BOOST_VERSION_NUMBER(((V)/100000000)%100,((V)/1000000)%100,((V)/100)%100)
+/*`
+[heading `BOOST_PREDEF_MAKE_*..` date macros]
+
+Date decomposition macros return a date in the relative to the 1970
+Epoch date. If the month is not available, January 1st is used as the month and day.
+If the day is not available, but the month is, the 1st of the month is used as the day.
+*/
+/*` `BOOST_PREDEF_MAKE_DATE(Y,M,D)` */
+#define BOOST_PREDEF_MAKE_DATE(Y,M,D) BOOST_VERSION_NUMBER((Y)%10000-1970,(M)%100,(D)%100)
+/*` `BOOST_PREDEF_MAKE_YYYYMMDD(V)` */
+#define BOOST_PREDEF_MAKE_YYYYMMDD(V) BOOST_PREDEF_MAKE_DATE(((V)/10000)%10000,((V)/100)%100,(V)%100)
+/*` `BOOST_PREDEF_MAKE_YYYY(V)` */
+#define BOOST_PREDEF_MAKE_YYYY(V) BOOST_PREDEF_MAKE_DATE(V,1,1)
+/*` `BOOST_PREDEF_MAKE_YYYYMM(V)` */
+#define BOOST_PREDEF_MAKE_YYYYMM(V) BOOST_PREDEF_MAKE_DATE((V)/100,(V)%100,1)
+
+#endif
diff --git a/cv_bridge/src/boost/predef/os/android.h b/cv_bridge/src/boost/predef/os/android.h
new file mode 100644
index 0000000..00836e7
--- /dev/null
+++ b/cv_bridge/src/boost/predef/os/android.h
@@ -0,0 +1,45 @@
+/*
+Copyright Rene Rivera 2015
+Distributed under the Boost Software License, Version 1.0.
+(See accompanying file LICENSE_1_0.txt or copy at
+http://www.boost.org/LICENSE_1_0.txt)
+*/
+
+#ifndef BOOST_PREDEF_OS_ADROID_H
+#define BOOST_PREDEF_OS_ADROID_H
+
+#include <boost/predef/version_number.h>
+#include <boost/predef/make.h>
+
+/*`
+[heading `BOOST_OS_ANDROID`]
+
+[@http://en.wikipedia.org/wiki/Android_%28operating_system%29 Android] operating system.
+
+[table
+ [[__predef_symbol__] [__predef_version__]]
+
+ [[`__ANDROID__`] [__predef_detection__]]
+ ]
+ */
+
+#define BOOST_OS_ANDROID BOOST_VERSION_NUMBER_NOT_AVAILABLE
+
+#if !defined(BOOST_PREDEF_DETAIL_OS_DETECTED) && ( \
+ defined(__ANDROID__) \
+ )
+# undef BOOST_OS_ANDROID
+# define BOOST_OS_ANDROID BOOST_VERSION_NUMBER_AVAILABLE
+#endif
+
+#if BOOST_OS_ANDROID
+# define BOOST_OS_ANDROID_AVAILABLE
+# include <boost/predef/detail/os_detected.h>
+#endif
+
+#define BOOST_OS_ANDROID_NAME "Android"
+
+#endif
+
+#include <boost/predef/detail/test.h>
+BOOST_PREDEF_DECLARE_TEST(BOOST_OS_ANDROID,BOOST_OS_ANDROID_NAME)
diff --git a/cv_bridge/src/boost/predef/os/bsd.h b/cv_bridge/src/boost/predef/os/bsd.h
new file mode 100644
index 0000000..fad9aed
--- /dev/null
+++ b/cv_bridge/src/boost/predef/os/bsd.h
@@ -0,0 +1,103 @@
+/*
+Copyright Rene Rivera 2008-2015
+Distributed under the Boost Software License, Version 1.0.
+(See accompanying file LICENSE_1_0.txt or copy at
+http://www.boost.org/LICENSE_1_0.txt)
+*/
+
+#ifndef BOOST_PREDEF_OS_BSD_H
+#define BOOST_PREDEF_OS_BSD_H
+
+/* Special case: OSX will define BSD predefs if the sys/param.h
+ * header is included. We can guard against that, but only if we
+ * detect OSX first. Hence we will force include OSX detection
+ * before doing any BSD detection.
+ */
+#include <boost/predef/os/macos.h>
+
+#include <boost/predef/version_number.h>
+#include <boost/predef/make.h>
+
+/*`
+[heading `BOOST_OS_BSD`]
+
+[@http://en.wikipedia.org/wiki/Berkeley_Software_Distribution BSD] operating system.
+
+BSD has various branch operating systems possible and each detected
+individually. This detects the following variations and sets a specific
+version number macro to match:
+
+* `BOOST_OS_BSD_DRAGONFLY` [@http://en.wikipedia.org/wiki/DragonFly_BSD DragonFly BSD]
+* `BOOST_OS_BSD_FREE` [@http://en.wikipedia.org/wiki/Freebsd FreeBSD]
+* `BOOST_OS_BSD_BSDI` [@http://en.wikipedia.org/wiki/BSD/OS BSDi BSD/OS]
+* `BOOST_OS_BSD_NET` [@http://en.wikipedia.org/wiki/Netbsd NetBSD]
+* `BOOST_OS_BSD_OPEN` [@http://en.wikipedia.org/wiki/Openbsd OpenBSD]
+
+[note The general `BOOST_OS_BSD` is set in all cases to indicate some form
+of BSD. If the above variants is detected the corresponding macro is also set.]
+
+[table
+ [[__predef_symbol__] [__predef_version__]]
+
+ [[`BSD`] [__predef_detection__]]
+ [[`_SYSTYPE_BSD`] [__predef_detection__]]
+
+ [[`BSD4_2`] [4.2.0]]
+ [[`BSD4_3`] [4.3.0]]
+ [[`BSD4_4`] [4.4.0]]
+ [[`BSD`] [V.R.0]]
+ ]
+ */
+
+#include <boost/predef/os/bsd/bsdi.h>
+#include <boost/predef/os/bsd/dragonfly.h>
+#include <boost/predef/os/bsd/free.h>
+#include <boost/predef/os/bsd/open.h>
+#include <boost/predef/os/bsd/net.h>
+
+#ifndef BOOST_OS_BSD
+#define BOOST_OS_BSD BOOST_VERSION_NUMBER_NOT_AVAILABLE
+#endif
+
+#if !defined(BOOST_PREDEF_DETAIL_OS_DETECTED) && ( \
+ defined(BSD) || \
+ defined(_SYSTYPE_BSD) \
+ )
+# undef BOOST_OS_BSD
+# include <sys/param.h>
+# if !defined(BOOST_OS_BSD) && defined(BSD4_4)
+# define BOOST_OS_BSD BOOST_VERSION_NUMBER(4,4,0)
+# endif
+# if !defined(BOOST_OS_BSD) && defined(BSD4_3)
+# define BOOST_OS_BSD BOOST_VERSION_NUMBER(4,3,0)
+# endif
+# if !defined(BOOST_OS_BSD) && defined(BSD4_2)
+# define BOOST_OS_BSD BOOST_VERSION_NUMBER(4,2,0)
+# endif
+# if !defined(BOOST_OS_BSD) && defined(BSD)
+# define BOOST_OS_BSD BOOST_PREDEF_MAKE_10_VVRR(BSD)
+# endif
+# if !defined(BOOST_OS_BSD)
+# define BOOST_OS_BSD BOOST_VERSION_NUMBER_AVAILABLE
+# endif
+#endif
+
+#if BOOST_OS_BSD
+# define BOOST_OS_BSD_AVAILABLE
+# include <boost/predef/detail/os_detected.h>
+#endif
+
+#define BOOST_OS_BSD_NAME "BSD"
+
+#else
+
+#include <boost/predef/os/bsd/bsdi.h>
+#include <boost/predef/os/bsd/dragonfly.h>
+#include <boost/predef/os/bsd/free.h>
+#include <boost/predef/os/bsd/open.h>
+#include <boost/predef/os/bsd/net.h>
+
+#endif
+
+#include <boost/predef/detail/test.h>
+BOOST_PREDEF_DECLARE_TEST(BOOST_OS_BSD,BOOST_OS_BSD_NAME)
diff --git a/cv_bridge/src/boost/predef/os/bsd/bsdi.h b/cv_bridge/src/boost/predef/os/bsd/bsdi.h
new file mode 100644
index 0000000..afdcd3e
--- /dev/null
+++ b/cv_bridge/src/boost/predef/os/bsd/bsdi.h
@@ -0,0 +1,48 @@
+/*
+Copyright Rene Rivera 2012-2015
+Distributed under the Boost Software License, Version 1.0.
+(See accompanying file LICENSE_1_0.txt or copy at
+http://www.boost.org/LICENSE_1_0.txt)
+*/
+
+#ifndef BOOST_PREDEF_OS_BSD_BSDI_H
+#define BOOST_PREDEF_OS_BSD_BSDI_H
+
+#include <boost/predef/os/bsd.h>
+
+/*`
+[heading `BOOST_OS_BSD_BSDI`]
+
+[@http://en.wikipedia.org/wiki/BSD/OS BSDi BSD/OS] operating system.
+
+[table
+ [[__predef_symbol__] [__predef_version__]]
+
+ [[`__bsdi__`] [__predef_detection__]]
+ ]
+ */
+
+#define BOOST_OS_BSD_BSDI BOOST_VERSION_NUMBER_NOT_AVAILABLE
+
+#if !defined(BOOST_PREDEF_DETAIL_OS_DETECTED) && ( \
+ defined(__bsdi__) \
+ )
+# ifndef BOOST_OS_BSD_AVAILABLE
+# define BOOST_OS_BSD BOOST_VERSION_NUMBER_AVAILABLE
+# define BOOST_OS_BSD_AVAILABLE
+# endif
+# undef BOOST_OS_BSD_BSDI
+# define BOOST_OS_BSD_BSDI BOOST_VERSION_NUMBER_AVAILABLE
+#endif
+
+#if BOOST_OS_BSD_BSDI
+# define BOOST_OS_BSD_BSDI_AVAILABLE
+# include <boost/predef/detail/os_detected.h>
+#endif
+
+#define BOOST_OS_BSD_BSDI_NAME "BSDi BSD/OS"
+
+#endif
+
+#include <boost/predef/detail/test.h>
+BOOST_PREDEF_DECLARE_TEST(BOOST_OS_BSD_BSDI,BOOST_OS_BSD_BSDI_NAME)
diff --git a/cv_bridge/src/boost/predef/os/bsd/dragonfly.h b/cv_bridge/src/boost/predef/os/bsd/dragonfly.h
new file mode 100644
index 0000000..1d07579
--- /dev/null
+++ b/cv_bridge/src/boost/predef/os/bsd/dragonfly.h
@@ -0,0 +1,50 @@
+/*
+Copyright Rene Rivera 2012-2015
+Distributed under the Boost Software License, Version 1.0.
+(See accompanying file LICENSE_1_0.txt or copy at
+http://www.boost.org/LICENSE_1_0.txt)
+*/
+
+#ifndef BOOST_PREDEF_OS_BSD_DRAGONFLY_H
+#define BOOST_PREDEF_OS_BSD_DRAGONFLY_H
+
+#include <boost/predef/os/bsd.h>
+
+/*`
+[heading `BOOST_OS_BSD_DRAGONFLY`]
+
+[@http://en.wikipedia.org/wiki/DragonFly_BSD DragonFly BSD] operating system.
+
+[table
+ [[__predef_symbol__] [__predef_version__]]
+
+ [[`__DragonFly__`] [__predef_detection__]]
+ ]
+ */
+
+#define BOOST_OS_BSD_DRAGONFLY BOOST_VERSION_NUMBER_NOT_AVAILABLE
+
+#if !defined(BOOST_PREDEF_DETAIL_OS_DETECTED) && ( \
+ defined(__DragonFly__) \
+ )
+# ifndef BOOST_OS_BSD_AVAILABLE
+# define BOOST_OS_BSD BOOST_VERSION_NUMBER_AVAILABLE
+# define BOOST_OS_BSD_AVAILABLE
+# endif
+# undef BOOST_OS_BSD_DRAGONFLY
+# if defined(__DragonFly__)
+# define BOOST_OS_DRAGONFLY_BSD BOOST_VERSION_NUMBER_AVAILABLE
+# endif
+#endif
+
+#if BOOST_OS_BSD_DRAGONFLY
+# define BOOST_OS_BSD_DRAGONFLY_AVAILABLE
+# include <boost/predef/detail/os_detected.h>
+#endif
+
+#define BOOST_OS_BSD_DRAGONFLY_NAME "DragonFly BSD"
+
+#endif
+
+#include <boost/predef/detail/test.h>
+BOOST_PREDEF_DECLARE_TEST(BOOST_OS_BSD_DRAGONFLY,BOOST_OS_BSD_DRAGONFLY_NAME)
diff --git a/cv_bridge/src/boost/predef/os/bsd/free.h b/cv_bridge/src/boost/predef/os/bsd/free.h
new file mode 100644
index 0000000..248011a
--- /dev/null
+++ b/cv_bridge/src/boost/predef/os/bsd/free.h
@@ -0,0 +1,60 @@
+/*
+Copyright Rene Rivera 2012-2015
+Distributed under the Boost Software License, Version 1.0.
+(See accompanying file LICENSE_1_0.txt or copy at
+http://www.boost.org/LICENSE_1_0.txt)
+*/
+
+#ifndef BOOST_PREDEF_OS_BSD_FREE_H
+#define BOOST_PREDEF_OS_BSD_FREE_H
+
+#include <boost/predef/os/bsd.h>
+
+/*`
+[heading `BOOST_OS_BSD_FREE`]
+
+[@http://en.wikipedia.org/wiki/Freebsd FreeBSD] operating system.
+
+[table
+ [[__predef_symbol__] [__predef_version__]]
+
+ [[`__FreeBSD__`] [__predef_detection__]]
+
+ [[`__FreeBSD_version`] [V.R.P]]
+ ]
+ */
+
+#define BOOST_OS_BSD_FREE BOOST_VERSION_NUMBER_NOT_AVAILABLE
+
+#if !defined(BOOST_PREDEF_DETAIL_OS_DETECTED) && ( \
+ defined(__FreeBSD__) \
+ )
+# ifndef BOOST_OS_BSD_AVAILABLE
+# define BOOST_OS_BSD BOOST_VERSION_NUMBER_AVAILABLE
+# define BOOST_OS_BSD_AVAILABLE
+# endif
+# undef BOOST_OS_BSD_FREE
+# if defined(__FreeBSD_version)
+# if __FreeBSD_version < 500000
+# define BOOST_OS_BSD_FREE \
+ BOOST_PREDEF_MAKE_10_VRP000(__FreeBSD_version)
+# else
+# define BOOST_OS_BSD_FREE \
+ BOOST_PREDEF_MAKE_10_VRR000(__FreeBSD_version)
+# endif
+# else
+# define BOOST_OS_BSD_FREE BOOST_VERSION_NUMBER_AVAILABLE
+# endif
+#endif
+
+#if BOOST_OS_BSD_FREE
+# define BOOST_OS_BSD_FREE_AVAILABLE
+# include <boost/predef/detail/os_detected.h>
+#endif
+
+#define BOOST_OS_BSD_FREE_NAME "Free BSD"
+
+#endif
+
+#include <boost/predef/detail/test.h>
+BOOST_PREDEF_DECLARE_TEST(BOOST_OS_BSD_FREE,BOOST_OS_BSD_FREE_NAME)
diff --git a/cv_bridge/src/boost/predef/os/bsd/net.h b/cv_bridge/src/boost/predef/os/bsd/net.h
new file mode 100644
index 0000000..387cbde
--- /dev/null
+++ b/cv_bridge/src/boost/predef/os/bsd/net.h
@@ -0,0 +1,84 @@
+/*
+Copyright Rene Rivera 2012-2015
+Distributed under the Boost Software License, Version 1.0.
+(See accompanying file LICENSE_1_0.txt or copy at
+http://www.boost.org/LICENSE_1_0.txt)
+*/
+
+#ifndef BOOST_PREDEF_OS_BSD_NET_H
+#define BOOST_PREDEF_OS_BSD_NET_H
+
+#include <boost/predef/os/bsd.h>
+
+/*`
+[heading `BOOST_OS_BSD_NET`]
+
+[@http://en.wikipedia.org/wiki/Netbsd NetBSD] operating system.
+
+[table
+ [[__predef_symbol__] [__predef_version__]]
+
+ [[`__NETBSD__`] [__predef_detection__]]
+ [[`__NetBSD__`] [__predef_detection__]]
+
+ [[`__NETBSD_version`] [V.R.P]]
+ [[`NetBSD0_8`] [0.8.0]]
+ [[`NetBSD0_9`] [0.9.0]]
+ [[`NetBSD1_0`] [1.0.0]]
+ [[`__NetBSD_Version`] [V.R.P]]
+ ]
+ */
+
+#define BOOST_OS_BSD_NET BOOST_VERSION_NUMBER_NOT_AVAILABLE
+
+#if !defined(BOOST_PREDEF_DETAIL_OS_DETECTED) && ( \
+ defined(__NETBSD__) || defined(__NetBSD__) \
+ )
+# ifndef BOOST_OS_BSD_AVAILABLE
+# define BOOST_OS_BSD BOOST_VERSION_NUMBER_AVAILABLE
+# define BOOST_OS_BSD_AVAILABLE
+# endif
+# undef BOOST_OS_BSD_NET
+# if defined(__NETBSD__)
+# if defined(__NETBSD_version)
+# if __NETBSD_version < 500000
+# define BOOST_OS_BSD_NET \
+ BOOST_PREDEF_MAKE_10_VRP000(__NETBSD_version)
+# else
+# define BOOST_OS_BSD_NET \
+ BOOST_PREDEF_MAKE_10_VRR000(__NETBSD_version)
+# endif
+# else
+# define BOOST_OS_BSD_NET BOOST_VERSION_NUMBER_AVAILABLE
+# endif
+# elif defined(__NetBSD__)
+# if !defined(BOOST_OS_BSD_NET) && defined(NetBSD0_8)
+# define BOOST_OS_BSD_NET BOOST_VERSION_NUMBER(0,8,0)
+# endif
+# if !defined(BOOST_OS_BSD_NET) && defined(NetBSD0_9)
+# define BOOST_OS_BSD_NET BOOST_VERSION_NUMBER(0,9,0)
+# endif
+# if !defined(BOOST_OS_BSD_NET) && defined(NetBSD1_0)
+# define BOOST_OS_BSD_NET BOOST_VERSION_NUMBER(1,0,0)
+# endif
+# if !defined(BOOST_OS_BSD_NET) && defined(__NetBSD_Version)
+# define BOOST_OS_BSD_NET \
+ BOOST_PREDEF_MAKE_10_VVRR00PP00(__NetBSD_Version)
+# endif
+# if !defined(BOOST_OS_BSD_NET)
+# define BOOST_OS_BSD_NET BOOST_VERSION_NUMBER_AVAILABLE
+# endif
+# endif
+#endif
+
+#if BOOST_OS_BSD_NET
+# define BOOST_OS_BSD_NET_AVAILABLE
+# include <boost/predef/detail/os_detected.h>
+#endif
+
+#define BOOST_OS_BSD_NET_NAME "DragonFly BSD"
+
+#endif
+
+#include <boost/predef/detail/test.h>
+BOOST_PREDEF_DECLARE_TEST(BOOST_OS_BSD_NET,BOOST_OS_BSD_NET_NAME)
diff --git a/cv_bridge/src/boost/predef/os/bsd/open.h b/cv_bridge/src/boost/predef/os/bsd/open.h
new file mode 100644
index 0000000..423103a
--- /dev/null
+++ b/cv_bridge/src/boost/predef/os/bsd/open.h
@@ -0,0 +1,171 @@
+/*
+Copyright Rene Rivera 2012-2015
+Distributed under the Boost Software License, Version 1.0.
+(See accompanying file LICENSE_1_0.txt or copy at
+http://www.boost.org/LICENSE_1_0.txt)
+*/
+
+#ifndef BOOST_PREDEF_OS_BSD_OPEN_H
+#define BOOST_PREDEF_OS_BSD_OPEN_H
+
+#include <boost/predef/os/bsd.h>
+
+/*`
+[heading `BOOST_OS_BSD_OPEN`]
+
+[@http://en.wikipedia.org/wiki/Openbsd OpenBSD] operating system.
+
+[table
+ [[__predef_symbol__] [__predef_version__]]
+
+ [[`__OpenBSD__`] [__predef_detection__]]
+
+ [[`OpenBSD2_0`] [2.0.0]]
+ [[`OpenBSD2_1`] [2.1.0]]
+ [[`OpenBSD2_2`] [2.2.0]]
+ [[`OpenBSD2_3`] [2.3.0]]
+ [[`OpenBSD2_4`] [2.4.0]]
+ [[`OpenBSD2_5`] [2.5.0]]
+ [[`OpenBSD2_6`] [2.6.0]]
+ [[`OpenBSD2_7`] [2.7.0]]
+ [[`OpenBSD2_8`] [2.8.0]]
+ [[`OpenBSD2_9`] [2.9.0]]
+ [[`OpenBSD3_0`] [3.0.0]]
+ [[`OpenBSD3_1`] [3.1.0]]
+ [[`OpenBSD3_2`] [3.2.0]]
+ [[`OpenBSD3_3`] [3.3.0]]
+ [[`OpenBSD3_4`] [3.4.0]]
+ [[`OpenBSD3_5`] [3.5.0]]
+ [[`OpenBSD3_6`] [3.6.0]]
+ [[`OpenBSD3_7`] [3.7.0]]
+ [[`OpenBSD3_8`] [3.8.0]]
+ [[`OpenBSD3_9`] [3.9.0]]
+ [[`OpenBSD4_0`] [4.0.0]]
+ [[`OpenBSD4_1`] [4.1.0]]
+ [[`OpenBSD4_2`] [4.2.0]]
+ [[`OpenBSD4_3`] [4.3.0]]
+ [[`OpenBSD4_4`] [4.4.0]]
+ [[`OpenBSD4_5`] [4.5.0]]
+ [[`OpenBSD4_6`] [4.6.0]]
+ [[`OpenBSD4_7`] [4.7.0]]
+ [[`OpenBSD4_8`] [4.8.0]]
+ [[`OpenBSD4_9`] [4.9.0]]
+ ]
+ */
+
+#define BOOST_OS_BSD_OPEN BOOST_VERSION_NUMBER_NOT_AVAILABLE
+
+#if !defined(BOOST_PREDEF_DETAIL_OS_DETECTED) && ( \
+ defined(__OpenBSD__) \
+ )
+# ifndef BOOST_OS_BSD_AVAILABLE
+# define BOOST_OS_BSD BOOST_VERSION_NUMBER_AVAILABLE
+# define BOOST_OS_BSD_AVAILABLE
+# endif
+# undef BOOST_OS_BSD_OPEN
+# if !defined(BOOST_OS_BSD_OPEN) && defined(OpenBSD2_0)
+# define BOOST_OS_BSD_OPEN BOOST_VERSION_NUMBER(2,0,0)
+# endif
+# if !defined(BOOST_OS_BSD_OPEN) && defined(OpenBSD2_1)
+# define BOOST_OS_BSD_OPEN BOOST_VERSION_NUMBER(2,1,0)
+# endif
+# if !defined(BOOST_OS_BSD_OPEN) && defined(OpenBSD2_2)
+# define BOOST_OS_BSD_OPEN BOOST_VERSION_NUMBER(2,2,0)
+# endif
+# if !defined(BOOST_OS_BSD_OPEN) && defined(OpenBSD2_3)
+# define BOOST_OS_BSD_OPEN BOOST_VERSION_NUMBER(2,3,0)
+# endif
+# if !defined(BOOST_OS_BSD_OPEN) && defined(OpenBSD2_4)
+# define BOOST_OS_BSD_OPEN BOOST_VERSION_NUMBER(2,4,0)
+# endif
+# if !defined(BOOST_OS_BSD_OPEN) && defined(OpenBSD2_5)
+# define BOOST_OS_BSD_OPEN BOOST_VERSION_NUMBER(2,5,0)
+# endif
+# if !defined(BOOST_OS_BSD_OPEN) && defined(OpenBSD2_6)
+# define BOOST_OS_BSD_OPEN BOOST_VERSION_NUMBER(2,6,0)
+# endif
+# if !defined(BOOST_OS_BSD_OPEN) && defined(OpenBSD2_7)
+# define BOOST_OS_BSD_OPEN BOOST_VERSION_NUMBER(2,7,0)
+# endif
+# if !defined(BOOST_OS_BSD_OPEN) && defined(OpenBSD2_8)
+# define BOOST_OS_BSD_OPEN BOOST_VERSION_NUMBER(2,8,0)
+# endif
+# if !defined(BOOST_OS_BSD_OPEN) && defined(OpenBSD2_9)
+# define BOOST_OS_BSD_OPEN BOOST_VERSION_NUMBER(2,9,0)
+# endif
+# if !defined(BOOST_OS_BSD_OPEN) && defined(OpenBSD3_0)
+# define BOOST_OS_BSD_OPEN BOOST_VERSION_NUMBER(3,0,0)
+# endif
+# if !defined(BOOST_OS_BSD_OPEN) && defined(OpenBSD3_1)
+# define BOOST_OS_BSD_OPEN BOOST_VERSION_NUMBER(3,1,0)
+# endif
+# if !defined(BOOST_OS_BSD_OPEN) && defined(OpenBSD3_2)
+# define BOOST_OS_BSD_OPEN BOOST_VERSION_NUMBER(3,2,0)
+# endif
+# if !defined(BOOST_OS_BSD_OPEN) && defined(OpenBSD3_3)
+# define BOOST_OS_BSD_OPEN BOOST_VERSION_NUMBER(3,3,0)
+# endif
+# if !defined(BOOST_OS_BSD_OPEN) && defined(OpenBSD3_4)
+# define BOOST_OS_BSD_OPEN BOOST_VERSION_NUMBER(3,4,0)
+# endif
+# if !defined(BOOST_OS_BSD_OPEN) && defined(OpenBSD3_5)
+# define BOOST_OS_BSD_OPEN BOOST_VERSION_NUMBER(3,5,0)
+# endif
+# if !defined(BOOST_OS_BSD_OPEN) && defined(OpenBSD3_6)
+# define BOOST_OS_BSD_OPEN BOOST_VERSION_NUMBER(3,6,0)
+# endif
+# if !defined(BOOST_OS_BSD_OPEN) && defined(OpenBSD3_7)
+# define BOOST_OS_BSD_OPEN BOOST_VERSION_NUMBER(3,7,0)
+# endif
+# if !defined(BOOST_OS_BSD_OPEN) && defined(OpenBSD3_8)
+# define BOOST_OS_BSD_OPEN BOOST_VERSION_NUMBER(3,8,0)
+# endif
+# if !defined(BOOST_OS_BSD_OPEN) && defined(OpenBSD3_9)
+# define BOOST_OS_BSD_OPEN BOOST_VERSION_NUMBER(3,9,0)
+# endif
+# if !defined(BOOST_OS_BSD_OPEN) && defined(OpenBSD4_0)
+# define BOOST_OS_BSD_OPEN BOOST_VERSION_NUMBER(4,0,0)
+# endif
+# if !defined(BOOST_OS_BSD_OPEN) && defined(OpenBSD4_1)
+# define BOOST_OS_BSD_OPEN BOOST_VERSION_NUMBER(4,1,0)
+# endif
+# if !defined(BOOST_OS_BSD_OPEN) && defined(OpenBSD4_2)
+# define BOOST_OS_BSD_OPEN BOOST_VERSION_NUMBER(4,2,0)
+# endif
+# if !defined(BOOST_OS_BSD_OPEN) && defined(OpenBSD4_3)
+# define BOOST_OS_BSD_OPEN BOOST_VERSION_NUMBER(4,3,0)
+# endif
+# if !defined(BOOST_OS_BSD_OPEN) && defined(OpenBSD4_4)
+# define BOOST_OS_BSD_OPEN BOOST_VERSION_NUMBER(4,4,0)
+# endif
+# if !defined(BOOST_OS_BSD_OPEN) && defined(OpenBSD4_5)
+# define BOOST_OS_BSD_OPEN BOOST_VERSION_NUMBER(4,5,0)
+# endif
+# if !defined(BOOST_OS_BSD_OPEN) && defined(OpenBSD4_6)
+# define BOOST_OS_BSD_OPEN BOOST_VERSION_NUMBER(4,6,0)
+# endif
+# if !defined(BOOST_OS_BSD_OPEN) && defined(OpenBSD4_7)
+# define BOOST_OS_BSD_OPEN BOOST_VERSION_NUMBER(4,7,0)
+# endif
+# if !defined(BOOST_OS_BSD_OPEN) && defined(OpenBSD4_8)
+# define BOOST_OS_BSD_OPEN BOOST_VERSION_NUMBER(4,8,0)
+# endif
+# if !defined(BOOST_OS_BSD_OPEN) && defined(OpenBSD4_9)
+# define BOOST_OS_BSD_OPEN BOOST_VERSION_NUMBER(4,9,0)
+# endif
+# if !defined(BOOST_OS_BSD_OPEN)
+# define BOOST_OS_BSD_OPEN BOOST_VERSION_NUMBER_AVAILABLE
+# endif
+#endif
+
+#if BOOST_OS_BSD_OPEN
+# define BOOST_OS_BSD_OPEN_AVAILABLE
+# include <boost/predef/detail/os_detected.h>
+#endif
+
+#define BOOST_OS_BSD_OPEN_NAME "OpenBSD"
+
+#endif
+
+#include <boost/predef/detail/test.h>
+BOOST_PREDEF_DECLARE_TEST(BOOST_OS_BSD_OPEN,BOOST_OS_BSD_OPEN_NAME)
diff --git a/cv_bridge/src/boost/predef/os/ios.h b/cv_bridge/src/boost/predef/os/ios.h
new file mode 100644
index 0000000..f853815
--- /dev/null
+++ b/cv_bridge/src/boost/predef/os/ios.h
@@ -0,0 +1,51 @@
+/*
+Copyright Franz Detro 2014
+Copyright Rene Rivera 2015
+Distributed under the Boost Software License, Version 1.0.
+(See accompanying file LICENSE_1_0.txt or copy at
+http://www.boost.org/LICENSE_1_0.txt)
+*/
+
+#ifndef BOOST_PREDEF_OS_IOS_H
+#define BOOST_PREDEF_OS_IOS_H
+
+#include <boost/predef/version_number.h>
+#include <boost/predef/make.h>
+
+/*`
+[heading `BOOST_OS_IOS`]
+
+[@http://en.wikipedia.org/wiki/iOS iOS] operating system.
+
+[table
+ [[__predef_symbol__] [__predef_version__]]
+
+ [[`__APPLE__`] [__predef_detection__]]
+ [[`__MACH__`] [__predef_detection__]]
+ [[`__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__`] [__predef_detection__]]
+
+ [[`__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__`] [__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__*1000]]
+ ]
+ */
+
+#define BOOST_OS_IOS BOOST_VERSION_NUMBER_NOT_AVAILABLE
+
+#if !defined(BOOST_PREDEF_DETAIL_OS_DETECTED) && ( \
+ defined(__APPLE__) && defined(__MACH__) && \
+ defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) \
+ )
+# undef BOOST_OS_IOS
+# define BOOST_OS_IOS (__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__*1000)
+#endif
+
+#if BOOST_OS_IOS
+# define BOOST_OS_IOS_AVAILABLE
+# include <boost/predef/detail/os_detected.h>
+#endif
+
+#define BOOST_OS_IOS_NAME "iOS"
+
+#endif
+
+#include <boost/predef/detail/test.h>
+BOOST_PREDEF_DECLARE_TEST(BOOST_OS_IOS,BOOST_OS_IOS_NAME)
diff --git a/cv_bridge/src/boost/predef/os/macos.h b/cv_bridge/src/boost/predef/os/macos.h
new file mode 100644
index 0000000..4afb30d
--- /dev/null
+++ b/cv_bridge/src/boost/predef/os/macos.h
@@ -0,0 +1,65 @@
+/*
+Copyright Rene Rivera 2008-2015
+Copyright Franz Detro 2014
+Distributed under the Boost Software License, Version 1.0.
+(See accompanying file LICENSE_1_0.txt or copy at
+http://www.boost.org/LICENSE_1_0.txt)
+*/
+
+#ifndef BOOST_PREDEF_OS_MACOS_H
+#define BOOST_PREDEF_OS_MACOS_H
+
+/* Special case: iOS will define the same predefs as MacOS, and additionally
+ '__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__'. We can guard against that,
+ but only if we detect iOS first. Hence we will force include iOS detection
+ * before doing any MacOS detection.
+ */
+#include <boost/predef/os/ios.h>
+
+#include <boost/predef/version_number.h>
+#include <boost/predef/make.h>
+
+/*`
+[heading `BOOST_OS_MACOS`]
+
+[@http://en.wikipedia.org/wiki/Mac_OS Mac OS] operating system.
+
+[table
+ [[__predef_symbol__] [__predef_version__]]
+
+ [[`macintosh`] [__predef_detection__]]
+ [[`Macintosh`] [__predef_detection__]]
+ [[`__APPLE__`] [__predef_detection__]]
+ [[`__MACH__`] [__predef_detection__]]
+
+ [[`__APPLE__`, `__MACH__`] [10.0.0]]
+ [[ /otherwise/ ] [9.0.0]]
+ ]
+ */
+
+#define BOOST_OS_MACOS BOOST_VERSION_NUMBER_NOT_AVAILABLE
+
+#if !defined(BOOST_PREDEF_DETAIL_OS_DETECTED) && ( \
+ defined(macintosh) || defined(Macintosh) || \
+ (defined(__APPLE__) && defined(__MACH__)) \
+ )
+# undef BOOST_OS_MACOS
+# if !defined(BOOST_OS_MACOS) && defined(__APPLE__) && defined(__MACH__)
+# define BOOST_OS_MACOS BOOST_VERSION_NUMBER(10,0,0)
+# endif
+# if !defined(BOOST_OS_MACOS)
+# define BOOST_OS_MACOS BOOST_VERSION_NUMBER(9,0,0)
+# endif
+#endif
+
+#if BOOST_OS_MACOS
+# define BOOST_OS_MACOS_AVAILABLE
+# include <boost/predef/detail/os_detected.h>
+#endif
+
+#define BOOST_OS_MACOS_NAME "Mac OS"
+
+#endif
+
+#include <boost/predef/detail/test.h>
+BOOST_PREDEF_DECLARE_TEST(BOOST_OS_MACOS,BOOST_OS_MACOS_NAME)
diff --git a/cv_bridge/src/boost/predef/other/endian.h b/cv_bridge/src/boost/predef/other/endian.h
new file mode 100644
index 0000000..6d1f43f
--- /dev/null
+++ b/cv_bridge/src/boost/predef/other/endian.h
@@ -0,0 +1,204 @@
+/*
+Copyright Rene Rivera 2013-2015
+Distributed under the Boost Software License, Version 1.0.
+(See accompanying file LICENSE_1_0.txt or copy at
+http://www.boost.org/LICENSE_1_0.txt)
+*/
+
+#ifndef BOOST_PREDEF_ENDIAN_H
+#define BOOST_PREDEF_ENDIAN_H
+
+#include <boost/predef/version_number.h>
+#include <boost/predef/make.h>
+#include <boost/predef/library/c/gnu.h>
+#include <boost/predef/os/macos.h>
+#include <boost/predef/os/bsd.h>
+#include <boost/predef/os/android.h>
+
+/*`
+[heading `BOOST_ENDIAN_*`]
+
+Detection of endian memory ordering. There are four defined macros
+in this header that define the various generally possible endian
+memory orderings:
+
+* `BOOST_ENDIAN_BIG_BYTE`, byte-swapped big-endian.
+* `BOOST_ENDIAN_BIG_WORD`, word-swapped big-endian.
+* `BOOST_ENDIAN_LITTLE_BYTE`, byte-swapped little-endian.
+* `BOOST_ENDIAN_LITTLE_WORD`, word-swapped little-endian.
+
+The detection is conservative in that it only identifies endianness
+that it knows for certain. In particular bi-endianness is not
+indicated as is it not practically possible to determine the
+endianness from anything but an operating system provided
+header. And the currently known headers do not define that
+programatic bi-endianness is available.
+
+This implementation is a compilation of various publicly available
+information and acquired knowledge:
+
+# The indispensable documentation of "Pre-defined Compiler Macros"
+ [@http://sourceforge.net/p/predef/wiki/Endianness Endianness].
+# The various endian specifications available in the
+ [@http://wikipedia.org/ Wikipedia] computer architecture pages.
+# Generally available searches for headers that define endianness.
+ */
+
+#define BOOST_ENDIAN_BIG_BYTE BOOST_VERSION_NUMBER_NOT_AVAILABLE
+#define BOOST_ENDIAN_BIG_WORD BOOST_VERSION_NUMBER_NOT_AVAILABLE
+#define BOOST_ENDIAN_LITTLE_BYTE BOOST_VERSION_NUMBER_NOT_AVAILABLE
+#define BOOST_ENDIAN_LITTLE_WORD BOOST_VERSION_NUMBER_NOT_AVAILABLE
+
+/* GNU libc provides a header defining __BYTE_ORDER, or _BYTE_ORDER.
+ * And some OSs provide some for of endian header also.
+ */
+#if !BOOST_ENDIAN_BIG_BYTE && !BOOST_ENDIAN_BIG_WORD && \
+ !BOOST_ENDIAN_LITTLE_BYTE && !BOOST_ENDIAN_LITTLE_WORD
+# if BOOST_LIB_C_GNU || BOOST_OS_ANDROID
+# include <endian.h>
+# else
+# if BOOST_OS_MACOS
+# include <machine/endian.h>
+# else
+# if BOOST_OS_BSD
+# if BOOST_OS_BSD_OPEN
+# include <machine/endian.h>
+# else
+# include <sys/endian.h>
+# endif
+# endif
+# endif
+# endif
+# if defined(__BYTE_ORDER)
+# if defined(__BIG_ENDIAN) && (__BYTE_ORDER == __BIG_ENDIAN)
+# undef BOOST_ENDIAN_BIG_BYTE
+# define BOOST_ENDIAN_BIG_BYTE BOOST_VERSION_NUMBER_AVAILABLE
+# endif
+# if defined(__LITTLE_ENDIAN) && (__BYTE_ORDER == __LITTLE_ENDIAN)
+# undef BOOST_ENDIAN_LITTLE_BYTE
+# define BOOST_ENDIAN_LITTLE_BYTE BOOST_VERSION_NUMBER_AVAILABLE
+# endif
+# if defined(__PDP_ENDIAN) && (__BYTE_ORDER == __PDP_ENDIAN)
+# undef BOOST_ENDIAN_LITTLE_WORD
+# define BOOST_ENDIAN_LITTLE_WORD BOOST_VERSION_NUMBER_AVAILABLE
+# endif
+# endif
+# if !defined(__BYTE_ORDER) && defined(_BYTE_ORDER)
+# if defined(_BIG_ENDIAN) && (_BYTE_ORDER == _BIG_ENDIAN)
+# undef BOOST_ENDIAN_BIG_BYTE
+# define BOOST_ENDIAN_BIG_BYTE BOOST_VERSION_NUMBER_AVAILABLE
+# endif
+# if defined(_LITTLE_ENDIAN) && (_BYTE_ORDER == _LITTLE_ENDIAN)
+# undef BOOST_ENDIAN_LITTLE_BYTE
+# define BOOST_ENDIAN_LITTLE_BYTE BOOST_VERSION_NUMBER_AVAILABLE
+# endif
+# if defined(_PDP_ENDIAN) && (_BYTE_ORDER == _PDP_ENDIAN)
+# undef BOOST_ENDIAN_LITTLE_WORD
+# define BOOST_ENDIAN_LITTLE_WORD BOOST_VERSION_NUMBER_AVAILABLE
+# endif
+# endif
+#endif
+
+/* Built-in byte-swpped big-endian macros.
+ */
+#if !BOOST_ENDIAN_BIG_BYTE && !BOOST_ENDIAN_BIG_WORD && \
+ !BOOST_ENDIAN_LITTLE_BYTE && !BOOST_ENDIAN_LITTLE_WORD
+# if (defined(__BIG_ENDIAN__) && !defined(__LITTLE_ENDIAN__)) || \
+ (defined(_BIG_ENDIAN) && !defined(_LITTLE_ENDIAN)) || \
+ defined(__ARMEB__) || \
+ defined(__THUMBEB__) || \
+ defined(__AARCH64EB__) || \
+ defined(_MIPSEB) || \
+ defined(__MIPSEB) || \
+ defined(__MIPSEB__)
+# undef BOOST_ENDIAN_BIG_BYTE
+# define BOOST_ENDIAN_BIG_BYTE BOOST_VERSION_NUMBER_AVAILABLE
+# endif
+#endif
+
+/* Built-in byte-swpped little-endian macros.
+ */
+#if !BOOST_ENDIAN_BIG_BYTE && !BOOST_ENDIAN_BIG_WORD && \
+ !BOOST_ENDIAN_LITTLE_BYTE && !BOOST_ENDIAN_LITTLE_WORD
+# if (defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__)) || \
+ (defined(_LITTLE_ENDIAN) && !defined(_BIG_ENDIAN)) || \
+ defined(__ARMEL__) || \
+ defined(__THUMBEL__) || \
+ defined(__AARCH64EL__) || \
+ defined(_MIPSEL) || \
+ defined(__MIPSEL) || \
+ defined(__MIPSEL__)
+# undef BOOST_ENDIAN_LITTLE_BYTE
+# define BOOST_ENDIAN_LITTLE_BYTE BOOST_VERSION_NUMBER_AVAILABLE
+# endif
+#endif
+
+/* Some architectures are strictly one endianess (as opposed
+ * the current common bi-endianess).
+ */
+#if !BOOST_ENDIAN_BIG_BYTE && !BOOST_ENDIAN_BIG_WORD && \
+ !BOOST_ENDIAN_LITTLE_BYTE && !BOOST_ENDIAN_LITTLE_WORD
+# include <boost/predef/architecture.h>
+# if BOOST_ARCH_M68K || \
+ BOOST_ARCH_PARISC || \
+ BOOST_ARCH_SPARC || \
+ BOOST_ARCH_SYS370 || \
+ BOOST_ARCH_SYS390 || \
+ BOOST_ARCH_Z
+# undef BOOST_ENDIAN_BIG_BYTE
+# define BOOST_ENDIAN_BIG_BYTE BOOST_VERSION_NUMBER_AVAILABLE
+# endif
+# if BOOST_ARCH_AMD64 || \
+ BOOST_ARCH_IA64 || \
+ BOOST_ARCH_X86 || \
+ BOOST_ARCH_BLACKFIN
+# undef BOOST_ENDIAN_LITTLE_BYTE
+# define BOOST_ENDIAN_LITTLE_BYTE BOOST_VERSION_NUMBER_AVAILABLE
+# endif
+#endif
+
+/* Windows on ARM, if not otherwise detected/specified, is always
+ * byte-swaped little-endian.
+ */
+#if !BOOST_ENDIAN_BIG_BYTE && !BOOST_ENDIAN_BIG_WORD && \
+ !BOOST_ENDIAN_LITTLE_BYTE && !BOOST_ENDIAN_LITTLE_WORD
+# if BOOST_ARCH_ARM
+# include <boost/predef/os/windows.h>
+# if BOOST_OS_WINDOWS
+# undef BOOST_ENDIAN_LITTLE_BYTE
+# define BOOST_ENDIAN_LITTLE_BYTE BOOST_VERSION_NUMBER_AVAILABLE
+# endif
+# endif
+#endif
+
+#if BOOST_ENDIAN_BIG_BYTE
+# define BOOST_ENDIAN_BIG_BYTE_AVAILABLE
+#endif
+#if BOOST_ENDIAN_BIG_WORD
+# define BOOST_ENDIAN_BIG_WORD_BYTE_AVAILABLE
+#endif
+#if BOOST_ENDIAN_LITTLE_BYTE
+# define BOOST_ENDIAN_LITTLE_BYTE_AVAILABLE
+#endif
+#if BOOST_ENDIAN_LITTLE_WORD
+# define BOOST_ENDIAN_LITTLE_WORD_BYTE_AVAILABLE
+#endif
+
+#define BOOST_ENDIAN_BIG_BYTE_NAME "Byte-Swapped Big-Endian"
+#define BOOST_ENDIAN_BIG_WORD_NAME "Word-Swapped Big-Endian"
+#define BOOST_ENDIAN_LITTLE_BYTE_NAME "Byte-Swapped Little-Endian"
+#define BOOST_ENDIAN_LITTLE_WORD_NAME "Word-Swapped Little-Endian"
+
+#endif
+
+#include <boost/predef/detail/test.h>
+BOOST_PREDEF_DECLARE_TEST(BOOST_ENDIAN_BIG_BYTE,BOOST_ENDIAN_BIG_BYTE_NAME)
+
+#include <boost/predef/detail/test.h>
+BOOST_PREDEF_DECLARE_TEST(BOOST_ENDIAN_BIG_WORD,BOOST_ENDIAN_BIG_WORD_NAME)
+
+#include <boost/predef/detail/test.h>
+BOOST_PREDEF_DECLARE_TEST(BOOST_ENDIAN_LITTLE_BYTE,BOOST_ENDIAN_LITTLE_BYTE_NAME)
+
+#include <boost/predef/detail/test.h>
+BOOST_PREDEF_DECLARE_TEST(BOOST_ENDIAN_LITTLE_WORD,BOOST_ENDIAN_LITTLE_WORD_NAME)
diff --git a/cv_bridge/src/boost/predef/version_number.h b/cv_bridge/src/boost/predef/version_number.h
new file mode 100644
index 0000000..3903a36
--- /dev/null
+++ b/cv_bridge/src/boost/predef/version_number.h
@@ -0,0 +1,53 @@
+/*
+Copyright Rene Rivera 2005, 2008-2013
+Distributed under the Boost Software License, Version 1.0.
+(See accompanying file LICENSE_1_0.txt or copy at
+http://www.boost.org/LICENSE_1_0.txt)
+*/
+
+#ifndef BOOST_PREDEF_VERSION_NUMBER_H
+#define BOOST_PREDEF_VERSION_NUMBER_H
+
+/*`
+[heading `BOOST_VERSION_NUMBER`]
+
+``
+BOOST_VERSION_NUMBER(major,minor,patch)
+``
+
+Defines standard version numbers, with these properties:
+
+* Decimal base whole numbers in the range \[0,1000000000).
+ The number range is designed to allow for a (2,2,5) triplet.
+ Which fits within a 32 bit value.
+* The `major` number can be in the \[0,99\] range.
+* The `minor` number can be in the \[0,99\] range.
+* The `patch` number can be in the \[0,99999\] range.
+* Values can be specified in any base. As the defined value
+ is an constant expression.
+* Value can be directly used in both preprocessor and compiler
+ expressions for comparison to other similarly defined values.
+* The implementation enforces the individual ranges for the
+ major, minor, and patch numbers. And values over the ranges
+ are truncated (modulo).
+
+*/
+#define BOOST_VERSION_NUMBER(major,minor,patch) \
+ ( (((major)%100)*10000000) + (((minor)%100)*100000) + ((patch)%100000) )
+
+#define BOOST_VERSION_NUMBER_MAX \
+ BOOST_VERSION_NUMBER(99,99,99999)
+
+#define BOOST_VERSION_NUMBER_ZERO \
+ BOOST_VERSION_NUMBER(0,0,0)
+
+#define BOOST_VERSION_NUMBER_MIN \
+ BOOST_VERSION_NUMBER(0,0,1)
+
+#define BOOST_VERSION_NUMBER_AVAILABLE \
+ BOOST_VERSION_NUMBER_MIN
+
+#define BOOST_VERSION_NUMBER_NOT_AVAILABLE \
+ BOOST_VERSION_NUMBER_ZERO
+
+#endif
diff --git a/cv_bridge/src/cv_bridge.cpp b/cv_bridge/src/cv_bridge.cpp
index c1fa04a..261fa71 100644
--- a/cv_bridge/src/cv_bridge.cpp
+++ b/cv_bridge/src/cv_bridge.cpp
@@ -2,6 +2,7 @@
* Software License Agreement (BSD License)
*
* Copyright (c) 2011, Willow Garage, Inc.
+* Copyright (c) 2015, Tal Regev.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -32,12 +33,16 @@
* POSSIBILITY OF SUCH DAMAGE.
*********************************************************************/
+#include "boost/endian/conversion.hpp"
+
#include <map>
#include <boost/make_shared.hpp>
#include <opencv2/imgproc/imgproc.hpp>
+#include <opencv2/highgui/highgui.hpp>
+
#include <sensor_msgs/image_encodings.h>
#include <cv_bridge/cv_bridge.h>
@@ -100,9 +105,9 @@ int getCvType(const std::string& encoding)
/// @cond DOXYGEN_IGNORE
-enum Format { INVALID = -1, GRAY = 0, RGB, BGR, RGBA, BGRA, YUV422, BAYER_RGGB, BAYER_BGGR, BAYER_GBRG, BAYER_GRBG};
+enum Encoding { INVALID = -1, GRAY = 0, RGB, BGR, RGBA, BGRA, YUV422, BAYER_RGGB, BAYER_BGGR, BAYER_GBRG, BAYER_GRBG};
-Format getFormat(const std::string& encoding)
+Encoding getEncoding(const std::string& encoding)
{
if ((encoding == enc::MONO8) || (encoding == enc::MONO16)) return GRAY;
if ((encoding == enc::BGR8) || (encoding == enc::BGR16)) return BGR;
@@ -126,10 +131,10 @@ static const int SAME_FORMAT = -1;
* The key is a pair: <FromFormat, ToFormat> and the value a succession of OpenCV code conversion
* It's not efficient code but it is only called once and the structure is small enough
*/
-std::map<std::pair<Format, Format>, std::vector<int> > getConversionCodes() {
- std::map<std::pair<Format, Format>, std::vector<int> > res;
+std::map<std::pair<Encoding, Encoding>, std::vector<int> > getConversionCodes() {
+ std::map<std::pair<Encoding, Encoding>, std::vector<int> > res;
for(int i=0; i<=5; ++i)
- res[std::pair<Format, Format>(Format(i),Format(i))].push_back(SAME_FORMAT);
+ res[std::pair<Encoding, Encoding>(Encoding(i),Encoding(i))].push_back(SAME_FORMAT);
res[std::make_pair(GRAY, RGB)].push_back(cv::COLOR_GRAY2RGB);
res[std::make_pair(GRAY, BGR)].push_back(cv::COLOR_GRAY2BGR);
@@ -184,8 +189,8 @@ std::map<std::pair<Format, Format>, std::vector<int> > getConversionCodes() {
const std::vector<int> getConversionCode(std::string src_encoding, std::string dst_encoding)
{
- Format src_format = getFormat(src_encoding);
- Format dst_format = getFormat(dst_encoding);
+ Encoding src_encod = getEncoding(src_encoding);
+ Encoding dst_encod = getEncoding(dst_encoding);
bool is_src_color_format = sensor_msgs::image_encodings::isColor(src_encoding) ||
sensor_msgs::image_encodings::isMono(src_encoding) ||
sensor_msgs::image_encodings::isBayer(src_encoding) ||
@@ -217,22 +222,25 @@ const std::vector<int> getConversionCode(std::string src_encoding, std::string d
}
// If we are converting from a color type to another type, then everything is fine
- static const std::map<std::pair<Format, Format>, std::vector<int> > CONVERSION_CODES = getConversionCodes();
+ static const std::map<std::pair<Encoding, Encoding>, std::vector<int> > CONVERSION_CODES = getConversionCodes();
- std::pair<Format, Format> key(src_format, dst_format);
- std::map<std::pair<Format, Format>, std::vector<int> >::const_iterator val = CONVERSION_CODES.find(key);
+ std::pair<Encoding, Encoding> key(src_encod, dst_encod);
+ std::map<std::pair<Encoding, Encoding>, std::vector<int> >::const_iterator val = CONVERSION_CODES.find(key);
if (val == CONVERSION_CODES.end())
throw Exception("Unsupported conversion from [" + src_encoding +
"] to [" + dst_encoding + "]");
- // And deal with depth differences
+ // And deal with depth differences if the colors are different
std::vector<int> res = val->second;
- if (enc::bitDepth(src_encoding) != enc::bitDepth(dst_encoding))
+ if ((enc::bitDepth(src_encoding) != enc::bitDepth(dst_encoding)) && (getEncoding(src_encoding) != getEncoding(dst_encoding)))
res.push_back(SAME_FORMAT);
- return val->second;
+ return res;
}
+/////////////////////////////////////// Image ///////////////////////////////////////////
+
+// Converts a ROS Image to a cv::Mat by sharing the data or chaning its endianness if needed
cv::Mat matFromImage(const sensor_msgs::Image& source)
{
int source_type = getCvType(source.encoding);
@@ -255,8 +263,32 @@ cv::Mat matFromImage(const sensor_msgs::Image& source)
throw Exception(ss.str());
}
- return cv::Mat(source.height, source.width, source_type,
- const_cast<uchar*>(&source.data[0]), source.step);
+ // If the endianness is the same as locally, share the data
+ cv::Mat mat(source.height, source.width, source_type, const_cast<uchar*>(&source.data[0]), source.step);
+ if ((boost::endian::order::native == boost::endian::order::big && source.is_bigendian) ||
+ (boost::endian::order::native == boost::endian::order::little && !source.is_bigendian) ||
+ byte_depth == 1)
+ return mat;
+
+ // Otherwise, reinterpret the data as bytes and switch the channels accordingly
+ mat = cv::Mat(source.height, source.width, CV_MAKETYPE(CV_8U, num_channels*byte_depth),
+ const_cast<uchar*>(&source.data[0]), source.step);
+ cv::Mat mat_swap(source.height, source.width, mat.type());
+
+ std::vector<int> fromTo;
+ fromTo.reserve(num_channels*byte_depth);
+ for(int i = 0; i < num_channels; ++i)
+ for(int j = 0; j < byte_depth; ++j)
+ {
+ fromTo.push_back(byte_depth*i + j);
+ fromTo.push_back(byte_depth*i + byte_depth - 1 - j);
+ }
+ cv::mixChannels(std::vector<cv::Mat>(1, mat), std::vector<cv::Mat>(1, mat_swap), fromTo);
+
+ // Interpret mat_swap back as the proper type
+ mat_swap = cv::Mat(source.height, source.width, source_type, mat_swap.data, mat_swap.step);
+
+ return mat_swap;
}
// Internal, used by toCvCopy and cvtColor
@@ -265,8 +297,6 @@ CvImagePtr toCvCopyImpl(const cv::Mat& source,
const std::string& src_encoding,
const std::string& dst_encoding)
{
- /// @todo Handle endianness - e.g. 16-bit dc1394 camera images are big-endian
-
// Copy metadata
CvImagePtr ptr = boost::make_shared<CvImage>();
ptr->header = src_header;
@@ -288,16 +318,18 @@ CvImagePtr toCvCopyImpl(const cv::Mat& source,
if (conversion_code == SAME_FORMAT)
{
// Same number of channels, but different bit depth
- double alpha = 1.0;
int src_depth = enc::bitDepth(src_encoding);
int dst_depth = enc::bitDepth(dst_encoding);
+ // Keep the number of channels for now but changed to the final depth
+ int image2_type = CV_MAKETYPE(CV_MAT_DEPTH(getCvType(dst_encoding)), image1.channels());
+
// Do scaling between CV_8U [0,255] and CV_16U [0,65535] images.
if (src_depth == 8 && dst_depth == 16)
- image1.convertTo(image2, getCvType(dst_encoding), 65535. / 255.);
+ image1.convertTo(image2, image2_type, 65535. / 255.);
else if (src_depth == 16 && dst_depth == 8)
- image1.convertTo(image2, getCvType(dst_encoding), 255. / 65535.);
+ image1.convertTo(image2, image2_type, 255. / 65535.);
else
- image1.convertTo(image2, getCvType(dst_encoding));
+ image1.convertTo(image2, image2_type);
}
else
{
@@ -328,7 +360,7 @@ void CvImage::toImageMsg(sensor_msgs::Image& ros_image) const
ros_image.height = image.rows;
ros_image.width = image.cols;
ros_image.encoding = encoding;
- ros_image.is_bigendian = false;
+ ros_image.is_bigendian = (boost::endian::order::native == boost::endian::order::big);
ros_image.step = image.cols * image.elemSize();
size_t size = ros_image.step * image.rows;
ros_image.data.resize(size);
@@ -376,7 +408,9 @@ CvImageConstPtr toCvShare(const sensor_msgs::Image& source,
const boost::shared_ptr<void const>& tracked_object,
const std::string& encoding)
{
- if (!encoding.empty() && source.encoding != encoding)
+ // If the encoding different or the endianness different, you have to copy
+ if ((!encoding.empty() && source.encoding != encoding) || (source.is_bigendian &&
+ (boost::endian::order::native != boost::endian::order::big)))
return toCvCopy(source, encoding);
CvImagePtr ptr = boost::make_shared<CvImage>();
@@ -393,4 +427,215 @@ CvImagePtr cvtColor(const CvImageConstPtr& source,
return toCvCopyImpl(source->image, source->header, source->encoding, encoding);
}
+/////////////////////////////////////// CompressedImage ///////////////////////////////////////////
+
+cv::Mat matFromImage(const sensor_msgs::CompressedImage& source)
+{
+ cv::Mat jpegData(1,source.data.size(),CV_8UC1);
+ jpegData.data = const_cast<uchar*>(&source.data[0]);
+ cv::InputArray data(jpegData);
+ cv::Mat bgrMat = cv::imdecode(data,cv::IMREAD_COLOR);
+ return bgrMat;
+}
+
+sensor_msgs::CompressedImagePtr CvImage::toCompressedImageMsg(const Format dst_format) const
+{
+ sensor_msgs::CompressedImagePtr ptr = boost::make_shared<sensor_msgs::CompressedImage>();
+ toCompressedImageMsg(*ptr,dst_format);
+ return ptr;
+}
+
+std::string getFormat(Format format) {
+
+ switch (format) {
+ case DIP:
+ return "dip";
+ case BMP:
+ return "bmp";
+ case JPG:
+ return "jpg";
+ case JPEG:
+ return "jpeg";
+ case JPE:
+ return "jpe";
+ case JP2:
+ return "jp2";
+ case PNG:
+ return "png";
+ case PBM:
+ return "pbm";
+ case PGM:
+ return "pgm";
+ case PPM:
+ return "ppm";
+ case RAS:
+ return "ras";
+ case SR:
+ return "sr";
+ case TIF:
+ return "tif";
+ case TIFF:
+ return "tiff";
+ }
+
+ throw Exception("Unrecognized image format");
+}
+
+void CvImage::toCompressedImageMsg(sensor_msgs::CompressedImage& ros_image, const Format dst_format) const
+{
+ ros_image.header = header;
+ cv::Mat image;
+ if(encoding != enc::BGR8)
+ {
+ CvImagePtr tempThis = boost::make_shared<CvImage>(*this);
+ CvImagePtr temp = cvtColor(tempThis,enc::BGR8);
+ image = temp->image;
+ }
+ else
+ {
+ image = this->image;
+ }
+ std::vector<uchar> buf;
+
+ std::string format = getFormat(dst_format);
+ ros_image.format = format;
+ cv::imencode("." + format, image, buf);
+
+ ros_image.data = buf;
+}
+
+// Deep copy data, returnee is mutable
+CvImagePtr toCvCopy(const sensor_msgs::CompressedImageConstPtr& source,
+ const std::string& encoding)
+{
+ return toCvCopy(*source, encoding);
+}
+
+CvImagePtr toCvCopy(const sensor_msgs::CompressedImage& source,
+ const std::string& encoding)
+{
+ // Construct matrix pointing to source data
+ return toCvCopyImpl(matFromImage(source), source.header, enc::BGR8, encoding);
+}
+
+CvImageConstPtr cvtColorForDisplay(const CvImageConstPtr& source,
+ const std::string& encoding_out,
+ bool do_dynamic_scaling,
+ double min_image_value,
+ double max_image_value)
+{
+ if (!source)
+ throw Exception("cv_bridge.cvtColorForDisplay() called with empty image.");
+ // let's figure out what to do with the empty encoding
+ std::string encoding = encoding_out;
+ if (encoding.empty())
+ {
+ try
+ {
+ // If there is a chance we can just share the data, let's try it out
+ if (sensor_msgs::image_encodings::isColor(source->encoding) || sensor_msgs::image_encodings::isMono(source->encoding))
+ {
+ return source;
+ }
+ // Otherwise, let's decide upon an output format
+ if (sensor_msgs::image_encodings::numChannels(source->encoding) == 1)
+ {
+ if ((sensor_msgs::image_encodings::bitDepth(source->encoding) == 8) ||
+ (sensor_msgs::image_encodings::bitDepth(source->encoding) == 16))
+ encoding = sensor_msgs::image_encodings::MONO8;
+ else
+ throw std::runtime_error("Unsupported depth of the source encoding " + encoding);
+ }
+ else
+ {
+ // We choose BGR by default here as we assume people will use OpenCV
+ if ((sensor_msgs::image_encodings::bitDepth(source->encoding) == 8) ||
+ (sensor_msgs::image_encodings::bitDepth(source->encoding) == 16))
+ encoding = sensor_msgs::image_encodings::BGR8;
+ else
+ throw std::runtime_error("Unsupported depth of the source encoding " + encoding);
+ }
+ }
+ // We could have cv_bridge exception or std_runtime_error from sensor_msgs::image_codings routines
+ catch (const std::runtime_error& e)
+ {
+ throw Exception("cv_bridge.cvtColorForDisplay() output encoding is empty and cannot be guessed.");
+ }
+ }
+ else
+ {
+ if ((!sensor_msgs::image_encodings::isColor(encoding_out) && !sensor_msgs::image_encodings::isMono(encoding_out)) ||
+ (sensor_msgs::image_encodings::bitDepth(encoding) != 8))
+ throw Exception("cv_bridge.cvtColorForDisplay() does not have an output encoding that is color or mono, and has is bit in depth");
+
+ }
+
+ // Perform scaling if asked for
+ if (do_dynamic_scaling)
+ {
+ cv::minMaxLoc(source->image, &min_image_value, &max_image_value);
+ if (min_image_value == max_image_value)
+ {
+ CvImagePtr result(new CvImage());
+ result->header = source->header;
+ result->encoding = encoding;
+ if (sensor_msgs::image_encodings::bitDepth(encoding) == 1)
+ {
+ result->image = cv::Mat(source->image.size(), CV_8UC1);
+ result->image.setTo(255./2.);
+ } else {
+ result->image = cv::Mat(source->image.size(), CV_8UC3);
+ result->image.setTo(cv::Scalar(1., 1., 1.)*255./2.);
+ }
+ return result;
+ }
+ }
+
+ if (min_image_value != max_image_value)
+ {
+ if (sensor_msgs::image_encodings::numChannels(source->encoding) != 1)
+ throw Exception("cv_bridge.cvtColorForDisplay() scaling for images with more than one channel is unsupported");
+ CvImagePtr img_scaled_8u(new CvImage());
+ img_scaled_8u->header = source->header;
+ img_scaled_8u->encoding = sensor_msgs::image_encodings::MONO8;
+ cv::Mat(source->image-min_image_value).convertTo(img_scaled_8u->image, CV_8UC1, 255.0 /
+ (max_image_value - min_image_value));
+ return cvtColor(img_scaled_8u, encoding);
+ }
+
+ // If no color conversion is possible, we must "guess" the input format
+ CvImagePtr source_typed(new CvImage());
+ source_typed->image = source->image;
+ source_typed->header = source->header;
+ source_typed->encoding = source->encoding;
+
+ // If we get the OpenCV format, if we have 1,3 or 4 channels, we are most likely in mono, BGR or BGRA modes
+ if (source->encoding == "CV_8UC1")
+ source_typed->encoding = sensor_msgs::image_encodings::MONO8;
+ else if (source->encoding == "16UC1")
+ source_typed->encoding = sensor_msgs::image_encodings::MONO16;
+ else if (source->encoding == "CV_8UC3")
+ source_typed->encoding = sensor_msgs::image_encodings::BGR8;
+ else if (source->encoding == "CV_8UC4")
+ source_typed->encoding = sensor_msgs::image_encodings::BGRA8;
+ else if (source->encoding == "CV_16UC3")
+ source_typed->encoding = sensor_msgs::image_encodings::BGR8;
+ else if (source->encoding == "CV_16UC4")
+ source_typed->encoding = sensor_msgs::image_encodings::BGRA8;
+
+ // If no conversion is needed, don't convert
+ if (source_typed->encoding == encoding)
+ return source;
+
+ try
+ {
+ // Now that the output is a proper color format, try to see if any conversion is possible
+ return cvtColor(source_typed, encoding);
+ }
+ catch (cv_bridge::Exception& e)
+ {
+ throw Exception("cv_bridge.cvtColorForDisplay() while trying to convert image from '" + source->encoding + "' to '" + encoding + "' an exception was thrown (" + e.what() + ")");
+ }
+}
+
} //namespace cv_bridge
diff --git a/cv_bridge/test/CMakeLists.txt b/cv_bridge/test/CMakeLists.txt
index 255dfad..612176c 100644
--- a/cv_bridge/test/CMakeLists.txt
+++ b/cv_bridge/test/CMakeLists.txt
@@ -1,5 +1,9 @@
# add the tests
-catkin_add_gtest(${PROJECT_NAME}-utest utest.cpp utest2.cpp)
+
+# add boost directories for now
+include_directories("../src")
+
+catkin_add_gtest(${PROJECT_NAME}-utest test_endian.cpp utest.cpp utest2.cpp)
target_link_libraries(${PROJECT_NAME}-utest
${PROJECT_NAME}
${OpenCV_LIBRARIES}
diff --git a/cv_bridge/test/test_endian.cpp b/cv_bridge/test/test_endian.cpp
new file mode 100644
index 0000000..58a1f50
--- /dev/null
+++ b/cv_bridge/test/test_endian.cpp
@@ -0,0 +1,38 @@
+#include "boost/endian/conversion.hpp"
+#include <boost/make_shared.hpp>
+#include <cv_bridge/cv_bridge.h>
+#include <gtest/gtest.h>
+
+TEST(CvBridgeTest, endianness)
+{
+ using namespace boost::endian;
+
+ // Create an image of the type opposite to the platform
+ sensor_msgs::Image msg;
+ msg.height = 1;
+ msg.width = 1;
+ msg.encoding = "32SC2";
+ msg.step = 8;
+
+ msg.data.resize(msg.step);
+ int32_t* data = reinterpret_cast<int32_t*>(&msg.data[0]);
+
+ // Write 1 and 2 in order, but with an endianness opposite to the platform
+ if (order::native == order::little)
+ {
+ msg.is_bigendian = true;
+ *(data++) = native_to_big(static_cast<int32_t>(1));
+ *data = native_to_big(static_cast<int32_t>(2));
+ } else {
+ msg.is_bigendian = false;
+ *(data++) = native_to_little(static_cast<int32_t>(1));
+ *data = native_to_little(static_cast<int32_t>(2));
+ }
+
+ // Make sure the values are still the same
+ cv_bridge::CvImageConstPtr img = cv_bridge::toCvShare(boost::make_shared<sensor_msgs::Image>(msg));
+ EXPECT_EQ(img->image.at<cv::Vec2i>(0, 0)[0], 1);
+ EXPECT_EQ(img->image.at<cv::Vec2i>(0, 0)[1], 2);
+ // Make sure we cannot share data
+ EXPECT_NE(img->image.data, &msg.data[0]);
+}
diff --git a/cv_bridge/test/utest.cpp b/cv_bridge/test/utest.cpp
index f1be20b..1d8255c 100644
--- a/cv_bridge/test/utest.cpp
+++ b/cv_bridge/test/utest.cpp
@@ -20,6 +20,30 @@ TEST(CvBridgeTest, NonContinuous)
EXPECT_EQ(msg->step, 6);
}
+TEST(CvBridgeTest, ChannelOrder)
+{
+ cv::Mat_<uint16_t> mat(200, 200);
+ mat.setTo(cv::Scalar(1000,0,0,0));
+ sensor_msgs::ImagePtr image(new sensor_msgs::Image());
+
+ image = cv_bridge::CvImage(image->header, sensor_msgs::image_encodings::MONO16, mat).toImageMsg();
+
+ cv_bridge::CvImageConstPtr cv_ptr = cv_bridge::toCvShare(image);
+
+ cv_bridge::CvImagePtr res = cv_bridge::cvtColor(cv_ptr, sensor_msgs::image_encodings::BGR8);
+ EXPECT_EQ(res->encoding, sensor_msgs::image_encodings::BGR8);
+ EXPECT_EQ(res->image.type(), cv_bridge::getCvType(res->encoding));
+ EXPECT_EQ(res->image.channels(), sensor_msgs::image_encodings::numChannels(res->encoding));
+ EXPECT_EQ(res->image.depth(), CV_8U);
+
+ // The matrix should be the following
+ cv::Mat_<cv::Vec3b> gt(200, 200);
+ gt.setTo(cv::Scalar(1, 1, 1)*1000.*255./65535.);
+
+ ASSERT_EQ(res->image.type(), gt.type());
+ EXPECT_EQ(cv::norm(res->image, gt, cv::NORM_INF), 0);
+}
+
TEST(CvBridgeTest, initialization)
{
sensor_msgs::Image image;
diff --git a/cv_bridge/test/utest2.cpp b/cv_bridge/test/utest2.cpp
index 421ba78..d41c976 100644
--- a/cv_bridge/test/utest2.cpp
+++ b/cv_bridge/test/utest2.cpp
@@ -76,7 +76,7 @@ TEST(OpencvTests, testCase_encode_decode)
bool is_src_color_format = isColor(src_encoding) || isMono(src_encoding) || (src_encoding == sensor_msgs::image_encodings::YUV422);
cv::Mat image_original(cv::Size(400, 400), cv_bridge::getCvType(src_encoding));
cv::RNG r(77);
- r.fill(image_original, cv::RNG::UNIFORM, 0, 255);
+ r.fill(image_original, cv::RNG::UNIFORM, 0, 127);
sensor_msgs::Image image_message;
cv_bridge::CvImage image_bridge(std_msgs::Header(), src_encoding, image_original);
@@ -132,11 +132,19 @@ TEST(OpencvTests, testCase_encode_decode)
}
// And convert back to a cv::Mat
image_back = cvtColor(cv_image, src_encoding)->image;
-
+
// If the number of channels,s different some information got lost at some point, so no possible test
if (!is_num_channels_the_same)
continue;
- EXPECT_LT(cv::norm(image_original, image_back)/image_original.cols/image_original.rows, 0.5) << "problem converting from " << src_encoding << " to " << dst_encoding << " and back.";
+ if (bitDepth(src_encoding) >= 32) {
+ // In the case where the input has floats, we will lose precision but no more than 1
+ EXPECT_LT(cv::norm(image_original, image_back, cv::NORM_INF), 1) << "problem converting from " << src_encoding << " to " << dst_encoding << " and back.";
+ } else if ((bitDepth(src_encoding) == 16) && (bitDepth(dst_encoding) == 8)) {
+ // In the case where the input has floats, we will lose precision but no more than 1 * max(127)
+ EXPECT_LT(cv::norm(image_original, image_back, cv::NORM_INF), 128) << "problem converting from " << src_encoding << " to " << dst_encoding << " and back.";
+ } else {
+ EXPECT_EQ(cv::norm(image_original, image_back, cv::NORM_INF), 0) << "problem converting from " << src_encoding << " to " << dst_encoding << " and back.";
+ }
}
}
}
diff --git a/image_geometry/CHANGELOG.rst b/image_geometry/CHANGELOG.rst
index cb11ccb..d59ed32 100644
--- a/image_geometry/CHANGELOG.rst
+++ b/image_geometry/CHANGELOG.rst
@@ -2,6 +2,12 @@
Changelog for package image_geometry
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+1.11.9 (2015-11-29)
+-------------------
+* add a condition if D=None
+* fix compilation warnings
+* Contributors: Vincent Rabaud, YuOhara
+
1.11.8 (2015-07-15)
-------------------
* fixes `#62 <https://github.com/ros-perception/vision_opencv/issues/62>`_, bug in Python rectifyPoint old opencv1 API
diff --git a/image_geometry/CMakeLists.txt b/image_geometry/CMakeLists.txt
index 8fee92a..3c9cb30 100644
--- a/image_geometry/CMakeLists.txt
+++ b/image_geometry/CMakeLists.txt
@@ -20,7 +20,7 @@ include_directories(include)
# add a library
add_library(${PROJECT_NAME} src/pinhole_camera_model.cpp src/stereo_camera_model.cpp)
target_link_libraries(${PROJECT_NAME} ${OpenCV_LIBRARIES})
-add_dependencies(${PROJECT_NAME} sensor_msgs_gencpp)
+add_dependencies(${PROJECT_NAME} ${catkin_EXPORTED_TARGETS})
install(DIRECTORY include/${PROJECT_NAME}/
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}/
diff --git a/image_geometry/package.xml b/image_geometry/package.xml
index be38bb5..b4912a0 100644
--- a/image_geometry/package.xml
+++ b/image_geometry/package.xml
@@ -1,6 +1,6 @@
<package>
<name>image_geometry</name>
- <version>1.11.8</version>
+ <version>1.11.9</version>
<description>
`image_geometry` contains C++ and Python libraries for interpreting images
geometrically. It interfaces the calibration parameters in sensor_msgs/CameraInfo
diff --git a/image_geometry/src/pinhole_camera_model.cpp b/image_geometry/src/pinhole_camera_model.cpp
index 7dbc780..ea1f940 100644
--- a/image_geometry/src/pinhole_camera_model.cpp
+++ b/image_geometry/src/pinhole_camera_model.cpp
@@ -127,7 +127,7 @@ bool PinholeCameraModel::fromCameraInfo(const sensor_msgs::CameraInfo& msg)
// Figure out how to handle the distortion
if (cam_info_.distortion_model == sensor_msgs::distortion_models::PLUMB_BOB ||
cam_info_.distortion_model == sensor_msgs::distortion_models::RATIONAL_POLYNOMIAL) {
- cache_->distortion_state = (cam_info_.D[0] == 0.0) ? NONE : CALIBRATED;
+ cache_->distortion_state = (cam_info_.D.size() == 0 || (cam_info_.D[0] == 0.0)) ? NONE : CALIBRATED;
}
else
cache_->distortion_state = UNKNOWN;
diff --git a/opencv_apps/CHANGELOG.rst b/opencv_apps/CHANGELOG.rst
index c14e140..160157c 100644
--- a/opencv_apps/CHANGELOG.rst
+++ b/opencv_apps/CHANGELOG.rst
@@ -2,6 +2,12 @@
Changelog for package opencv_apps
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+1.11.9 (2015-11-29)
+-------------------
+* Accept grayscale images as input as well
+* Add format enum for easy use and choose format.
+* Contributors: Felix Mauch, talregev
+
1.11.8 (2015-07-15)
-------------------
* simplify the OpenCV3 compatibility
diff --git a/opencv_apps/CMakeLists.txt b/opencv_apps/CMakeLists.txt
index 35cc61f..90d0262 100644
--- a/opencv_apps/CMakeLists.txt
+++ b/opencv_apps/CMakeLists.txt
@@ -102,6 +102,8 @@ add_library(${PROJECT_NAME} SHARED
# calibration_artificial.cpp
# calibration.cpp
src/nodelet/camshift_nodelet.cpp
+ src/nodelet/simple_example_nodelet.cpp
+ src/nodelet/simple_compressed_example_nodelet.cpp
# chamfer.cpp
# connected_components.cpp
# contours2.cpp
@@ -229,6 +231,14 @@ add_executable(camshift_exe src/node/camshift.cpp)
SET_TARGET_PROPERTIES(camshift_exe PROPERTIES OUTPUT_NAME camshift)
target_link_libraries(camshift_exe ${catkin_LIBRARIES} ${OpenCV_LIBRARIES})
+add_executable(simple_example_exe src/node/simple_example.cpp)
+SET_TARGET_PROPERTIES(simple_example_exe PROPERTIES OUTPUT_NAME simple_example)
+target_link_libraries(simple_example_exe ${catkin_LIBRARIES} ${OpenCV_LIBRARIES})
+
+add_executable(simple_compressed_example_exe src/node/simple_compressed_example.cpp)
+SET_TARGET_PROPERTIES(simple_compressed_example_exe PROPERTIES OUTPUT_NAME simple_compressed_example)
+target_link_libraries(simple_compressed_example_exe ${catkin_LIBRARIES} ${OpenCV_LIBRARIES})
+
add_executable(fback_flow_exe src/node/fback_flow.cpp)
SET_TARGET_PROPERTIES(fback_flow_exe PROPERTIES OUTPUT_NAME fback_flow)
target_link_libraries(fback_flow_exe ${catkin_LIBRARIES} ${OpenCV_LIBRARIES})
@@ -278,7 +288,7 @@ target_link_libraries(watershed_segmentation_exe ${catkin_LIBRARIES} ${OpenCV_LI
install(TARGETS edge_detection_exe hough_lines_exe hough_circles_exe face_detection_exe goodfeature_track_exe
- camshift_exe fback_flow_exe lk_flow_exe people_detect_exe phase_corr_exe segment_objects_exe watershed_segmentation_exe
+ camshift_exe simple_example_exe simple_compressed_example_exe fback_flow_exe lk_flow_exe people_detect_exe phase_corr_exe segment_objects_exe watershed_segmentation_exe
DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)
install(FILES nodelet_plugins.xml
diff --git a/opencv_apps/nodelet_plugins.xml b/opencv_apps/nodelet_plugins.xml
index d573fce..56203d6 100644
--- a/opencv_apps/nodelet_plugins.xml
+++ b/opencv_apps/nodelet_plugins.xml
@@ -63,6 +63,14 @@
<class name="simple_flow/simple_flow" type="simple_flow::SimpleFlowNodelet" base_class_type="nodelet::Nodelet">
<description>Nodelet of SimpleFlow optical flow algorithm</description>
</class>
+
+ <class name="simple_example/simple_example" type="simple_example::SimpleExampleNodelet" base_class_type="nodelet::Nodelet">
+ <description>Nodelet of Simple Example from wiki</description>
+ </class>
+
+ <class name="simple_compressed_example/simple_compressed_example" type="simple_compressed_example::SimpleCompressedExampleNodelet" base_class_type="nodelet::Nodelet">
+ <description>Nodelet of Simple Example from wiki</description>
+ </class>
<class name="watershed_segmentation/watershed_segmentation" type="watershed_segmentation::WatershedSegmentationNodelet" base_class_type="nodelet::Nodelet">
<description>Nodelet to demonstrate the famous watershed segmentation algorithm in OpenCV: watershed()</description>
diff --git a/opencv_apps/package.xml b/opencv_apps/package.xml
index e6341a8..efd8c45 100644
--- a/opencv_apps/package.xml
+++ b/opencv_apps/package.xml
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<package>
<name>opencv_apps</name>
- <version>1.11.8</version>
+ <version>1.11.9</version>
<description>The opencv_apps package, most of code is taken from https://github.com/Itseez/opencv/tree/master/samples/cpp</description>
<maintainer email="kei.okada at gmail.com">Kei Okada</maintainer>
diff --git a/opencv_apps/src/node/simple_compressed_example.cpp b/opencv_apps/src/node/simple_compressed_example.cpp
new file mode 100644
index 0000000..417001d
--- /dev/null
+++ b/opencv_apps/src/node/simple_compressed_example.cpp
@@ -0,0 +1,55 @@
+/*********************************************************************
+* Software License Agreement (BSD License)
+*
+* Copyright (c) 2015, Tal Regev.
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions
+* are met:
+*
+* * Redistributions of source code must retain the above copyright
+* notice, this list of conditions and the following disclaimer.
+* * Redistributions in binary form must reproduce the above
+* copyright notice, this list of conditions and the following
+* disclaimer in the documentation and/or other materials provided
+* with the distribution.
+* * Neither the name of the Kei Okada nor the names of its
+* contributors may be used to endorse or promote products derived
+* from this software without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+* POSSIBILITY OF SUCH DAMAGE.
+*********************************************************************/
+
+#include <ros/ros.h>
+#include <nodelet/loader.h>
+
+int main(int argc, char **argv)
+{
+ ros::init(argc, argv, "simple_compressed_example", ros::init_options::AnonymousName);
+ if (ros::names::remap("image") == "image") {
+ ROS_WARN("Topic 'image' has not been remapped! Typical command-line usage:\n"
+ "\t$ rosrun image_rotate image_rotate image:=<image topic> [transport]");
+ }
+
+ nodelet::Loader manager(false);
+ nodelet::M_string remappings;
+ nodelet::V_string my_argv(argv + 1, argv + argc);
+ my_argv.push_back("--shutdown-on-close"); // Internal
+
+ manager.load(ros::this_node::getName(), "simple_compressed_example/simple_compressed_example", remappings, my_argv);
+
+ ros::spin();
+ return 0;
+}
diff --git a/opencv_apps/src/node/simple_example.cpp b/opencv_apps/src/node/simple_example.cpp
new file mode 100644
index 0000000..a483c40
--- /dev/null
+++ b/opencv_apps/src/node/simple_example.cpp
@@ -0,0 +1,55 @@
+/*********************************************************************
+* Software License Agreement (BSD License)
+*
+* Copyright (c) 2015, Tal Regev.
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions
+* are met:
+*
+* * Redistributions of source code must retain the above copyright
+* notice, this list of conditions and the following disclaimer.
+* * Redistributions in binary form must reproduce the above
+* copyright notice, this list of conditions and the following
+* disclaimer in the documentation and/or other materials provided
+* with the distribution.
+* * Neither the name of the Kei Okada nor the names of its
+* contributors may be used to endorse or promote products derived
+* from this software without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+* POSSIBILITY OF SUCH DAMAGE.
+*********************************************************************/
+
+#include <ros/ros.h>
+#include <nodelet/loader.h>
+
+int main(int argc, char **argv)
+{
+ ros::init(argc, argv, "simple_example", ros::init_options::AnonymousName);
+ if (ros::names::remap("image") == "image") {
+ ROS_WARN("Topic 'image' has not been remapped! Typical command-line usage:\n"
+ "\t$ rosrun image_rotate image_rotate image:=<image topic> [transport]");
+ }
+
+ nodelet::Loader manager(false);
+ nodelet::M_string remappings;
+ nodelet::V_string my_argv(argv + 1, argv + argc);
+ my_argv.push_back("--shutdown-on-close"); // Internal
+
+ manager.load(ros::this_node::getName(), "simple_example/simple_example", remappings, my_argv);
+
+ ros::spin();
+ return 0;
+}
diff --git a/opencv_apps/src/nodelet/contour_moments_nodelet.cpp b/opencv_apps/src/nodelet/contour_moments_nodelet.cpp
index 129bb83..5084bc3 100644
--- a/opencv_apps/src/nodelet/contour_moments_nodelet.cpp
+++ b/opencv_apps/src/nodelet/contour_moments_nodelet.cpp
@@ -3,11 +3,11 @@
*
* Copyright (c) 2014, Kei Okada.
* All rights reserved.
-*
+*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
-*
+*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
@@ -17,7 +17,7 @@
* * Neither the name of the Kei Okada nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
-*
+*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -99,7 +99,7 @@ class ContourMomentsNodelet : public nodelet::Nodelet
{
do_work(msg, cam_info->header.frame_id);
}
-
+
void imageCallback(const sensor_msgs::ImageConstPtr& msg)
{
do_work(msg, msg->header.frame_id);
@@ -125,7 +125,11 @@ class ContourMomentsNodelet : public nodelet::Nodelet
// Do the work
cv::Mat src_gray;
/// Convert image to gray and blur it
- cv::cvtColor( frame, src_gray, cv::COLOR_BGR2GRAY );
+ if ( frame.channels() > 1 ) {
+ cv::cvtColor( frame, src_gray, cv::COLOR_BGR2GRAY );
+ } else {
+ src_gray = frame;
+ }
cv::blur( src_gray, src_gray, cv::Size(3,3) );
/// Create window
@@ -170,7 +174,7 @@ class ContourMomentsNodelet : public nodelet::Nodelet
cv::Scalar color = cv::Scalar( rng.uniform(0, 255), rng.uniform(0,255), rng.uniform(0,255) );
cv::drawContours( drawing, contours, (int)i, color, 2, 8, hierarchy, 0, cv::Point() );
cv::circle( drawing, mc[i], 4, color, -1, 8, 0 );
-
+
opencv_apps::Moment moment_msg;
moment_msg.m00 = mu[i].m00;
moment_msg.m10 = mu[i].m10;
@@ -289,7 +293,7 @@ public:
ros::SubscriberStatusCallback msg_disconnect_cb = boost::bind(&ContourMomentsNodelet::msg_disconnectCb, this, _1);
img_pub_ = image_transport::ImageTransport(local_nh_).advertise("image", 1, img_connect_cb, img_disconnect_cb);
msg_pub_ = local_nh_.advertise<opencv_apps::MomentArrayStamped>("moments", 1, msg_connect_cb, msg_disconnect_cb);
-
+
if( debug_view_ ) {
subscriber_count_++;
}
diff --git a/opencv_apps/src/nodelet/convex_hull_nodelet.cpp b/opencv_apps/src/nodelet/convex_hull_nodelet.cpp
index e8964ed..6f1408d 100644
--- a/opencv_apps/src/nodelet/convex_hull_nodelet.cpp
+++ b/opencv_apps/src/nodelet/convex_hull_nodelet.cpp
@@ -3,11 +3,11 @@
*
* Copyright (c) 2014, Kei Okada.
* All rights reserved.
-*
+*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
-*
+*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
@@ -17,7 +17,7 @@
* * Neither the name of the Kei Okada nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
-*
+*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -99,7 +99,7 @@ class ConvexHullNodelet : public nodelet::Nodelet
{
do_work(msg, cam_info->header.frame_id);
}
-
+
void imageCallback(const sensor_msgs::ImageConstPtr& msg)
{
do_work(msg, msg->header.frame_id);
@@ -126,7 +126,11 @@ class ConvexHullNodelet : public nodelet::Nodelet
cv::Mat src_gray;
/// Convert image to gray and blur it
- cv::cvtColor( frame, src_gray, cv::COLOR_RGB2GRAY );
+ if ( frame.channels() > 1 ) {
+ cv::cvtColor( frame, src_gray, cv::COLOR_RGB2GRAY );
+ } else {
+ src_gray = frame;
+ }
cv::blur( src_gray, src_gray, cv::Size(3,3) );
/// Create window
@@ -150,7 +154,7 @@ class ConvexHullNodelet : public nodelet::Nodelet
std::vector<std::vector<cv::Point> >hull( contours.size() );
for( size_t i = 0; i < contours.size(); i++ )
{ cv::convexHull( cv::Mat(contours[i]), hull[i], false ); }
-
+
/// Draw contours + hull results
cv::Mat drawing = cv::Mat::zeros( threshold_output.size(), CV_8UC3 );
for( size_t i = 0; i< contours.size(); i++ )
@@ -261,7 +265,7 @@ public:
ros::SubscriberStatusCallback msg_disconnect_cb = boost::bind(&ConvexHullNodelet::msg_disconnectCb, this, _1);
img_pub_ = image_transport::ImageTransport(local_nh_).advertise("image", 1, img_connect_cb, img_disconnect_cb);
msg_pub_ = local_nh_.advertise<opencv_apps::ContourArrayStamped>("hulls", 1, msg_connect_cb, msg_disconnect_cb);
-
+
if( debug_view_ ) {
subscriber_count_++;
}
diff --git a/opencv_apps/src/nodelet/edge_detection_nodelet.cpp b/opencv_apps/src/nodelet/edge_detection_nodelet.cpp
index c293298..0179183 100644
--- a/opencv_apps/src/nodelet/edge_detection_nodelet.cpp
+++ b/opencv_apps/src/nodelet/edge_detection_nodelet.cpp
@@ -3,11 +3,11 @@
*
* Copyright (c) 2014, Kei Okada.
* All rights reserved.
-*
+*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
-*
+*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
@@ -17,7 +17,7 @@
* * Neither the name of the Kei Okada nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
-*
+*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -106,7 +106,7 @@ class EdgeDetectionNodelet : public nodelet::Nodelet
{
do_work(msg, cam_info->header.frame_id);
}
-
+
void imageCallback(const sensor_msgs::ImageConstPtr& msg)
{
do_work(msg, msg->header.frame_id);
@@ -130,8 +130,12 @@ class EdgeDetectionNodelet : public nodelet::Nodelet
cv::GaussianBlur( frame, frame, cv::Size(3,3), 0, 0, cv::BORDER_DEFAULT );
/// Convert it to gray
- cv::cvtColor( frame, src_gray, cv::COLOR_RGB2GRAY );
-
+ if ( frame.channels() > 1 ) {
+ cv::cvtColor( frame, src_gray, cv::COLOR_RGB2GRAY );
+ } else {
+ src_gray = frame;
+ }
+
/// Create window
if( debug_view_) {
cv::namedWindow( window_name_, cv::WINDOW_AUTOSIZE );
@@ -149,7 +153,7 @@ class EdgeDetectionNodelet : public nodelet::Nodelet
int scale = 1;
int delta = 0;
int ddepth = CV_16S;
-
+
/// Gradient X
//Scharr( src_gray, grad_x, ddepth, 1, 0, scale, delta, BORDER_DEFAULT );
cv::Sobel( src_gray, grad_x, ddepth, 1, 0, 3, scale, delta, cv::BORDER_DEFAULT );
@@ -174,7 +178,7 @@ class EdgeDetectionNodelet : public nodelet::Nodelet
int delta = 0;
int ddepth = CV_16S;
/// Apply Laplace function
-
+
cv::Laplacian( src_gray, dst, ddepth, kernel_size, scale, delta, cv::BORDER_DEFAULT );
convertScaleAbs( dst, grad );
@@ -196,7 +200,7 @@ class EdgeDetectionNodelet : public nodelet::Nodelet
cv::Canny( grad, grad, low_threshold_, low_threshold_*ratio, kernel_size );
new_window_name = "Canny Edge Detection Demo";
-
+
/// Create a Trackbar for user to enter threshold
if( debug_view_) {
if (need_config_update_) {
@@ -300,7 +304,7 @@ public:
ros::SubscriberStatusCallback msg_disconnect_cb = boost::bind(&EdgeDetectionNodelet::msg_disconnectCb, this, _1);
img_pub_ = image_transport::ImageTransport(local_nh_).advertise("image", 1, img_connect_cb, img_disconnect_cb);
//msg_pub_ = local_nh_.advertise<opencv_apps::LineArrayStamped>("lines", 1, msg_connect_cb, msg_disconnect_cb);
-
+
if( debug_view_ ) {
subscriber_count_++;
}
diff --git a/opencv_apps/src/nodelet/face_detection_nodelet.cpp b/opencv_apps/src/nodelet/face_detection_nodelet.cpp
index 6b40e8e..a81197c 100644
--- a/opencv_apps/src/nodelet/face_detection_nodelet.cpp
+++ b/opencv_apps/src/nodelet/face_detection_nodelet.cpp
@@ -3,11 +3,11 @@
*
* Copyright (c) 2014, Kei Okada.
* All rights reserved.
-*
+*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
-*
+*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
@@ -17,7 +17,7 @@
* * Neither the name of the Kei Okada nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
-*
+*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -96,7 +96,7 @@ class FaceDetectionNodelet : public nodelet::Nodelet
{
do_work(msg, cam_info->header.frame_id);
}
-
+
void imageCallback(const sensor_msgs::ImageConstPtr& msg)
{
do_work(msg, msg->header.frame_id);
@@ -118,7 +118,11 @@ class FaceDetectionNodelet : public nodelet::Nodelet
std::vector<cv::Rect> faces;
cv::Mat frame_gray;
- cv::cvtColor( frame, frame_gray, cv::COLOR_BGR2GRAY );
+ if ( frame.channels() > 1 ) {
+ cv::cvtColor( frame, frame_gray, cv::COLOR_BGR2GRAY );
+ } else {
+ frame_gray = frame;
+ }
cv::equalizeHist( frame_gray, frame_gray );
//-- Detect faces
#ifndef CV_VERSION_EPOCH
@@ -245,14 +249,14 @@ public:
ros::SubscriberStatusCallback msg_disconnect_cb = boost::bind(&FaceDetectionNodelet::msg_disconnectCb, this, _1);
img_pub_ = image_transport::ImageTransport(local_nh_).advertise("image", 1, img_connect_cb, img_disconnect_cb);
msg_pub_ = local_nh_.advertise<opencv_apps::FaceArrayStamped>("faces", 1, msg_connect_cb, msg_disconnect_cb);
-
+
if( debug_view_ ) {
subscriber_count_++;
}
std::string face_cascade_name, eyes_cascade_name;
local_nh_.param("face_cascade_name", face_cascade_name, std::string("/usr/share/opencv/haarcascades/haarcascade_frontalface_alt.xml"));
local_nh_.param("eyes_cascade_name", eyes_cascade_name, std::string("/usr/share/opencv/haarcascades/haarcascade_eye_tree_eyeglasses.xml"));
-
+
if( !face_cascade_.load( face_cascade_name ) ){ NODELET_ERROR("--Error loading %s", face_cascade_name.c_str()); };
if( !eyes_cascade_.load( eyes_cascade_name ) ){ NODELET_ERROR("--Error loading %s", eyes_cascade_name.c_str()); };
diff --git a/opencv_apps/src/nodelet/fback_flow_nodelet.cpp b/opencv_apps/src/nodelet/fback_flow_nodelet.cpp
index 3622535..cdad8c2 100644
--- a/opencv_apps/src/nodelet/fback_flow_nodelet.cpp
+++ b/opencv_apps/src/nodelet/fback_flow_nodelet.cpp
@@ -3,11 +3,11 @@
*
* Copyright (c) 2014, Kei Okada.
* All rights reserved.
-*
+*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
-*
+*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
@@ -17,7 +17,7 @@
* * Neither the name of the Kei Okada nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
-*
+*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -95,7 +95,7 @@ class FBackFlowNodelet : public nodelet::Nodelet
{
do_work(msg, cam_info->header.frame_id);
}
-
+
void imageCallback(const sensor_msgs::ImageConstPtr& msg)
{
do_work(msg, msg->header.frame_id);
@@ -127,7 +127,11 @@ class FBackFlowNodelet : public nodelet::Nodelet
}
// Do the work
- cv::cvtColor( frame, gray, cv::COLOR_BGR2GRAY );
+ if ( frame.channels() > 1 ) {
+ cv::cvtColor( frame, gray, cv::COLOR_BGR2GRAY );
+ } else {
+ gray = frame;
+ }
if( prevgray.data )
{
cv::calcOpticalFlowFarneback(prevgray, gray, flow, 0.5, 3, 15, 3, 5, 1.2, 0);
@@ -243,7 +247,7 @@ public:
ros::SubscriberStatusCallback msg_disconnect_cb = boost::bind(&FBackFlowNodelet::msg_disconnectCb, this, _1);
img_pub_ = image_transport::ImageTransport(local_nh_).advertise("image", 1, img_connect_cb, img_disconnect_cb);
msg_pub_ = local_nh_.advertise<opencv_apps::FlowArrayStamped>("flows", 1, msg_connect_cb, msg_disconnect_cb);
-
+
if( debug_view_ ) {
subscriber_count_++;
}
diff --git a/opencv_apps/src/nodelet/find_contours_nodelet.cpp b/opencv_apps/src/nodelet/find_contours_nodelet.cpp
index 537b847..dd1398a 100644
--- a/opencv_apps/src/nodelet/find_contours_nodelet.cpp
+++ b/opencv_apps/src/nodelet/find_contours_nodelet.cpp
@@ -126,9 +126,13 @@ class FindContoursNodelet : public nodelet::Nodelet
cv::Mat src_gray;
/// Convert it to gray
- cv::cvtColor( frame, src_gray, cv::COLOR_RGB2GRAY );
+ if ( frame.channels() > 1 ) {
+ cv::cvtColor( frame, src_gray, cv::COLOR_RGB2GRAY );
+ } else {
+ src_gray = frame;
+ }
cv::GaussianBlur( src_gray, src_gray, cv::Size(3,3), 0, 0, cv::BORDER_DEFAULT );
-
+
/// Create window
if( debug_view_) {
cv::namedWindow( window_name_, cv::WINDOW_AUTOSIZE );
diff --git a/opencv_apps/src/nodelet/general_contours_nodelet.cpp b/opencv_apps/src/nodelet/general_contours_nodelet.cpp
index 55316ab..46e8a86 100644
--- a/opencv_apps/src/nodelet/general_contours_nodelet.cpp
+++ b/opencv_apps/src/nodelet/general_contours_nodelet.cpp
@@ -3,11 +3,11 @@
*
* Copyright (c) 2014, Kei Okada.
* All rights reserved.
-*
+*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
-*
+*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
@@ -17,7 +17,7 @@
* * Neither the name of the Kei Okada nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
-*
+*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -99,7 +99,7 @@ class GeneralContoursNodelet : public nodelet::Nodelet
{
do_work(msg, cam_info->header.frame_id);
}
-
+
void imageCallback(const sensor_msgs::ImageConstPtr& msg)
{
do_work(msg, msg->header.frame_id);
@@ -127,7 +127,11 @@ class GeneralContoursNodelet : public nodelet::Nodelet
cv::Mat src_gray;
/// Convert image to gray and blur it
- cv::cvtColor( frame, src_gray, cv::COLOR_RGB2GRAY );
+ if ( frame.channels() > 1 ) {
+ cv::cvtColor( frame, src_gray, cv::COLOR_RGB2GRAY );
+ } else {
+ src_gray = frame;
+ }
cv::blur( src_gray, src_gray, cv::Size(3,3) );
/// Create window
@@ -279,7 +283,7 @@ public:
local_nh_.param("debug_view", debug_view_, false);
subscriber_count_ = 0;
prev_stamp_ = ros::Time(0, 0);
-
+
window_name_ = "Contours";
threshold_ = 100;
@@ -290,7 +294,7 @@ public:
img_pub_ = image_transport::ImageTransport(local_nh_).advertise("image", 1, img_connect_cb, img_disconnect_cb);
rects_pub_ = local_nh_.advertise<opencv_apps::RotatedRectArrayStamped>("rectangles", 1, msg_connect_cb, msg_disconnect_cb);
ellipses_pub_ = local_nh_.advertise<opencv_apps::RotatedRectArrayStamped>("ellipses", 1, msg_connect_cb, msg_disconnect_cb);
-
+
if( debug_view_ ) {
subscriber_count_++;
}
diff --git a/opencv_apps/src/nodelet/goodfeature_track_nodelet.cpp b/opencv_apps/src/nodelet/goodfeature_track_nodelet.cpp
index e1128ed..c6d505c 100644
--- a/opencv_apps/src/nodelet/goodfeature_track_nodelet.cpp
+++ b/opencv_apps/src/nodelet/goodfeature_track_nodelet.cpp
@@ -3,11 +3,11 @@
*
* Copyright (c) 2014, Kei Okada.
* All rights reserved.
-*
+*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
-*
+*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
@@ -17,7 +17,7 @@
* * Neither the name of the Kei Okada nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
-*
+*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -95,7 +95,7 @@ class GoodfeatureTrackNodelet : public nodelet::Nodelet
{
do_work(msg, cam_info->header.frame_id);
}
-
+
void imageCallback(const sensor_msgs::ImageConstPtr& msg)
{
do_work(msg, msg->header.frame_id);
@@ -122,7 +122,11 @@ class GoodfeatureTrackNodelet : public nodelet::Nodelet
cv::Mat src_gray;
int maxTrackbar = 100;
- cv::cvtColor( frame, src_gray, cv::COLOR_BGR2GRAY );
+ if ( frame.channels() > 1 ) {
+ cv::cvtColor( frame, src_gray, cv::COLOR_BGR2GRAY );
+ } else {
+ src_gray = frame;
+ }
if( debug_view_) {
/// Create Trackbars for Thresholds
@@ -251,7 +255,7 @@ public:
ros::SubscriberStatusCallback msg_disconnect_cb = boost::bind(&GoodfeatureTrackNodelet::msg_disconnectCb, this, _1);
img_pub_ = image_transport::ImageTransport(local_nh_).advertise("image", 1, img_connect_cb, img_disconnect_cb);
//msg_pub_ = local_nh_.advertise<opencv_apps::LineArrayStamped>("lines", 1, msg_connect_cb, msg_disconnect_cb);
-
+
if( debug_view_ ) {
subscriber_count_++;
}
diff --git a/opencv_apps/src/nodelet/hough_circles_nodelet.cpp b/opencv_apps/src/nodelet/hough_circles_nodelet.cpp
index ceee402..99becfa 100644
--- a/opencv_apps/src/nodelet/hough_circles_nodelet.cpp
+++ b/opencv_apps/src/nodelet/hough_circles_nodelet.cpp
@@ -3,11 +3,11 @@
*
* Copyright (c) 2014, Kei Okada.
* All rights reserved.
-*
+*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
-*
+*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
@@ -17,7 +17,7 @@
* * Neither the name of the Kei Okada nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
-*
+*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -81,7 +81,7 @@ class HoughCirclesNodelet : public nodelet::Nodelet
int max_canny_threshold_;
int canny_threshold_;
int accumulator_threshold_;
-
+
void reconfigureCallback(hough_circles::HoughCirclesConfig &new_config, uint32_t level)
{
@@ -106,7 +106,7 @@ class HoughCirclesNodelet : public nodelet::Nodelet
{
do_work(msg, cam_info->header.frame_id);
}
-
+
void imageCallback(const sensor_msgs::ImageConstPtr& msg)
{
do_work(msg, msg->header.frame_id);
@@ -133,7 +133,11 @@ class HoughCirclesNodelet : public nodelet::Nodelet
std::vector<cv::Rect> faces;
cv::Mat src_gray, edges;
- cv::cvtColor( frame, src_gray, cv::COLOR_BGR2GRAY );
+ if ( frame.channels() > 1 ) {
+ cv::cvtColor( frame, src_gray, cv::COLOR_BGR2GRAY );
+ } else {
+ src_gray = frame;
+ }
// Reduce the noise so we avoid false circle detection
cv::GaussianBlur( src_gray, src_gray, cv::Size(9, 9), 2, 2 );
@@ -174,7 +178,7 @@ class HoughCirclesNodelet : public nodelet::Nodelet
circle( frame, center, 3, cv::Scalar(0,255,0), -1, 8, 0 );
// circle outline
circle( frame, center, radius, cv::Scalar(0,0,255), 3, 8, 0 );
-
+
opencv_apps::Circle circle_msg;
circle_msg.center.x = center.x;
circle_msg.center.y = center.y;
@@ -274,7 +278,7 @@ public:
ros::SubscriberStatusCallback msg_disconnect_cb = boost::bind(&HoughCirclesNodelet::msg_disconnectCb, this, _1);
img_pub_ = image_transport::ImageTransport(local_nh_).advertise("image", 1, img_connect_cb, img_disconnect_cb);
msg_pub_ = local_nh_.advertise<opencv_apps::CircleArrayStamped>("circles", 1, msg_connect_cb, msg_disconnect_cb);
-
+
if( debug_view_ ) {
subscriber_count_++;
}
diff --git a/opencv_apps/src/nodelet/hough_lines_nodelet.cpp b/opencv_apps/src/nodelet/hough_lines_nodelet.cpp
index 9fed2a8..2c5f437 100644
--- a/opencv_apps/src/nodelet/hough_lines_nodelet.cpp
+++ b/opencv_apps/src/nodelet/hough_lines_nodelet.cpp
@@ -3,11 +3,11 @@
*
* Copyright (c) 2014, Kei Okada.
* All rights reserved.
-*
+*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
-*
+*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
@@ -17,7 +17,7 @@
* * Neither the name of the Kei Okada nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
-*
+*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -100,7 +100,7 @@ class HoughLinesNodelet : public nodelet::Nodelet
{
do_work(msg, cam_info->header.frame_id);
}
-
+
void imageCallback(const sensor_msgs::ImageConstPtr& msg)
{
do_work(msg, msg->header.frame_id);
@@ -127,7 +127,11 @@ class HoughLinesNodelet : public nodelet::Nodelet
std::vector<cv::Rect> faces;
cv::Mat src_gray, edges;
- cv::cvtColor( frame, src_gray, cv::COLOR_BGR2GRAY );
+ if ( frame.channels() > 1 ) {
+ cv::cvtColor( frame, src_gray, cv::COLOR_BGR2GRAY );
+ } else {
+ src_gray = frame;
+ }
/// Apply Canny edge detector
Canny( src_gray, edges, 50, 200, 3 );
@@ -163,7 +167,7 @@ class HoughLinesNodelet : public nodelet::Nodelet
double cos_t = cos(t), sin_t = sin(t);
double x0 = r*cos_t, y0 = r*sin_t;
double alpha = 1000;
-
+
cv::Point pt1( cvRound(x0 + alpha*(-sin_t)), cvRound(y0 + alpha*cos_t) );
cv::Point pt2( cvRound(x0 - alpha*(-sin_t)), cvRound(y0 - alpha*cos_t) );
#ifndef CV_VERSION_EPOCH
@@ -297,7 +301,7 @@ public:
ros::SubscriberStatusCallback msg_disconnect_cb = boost::bind(&HoughLinesNodelet::msg_disconnectCb, this, _1);
img_pub_ = image_transport::ImageTransport(local_nh_).advertise("image", 1, img_connect_cb, img_disconnect_cb);
msg_pub_ = local_nh_.advertise<opencv_apps::LineArrayStamped>("lines", 1, msg_connect_cb, msg_disconnect_cb);
-
+
if( debug_view_ ) {
subscriber_count_++;
}
diff --git a/opencv_apps/src/nodelet/lk_flow_nodelet.cpp b/opencv_apps/src/nodelet/lk_flow_nodelet.cpp
index 551c83e..b759c71 100644
--- a/opencv_apps/src/nodelet/lk_flow_nodelet.cpp
+++ b/opencv_apps/src/nodelet/lk_flow_nodelet.cpp
@@ -3,11 +3,11 @@
*
* Copyright (c) 2014, Kei Okada.
* All rights reserved.
-*
+*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
-*
+*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
@@ -17,7 +17,7 @@
* * Neither the name of the Kei Okada nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
-*
+*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -104,7 +104,7 @@ class LKFlowNodelet : public nodelet::Nodelet
{
do_work(msg, cam_info->header.frame_id);
}
-
+
void imageCallback(const sensor_msgs::ImageConstPtr& msg)
{
do_work(msg, msg->header.frame_id);
@@ -150,7 +150,11 @@ class LKFlowNodelet : public nodelet::Nodelet
cv::TermCriteria termcrit(cv::TermCriteria::MAX_ITER + cv::TermCriteria::EPS, 20, 0.03);
cv::Size subPixWinSize(10,10), winSize(31,31);
- cv::cvtColor(image, gray, cv::COLOR_BGR2GRAY);
+ if ( image.channels() > 1 ) {
+ cv::cvtColor( image, gray, cv::COLOR_BGR2GRAY );
+ } else {
+ gray = image;
+ }
if( nightMode )
image = cv::Scalar::all(0);
@@ -338,7 +342,7 @@ public:
initialize_points_service_ = local_nh_.advertiseService("initialize_points", &LKFlowNodelet::initialize_points_cb, this);
delete_points_service_ = local_nh_.advertiseService("delete_points", &LKFlowNodelet::delete_points_cb, this);
toggle_night_mode_service_ = local_nh_.advertiseService("toggle_night_mode", &LKFlowNodelet::toggle_night_mode_cb, this);
-
+
if( debug_view_ ) {
subscriber_count_++;
}
diff --git a/opencv_apps/src/nodelet/phase_corr_nodelet.cpp b/opencv_apps/src/nodelet/phase_corr_nodelet.cpp
index c6c24cd..fef1d32 100644
--- a/opencv_apps/src/nodelet/phase_corr_nodelet.cpp
+++ b/opencv_apps/src/nodelet/phase_corr_nodelet.cpp
@@ -3,11 +3,11 @@
*
* Copyright (c) 2014, Kei Okada.
* All rights reserved.
-*
+*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
-*
+*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
@@ -17,7 +17,7 @@
* * Neither the name of the Kei Okada nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
-*
+*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -95,7 +95,7 @@ class PhaseCorrNodelet : public nodelet::Nodelet
{
do_work(msg, cam_info->header.frame_id);
}
-
+
void imageCallback(const sensor_msgs::ImageConstPtr& msg)
{
do_work(msg, msg->header.frame_id);
@@ -119,8 +119,12 @@ class PhaseCorrNodelet : public nodelet::Nodelet
shift_msg.header = msg->header;
// Do the work
- cv::cvtColor(frame, curr, cv::COLOR_RGB2GRAY);
-
+ if ( frame.channels() > 1 ) {
+ cv::cvtColor( frame, curr, cv::COLOR_RGB2GRAY );
+ } else {
+ curr = frame;
+ }
+
if( debug_view_) {
cv::namedWindow( window_name_, cv::WINDOW_AUTOSIZE );
if (need_config_update_) {
@@ -245,7 +249,7 @@ public:
ros::SubscriberStatusCallback msg_disconnect_cb = boost::bind(&PhaseCorrNodelet::msg_disconnectCb, this, _1);
img_pub_ = image_transport::ImageTransport(local_nh_).advertise("image", 1, img_connect_cb, img_disconnect_cb);
msg_pub_ = local_nh_.advertise<opencv_apps::Point2DStamped>("shift", 1, msg_connect_cb, msg_disconnect_cb);
-
+
if( debug_view_ ) {
subscriber_count_++;
}
diff --git a/opencv_apps/src/nodelet/simple_compressed_example_nodelet.cpp b/opencv_apps/src/nodelet/simple_compressed_example_nodelet.cpp
new file mode 100644
index 0000000..85ec9fa
--- /dev/null
+++ b/opencv_apps/src/nodelet/simple_compressed_example_nodelet.cpp
@@ -0,0 +1,121 @@
+/*********************************************************************
+* Software License Agreement (BSD License)
+*
+* Copyright (c) 2015, Tal Regev.
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions
+* are met:
+*
+* * Redistributions of source code must retain the above copyright
+* notice, this list of conditions and the following disclaimer.
+* * Redistributions in binary form must reproduce the above
+* copyright notice, this list of conditions and the following
+* disclaimer in the documentation and/or other materials provided
+* with the distribution.
+* * Neither the name of the Kei Okada nor the names of its
+* contributors may be used to endorse or promote products derived
+* from this software without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+* POSSIBILITY OF SUCH DAMAGE.
+*********************************************************************/
+
+//http://wiki.ros.org/cv_bridge/Tutorials/UsingCvBridgeToConvertBetweenROSImagesAndOpenCVImages
+/**
+ * This is a demo of Simple Example from wiki tutorial
+ */
+
+#include <ros/ros.h>
+#include <sensor_msgs/image_encodings.h>
+#include <nodelet/nodelet.h>
+#include <image_transport/image_transport.h>
+#include <cv_bridge/cv_bridge.h>
+
+#include <opencv2/highgui/highgui.hpp>
+#include <opencv2/imgproc/imgproc.hpp>
+
+
+#include <dynamic_reconfigure/server.h>
+
+
+namespace simple_compressed_example {
+
+static const std::string OPENCV_WINDOW = "Image window";
+
+class ImageConverter
+{
+ ros::NodeHandle nh_;
+ ros::Subscriber image_sub_;
+ ros::Publisher image_pub_;
+
+public:
+ ImageConverter()
+ {
+ // Subscrive to input video feed and publish output video feed
+ image_sub_ = nh_.subscribe("image/compressed", 1,
+ &ImageConverter::imageCb,this);
+ image_pub_ = nh_.advertise<sensor_msgs::CompressedImage>("/image_converter/output_video/compressed", 1);
+
+ cv::namedWindow(OPENCV_WINDOW);
+ }
+
+ ~ImageConverter()
+ {
+ cv::destroyWindow(OPENCV_WINDOW);
+ }
+
+ void imageCb(const sensor_msgs::CompressedImageConstPtr& msg)
+ {
+ cv_bridge::CvImagePtr cv_ptr;
+ try
+ {
+ cv_ptr = cv_bridge::toCvCopy(msg, sensor_msgs::image_encodings::BGR8);
+ }
+ catch (cv_bridge::Exception& e)
+ {
+ ROS_ERROR("cv_bridge exception: %s", e.what());
+ return;
+ }
+
+ // Draw an example circle on the video stream
+ if (cv_ptr->image.rows > 110 && cv_ptr->image.cols > 110)
+ cv::circle(cv_ptr->image, cv::Point(cv_ptr->image.cols/2, cv_ptr->image.rows/2), 100, CV_RGB(255,0,0));
+
+ // Update GUI Window
+ cv::imshow(OPENCV_WINDOW, cv_ptr->image);
+ cv::waitKey(3);
+
+ // Output modified video stream
+ image_pub_.publish(cv_ptr->toCompressedImageMsg());
+ }
+};
+
+
+class SimpleCompressedExampleNodelet : public nodelet::Nodelet
+{
+
+
+public:
+ virtual void onInit()
+ {
+ simple_compressed_example::ImageConverter ic;
+ ros::spin();
+ }
+};
+
+}
+
+#include <pluginlib/class_list_macros.h>
+PLUGINLIB_EXPORT_CLASS(simple_compressed_example::SimpleCompressedExampleNodelet, nodelet::Nodelet);
diff --git a/opencv_apps/src/nodelet/simple_example_nodelet.cpp b/opencv_apps/src/nodelet/simple_example_nodelet.cpp
new file mode 100644
index 0000000..85f120d
--- /dev/null
+++ b/opencv_apps/src/nodelet/simple_example_nodelet.cpp
@@ -0,0 +1,122 @@
+/*********************************************************************
+* Software License Agreement (BSD License)
+*
+* Copyright (c) 2015, Tal Regev.
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions
+* are met:
+*
+* * Redistributions of source code must retain the above copyright
+* notice, this list of conditions and the following disclaimer.
+* * Redistributions in binary form must reproduce the above
+* copyright notice, this list of conditions and the following
+* disclaimer in the documentation and/or other materials provided
+* with the distribution.
+* * Neither the name of the Kei Okada nor the names of its
+* contributors may be used to endorse or promote products derived
+* from this software without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+* POSSIBILITY OF SUCH DAMAGE.
+*********************************************************************/
+//http://wiki.ros.org/cv_bridge/Tutorials/UsingCvBridgeToConvertBetweenROSImagesAndOpenCVImages
+/**
+ * This is a demo of Simple Example from wiki tutorial
+ */
+
+#include <ros/ros.h>
+#include <sensor_msgs/image_encodings.h>
+#include <nodelet/nodelet.h>
+#include <image_transport/image_transport.h>
+#include <cv_bridge/cv_bridge.h>
+
+#include <opencv2/highgui/highgui.hpp>
+#include <opencv2/imgproc/imgproc.hpp>
+
+
+#include <dynamic_reconfigure/server.h>
+
+
+namespace simple_example {
+
+static const std::string OPENCV_WINDOW = "Image window";
+
+class ImageConverter
+{
+ ros::NodeHandle nh_;
+ image_transport::ImageTransport it_;
+ image_transport::Subscriber image_sub_;
+ image_transport::Publisher image_pub_;
+
+public:
+ ImageConverter()
+ : it_(nh_)
+ {
+ // Subscrive to input video feed and publish output video feed
+ image_sub_ = it_.subscribe("image", 1,
+ &ImageConverter::imageCb, this);
+ image_pub_ = it_.advertise("/image_converter/output_video/raw", 1);
+
+ cv::namedWindow(OPENCV_WINDOW);
+ }
+
+ ~ImageConverter()
+ {
+ cv::destroyWindow(OPENCV_WINDOW);
+ }
+
+ void imageCb(const sensor_msgs::ImageConstPtr& msg)
+ {
+ cv_bridge::CvImagePtr cv_ptr;
+ try
+ {
+ cv_ptr = cv_bridge::toCvCopy(msg, sensor_msgs::image_encodings::BGR8);
+ }
+ catch (cv_bridge::Exception& e)
+ {
+ ROS_ERROR("cv_bridge exception: %s", e.what());
+ return;
+ }
+
+ // Draw an example circle on the video stream
+ if (cv_ptr->image.rows > 110 && cv_ptr->image.cols > 110)
+ cv::circle(cv_ptr->image, cv::Point(cv_ptr->image.cols/2, cv_ptr->image.rows/2), 100, CV_RGB(255,0,0));
+
+ // Update GUI Window
+ cv::imshow(OPENCV_WINDOW, cv_ptr->image);
+ cv::waitKey(3);
+
+ // Output modified video stream
+ image_pub_.publish(cv_ptr->toImageMsg());
+ }
+};
+
+
+class SimpleExampleNodelet : public nodelet::Nodelet
+{
+
+
+public:
+ virtual void onInit()
+ {
+ simple_example::ImageConverter ic;
+ ros::spin();
+ }
+};
+
+}
+
+#include <pluginlib/class_list_macros.h>
+PLUGINLIB_EXPORT_CLASS(simple_example::SimpleExampleNodelet, nodelet::Nodelet);
diff --git a/opencv_tests/CHANGELOG.rst b/opencv_tests/CHANGELOG.rst
index 529c5d5..df63818 100644
--- a/opencv_tests/CHANGELOG.rst
+++ b/opencv_tests/CHANGELOG.rst
@@ -2,6 +2,9 @@
Changelog for package opencv_tests
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+1.11.9 (2015-11-29)
+-------------------
+
1.11.8 (2015-07-15)
-------------------
* simplify dependencies
diff --git a/opencv_tests/package.xml b/opencv_tests/package.xml
index 4b7dc24..4874f16 100644
--- a/opencv_tests/package.xml
+++ b/opencv_tests/package.xml
@@ -1,6 +1,6 @@
<package>
<name>opencv_tests</name>
- <version>1.11.8</version>
+ <version>1.11.9</version>
<description>
opencv_tests
</description>
diff --git a/vision_opencv/CHANGELOG.rst b/vision_opencv/CHANGELOG.rst
index ef592c8..512d58b 100644
--- a/vision_opencv/CHANGELOG.rst
+++ b/vision_opencv/CHANGELOG.rst
@@ -2,6 +2,11 @@
Changelog for package vision_opencv
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+1.11.9 (2015-11-29)
+-------------------
+* Add opencv_apps to vision_opencv dependency
+* Contributors: Ryohei Ueda
+
1.11.8 (2015-07-15)
-------------------
diff --git a/vision_opencv/package.xml b/vision_opencv/package.xml
index 622b158..b4c4515 100644
--- a/vision_opencv/package.xml
+++ b/vision_opencv/package.xml
@@ -1,6 +1,6 @@
<package>
<name>vision_opencv</name>
- <version>1.11.8</version>
+ <version>1.11.9</version>
<description>Packages for interfacing ROS with OpenCV, a library of programming functions for real time computer vision.</description>
<author>Patrick Mihelich</author>
<author>James Bowman</author>
@@ -16,7 +16,7 @@
<!-- Old stack contents -->
<run_depend>cv_bridge</run_depend>
<run_depend>image_geometry</run_depend>
-
+ <run_depend>opencv_apps</run_depend>
<export>
<metapackage/>
</export>
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/ros/ros-vision-opencv.git
More information about the debian-science-commits
mailing list