[ros-vision-opencv] 01/03: New upstream version 1.12.4+ds

Leopold Palomo-Avellaneda leo at alaxarxa.net
Tue Jun 27 08:13:00 UTC 2017


This is an automated email from the git hooks/post-receive script.

lepalom-guest pushed a commit to branch master
in repository ros-vision-opencv.

commit 1cc23690f1cc6f22e73bb6a8dc54534a79db29e8
Author: Leopold Palomo-Avellaneda <leo at alaxarxa.net>
Date:   Tue Jun 27 10:06:00 2017 +0200

    New upstream version 1.12.4+ds
---
 cv_bridge/CHANGELOG.rst                       | 30 ++++++++++++++++++++++++---
 cv_bridge/CMakeLists.txt                      | 10 ++++++---
 cv_bridge/include/cv_bridge/cv_bridge.h       |  2 +-
 cv_bridge/package.xml                         |  7 ++-----
 cv_bridge/python/cv_bridge/core.py            | 12 -----------
 cv_bridge/src/CMakeLists.txt                  |  5 +----
 cv_bridge/src/cv_bridge.cpp                   | 11 ++++++++++
 cv_bridge/test/utest.cpp                      | 29 ++++++++++++++++++++++++++
 image_geometry/CHANGELOG.rst                  |  8 +++++++
 image_geometry/package.xml                    |  2 +-
 image_geometry/src/image_geometry/__init__.py |  3 ++-
 opencv_tests/CHANGELOG.rst                    |  6 ++++++
 opencv_tests/package.xml                      |  2 +-
 vision_opencv/CHANGELOG.rst                   |  6 ++++++
 vision_opencv/package.xml                     |  2 +-
 15 files changed, 103 insertions(+), 32 deletions(-)

diff --git a/cv_bridge/CHANGELOG.rst b/cv_bridge/CHANGELOG.rst
index 76a85f6..655755d 100644
--- a/cv_bridge/CHANGELOG.rst
+++ b/cv_bridge/CHANGELOG.rst
@@ -2,8 +2,33 @@
 Changelog for package cv_bridge
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-<<<<<<< HEAD
-=======
+1.12.4 (2017-01-29)
+-------------------
+* properly find Boost Python 2 or 3
+  This fixes `#158 <https://github.com/ros-perception/vision_opencv/issues/158>`_
+* Contributors: Vincent Rabaud
+
+1.12.3 (2016-12-04)
+-------------------
+* Use api in sensor_msgs to get byte_depth and num channels
+* Implement cpp conversion of N channel image
+  This is cpp version of https://github.com/ros-perception/vision_opencv/pull/141,
+  which is one for python.
+* Fill black color to depth nan region
+* address gcc6 build error in cv_bridge and tune
+  With gcc6, compiling fails with `stdlib.h: No such file or directory`,
+  as including '-isystem /usr/include' breaks with gcc6, cf.,
+  https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70129
+  This commit addresses this issue for cv_bridge in the same way
+  it was done in the commit ead421b8 [1] for image_geometry.
+  This issue was also addressed in various other ROS packages.
+  A list of related commits and pull requests is at:
+  https://github.com/ros/rosdistro/issues/12783
+  [1] https://github.com/ros-perception/vision_opencv/commit/ead421b85eeb750cbf7988657015296ed6789bcf
+  Signed-off-by: Lukas Bulwahn <lukas.bulwahn at oss.bmw-carit.de>
+* cv_bridge: Add missing test_depend on numpy
+* Contributors: Kentaro Wada, Lukas Bulwahn, Maarten de Vries
+
 1.12.2 (2016-09-24)
 -------------------
 * Specify background label when colorizing label image
@@ -55,7 +80,6 @@ Changelog for package cv_bridge
 * Fix compilation of cv_bridge with opencv3 and python3.
 * Contributors: Kentaro Wada, Maarten de Vries, Vincent Rabaud, talregev
 
->>>>>>> Imported Upstream version 1.12.2+ds
 1.12.0 (2016-03-18)
 -------------------
 * depend on OpenCV3 only
diff --git a/cv_bridge/CMakeLists.txt b/cv_bridge/CMakeLists.txt
index 075fbbd..0cebaf8 100644
--- a/cv_bridge/CMakeLists.txt
+++ b/cv_bridge/CMakeLists.txt
@@ -4,7 +4,12 @@ project(cv_bridge)
 find_package(catkin REQUIRED COMPONENTS rosconsole sensor_msgs)
 
 if(NOT ANDROID)
