Comments (3)
Hi @SuryaViswanath11 ,
Glad to hear you found BoxDetect useful.
To use BoxDetect functions you need to first convert your PDF to images which is a fairly simple task. You can use one of few available packages to do it, like pdf2image
from boxdetect.
Hi @SuryaViswanath11 , Glad to hear you found BoxDetect useful. To use BoxDetect functions you need to first convert your PDF to images which is a fairly simple task. You can use one of few available packages to do it, like pdf2image
Seems there is no direct answer to the question, Is there a way to extract the coordinates for the boxes present in the image file?
from boxdetect.
Hi @teohsinyee
Each function from BoxDetect takes an image as input and returns a collection of coordinates for detected boxes (based on config params).
Example:
from boxdetect.pipelines import get_boxes
rects, grouping_rects, image, output_image = get_boxes(
file_name, cfg=cfg, plot=False)
print(grouping_rects)
OUT:
# (x, y, w, h)
[(276, 276, 1221, 33),
(324, 466, 430, 33),
(384, 884, 442, 33),
(985, 952, 410, 32),
(779, 1052, 156, 33),
(253, 1256, 445, 33)]
import matplotlib.pyplot as plt
plt.figure(figsize=(20,20))
plt.imshow(output_image)
plt.show()
Another:
from boxdetect.pipelines import get_checkboxes
checkboxes = get_checkboxes(
file_path, cfg=cfg, px_threshold=0.1, plot=False, verbose=True)
print("Output object type: ", type(checkboxes))
for checkbox in checkboxes:
print("Checkbox bounding rectangle (x,y,width,height): ", checkbox[0])
print("Result of `contains_pixels` for the checkbox: ", checkbox[1])
print("Display the cropout of checkbox:")
plt.figure(figsize=(1,1))
plt.imshow(checkbox[2])
plt.show()
from boxdetect.
Related Issues (20)
- As a user I want to automatically get optimal configuration based on provided ground truth
- AttributeError: module 'boxdetect.config' has no attribute 'update_num_iterations'
- Strategies for getting accurate checkboxes on documents with Serif Font HOT 3
- Check box mapping with text HOT 1
- challenging case on checkbox crossing outside box HOT 2
- Failed detection of cropped image HOT 2
- checkbox detect fails with sloppy crosses HOT 7
- Cumulative results? HOT 2
- Removing noise while preserving the boundary of the checkbox HOT 4
- Not detecting all the boxes HOT 1
- Default config for vertical grouping has bad results for vertically aligned checkboxes HOT 2
- New release for scikit-learn installation HOT 3
- Failure in UnitTests HOT 1
- Which configurations should I use?
- Can't detect table cells
- using boxdetect in a lambda errors due to GUI artifacts
- AttributeError: module 'boxdetect.config' has no attribute 'update_num_iterations'. Did you mean: 'dilation_iterations'? HOT 1
- Add missing docstrings
- Add full tests coverage
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from boxdetect.