Skip to content

Commit 799091d

Browse files
committed
Merge branch 'release/v0.1.5'
2 parents be98ae3 + 7462894 commit 799091d

File tree

64 files changed

+1722
-1108
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+1722
-1108
lines changed

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ matrix:
77
- python: 2.7
88
env:
99
- PYTHON_VERSION="2.7"
10-
- NUMPY_VERSION="1.13.3"
1110

1211
notifications:
1312
slack: colour-science:Y6lPPcN7y53Js94geqUpqsAP

BIBLIOGRAPHY.bib

Lines changed: 297 additions & 166 deletions
Large diffs are not rendered by default.

CONTRIBUTORS.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ About
1212
-----
1313

1414
| **Colour - HDRI** by Colour Developers
15-
| Copyright © 2015-2018 – Colour Developers – `colour-science@googlegroups.com <colour-science@googlegroups.com>`_
15+
| Copyright © 2015-2019 – Colour Developers – `colour-science@googlegroups.com <colour-science@googlegroups.com>`_
1616
| This software is released under terms of New BSD License: http://opensource.org/licenses/BSD-3-Clause
1717
| `http://github.com/colour-science/colour-hdri <http://github.com/colour-science/colour-hdri>`_

COPYING

Lines changed: 0 additions & 28 deletions
This file was deleted.

MANIFEST.in

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
include COPYING
21
include LICENSE
32
include *.bib
43
include *.rst
54
graft colour_hdri/examples
6-
graft docs/_build
7-
graft utilities
85
prune colour_hdri/examples/.ipynb_checkpoints
96
global-exclude *.pyc
107
global-exclude *.pyo

README.rst

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ Primary Dependencies
5959

6060
- `Python 2.7 <https://www.python.org/download/releases/>`_ or
6161
`Python 3.5 <https://www.python.org/download/releases/>`_
62+
- `Colour Science <https://www.colour-science.org>`_
6263
- `NumPy <http://www.numpy.org/>`_
6364
- `OpenImageIO <https://github.com/OpenImageIO/oiio>`_
6465

@@ -96,6 +97,10 @@ The documentation building dependencies are installed as follows::
9697

9798
pip install 'colour-hdri[docs]'
9899

100+
The overall development dependencies are installed as follows::
101+
102+
pip install 'colour-hdri[development]'
103+
99104
Usage
100105
-----
101106

@@ -115,7 +120,7 @@ Contributing
115120
------------
116121

117122
If you would like to contribute to `Colour - HDRI <https://github.com/colour-science/colour-hdri>`_,
118-
please refer to the following `Contributing <http://colour-science.org/contributing/>`_
123+
please refer to the following `Contributing <https://www.colour-science.org/contributing/>`_
119124
guide for `Colour <https://github.com/colour-science/colour>`_.
120125

121126
Bibliography
@@ -129,6 +134,6 @@ About
129134
-----
130135

131136
| **Colour - HDRI** by Colour Developers
132-
| Copyright © 2015-2018 – Colour Developers – `colour-science@googlegroups.com <colour-science@googlegroups.com>`_
137+
| Copyright © 2015-2019 – Colour Developers – `colour-science@googlegroups.com <colour-science@googlegroups.com>`_
133138
| This software is released under terms of New BSD License: http://opensource.org/licenses/BSD-3-Clause
134139
| `http://github.com/colour-science/colour-hdri <http://github.com/colour-science/colour-hdri>`_

TODO.rst

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,14 @@ Colour - HDRI - TODO
44
TODO
55
----
66

7+
- colour_hdri/__init__.py
8+
9+
- Line 144 : # TODO: Remove legacy printing support when deemed appropriate.
10+
11+
712
- colour_hdri/calibration/debevec1997.py
813

9-
- Line 168 : # TODO: Investigate if the normalisation value should account for the percentage of uncertain camera response functions values or be correlated to it and scaled accordingly. As an alternative of setting the uncertain camera response functions values to zero, it would be interesting to explore extrapolation as the camera response functions are essentially smooth. It is important to note that camera sensors are usually acting non linearly when reaching saturation level.
14+
- Line 167 : # TODO: Investigate if the normalisation value should account for the percentage of uncertain camera response functions values or be correlated to it and scaled according. As an alternative of setting the uncertain camera response functions values to zero, it would be interesting to explore extrapolation as the camera response functions are essentially smooth. It is important to note that camera sensors are usually acting non linearly when reaching saturation level.
1015

