augmented is a cross-platform Python library for augmented reality. It provides image overlay and ArUco marker-based AR using OpenCV.
- Image Overlay — Detect a target image in a live camera feed and overlay another image on top of it using ORB feature matching and homography.
- ArUco Marker AR — Detect ArUco markers in real-time and augment them with custom images.
- Debug mode for visualizing feature matches and warping steps.
- Simple, minimal API.
pip install augmentedRequirements:
- Python 3.9+
- opencv-contrib-python >= 4.8.0
- numpy >= 1.21.0
import augmented
ar = augmented.ar_overlay(capture=0)
ar.setup(
targetImage="target.jpg",
overlayImage="overlay.png",
nfeatures=1000,
debug=True,
confidence=25,
displayName="Augmented"
)
ar.start(display=True)Run in a loop for continuous tracking:
while True:
ar.start(display=True)import augmented
arucoar = augmented.arucoar(cam=0)
imgAug = {0: "assets/unnamed.jpg"}
arucoar.setup(
imgAug=imgAug,
markerSize=6,
totalMarkers=250,
debug=True,
displayName="Augmented AR"
)
while True:
arucoar.start(display=True)| Parameter | Type | Description |
|---|---|---|
capture |
int |
Camera device index |
| Parameter | Type | Default | Description |
|---|---|---|---|
targetImage |
str |
— | Path to the image to detect |
overlayImage |
str |
— | Path to the overlay image |
nfeatures |
int |
— | Number of ORB features to detect (1000 recommended) |
debug |
bool |
True |
Show debug visualizations |
confidence |
int |
25 |
Minimum feature matches to trigger overlay |
displayName |
str |
"Augmented by sarang" |
OpenCV window title |
Process one frame. Returns [stacked_frame, augmented_frame].
| Parameter | Type | Default | Description |
|---|---|---|---|
cam |
int |
0 |
Camera device index |
| Parameter | Type | Default | Description |
|---|---|---|---|
imgAug |
dict |
— | {aruco_id: image_path} mapping |
markerSize |
int |
6 |
ArUco marker grid size |
totalMarkers |
int |
250 |
Total markers in the dictionary |
debug |
bool |
True |
Enable debug output |
displayName |
str |
"Augmented by Sarang" |
OpenCV window title |
Process one frame. Returns the augmented frame.
BSD-3-Clause. See LICENSE.