Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

madcat arabic scripts cleaning and adding higher order language model #2718

Merged
merged 9 commits into from
Sep 19, 2018
Prev Previous commit
Next Next commit
removing unused function
  • Loading branch information
aarora8 committed Sep 18, 2018
commit a72d9224066396e12149d8d43ca701a79b34c4ea
45 changes: 0 additions & 45 deletions egs/madcat_ar/v1/local/create_line_image_from_page_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,50 +211,6 @@ def get_orientation(origin, p1, p2):
return difference


def compute_hull(points):
"""
Given input list of points, return a list of points that
made up the convex hull.
Returns
-------
[(float, float)]: convexhull points
"""
hull_points = []
start = points[0]
min_x = start[0]
for p in points[1:]:
if p[0] < min_x:
min_x = p[0]
start = p

point = start
hull_points.append(start)

far_point = None
while far_point is not start:
p1 = None
for p in points:
if p is point:
continue
else:
p1 = p
break

far_point = p1

for p2 in points:
if p2 is point or p2 is p1:
continue
else:
direction = get_orientation(point, far_point, p2)
if direction > 0:
far_point = p2

hull_points.append(far_point)
point = far_point
return hull_points


def minimum_bounding_box(points):
""" Given a list of 2D points, it returns the minimum area rectangle bounding all
the points in the point cloud.
Expand All @@ -274,7 +230,6 @@ def minimum_bounding_box(points):

hull_ordered = [points[index] for index in ConvexHull(points).vertices]
hull_ordered.append(hull_ordered[0])
#hull_ordered = compute_hull(points)
hull_ordered = tuple(hull_ordered)

min_rectangle = bounding_area(0, hull_ordered)
Expand Down