Skip to content

module 'utils' has no attribute verify_table #14

Description

@jeevandhadge

import utils
tables = [] # list of tables
for i in range(len(contours)):
# Verify that region of interest is a table
(rect, table_joints) = utils.verify_table(contours[i], intersections)
if rect == None or table_joints == None:
continue

# Create a new instance of a table
table = Table(rect[0], rect[1], rect[2], rect[3])

# Get an n-dimensional array of the coordinates of the table joints
joint_coords = []
for i in range(len(table_joints)):
    joint_coords.append(table_joints[i][0][0])
joint_coords = np.asarray(joint_coords)

# Returns indices of coordinates in sorted order
# Sorts based on parameters (aka keys) starting from the last parameter, then second-to-last, etc
sorted_indices = np.lexsort((joint_coords[:, 0], joint_coords[:, 1]))
joint_coords = joint_coords[sorted_indices]

# Store joint coordinates in the table instance
table.set_joints(joint_coords)

tables.append(table)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions