I started experimenting with the Image API with a view to creating a 3D object scanner. I'm using OpenCV through the Cinder wrapper (as well as using Cinder to display the images) in Xcode. The first step is to generate a good disparity map which is a luminosity coded depth map. I'm wondering if anyone else is experimenting with this, I'm not getting great results with this stage. I've got my project on github here: https://github.com/digithree/leap-3d-imager
Here's a screen grab:
I'd like to improve this as much as I can. I've been tweaking the OpenCV StereoSGBM method parameters a bit and have improved from very a noisy disparity map to what you see in the image. The parameters for what you see in the picture are as follow, with comments for other parameters I tried:
sgbm.SADWindowSize = 5; //5, 30
sgbm.numberOfDisparities = 256; //192, 32
sgbm.preFilterCap = 48; //4, 32
sgbm.minDisparity = 0; //-64, 64
sgbm.uniquenessRatio = 10; //1
sgbm.speckleWindowSize = 50; //100
sgbm.speckleRange = 20; //2, 8, 20
sgbm.disp12MaxDiff = 5; //10
sgbm.fullDP = true;
sgbm.P1 = 128;
sgbm.P2 = 256;
I've also tried it with image ray correction with the algorithm from the docs (https://developer.leapmotion.com/documentation/skeletal/csharp/devguide/Leap_Images.html) and it's no better.
I would love to know about what anyone else is doing on this or if anyone has tips for getting a disparity map to turn out better. Thanks