Thanks to visit codestin.com
Credit goes to github.com

Skip to content

charooanand/table-line-detector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 

Repository files navigation

table-line-detector

vline_detector() is a function for finding the pixel location of vertical lines in images of tables. hline_detector() is an analogous function for horizontal lines. These could be useful for cropping cells of tables before running OCR.

usage

import cv2

import matplotlib.pyplot as plt

import numpy as np

import statistics

image = cv2.imread(image_path)

coords, plot = vline_detector(image)

The x-axis of plot denotes the width of the image. Moving along the width of the image, we can count the number of pixels in each vertical slice that is recognised as a vertical edge. The y-axis of plot shows this count. Therefore the spikes in plot are the horizontal coordinates of detected vertical lines. coords is a list of the positions of these spikes (i.e. the horizontal coordinates of detected vertical lines).

About

Functions to detect the coordinates of vertical and horizontal lines in table images

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages