Skip to content

Commit 2cf8c1e

Browse files
committed
fix: Remove two empty blocks of code
1 parent 960410d commit 2cf8c1e

File tree

1 file changed

+56
-79
lines changed

1 file changed

+56
-79
lines changed

notebooks/2-Image_stats_and_image_processing.ipynb

Lines changed: 56 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@
2222
"colab": {
2323
"name": "2-Image-stats-and-image-processing.ipynb",
2424
"provenance": [],
25-
"collapsed_sections": [],
26-
"toc_visible": true
25+
"collapsed_sections": []
2726
}
2827
},
2928
"cells": [
@@ -50,15 +49,13 @@
5049
},
5150
{
5251
"cell_type": "code",
53-
"execution_count": 0,
5452
"metadata": {
55-
"colab": {},
5653
"colab_type": "code",
5754
"deletable": true,
5855
"editable": true,
59-
"id": "sWiMMUll3fWL"
56+
"id": "sWiMMUll3fWL",
57+
"colab": {}
6058
},
61-
"outputs": [],
6259
"source": [
6360
"# Download the test image and utils files\n",
6461
"!wget --no-check-certificate \\\n",
@@ -79,7 +76,9 @@
7976
"pylab.rcParams['figure.figsize'] = (10.0, 8.0) # this controls figure size in the notebook\n",
8077
"\n",
8178
"input_image=cv2.imread('noidea.jpg')"
82-
]
79+
],
80+
"execution_count": 0,
81+
"outputs": []
8382
},
8483
{
8584
"cell_type": "markdown",
@@ -97,51 +96,51 @@
9796
},
9897
{
9998
"cell_type": "code",
100-
"execution_count": 0,
10199
"metadata": {
102-
"colab": {},
103100
"colab_type": "code",
104101
"deletable": true,
105102
"editable": true,
106-
"id": "4LHzdNvt3fWP"
103+
"id": "4LHzdNvt3fWP",
104+
"colab": {}
107105
},
108-
"outputs": [],
109106
"source": [
110107
"flipped_code_0=cv2.flip(input_image,0) # vertical flip\n",
111108
"plt.imshow(flipped_code_0)"
112-
]
109+
],
110+
"execution_count": 0,
111+
"outputs": []
113112
},
114113
{
115114
"cell_type": "code",
116-
"execution_count": 0,
117115
"metadata": {
118-
"colab": {},
119116
"colab_type": "code",
120117
"deletable": true,
121118
"editable": true,
122-
"id": "9SOq_oD-3fWR"
119+
"id": "9SOq_oD-3fWR",
120+
"colab": {}
123121
},
124-
"outputs": [],
125122
"source": [
126123
"flipped_code_1=cv2.flip(input_image,1) # horizontal flip\n",
127124
"plt.imshow(flipped_code_1)"
128-
]
125+
],
126+
"execution_count": 0,
127+
"outputs": []
129128
},
130129
{
131130
"cell_type": "code",
132-
"execution_count": 0,
133131
"metadata": {
134-
"colab": {},
135132
"colab_type": "code",
136133
"deletable": true,
137134
"editable": true,
138-
"id": "7zapvC1p3fWU"
135+
"id": "7zapvC1p3fWU",
136+
"colab": {}
139137
},
140-
"outputs": [],
141138
"source": [
142139
"transposed=cv2.transpose(input_image)\n",
143140
"plt.imshow(transposed)"
144-
]
141+
],
142+
"execution_count": 0,
143+
"outputs": []
145144
},
146145
{
147146
"cell_type": "markdown",
@@ -159,20 +158,20 @@
159158
},
160159
{
161160
"cell_type": "code",
162-
"execution_count": 0,
163161
"metadata": {
164-
"colab": {},
165162
"colab_type": "code",
166163
"deletable": true,
167164
"editable": true,
168-
"id": "S7nLP0QL3fWY"
165+
"id": "S7nLP0QL3fWY",
166+
"colab": {}
169167
},
170-
"outputs": [],
171168
"source": [
172169
"for i in range(0,3):\n",
173170
" min_value, max_value, min_location, max_location=cv2.minMaxLoc(input_image[:,:,i])\n",
174171
" print(\"min {} is at {}, and max {} is at {}\".format(min_value, min_location, max_value, max_location))\n"
175-
]
172+
],
173+
"execution_count": 0,
174+
"outputs": []
176175
},
177176
{
178177
"cell_type": "markdown",
@@ -192,15 +191,13 @@
192191
},
193192
{
194193
"cell_type": "code",
195-
"execution_count": 0,
196194
"metadata": {
197-
"colab": {},
198195
"colab_type": "code",
199196
"deletable": true,
200197
"editable": true,
201-
"id": "Gg5M59Lt3fWa"
198+
"id": "Gg5M59Lt3fWa",
199+
"colab": {}
202200
},
203-
"outputs": [],
204201
"source": [
205202
"#First create an image the same size as our input\n",
206203
"blank_image = np.zeros((input_image.shape), np.uint8)\n",
@@ -210,7 +207,9 @@
210207
"new_image=cv2.add(blank_image,input_image) # add the two images together\n",
211208
"\n",
212209
"plt.imshow(cv2.cvtColor(new_image, cv2.COLOR_BGR2RGB))"
213-
]
210+
],
211+
"execution_count": 0,
212+
"outputs": []
214213
},
215214
{
216215
"cell_type": "markdown",
@@ -228,57 +227,57 @@
228227
},
229228
{
230229
"cell_type": "code",
231-
"execution_count": 0,
232230
"metadata": {
233-
"colab": {},
234231
"colab_type": "code",
235232
"deletable": true,
236233
"editable": true,
237-
"id": "EyxmwP0E3fWd"
234+
"id": "EyxmwP0E3fWd",
235+
"colab": {}
238236
},
239-
"outputs": [],
240237
"source": [
241238
"d=3\n",
242239
"img_blur3 = cv2.GaussianBlur(input_image, (2*d+1, 2*d+1), -1)[d:-d,d:-d]\n",
243240
"\n",
244241
"plt.imshow(cv2.cvtColor(img_blur3, cv2.COLOR_BGR2RGB))"
245-
]
242+
],
243+
"execution_count": 0,
244+
"outputs": []
246245
},
247246
{
248247
"cell_type": "code",
249-
"execution_count": 0,
250248
"metadata": {
251-
"colab": {},
252249
"colab_type": "code",
253250
"deletable": true,
254251
"editable": true,
255-
"id": "GjGY7Dl33fWg"
252+
"id": "GjGY7Dl33fWg",
253+
"colab": {}
256254
},
257-
"outputs": [],
258255
"source": [
259256
"d=5\n",
260257
"img_blur5 = cv2.GaussianBlur(input_image, (2*d+1, 2*d+1), -1)[d:-d,d:-d]\n",
261258
"\n",
262259
"plt.imshow(cv2.cvtColor(img_blur5, cv2.COLOR_BGR2RGB))"
263-
]
260+
],
261+
"execution_count": 0,
262+
"outputs": []
264263
},
265264
{
266265
"cell_type": "code",
267-
"execution_count": 0,
268266
"metadata": {
269-
"colab": {},
270267
"colab_type": "code",
271268
"deletable": true,
272269
"editable": true,
273-
"id": "AaJ7zd1w3fWi"
270+
"id": "AaJ7zd1w3fWi",
271+
"colab": {}
274272
},
275-
"outputs": [],
276273
"source": [
277274
"d=15\n",
278275
"img_blur15 = cv2.GaussianBlur(input_image, (2*d+1, 2*d+1), -1)[d:-d,d:-d]\n",
279276
"\n",
280277
"plt.imshow(cv2.cvtColor(img_blur15, cv2.COLOR_BGR2RGB))"
281-
]
278+
],
279+
"execution_count": 0,
280+
"outputs": []
282281
},
283282
{
284283
"cell_type": "markdown",
@@ -298,23 +297,23 @@
298297
},
299298
{
300299
"cell_type": "code",
301-
"execution_count": 0,
302300
"metadata": {
303-
"colab": {},
304301
"colab_type": "code",
305302
"deletable": true,
306303
"editable": true,
307-
"id": "d7ceQSv13fWk"
304+
"id": "d7ceQSv13fWk",
305+
"colab": {}
308306
},
309-
"outputs": [],
310307
"source": [
311308
"sobelimage=cv2.cvtColor(input_image,cv2.COLOR_BGR2GRAY)\n",
312309
"\n",
313310
"sobelx = cv2.Sobel(sobelimage,cv2.CV_64F,1,0,ksize=9)\n",
314311
"sobely = cv2.Sobel(sobelimage,cv2.CV_64F,0,1,ksize=9)\n",
315312
"plt.imshow(sobelx,cmap = 'gray') \n",
316313
"# Sobel works in x and in y, change sobelx to sobely in the olt line above to see the difference\n"
317-
]
314+
],
315+
"execution_count": 0,
316+
"outputs": []
318317
},
319318
{
320319
"cell_type": "markdown",
@@ -331,15 +330,13 @@
331330
},
332331
{
333332
"cell_type": "code",
334-
"execution_count": 0,
335333
"metadata": {
336-
"colab": {},
337334
"colab_type": "code",
338335
"deletable": true,
339336
"editable": true,
340-
"id": "1MJQRgXL3fWn"
337+
"id": "1MJQRgXL3fWn",
338+
"colab": {}
341339
},
342-
"outputs": [],
343340
"source": [
344341
"th1=30\n",
345342
"th2=60 # Canny recommends threshold 2 is 3 times threshold 1 - you could try experimenting with this...\n",
@@ -355,22 +352,9 @@
355352
"edgeresult[edge != 0] = (0, 255, 0) # this takes pixels in edgeresult where edge non-zero colours them bright green\n",
356353
"\n",
357354
"plt.imshow(cv2.cvtColor(edgeresult, cv2.COLOR_BGR2RGB))"
358-
]
359-
},
360-
{
361-
"cell_type": "code",
355+
],
362356
"execution_count": 0,
363-
"metadata": {
364-
"colab": {},
365-
"colab_type": "code",
366-
"deletable": true,
367-
"editable": true,
368-
"id": "fpjccg2Z3fWp"
369-
},
370-
"outputs": [],
371-
"source": [
372-
""
373-
]
357+
"outputs": []
374358
},
375359
{
376360
"cell_type": "markdown",
@@ -384,13 +368,6 @@
384368
"source": [
385369
"[Previous](1-Fundamentals.ipynb) [Next](3-Features.ipynb)"
386370
]
387-
},
388-
{
389-
"cell_type": "code",
390-
"execution_count": null,
391-
"metadata": {},
392-
"outputs": [],
393-
"source": []
394371
}
395372
]
396-
}
373+
}

0 commit comments

Comments
 (0)