1116

1217
- colour_hdri/tonemapping/global_operators/operators.py
@@ -17,6 +22,6 @@ About
1722
-----
1823

1924
| **Colour - HDRI** by Colour Developers
20-
| Copyright © 2015-2018 – Colour Developers – `colour-science@googlegroups.com <colour-science@googlegroups.com>`_
25+
| Copyright © 2015-2019 – Colour Developers – `colour-science@googlegroups.com <colour-science@googlegroups.com>`_
2126
| This software is released under terms of New BSD License: http://opensource.org/licenses/BSD-3-Clause
2227
| `http://github.com/colour-science/colour-hdri <http://github.com/colour-science/colour-hdri>`_

colour_hdri/__init__.py

Lines changed: 38 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,20 @@
2222

2323
from __future__ import absolute_import
2424

25+
import numpy as np
2526
import os
27+
import recordclass
28+
import subprocess # nosec
29+
30+
import colour
2631

2732
from .utilities import (
28-
EXIF_EXECUTABLE, ExifTag, adjust_exposure, average_luminance,
29-
copy_exif_tags, delete_exif_tags, exposure_value, filter_files, Image,
30-
ImageStack, Metadata, parse_exif_array, parse_exif_data,
31-
parse_exif_fraction, parse_exif_numeric, parse_exif_string, path_exists,
32-
read_exif_tag, read_exif_tags, update_exif_tags, vivification,
33-
vivified_to_dict, write_exif_tag)
33+
EXIF_EXECUTABLE, ExifTag, adjust_exposure, average_illuminance,
34+
average_luminance, copy_exif_tags, delete_exif_tags, exposure_value,
35+
filter_files, Image, ImageStack, Metadata, parse_exif_array,
36+
parse_exif_data, parse_exif_fraction, parse_exif_numeric,
37+
parse_exif_string, path_exists, read_exif_tag, read_exif_tags,
38+
update_exif_tags, vivification, vivified_to_dict, write_exif_tag)
3439
from .sampling import (
3540
light_probe_sampling_variance_minimization_Viriyothai2009,
3641
samples_Grossberg2003)
@@ -48,7 +53,7 @@
4853
RAW_CONVERTER, RAW_D_CONVERSION_ARGUMENTS,
4954
convert_dng_files_to_intermediate_files,
5055
convert_raw_files_to_dng_files, read_dng_files_exif_tags)
51-
from .recovery import (highlights_recovery_blend, highlights_recovery_LCHab)
56+
from .recovery import highlights_recovery_blend, highlights_recovery_LCHab
5257
from .tonemapping import (
5358
tonemapping_operator_exponential,
5459
tonemapping_operator_exponentiation_mapping, tonemapping_operator_filmic,
@@ -59,19 +64,20 @@
5964
tonemapping_operator_Tumblin1999)
6065

6166
__author__ = 'Colour Developers'
62-
__copyright__ = 'Copyright (C) 2015-2018 - Colour Developers'
67+
__copyright__ = 'Copyright (C) 2015-2019 - Colour Developers'
6368
__license__ = 'New BSD License - http://opensource.org/licenses/BSD-3-Clause'
6469
__maintainer__ = 'Colour Developers'
6570
__email__ = 'colour-science@googlegroups.com'
6671
__status__ = 'Production'
6772

