A Python package implementing various colour checker detection algorithms and related utilities.

Overview

Colour - Checker Detection

Develop Build Status Coverage Status Code Grade Package Version

A Python package implementing various colour checker detection algorithms and related utilities.

It is open source and freely available under the New BSD License terms.

https://raw.githubusercontent.com/colour-science/colour-checker-detection/master/docs/_static/ColourCheckerDetection_001.png

1   Features

The following colour checker detection algorithms are implemented:

  • Segmentation

2   Installation

Because of their size, the resources dependencies needed to run the various examples and unit tests are not provided within the Pypi package. They are separately available as Git Submodules when cloning the repository.

2.1   Primary Dependencies

Colour - Checker Detection requires various dependencies in order to run:

2.2   Pypi

Once the dependencies are satisfied, Colour - Checker Detection can be installed from the Python Package Index by issuing this command in a shell:

pip install --user colour-checker-detection

The overall development dependencies are installed as follows:

pip install --user 'colour-checker-detection[development]'

3   Usage

3.1   API

The main reference for Colour - Checker Detection is the Colour - Checker Detection Manual.

3.2   Examples

Various usage examples are available from the examples directory.

4   Contributing

If you would like to contribute to Colour - Checker Detection, please refer to the following Contributing guide for Colour.

5   Bibliography

The bibliography is available in the repository in BibTeX format.

6   Code of Conduct

The Code of Conduct, adapted from the Contributor Covenant 1.4, is available on the Code of Conduct page.

7   Contact & Social

The Colour Developers can be reached via different means:

8   About

