Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not detecting all the boxes #22

Open
Sturaga86 opened this issue Aug 19, 2022 · 1 comment
Open

Not detecting all the boxes #22

Sturaga86 opened this issue Aug 19, 2022 · 1 comment

Comments

@Sturaga86
Copy link

Hi,

Thanks for the amazing work! I am trying to use the config to detect boxes on my image but it's not detecting all the boxes.What i should change?

Not sure why it's not detecting some of the boxes.Any ideas?

from boxdetect import config

cfg = config.PipelinesConfig()

important to adjust these values to match the size of boxes on your image

cfg.width_range = (30,500)
cfg.height_range = (40,500)

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 = [1.0]

w/h ratio range for boxes/rectangles filtering

cfg.wh_ratio_range = (0.5,4.0)

group_size_range starting from 2 will skip all the groups

with a single box detected inside (like checkboxes)

cfg.group_size_range = (0,0)

num of iterations when running dilation tranformation (to engance the image)

cfg.dilation_iterations = 1

image

@karolzak
Copy link
Owner

karolzak commented Sep 2, 2022

Hey @Sturaga86 !
I'd probably focus on playing around with these options:

# set these ranges to as close as the real pixel sizes of boxes you want to detect
# too large range will make the algorithm very slow
# try smaller range like: 
cfg.width_range = (25,80)
cfg.height_range = (50,100)

# scaling factors is a list of scales to use to scale the input image
cfg.scaling_factors = [1.0] # maybe try [0.7, 0.9] instead. Or in another attempt [1.2] 

If you share a raw image input I could try to figure out the right config

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants