hexatess-code 0.2.0__tar.gz → 0.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of hexatess-code might be problematic. Click here for more details.

Files changed (34) hide show
  1. {hexatess_code-0.2.0 → hexatess_code-0.3.0}/PKG-INFO +22 -10
  2. {hexatess_code-0.2.0 → hexatess_code-0.3.0}/README.md +17 -9
  3. {hexatess_code-0.2.0 → hexatess_code-0.3.0}/pyproject.toml +6 -1
  4. {hexatess_code-0.2.0 → hexatess_code-0.3.0}/src/hexatess/__init__.py +1 -1
  5. hexatess_code-0.3.0/src/hexatess/camera.py +840 -0
  6. {hexatess_code-0.2.0 → hexatess_code-0.3.0}/src/hexatess/cli.py +37 -2
  7. {hexatess_code-0.2.0 → hexatess_code-0.3.0}/src/hexatess_code.egg-info/PKG-INFO +22 -10
  8. {hexatess_code-0.2.0 → hexatess_code-0.3.0}/src/hexatess_code.egg-info/SOURCES.txt +2 -0
  9. hexatess_code-0.3.0/src/hexatess_code.egg-info/requires.txt +9 -0
  10. hexatess_code-0.3.0/tests/test_camera.py +75 -0
  11. hexatess_code-0.2.0/src/hexatess_code.egg-info/requires.txt +0 -4
  12. {hexatess_code-0.2.0 → hexatess_code-0.3.0}/LICENSE +0 -0
  13. {hexatess_code-0.2.0 → hexatess_code-0.3.0}/setup.cfg +0 -0
  14. {hexatess_code-0.2.0 → hexatess_code-0.3.0}/src/hexatess/decoder.py +0 -0
  15. {hexatess_code-0.2.0 → hexatess_code-0.3.0}/src/hexatess/encoder.py +0 -0
  16. {hexatess_code-0.2.0 → hexatess_code-0.3.0}/src/hexatess/galois.py +0 -0
  17. {hexatess_code-0.2.0 → hexatess_code-0.3.0}/src/hexatess/geometry.py +0 -0
  18. {hexatess_code-0.2.0 → hexatess_code-0.3.0}/src/hexatess/header.py +0 -0
  19. {hexatess_code-0.2.0 → hexatess_code-0.3.0}/src/hexatess/masks.py +0 -0
  20. {hexatess_code-0.2.0 → hexatess_code-0.3.0}/src/hexatess/reedsolomon.py +0 -0
  21. {hexatess_code-0.2.0 → hexatess_code-0.3.0}/src/hexatess/render.py +0 -0
  22. {hexatess_code-0.2.0 → hexatess_code-0.3.0}/src/hexatess/resilience.py +0 -0
  23. {hexatess_code-0.2.0 → hexatess_code-0.3.0}/src/hexatess_code.egg-info/dependency_links.txt +0 -0
  24. {hexatess_code-0.2.0 → hexatess_code-0.3.0}/src/hexatess_code.egg-info/entry_points.txt +0 -0
  25. {hexatess_code-0.2.0 → hexatess_code-0.3.0}/src/hexatess_code.egg-info/top_level.txt +0 -0
  26. {hexatess_code-0.2.0 → hexatess_code-0.3.0}/tests/test_codec.py +0 -0
  27. {hexatess_code-0.2.0 → hexatess_code-0.3.0}/tests/test_conformance.py +0 -0
  28. {hexatess_code-0.2.0 → hexatess_code-0.3.0}/tests/test_galois.py +0 -0
  29. {hexatess_code-0.2.0 → hexatess_code-0.3.0}/tests/test_geometry.py +0 -0
  30. {hexatess_code-0.2.0 → hexatess_code-0.3.0}/tests/test_header.py +0 -0
  31. {hexatess_code-0.2.0 → hexatess_code-0.3.0}/tests/test_masks.py +0 -0
  32. {hexatess_code-0.2.0 → hexatess_code-0.3.0}/tests/test_reedsolomon.py +0 -0
  33. {hexatess_code-0.2.0 → hexatess_code-0.3.0}/tests/test_render.py +0 -0
  34. {hexatess_code-0.2.0 → hexatess_code-0.3.0}/tests/test_resilience.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hexatess-code
3
- Version: 0.2.0
3
+ Version: 0.3.0
4
4
  Summary: Hexatess Code - an experimental 2D barcode on a hexagonal grid with Reed-Solomon error correction
5
5
  Author: The Hexatess Code Authors
6
6
  License: MIT License
