Ask Your Question

Extracting depth images using rosrun command using realsense camera

asked 2018-06-15 04:19:59 -0500

janhvi_02 gravatar image

updated 2018-06-20 01:35:51 -0500

I entered this command to extract depth images from intel realsense R200 camera:

rosrun image_view extract_images _sec_per_frame:=0.01 image:=/camera/depth/image_raw

I wasn't able to get the images, instead showed this error:

[ERROR] [1529053683.952956798]: Unable to convert 16UC1 image to bgr8
[ WARN] [1529053683.953020485]: Couldn't save image, no data!

When i entered this command for color images, it worked:

rosrun image_view extract_images _sec_per_frame:=0.01 image:=/camera/color/image_raw

How can this issue be resolved?

edit retag flag offensive close merge delete


Can you list all the published image topics? You cannot extract from image:=/camera/depth/image_raw because the format needed for extract_images is different. Maybe there is different topic like depth_registered or depth_rect...I have used the zed camera and had faced similar problems.

PratNag gravatar image PratNag  ( 2018-06-19 13:18:57 -0500 )edit

I tried for dpeth_registered and depth_rectify but I think i need to provide encoding for depth images.

janhvi_02 gravatar image janhvi_02  ( 2018-06-21 04:24:33 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2018-06-20 05:39:57 -0500

mathsci gravatar image

extract_images can only save images with bgr8 encoding. You could try using image_saver which provide option for setting encoding of the image topic, something like so:

rosrun image_view image_saver _encoding:=16UC1 image:=/camera/depth/image_raw
edit flag offensive delete link more


Thanks a lot, i could extract depth images using this command.

janhvi_02 gravatar image janhvi_02  ( 2018-06-21 04:23:38 -0500 )edit

Can you also provide a single command for extracting both depth and color images?

janhvi_02 gravatar image janhvi_02  ( 2018-06-29 03:49:36 -0500 )edit

@janhvi_02 if this answered your question then please click on the check mark to mark it as correct.

jayess gravatar image jayess  ( 2018-06-29 04:12:35 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2018-06-15 04:19:59 -0500

Seen: 902 times

Last updated: Jun 20 '18