erget / StereoVision

Library and utilities for 3d reconstruction from stereo cameras.
http://erget.github.io/StereoVision
GNU General Public License v3.0
649 stars 268 forks source link

Update code to support OpenCV v. 3. #13

Closed mortlind closed 6 years ago

mortlind commented 7 years ago

In trying to use OpenCV 3, specifically 3.1.0, it is found that cv2.STEREO_BM_NARROW_PRESET, needed by the current StereoVision code base, is not exposed. There are several other interface changes from OpenCV v. 2 to v. 3, which need to be addressed.

wickywaka commented 7 years ago

I am having the same issues..

erget commented 7 years ago

I'm currently not able to devote a lot of time to porting to OpenCV3, do either of you have experience with using the new library? It'd be great to be able to support this but I won't be able to focus on this until at least after Christmas.

mortlind commented 7 years ago

I may get some experience with v3, but I will not be able to do an effort in StereoVision before Christmas as well. I will happily contribute in the future, if I feel like comming up to speed.

wickywaka commented 7 years ago

Now that I have only one last assignment to submit for this semester, I will try to do it but I am relatively new to opencv so I can't promise.

ss32 commented 7 years ago

Looking at http://docs.opencv.org/java/2.4.4/constant-values.html#org.opencv.calib3d.StereoBM.NARROW_PRESET it looks like they've assigned those values to 0,1,2 respectively. I've gone through and edited blockmatchers.py to reflect that but haven't had a chance to run it to confirm that it even works, but the package does import without error now.

srk97 commented 7 years ago

It works when I replace the flags to 0,1,2. Also, StereoSGBM() has to be replaced with StereoSGBM_create() with the required positional arguments.

mortlind commented 7 years ago

I have had Py3 + OCV3 working for some time by using the fork by Douglas Gibbons.

mortlind commented 7 years ago

I am closing this issue, since I do not have it any longer. I advise to merge changes from https://github.com/douglas-gibbons/StereoVision

atmadeep commented 6 years ago

Thank you very much, Douglas Gibbons. I might also add that you need to install progressBar2 on pip3 for tune_blockmatcher to work.

atmadeep commented 6 years ago

I should also add that in image_to_pointcloud when writing to output.ply file, the file should be opened in binary mode. This should be updated in point_cloud.ply file.Running image_to_pointcloud with proper arguments gives the following set of errors:

  1. TypeError: write() argument must be str, not bytes
  2. (This exception is generated while handling above exception) TypeError: mismatch between array dtype (float32) and format specifier. Please check attached image for more info. Has anyone encountered them earlier? Can you please provide the solution. screenshot from 2018-01-30 16-51-11
kahlju commented 6 years ago

Has anyone confirmed the next line in blockmatchers.py which deals with Fish_eye? It errors out the code is you try the --usestereobm settings option.