Ask Your Question
0

how to save 1 frame of depth registered depth image [closed]

asked 2015-08-29 22:45:31 -0500

dmngu9 gravatar image

I tried modifying the image view nodes image_saver and extract_image but it stiil gives me error " cant convert 16UC1 to BRG8' . I want to save it in png type

anyone has any idea

edit retag flag offensive reopen merge delete

Closed for the following reason OpenCV Question: THe OpenCV community prefers to answer questions at: http://answers.opencv.org/questions/ by tfoote
close date 2015-11-02 01:25:49.390787

2 Answers

Sort by ยป oldest newest most voted
3

answered 2015-08-31 04:45:05 -0500

Just use:

rosrun image_view image_saver image:=/camera/depth_registered/image_raw _encoding:=16UC1 _filename_format:="image%04i.png"

Get sure the topic is published. Maybe you need to activate registration with dynamic reconfiguration.

edit flag offensive delete link more

Comments

For reference for anyone else finding this, if the encoding is 32FC1 then this works (and using 16UC1 will produce blank images)

rosrun image_view image_saver image:=/camera/depth_registered/image_raw _encoding:=32FC1 _filename_format:="image%04i.tif"

tif is needed to save as a float, png will crush it down to 8-bit.

lucasw gravatar image lucasw  ( 2021-09-09 10:59:20 -0500 )edit

The specified encoding must of course match the data. When I wrote the answer 6 years ago, all sensors coded the depth with 2 bytes and thus the command above was correct for all /.../depth_registered/image_raw topcis. Unfortunately, I'm now in a completely different technological environment, but I'm a bit surprised that a sensor delivers 32FC1: In my time, only 11 to 12 (if I remember right) of the 16 bits were used, so there was still some space left.

MichaelKorn gravatar image MichaelKorn  ( 2021-09-09 14:37:22 -0500 )edit
0

answered 2015-08-30 12:31:04 -0500

NEngelhard gravatar image

This is most probably rather an OpenCV-Question. Can you show the corresponding code?

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2015-08-29 22:45:31 -0500

Seen: 1,251 times

Last updated: Aug 31 '15