A python package to generate AR markers and patterns based on input images
Project description
PyMarker
A python package to manage Augmented Reality markers and patterns based on input images. This package is capable of generating black borders around images to be used as AR markers and also removing them in cases where you need to automatize the process.
Installation
PyMarker is available through pip and Pypi.
python3 -m pip install pymarker --user
// or
pip3 install pymarker --user
Usage
Pymarker provides three features for a marker-based AR: generating Pattern files (.patt); Markers images (.png); Removing borders of existing Marker images. The marker will be used by the user to visualize some augmented reality, the pattern file for the system to be able to recognize the marker.
An example input image:
Expected output patt:
Expected output marker:
Using the remove feature, we can return this marker to the starter image back again:
Commands
PyMarker now uses subcommands for its CLI interface.
Generate markers and patt files
By default, the generate subcommand receives an image and generates both patt and marker files:
$ pymarker generate tests/input/hiro.jpg
To generate only the patt file for the input, use the -p or --patt flag:
$ pymarker generate -p tests/input/hiro.jpg
# or
$ pymarker generate --patt tests/input/hiro.jpg
To generate only the marker, use the -m or --marker flag:
$ pymarker generate -m tests/input/hiro.jpg
# or
$ pymarker generate --marker tests/input/hiro.jpg
You can adjust the marker border size with -b (black border, default 20%) and -w (white border, default 3%):
$ pymarker generate -b 40 -w 5 tests/input/hiro.jpg
You can also specify an output path with -o or --output:
$ pymarker generate -o output_dir/ tests/input/hiro.jpg
Remove borders from marker images
To remove borders from a marker image, use the remove subcommand:
$ pymarker remove tests/input/marker.png
You can specify an output path for the result:
$ pymarker remove -o output_dir/ tests/input/marker.png
Modules
You can use the functions directly from your python code to generate markers and patts.
from pymarker.core import generate_patt, generate_marker
def main():
filename = "tests/input/hiro.jpg"
border_size = 50 // size in percentage
generate_patt(filename)
generate_marker(filename,border_size)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pymarker-1.2.2.tar.gz.
File metadata
- Download URL: pymarker-1.2.2.tar.gz
- Upload date:
- Size: 18.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.4 CPython/3.12.12 Linux/6.11.0-1018-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7c618921baf988f9959e4714e891e962906609ae5cdf552c13a5213037b9154d
|
|
| MD5 |
cf285de985d129313b2de06899b9d8cb
|
|
| BLAKE2b-256 |
0217175f059f322e6d3f6b84736354362ac7ab86b2a7332f0ba9b525c1596e02
|
File details
Details for the file pymarker-1.2.2-py3-none-any.whl.
File metadata
- Download URL: pymarker-1.2.2-py3-none-any.whl
- Upload date:
- Size: 19.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.4 CPython/3.12.12 Linux/6.11.0-1018-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c890a0e5e0f477844aa37b4e3c66eae8a572b20bcfce0c8806ab470587a2e4ee
|
|
| MD5 |
1cce990af429af4eeda120413916d993
|
|
| BLAKE2b-256 |
851004bae0a211512538f6794eac173bd894549707ff1bdf4512b290b33fc8e2
|