Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: DepthMap with glreadPixels

  1. #1
    Junior Member Newbie
    Join Date
    May 2013
    Posts
    12

    Question DepthMap with glreadPixels

    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?

  2. #2
    Junior Member Newbie
    Join Date
    May 2013
    Posts
    12
    this is the image: imageshack.us/a/img267/2125/depthmap.png

  3. #3
    Junior Member Newbie
    Join Date
    May 2013
    Posts
    12
    I found the problem, is the data type of the mat that I was saving the image. Sorry for the post

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •