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 this question (Thanks to jason), I navigated my way to the patch where I found both the code and the header.
What I did was to add a new file connectedcomponents.cpp
in C:\opencv\modules\imgproc\src
, in which I placed the code for this new function. Next, I went to C:\opencv\modules\imgproc\include\opencv2\imgproc
and I added the appropriate export header to imgproc.hpp
. Finally, I rebuilt the opencv_imgproc
project in the OpenCV source code using Visual Studio 2010. Everything builds fine, and generates the opencv_imgproc244.dll
, opencv_imgproc244.lib
, and opencv_imgproc244.exp
files for me.
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 #include <opencv2/imgproc/imgproc.hpp>
, and from here I can access all the other methods in the file, except for the new one that I want.
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.
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 cvBlobsLib 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).