View Full Version : DepthMap with glreadPixels

05-23-2013, 08:20 AM
Hello everyone,

I'm trying to get a depthmap of the scene using glreadpixels, mi command is it:

glReadPixels(0, 0, img.cols, img.rows, GL_DEPTH_COMPONENT, GL_FLOAT, img.data);

and save it in a openCV mat. When I use to get the scene and save intop a cv::mat it's working but when I try to get the depth component I get the image four times and two times the images are reversed (I can't put the image here I don't know why :( ).

so anybody knows what is the problem?

05-23-2013, 08:22 AM
this is the image: imageshack.us/a/img267/2125/depthmap.png

05-23-2013, 08:32 AM
I found the problem, is the data type of the mat that I was saving the image. Sorry for the post