Skip to content

Commit

Permalink
Merge branch 'release/v0.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
KelSolaar committed Dec 18, 2015
2 parents f32168e + 92c7ed3 commit 7207e26
Show file tree
Hide file tree
Showing 15 changed files with 158 additions and 19 deletions.
2 changes: 2 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[run]
source = colour_hdri
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@
.idea
.ipynb_checkpoints/
__pycache__
docs/_build
colour_hdri.egg-info
dist
docs/_build
2 changes: 2 additions & 0 deletions .landscape.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ignore-paths:
- docs
60 changes: 60 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
sudo: true
language: python

matrix:
fast_finish: true
include:
- python: 2.7
env:
- PYTHON_VERSION="2.7"
- NUMPY_VERSION="1.10.1"
- SCIPY_VERSION="0.16.0"
- MATPLOTLIB_VERSION="1.4.3"

notifications:
slack: colour-science:Y6lPPcN7y53Js94geqUpqsAP

addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- libboost-all-dev
- libopenexr-dev
- libilmbase-dev
- libimage-exiftool-perl

before_install:
- wget http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh
- chmod +x miniconda.sh
- ./miniconda.sh -b -p /home/travis/miniconda
- export PATH=/home/travis/miniconda/bin:$PATH
- conda update --yes --quiet conda
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
- PACKAGES="python=${PYTHON_VERSION}"
- PACKAGES="${PACKAGES} numpy"; if [ ${NUMPY_VERSION} ]; then PACKAGES="${PACKAGES}=${NUMPY_VERSION}"; fi
- PACKAGES="${PACKAGES} scipy"; if [ ${SCIPY_VERSION} ]; then PACKAGES="${PACKAGES}=${SCIPY_VERSION}"; fi
- PACKAGES="${PACKAGES} matplotlib"; if [ ${MATPLOTLIB_VERSION} ]; then PACKAGES="${PACKAGES}=${MATPLOTLIB_VERSION}"; fi
# TODO: Investigate reason why *dcraw* cannot be installed along other packages.
- sudo apt-get install dcraw
- wget https://github.com/OpenImageIO/oiio/archive/Release-1.5.21.tar.gz -O /tmp/OpenImageIO-1.5.21.tar.gz
- tar -xvf /tmp/OpenImageIO-1.5.21.tar.gz
- cd oiio-Release-1.5.21
- make
- cd /home/travis/build/colour-science/colour-hdri

install:
- conda create --yes --quiet -n colour-hdri-test ${PACKAGES} pip setuptools nose
- source activate colour-hdri-test
- pip install colour-science recordclass coverage coveralls flake8 mock==1.0.1
- sudo cp /home/travis/build/colour-science/colour-hdri/oiio-Release-1.5.21/dist/linux64/bin/* /usr/local/bin/
- sudo cp /home/travis/build/colour-science/colour-hdri/oiio-Release-1.5.21/dist/linux64/lib/* /usr/local/lib/
- cp /home/travis/build/colour-science/colour-hdri/oiio-Release-1.5.21/dist/linux64/python/OpenImageIO.so /home/travis/miniconda/envs/colour-hdri-test/lib/python2.7/site-packages/

script:
- flake8 colour_hdri
- nosetests --nocapture --with-doctest --doctest-options=+ELLIPSIS,+NORMALIZE_WHITESPACE --with-coverage --cover-package=colour_hdri -exclude-dir=

after_success:
- coveralls
12 changes: 12 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
include COPYING
include LICENSE
include *.bib
include *.rst
graft colour_hdri/examples
graft docs/_build
graft utilities
prune colour_hdri/examples/.ipynb_checkpoints
global-exclude *.pyc
global-exclude *.pyo
global-exclude ._*
global-exclude .DS_Store
19 changes: 19 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
.. image:: https://badge.waffle.io/colour-science/colour-hdri.svg?label=ready&title=Ready
:target: https://github.com/colour-science/colour-hdri/issues
.. image:: https://img.shields.io/travis/colour-science/colour-hdri/develop.svg
:target: https://travis-ci.org/colour-science/colour-hdri
.. image:: http://img.shields.io/coveralls/colour-science/colour-hdri/develop.svg
:target: https://coveralls.io/r/colour-science/colour-hdri
.. image:: https://img.shields.io/scrutinizer/g/colour-science/colour-hdri/develop.svg
:target: https://scrutinizer-ci.com/g/colour-science/colour-hdri/
.. image:: https://landscape.io/github/colour-science/colour-hdri/master/landscape.png
:target: https://landscape.io/github/colour-science/colour-hdri
.. image:: https://img.shields.io/gemnasium/colour-science/colour-hdri.svg
:target: https://gemnasium.com/colour-science/colour-hdri
.. image:: https://badge.fury.io/py/colour-hdri.svg
:target: https://pypi.python.org/pypi/colour-hdri
.. image:: https://img.shields.io/pypi/dm/colour-hdri.svg
:target: https://pypi.python.org/pypi/colour-hdri

Colour - HDRI
=============

Expand All @@ -12,6 +29,8 @@ It is open source and freely available under the
Features
--------

The following features are available:

- HDRI / Radiance Image Generation
- Debevec (1997) Camera Response Function Computation
- Grossberg (2003) Histogram Based Image Sampling
Expand Down
29 changes: 29 additions & 0 deletions TODO.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
Colour - HDRI - TODO
====================

TODO
----

- colour_hdri (2 items in 2 files)

- calibration (1 item in 1 file)

- debevec1997.py

- (159, 11) # 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.

- tonemapping (1 item in 1 file)

- global_operators (1 item in 1 file)

- operators.py

- (464, 7) # TODO: Implement automatic *p* and *non-uniform* computations support.

About
-----

| **Colour - HDRI** by Colour Developers - 2013 - 2015
| Copyright © 2013 - 2015 – Colour Developers – `colour-science@googlegroups.com <colour-science@googlegroups.com>`_
| This software is released under terms of New BSD License: http://opensource.org/licenses/BSD-3-Clause
| `http://github.com/colour-science/colour-hdri <http://github.com/colour-science/colour-hdri>`_
3 changes: 0 additions & 3 deletions colour_hdri/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@
from . import calibration
from .models import * # noqa
from . import models
from .plotting import * # noqa
from . import plotting
from .process import * # noqa
from . import process
from .recovery import * # noqa
Expand All @@ -58,7 +56,6 @@
__all__ += generation.__all__
__all__ += calibration.__all__
__all__ += models.__all__
__all__ += plotting.__all__
__all__ += process.__all__
__all__ += recovery.__all__
__all__ += tonemapping.__all__
Expand Down
26 changes: 16 additions & 10 deletions colour_hdri/calibration/tests/tests_debevec1997.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,19 +60,23 @@ def test_g_solve(self):
for i in range(3):
g, lE = g_solve(samples[..., i], L_l)

np.testing.assert_almost_equal(
g,
# Lower precision for unit tests under *travis-ci*.
np.testing.assert_allclose(
g[0:-2],
np.load(os.path.join(
CALIBRATION_DIRECTORY,
'test_g_solve_g_{0}.npy'.format(i))),
decimal=7)
'test_g_solve_g_{0}.npy'.format(i)))[0:-2],
rtol=0.001,
atol=0.001)

np.testing.assert_almost_equal(
lE,
# Lower precision for unit tests under *travis-ci*.
np.testing.assert_allclose(
lE[1:],
np.load(os.path.join(
CALIBRATION_DIRECTORY,
'test_g_solve_lE_{0}.npy'.format(i))),
decimal=7)
'test_g_solve_lE_{0}.npy'.format(i)))[1:],
rtol=0.001,
atol=0.001)


class TestCameraResponseFunctionsDebevec1997(unittest.TestCase):
Expand All @@ -87,13 +91,15 @@ def test_camera_response_function_Debevec1997(self):
camera_response_functions_Debevec1997` definition.
"""

np.testing.assert_almost_equal(
# Lower precision for unit tests under *travis-ci*.
np.testing.assert_allclose(
camera_response_functions_Debevec1997(
ImageStack.from_files(JPG_IMAGES)),
np.load(os.path.join(
CALIBRATION_DIRECTORY,
'test_camera_response_function_Debevec1997_crfs.npy')),
decimal=7)
rtol=0.00001,
atol=0.00001)


if __name__ == '__main__':
Expand Down
6 changes: 4 additions & 2 deletions colour_hdri/generation/tests/tests_radiance.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,18 @@ def test_radiance_image(self):
'test_radiance_image_linear.npy')),
decimal=7)

# Lower precision for unit tests under *travis-ci*.
image_stack = ImageStack.from_files(JPG_IMAGES)
np.testing.assert_almost_equal(
np.testing.assert_allclose(
image_stack_to_radiance_image(
image_stack,
camera_response_functions=(
camera_response_functions_Debevec1997(image_stack))),
np.load(os.path.join(
GENERATION_DIRECTORY,
'test_radiance_image_crfs.npy')),
decimal=7)
rtol=0.00001,
atol=0.00001)


if __name__ == '__main__':
Expand Down
2 changes: 1 addition & 1 deletion colour_hdri/plotting/radiance.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def radiance_image_strip_plot(image,
grid = matplotlib.gridspec.GridSpec(1, count)
grid.update(wspace=0, hspace=0)

height, width, channel = image.shape
height, width, _channel = image.shape
for i in range(count):
ev = i * ev_steps
axis = matplotlib.pyplot.subplot(grid[i])
Expand Down
6 changes: 6 additions & 0 deletions colour_hdri/process/tests/tests_conversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

import numpy as np
import os
import platform
import shutil
import tempfile
import unittest
Expand Down Expand Up @@ -69,6 +70,11 @@ def test_convert_raw_files_to_dng_files(self):
convert_raw_files_to_dng_files` definition.
"""

if platform.system() not in ('Windows', 'Microsoft', 'Darwin'):
# *Adobe DNG Converter* is not available on Linux, thus we skip
# that unit test.
return

reference_dng_files = sorted(filter_files(
PROCESS_DIRECTORY, ('dng',)))
test_dng_files = sorted(convert_raw_files_to_dng_files(
Expand Down
2 changes: 1 addition & 1 deletion colour_hdri/recovery/tests/tests_recovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

__all__ = ['FROBISHER_001_DIRECTORY',
'RECOVERY_DIRECTORY',
'RAW_IMAGES'
'RAW_IMAGES',
'TestHighlightsRecoveryBlend']

FROBISHER_001_DIRECTORY = os.path.join(
Expand Down
2 changes: 1 addition & 1 deletion colour_hdri/sampling/tests/tests_grossberg2003.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

__all__ = ['FROBISHER_001_DIRECTORY',
'SAMPLING_DIRECTORY',
'JPG_IMAGES'
'JPG_IMAGES',
'TestSamplesGrossberg2003']

FROBISHER_001_DIRECTORY = os.path.join(
Expand Down
2 changes: 2 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ It is open source and freely available under the
Features
--------

The following features are available:

- HDRI / Radiance Image Generation
- Debevec (1997) Camera Response Function Computation
- Grossberg (2003) Histogram Based Image Sampling
Expand Down

0 comments on commit 7207e26

Please sign in to comment.