https://github.com/pablodiegoss/pymarker
A python package to generate AR markers and patterns based on input images
https://github.com/pablodiegoss/pymarker
ar-markers hacktoberfest markers python
Last synced: 6 months ago
JSON representation
A python package to generate AR markers and patterns based on input images
- Host: GitHub
- URL: https://github.com/pablodiegoss/pymarker
- Owner: pablodiegoss
- License: gpl-3.0
- Created: 2020-04-01T18:45:47.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-10-31T15:53:06.000Z (almost 3 years ago)
- Last Synced: 2025-03-25T22:02:03.380Z (7 months ago)
- Topics: ar-markers, hacktoberfest, markers, python
- Language: Python
- Homepage:
- Size: 92.8 KB
- Stars: 8
- Watchers: 1
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PyMarker
A python package to generate AR markers and patterns based on input images.
## Installation
PyMarker is available through pip and [Pypi](https://pypi.org/project/pymarker/).
```bash
python3 -m pip install pymarker --user
// or
pip3 install pymarker --user
```## Usage
Pymarker provides two features for a marker-based AR, generating Pattern files (.patt) and Markers (.png). 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:

### Commands
By default pymarker receives an image and generate both patt and marker
```bash
$ pymarker tests/input/hiro.jpg
```However, if needed the flag `-p` or `--patt` can gerate only the patt file for the input:
```bash
$ pymarker -p tests/input/hiro.jpg
// or
$ pymarker --patt tests/input/hiro.jpg
```The same can happen for markers using the `-m` or `--marker` which generates only the marker:
```bash
$ pymarker -m tests/input/hiro.jpg
// or
$ pymarker --marker tests/input/hiro.jpg
```The marker border size can be adjusted with `-b`, the default value being 50%.
```bash
$ pymarker -b 40 tests/input/hiro.jpg
```### Modules
You can use the functions directly from your python code to generate markers and patts.
```python
from pymarker.core import generate_patt, generate_markerdef main():
filename = "tests/input/hiro.jpg"
border_size = 50 // size in percentagegenerate_patt(filename)
generate_marker(filename,border_size)```