开发者

intentional mix of opencv versions

I have a project that use to use OpenCV1.1 and now has moved to use OpenCV2.2. This project uses opencv's face detection, and this happens to be about twice slower in version 2.2 that in 1.1. This slow down is affecting the realtime performance of this project.

I wondered if I could use the facedetector in 1.1 while using 2.2 for other not time critical parts of the project. So I tried a couple of things with limited success. First I tried to use both versions in the same project but I had various built problems I couldn’t resolve. Then I tried to make a dll with just the face detector in 1.1 and use this dll in the project that used 2.2. This works but, strangely, despite I can measure a speed increase for the face detection (which i开发者_开发知识库s opencv1.1 wrapped in the dll), the rest of parts in the project seem to have slowed down. I don’t know what is happening, maybe some internal conflict between opencv versions, deadlocking or something like this.

Has anybody tried this before? Any help would be appreciated

Martin.


It can work. Don't link your project to the v1.1 DLLs. It's also probably best to rename OpenCV 1.1 DLLs to something else and prevent possible conflicts on your system with the v2.2 DLLs.

The trick consists in loading DLLs dinamically. Use LoadLibrary() to load v1.1 DLLs into your application and GetProcAddress() to retrieve the addresses of the functions (to be able to call them later on your code).

Note: you need to call GetProcAddress() once for every function of OpenCV v1.1 you are using on your code.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