Recompile OpenCV 1.1 for 64 bit Windows 7
I have a large code base that I wrote to use OpenCV 1.1. Originally I wrote this for a 32 bit Windows XP box. Now I would like to compile the code for 64 bit Windows 7. Here are some questions:
- Are there pre-comipiled 64 bit binaries for OpenCV 1.1 that I can link against? If so where?
- How possible would it be to recompile OpenCV 1.1 from source using mingw-w64 or some other compiler that could target 64bit?
- How difficult would recompiling be compared to updating my code to run with OpenCV2.x?
My code is hefty, maybe ten thousand lines or so. (For those interested the code is here: http://github.com/samuellab/mindcontrol )
Why am I bothering? Why not run this as a 32 bit binary on 64 bit Windows? Well with the migration to newer hardware I must now link my code against 64 bit binaries. As I understand it, I cannot generate 32 bit code that is statically linked to third party 64 bit libraries. So my conclusion is to recompile everything for 64 bit including OpenCV.
I am on Windows 7 64 bit. I have been using 32bit mingw from mingw.org for compiling for 32 bit targets and the mingw-w64 cross compiler for compiling to 64 bit targets.
Any help would be appreciated.
Thank you.
"How difficult would recompiling be compared to updating my code to run with OpenCV2.x?"
if i were in your shoes, before trying anything else, i'd get 2.4.4 and try to compile your codebase against it. yes, stuff got deprecated / moved to legacy (but afaiik, nothing ever got thrown away )
headers changed, libraries too, most of the work will go into changing your projects/makefiles
at least you're up to date then, any effort in upwarming 1.1 seems to be a dead end
Yeah. That makes sense.
It seems here: http://docs.opencv.org/trunk/doc/tutorials/core/interoperability_with_OpenCV_1/interoperability_with_OpenCV_1.html that you they dropped the "cv" from the beginning of all the functions? Does that mean I will have to go through and rename every opencv function I call?
hehe, not me, i'm not part of that team ;)
and no, the 1.1 api is still the same, cvNamedWindow, etc, it still runs, as of 2.4.9 ( github master )
the 2.0 api is running in parallel, it has all calls with replaced cv prefix for cv:: namespace prefix, but that should not bother you
Thanks @berak. I just git cloned the most recent OpenCV 2.4.9 and am still figuring out how the heading structure works. It seems like the legacy opencv headers that I am familiar with are in: opencv/include/opencv/ but that then just point to other headers that are not where I would expect. Seems like core_c.h for example is in: opencv/modules/core/include/ opencv2/core/ I may have to seriously redo my makefile.
bit unfortunate, cloning current master, since in 2.0 core.hpp was inside the core folder, too, and they just(week ago) moved it out ( up one to opencv2 )
also, if you're looking for functions "vanished", they're most probably in legacy.hpp
"I may have to seriously redo my makefile." yes, but if the ppl there did it right, that's all you've got to do ;)
Now I'm thinking it might be worth learning cmake, since OpenCV seems to play really nicely with it. Maybe I can reimplement my make file in cmake since i'm going to have to change it all up anyway.
I would recommend to not work with 'master' branch, please use '2.4' instead. 'master' is used for 3.0 preparation, and you'll have a lot of troubles using it...
Thanks @Kirill, I am already downgraded to
2.4.
However, I am have all sorts of problems getting cmake to use mingw-w64, see this question: http://answers.opencv.org/question/11600/can-opencv-2x-be-compiled-with-mingw-w64-through/