@@ -292,7 +292,7 @@ def as_8_bit_BGR_image(image: ArrayLike) -> NDArray:
292292def adjust_image (
293293 image : ArrayLike ,
294294 target_width : Integer ,
295- interpolation_method : Literal [ # type: ignore[misc ]
295+ interpolation_method : Literal [ # type: ignore[valid-type ]
296296 cv2 .INTER_AREA ,
297297 cv2 .INTER_BITS ,
298298 cv2 .INTER_BITS2 ,
@@ -465,7 +465,7 @@ def scale_contour(contour: ArrayLike, factor: Floating) -> NDArray:
465465def crop_and_level_image_with_rectangle (
466466 image : ArrayLike ,
467467 rectangle : Tuple [Tuple , Tuple , Floating ],
468- interpolation_method : Literal [ # type: ignore[misc ]
468+ interpolation_method : Literal [ # type: ignore[valid-type ]
469469 cv2 .INTER_AREA ,
470470 cv2 .INTER_BITS ,
471471 cv2 .INTER_BITS2 ,
@@ -499,10 +499,13 @@ def crop_and_level_image_with_rectangle(
499499 --------
500500 >>> import os
501501 >>> from colour import read_image
502- >>> from colour_checker_detection import TESTS_RESOURCES_DIRECTORY
503- >>> path = os.path.join(TESTS_RESOURCES_DIRECTORY,
504- ... 'colour_checker_detection', 'detection',
505- ... 'IMG_1967.png')
502+ >>> from colour_checker_detection import ROOT_RESOURCES_TESTS
503+ >>> path = os.path.join(
504+ ... ROOT_RESOURCES_TESTS,
505+ ... "colour_checker_detection",
506+ ... "detection",
507+ ... "IMG_1967.png",
508+ ... )
506509 >>> image = adjust_image(read_image(path), 1440)
507510 >>> rectangle = (
508511 ... (723.29608154, 465.50939941),
@@ -661,10 +664,13 @@ def colour_checkers_coordinates_segmentation(
661664 --------
662665 >>> import os
663666 >>> from colour import read_image
664- >>> from colour_checker_detection import TESTS_RESOURCES_DIRECTORY
665- >>> path = os.path.join(TESTS_RESOURCES_DIRECTORY,
666- ... 'colour_checker_detection', 'detection',
667- ... 'IMG_1967.png')
667+ >>> from colour_checker_detection import ROOT_RESOURCES_TESTS
668+ >>> path = os.path.join(
669+ ... ROOT_RESOURCES_TESTS,
670+ ... "colour_checker_detection",
671+ ... "detection",
672+ ... "IMG_1967.png",
673+ ... )
668674 >>> image = read_image(path)
669675 >>> colour_checkers_coordinates_segmentation(image) # doctest: +ELLIPSIS
670676 (array([[ 369, 688],
@@ -856,10 +862,13 @@ def extract_colour_checkers_segmentation(
856862 --------
857863 >>> import os
858864 >>> from colour import read_image
859- >>> from colour_checker_detection import TESTS_RESOURCES_DIRECTORY
860- >>> path = os.path.join(TESTS_RESOURCES_DIRECTORY,
861- ... 'colour_checker_detection', 'detection',
862- ... 'IMG_1967.png')
865+ >>> from colour_checker_detection import ROOT_RESOURCES_TESTS
866+ >>> path = os.path.join(
867+ ... ROOT_RESOURCES_TESTS,
868+ ... "colour_checker_detection",
869+ ... "detection",
870+ ... "IMG_1967.png",
871+ ... )
863872 >>> image = read_image(path)
864873 >>> extract_colour_checkers_segmentation(image)
865874 ... # doctest: +SKIP
@@ -1042,10 +1051,13 @@ def detect_colour_checkers_segmentation(
10421051 --------
10431052 >>> import os
10441053 >>> from colour import read_image
1045- >>> from colour_checker_detection import TESTS_RESOURCES_DIRECTORY
1046- >>> path = os.path.join(TESTS_RESOURCES_DIRECTORY,
1047- ... 'colour_checker_detection', 'detection',
1048- ... 'IMG_1967.png')
1054+ >>> from colour_checker_detection import ROOT_RESOURCES_TESTS
1055+ >>> path = os.path.join(
1056+ ... ROOT_RESOURCES_TESTS,
1057+ ... "colour_checker_detection",
1058+ ... "detection",
1059+ ... "IMG_1967.png",
1060+ ... )
10491061 >>> image = read_image(path)
10501062 >>> detect_colour_checkers_segmentation(image) # doctest: +SKIP
10511063 (array([[ 0.361626... , 0.2241066..., 0.1187837...],
@@ -1115,7 +1127,7 @@ def detect_colour_checkers_segmentation(
11151127 settings .swatches_achromatic_slice ,
11161128 ]:
11171129 swatch_std_mean = as_float_array (swatch_colours [slice_ ])
1118- swatch_std_mean /= swatch_std_mean [..., 1 ][..., np . newaxis ]
1130+ swatch_std_mean /= swatch_std_mean [..., 1 ][..., None ]
11191131 std_means .append (np .mean (np .std (swatch_std_mean , 0 )))
11201132 if std_means [0 ] < std_means [1 ]:
11211133 usage_warning (
0 commit comments