Skip to content

Commit 10fecd1

Browse files
committed
Switch row, columns in active_countour example
The dimension order of row (r) and column (c) seem to be switched. This aligns the tutorial with the gallery example at [1]. [1] https://scikit-image.org/docs/stable/auto_examples/edges/plot_active_contours.html
1 parent e06284c commit 10fecd1

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lectures/4_segmentation.ipynb

+5-5
Original file line numberDiff line numberDiff line change
@@ -259,13 +259,13 @@
259259
" \"\"\"Generate points defining a circle on an image.\"\"\"\n",
260260
" radians = np.linspace(0, 2*np.pi, resolution)\n",
261261
"\n",
262-
" c = center[1] + radius*np.cos(radians)\n",
263262
" r = center[0] + radius*np.sin(radians)\n",
263+
" c = center[1] + radius*np.cos(radians)\n",
264264
" \n",
265-
" return np.array([c, r]).T\n",
265+
" return np.array([r, c]).T\n",
266266
"\n",
267267
"# Exclude last point because a closed path should not have duplicate points\n",
268-
"points = circle_points(200, [100, 220], 100)[:-1]"
268+
"points = circle_points(resolution=200, center=[100, 220], radius=100)[:-1]"
269269
]
270270
},
271271
{
@@ -284,8 +284,8 @@
284284
"outputs": [],
285285
"source": [
286286
"fig, ax = image_show(astronaut)\n",
287-
"ax.plot(points[:, 0], points[:, 1], '--r', lw=3)\n",
288-
"ax.plot(snake[:, 0], snake[:, 1], '-b', lw=3);"
287+
"ax.plot(points[:, 1], points[:, 0], '--r', lw=3)\n",
288+
"ax.plot(snake[:, 1], snake[:, 0], '-b', lw=3);"
289289
]
290290
},
291291
{

0 commit comments

Comments
 (0)