How can I work with Depth Data, offline?
I have some depth data & RGB video have been captured by kinect camera & I've saved them in a folder. How can I extract depth from them.
It depends on the format you were using. You can read video (AVI) files using theVideoCapture
class , or a series of images with the imread
function.
The problem with the Kinect sensor is that depth data ranges from 800 to 4000 (millimeters), which is outside the 8 bit (0-255) range. So the AVI file cannot store the real depth data, so only some image formats (TIFF and PNG) can be used to store these values (note: you have to use CV_LOAD_IMAGE_ANYDEPTH
in the imread
function).
So I suggest to store the captured data as a series of images: the color as JPG (PNG or TIFF), the depth as 16 bit TIFF: color1.jpg,color2.jpg,...,depth1.tif,depth2.tif,...
Here is the code to read them
Mat depth,color;
int count=10; //number of depth images
char s[20];
for(int i=0;i<count;i++)
{
sprintf(s,"depth%d.tif",i);
depth=imread(s,CV_LOAD_IMAGE_ANYDEPTH);
sprintf(s,"color%d.jpg",i);
color=imread(s);
//process the images...
}
Thanks a lot. I could fine the PNG files related to my database.
Asked: 2016-09-19 04:20:44 -0600
Seen: 177 times
Last updated: Sep 19 '16