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)
- Other
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 opencv_contrib
Ā package.
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+
- Other
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?
- Home/hobby
- Academic
- Scientific
- Production
- Other
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.
My takeaways
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.
What's next? I recommend PyImageSearch University.
30+ total classes • 39h 44m video • Last updated: 12/2021
★★★★★ 4.84 (128 Ratings) • 3,000+ Students Enrolled
I strongly believe that if you had the right teacher you could master computer vision and deep learning.
Do you think learning computer vision and deep learning has to be time-consuming, overwhelming, and complicated? Or has to involve complex mathematics and equations? Or requires a degree in computer science?
Thatās not the case.
All you need to master computer vision and deep learning is for someone to explain things to you in simple, intuitive terms. And thatās exactly what I do. My mission is to change education and how complex Artificial Intelligence topics are taught.
If you're serious about learning computer vision, your next stop should be PyImageSearch University, the most comprehensive computer vision, deep learning, and OpenCV course online today. Here youāll learn how to successfully and confidently apply computer vision to your work, research, and projects. Join me in computer vision mastery.
Inside PyImageSearch University you'll find:
- ✓ 30+ courses on essential computer vision, deep learning, and OpenCV topics
- ✓ 30+ Certificates of Completion
- ✓ 39h 44m on-demand video
- ✓ Brand new courses released every month, ensuring you can keep up with state-of-the-art techniques
- ✓ Pre-configured Jupyter Notebooks in Google Colab
- ✓ Run all code examples in your web browser ā works on Windows, macOS, and Linux (no dev environment configuration required!)
- ✓ Access to centralized code repos for all 500+ tutorials on PyImageSearch
- ✓ Easy one-click downloads for code, datasets, pre-trained models, etc.
- ✓ Access on mobile, laptop, desktop, etc.
Summary
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.