Skip to content

Commit

Permalink
Merge pull request ethz-asl#90 from tu-darmstadt-ros-pkg/calibration_…
Browse files Browse the repository at this point in the history
…validator_rgb_support

Allow using rgb images in validator
  • Loading branch information
Thomas Schneider authored Nov 13, 2017
2 parents 30c2860 + 211f416 commit 6f6657d
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,17 @@ class CameraChainValidator(object):
if (timeNow-self.timeLast < 1.0/rate) and self.timeLast!=0:
return
self.timeLast = timeNow

#process the images of all cameras
self.observations=[];
for cam_nr, msg in enumerate(cam_msgs):

#convert image to numpy
try:
cv_image = self.bridge.imgmsg_to_cv2(msg)
if (msg.encoding == "rgb8"):
cv_image = np.squeeze(np.array(self.bridge.imgmsg_to_cv2(msg, "mono8")))
else:
cv_image = self.bridge.imgmsg_to_cv2(msg)
np_image = np.array(cv_image)
except CvBridgeError, e:
print e
Expand Down

0 comments on commit 6f6657d

Please sign in to comment.