@@ -56,6 +56,10 @@ License-File: LICENSE
56
56
  Requires-Dist: pillow>=9.0
57
57
  Provides-Extra: dev
58
58
  Requires-Dist: pytest>=7.0; extra == "dev"
59
+ Provides-Extra: camera
60
+ Requires-Dist: numpy>=1.24; extra == "camera"
61
+ Requires-Dist: opencv-python>=4.8; extra == "camera"
62
+ Requires-Dist: scipy>=1.10; extra == "camera"
59
63
  Dynamic: license-file
60
64
 
61
65
  # Hexatess Code 🐝
@@ -109,27 +113,32 @@ text, stats = decode(grid) # ('Hello, Hexatess!', {...})
109
113
 
110
114
  > **Status: experimental.** This is a young format: the symbol
111
115
  > specification and reference implementation are solid and heavily
112
- > tested (2,500+ tests, conformance vectors), but there is **no camera
113
- > decoder yet** — reading images assumes ideal upright sampling. See
114
- > the roadmap below. Adopting a young format is a deliberate bet; the
115
- > [full format specification](SPECIFICATION.md) is the insurance.
116
+ > tested (2,500+ tests, conformance vectors). A **camera decoder**
117
+ > (`hexatess.camera`, optional `[camera]` extra) already reads symbols
118
+ > from real photographs — printed labels, foil transparencies, tilted
119
+ > and rotated shots. See the roadmap below. Adopting a young format
120
+ > is a deliberate bet; the [full format specification](SPECIFICATION.md)
121
+ > is the insurance.
116
122
 
117
123
  ## Installation
118
124
 
119
125
  ```bash
120
126
  pip install hexatess-code # from PyPI (once published)
127
+ pip install "hexatess-code[camera]" # + photo decoding (numpy, opencv, scipy)
121
128
  # or from a source checkout:
122
129
  pip install -e .
123
130
  ```
124
131
 
125
- Requires Python ≥ 3.8 and Pillow (for rendering only).
132
+ Requires Python ≥ 3.8; Pillow for rendering, numpy + OpenCV + SciPy
133
+ for the optional camera decoder.
126
134
 
127
135
  ## Command line
128
136
 
129
137
  ```bash
130
138
  hexatess "Hello world" -o koda.png --ec 30
131
139
  hexatess "Important URL https://example.org" -o url.png --ec 55
132
- hexatess-code --demo # demo symbol + robustness statistics
140
+ hexatess --demo # demo symbol + robustness statistics
141
+ hexatess decode-photo photo1.jpg photo2.jpg # read symbols from photos
133
142
  ```
134
143
 
135
144
  ## API
@@ -141,6 +150,7 @@ hexatess-code --demo # demo symbol + robustness statistics
141
150
  | `render(grid, path, size_px=18, ...)` | grid → PNG (pointy-top hexagons, quiet zone, supersampling) |
142
151
  | `sample_grid_from_image(path, rmax, ...)` | ideal re-sampling of a rendered PNG (self-test helper) |
143
152
  | `run_tests(...)` | noise/blob robustness statistics |
153
+ | `hexatess.camera.decode_photo(path)` | photograph → `(text, stats)`; finder detection, perspective handling, adaptive sampling (optional `[camera]` extra) |
144
154
 
145
155
  `params` / `stats` contain `rmax` (radius in rings), `mask`, `ec`,
146
156
  `blocks` (list of `(data_bytes, ecc_bytes)`) and `data_len`.
@@ -174,9 +184,11 @@ vectors, it speaks Hexatess Code.
174
184
 
175
185
  ## Roadmap
176
186
 
177
- 1. **v0.2 — camera decoding:** bullseye detection + perspective
178
- correction (the critical ecosystem step).
179
- 2. **v0.2 — erasure decoding:** declare blob-occluded modules as
187
+ 1. ~~v0.2/0.3 — camera decoding~~ **done (v0.3.0):** `hexatess.camera`
188
+ reads symbols from photographs — bullseye detection, homography +
189
+ correction-field warp handling, adaptive sampling; validated on
190
+ printed foil with curl and glare.
191
+ 2. **Erasure decoding:** declare blob-occluded modules as
180
192
  erasures → doubles correctable symbol counts.
181
193
  3. **JavaScript/TypeScript SDK** + online playground (generate a code
182
194
  in the browser in 10 seconds).
@@ -49,27 +49,32 @@ text, stats = decode(grid) # ('Hello, Hexatess!', {...})
49
49
 
50
50
  > **Status: experimental.** This is a young format: the symbol
51
51
  > specification and reference implementation are solid and heavily
