opencv各版本速度比较
(2011-09-17 19:44:09)
标签:
opencv速度比较speedcomparisonofit |
分类: OpenCV |
Speed comparison of OpenCV v1.1, v2.0, v2.1 and v2.2
Yes it seems that some very basic operations such as copying an
image or matrix or using Regions Of Interest or direct pixel access
that have slowed down a lot, because the C++ interface sometimes
creates temporary image copies during operations whereas the C
interface accessed the data directly, etc. I did not bother testing
that sort of thing since it is highly specific to the way someone
uses the C++ interface, and I'm not familiar enough with the C++
interface to analyze the different methods. But there are other
times when you call a single OpenCV function that does a major
operation, such as face detection, so I just analyzed 2 of those
cases. I'm sure there are also some OpenCV functions that are
faster now than they used to be (especially since the newer
versions supposedly use some MMX/SSE automatically whereas it used
to require IPP), its just that I haven't found them yet!
Cheers,
Shervin Emami.
http://www.shervinemami.info/openCV.html
Hi Sherman,
Interesting test, but should be interesting also looking at your code. There are operations in STD C++ that make the code very slow. If I remember well you replied to one of my email about this "issue".
I would like to understand better which code world better in which version.
Regards
Walter
-- Inviato dal mio cellulare Android con K-9 Mail.
ShervinEmami <shervin.emami@gmail.com> ha scritto:I have performed some basic timing tests comparing different versions of OpenCV as well as the C interface vs the C++ interface. Obviously there are some basic operations such as copying or cropping images & matrices where there is a huge difference in speed in different versions and C vs C++ interface, but I was interested in the large functions that often cause the major delays in software. So I analyzed 2 common computer vision tasks: detecting lines using the Probabilistic Hough transform, and detecting faces using the Haar detector.
The overall conclusion was that some features are the same speed in all versions of OpenCV, some features take twice as long in newer versions of OpenCV, and some features take twice as long in the C++ or C interface (depending on the version). But basically, for fastest speed you should use the old C interface with OpenCV v1.1, or if you need newer features then use the C++ interface with the latest version of OpenCV.
Interestingly, I found that the Haar face detector is quite different both in speed AND detection results between different versions of OpenCV and between the C vs C++ interface. The fastest face detector was in OpenCV v1.1 using the C interface but the most reliable face detector is the current one (since OpenCV v2.1) but only if you use the C++ interface rather than the old C interface! Since the Haar detector is such a crucial feature of many OpenCV projects and is often the slowest part of the project, this is a fairly important issue.
More detailed results (including the test code) are shown in:
http://www.shervinemami.info/timingTests.html
Cheers,
Shervin Emami.
http://www.shervinemami.info/
http://www.shervinemami./

加载中…