-find_package(Boost REQUIRED python)
+  find_package(PythonLibs)
+  if(PYTHONLIBS_VERSION_STRING VERSION_LESS 3)
+    find_package(Boost REQUIRED python)
+  else()
+    find_package(Boost REQUIRED python3)
+  endif()
 else()
 find_package(Boost REQUIRED)
 endif()
@@ -19,8 +24,7 @@ catkin_package(
 
 catkin_python_setup()
 
-include_directories(SYSTEM ${Boost_INCLUDE_DIRS} ${OpenCV_INCLUDE_DIRS})
-include_directories(include ${catkin_INCLUDE_DIRS})
+include_directories(include ${Boost_INCLUDE_DIRS} ${OpenCV_INCLUDE_DIRS} ${catkin_INCLUDE_DIRS})
 
 if(NOT ANDROID)
 add_subdirectory(python)
diff --git a/cv_bridge/include/cv_bridge/cv_bridge.h b/cv_bridge/include/cv_bridge/cv_bridge.h
index 2b44303..759ce95 100644
--- a/cv_bridge/include/cv_bridge/cv_bridge.h
+++ b/cv_bridge/include/cv_bridge/cv_bridge.h
@@ -300,7 +300,7 @@ CvImageConstPtr cvtColorForDisplay(const CvImageConstPtr& source,
 /**
  * \brief Get the OpenCV type enum corresponding to the encoding.
  *
- * For example, "bgr8" -> CV_8UC3.
+ * For example, "bgr8" -> CV_8UC3, "32FC1" -> CV_32FC1, and "32FC10" -> CV_32FC10.
  */
 int getCvType(const std::string& encoding);
 
diff --git a/cv_bridge/package.xml b/cv_bridge/package.xml
index 588ac81..27ca093 100644
--- a/cv_bridge/package.xml
+++ b/cv_bridge/package.xml
@@ -1,10 +1,6 @@
 <package format="2">
   <name>cv_bridge</name>
-<<<<<<< HEAD
-  <version>1.12.0</version>
-=======
-  <version>1.12.2</version>
->>>>>>> Imported Upstream version 1.12.2+ds
+  <version>1.12.4</version>
   <description>
     This contains CvBridge, which converts between ROS
     Image messages and OpenCV images.
@@ -36,6 +32,7 @@
   <build_export_depend>sensor_msgs</build_export_depend>
 
   <test_depend>rostest</test_depend>
+  <test_depend>python-numpy</test_depend>
 
   <doc_depend>dvipng</doc_depend>
 </package>
diff --git a/cv_bridge/python/cv_bridge/core.py b/cv_bridge/python/cv_bridge/core.py
index 07f5b34..b392989 100644
--- a/cv_bridge/python/cv_bridge/core.py
+++ b/cv_bridge/python/cv_bridge/core.py
@@ -41,10 +41,7 @@ class CvBridgeError(TypeError):
     """
     pass
 
-<<<<<<< HEAD
-=======
 
->>>>>>> Imported Upstream version 1.12.2+ds
 class CvBridge(object):
     """
     The CvBridge is an object that converts between OpenCV Images and ROS Image messages.
@@ -87,14 +84,8 @@ class CvBridge(object):
         return '%sC%d' % (self.numpy_type_to_cvtype[dtype.name], n_channels)
 
     def cvtype2_to_dtype_with_channels(self, cvtype):
-<<<<<<< HEAD
-        import re
-        vals = re.split('(.+)C(.+)', self.cvtype_to_name[cvtype])
-        return self.numpy_type_to_cvtype[vals[1]], int(vals[2])
-=======
         from cv_bridge.boost.cv_bridge_boost import CV_MAT_CNWrap, CV_MAT_DEPTHWrap
         return self.cvdepth_to_numpy_depth[CV_MAT_DEPTHWrap(cvtype)], CV_MAT_CNWrap(cvtype)
->>>>>>> Imported Upstream version 1.12.2+ds
 
     def encoding_to_cvtype2(self, encoding):
         from cv_bridge.boost.cv_bridge_boost import getCvType
@@ -267,11 +258,8 @@ class CvBridge(object):
             # Verify that the supplied encoding is compatible with the type of the OpenCV image
             if self.cvtype_to_name[self.encoding_to_cvtype2(encoding)] != cv_type:
                 raise CvBridgeError("encoding specified as %s, but image has incompatible type %s" % (encoding, cv_type))
-<<<<<<< HEAD
-=======
         if cvim.dtype.byteorder == '>':
             img_msg.is_bigendian = True
->>>>>>> Imported Upstream version 1.12.2+ds
         img_msg.data = cvim.tostring()
         img_msg.step = len(img_msg.data) / img_msg.height
 
diff --git a/cv_bridge/src/CMakeLists.txt b/cv_bridge/src/CMakeLists.txt
index 8ec321c..37ba30e 100644
--- a/cv_bridge/src/CMakeLists.txt
+++ b/cv_bridge/src/CMakeLists.txt
@@ -26,10 +26,7 @@ if(NOT PYTHON_NUMPY_INCLUDE_DIR)
     endif(PYTHON_NUMPY_PROCESS EQUAL 0)
  endif(NOT PYTHON_NUMPY_INCLUDE_DIR)
 
-include_directories(SYSTEM ${PYTHON_INCLUDE_PATH}
-                           ${Boost_INCLUDE_DIRS}
-                           ${PYTHON_NUMPY_INCLUDE_DIR} # cv_bridge module uses NumPy functions
-)
+include_directories(${PYTHON_INCLUDE_PATH} ${Boost_INCLUDE_DIRS} ${PYTHON_NUMPY_INCLUDE_DIR})
 
 if (PYTHON_VERSION_MAJOR VERSION_EQUAL 3)
   add_definitions(-DPYTHON3)
diff --git a/cv_bridge/src/cv_bridge.cpp b/cv_bridge/src/cv_bridge.cpp
index 4919078..f31ba93 100644
--- a/cv_bridge/src/cv_bridge.cpp
+++ b/cv_bridge/src/cv_bridge.cpp
@@ -635,6 +635,17 @@ CvImageConstPtr cvtColorForDisplay(const CvImageConstPtr& source,
       cv::Mat(source->image-min_image_value).convertTo(img_scaled->image, CV_8UC3, 255.0 /
         (max_image_value - min_image_value));
       cv::applyColorMap(img_scaled->image, img_scaled->image, options.colormap);
+      // Fill black color to the nan region.
+      if (source->encoding == enc::TYPE_32FC1) {
+        for (size_t j = 0; j < source->image.rows; ++j) {
+          for (size_t i = 0; i < source->image.cols; ++i) {
+            float float_value = source->image.at<float>(j, i);
+            if (std::isnan(float_value)) {
+              img_scaled->image.at<cv::Vec3b>(j, i) = cv::Vec3b(0, 0, 0);
+            }
+          }
+        }
+      }
     }
     return cvtColor(img_scaled, encoding);
   }
diff --git a/cv_bridge/test/utest.cpp b/cv_bridge/test/utest.cpp
index 1d8255c..d74be56 100644
--- a/cv_bridge/test/utest.cpp
+++ b/cv_bridge/test/utest.cpp
@@ -105,6 +105,35 @@ TEST(CvBridgeTest, imageMessageStep)
   ASSERT_EQ(200, cv_ptr->image.step[0]);
 }
 
