Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development

OpenCV project wizard for MinGW and Linux

(1/3) > >>

ollydbg:
Hi, I just create an OpenCV project wizard, I will put it here for some days until commit to trunk, comments are welcome.
Steps to use:
1,   unzip to share\CodeBlocks\templates\wizard\opencv
2,   add one line:

--- Code: ---    RegisterWizard(wizProject,     _T("opencv"),       _T("OpenCV project"),        _T("Console"));
--- End code ---
in share\CodeBlocks\templates\wizard\config.script

Edit1: I'm using this release:
http://sourceforge.net/projects/opencvlibrary/files/opencv-win/, you can download either 2.4.3, 2.4.4 and 2.4.5 Windows installer

Edit2: You need to use MinGW 4.6.1dw2 if you want to link to the prebuild opencv libraries, see this for details: which mingw compiler is used to create the pre-build libs in 2.4.3 release - OpenCV Q&A Forum

Edit3: I did not tested this wizard on Linux, so it may have bugs. ;D







[attachment deleted by admin]

scarphin:
I've finally tested it.

1- In the version number adjustment page, when an error occurs, the version number gets added to the file name again and again. I mean after I got a couple of path not found errors, I get an error message like "The lib path you entered seems invalid: File path\to\cv\lib/libopencv_core.244244244244244244244244.dll.a" not found. My CV version is '2.4.4.' btw. It seems to be searching for some file with lots of version repetitions in it which is not there actually. ;/

2- You included CV ver1 style headers in 'main.cpp', wouldn't it be better if they are ver2 style? Just a thought.

Couldn't go on testing it because of the error in step1, I'd like to continue after it's fixed though.

Win7 x64 SP1 cb rev8982

ollydbg:

--- Quote from: scarphin on May 01, 2013, 03:17:28 pm ---I've finally tested it.

1- In the version number adjustment page, when an error occurs, the version number gets added to the file name again and again. I mean after I got a couple of path not found errors, I get an error message like "The lib path you entered seems invalid: File path\to\cv\lib/libopencv_core.244244244244244244244244.dll.a" not found. My CV version is '2.4.4.' btw. It seems to be searching for some file with lots of version repetitions in it which is not there actually. ;/

--- End quote ---
Thanks for report this, I will dig into it, I guess the wrong path was saved to configure file. I will add many log messages in the next version. :)


--- Quote ---2- You included CV ver1 style headers in 'main.cpp', wouldn't it be better if they are ver2 style? Just a thought.

--- End quote ---
Ok, I will use more recent code cv::Mat.


--- Quote ---Couldn't go on testing it because of the error in step1, I'd like to continue after it's fixed though.
Win7 x64 SP1 cb rev8982

--- End quote ---
Many thanks, I will fix the bugs you reported.

BTW: I have create a python script to debug opencv matrix when debugging. See:
Visualize in memory OpenCV image or matrix from GDB pretty printers

scarphin:

--- Quote from: ollydbg on May 01, 2013, 03:25:45 pm ---Many thanks, I will fix the bugs you reported.

--- End quote ---

You're welcome and thanks to you for this wizard. ;)

I need to add, I had defined global variables for CV 'base', 'include' and 'lib' before I tested the wizard. Does the version adjustment change these variables or create new ones or...? I also didn't have a global variable for cv 'bin', what is that used for? Will it be better if I create it as a user-defined variable?

scarphin:
I think I've found the bug.

--- Code: ---VersionString += Major;
VersionString += Minor;
VersionString += Revision;

--- End code ---
Every time there is an error and the adjustment page cannot continue, these lines add 'Major' + 'Minor' + 'Revision' to 'VersionString' again and again.

I managed to get past the wizard by not making a mistake ever in the version adjustment and when I hit compile, it said,

--- Code: ---||=== Build: Debug in testcv (compiler: GNU GCC Compiler) ===|
ld.exe||cannot find -lopencv_imgproc244.dll|
ld.exe||cannot find -lopencv_core244.dll|
ld.exe||cannot find -lopencv_highgui244.dll|
||=== Build failed: 3 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|

--- End code ---
Then I checked search directories and the entries were,

--- Code: ---$(#cv)\x86\mingw\lib
$(#cv)\x86\mingw\bin

--- End code ---
but they should be,

--- Code: ---$(#cv.lib)
$(#cv.bin)

--- End code ---
because I've changed them in version adjustment page to use these values. And if I change them manually, the wizard works.

Edit: I think the lines under 'function SetupProject(project)'

--- Code: ---project.AddIncludeDir(OpenCVPathDefaultInc);
project.AddLibDir(OpenCVPathDefaultLib);
project.AddLibDir(OpenCVPathDefaultBin);

--- End code ---
should be

--- Code: ---project.AddIncludeDir(OpenCVPathInc);
project.AddLibDir(OpenCVPathLib);
project.AddLibDir(OpenCVPathBin);

--- End code ---

Navigation

[0] Message Index

[#] Next page

Go to full version