Skip to content

Commit ee40af8

Browse files
committed
Update examples.
1 parent ff3bbde commit ee40af8

File tree

1 file changed

+46
-71
lines changed

1 file changed

+46
-71
lines changed

colour_checker_detection/examples/examples_detection.ipynb

Lines changed: 46 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,36 @@
2020
"cell_type": "code",
2121
"execution_count": 1,
2222
"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+
],
2453
"source": [
2554
"from __future__ import division\n",
2655
"\n",
@@ -32,7 +61,7 @@
3261
"from collections import OrderedDict\n",
3362
"\n",
3463
"import colour\n",
35-
"import colour.plotting\n",
64+
"from colour.plotting import *\n",
3665
"\n",
3766
"from colour_checker_detection import (\n",
3867
" EXAMPLES_RESOURCES_DIRECTORY,\n",
@@ -43,72 +72,18 @@
4372
"\n",
4473
"OETF = colour.RGB_COLOURSPACES['sRGB'].encoding_cctf\n",
4574
"\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();"
4778
]
4879
},
4980
{
5081
"cell_type": "code",
5182
"execution_count": 2,
5283
"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": [],
11085
"source": [
111-
"colour.plotting.colour_style()"
86+
"colour_style();"
11287
]
11388
},
11489
{
@@ -160,7 +135,7 @@
160135
"]\n",
161136
"\n",
162137
"for image in COLOUR_CHECKER_IMAGES:\n",
163-
" colour.plotting.plot_image(OETF(image))"
138+
" plot_image(OETF(image));"
164139
]
165140
},
166141
{
@@ -211,8 +186,8 @@
211186
" masks_i = np.zeros(colour_checker.shape)\n",
212187
" for i, mask in enumerate(masks):\n",
213188
" 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)));"
216191
]
217192
},
218193
{
@@ -312,7 +287,7 @@
312287
" OrderedDict(zip(REFERENCE_COLOUR_CHECKER.data.keys(), swatches_xyY)),\n",
313288
" D65)\n",
314289
" \n",
315-
" colour.plotting.plot_multi_colour_checkers(\n",
290+
" plot_multi_colour_checkers(\n",
316291
" [REFERENCE_COLOUR_CHECKER, colour_checker])\n",
317292
" \n",
318293
" swatches_f = colour.colour_correction(swatches, swatches, REFERENCE_SWATCHES)\n",
@@ -323,12 +298,12 @@
323298
" OrderedDict(zip(REFERENCE_COLOUR_CHECKER.data.keys(), swatches_f_xyY)),\n",
324299
" D65)\n",
325300
" \n",
326-
" colour.plotting.plot_multi_colour_checkers(\n",
301+
" plot_multi_colour_checkers(\n",
327302
" [REFERENCE_COLOUR_CHECKER, colour_checker])\n",
328303
"\n",
329-
" colour.plotting.plot_image(OETF(\n",
304+
" plot_image(OETF(\n",
330305
" colour.colour_correction(\n",
331-
" COLOUR_CHECKER_IMAGES[i], swatches, REFERENCE_SWATCHES)))"
306+
" COLOUR_CHECKER_IMAGES[i], swatches, REFERENCE_SWATCHES)));"
332307
]
333308
},
334309
{
@@ -402,18 +377,18 @@
402377
" \n",
403378
" image_a = adjust_image(image)\n",
404379
"\n",
405-
" colour.plotting.plot_image(OETF(segmented_image), text_parameters={\n",
380+
" plot_image(OETF(segmented_image), text_parameters={\n",
406381
" 'text': 'Segmented Image',\n",
407382
" 'color': 'black'\n",
408383
" })\n",
409384
" \n",
410385
" cv2.drawContours(image_a, swatches, -1, (1, 0, 1), 3)\n",
411386
" cv2.drawContours(image_a, clusters, -1, (0, 1, 1), 3)\n",
412387
"\n",
413-
" colour.plotting.plot_image(OETF(image_a), text_parameters={\n",
388+
" plot_image(OETF(image_a), text_parameters={\n",
414389
" 'text': 'Swatches & Clusters',\n",
415390
" 'color': 'white'\n",
416-
" })"
391+
" });"
417392
]
418393
}
419394
],

0 commit comments

Comments
 (0)