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

[FEATURE]: Adaptive samples count #65

Open
roshameow opened this issue Sep 19, 2022 · 2 comments
Open

[FEATURE]: Adaptive samples count #65

roshameow opened this issue Sep 19, 2022 · 2 comments
Labels

Comments

@roshameow
Copy link

Description

I noticed that in segmentation.py/detect_colour_checkers_segmentation the samples is a passed in parameter. Would it be more natural if we instead pass in the ratio of samples/colorchecker to adapt different checkerboard size?

This line can be modified as following:
https://github.com/colour-science/colour-checker-detection/blob/develop/colour_checker_detection/detection/segmentation.py#L1097

samples_ratio=4
samples = int(np.sqrt(height*width/(swatches_h*swatches_v))/samples_ratio)
masks = swatch_masks(width, height, swatches_h, swatches_v, samples)
@KelSolaar
Copy link
Member

Hi @roshameow,

Sorry for the late reply, this slipped through the many cracks!

We tend to like knowing how much samples are being processed in my field, that said we could have a utility function to compute them so that they could be passed a bit more easily this way.

Cheers,

Thomas

@roshameow
Copy link
Author

Hi Thomas,

I see your concern here. Are you talking about a utility function like

def get_sample_by_ratio(height, width, swatches_h, swatches_v, samples_ratio=0.25):
    return int(np.sqrt(height*width/(swatches_h*swatches_v))*samples_ratio)

and add flag like "use_sample_ratio" in the parameter dict? I totally agree.

Also much thanks for your work. It did speed up a lot when I was doing a color correction process.

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

No branches or pull requests

2 participants