Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions alyn/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
""" Import required modules"""
from deskew import *
from skew_detect import *
from .deskew import *
from .skew_detect import *
2 changes: 1 addition & 1 deletion alyn/deskew.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import numpy as np
import matplotlib.pyplot as plt

from skew_detect import SkewDetect
from .skew_detect import SkewDetect
from skimage import io
from skimage.transform import rotate

Expand Down
6 changes: 3 additions & 3 deletions alyn/skew_detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def compare_sum(self, value):
def display(self, data):

for i in data:
print i + ": " + str(data[i])
print(i + ": " + str(data[i]))

def calculate_deviation(self, angle):

Expand All @@ -104,7 +104,7 @@ def run(self):
if self.batch_path:
self.batch_process()
else:
print "Invalid input, nothing to process."
print("Invalid input, nothing to process.")
else:
self.process_single_file()

Expand Down Expand Up @@ -156,7 +156,7 @@ def batch_process(self):

def determine_skew(self, img_file):

img = io.imread(img_file, as_grey=True)
img = io.imread(img_file, as_gray=True)
edges = canny(img, sigma=self.sigma)
h, a, d = hough_line(edges)
_, ap, _ = hough_line_peaks(h, a, d, num_peaks=self.num_peaks)
Expand Down
2 changes: 2 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

[![PyPI version](https://badge.fury.io/py/alyn.svg)](https://badge.fury.io/py/alyn)

Note: Minor tweaks done to work with Python 3

## Skew detection and correction in images containing text

<img src="/examples/4.jpg" width=400px></img>
Expand Down