27

The latest release of OpenCV shows 2.4.11 Feb,2015 which is more recent then 3.0.0 which is in Beta. What is the difference between them. Should I use OpenCV 2.4.11 over 3.0.0 as I have encountered few bugs in 3.0.0. How do their releases work?

Manish Kumar Sharma
  • 12,982
  • 9
  • 58
  • 105

3 Answers3

42

Though there are new features( like text detection, KAZE detector ) in OpenCV 3.0, for most developers, this comparison is not about features. It is about speed. Unless you are immediately into production, I suggest you use OpenCV 3.0. Also, this is far from adventurous.

  1. The key difference is transparent API in OpenCV 3.0. Almost all OpenCV 3.0 methods are OpenCL accelerated. So, all methods could run on GPU and this could lead to improvement from 10 to 230%. Only change in required in your code is to use UMat where you used to use Mat. Samples(1). If you needed this performance in OpenCV 2.4.*, you had to explicitly invoke cv::ocl::* or cv::gpu::* methods.
  2. If you happen to be a Java developer, it is even better. Java wrappers for classes/methods which were unavailable earlier, are now provided in OpenCV 3.0 ( see widely used KalmanFilter )
  3. There are changes like internal module restructure, which from a developer point of view, is minor as that could be resolved by changing OpenCV headers in your code.

About the release cycle, a quick look into OpenCV github repo(2) shows, pull request are mostly going into master branch which is for OpenCV 3.0. So I assume, major bug fixes could be backported to 2.4.* branch.

For more, on differences read (3) and (4). About the bugs you encountered in 3.0 beta, it could helpful, if you could raise them with a minimal complete running sample at OpenCV issues page(5).

kiranpradeep
  • 10,859
  • 4
  • 50
  • 82
13

3.0.0 should bring a lot of new features but it's currently beta and not the official release (can be unstable). Last official stable release was 2.4.11.

Use the 3.0.0 if there is features you don't retrieve in 2.4.11 or if you are adventurous (3.0.0beta is great and the final release should come soon). If you want security with no additional needs, use 2.4.11.

Tom A
  • 639
  • 5
  • 10
  • 1
    Can you list a few features present additionally in 3.0.0? And why are they using the versioning as 3.0.0 instead of saying 2.4.12 beta? – Manish Kumar Sharma Apr 11 '15 at 17:15
  • 7
    3.0.0 will not be completely backwards compatible with 2.4.x. On top of this, many of the classes have been completely re-written, as well as an emphasis on GPU accelerated functions. There have been a number of new modules added, you can see a list of changes [here](http://code.opencv.org/projects/opencv/wiki/ChangeLog). – Nicholas Betsworth Apr 11 '15 at 17:24
  • They also opened up a challenge to integrate very disruptive technologies: http://code.opencv.org/projects/opencv/wiki/VisionChallenge – Tom A Apr 11 '15 at 18:19
  • @TomA : Wow! Thats terrific. I hope that ends up in some best quality algorithms being integrated in forthcoming releases. – Manish Kumar Sharma Apr 11 '15 at 18:47
  • @NicholasBetsworth the comment about backward compatibility appears confusing. Unless we use newer features like UMat, 3.0 code should run in 2.4, with minimal changes like include headers, enums, namespaces. – kiranpradeep Apr 12 '15 at 12:49
  • @Kiran My apologies, I may have worded it somewhat confusingly. However if you look at the [Change Log](http://code.opencv.org/projects/opencv/wiki/ChangeLog), "Although OpenCV 3 can be viewed as refined OpenCV 2 and is similar to the latter, this new version is not completely backward-compatible with OpenCV 2.". They list a number of changes that may break your code, if you wish to check it out. – Nicholas Betsworth Apr 12 '15 at 13:23
  • @NicholasBetsworth Ok. Thanks for changelog. But, from what ever little I tried with both versions, I was able to run with minimal code changes. – kiranpradeep Apr 12 '15 at 15:08
8

In addition to the answers provided above, another important difference is that SIFT/SURF feature detection has been taken off the default openCV 3.0 package. Since they are patented, openCV has moved 'non-free' algorithms to a different package:

opencv_contrib
seriousgeek
  • 992
  • 3
  • 13
  • 29
  • Thanks for pointing this out! Newbies to OpenCV should know that it's trivial to install the "contrib" version, though, so in practice, it's not a big deal. – rinogo Mar 30 '21 at 02:54