upgrading OpenCV to 1.0

The openCV addon uses version of OpenCV. Version has been out since October 2006.

Is there any reason for using the older version? (just wondering if it breaks some ofw core?)

I’ve downloaded new version and put the required files into the right place libs/opencv/

heres a copy:

When compiling my code, it doesn’t find cvWarpPerspectiveQMatrix in ofwCvColorImage.

Any ideas?


they may have changed the syntax with 1.0.1 - the reason we are with 0.97 is no reason, just legacy – happy to move up to 1.0.1 -

I think the new function is named: cvWarpPerspective (in cv.h):

/* Warps image with perspective (projective) transform */  
CVAPI(void)  cvWarpPerspective( const CvArr* src, CvArr* dst, const CvMat* map_matrix, int flags CV_DEFAULT(CV_INTER_LINEAR+CV_WARP_FILL_OUTLIERS), CvScalar fillval CV_DEFAULT(cvScalarAll(0)) );  

can you give that a try ?


Very strange, I’ve come back to this tonight, and it builds fine without this error.

If you do this, it will print the opencv version you are running.

I am running 1.0.0, and everything seems to build and run ok.

My reason for updgrading is I want to try this:

Even though I have the latest version, for cvCreateGaussianBGModel() I get identifier not found :frowning:

it looks like you might need to include / link against cvAux (where the experimental code is) – in the worst case, just search for the function you want through all the code and see if it’s in 1.0.0…

the undocumented stuff of opencv is always weird to get running, and the documentation is seriously, seriously lacking. the wiki is pretty good, but it hasn’t caught up I think to include what you are mentioning:


take care!!

Zach, you are right again, its in cvaux.

cvbgfg_gaussmix.cpp in \v0.03\libs\opencv\cvaux\src\

Project settings, c++, include directories add

In linker > input add

That *should* be it right?

Still doesn’t find the function unfortunately.


it doesn’t find it in the includes or in linking? can you post the errors here?

I’ll dig around the 1.0 code, it might be a missing h file or a missing .cpp/lib if it’s a linking issue.

take care

It now includes ok, I forget to include cvaux in ofCvConstants.h:
#include “cv.h”
#include “cvaux.h”

It builds ok, but I get 118 build warnings (all saying the same):

1>c:\openframeworks\v0.03\libs\opencv\cvaux\include\cvvidsurv.hpp(122) : warning C4996: ‘strdup’ was declared deprecated
1> C:\Program Files\Microsoft Visual Studio 8\VC\include\string.h(205) : see declaration of ‘strdup’
1> Message: ‘The POSIX name for this item is deprecated. Instead, use the ISO C++ conformant name: _strdup. See online help for details.’

we have this

#if (_MSC_VER)       // microsoft visual studio  
#pragma warning(disable : 4996)     // disable all deprecation warnings  

in ofConstants, you might want to throw it somewhere else that includes the thing that throws all the warning. there are alot of deprecated things (as you can see) that would be a nightmare to change. it makes sense if you want to make software that can avoid malicious users (trying to cause buffer overflows, etc) but in our case we can usually safely ignore 4996 errors.

alternatively, looks like there is a flag you can pass to the compiler :
-wd4996 (or /wd4996). you can google “wd4996 cflags”. I dont’ have vs installed on the machine I am on, but this is an alternative which work across the whole compile, where as pragmas only work down the chain of includes…

take care,

Thanks, I put it in ofCvConstants.h and it works

#if (_MSC_VER)       // microsoft visual studio  
#pragma warning(disable : 4996)     // disable all deprecation warnings  
#include "cv.h"  
#include "cvaux.h"