OpenCV 2.2

Peter's picture

Hi Everyone,

I am working on porting the Kineme CVTools to OpenCV 2.2 and improving the heck out of it to improve the overall performance. But because this is a way bigger task than I initially thought it would be, I started from scratch and created a lightweight version for my projects.

The Lion version of QC now comes with a build in Face detection patch and this task might becomes partly obsolete now. I can still imagine on the other hand the implementation of some new interesting things like hand/finger detection, gestures etc.

Nevertheless, I wanted to present my preliminary solution in form of a small test plugin to get some feedback from you guys. Especially how it performs vs. the Lion version on your Mac.

-New modes: Find Biggest Object and Rough Search

While a multi object detection still takes about the same amount of time compared to OpenCV 1.x, using the new modes increased the performance up to 10 times for me (yay!).

-Sender and Receiver functionality: Send the detection results out and receive them in another composition. I use distributed objects for the transportation layer. This is only interesting when you like to run two compositions at the same time using the same detection results = only one detection process is needed.

-General tweaks to improve performance

Compared to the Lion version, this one is still noticeable faster for me.

Attached the test plugin file and some compositions to play with.

Please use the plugin only for test purposes as it is still in early stages. Patches run on Snow Leopard and Lion only.

Any feedback and improvement ideas are very much appreciated.

Thanks, -Peter

PreviewAttachmentSize
QC OpenCV2 Tests.zip3.52 MB

gtoledo3's picture
Re: OpenCV 2.2

What do you mean by "porting the Kineme CVTools to OpenCV 2.2"? Is this the CVTools project?

"I can still imagine on the other hand the implementation of some new interesting things like hand/finger detection, gestures etc."

Kineme CVTools provides hand, face, eye, detection etc. now through support for haar files, among other features. The Lion patch seems to replicate a subset of that functionality, with built in reference files for the face shapes.

"-General tweaks to improve performance

Compared to the Lion version, this one is still noticeable faster for me."

This is confusing... tweaks to improve performance of what, and what Lion version? Are you talking about the apple Lion face tracker, CVTools, or kind of talking about all of the feature set of both patches in aggregate?

What do you think it is that's lacking in performance with the current CVTools? It seems as though some more patches could be added, but it doesn't seem as though it is lacking in performance.

Peter's picture
Re: OpenCV 2.2

No this is not based on the CVTools project, I wanted to create a lightweight project first to test how OpenCV 2 behaves in a QC environment and also try out a few different ideas that I had (e.g. off/on switch, sender and receiver patch). Also, if it was even the afford worth to go to OpenCV 2.

I really started noticing the performance factor when working on compositions which are doing a lot of other things in the background. (E.G. image calculations, running things on multiple screens, etc.).

I use Lion 10.7 and this is only about the haar detection for now.

I still like to try my luck on bringing the CVTools to OpenCV 2 though but wanted to get your guys feedback and ideas as well.

dust's picture
Re: OpenCV 2.2

seems to run faster than cv tools for me. is this cv 2.3 ? I'm building 2.3 now and it seems there is support for cuda. i bet that would drastically speed things up. can not confirm as it appears CV is griping about me having the wrong cuda build or what not.

seems to be that apples new face core has the best performance out of the 3 tests you have provided. cv detection alone being faster than cv tools. cv detection with send and receive give me the same results as CV tools. i suppose a test with multiple faces could change things ?

any chance on sharing the code ?

vade's picture
Re: OpenCV 2.2

Fork and contribute to this:

https://github.com/mirek/quartzcomposer-opencv/commits/master

I have a few objects using his base, which are pretty decently fast, that I need to share.

dust's picture
Re: OpenCV 2.2

nice thanks vade and mirek.

Peter's picture
Re: OpenCV 2.2

Thanks for the info!

I would love to see it running with CUDA support. Unfortunately, I only have an ATI GPU which doesn't seem to support this and probably never will.

I like to iron out some smaller issues first and un-spagetti my code before I share the project. I will keep you posted.

Peter's picture
Re: OpenCV 2.2

Thanks vade.

Does this plugin uses the unofficial API? At the moment I use the official one... I probably need to convert it first then.

dust's picture
Re: OpenCV 2.2

mirek's plugins use the official api extensively. i suppose at first glance one may think he is using a un-official api but its all official he just puts plugins together a bit differently than others, or dev examples do.

samy's picture
Re: OpenCV 2.2

Hey all,

Does anyone have a recently compiled version of the OpenCV plugin? I can't seem to compile it on 10.8.4 using Xcode 4.6.3 (I've tried switching between libc++ and libstdc++, not sure what else to test out):

quartzcomposer-opencv/include/opencv/cxoperations.hpp:1258:15: No viable overloaded '=' r = Range(0, d.size());

quartzcomposer-opencv/include/opencv/cxmat.hpp:2978:12: No viable conversion from 'MatExpr_<MatExpr_Op3_<[4 * ...], MatOp_Bin_>, [...]>' to 'MatExpr_<MatExpr_Op3_<[4 * ...], MatOp_BinS_>, [...]>' return MatExpr_<MatExpr_Temp, Mat >(MatExpr_Temp(a, Scalar(0), 'a'));

quartzcomposer-opencv/include/opencv/cxmat.hpp:3956:14: Call to non-static member function without an object argument Mat::operator = (m);