Quick Start
Get up and running with OpenCV on Linux in a few minutes:Compiler Support
OpenCV supports multiple compilers on Linux:- GCC
- Clang
GCC is the default compiler on most Linux systems:
Build System Options
- Make (Default)
- Ninja
Traditional GNU Make build system:The
-j$(nproc) flag enables parallel compilation using all CPU cores.Installing Dependencies
Required Dependencies
Optional Dependencies
GUI Support (highgui module)
GUI Support (highgui module)
Video I/O Support
Video I/O Support
Image Codecs
Image Codecs
Python Support
Python Support
Parallel Processing
Parallel Processing
Cross-Compilation
OpenCV provides toolchain files for cross-compilation to other architectures:ARM 32-bit (ARMv7)
ARM 64-bit (AArch64)
RISC-V 64-bit
Available toolchain files in
platforms/linux/:arm-gnueabi.toolchain.cmake- ARM v7 with hard floataarch64-gnu.toolchain.cmake- ARM 64-bitriscv64-gcc.toolchain.cmake- RISC-V 64-bit (GCC)riscv64-clang.toolchain.cmake- RISC-V 64-bit (Clang)ppc64le-gnu.toolchain.cmake- PowerPC 64-bit little-endianmips64r6el-gnu.toolchain.cmake- MIPS 64-bit
Build Configuration Options
Common CMake Options
Minimal Build for Embedded Systems
GPU Acceleration
- CUDA (NVIDIA)
- OpenCL
- VA-API (Intel)
Installation
System-Wide Installation
Custom Installation Directory
Verification
Verify your OpenCV installation:Distribution-Specific Notes
- Ubuntu/Debian
- Fedora/RHEL
- Arch Linux
Troubleshooting
CMake cannot find dependencies
CMake cannot find dependencies
Install development packages for missing dependencies:
Linking errors during compilation
Linking errors during compilation
Clean and rebuild:
Python module not found after installation
Python module not found after installation
Ensure Python can find the cv2 module:
Next Steps
CMake Configuration
Explore all CMake configuration options
Getting Started
Write your first OpenCV application
Cross-Compilation
Build for embedded systems
GPU Acceleration
Enable CUDA and OpenCL support
