Problem with use of IPP7.1 & OpenCV 2.4.1

Problem with use of IPP7.1 & OpenCV 2.4.1

Please say to me what steps I should follow for installing ipp7.1 on windows and use it in OpenCV2.4.2. I downloaded Ipp7.1 evaluation version and I used CMake 2.8 then I configured static OpenCV in CMake and Built all project in vs2008 without any problem.

For the static project I appended the following list for OpenCV & 3rdparty:

  • opencv_calib3d241.lib opencv_contrib241.lib opencv_core241.lib opencv_features2d241.lib opencv_flann241.lib opencv_gpu241.lib opencv_highgui241.lib opencv_imgproc241.lib opencv_legacy241.lib opencv_ml241.lib opencv_nonfree241.lib opencv_objdetect241.lib opencv_photo241.lib opencv_stitching241.lib opencv_ts241.lib opencv_video241.lib opencv_videostab241.lib
  • libjasper.lib libjasperd.lib libjpeg.lib libjpegd.lib libpng.lib libpngd.lib libtiff.lib libtiffd.lib zlib.lib zlibd.lib user32.lib

And then appended the following list for IPP static library:

  • ippac_l.lib ippcc_l.lib ippch_l.lib ippcore_l.lib ippcv_l.lib
  • ippdc_l.lib ippdi_l.lib ippi_l.lib ippj_l.lib ippm_l.lib ippr_l.lib
  • ippsc_l.lib ipps_l.lib ippvc_l.lib ippvm_l.lib

My project compiled without any problem.

I used the following code for a way to make sure that IPP is installed and working correctly. This function has 2 input arguments. First one is "opencv_lib" and it will be filled by the version of OpenCV. But my problem is with the second parameter. "add_modules" is always empty.

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);

There is another problem too which I believe it refers to the previous problem. In the following code I've used cvUseOptimized(1) and cvUseOptimized(0) before a same loop code. But the odd point is that the proccessing time is actually equall for both!

double  t1, t2,timeCalc;  

    IplImage *template_image = cvLoadImage ("c:\\box.png",0);
    IplImage* converted_image= cvLoadImage ("c:\\box_in_scene.png",0);
    CvSize cvsrcSize    = cvGetSize(converted_image);

    cout << " image match template using OpenCV cvMatchTemplate() " << endl;
    IplImage *image_ncc, *result_ncc;
    image_ncc = cvCreateImage(cvsrcSize,8,1);
    memcpy(image_ncc->imageData,converted_image->imageData,converted_image->imageSize);
    result_ncc = cvCreateImage(cvSize(converted_image->width -template_image->width+1,
                                            converted_image->height-template_image->height+1),IPL_DEPTH_32F,1);

    int NumUploadedFunction = cvUseOptimized(1);
    t1 = (double)cvGetTickCount();
    for (int j=0;j<LOOP;j++)
        cvMatchTemplate(image_ncc, template_image, result_ncc, CV_TM_CCORR_NORMED);
    t2 = (double)cvGetTickCount();
    timeCalc=(t2-t1)/((double)cvGetTickFrequency()*1000. * 1000.0);
    cout << " OpenCV matchtemplate using cross-correlation Valid: " << timeCalc << endl;

NumUploadedFunction = cvUseOptimized(0);
    t1 = (double)cvGetTickCount();
    for (int j=0;j<LOOP;j++)
        cvMatchTemplate(image_ncc, template_image, result_ncc, CV_TM_CCORR_NORMED);
    t2 = (double)cvGetTickCount();
    timeCalc=(t2-t1)/((double)cvGetTickFrequency()*1000. * 1000.0);
    cout << " OpenCV matchtemplate using cross-correlation Valid: " << timeCalc << endl;

4 posts / 0 nouveau(x)
Dernière contribution
Reportez-vous à notre Notice d'optimisation pour plus d'informations sur les choix et l'optimisation des performances dans les produits logiciels Intel.

Both questions are very OpenCV related and a question on an OpenCV forum has to be asked.

>>...But my problem is with the second parameter. "add_modules" is always empty...

This is at least 3 year old problem and since OpenCV could be downloaded and installed with a complete set of sources I recommend to do this:

- install OpenCV with sources
- build the library
- when debugging the test code you need to step into the 'cvGetModuleInfo' function in order to understand what could be wrong

>>...(1) and cvUseOptimized(0) before a same loop code. But the odd point is that the proccessing time is actually equall for both!...

The same as above is applicable in the 2nd case with a difference that you need to step into 'cvUseOptimized' function.

Regarding a declaration of 'cvGetModuleInfo' function. Could you post the function declaration from headers? I wonder if it is declared with 'char' or 'TCHAR' for the 2nd and 3rd parameters?

Also, please take a look at a similar very old thread on IPP forum:
.
http://software.intel.com/en-us/forums/topic/301795

A user finally resolved the problem and it was related to incorrectly set paths to IPP library.

Connectez-vous pour laisser un commentaire.