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

PR: Implement support for IHLS colourspace. #822

Conversation

SGeetansh
Copy link
Contributor

Cherry-picked commits from #614.

Copy link
Member

@KelSolaar KelSolaar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello,

Left some comments here, bit of minor work left to cleanup the cherry-picked commit.

Cheers,

Thomas

@@ -19,6 +19,7 @@
YCbCr_to_RGB, RGB_to_YcCbcCrc, YcCbcCrc_to_RGB)
from .ycocg import RGB_to_YCoCg, YCoCg_to_RGB
from .ictcp import RGB_to_ICtCp, ICtCp_to_RGB, XYZ_to_ICtCp, ICtCp_to_XYZ
from .hanbury2002 import RGB_to_IHLS, IHLS_to_RGB
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs to be in alphabetical order here.

@@ -42,3 +43,5 @@
]
__all__ += ['RGB_to_YCoCg', 'YCoCg_to_RGB']
__all__ += ['RGB_to_ICtCp', 'ICtCp_to_RGB', 'XYZ_to_ICtCp', 'ICtCp_to_XYZ']
__all__ += ['RGB_to_ICtCp', 'ICtCp_to_RGB']
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one is extraneous.

@@ -42,3 +43,5 @@
]
__all__ += ['RGB_to_YCoCg', 'YCoCg_to_RGB']
__all__ += ['RGB_to_ICtCp', 'ICtCp_to_RGB', 'XYZ_to_ICtCp', 'ICtCp_to_XYZ']
__all__ += ['RGB_to_ICtCp', 'ICtCp_to_RGB']
__all__ += ['RGB_to_IHLS', 'IHLS_to_RGB']
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto for order.

# -*- coding: utf-8 -*-
"""
:math:`IHLS` Colour Encoding
===============================
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Header === are too long.

References
----------
- :cite:
https://www.researchgate.net/publication/243602454_A_3D-Polar_Coordinate_Colour_Representation_Suitable_for_Image_Analysis
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Key: Hanbury2003
  • Bibliography: Hanbury, A. (2003). A 3D-Polar Coordinate Colour Representation Well Adapted to Image Analysis. In J. Bigun & T. Gustavsson (Eds.), Image Analysis (pp. 804–811). Springer Berlin Heidelberg. ISBN:978-3-540-45103-7

Defines unit tests for :mod:`colour.models.rgb.cylindrical` module.
"""

from __future__ import division, unicode_literals
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not required.


import numpy as np
import unittest
from itertools import permutations
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line break.

import numpy as np
import unittest
from itertools import permutations
from colour.models.rgb.hanbury2002 import (RGB_to_IHLS, IHLS_to_RGB)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need for parenthesis.

"""
Tests :func:`colour.models.rgb.HLS.RGB_to_HLS` definition.
"""
np.testing.assert_almost_equal(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line breaks consistency.

RGB_to_IHLS(np.array([0.45620519, 0.03081071, 0.04091952])),
np.array([3.59979176e+02, 1.21979433e-01, -1.57572751e-01]),
decimal=7)
np.testing.assert_almost_equal(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto

@SGeetansh SGeetansh force-pushed the feature/IHLS_colourspace_cherry-pick branch from c8616c9 to 4952a28 Compare July 11, 2021 06:53
@KelSolaar
Copy link
Member

Hey @SGeetansh,

As mentioned on Slack, we can cherry-pick the last commit from this branch to hopefully finish with one: https://github.com/colour-science/colour/tree/feature/hanbury2003

@KelSolaar KelSolaar added this to the v0.4.0 milestone Aug 13, 2021
@KelSolaar
Copy link
Member

Thanks @SGeetansh!

@KelSolaar KelSolaar changed the title PR: Implement support for IHLS colourspace PR: Implement support for IHLS colourspace. Aug 13, 2021
@KelSolaar KelSolaar merged commit e9f8ba9 into colour-science:develop Aug 13, 2021
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

Successfully merging this pull request may close these issues.

3 participants