|
20 | 20 | "cell_type": "code",
|
21 | 21 | "execution_count": 1,
|
22 | 22 | "metadata": {},
|
23 |
| - "outputs": [], |
| 23 | + "outputs": [ |
| 24 | + { |
| 25 | + "name": "stdout", |
| 26 | + "output_type": "stream", |
| 27 | + "text": [ |
| 28 | + "===============================================================================\n", |
| 29 | + "* *\n", |
| 30 | + "* Interpreter : *\n", |
| 31 | + "* python : 3.7.1 | packaged by conda-forge | (default, Mar 13 2019, *\n", |
| 32 | + "* 05:40:40) *\n", |
| 33 | + "* [Clang 4.0.1 (tags/RELEASE_401/final)] *\n", |
| 34 | + "* *\n", |
| 35 | + "* colour-science.org : *\n", |
| 36 | + "* colour : v0.3.12-2-g9e02e488 *\n", |
| 37 | + "* colour-checker-detection : 0.1.0 *\n", |
| 38 | + "* *\n", |
| 39 | + "* Runtime : *\n", |
| 40 | + "* numpy : 1.16.2 *\n", |
| 41 | + "* scipy : 1.2.1 *\n", |
| 42 | + "* pandas : 0.24.2 *\n", |
| 43 | + "* matplotlib : 3.0.3 *\n", |
| 44 | + "* notebook : 5.7.6 *\n", |
| 45 | + "* ipywidgets : 7.4.2 *\n", |
| 46 | + "* OpenImageIO : 1.8.17 *\n", |
| 47 | + "* opencv : 3.4.2 *\n", |
| 48 | + "* *\n", |
| 49 | + "===============================================================================\n" |
| 50 | + ] |
| 51 | + } |
| 52 | + ], |
24 | 53 | "source": [
|
25 | 54 | "from __future__ import division\n",
|
26 | 55 | "\n",
|
|
32 | 61 | "from collections import OrderedDict\n",
|
33 | 62 | "\n",
|
34 | 63 | "import colour\n",
|
35 |
| - "import colour.plotting\n", |
| 64 | + "from colour.plotting import *\n", |
36 | 65 | "\n",
|
37 | 66 | "from colour_checker_detection import (\n",
|
38 | 67 | " EXAMPLES_RESOURCES_DIRECTORY,\n",
|
|
43 | 72 | "\n",
|
44 | 73 | "OETF = colour.RGB_COLOURSPACES['sRGB'].encoding_cctf\n",
|
45 | 74 | "\n",
|
46 |
| - "EOTF = colour.RGB_COLOURSPACES['sRGB'].decoding_cctf" |
| 75 | + "EOTF = colour.RGB_COLOURSPACES['sRGB'].decoding_cctf\n", |
| 76 | + "\n", |
| 77 | + "colour.utilities.describe_environment();" |
47 | 78 | ]
|
48 | 79 | },
|
49 | 80 | {
|
50 | 81 | "cell_type": "code",
|
51 | 82 | "execution_count": 2,
|
52 | 83 | "metadata": {},
|
53 |
| - "outputs": [ |
54 |
| - { |
55 |
| - "data": { |
56 |
| - "text/plain": [ |
57 |
| - "{'figure.figsize': (12.8, 7.2),\n", |
58 |
| - " 'figure.dpi': 100,\n", |
59 |
| - " 'savefig.dpi': 100,\n", |
60 |
| - " 'savefig.bbox': 'standard',\n", |
61 |
| - " 'axes.titlesize': 'x-large',\n", |
62 |
| - " 'axes.labelsize': 'larger',\n", |
63 |
| - " 'legend.fontsize': 'small',\n", |
64 |
| - " 'xtick.labelsize': 'medium',\n", |
65 |
| - " 'ytick.labelsize': 'medium',\n", |
66 |
| - " 'text.color': '#111111',\n", |
67 |
| - " 'xtick.top': False,\n", |
68 |
| - " 'xtick.bottom': True,\n", |
69 |
| - " 'ytick.right': False,\n", |
70 |
| - " 'ytick.left': True,\n", |
71 |
| - " 'xtick.minor.visible': True,\n", |
72 |
| - " 'ytick.minor.visible': True,\n", |
73 |
| - " 'xtick.direction': 'out',\n", |
74 |
| - " 'ytick.direction': 'out',\n", |
75 |
| - " 'xtick.major.size': 6.25,\n", |
76 |
| - " 'xtick.minor.size': 3.75,\n", |
77 |
| - " 'ytick.major.size': 6.25,\n", |
78 |
| - " 'ytick.minor.size': 3.75,\n", |
79 |
| - " 'xtick.major.width': 1,\n", |
80 |
| - " 'xtick.minor.width': 1,\n", |
81 |
| - " 'ytick.major.width': 1,\n", |
82 |
| - " 'ytick.minor.width': 1,\n", |
83 |
| - " 'axes.linewidth': 1,\n", |
84 |
| - " 'axes.edgecolor': '#333333',\n", |
85 |
| - " 'axes.titlepad': 7.5,\n", |
86 |
| - " 'axes.facecolor': '#F5F5F5',\n", |
87 |
| - " 'axes.grid': True,\n", |
88 |
| - " 'axes.grid.which': 'major',\n", |
89 |
| - " 'axes.grid.axis': 'both',\n", |
90 |
| - " 'axes.axisbelow': True,\n", |
91 |
| - " 'grid.linewidth': 0.5,\n", |
92 |
| - " 'grid.linestyle': '--',\n", |
93 |
| - " 'grid.color': '#D5D5D5',\n", |
94 |
| - " 'legend.frameon': True,\n", |
95 |
| - " 'legend.framealpha': 0.75,\n", |
96 |
| - " 'legend.fancybox': False,\n", |
97 |
| - " 'legend.facecolor': '#F0F0F0',\n", |
98 |
| - " 'legend.borderpad': 0.5,\n", |
99 |
| - " 'lines.linewidth': 1,\n", |
100 |
| - " 'lines.markersize': 3,\n", |
101 |
| - " 'lines.markeredgewidth': 0.75,\n", |
102 |
| - " 'axes.prop_cycle': cycler('color', ['#F44336', '#9C27B0', '#3F51B5', '#03A9F4', '#009688', '#8BC34A', '#FFEB3B', '#FF9800', '#795548', '#607D8B'])}" |
103 |
| - ] |
104 |
| - }, |
105 |
| - "execution_count": 2, |
106 |
| - "metadata": {}, |
107 |
| - "output_type": "execute_result" |
108 |
| - } |
109 |
| - ], |
| 84 | + "outputs": [], |
110 | 85 | "source": [
|
111 |
| - "colour.plotting.colour_style()" |
| 86 | + "colour_style();" |
112 | 87 | ]
|
113 | 88 | },
|
114 | 89 | {
|
|
160 | 135 | "]\n",
|
161 | 136 | "\n",
|
162 | 137 | "for image in COLOUR_CHECKER_IMAGES:\n",
|
163 |
| - " colour.plotting.plot_image(OETF(image))" |
| 138 | + " plot_image(OETF(image));" |
164 | 139 | ]
|
165 | 140 | },
|
166 | 141 | {
|
|
211 | 186 | " masks_i = np.zeros(colour_checker.shape)\n",
|
212 | 187 | " for i, mask in enumerate(masks):\n",
|
213 | 188 | " masks_i[mask[0]:mask[1], mask[2]:mask[3], ...] = 1\n",
|
214 |
| - " colour.plotting.plot_image(\n", |
215 |
| - " OETF(np.clip(colour_checker + masks_i * 0.25, 0, 1)))" |
| 189 | + " plot_image(\n", |
| 190 | + " OETF(np.clip(colour_checker + masks_i * 0.25, 0, 1)));" |
216 | 191 | ]
|
217 | 192 | },
|
218 | 193 | {
|
|
312 | 287 | " OrderedDict(zip(REFERENCE_COLOUR_CHECKER.data.keys(), swatches_xyY)),\n",
|
313 | 288 | " D65)\n",
|
314 | 289 | " \n",
|
315 |
| - " colour.plotting.plot_multi_colour_checkers(\n", |
| 290 | + " plot_multi_colour_checkers(\n", |
316 | 291 | " [REFERENCE_COLOUR_CHECKER, colour_checker])\n",
|
317 | 292 | " \n",
|
318 | 293 | " swatches_f = colour.colour_correction(swatches, swatches, REFERENCE_SWATCHES)\n",
|
|
323 | 298 | " OrderedDict(zip(REFERENCE_COLOUR_CHECKER.data.keys(), swatches_f_xyY)),\n",
|
324 | 299 | " D65)\n",
|
325 | 300 | " \n",
|
326 |
| - " colour.plotting.plot_multi_colour_checkers(\n", |
| 301 | + " plot_multi_colour_checkers(\n", |
327 | 302 | " [REFERENCE_COLOUR_CHECKER, colour_checker])\n",
|
328 | 303 | "\n",
|
329 |
| - " colour.plotting.plot_image(OETF(\n", |
| 304 | + " plot_image(OETF(\n", |
330 | 305 | " colour.colour_correction(\n",
|
331 |
| - " COLOUR_CHECKER_IMAGES[i], swatches, REFERENCE_SWATCHES)))" |
| 306 | + " COLOUR_CHECKER_IMAGES[i], swatches, REFERENCE_SWATCHES)));" |
332 | 307 | ]
|
333 | 308 | },
|
334 | 309 | {
|
|
402 | 377 | " \n",
|
403 | 378 | " image_a = adjust_image(image)\n",
|
404 | 379 | "\n",
|
405 |
| - " colour.plotting.plot_image(OETF(segmented_image), text_parameters={\n", |
| 380 | + " plot_image(OETF(segmented_image), text_parameters={\n", |
406 | 381 | " 'text': 'Segmented Image',\n",
|
407 | 382 | " 'color': 'black'\n",
|
408 | 383 | " })\n",
|
409 | 384 | " \n",
|
410 | 385 | " cv2.drawContours(image_a, swatches, -1, (1, 0, 1), 3)\n",
|
411 | 386 | " cv2.drawContours(image_a, clusters, -1, (0, 1, 1), 3)\n",
|
412 | 387 | "\n",
|
413 |
| - " colour.plotting.plot_image(OETF(image_a), text_parameters={\n", |
| 388 | + " plot_image(OETF(image_a), text_parameters={\n", |
414 | 389 | " 'text': 'Swatches & Clusters',\n",
|
415 | 390 | " 'color': 'white'\n",
|
416 |
| - " })" |
| 391 | + " });" |
417 | 392 | ]
|
418 | 393 | }
|
419 | 394 | ],
|
|
0 commit comments