+TEST(CvBridgeTest, imageMessageConversion)
+{
+  sensor_msgs::Image imgmsg;
+  cv_bridge::CvImagePtr cv_ptr;
+  imgmsg.height = 220;
+  imgmsg.width = 200;
+  imgmsg.is_bigendian = false;
+
+  // image with data type float32 and 1 channels
+  imgmsg.encoding = "32FC1";
+  imgmsg.step = imgmsg.width * 32 / 8 * 1;
+  imgmsg.data.resize(imgmsg.height * imgmsg.step);
+  ASSERT_NO_THROW(cv_ptr = cv_bridge::toCvCopy(imgmsg, imgmsg.encoding));
+  ASSERT_EQ(imgmsg.height, cv_ptr->image.rows);
+  ASSERT_EQ(imgmsg.width, cv_ptr->image.cols);
+  ASSERT_EQ(1, cv_ptr->image.channels());
+  ASSERT_EQ(imgmsg.step, cv_ptr->image.step[0]);
+
+  // image with data type float32 and 10 channels
+  imgmsg.encoding = "32FC10";
+  imgmsg.step = imgmsg.width * 32 / 8 * 10;
+  imgmsg.data.resize(imgmsg.height * imgmsg.step);
+  ASSERT_NO_THROW(cv_ptr = cv_bridge::toCvCopy(imgmsg, imgmsg.encoding));
+  ASSERT_EQ(imgmsg.height, cv_ptr->image.rows);
+  ASSERT_EQ(imgmsg.width, cv_ptr->image.cols);
+  ASSERT_EQ(10, cv_ptr->image.channels());
+  ASSERT_EQ(imgmsg.step, cv_ptr->image.step[0]);
+}
+
 int main(int argc, char** argv)
 {
   testing::InitGoogleTest(&argc, argv);
diff --git a/image_geometry/CHANGELOG.rst b/image_geometry/CHANGELOG.rst
index acef786..7e4e0a7 100644
--- a/image_geometry/CHANGELOG.rst
+++ b/image_geometry/CHANGELOG.rst
@@ -2,6 +2,14 @@
 Changelog for package image_geometry
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
+1.12.4 (2017-01-29)
+-------------------
+* Import using __future_\_ for python 3 compatibility.
+* Contributors: Hans Gaiser
+
+1.12.3 (2016-12-04)
+-------------------
+
 1.12.2 (2016-09-24)
 -------------------
 * Fix "stdlib.h: No such file or directory" errors in GCC-6
diff --git a/image_geometry/package.xml b/image_geometry/package.xml
index 3f554f5..6a64b34 100644
--- a/image_geometry/package.xml
+++ b/image_geometry/package.xml
@@ -1,6 +1,6 @@
 <package format="2">
   <name>image_geometry</name>
-  <version>1.12.2</version>
+  <version>1.12.4</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/image_geometry/__init__.py b/image_geometry/src/image_geometry/__init__.py
index 25df78c..f1cbda0 100644
--- a/image_geometry/src/image_geometry/__init__.py
+++ b/image_geometry/src/image_geometry/__init__.py
@@ -1 +1,2 @@
-from cameramodels import PinholeCameraModel, StereoCameraModel
+from __future__ import absolute_import
+from .cameramodels import PinholeCameraModel, StereoCameraModel
diff --git a/opencv_tests/CHANGELOG.rst b/opencv_tests/CHANGELOG.rst
index 52ce2c8..afa174d 100644
--- a/opencv_tests/CHANGELOG.rst
+++ b/opencv_tests/CHANGELOG.rst
@@ -2,6 +2,12 @@
 Changelog for package opencv_tests
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
+1.12.4 (2017-01-29)
+-------------------
+
+1.12.3 (2016-12-04)
+-------------------
+
 1.12.2 (2016-09-24)
 -------------------
 
diff --git a/opencv_tests/package.xml b/opencv_tests/package.xml
index 472932d..b31271e 100644
--- a/opencv_tests/package.xml
+++ b/opencv_tests/package.xml
@@ -1,6 +1,6 @@
 <package>
   <name>opencv_tests</name>
-  <version>1.12.2</version>
+  <version>1.12.4</version>
   <description>
     Tests the enumerants of the ROS Image message, and functionally tests the Python and C++ implementations of CvBridge.
   </description>
diff --git a/vision_opencv/CHANGELOG.rst b/vision_opencv/CHANGELOG.rst
index a6d8da7..519f391 100644
--- a/vision_opencv/CHANGELOG.rst
+++ b/vision_opencv/CHANGELOG.rst
@@ -2,6 +2,12 @@
 Changelog for package vision_opencv
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
+1.12.4 (2017-01-29)
+-------------------
+
+1.12.3 (2016-12-04)
+-------------------
+
 1.12.2 (2016-09-24)
 -------------------
 
diff --git a/vision_opencv/package.xml b/vision_opencv/package.xml
index bcb1ff2..318c145 100644
--- a/vision_opencv/package.xml
+++ b/vision_opencv/package.xml
@@ -1,6 +1,6 @@
 <package>
   <name>vision_opencv</name>
-  <version>1.12.2</version>
+  <version>1.12.4</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>

-- 
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