Delphi-OpenCV
Project Delphi-OpenCV. Translation of OpenCV library header files in Delphi
git clone https://github.com/Laex/Delphi-OpenCV.gitLaex/Delphi-OpenCVDelphi-OpenCV
A comprehensive port of the OpenCV (Open Source Computer Vision Library) v2.4.13 to Delphi and FreePascal (FPC). This library enables object pascal developers to leverage computer vision algorithms, image/video processing tools, and FFMPEG integration directly in their applications.
🌟 Key Features
- Direct OpenCV Bindings: Direct access to OpenCV C/C++ APIs (v2.4.13) from Delphi code.
- FFMPEG Integration: IP camera / RTSP streaming via Delphi-FFMPEG (
rtpFFMPEG,TocvFFMpegIPCamSource) on Win32 and Win64. - Cross-Framework UI: Components and views ready for both VCL and FireMonkey (FMX) platforms.
- Rich Samples Collection: Ready-to-run examples demonstrating object tracking, camera captures, face detection (Haar cascades), motion detection, and OpenGL overlays.
📋 Prerequisites & Requirements
| Dependency | Version | Description | Download |
|---|---|---|---|
| OpenCV DLLs | 2.4.13.6 | opencv_*2413.dll / *2413d.dll (Win32) |
OpenCV 2.4.13.6 release |
| VC++ Redistributable | 2015 (VC14) | msvcp140.dll, vcruntime140.dll, … |
Microsoft VC++ 2015 Redistributable |
| FFmpeg DLLs | see Delphi-FFMPEG | Shared libs for rtpFFMPEG / IP camera (Win32 & Win64) |
Delphi-FFMPEG script, BtbN Win64, defisym Win32 |
| SDL | 1.2 & 2.0 | SDL.dll, SDL2.dll for some video examples |
SDL 1.2, SDL2 releases |
| JEDI | submodule | jedi.inc required by source/OpenCV.inc |
project-jedi/jedi |
| Delphi-FFMPEG | submodule / junction | Pascal FFmpeg bindings (libav*.pas) |
Laex/Delphi-FFMPEG — see setup below |
Note: The
redist/folder contains onlyreadme.mdstubs (ffmpeg,SDL,VC14) with download links. Runtime DLLs are not included in the repository.
🔗 Delphi-FFMPEG: submodule or development junction
All projects reference Delphi-FFMPEG/source inside this repository (<PROJECT_ROOT>/Delphi-FFMPEG/).
Standard setup (GitHub clone)
git clone --recurse-submodules https://github.com/Laex/Delphi-OpenCV.git cd Delphi-OpenCV
or after a plain clone:
InitDelphiFFMPEG.cmd
This initializes jedi and Delphi-FFMPEG git submodules.
Development setup (local Delphi-FFMPEG repo)
If you maintain FFmpeg bindings in a separate clone (e.g. D:\Work\Delphi\Delphi-FFMPEG), place it as a sibling of this repo or set a custom path:
Delphi/
├── Delphi-FFMPEG/ ← your working clone
└── OpenCV/
└── Delphi-OpenCV/ ← this repository
Run from <PROJECT_ROOT>:
InitDelphiFFMPEG.cmd
The script creates a directory junction Delphi-FFMPEG → ..\..\Delphi-FFMPEG when that folder contains source/. Projects keep using Delphi-FFMPEG/source — no path changes needed.
Custom path: copy InitDelphiFFMPEG.local.cmd.example to InitDelphiFFMPEG.local.cmd and set FFMPEG_DEV_PATH.
Manual junction:
mklink /J Delphi-FFMPEG D:\Work\Delphi\Delphi-FFMPEG
🛠️ Installation Guide
Step 1: Clone and run setup
git clone https://github.com/Laex/Delphi-OpenCV.git cd Delphi-OpenCV InitDelphiFFMPEG.cmd
Step 2: Configure Delphi Library Paths
Add in Tools → Options → Language → Delphi → Library → Library path:
<PROJECT_ROOT>/source
<PROJECT_ROOT>/source/opengl
<PROJECT_ROOT>/source/sdl
<PROJECT_ROOT>/source/sdl2
<PROJECT_ROOT>/packages
<PROJECT_ROOT>/resource
<PROJECT_ROOT>/resource/facedetectxml
<PROJECT_ROOT>/jedi
<PROJECT_ROOT>/Delphi-FFMPEG/source
Note:
opencv_cpp_classesis archival only. For OpenCV C++ / 5.x use Delphi-OpenCV5.
Step 3: Set up runtime DLLs
| DLL group | Source |
|---|---|
| OpenCV 2.4.13 | OpenCV 2.4.13.6 |
| VC++ 2015 | VC++ 2015 |
| FFmpeg | Delphi-FFMPEG download script |
| SDL | SDL 1.2, SDL2 |
Copy DLLs next to your .exe or onto PATH.
Step 4: Verify configuration
Build and run <PROJECT_ROOT>/CheckCVDep/CheckCVDep.dproj.
Step 5: Install Delphi packages
Open packages/<your Delphi version>/ and install in order:
rtpFFMPEG.dpkrclVCLOpenCV.dpkrclFMXOpenCV.dpkdclVCLOpenCV.dpkdclFMXOpenCV.dpk
📂 Directory Structure
<PROJECT_ROOT>
├── Delphi-FFMPEG # Submodule, or junction to your dev clone
├── jedi # JEDI submodule
├── packages # Delphi IDE packages (D2010–D13)
├── samples # Demo projects
├── source # OpenCV 2.4 C API bindings
└── opencv_cpp_classes # Archival C++ experiment (see folder README.md)
🚀 Examples & Demos
samples/LibDemo/LibDemo.groupproj— basic OpenCV functions and bindingssamples/MultiDemo/MultiDemo.groupproj— video processing, motion detectionsamples/VCLDemo/VCLDemo.groupproj— VCL visual wrapperssamples/Components/ComponentsDemo.groupproj— IDE componentsDelphi-FFMPEG/examples/Examples.groupproj— low-level FFmpeg API samples
For OpenCV C++ / 5.x see Delphi-OpenCV5.
👥 Contributors
- Laentir Valetov (Lead Contributor) — laex@bk.ru
- Mikhail Grigorev — sleuthhound@gmail.com
📄 License
This project is licensed under the Mozilla Public License Version 1.1 (MPL 1.1). See Mozilla MPL 1.1.
more like this