Skip to main content

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:

Example of an input image

Expected output patt:

Example output for pattern file

Expected output marker:

Example of a generated marker

Using the remove feature, we can return this marker to the starter image back again:

Example of an input image

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)

Source distribution for pymarker 1.3.0
File Size Uploaded
pymarker-1.3.0.tar.gz 18.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pymarker 1.3.0
File Interpreter ABI Platform
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

Release history Release notifications | RSS feed

This release

1.3.0 This release

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.4.0

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.1.0

3 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page