Open christenbc opened 5 years ago
I have a similar issue with an intel sense camera, but with mono16 encoding. Were you able to fix it? Thank you
Same issue here
same here with
Could not convert depth image to laserscan: Depth image has unsupported encoding: mono16
Any update on this?
As it stands, depthimage_to_laserscan only supports image encodings of TYPE_16UC1 and TYPE_32FC1 (see https://github.com/ros-perception/depthimage_to_laserscan/blob/547cead75adea252893269044e52c8022877bb6a/src/DepthImageToLaserScan.cpp#L129). All other encodings throw that exception. To fix this issue, you'll have to open a pull request that adds support for converting from another encoding.
you should convert the type of the image
def callback(self,data):
try:
cv_image = self.bridge.imgmsg_to_cv2(data, "bgr8")
except CvBridgeError as e:
print(e)
img = cv2.cvtColor(cv_image,cv2.COLOR_BGR2GRAY)
img2 = np.array(img, dtype=np.float32)
cv2.waitKey(1)
try:
self.image_pub.publish(self.bridge.cv2_to_imgmsg(img2, "32FC1"))
except CvBridgeError as e:
print(e)
Hi same problem..where do I have to place that code snippet?
The camera is an Intel Sense. Is there any solution to this issue?