2

I am using python bindings of openkinect for getting the depth and RGB image. For some reasons , I need the disparity image.

Could someone please help me that how to get that image?

Thanks a lot.

skaffman
  • 398,947
  • 96
  • 818
  • 769
Shan
  • 18,563
  • 39
  • 97
  • 132
  • 2
    What do you mean exactly with "disparity image"? – Masci Mar 22 '12 at 12:13
  • the image which has been calculated by the two infrared cameras... as far as my understanding is concerned the disparity is finding the correspondences and the depth image is the one which has been estimated from the disparity values – Shan Mar 22 '12 at 14:21
  • 1
    Being nitpicky: The Kinect have only one IR-camera. The disparity is calculated by it having also a IR-projector that transmits a pattern in the IR specturm. See http://en.wikipedia.org/wiki/Structured_Light_3D_Scanner – Hannes Ovrén Mar 22 '12 at 16:03

1 Answers1

1

AFAIK you can retrieve different types of image both from the RGB camera (e.g. the IR image) and the depth camera. Don't known exactly which one can be useful for your purposes. These are the constants for the video camera:

('VIDEO_BAYER', 
 'VIDEO_IR_10BIT', 
 'VIDEO_IR_10BIT_PACKED', 
 'VIDEO_IR_8BIT', 
 'VIDEO_RGB', 
 'VIDEO_YUV_RAW', 
 'VIDEO_YUV_RGB')

and these for the depth camera:

('DEPTH_10BIT', 
 'DEPTH_10BIT_PACKED', 
 'DEPTH_11BIT', 
 'DEPTH_11BIT_PACKED')

For example, to retrieve IR image you can do:

freenect.sync_get_video(0, freenect.VIDEO_IR_10BIT)

working with the non-sync api is analogous. Maybe you could give a try to some of the above video types, sorry I can't be more precise but I lack of some theory behind the kinect.

Masci
  • 5,864
  • 1
  • 26
  • 21