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)
Metadata
Release files for pymarker 1.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pymarker-1.3.0.tar.gz | 18.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pymarker-1.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 38.3 kB
Release files / pymarker-1.3.0.tar.gz
| Download URL | pymarker-1.3.0.tar.gz |
|---|---|
| Size | 18.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ff9aaa497ef433495ec2c1cba0c3d4bdc4f68a669c046505f0cf7d684427a286
|
|
BLAKE2b-256 checksum How to use checksums |
0ef80cb80e96e5b225127cf5c27ac7efed14d773378ef62c6367fb6b3335a0a4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.4 CPython/3.12.13 Linux/6.17.0-1010-azure
|
Release files / pymarker-1.3.0-py3-none-any.whl
| Download URL | pymarker-1.3.0-py3-none-any.whl |
|---|---|
| Size | 19.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9212b44c5ee2d0063486e8458da2703d6eff924ad9b88cefa6509a94cee84408
|
|
BLAKE2b-256 checksum How to use checksums |
b444914bca877f91c82b1cc73eed5eb6bc1353b8a73ca4b78b9c5d01053ed3af
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.4 CPython/3.12.13 Linux/6.17.0-1010-azure
|