Where is python source code/bindings - want to look into StereoBM?

asked 2015-05-12 02:45:21 -0600

ricor29 gravatar image

I'm really struggling to find where the python source code of opencv is. For c++ I can find it in the modules directory but I'm stumped when it comes to the python. I've got the .pyd file that I think is like a dll and enables me to use the code but that won't let me look at the code or the bindings.

In particular I want to understand how to set values in cv2.StereoBM such as min disparity and uniqueness ratio. Currently I'm only able to use the presets.

Thanks

edit retag flag offensive close merge delete

Comments

1

the python wrappers are generated from the c++ api. if you did build opencv locally, you will have the code in opencv/build/modules/python

it's probably far easier, to query python's builtin help(shown here for opencv3.0:

>>> bm = cv2.StereoBM_create() 
>>> help(bm) Help on StereoBM object:

class StereoBM(StereoMatcher)
 |  Method resolution order:
 |      StereoBM
 |      StereoMatcher
 |      Algorithm
 |      __builtin__.object
 |
 |  Methods defined here:
 |
 |  __repr__(...)
 |      x.__repr__() <==> repr(x)
 |
 |  getPreFilterCap(...)
 |      getPreFilterCap() -> retval
 |
 |  getPreFilterSize(...)

 ... (more methods
berak gravatar imageberak ( 2015-05-12 02:54:59 -0600 )edit

Thanks Berak that answered it for me.

ricor29 gravatar imagericor29 ( 2015-05-13 12:55:43 -0600 )edit