Posts‎ > ‎

IPP with OpenCV highGUI + VS 2008 express

posted Aug 5, 2009, 4:55 AM by rudy chip   [ updated Aug 9, 2009, 6:06 AM ]

Tools:
     -Intel Integrated Performance Primitive6.0-IA32
     -OpenCV_1.1pre1a
     -Microsoft Visual C++ 2008 Express

Steps:
1. Assumed has download & install the Tools.
2. Open /OpenCV/_make/opencv.vs2005.no_openmp.sln
3. Configure VS C++ 2008 Express :
     a. Tools -> Options -> Projects and Solutions -> VC++ Directories -> Show directories for:
         i. Executable files add C:\Program Files\Intel\Compiler\11.0\ipp\ia32\bin
        ii. Include files add C:\Program Files\Intel\Compiler\11.0\ipp\ia32\include
       iii. Library files add C:\Program Files\Intel\Compiler\11.0\ipp\ia32\stublib
                                   C:\Program Files\Intel\Compiler\11.0\ipp\ia32\lib
     b. At StartUp Project, right click select Properties -> Linker -> Input -> Additional Dependencies : add necessary .lib which contain in C:\Program                           Files\Intel\Compiler\11.0\ipp\ia32\stublib like ippi.lib, ippcore.lib, ipps.lib etc

4. Download libiomp5md.dll copy to Windows\System32

5. Open OpenCV/cxcore/src/cxswitcher.cpp :
     Go to function cvUseOptimized and Make sure at line 551,552,553 your IPP version exists.
        551 static const char* ipp_sfx_ia32[] = {”-6.1″, “-6.0″, “-5.3″, “-5.2″, “-5.1″, “”, 0 };
        552 static const char* ipp_sfx_ia64[] = { “64-6.1″, “64-6.0″, “64-5.3″, “64-5.2″, “64-5.1″, “64″, 0 };
        553 static const char* ipp_sfx_em64t[] = { “em64t-6.1″, “em64t-6.0″, “em64t-5.3″, “em64t-5.2″, “em64t-5.1″, “em64t”, 0 };
     Find and set VERBOSE_LOADING 1

6. Run code below to test whether IPP dlls can be used by OpenCV automatically:

#include "stdio.h"
#include "cv.h"
#pragma comment( lib, "highgui.lib" )
#pragma comment( lib, "cxcore.lib" )
int main(){
int NumUploadedFunction = 0;
int delay;
NumUploadedFunction = cvUseOptimized(1);
printf("\t NumUploadedFunction = %d \n\n", NumUploadedFunction);
const char* opencv_lib = 0;
const char* add_modules = 0;
cvGetModuleInfo(0, &opencv_lib,&add_modules);
printf("\t opencv_lib = %s,\n\t add_modules = %s\n\n", opencv_lib,add_modules);
scanf("%d",&delay);
return 0;
}

The right output is like
    
    NumUploadedFunction = 134
    opencv_lib = cxcore: 1.1.0,
    add_modules = ippcv-6.0.dll, ippi-6.0.dll, ipps-6.0.dll, ippvm-6.0.dll, ippcc-6.0.dll

7. Demo the code:
  IPPCanny.cpp ( attachment file) applies IPP Canny Detector and adapt from here and here


The Output :
cannyLena

Comments

ċ
rudy chip,
Aug 5, 2009, 5:03 AM
Comments