Skip to content

Instantly share code, notes, and snippets.

@b10011
Created March 5, 2023 21:45
Show Gist options
  • Save b10011/706032cb73ad2927904163dcd8eb6d1f to your computer and use it in GitHub Desktop.
Save b10011/706032cb73ad2927904163dcd8eb6d1f to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"id": "948b24d7",
"metadata": {},
"outputs": [],
"source": [
"# Notebook stuff\n",
"from PIL import Image\n",
"from IPython.display import display\n",
"\n",
"def imshow(image):\n",
" if len(image.shape) == 2:\n",
" image = cv2.cvtColor(image, cv2.COLOR_GRAY2BGR)\n",
" else:\n",
" image = image[:, :, ::-1]\n",
" return display(Image.fromarray(image))"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "886faaba",
"metadata": {},
"outputs": [],
"source": [
"# Python code imports\n",
"import cv2\n",
"from skimage.morphology import skeletonize"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "d3969869",
"metadata": {},
"outputs": [
{
"data": {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment