Ask Your Question
0

Correct way to read depth images

asked 2013-03-14 11:52:17 -0600

Shin gravatar image

updated 2013-03-14 11:52:50 -0600

I need to use the dataset at http://www.informatik.uni-freiburg.de/~spinello/RGBD-dataset.html and i'd like to know how to correctly read in the depth images using opencv.

I've uploaded one of these depth images here: http://bitshare.com/files/fqil8g7s/seq0_0000_0.pgm.html

Thank you.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2013-03-14 12:42:14 -0600

xaffeine gravatar image

updated 2013-03-14 12:46:07 -0600

The pgm file format is a "portable gray map" described at netpbm.sourceforge.net. There is also a wikipedia article about the netpbm standards.

Opencv imread is documented as being able to read these.

edit flag offensive delete link more

Comments

Thank you. Well, i was reading them using a cv::Mat object of type CV_16UC1. I'd like to know if some scaling operation is needed (considering that these are indeed kinect depth images) and that most opencv functions work with CV_8U matrixes.

Shin gravatar imageShin ( 2013-03-14 14:15:51 -0600 )edit

I would just look at the data and see what min and max values you find there. For display, you probably want to scale or normalize them before converting to 8 bit.

xaffeine gravatar imagexaffeine ( 2013-03-14 18:04:36 -0600 )edit

Question Tools

Stats

Asked: 2013-03-14 11:52:17 -0600

Seen: 2,547 times

Last updated: Mar 14 '13