52
- > tested (2,500+ tests, conformance vectors), but there is **no camera
53
- > decoder yet** — reading images assumes ideal upright sampling. See
54
- > the roadmap below. Adopting a young format is a deliberate bet; the
55
- > [full format specification](SPECIFICATION.md) is the insurance.
52
+ > tested (2,500+ tests, conformance vectors). A **camera decoder**
53
+ > (`hexatess.camera`, optional `[camera]` extra) already reads symbols
54
+ > from real photographs — printed labels, foil transparencies, tilted
55
+ > and rotated shots. See the roadmap below. Adopting a young format
56
+ > is a deliberate bet; the [full format specification](SPECIFICATION.md)
57
+ > is the insurance.
56
58
 
57
59
  ## Installation
58
60
 
59
61
  ```bash
60
62
  pip install hexatess-code # from PyPI (once published)
63
+ pip install "hexatess-code[camera]" # + photo decoding (numpy, opencv, scipy)
61
64
  # or from a source checkout:
62
65
  pip install -e .
63
66
  ```
64
67
 
65
- Requires Python ≥ 3.8 and Pillow (for rendering only).
68
+ Requires Python ≥ 3.8; Pillow for rendering, numpy + OpenCV + SciPy
69
+ for the optional camera decoder.
66
70
 
67
71
  ## Command line
68
72
 
69
73
  ```bash
70
74
  hexatess "Hello world" -o koda.png --ec 30
71
75
  hexatess "Important URL https://example.org" -o url.png --ec 55
72
- hexatess-code --demo # demo symbol + robustness statistics
76
+ hexatess --demo # demo symbol + robustness statistics
77
+ hexatess decode-photo photo1.jpg photo2.jpg # read symbols from photos
73
78
  ```
74
79
 
75
80
  ## API
@@ -81,6 +86,7 @@ hexatess-code --demo # demo symbol + robustness statistics
81
86
  | `render(grid, path, size_px=18, ...)` | grid → PNG (pointy-top hexagons, quiet zone, supersampling) |
82
87
  | `sample_grid_from_image(path, rmax, ...)` | ideal re-sampling of a rendered PNG (self-test helper) |
83
88
  | `run_tests(...)` | noise/blob robustness statistics |
89
+ | `hexatess.camera.decode_photo(path)` | photograph → `(text, stats)`; finder detection, perspective handling, adaptive sampling (optional `[camera]` extra) |
84
90
 
85
91
  `params` / `stats` contain `rmax` (radius in rings), `mask`, `ec`,
86
92
  `blocks` (list of `(data_bytes, ecc_bytes)`) and `data_len`.
@@ -114,9 +120,11 @@ vectors, it speaks Hexatess Code.
114
120
 
115
121
  ## Roadmap
116
122
 
117
- 1. **v0.2 — camera decoding:** bullseye detection + perspective
118
- correction (the critical ecosystem step).
119
- 2. **v0.2 — erasure decoding:** declare blob-occluded modules as
123
+ 1. ~~v0.2/0.3 — camera decoding~~ **done (v0.3.0):** `hexatess.camera`
124
+ reads symbols from photographs — bullseye detection, homography +
125
+ correction-field warp handling, adaptive sampling; validated on
126
+ printed foil with curl and glare.
127
+ 2. **Erasure decoding:** declare blob-occluded modules as
120
128
  erasures → doubles correctable symbol counts.
121
129
  3. **JavaScript/TypeScript SDK** + online playground (generate a code
122
130
  in the browser in 10 seconds).
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "hexatess-code"
7
- version = "0.2.0"
7
+ version = "0.3.0"
8
8
  description = "Hexatess Code - an experimental 2D barcode on a hexagonal grid with Reed-Solomon error correction"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.8"
@@ -36,6 +36,11 @@ dependencies = [
36
36
  dev = [
37
37
  "pytest>=7.0",
38
38
  ]
39
+ camera = [
40
+ "numpy>=1.24",
41
+ "opencv-python>=4.8",
42
+ "scipy>=1.10",
43
+ ]
39
44
 
40
45
  [project.urls]
41
46
  Homepage = "https://github.com/lovro-abram/hexatess-code"
@@ -57,7 +57,7 @@ from .reedsolomon import rs_correct_msg, rs_encode_msg
57
57
  from .render import render, sample_grid_from_image
58
58
  from .resilience import add_blob_damage, add_random_noise, run_tests
59
59
 
60
- __version__ = "0.2.0"
60
+ __version__ = "0.3.0"
61
61
  SPEC_VERSION = "0.2"
62
62
 
63
63
  __all__ = [