Skip to content

Commit 35580f9

Browse files
committed
Implement support for "Colour 0.3.14" changes.
1 parent b1465c3 commit 35580f9

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

colour_checker_detection/detection/segmentation.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import numpy as np
2323
from collections import namedtuple
2424

25-
from colour.models import decoding_cctf, encoding_cctf
25+
from colour.models import cctf_decoding, cctf_encoding
2626
from colour.utilities import as_float_array, as_int_array, as_int
2727

2828
__author__ = 'Colour Developers'
@@ -250,7 +250,7 @@ def as_8_bit_BGR_image(image):
250250
if image.dtype == np.uint8:
251251
return image
252252

253-
return cv2.cvtColor((encoding_cctf(image) * 255).astype(np.uint8),
253+
return cv2.cvtColor((cctf_encoding(image) * 255).astype(np.uint8),
254254
cv2.COLOR_RGB2BGR)
255255

256256

@@ -767,7 +767,7 @@ class instances.
767767
colour_checkers_colours = []
768768
colour_checkers_data = []
769769
for colour_checker in extract_colour_checkers_segmentation(image):
770-
colour_checker = decoding_cctf(
770+
colour_checker = cctf_decoding(
771771
as_float_array(colour_checker[..., ::-1]) / 255)
772772
width, height = (colour_checker.shape[1], colour_checker.shape[0])
773773
masks = swatch_masks(width, height, swatches_h, swatches_v, samples)

colour_checker_detection/detection/tests/test_segmentation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import unittest
1414

1515
from colour import read_image
16-
from colour.models import encoding_cctf
16+
from colour.models import cctf_encoding
1717

1818
from colour_checker_detection import TESTS_RESOURCES_DIRECTORY
1919
from colour_checker_detection.detection.segmentation import (
@@ -90,7 +90,7 @@ def test_as_8_bit_BGR_image(self):
9090
self.assertEqual(image_o.dtype, np.uint8)
9191
np.testing.assert_almost_equal(
9292
image_o[16, 16, ...],
93-
(encoding_cctf(image_i[16, 16, ::-1]) * 255).astype(np.uint8))
93+
(cctf_encoding(image_i[16, 16, ::-1]) * 255).astype(np.uint8))
9494

9595

9696
class TestAdjustImage(unittest.TestCase):

colour_checker_detection/examples/examples_detection.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@
7070
"from colour_checker_detection.detection.segmentation import (\n",
7171
" adjust_image)\n",
7272
"\n",
73-
"OETF = colour.RGB_COLOURSPACES['sRGB'].encoding_cctf\n",
73+
"OETF = colour.RGB_COLOURSPACES['sRGB'].cctf_encoding\n",
7474
"\n",
75-
"EOTF = colour.RGB_COLOURSPACES['sRGB'].decoding_cctf\n",
75+
"EOTF = colour.RGB_COLOURSPACES['sRGB'].cctf_decoding\n",
7676
"\n",
7777
"colour.utilities.describe_environment();"
7878
]

0 commit comments

Comments
 (0)