-
-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
35 changed files
with
524 additions
and
602 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
[run] | ||
source = colour_demosaicing | ||
sigterm = True | ||
[report] | ||
exclude_lines = | ||
pragma: no cover | ||
|
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,5 +31,5 @@ About | |
|
||
| **Colour - Demosaicing** by Colour Developers | ||
| Copyright 2015 Colour Developers – `[email protected] <[email protected]>`__ | ||
| This software is released under terms of New BSD License: https://opensource.org/licenses/BSD-3-Clause | ||
| This software is released under terms of BSD-3-Clause: https://opensource.org/licenses/BSD-3-Clause | ||
| `https://github.com/colour-science/colour-demosaicing <https://github.com/colour-science/colour-demosaicing>`__ |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,11 @@ | ||
Copyright 2015 Colour Developers | ||
All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are met: | ||
* Redistributions of source code must retain the above copyright | ||
notice, this list of conditions and the following disclaimer. | ||
* Redistributions in binary form must reproduce the above copyright | ||
notice, this list of conditions and the following disclaimer in the | ||
documentation and/or other materials provided with the distribution. | ||
* Neither the name of the Colour Developers nor the | ||
names of its contributors may be used to endorse or promote products | ||
derived from this software without specific prior written permission. | ||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
DISCLAIMED. IN NO EVENT SHALL COLOUR DEVELOPERS BE LIABLE FOR ANY | ||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. | ||
|
||
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. | ||
|
||
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ Colour - Demosaicing | |
|actions| |coveralls| |codacy| |version| | ||
|
||
.. |actions| image:: https://img.shields.io/github/workflow/status/colour-science/colour-demosaicing/Continuous%20Integration%20-%20Quality%20&%20Unit%20Tests?label=actions&logo=github&style=flat-square | ||
.. |actions| image:: https://img.shields.io/github/actions/workflow/status/colour-science/colour-demosaicing/.github/workflows/continuous-integration-quality-unit-tests.yml?branch=develop&style=flat-square | ||
:target: https://github.com/colour-science/colour-demosaicing/actions | ||
:alt: Develop Build Status | ||
.. |coveralls| image:: http://img.shields.io/coveralls/colour-science/colour-demosaicing/develop.svg?style=flat-square | ||
|
@@ -20,11 +20,11 @@ Colour - Demosaicing | |
|
||
.. end-badges | ||
A `Python <https://www.python.org/>`__ package implementing various | ||
A `Python <https://www.python.org>`__ package implementing various | ||
CFA (Colour Filter Array) demosaicing algorithms and related utilities. | ||
|
||
It is open source and freely available under the | ||
`New BSD License <https://opensource.org/licenses/BSD-3-Clause>`__ terms. | ||
`BSD-3-Clause <https://opensource.org/licenses/BSD-3-Clause>`__ terms. | ||
|
||
.. image:: https://raw.githubusercontent.com/colour-science/colour-demosaicing/master/docs/_static/Demosaicing_001.png | ||
|
||
|
@@ -67,11 +67,11 @@ Primary Dependencies | |
|
||
**Colour - Demosaicing** requires various dependencies in order to run: | ||
|
||
- `python >= 3.8, < 4 <https://www.python.org/download/releases/>`__ | ||
- `colour-science >= 4 <https://pypi.org/project/colour-science/>`__ | ||
- `imageio >= 2, < 3 <https://imageio.github.io/>`__ | ||
- `numpy >= 1.19, < 2 <https://pypi.org/project/numpy/>`__ | ||
- `scipy >= 1.5, < 2 <https://pypi.org/project/scipy/>`__ | ||
- `python >= 3.9, < 4 <https://www.python.org/download/releases>`__ | ||
- `colour-science >= 4.3 <https://pypi.org/project/colour-science>`__ | ||
- `imageio >= 2, < 3 <https://imageio.github.io>`__ | ||
- `numpy >= 1.22, < 2 <https://pypi.org/project/numpy>`__ | ||
- `scipy >= 1.8, < 2 <https://pypi.org/project/scipy>`__ | ||
|
||
Pypi | ||
~~~~ | ||
|
@@ -90,7 +90,7 @@ Contributing | |
^^^^^^^^^^^^ | ||
|
||
If you would like to contribute to `Colour - Demosaicing <https://github.com/colour-science/colour-demosaicing>`__, | ||
please refer to the following `Contributing <https://www.colour-science.org/contributing/>`__ | ||
please refer to the following `Contributing <https://www.colour-science.org/contributing>`__ | ||
guide for `Colour <https://github.com/colour-science/colour>`__. | ||
|
||
Bibliography | ||
|
@@ -110,7 +110,7 @@ Code of Conduct | |
--------------- | ||
|
||
The *Code of Conduct*, adapted from the `Contributor Covenant 1.4 <https://www.contributor-covenant.org/version/1/4/code-of-conduct.html>`__, | ||
is available on the `Code of Conduct <https://www.colour-science.org/code-of-conduct/>`__ page. | ||
is available on the `Code of Conduct <https://www.colour-science.org/code-of-conduct>`__ page. | ||
|
||
Contact & Social | ||
---------------- | ||
|
@@ -128,5 +128,5 @@ About | |
|
||
| **Colour - Demosaicing** by Colour Developers | ||
| Copyright 2015 Colour Developers – `[email protected] <[email protected]>`__ | ||
| This software is released under terms of New BSD License: https://opensource.org/licenses/BSD-3-Clause | ||
| This software is released under terms of BSD-3-Clause: https://opensource.org/licenses/BSD-3-Clause | ||
| `https://github.com/colour-science/colour-demosaicing <https://github.com/colour-science/colour-demosaicing>`__ |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,12 +6,12 @@ TODO | |
|
||
- colour_demosaicing/__init__.py | ||
|
||
- Line 81 : # TODO: Remove legacy printing support when deemed appropriate. | ||
- Line 82 : # TODO: Remove legacy printing support when deemed appropriate. | ||
|
||
About | ||
----- | ||
|
||
| **Colour - Demosaicing** by Colour Developers | ||
| Copyright 2015 Colour Developers – `[email protected] <[email protected]>`__ | ||
| This software is released under terms of New BSD License: https://opensource.org/licenses/BSD-3-Clause | ||
| Copyright 2015 Colour Developers - `[email protected] <[email protected]>`__ | ||
| This software is released under terms of BSD-3-Clause: https://opensource.org/licenses/BSD-3-Clause | ||
| `https://github.com/colour-science/colour-demosaicing <https://github.com/colour-science/colour-demosaicing>`__ |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,9 +11,10 @@ | |
|
||
from __future__ import annotations | ||
|
||
import contextlib | ||
import numpy as np | ||
import os | ||
import subprocess # nosec | ||
import subprocess | ||
|
||
import colour | ||
|
||
|
@@ -28,7 +29,7 @@ | |
|
||
__author__ = "Colour Developers" | ||
__copyright__ = "Copyright 2015 Colour Developers" | ||
__license__ = "New BSD License - https://opensource.org/licenses/BSD-3-Clause" | ||
__license__ = "BSD-3-Clause - https://opensource.org/licenses/BSD-3-Clause" | ||
__maintainer__ = "Colour Developers" | ||
__email__ = "[email protected]" | ||
__status__ = "Production" | ||
|
@@ -54,32 +55,30 @@ | |
|
||
__major_version__ = "0" | ||
__minor_version__ = "2" | ||
__change_version__ = "3" | ||
__change_version__ = "4" | ||
__version__ = ".".join( | ||
(__major_version__, __minor_version__, __change_version__) | ||
) | ||
|
||
try: | ||
_version: str = ( | ||
subprocess.check_output( # nosec | ||
["git", "describe"], | ||
subprocess.check_output( | ||
["git", "describe"], # noqa: S603, S607 | ||
cwd=os.path.dirname(__file__), | ||
stderr=subprocess.STDOUT, | ||
) | ||
.strip() | ||
.decode("utf-8") | ||
) | ||
except Exception: | ||
_version: str = __version__ # type: ignore[no-redef] | ||
_version: str = __version__ | ||
|
||
colour.utilities.ANCILLARY_COLOUR_SCIENCE_PACKAGES[ | ||
colour.utilities.ANCILLARY_COLOUR_SCIENCE_PACKAGES[ # pyright: ignore | ||
"colour-demosaicing" | ||
] = _version | ||
|
||
del _version | ||
|
||
# TODO: Remove legacy printing support when deemed appropriate. | ||
try: | ||
with contextlib.suppress(TypeError): | ||
np.set_printoptions(legacy="1.13") | ||
except TypeError: | ||
pass |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,14 +15,14 @@ | |
|
||
from scipy.ndimage.filters import convolve | ||
|
||
from colour.hints import ArrayLike, Literal, NDArray, Union | ||
from colour.hints import ArrayLike, Literal, NDArrayFloat | ||
from colour.utilities import as_float_array, tstack | ||
|
||
from colour_demosaicing.bayer import masks_CFA_Bayer | ||
|
||
__author__ = "Colour Developers" | ||
__copyright__ = "Copyright 2015 Colour Developers" | ||
__license__ = "New BSD License - https://opensource.org/licenses/BSD-3-Clause" | ||
__license__ = "BSD-3-Clause - https://opensource.org/licenses/BSD-3-Clause" | ||
__maintainer__ = "Colour Developers" | ||
__email__ = "[email protected]" | ||
__status__ = "Production" | ||
|
@@ -34,8 +34,8 @@ | |
|
||
def demosaicing_CFA_Bayer_bilinear( | ||
CFA: ArrayLike, | ||
pattern: Union[Literal["RGGB", "BGGR", "GRBG", "GBRG"], str] = "RGGB", | ||
) -> NDArray: | ||
pattern: Literal["RGGB", "BGGR", "GRBG", "GBRG"] | str = "RGGB", | ||
) -> NDArrayFloat: | ||
""" | ||
Return the demosaiced *RGB* colourspace array from given *Bayer* CFA using | ||
bilinear interpolation. | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,14 +18,14 @@ | |
import numpy as np | ||
from scipy.ndimage.filters import convolve | ||
|
||
from colour.hints import ArrayLike, Literal, NDArray, Union | ||
from colour.hints import ArrayLike, Literal, NDArrayFloat | ||
from colour.utilities import as_float_array, ones, tstack | ||
|
||
from colour_demosaicing.bayer import masks_CFA_Bayer | ||
|
||
__author__ = "Colour Developers" | ||
__copyright__ = "Copyright 2015 Colour Developers" | ||
__license__ = "New BSD License - https://opensource.org/licenses/BSD-3-Clause" | ||
__license__ = "BSD-3-Clause - https://opensource.org/licenses/BSD-3-Clause" | ||
__maintainer__ = "Colour Developers" | ||
__email__ = "[email protected]" | ||
__status__ = "Production" | ||
|
@@ -37,8 +37,8 @@ | |
|
||
def demosaicing_CFA_Bayer_Malvar2004( | ||
CFA: ArrayLike, | ||
pattern: Union[Literal["RGGB", "BGGR", "GRBG", "GBRG"], str] = "RGGB", | ||
) -> NDArray: | ||
pattern: Literal["RGGB", "BGGR", "GRBG", "GBRG"] | str = "RGGB", | ||
) -> NDArrayFloat: | ||
""" | ||
Return the demosaiced *RGB* colourspace array from given *Bayer* CFA using | ||
*Malvar (2004)* demosaicing algorithm. | ||
|
Oops, something went wrong.