6873
__all__ = [
69-
'EXIF_EXECUTABLE', 'ExifTag', 'adjust_exposure', 'average_luminance',
70-
'copy_exif_tags', 'delete_exif_tags', 'exposure_value', 'filter_files',
71-
'Image', 'ImageStack', 'Metadata', 'parse_exif_array', 'parse_exif_data',
72-
'parse_exif_fraction', 'parse_exif_numeric', 'parse_exif_string',
73-
'path_exists', 'read_exif_tag', 'read_exif_tags', 'update_exif_tags',
74-
'vivification', 'vivified_to_dict', 'write_exif_tag'
74+
'EXIF_EXECUTABLE', 'ExifTag', 'adjust_exposure', 'average_illuminance',
75+
'average_luminance', 'copy_exif_tags', 'delete_exif_tags',
76+
'exposure_value', 'filter_files', 'Image', 'ImageStack', 'Metadata',
77+
'parse_exif_array', 'parse_exif_data', 'parse_exif_fraction',
78+
'parse_exif_numeric', 'parse_exif_string', 'path_exists', 'read_exif_tag',
79+
'read_exif_tags', 'update_exif_tags', 'vivification', 'vivified_to_dict',
80+
'write_exif_tag'
7581
]
7682
__all__ += [
7783
'light_probe_sampling_variance_minimization_Viriyothai2009',
@@ -119,8 +125,25 @@
119125

120126
__major_version__ = '0'
121127
__minor_version__ = '1'
122-
__change_version__ = '4'
128+
__change_version__ = '5'
123129
__version__ = '.'.join(
124130
(__major_version__,
125131
__minor_version__,
126132
__change_version__)) # yapf: disable
133+
134+
try:
135+
version = subprocess.check_output( # nosec
136+
['git', 'describe'], cwd=os.path.dirname(__file__)).strip()
137+
version = version.decode('utf-8')
138+
except Exception:
139+
version = __version__
140+
141+
colour.utilities.ANCILLARY_COLOUR_SCIENCE_PACKAGES['colour-hdri'] = version
142+
colour.utilities.ANCILLARY_RUNTIME_PACKAGES[
143+
'recordclass'] = recordclass.__version__
144+
145+
# TODO: Remove legacy printing support when deemed appropriate.
146+
try:
147+
np.set_printoptions(legacy='1.13')
148+
except TypeError:
149+
pass

colour_hdri/calibration/absolute_luminance.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,10 @@
2323
import numpy as np
2424

2525
from colour import RGB_COLOURSPACES, RGB_luminance
26+
from colour.utilities import as_float_array
2627

2728
__author__ = 'Colour Developers'
28-
__copyright__ = 'Copyright (C) 2015-2018 - Colour Developers'
29+
__copyright__ = 'Copyright (C) 2015-2019 - Colour Developers'
2930
__license__ = 'New BSD License - http://opensource.org/licenses/BSD-3-Clause'
3031
__maintainer__ = 'Colour Developers'
3132
__email__ = 'colour-science@googlegroups.com'
@@ -58,7 +59,7 @@ def upper_hemisphere_illuminance_Lagarde2016(
5859
5960
References
6061
----------
61-
- :cite:`Lagarde2016b`
62+
:cite:`Lagarde2016b`
6263
6364
Examples
6465
--------
@@ -67,7 +68,7 @@ def upper_hemisphere_illuminance_Lagarde2016(
6768
2.9344691...
6869
"""
6970

70-
RGB = np.asarray(RGB)
71+
RGB = as_float_array(RGB)
7172

7273
height, width, _channels = RGB.shape
7374

@@ -104,7 +105,7 @@ def upper_hemisphere_illuminance_weights_Lagarde2016(height, width):
104105
105106
References
106107
----------
107-
- :cite:`Lagarde2016b`
108+
:cite:`Lagarde2016b`
108109
109110
Examples
110111
--------
@@ -204,7 +205,7 @@ def absolute_luminance_calibration_Lagarde2016(
204205
[ 233.9912506..., 233.9912506..., 233.9912506...]]])
205206
"""
206207

207-
RGB = np.asarray(RGB)
208+
RGB = as_float_array(RGB)
208209

209210
E_v = upper_hemisphere_illuminance_Lagarde2016(RGB, colourspace)
210211

colour_hdri/calibration/debevec1997.py

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@
2727

2828
import numpy as np
2929

30-
from colour.utilities import tstack
30+
from colour.utilities import as_float_array, as_int_array, tstack
3131

3232
from colour_hdri.generation import weighting_function_Debevec1997
3333
from colour_hdri.sampling import samples_Grossberg2003
3434
from colour_hdri.utilities import average_luminance
3535

3636
__author__ = 'Colour Developers'
37-
__copyright__ = 'Copyright (C) 2015-2018 - Colour Developers'
37+
__copyright__ = 'Copyright (C) 2015-2019 - Colour Developers'
3838
__license__ = 'New BSD License - http://opensource.org/licenses/BSD-3-Clause'
3939
__maintainer__ = 'Colour Developers'
4040
__email__ = 'colour-science@googlegroups.com'
@@ -55,9 +55,9 @@ def g_solve(Z, B, l_s=30, w=weighting_function_Debevec1997, n=256):
5555
Z : array_like
5656
Set of pixel values observed for several pixels in several images.
5757
B : array_like
58-
Log :math:`\Delta t`, or log shutter speed for images.
58+
Log :math:`\\Delta t`, or log shutter speed for images.
5959
l_s : numeric, optional
60-
:math:`\lambda` smoothing term.
60+
:math:`\\lambda` smoothing term.
6161
w : callable, optional
6262
Weighting function :math:`w`.
6363
n : int, optional
@@ -71,12 +71,12 @@ def g_solve(Z, B, l_s=30, w=weighting_function_Debevec1997, n=256):
7171
7272
References
7373
----------
74-
- :cite:`Debevec1997a`
74+
:cite:`Debevec1997a`
7575
"""
7676

77-
Z = np.asarray(Z).astype(int)
78-
B = np.asarray(B)
79-
l_s = np.asarray(l_s)
77+
Z = as_int_array(Z)
78+
B = as_float_array(B)
79+
l_s = as_float_array(l_s)
8080

8181
Z_x, Z_y = Z.shape
8282

@@ -134,7 +134,7 @@ def camera_response_functions_Debevec1997(image_stack,
134134
samples : int, optional
135135
Samples count per images.
136136
l_s : numeric, optional
137-
:math:`\lambda` smoothing term.
137+
:math:`\\lambda` smoothing term.
138138
w : callable, optional
139139
Weighting function :math:`w`.
140140
n : int, optional
@@ -151,14 +151,13 @@ def camera_response_functions_Debevec1997(image_stack,
151151
152152
References
153153
----------
154-
- :cite:`Debevec1997a`
154+
:cite:`Debevec1997a`
155155
"""
156156

157157
s_o = s(image_stack.data, samples, n)
158158

159-
L_l = np.log(
160-
average_luminance(image_stack.f_number, image_stack.exposure_time,
161-
image_stack.iso))
159+
L_l = np.log(1 / average_luminance(
160+
image_stack.f_number, image_stack.exposure_time, image_stack.iso))
162161

163162
g_c = [
164163
g_solve(s_o[..., x], L_l, l_s, w, n)[0] for x in range(s_o.shape[-1])
@@ -168,7 +167,7 @@ def camera_response_functions_Debevec1997(image_stack,
168167
if normalise:
169168
# TODO: Investigate if the normalisation value should account for the
170169
# percentage of uncertain camera response functions values or be
171-
# correlated to it and scaled accordingly. As an alternative of setting
170+
# correlated to it and scaled according. As an alternative of setting
172171
# the uncertain camera response functions values to zero, it would be
173172
# interesting to explore extrapolation as the camera response functions
174173
# are essentially smooth. It is important to note that camera sensors

colour_hdri/calibration/tests/test_absolute_luminance.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
upper_hemisphere_illuminance_Lagarde2016)
2222

2323
__author__ = 'Colour Developers'
24-
__copyright__ = 'Copyright (C) 2015-2018 - Colour Developers'
24+
__copyright__ = 'Copyright (C) 2015-2019 - Colour Developers'
2525
__license__ = 'New BSD License - http://opensource.org/licenses/BSD-3-Clause'
2626
__maintainer__ = 'Colour Developers'
2727
__email__ = 'colour-science@googlegroups.com'

colour_hdri/calibration/tests/test_debevec1997.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
from colour_hdri.utilities import ImageStack, average_luminance, filter_files
1818

1919
__author__ = 'Colour Developers'
20-
__copyright__ = 'Copyright (C) 2015-2018 - Colour Developers'
20+
__copyright__ = 'Copyright (C) 2015-2019 - Colour Developers'
2121
__license__ = 'New BSD License - http://opensource.org/licenses/BSD-3-Clause'
2222
__maintainer__ = 'Colour Developers'
2323
__email__ = 'colour-science@googlegroups.com'
@@ -49,9 +49,8 @@ def test_g_solve(self):
4949
"""
5050

5151
image_stack = ImageStack.from_files(JPG_IMAGES)
52-
L_l = np.log(
53-
average_luminance(image_stack.f_number, image_stack.exposure_time,
54-
image_stack.iso))
52+
L_l = np.log(1 / average_luminance(
53+
image_stack.f_number, image_stack.exposure_time, image_stack.iso))
5554
samples = samples_Grossberg2003(image_stack.data)
5655

5756
for i in range(3):

0 commit comments

Comments
 (0)