Skip to content

Commit

Permalink
Merge pull request ethz-asl#113 from NikolausDemmel/feature/fix-8uc1-…
Browse files Browse the repository at this point in the history
…encoding

Make ImageDatasetReader work with 8UC1 encoded msg
  • Loading branch information
Thomas Schneider authored Jul 11, 2017
2 parents a43a7b2 + 6a1f19a commit 5829edd
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,7 @@ def getImage(self, idx):
image_16u = np.array(self.CVB.imgmsg_to_cv2(data))
img_data = (image_16u / 256).astype("uint8")
elif data.encoding == "8UC1" or data.encoding == "mono8":
img_data = np.array(self.CVB.imgmsg_to_cv2(
data, desired_encoding="mono8"))
img_data = np.array(self.CVB.imgmsg_to_cv2(data))
elif data.encoding == "8UC3" or data.encoding == "rgb8":
img_data = np.array(self.CVB.imgmsg_to_cv2(data))
img_data = cv2.cvtColor(img_data, cv2.COLOR_BGR2GRAY)
Expand Down

0 comments on commit 5829edd

Please sign in to comment.