Open
Conversation
The updated implementation uses the @ operator for matrix multiplication, uses the `illuminant_D65` constant from the `colour` library for the reference white point, and includes a more detailed function signature.
andreped
requested changes
Apr 4, 2023
| _rgb2xyz = np.array([[0.412453, 0.357580, 0.180423], | ||
| [0.212671, 0.715160, 0.072169], | ||
| [0.019334, 0.119193, 0.950227]]) | ||
| from colour.models import illuminants |
Collaborator
There was a problem hiding this comment.
For this project, we wish to use pure numpy, torch, or tensorflow without introducing any new libraries. Hence, using the colour library is not ideal.
| # scale by CIE XYZ tristimulus values of the reference white point | ||
| arr = xyz.copy() | ||
| arr = arr / np.asarray((0.95047, 1., 1.08883), dtype=xyz.dtype) | ||
| xyz = xyz / illuminants.illuminant_D65()[np.newaxis, :] |
Collaborator
There was a problem hiding this comment.
Due to the beforementioned comment, I would keep the old solution for this transform.
The old copy() can still likely be removed, and the variable renaming is fine.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The updated implementation uses the @ operator for matrix multiplication, uses the
illuminant_D65constant from thecolourlibrary for the reference white point, and includes a more detailed function signature.