Comments (2)
Hi @martinkozle !
Thanks for sharing your issue.
Looking back I agree that putting that hardcoded (1,1)
value for group_size_range
wasn't the best practice but I can definitely share some of the logic behind it:
- The grouping params and logic is used for cases where you want to detect character boxes on forms and group them such as here:
- For
get_checkboxes
pipeline I usedgroup_size_range = (1,1)
to completely avoid grouping and treat every detection as a separate entity of a checkbox instance - In my work I haven't seen an example where it would be useful to actually group checkbox detections
- If current pipeline configuration for detecting checkboxes fails to detect some checkboxes on your input data, maybe you could share such example and I could investigate what is the problem there?
Let me know if that helps in anyway!
from boxdetect.
I can't really send the real images that I was working with. So I tried recreating the issue with an image I found on the internet:
With these options:
cfg = config.PipelinesConfig()
# important to adjust these values to match the size of boxes on your image
cfg.width_range = [(10, 50)]
cfg.height_range = [(10, 50)]
# the more scaling factors the more accurate the results but also it takes more time to processing
# too small scaling factor may cause false positives
# too big scaling factor will take a lot of processing time
cfg.scaling_factors = [0.7, 0.9, 1.0, 1.2, 1.5, 2.0]
# w/h ratio range for boxes/rectangles filtering
cfg.wh_ratio_range = [(0.9, 1.1)]
# num of iterations when running dilation tranformation (to engance the image)
cfg.dilation_iterations = [0]
checkboxes = get_checkboxes(img, cfg=cfg, px_threshold=0.1, verbose=True)
img_vis = img.copy()
for (x, y, w, h), _, _ in checkboxes:
img_vis = cv2.rectangle(img_vis, (x, y), (x+w, y+h), (0, 255, 0), thickness=3)
It found 0 checkboxes.
By setting only vertical max distance:
cfg.vertical_max_distance = [0]
I get a couple of checkboxes detected:
By setting only horizontal max distance:
cfg.horizontal_max_distance = [0]
I get all checkboxes detected:
And by setting both options I also get all checkboxes detected
This is why I was confused with the grouping regarding checkboxes.
Unrelated to this, on my data the checked checkboxes had big checks and X marks that extended far outside the checkboxes that made the square contours approach not really work. So in the end I made my own solution from scratch that only uses kernels and filter2D to find checkboxes that works well in my case (not a general solution).
Thank you for your help. I hope that you can also reproduce the same issue and that it helps in improving the library.
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
- Is there way to extract coordinates 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
- 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.