Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cv_bridge/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
<buildtool_depend>ament_cmake_ros</buildtool_depend>
<buildtool_depend>python_cmake_module</buildtool_depend>

<depend>libopencv-dev</depend>
<depend>boost</depend>
<depend>sensor_msgs</depend>

Expand Down
9 changes: 4 additions & 5 deletions cv_bridge/test/python_bindings.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import cv_bridge
from nose.tools import assert_equal
import numpy as np


Expand All @@ -20,9 +19,9 @@ def test_cvtColorForDisplay():
label[min_y:max_y, min_x:max_x] = label_value
label_value += 1
label_viz = cv_bridge.cvtColorForDisplay(label, '32SC1', 'bgr8')
assert_equal(label_viz.dtype, np.uint8)
assert_equal(label_viz.min(), 0)
assert_equal(label_viz.max(), 255)
assert label_viz.dtype == np.uint8
assert label_viz.min() == 0
assert label_viz.max() == 255

# Check that mono8 conversion returns the right shape.
bridge = cv_bridge.CvBridge()
Expand All @@ -31,4 +30,4 @@ def test_cvtColorForDisplay():

input_msg = bridge.cv2_to_imgmsg(mono, encoding='mono8')
output = bridge.imgmsg_to_cv2(input_msg, desired_encoding='mono8')
assert_equal(output.shape, (100, 100))
assert output.shape == (100, 100)