-
-
Notifications
You must be signed in to change notification settings - Fork 262
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
PR: Implement support for IHLS colourspace. #822
Conversation
There was a problem hiding this 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
colour/models/rgb/__init__.py
Outdated
@@ -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 |
There was a problem hiding this comment.
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.
colour/models/rgb/__init__.py
Outdated
@@ -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'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one is extraneous.
colour/models/rgb/__init__.py
Outdated
@@ -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'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto for order.
colour/models/rgb/hanbury2002.py
Outdated
# -*- coding: utf-8 -*- | ||
""" | ||
:math:`IHLS` Colour Encoding | ||
=============================== |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Header ===
are too long.
colour/models/rgb/hanbury2002.py
Outdated
References | ||
---------- | ||
- :cite: | ||
https://www.researchgate.net/publication/243602454_A_3D-Polar_Coordinate_Colour_Representation_Suitable_for_Image_Analysis |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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( |
There was a problem hiding this comment.
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( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto
c8616c9
to
4952a28
Compare
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 |
Thanks @SGeetansh! |
Cherry-picked commits from #614.