camelot-dev / camelot-dev/camelot

Misdetection of columns with narrow gap between them

Open
#341 2 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
3.8k
Forks
546
Avg merge
3d 17h
Merged PRs (30d)
3

Description

When I was trying to extract table in screenshot from pdf, you can download from given link, I got the table object which extracted as first and second columns are combined together.

**Steps to reproduce the bug**

Run the following code after installing Camelot and Ghostscript etc.

**Expected behavior**

I was expecting to get the table extracted correctly.

**Here is the code I used to extract:**
```
tables, layout, dim = self.extract_tables(linescale=30, flag_size= True)
acc_tables = self.filter_acc_tables(tables=tables, min_accuracy=85, max_whitespace=30)
```

**PDF**

**Screenshots**
![image](https://user-images.githubusercontent.com/29119961/210734324-685a1530-6144-4274-b54f-13af52b6c84b.png)

![image](https://user-images.githubusercontent.com/29119961/210736026-5ee53ba7-3302-44cf-8b6a-50ab399fcd8e.png)

**Environment**

- OS: Windows
- Python version: 3.9.12
- Numpy version: 1.22.3
- OpenCV version: 4.5.5.64
- Ghostscript version: 0.7
- Camelot version: 0.10.1

**Link for PDF**

https://www.irf.com/product-info/datasheets/data/irhm9150.pdf

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by running the reported extract_tables and filter_acc_tables calls against the linked PDF with the stated environment, then compare the extracted columns with the screenshots. Done means the narrow gap is preserved and the first two columns are returned separately in the table object.

Written by the indexing model from the issue text.

Assessment

Tech stack
numpy, opencv, python
Domain
data
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.