title: Adding my own function to OpenCV
body: <p>I need to add a new method that computes connected components to OpenCV 2.4.4 to use in one of my own projects.  I already have the code for the function from <a href="https://stackoverflow.com/questions/4641817/blob-extraction-in-opencv/10116591#10116591">this question</a> (Thanks to <a href="https://stackoverflow.com/users/1327999/jason">jason</a>), I navigated my way to <a href="http://code.opencv.org/attachments/467/opencv-connectedcomponents.patch" rel="nofollow noreferrer">the patch</a> where I found both the code and the header.</p>
  
  <p>What I did was to add a new file <code>connectedcomponents.cpp</code> in <code>C:\opencv\modules\imgproc\src</code>, in which I placed the code for this new function.  Next, I went to <code>C:\opencv\modules\imgproc\include\opencv2\imgproc</code> and I added the appropriate export header to <code>imgproc.hpp</code>.  Finally, I rebuilt the <code>opencv_imgproc</code> project in the OpenCV source code using Visual Studio 2010.  Everything builds fine, and generates the <code>opencv_imgproc244.dll</code>, <code>opencv_imgproc244.lib</code>, and <code>opencv_imgproc244.exp</code> files for me.</p>
  
  <p>Now, I copy these files (except for the .exp, where I can't find where it should go?) into my existing OpenCV directory and replace the old files.  When I now try to build my own project, everything still builds fine, but I cannot access the new method from here.  I include <code>#include &lt;opencv2/imgproc/imgproc.hpp&gt;</code>, and from here I can access all the other methods in the file, except for the new one that I want.</p>
  
  <p>The fact that everything compiles but that the method is not exposed leads me to think there is some other file that I should have changed as well, however, due to lack of experience I do not know where or what this file could be.</p>
  
  <p>Extra information:
  I am using Visual Studio 2010, OpenCV 2.4.4 and built OpenCV with CMake 2.8.10.2
  I am aware that there are libaries such as <a href="http://opencv.willowgarage.com/wiki/cvBlobsLib" rel="nofollow noreferrer">cvBlobsLib</a> that compute connected components, and I have successfully used these in my project.  However, I want a faster and more recent solution (cvBlobsLib still uses the old IplImage).</p>