README.md 2.03 KB
Newer Older
Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
1 2
# python3-escher-pattern

Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
3
Online examples:
Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
4
* [Escher](https://community.elphel.com/files/escher_pattern/?PAGE_WIDTH=1524&PAGE_HEIGHT=3048&LPM=2.705449885575893&ROTATE=14.036243467&ESCHER=2) - 1524x3048 mm, ~14° CW rotation, ~4 periods total
Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
5
* [Checker board](https://community.elphel.com/files/escher_pattern/?PAGE_WIDTH=1524&PAGE_HEIGHT=3048&LPM=2.705449885575893&ROTATE=14.036243467&ESCHER=0) - 1524x3048 mm, ~14° CW rotation, ~4 periods total
Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
6

Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
7

Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
8 9 10 11 12 13 14
Generates:
* Escher pattern
* Checker board pattern

Used for camera systems optical calibration.
Outputs is a PDF file. No borders. Ready for printing.

Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
15
## comparison
Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
16

Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
17
* Escher pattern provides better Point Spread Function (PSF) localization
Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
18

Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
19 20
![](https://community.elphel.com/pictures/escher_vs_checker.png)

Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
21 22
# Recommendations

Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
23
* Overall pattern rotation angle 0 is bad for correct PSF computation - because sensor pixel grid
Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72

# Requirements
* matplotlib

# Usage

## Docker

```
docker build --tag ep .
docker run -d -p 3113:5000 ep
```

Then:
```
http://localhost:3113/?PAGE_WIDTH=1524&PAGE_HEIGHT=3048&LPM=2.705449885575893&ROTATE=14.036243467
```

Parameters:
* **PAGE_WIDTH**  - page width in mm
* **PAGE_HEIGHT** - page width in mm
* **LPM**         - cell pairs per meter
* **ROTATE**      - pattern rotation angle
* **ESCHER**      - cell border curvature - at 0 or inf becomes a normal checker board. Max curvature is at ~2.4. Optimal - 2.0


## Command line

escher.py:
```
from escher_pattern import Escher_Pattern
ep = Escher_Pattern(width= 1524, height= 3048, escher=2, lpm=2.705449885575893, rotate=14.036243467)
ep.generate()
ep.save()
```

checkerboard.py:
```
from escher_pattern import Escher_Pattern
ep = Escher_Pattern(width= 1524, height= 3048, escher=0, lpm=2.705449885575893, rotate=14.036243467)
ep.generate()
ep.save()
```

Parameters:
* **width**  - page width in mm
* **height** - page width in mm
* **lpm**    - cell pairs per meter
* **rotate** - pattern rotation angle
Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
73
* **escher** - cell border curvature - at 0 or inf becomes a normal checker board. Max curvature is at ~2.4. Optimal - 2.0 
Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
74