title: How does one look at imported OpenCV code? (specifically python's cv2)
body: <p>A friend and I are using OpenCV for some image processing work and wanted to open the "black box" of the findContours method in the python library since the documentation doesn't give much more than the <a href="http://docs.opencv.org/modules/imgproc/doc/structural_analysis_and_shape_descriptors.html?#findcontours" rel="nofollow">function definition/parameters</a>. We've read about the math behind finding contours but are interested in looking at the specific OpenCV code written for this task.</p>
  
  <p>Things we've tried:</p>
  
  <p>We've looked through the <a href="https://github.com/Itseez/opencv" rel="nofollow">opencv github repository</a> but it seems like the only function/methods we have access to are in c++ and we're not sure how opencv makes its python wrappers. </p>
  
  <p>We've also tried importing cv2 in a python shell and printing the location of the source code but didn't know where to start with the .so file and the other contents in that directory were not helpful either...</p>
  
  <pre><code>&gt;&gt;&gt; import cv2
  &gt;&gt;&gt; print cv2
  &lt;module 'cv2' from '/usr/local/lib/python2.7/dist-packages/cv2.so'&gt;
  </code></pre>
  
  <p>Any links to other responses (Is this actually supposed to be a question about c++ and python wrappers, or is there a simpler way to print out the findContours code in the cv2 module, or...?) or tips about what to do next would be greatly appreciated. Thanks!</p>