This is an unofficial guide. The official OpenCV project is at opencv.org.
What is OpenCV?
OpenCV for Windows — the world's most popular computer vision library
OpenCV (Open Source Computer Vision Library) is a free, open-source library with over 2,500 optimised algorithms for image processing, video analysis, face detection, object tracking, machine learning and more. It supports Python, C++, Java and MATLAB. On Windows it runs on Python via pip or as a C++ library configured in Visual Studio or CMake.
Quick install
Get OpenCV running in 60 seconds
# Python (recommended for most users):
C:\> pip install opencv-python
Successfully installed opencv-python-4.12.0.86
# Verify:
C:\> python -c "import cv2; print(cv2.__version__)"
4.12.0
For C++ development see C++ / Visual Studio guide. For CUDA GPU acceleration see CUDA guide.
All guides
OpenCV on Windows — complete guide index
| Guide | What it covers |
|---|---|
| Python install | pip, venv, conda, headless vs contrib |
| C++ / Visual Studio | include paths, linker settings, DLL fix |
| CUDA / GPU | CUDA build, cuDNN, GPU acceleration |
| Install methods | pip vs conda vs source vs vcpkg |
| Quickstart | camera, images, video I/O |
| Troubleshooting | DLL errors, PATH, import errors |
| opencv_iconv.dll fix | WinError 126, missing DLL |
| opencv_world.dll fix | C++ DLL not found |
| import cv2 error | module not found, DLL load failed |
| CMake build | build from source on Windows |
| Contrib modules | extra modules, face recognition |
| VS Code setup | IntelliSense, C++ extension |
| Conda / Anaconda | conda install, environment setup |
| Headless mode | server use, no GUI |
| VideoCapture | camera open, DirectShow, MSMF |
| Version check | check and update OpenCV |
| Face detection | Haar cascade, DNN detector |
| Uninstall | remove OpenCV completely |
| FAQ | all common questions |
Quick answers
Common questions
Is OpenCV free?
Yes. OpenCV is released under the Apache 2.0 license, which allows free personal and commercial use without restrictions.
pip install opencv-python vs opencv-contrib-python?
opencv-python contains the main modules. opencv-contrib-python adds extra community modules including face recognition, text detection and more. Install contrib if you need those features. Do not install both at the same time — they conflict.DLL load failed: WinError 126 after installing
This is the most common issue on Windows. It means a dependency DLL is missing. Fix: install Visual C++ Redistributable from microsoft.com, then
pip install opencv-python --force-reinstall. Full fix at opencv_iconv.dll error guide.