A Free Pascal / Lazarus wrapper for the Intel RealSense SDK (librealsense), letting you use Intel RealSense depth cameras directly from Object Pascal applications.
💡 New to modern Free Pascal? Check out this excellent introduction article to get up to speed quickly.
- ✅ Full Pascal binding for the Intel RealSense C API
- ✅ Works with Lazarus (GUI and console applications)
- ✅ Cross-platform: Windows and Linux
- ✅ Easy-to-install Lazarus package (
laz_realsense) - ✅ Includes ready-to-run examples to get you started fast
- ✅ Clean, idiomatic Object Pascal — no external dependencies beyond librealsense
- Any Intel RealSense camera (D400 series recommended)
| Component | Version | Notes |
|---|---|---|
| Lazarus IDE | 2.2 or later | 64-bit recommended |
| Free Pascal Compiler (FPC) | 3.2 or later | Bundled with Lazarus |
| Intel librealsense | 2.x | Install separately |
- Windows 10 / 11 (64-bit) — requires
realsense2.dllaccessible in your PATH or next to your executable - Linux — requires
librealsense2.soinstalled (via apt or built from source)
If you don't have Lazarus yet, download the 64-bit installer from the official site and make sure to select the version matching your OS.
Download and install the Intel RealSense SDK for your platform from the librealsense releases page.
- Windows: Run the installer — it will place
realsense2.dllin your system. - Linux: Follow the official Linux installation guide.
git clone https://github.com/Blueicaro/Pascal-Librealsense.gitOr download the ZIP from the GitHub interface and extract it to a folder of your choice.
In Lazarus, go to Package → Open Package File (.lpk)…
Navigate to the cloned repository and open:
Lazarus package / laz_realsense.lpk
Click Compile. Once compiled, you can close the package window.
Create a new project (console or GUI application) or open an existing one.
Go to Project → Project Inspector and click Add to add a new requirement.
Search for laz_realsense and select it.
You're all set — start writing your Pascal code! 🎉
⚠️ Windows note: Make surerealsense2.dllis either in the same folder as your compiled executable or in a directory listed in your system PATH.
The examples/ folder contains several ready-to-run projects. To open one in Lazarus, go to Project → Open Project…
Navigate to the examples/ folder and pick one. If this is your first time, start with TestLib — it verifies that the library is correctly found and working.
Press Run (or F9) to build and execute the example.
If you see an error like the one below, your program cannot locate the RealSense library.
Fix: Place realsense2.dll (Windows) or ensure librealsense2.so is installed (Linux) so your OS can find it — either next to the executable or in the system PATH.
Contributions are very welcome! Here's how to get involved:
- Fork this repository and create a branch from
main. - Make your changes — whether it's fixing a bug, adding bindings, or improving documentation.
- Make sure the existing examples still compile and run correctly.
- Open a Pull Request with a clear description of what you changed and why.
If you find a bug or have a feature request, please open an issue — all feedback is appreciated.
This project is licensed under the Apache License, Version 2.0.











