-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathexample.py
More file actions
34 lines (28 loc) · 828 Bytes
/
example.py
File metadata and controls
34 lines (28 loc) · 828 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#-*- coding: utf-8 -*-
"""
Created on Sat Mar 05 13:55:06 2016
@author: victor
"""
import os
from PIL import Image
from Algorithm import Piece
# File path
sample_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'Coin_Samples', 'F.534_2_1899_2 (copy).jpg')
# Show Image
Image.open(sample_path).show()
# Import Coin (Piece in French)
toto = Piece.Piece(sample_path)
# Generate Obverse (Avers in French) and Reverse (Revers in French)
toto.generate_aversrever()
# Show circles coins
toto.show_coin_with_circles()
# Uncoil the coin and generate a stripe for both obverse and reverse
toto.avers.coin2stripe()
toto.revers.coin2stripe()
# Show stripes for obverse and reverse
toto.avers.show_stripe()
toto.revers.show_stripe()
# Extract words
toto.avers.extract_words()
# Get letters
#toto.avers.stripe2letters()