Colour - Checker Detection by Colour Developers
Copyright © 2018-2021 – Colour Developers – [email protected]
This software is released under terms of New BSD License: https://opensource.org/licenses/BSD-3-Clause
Comments
  • Support for other colour rendition charts?

    Support for other colour rendition charts?

    This is a question than an issue.

    I am designing software with GUI allowing users to extract color values of patches in different color targets (e.g., X-rite color checker SG, IT8.7/2, and HCT). I think that color target detection in the software does not have to be automatic as it can ask users to select 4 corner points. I wonder how your code can be extended for the other color targets. Thanks.

    Discussion API 
    opened by statcom 13
  • Can't parse 'center'. Sequence item with index 0 has a wrong type

    Can't parse 'center'. Sequence item with index 0 has a wrong type

    i use your code from the examples but i'm getting an error: Can't parse 'center'. Sequence item with index 0 has a wrong type.

    here's the code:

    from colour import read_image
    import colour_checker_detection as ccd
    
    path = '/home/ftn21/Documents/ran/colour/img/IMG_1967.png'
    image = read_image(path)
    arr = ccd.detect_colour_checkers_segmentation(image)
    

    here's the console output:

    runfile('/home/ftn21/Documents/ran/colour/src/exmp_detect.py', wdir='/home/ftn21/Documents/ran/colour/src')
    Traceback (most recent call last):
    
      File "/home/ftn21/Documents/ran/colour/src/exmp_detect.py", line 14, in <module>
        arr = ccd.detect_colour_checkers_segmentation(image)
    
      File "/home/ftn21/anaconda3/lib/python3.8/site-packages/colour_checker_detection/detection/segmentation.py", line 769, in detect_colour_checkers_segmentation
        for colour_checker in extract_colour_checkers_segmentation(image):
    
      File "/home/ftn21/anaconda3/lib/python3.8/site-packages/colour_checker_detection/detection/segmentation.py", line 692, in extract_colour_checkers_segmentation
        colour_checker = crop_and_level_image_with_rectangle(
    
      File "/home/ftn21/anaconda3/lib/python3.8/site-packages/colour_checker_detection/detection/segmentation.py", line 461, in crop_and_level_image_with_rectangle
        M_r = cv2.getRotationMatrix2D(centroid, angle, 1)
    
    TypeError: Can't parse 'center'. Sequence item with index 0 has a wrong type
    
    
    
    Defect Critical API 
    opened by ftn21 4
  • Why is SVD not converging?

    Why is SVD not converging?

    I was having trouble getting the SVD to converge while using the colour_correction_matrix_Cheung2004 function with the default 3 terms. Ended up figuring out that the array M_T had ??too small of numbers in it?? My current workaround is to multiply both M_T and M_R by an order of magnitude, which allows the SVD to converge.

    The results seem to be correct, didn't know if this was bad practice?

    Discussion API 
    opened by mexicantexan 4
  • Type exception raised with OpenCV 4.5.2.

    Type exception raised with OpenCV 4.5.2.

    I moved to a fresh install today, and this happened:

    Traceback (most recent call last): File "/home/davidd/git/UB-ISP/scripts/color_calib", line 88, in result = detect_colour_checkers_segmentation(img, additional_data=True) File "/home/davidd/.local/lib/python3.8/site-packages/colour_checker_detection/detection/segmentation.py", line 771, in detect_colour_checkers_segmentation for colour_checker in extract_colour_checkers_segmentation(image): File "/home/davidd/.local/lib/python3.8/site-packages/colour_checker_detection/detection/segmentation.py", line 694, in extract_colour_checkers_segmentation colour_checker = crop_and_level_image_with_rectangle( File "/home/davidd/.local/lib/python3.8/site-packages/colour_checker_detection/detection/segmentation.py", line 463, in crop_and_level_image_with_rectangle M_r = cv2.getRotationMatrix2D(centroid, angle, 1) TypeError: Can't parse 'center'. Sequence item with index 0 has a wrong type

    Previously cv2 was at version 4.5.1, but with the fresh install it had moved to 4.5.2.

    Modifying segmentation.py (line 451) from: centroid = as_int_array(contour_centroid(cv2.boxPoints(rectangle))) to: centroid = as_float_array(contour_centroid(cv2.boxPoints(rectangle)))

    fixed it for me.

    Defect Critical API 
    opened by ddonohoe 3
  • On colour checker detection robustness?

    On colour checker detection robustness?

    Colour checker detection fails with the following image:

    colourchecker.bmp.gz

    The following is my minimal test case:

    import colour
    from colour_checker_detection import detect_colour_checkers_segmentation
    
    image = colour.cctf_decoding(colour.io.read_image('colourchecker_crop.bmp'))
    
    swatches = detect_colour_checkers_segmentation(image)
    
    if len(swatches) == 0:
        print("Detection failed")
    

    I found that I can make the detection work if I replace INTER_CUBIC with INTER_LINEAR in adjust_image(). With Cubic interpolation, only 15 swatches are detected ("counts" in colour_checkers_coordinates_segmentation()), whereas with Linear interpolation, 19 swatches are detected.

    A strange thing I observed is that if I convert the image to .png first, everything changes, even though the images should be identical. In this case Linear interpolation detects 18 swatches, whereas Cubic interpolation detects 19.

    Discussion API 
    opened by ddonohoe 2
  • Bump pillow from 8.4.0 to 9.0.0

    Bump pillow from 8.4.0 to 9.0.0

    Bumps pillow from 8.4.0 to 9.0.0.

    Release notes

    Sourced from pillow's releases.

    9.0.0

    https://pillow.readthedocs.io/en/stable/releasenotes/9.0.0.html

    Changes

    ... (truncated)

    Changelog

    Sourced from pillow's changelog.

    9.0.0 (2022-01-02)

    • Restrict builtins for ImageMath.eval(). CVE-2022-22817 #5923 [radarhere]

    • Ensure JpegImagePlugin stops at the end of a truncated file #5921 [radarhere]

    • Fixed ImagePath.Path array handling. CVE-2022-22815, CVE-2022-22816 #5920 [radarhere]

    • Remove consecutive duplicate tiles that only differ by their offset #5919 [radarhere]

    • Improved I;16 operations on big endian #5901 [radarhere]

    • Limit quantized palette to number of colors #5879 [radarhere]

    • Fixed palette index for zeroed color in FASTOCTREE quantize #5869 [radarhere]

    • When saving RGBA to GIF, make use of first transparent palette entry #5859 [radarhere]

    • Pass SAMPLEFORMAT to libtiff #5848 [radarhere]

    • Added rounding when converting P and PA #5824 [radarhere]

    • Improved putdata() documentation and data handling #5910 [radarhere]

    • Exclude carriage return in PDF regex to help prevent ReDoS #5912 [hugovk]

    • Fixed freeing pointer in ImageDraw.Outline.transform #5909 [radarhere]

    • Added ImageShow support for xdg-open #5897 [m-shinder, radarhere]

    • Support 16-bit grayscale ImageQt conversion #5856 [cmbruns, radarhere]

    • Convert subsequent GIF frames to RGB or RGBA #5857 [radarhere]

    ... (truncated)

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    Dependencies 
    opened by dependabot[bot] 1
  • Bump pillow from 8.2.0 to 8.3.2

    Bump pillow from 8.2.0 to 8.3.2

    Bumps pillow from 8.2.0 to 8.3.2.

    Release notes

    Sourced from pillow's releases.

    8.3.2

    https://pillow.readthedocs.io/en/stable/releasenotes/8.3.2.html

    Security

    • CVE-2021-23437 Raise ValueError if color specifier is too long [hugovk, radarhere]

    • Fix 6-byte OOB read in FliDecode [wiredfool]

    Python 3.10 wheels

    • Add support for Python 3.10 #5569, #5570 [hugovk, radarhere]

    Fixed regressions

    • Ensure TIFF RowsPerStrip is multiple of 8 for JPEG compression #5588 [kmilos, radarhere]

    • Updates for ImagePalette channel order #5599 [radarhere]

    • Hide FriBiDi shim symbols to avoid conflict with real FriBiDi library #5651 [nulano]

    8.3.1

    https://pillow.readthedocs.io/en/stable/releasenotes/8.3.1.html

    Changes

    8.3.0

    https://pillow.readthedocs.io/en/stable/releasenotes/8.3.0.html

    Changes

    ... (truncated)

    Changelog

    Sourced from pillow's changelog.

    8.3.2 (2021-09-02)

    • CVE-2021-23437 Raise ValueError if color specifier is too long [hugovk, radarhere]

    • Fix 6-byte OOB read in FliDecode [wiredfool]

    • Add support for Python 3.10 #5569, #5570 [hugovk, radarhere]

    • Ensure TIFF RowsPerStrip is multiple of 8 for JPEG compression #5588 [kmilos, radarhere]

    • Updates for ImagePalette channel order #5599 [radarhere]

    • Hide FriBiDi shim symbols to avoid conflict with real FriBiDi library #5651 [nulano]

    8.3.1 (2021-07-06)

    • Catch OSError when checking if fp is sys.stdout #5585 [radarhere]

    • Handle removing orientation from alternate types of EXIF data #5584 [radarhere]

    • Make Image.array take optional dtype argument #5572 [t-vi, radarhere]

    8.3.0 (2021-07-01)

    • Use snprintf instead of sprintf. CVE-2021-34552 #5567 [radarhere]

    • Limit TIFF strip size when saving with LibTIFF #5514 [kmilos]

    • Allow ICNS save on all operating systems #4526 [baletu, radarhere, newpanjing, hugovk]

    • De-zigzag JPEG's DQT when loading; deprecate convert_dict_qtables #4989 [gofr, radarhere]

    • Replaced xml.etree.ElementTree #5565 [radarhere]

    ... (truncated)

    Commits
    • 8013f13 8.3.2 version bump
    • 23c7ca8 Update CHANGES.rst
    • 8450366 Update release notes
    • a0afe89 Update test case
    • 9e08eb8 Raise ValueError if color specifier is too long
    • bd5cf7d FLI tests for Oss-fuzz crash.
    • 94a0cf1 Fix 6-byte OOB read in FliDecode
    • cece64f Add 8.3.2 (2021-09-02) [CI skip]
    • e422386 Add release notes for Pillow 8.3.2
    • 08dcbb8 Pillow 8.3.2 supports Python 3.10 [ci skip]
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    Dependencies 
    opened by dependabot[bot] 1
  • Bump notebook from 6.4.0 to 6.4.1

    Bump notebook from 6.4.0 to 6.4.1

    Bumps notebook from 6.4.0 to 6.4.1.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    Dependencies 
    opened by dependabot[bot] 1
  • Bump pillow from 8.1.0 to 8.2.0

    Bump pillow from 8.1.0 to 8.2.0

    Bumps pillow from 8.1.0 to 8.2.0.

    Release notes

    Sourced from pillow's releases.

    8.2.0

    https://pillow.readthedocs.io/en/stable/releasenotes/8.2.0.html

    Changes

    Dependencies

    Deprecations

    ... (truncated)

    Changelog

    Sourced from pillow's changelog.

    8.2.0 (2021-04-01)

    • Added getxmp() method #5144 [UrielMaD, radarhere]

    • Add ImageShow support for GraphicsMagick #5349 [latosha-maltba, radarhere]

    • Do not load transparent pixels from subsequent GIF frames #5333 [zewt, radarhere]

    • Use LZW encoding when saving GIF images #5291 [raygard]

    • Set all transparent colors to be equal in quantize() #5282 [radarhere]

    • Allow PixelAccess to use Python int when parsing x and y #5206 [radarhere]

    • Removed Image._MODEINFO #5316 [radarhere]

    • Add preserve_tone option to autocontrast #5350 [elejke, radarhere]

    • Fixed linear_gradient and radial_gradient I and F modes #5274 [radarhere]

    • Add support for reading TIFFs with PlanarConfiguration=2 #5364 [kkopachev, wiredfool, nulano]

    • Deprecated categories #5351 [radarhere]

    • Do not premultiply alpha when resizing with Image.NEAREST resampling #5304 [nulano]

    • Dynamically link FriBiDi instead of Raqm #5062 [nulano]

    • Allow fewer PNG palette entries than the bit depth maximum when saving #5330 [radarhere]

    • Use duration from info dictionary when saving WebP #5338 [radarhere]

    • Stop flattening EXIF IFD into getexif() #4947 [radarhere, kkopachev]

    ... (truncated)

    Commits
    • e0e353c 8.2.0 version bump
    • ee635be Merge pull request #5377 from hugovk/security-and-release-notes
    • 694c84f Fix typo [ci skip]
    • 8febdad Review, typos and lint
    • fea4196 Reorder, roughly alphabetic
    • 496245a Fix BLP DOS -- CVE-2021-28678
    • 22e9bee Fix DOS in PSDImagePlugin -- CVE-2021-28675
    • ba65f0b Fix Memory DOS in ImageFont
    • bb6c11f Fix FLI DOS -- CVE-2021-28676
    • 5a5e6db Fix EPS DOS on _open -- CVE-2021-28677
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    Dependencies 
    opened by dependabot[bot] 1
  • Bump urllib3 from 1.26.2 to 1.26.5

    Bump urllib3 from 1.26.2 to 1.26.5

    Bumps urllib3 from 1.26.2 to 1.26.5.

    Release notes

    Sourced from urllib3's releases.

    1.26.5

    :warning: IMPORTANT: urllib3 v2.0 will drop support for Python 2: Read more in the v2.0 Roadmap

    • Fixed deprecation warnings emitted in Python 3.10.
    • Updated vendored six library to 1.16.0.
    • Improved performance of URL parser when splitting the authority component.

    If you or your organization rely on urllib3 consider supporting us via GitHub Sponsors

    1.26.4

    :warning: IMPORTANT: urllib3 v2.0 will drop support for Python 2: Read more in the v2.0 Roadmap

    • Changed behavior of the default SSLContext when connecting to HTTPS proxy during HTTPS requests. The default SSLContext now sets check_hostname=True.

    If you or your organization rely on urllib3 consider supporting us via GitHub Sponsors

    1.26.3

    :warning: IMPORTANT: urllib3 v2.0 will drop support for Python 2: Read more in the v2.0 Roadmap

    • Fixed bytes and string comparison issue with headers (Pull #2141)

    • Changed ProxySchemeUnknown error message to be more actionable if the user supplies a proxy URL without a scheme (Pull #2107)

    If you or your organization rely on urllib3 consider supporting us via GitHub Sponsors

    Changelog

    Sourced from urllib3's changelog.

    1.26.5 (2021-05-26)

    • Fixed deprecation warnings emitted in Python 3.10.
    • Updated vendored six library to 1.16.0.
    • Improved performance of URL parser when splitting the authority component.

    1.26.4 (2021-03-15)

    • Changed behavior of the default SSLContext when connecting to HTTPS proxy during HTTPS requests. The default SSLContext now sets check_hostname=True.

    1.26.3 (2021-01-26)

    • Fixed bytes and string comparison issue with headers (Pull #2141)

    • Changed ProxySchemeUnknown error message to be more actionable if the user supplies a proxy URL without a scheme. (Pull #2107)

    Commits
    • d161647 Release 1.26.5
    • 2d4a3fe Improve performance of sub-authority splitting in URL
    • 2698537 Update vendored six to 1.16.0
    • 07bed79 Fix deprecation warnings for Python 3.10 ssl module
    • d725a9b Add Python 3.10 to GitHub Actions
    • 339ad34 Use pytest==6.2.4 on Python 3.10+
    • f271c9c Apply latest Black formatting
    • 1884878 [1.26] Properly proxy EOF on the SSLTransport test suite
    • a891304 Release 1.26.4
    • 8d65ea1 Merge pull request from GHSA-5phf-pp7p-vc2r
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    Dependencies 
    opened by dependabot[bot] 1
  • Bump urllib3 from 1.26.2 to 1.26.4

    Bump urllib3 from 1.26.2 to 1.26.4

    Bumps urllib3 from 1.26.2 to 1.26.4.

    Release notes

    Sourced from urllib3's releases.

    1.26.4

    :warning: IMPORTANT: urllib3 v2.0 will drop support for Python 2: Read more in the v2.0 Roadmap

    • Changed behavior of the default SSLContext when connecting to HTTPS proxy during HTTPS requests. The default SSLContext now sets check_hostname=True.

    If you or your organization rely on urllib3 consider supporting us via GitHub Sponsors

    1.26.3

    :warning: IMPORTANT: urllib3 v2.0 will drop support for Python 2: Read more in the v2.0 Roadmap

    • Fixed bytes and string comparison issue with headers (Pull #2141)

    • Changed ProxySchemeUnknown error message to be more actionable if the user supplies a proxy URL without a scheme (Pull #2107)

    If you or your organization rely on urllib3 consider supporting us via GitHub Sponsors

    Changelog

    Sourced from urllib3's changelog.

    1.26.4 (2021-03-15)

    • Changed behavior of the default SSLContext when connecting to HTTPS proxy during HTTPS requests. The default SSLContext now sets check_hostname=True.

    1.26.3 (2021-01-26)

    • Fixed bytes and string comparison issue with headers (Pull #2141)

    • Changed ProxySchemeUnknown error message to be more actionable if the user supplies a proxy URL without a scheme. (Pull #2107)

    Commits
    • a891304 Release 1.26.4
    • 8d65ea1 Merge pull request from GHSA-5phf-pp7p-vc2r
    • 5e34326 Add proper stacklevel to method_allowlist warning
    • 361f1e2 Release 1.26.3
    • 3179dfd Allow using deprecated OpenSSL with CRYPTOGRAPHY_ALLOW_OPENSSL_102
    • d97e5d4 Use Python 3.5 compatible get-pip
    • cb5e2fc [1.26] Don't compare bytes and str in putheader()
    • b89158f [1.26] Update RECENT_DATE to 2020-07-01
    • a800c74 [1.26] Recommend GitHub Sponsors instead of Open Collective
    • 947284e [1.26] Improve message for ProxySchemeUnknown exception
    • See full diff in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    Dependencies 
    opened by dependabot[bot] 1
  • [FEATURE]: Adaptive samples count

    [FEATURE]: Adaptive samples count

    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)
    
    Feature 
    opened by roshameow 2
  • [ENHANCEMENT] Proposal to allow detection from different perspectives

    [ENHANCEMENT] Proposal to allow detection from different perspectives

    Hey,

    I've been tinkering around the problem of being able to detect the color-checker when its shot was taken, so that the approximate rectangle of the checker is distorted.

    I am unsure if the detection of such a contour is currently possible with this package, but I would like to contribute in order to enable such a functionality.

    As the masking of the checker should stay fixed, the idea is to warp the detected contour to fit the mask. When the contour is warped even the size of the mask can stay fixed. This can be done as follows:

    # the dimensions are somewhat arbitrary but should fit the aspect ratio of the checker 
    
    def correct_distortion(distorted_cnt, x_dim, y_dim, img):
        desired_cnt = [[0,0],[x_dim,0],[x_dim,y_dim],[0, y_dim]]
        M = cv2.getPerspectiveTransform(np.float32(distorted_cnt), np.float32(desired_cnt))
        return cv2.warpPerspective(img, M,(x_dim,y_dim))
    

    As the checker orientation matters, it is necessary to ensure that the points of the detected contour are ordered in the same way as the new coordinates e.g.

    ordering

    My attempt to ensure such an ordering are the following functions:

    def order_clockwise(cnt):
        centroid = contour_centroid(cnt)
        angles = [math.atan2(c[1]-centroid[0][1], c[0]-centroid[0][0])*180//np.pi for corner in cnt]
        clockwise_contours = [c for c, a in sorted(zip(unpacked_cnt, angles), key=lambda pair: pair[1])]
    
        return clockwise_contours 
    
    def order_cnt(cnt):
        clockwise_contour = order_clockwise(cnt)
    
        lowest_point_index = np.argmax([pt[0][1] for pt in clockwise_contour])
        next_index = (lowest_point_index+1) % len(clockwise_contour)
        previous_index = lowest_point_index-1
    
        
        lowest_point = clockwise_contour[lowest_point_index]
        next_point = clockwise_contour[next_index]
        previous_point = clockwise_contour[previous_index]
        
        next_diff_x = np.abs(lowest_point[0][0] - next_point[0][0])
        next_diff_y = np.abs(lowest_point[0][1] - next_point[0][1])
        previous_diff_x = np.abs(lowest_point[0][0] - previous_point[0][0])
        previous_diff_y = np.abs(lowest_point[0][1] - previous_point[0][1])
        
        anti_clockwise_angle = math.atan2(next_diff_y, next_diff_x) * 180 //np.pi
        clockwise_angle = math.atan2(previous_diff_y, previous_diff_x) * 180 //np.pi
        
        # Lower line is already aligned in the image
        if next_diff_y == 0 or previous_diff_y == 0:
            next_angle = previous_angle = "Aligned"
        
        # "Falling" to the right, Less rotation needed to align when rotating clockwise
        if anti_clockwise_angle > clockwise_angle: 
            first_index = next_index       
        
        # "Falling" to the left, Less rotation needed to align when rotating anti-clockwise
        if anti_clockwise_angle == "Aligned" or anti_clockwise_angle <= clockwise_angle: 
            first_index = next_index+1 if next_index+1 < len(clockwise_contour) else 0 
            if previous_diff_y == 0:
                first_index -= 1
            
        return clockwise_contour[first_index:] + clockwise_contour[:first_index]
        
    

    This works under the assumption that the checker is not flipped but was recorded as the aspect ratio suggests. It is required to perform the ordering before the wrapping.

    I've attached a notebook, with a demonstration of the described pipeline Demo.zip

    Feature 
    opened by TimWalter 1
  • [FEATURE]: More Robust Square Detection In Segmentation

    [FEATURE]: More Robust Square Detection In Segmentation

    Description

    In segementation.py when filtering for squares/swatches contours

    the original code reads:

    # Filtering squares/swatches contours.
    swatches = []
    for contour in contours:
        curve = cv2.approxPolyDP(
            contour, 0.01 * cv2.arcLength(contour, True), True
        )
        if minimum_area < cv2.contourArea(curve) < maximum_area and is_square(
            curve
        ):
            swatches.append(
                as_int_array(cv2.boxPoints(cv2.minAreaRect(curve)))
            )
    

    suggested way:

    def angle_cos(p0, p1, p2):
        d1, d2 = (p0 - p1).astype('float'), (p2 - p1).astype('float')
        return abs(np.dot(d1, d2) / np.sqrt(np.dot(d1, d1) * np.dot(d2, d2)))
    
    # Filtering squares/swatches contours.
    swatches = []
    for contour in contours:
        curve = cv2.approxPolyDP(
            contour, 0.01 * cv2.arcLength(contour, True), True
        )
        if len(curve) == 4 and minimum_area < cv2.contourArea(curve) < maximum_area and cv2.isContourConvex(curve):
            cnt = curve.reshape(-1, 2)
            max_cos = np.max([angle_cos( cnt[i], cnt[(i+1) % 4], cnt[(i+2) % 4] ) for i in range(4)])
            if max_cos < 0.1:
                swatches.append(as_int_array(cv2.boxPoints(cv2.minAreaRect(curve))))
    

    From my little testing it seems to help prevent erroneous contours from being detected on the passport color-checker eg: WITHOUT SUGGESTION: step_5_mod

    WITH SUGGESTION: step_5

    Feature 
    opened by mexicantexan 3
Releases(v0.1.4)
  • v0.1.4(Dec 4, 2022)

    This release is a compatibility release with Colour 0.4.2 providing support for Python 3.11.

    The minimum Python version is 3.9 and the following scientific packages minimum versions are required:

    • Numpy >= 1.20
    • Scipy >= 1.7
    • colour-science >= 0.4.2
    Source code(tar.gz)
    Source code(zip)
  • v0.1.3(Feb 27, 2022)

    This release is a compatibility release with Colour 0.4.1.

    Support for Python 2.7 has been dropped!

    It is now possible to detect the ColorChecker SG in an image.

    Changes

    • The signatures and return values of various definitions have been updated. (@KelSolaar)

    Please refer to the following attributes and definitions:

    • colour_checker_detection.SETTINGS_SEGMENTATION_COLORCHECKER_CLASSIC
    • colour_checker_detection.SETTINGS_SEGMENTATION_COLORCHECKER_SG
    • colour_checker_detection.colour_checkers_coordinates_segmentation
    • colour_checker_detection.extract_colour_checkers_segmentation
    • colour_checker_detection.detect_colour_checkers_segmentation
    Source code(tar.gz)
    Source code(zip)
  • v0.1.2(Nov 28, 2020)

  • v0.1.0(Mar 24, 2019)

Owner
colour-science
Colour Science & Digital Imaging
colour-science
This is discord nitro code generator and checker made with python. This will generate nitro codes and checks if the code is valid or not. If code is valid then it will print the code leaving 2 lines and if not then it will print '*'.

Discord Nitro Generator And Checker ⚙️ Rᴜɴ Oɴ Rᴇᴘʟɪᴛ ??️ Lᴀɴɢᴜᴀɢᴇs Aɴᴅ Tᴏᴏʟs If you are taking code from this repository without a fork, then atleast

Vɪɴᴀʏᴀᴋ Pᴀɴᴅᴇʏ 37 Jan 7, 2023
Implementing C++ Semantics in Python

Implementing C++ Semantics in Python

Tamir Bahar 7 May 18, 2022
Allows you to canibalize methods from classes effectively implementing trait-oriented programming

About This package enables code reuse in non-inheritance way from existing classes, effectively implementing traits-oriented programming pattern. Stor

null 1 Dec 13, 2021
Python type-checker written in Rust

pravda Python type-checker written in Rust Features Fully typed with annotations and checked with mypy, PEP561 compatible Add yours! Installation pip

wemake.services 31 Oct 21, 2022
A quick username checker to see if a username is available on a list of assorted websites.

A quick username checker to see if a username is available on a list of assorted websites.

Maddie 4 Jan 4, 2022
Python utilities for writing cross-version compatible libraries

Python utilities for writing cross-version compatible libraries

Tyler M. Kontra 85 Jun 29, 2022
Python based utilities for interacting with digital multimeters that are built on the FS9721-LP3 chipset.

Python based utilities for interacting with digital multimeters that are built on the FS9721-LP3 chipset.

Fergus 1 Feb 2, 2022
This repository contains some utilities for playing with PKINIT and certificates.

PKINIT tools This repository contains some utilities for playing with PKINIT and certificates. The tools are built on minikerberos and impacket. Accom

Dirk-jan 395 Dec 27, 2022
Plone Interface contracts, plus basic features and utilities

plone.base This package is the base package of the CMS Plone <https://plone.org>. It contains only interface contracts and basic features and utilitie

Plone Foundation 1 Oct 3, 2022
Set of utilities for exporting/controlling your robot in Blender

Blender Robotics Utils This repository contains utilities for exporting/controlling your robot in Blender Maintainers This repository is maintained by

Robotology 33 Nov 30, 2022
Michael Vinyard's utilities

Install vintools To download this package from pypi: pip install vintools Install the development package To download and install the developmen

Michael Vinyard 2 May 22, 2022
Data Utilities e.g. for importing files to onetask

Use this repository to easily convert your source files (csv, txt, excel, json, html) into record-oriented JSON files that can be uploaded into onetask.

onetask.ai 1 Jul 18, 2022
PyResToolbox - A collection of Reservoir Engineering Utilities

pyrestoolbox A collection of Reservoir Engineering Utilities This set of functio

Mark W. Burgoyne 39 Oct 17, 2022
ZX Spectrum Utilities: (zx-spectrum-utils)

Here are a few utility programs that can be used with the zx spectrum. The ZX Spectrum is one of the first home computers from the early 1980s.

Graham Oakes 4 Mar 7, 2022
Python Libraries with functions and constants related to electrical engineering.

ElectricPy Electrical-Engineering-for-Python Python Libraries with functions and constants related to electrical engineering. The functions and consta

Joe Stanley 39 Dec 23, 2022
Utility to play with ADCS, allows to request tickets and collect information about related objects.

certi Utility to play with ADCS, allows to request tickets and collect information about related objects. Basically, it's the impacket copy of Certify

Eloy 185 Dec 29, 2022
Airspy-Utils is a small software collection to help with firmware related operations on Airspy HF+ devices.

Airspy-Utils Airspy-Utils is a small software collection to help with firmware related operations on Airspy HF+ devices on Linux (and other free syste

Dhiru Kholia 11 Oct 4, 2022
PyHook is an offensive API hooking tool written in python designed to catch various credentials within the API call.

PyHook is the python implementation of my SharpHook project, It uses various API hooks in order to give us the desired credentials. PyHook Uses

Ilan Kalendarov 158 Dec 22, 2022
ColorController is a Pythonic interface for managing colors by english-language name and various color values.

ColorController.py Table of Contents Encode color data in various formats. 1.1: Create a ColorController object using a familiar, english-language col

Tal Zaken 2 Feb 12, 2022