As we all know, OpenCV 3.0 was officially released back in June of 2015. This new update incorporated a ton of new features and optimizations, including Python 3 bindings.
But the big question on everyone’s mind is: “Should I switch to OpenCV 3? If so, when should I switch?”
Deciding when or even if you should switch to OpenCV 3 isn’t necessarily the easiest decision, especially (1) if you are deploying OpenCV to a production environment or (2) you’re doing research in the computer vision space.
In order to help answer whether or not you should switch to OpenCV 3 (along with “when” you should make the transition), I emailed a portion of PyImageSearch readers and asked them to take a quick four question survey on their OpenCV usage.
The results are quite insightful — but I’ll leave you to draw your own conclusions from the results before I share my key takeaways.
OpenCV 3 adoption rate
A few months ago I emailed subset of the most active PyImageSearch readers and asked them to answer a short, 4 question survey about their OpenCV usage. I received 431 responses which I have gathered here today. For most questions, readers were allowed to select multiple responses for each answer that was applicable to them.
Question #1: Which version of OpenCV are you currently using?
- OpenCV 2.4.X
- OpenCV 3.0 (includes beta, RC, and official release)
The purpose of this question was simply to establish a baseline on which version of OpenCV most people were using. As expected, OpenCV 2.4.X dominates OpenCV 3.0:
Not surprisingly, most people are still using OpenCV 2.4.X. However, 29% of developers, researchers, and programmers have already started using OpenCV 3.0 in some capacity. For a brand new major release of a library to achieve 29% usage in only a few short months is quite remarkable.
Will this adoption trend continue?
Yes, I believe it will. However, I think it will take another year for us to see OpenCV 3.0 hit 50% adoption rate, putting it equal with OpenCV 2.4.X.
The primary reason for this is because OpenCV 2.4 is still the de facto standard for computer vision development. OpenCV 2.4 has been around longer. It’s more stable. It’s had more bug patches applied. And it’s currently deployed to production environments and research labs around the world where the cost of switching is non-trivial and potentially quite expensive.
For example, with the release of OpenCV 3, common functions such as
cv2.findContours have different return signatures than OpenCV 2.4. The
cv2.normalize function signature has also changed. SIFT and SURF are no longer included in OpenCV 3 by default, requiring us to install the
Are these changes “deal-breakers”?
Absolutely not. But for large codebases, the cost of switching is non-trivial, especially since this is just the v3.0 release of OpenCV and more changes are likely to come as the version matures.
Question #2: Which version of Python are you currently using?
- Python 2.7+
- Python 3+
The results follow:
The fact that Python 2.7 is being used over 2.6x than Python 3 shouldn’t come as a surprise. First, the Python scientific community is reluctant to switch to Python 3 — although that is now quickly changing given NumPy, SciPy, scikit-learn, and the awesome 2to3 tool paving the way for Python 3 adoption.
Secondly, OpenCV 2.4.X was only compatible with Python 2.7. It wasn’t until the OpenCV 3.0 release that we received Python 3 support.
Simply put: if you were doing any development with OpenCV prior to June of 2015, you were most certainly using Python 2.7.
In fact, it’s quite a surprise to see that OpenCV users have reached 31% Python 3 usage! I would have guessed a far lower percentage of computer vision developers would be using Python 3. But then again, you could quite possibly be working on other projects unrelated to computer vision where the libraries are Python 3 compatible.
All that said, given the OpenCV 3 and Python 3+ integration, I fully expect this number to rise over the next year.
Question #3: What type of “setting” do you use OpenCV in?
Again, users were allowed to select all answers that applied. Below you can see the results:
It’s important to note that these answers are not mutually exclusive. Just because you may be doing academic or scientific research, does not mean that you cannot come home at the end of the day and work on your hobby computer vision project (in fact, I’m willing to be that’s what a lot of us do).
Similarly, “academic” and “scientific” do have a significant amount of overlap. If you’re writing and publishing papers at your university, then you’re most certainly using OpenCV in an academic setting. But you’re also conducting scientific research.
However, if you’re building a state-of-the-art computer vision product, then you’re performing scientific research in a production setting, but this research isn’t necessarily academic.
Personally, I don’t see OpenCV 3 affecting these numbers much.
Home and hobby users will be more likely to play with OpenCV and take it for a spin, especially when they go to the OpenCV.org website and see that OpenCV 3.0 is the latest, stable version.
But in a production, scientific, or academic setting, the cost of switching from OpenCV 2.4 to OpenCV 3 is much higher given legacy code and other dependencies. Furthermore, if you’re doing scientific/academic research, you may be reliant on OpenCV 2.4 to run legacy code associated with various experiments.
Question #4: Do you plan on upgrading to OpenCV 3.0?
- I am in no rush — I will take my time and upgrade when the v3 release is more mature.
- Yes, I am upgrading right now/have already upgraded.
- I have no plans to upgrade to OpenCV 3.0 right now.
Readers were only allowed to select one answer for this question.
Personally, I’m not too surprised by the response to this question. OpenCV is a big, established library with lots of history. It takes awhile to push out new releases, especially major ones. In fact, it’s been approximately 6 years since the v2.0 release. And 3 years in between v2.3 and v2.4 — talk about a long time in between releases!
Given that it takes awhile for new versions of the library to be released, it makes sense that the adoption rate is a bit slow as well. We’re all curious about the new version, but we may not fully adopt the latest version until we (1) have the time/resources to update our old code base or (2) we start a new project can start from scratch without worrying about dependencies.
If I were to sum up my opinion in only a single sentence it would be:
Don’t stress yourself out about switching to OpenCV 3.0.
If you’re starting from scratch:
If you’re starting a brand new project where you don’t have to worry about dependencies and legacy code, there is no harm in switching to OpenCV 3.0. In fact, in this particular case, I would encourage you to use OpenCV 3 since you will increase adoption rates and push the library forward. Just keep in mind that the library will evolve and that if you want to use OpenCV 3.0 now, you might have to update your code later when OpenCV 3.1 is released.
If you have an existing OpenCV project:
Unless there is a new feature inside OpenCV 3 that is not available in 2.4.X or you absolutely must have Python 3 support, it may be too early to migrate your entire codebase. In my opinion, OpenCV 3.0 is still very much in its infancy: there are still problems that need to be addressed and there are still bugs to be fixed. I would consider waiting until the v3.1 or even v3.2 release before you seriously consider making the big switch.
If you’re in an academic, scientific, or production setting:
I would advise against making the switch at this moment, provided that you have an existing codebase of experiments. As I mentioned before, OpenCV 2.4.X is still the de facto standard for computer vision development. The 2.4 flavors are much more mature and stable. And by sticking with the 2.4 version until v3 matures, you can save yourself a lot of headaches.
What is Adrian doing?
Personally, I have both OpenCV 2.4 and OpenCV 3 installed on my laptops. I use both of them daily, mainly so I can adjust to the OpenCV 3 environment (not to mention, work with Python 3) and help field any questions related to differences in the versions. But I am still using OpenCV 2.4 in all of my production environments. Eventually I will fully make the switch to OpenCV 3 — but I don’t see that realistically happening to the v3.1 or v3.2 release.
Recently, I sent out a survey to the most active PyImageSearch readers and asked whether or not they were planning on switching to OpenCV 3. I received 431 responses to this survey and have presented the results in this blog post.
Overall, most readers are in no hurry to switch to OpenCV 3.
Although I can reciprocate this feeling, I use both OpenCV 2.4 and 3.0 daily. If you’re using OpenCV in a home/hobby environment, by all means, upgrade to OpenCV 3 and play with it. But if you’re in a production, academic, or scientific setting, I would consider waiting until the v3 release matures a bit. The primary exception to this being if you are starting a brand new project where you don’t any dependencies or legacy code — in that case, I would encourage you to use OpenCV 3.
Join the PyImageSearch Newsletter and Grab My FREE 17-page Resource Guide PDF
Enter your email address below to join the PyImageSearch Newsletter and download my FREE 17-page Resource Guide PDF on Computer Vision, OpenCV, and Deep Learning.