Skip to content

Instantly share code, notes, and snippets.

@dsaint31x
Last active February 22, 2023 02:13
Show Gist options
  • Save dsaint31x/2afa8252d9134452db87ee5046ba1d3a to your computer and use it in GitHub Desktop.
Save dsaint31x/2afa8252d9134452db87ee5046ba1d3a to your computer and use it in GitHub Desktop.
dip_canny_edge_detection.ipynb
Display the source blob
Display the rendered blob
Raw
{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"provenance": [],
"authorship_tag": "ABX9TyPON82d4lG96jF2dOcrgdak",
"include_colab_link": true
},
"kernelspec": {
"name": "python3",
"display_name": "Python 3"
},
"language_info": {
"name": "python"
},
"widgets": {
"application/vnd.jupyter.widget-state+json": {
"8848e51e746242babd4dc05d8583a176": {
"model_module": "@jupyter-widgets/controls",
"model_name": "VBoxModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [
"widget-interact"
],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "VBoxModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "VBoxView",
"box_style": "",
"children": [
"IPY_MODEL_ee5e3581159b4157a74603b5c15924be",
"IPY_MODEL_84e5ad8017cf46f4a17ea48bb97de8fa",
"IPY_MODEL_86bcff8f14fe4e829ee5954fda21c0a5"
],
"layout": "IPY_MODEL_2bed0e04c4e94a9490a85ac16213d3ed"
}
},
"ee5e3581159b4157a74603b5c15924be": {
"model_module": "@jupyter-widgets/controls",
"model_name": "IntSliderModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "IntSliderModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "IntSliderView",
"continuous_update": true,
"description": "min",
"description_tooltip": null,
"disabled": false,
"layout": "IPY_MODEL_41f63bc6783b4af181e4303f5f68a18b",
"max": 255,
"min": 0,
"orientation": "horizontal",
"readout": true,
"readout_format": "d",
"step": 1,
"style": "IPY_MODEL_8dd98c92a5794b5e9db5848548ca4ccf",
"value": 59
}
},
"84e5ad8017cf46f4a17ea48bb97de8fa": {
"model_module": "@jupyter-widgets/controls",
"model_name": "IntSliderModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "IntSliderModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "IntSliderView",
"continuous_update": true,
"description": "max",
"description_tooltip": null,
"disabled": false,
"layout": "IPY_MODEL_01686b9cdcc2416c83c5c066d0bc86c8",
"max": 255,
"min": 0,
"orientation": "horizontal",
"readout": true,
"readout_format": "d",
"step": 1,
"style": "IPY_MODEL_450b5dca331847ff85c2353fa5432698",
"value": 84
}
},
"86bcff8f14fe4e829ee5954fda21c0a5": {
"model_module": "@jupyter-widgets/output",
"model_name": "OutputModel",
"model_module_version": "1.0.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/output",
"_model_module_version": "1.0.0",
"_model_name": "OutputModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/output",
"_view_module_version": "1.0.0",
"_view_name": "OutputView",
"layout": "IPY_MODEL_09eedbb8a2bb4785a19f3bec50ba65a2",
"msg_id": "",
"outputs": [
{
"output_type": "display_data",
"data": {
"text/plain": "<PIL.Image.Image image mode=L size=317x320 at 0x7EFCEA113760>",
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAT0AAAFACAAAAADrTPReAAAcsUlEQVR4nO0d69LkqApOzfu/MvtDUVBQvKQ7PWeorZ3+Ei+ICAhoEFog7B6pt4SEQAAAXJAAxfv0PwIAJEjFUmn+KwQJC0LC1BymXgRyjIKFb6rXPwZAUT63zb1kTDEPSA3RgT9d+2PgzhCAmBzY1UrdZzwTRpNZGQMhlJFwZ+PmKk4FCatKaViTDTVLuNBQDycEJKjkymgxVcR8o/g/QH4+Q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uOZ+VehXTHlOcoS/5zSdsVJvyaOJU4Ppu3THxBlbXGkv8ccWcF0oXAxQV4UO5NOckoEL83bBmdJ+BB6s04itQ/XCdIFidf4sPwpM6twQXBU3123Y7badFx8RTEsoCOYLCJ7KIv73LfObAW1zjtavodrPeTTEqU2V5jAkuGxTilhIxkpR+CB3hPugInKSUIXbLST8Gj9h7fMzXxWv3AynXgAd6rORyjBESR2XYfhU/Bg7w3JN4vqIo5WNQ7kUKyLoJ/qBh+m+kyPGyxJAK5GjcbvW8no7sDei5vWVyBYGld5Fyl02y7b8JzvCcmzDaX6fRUyvftnCdXbk8VJRWpxNm/ToVd2KHeaLBo/iyPtFI59ZR8XV66J+v3mxxoinatdX+OJ2Zc+wy25IBDvXPETPLL2x43YTNZZZIAsqm5rDo0K/BNGLlr9iYGCScihDzOnBLnMdlyLvYuAeE0Tcxz4H4P+VAe5S7gbdfD26j3KND1szl/KaH+wT/4B//gH/yDf/AP/sEIdI7xtMQ/UKB9LFOfwSFg0+AL3MNH0HmoWmINomLrQ2+PWbZXrHvwVhrrlWvmZg+O1jnH7gZH8ZZAxNUPW3oIJO+lAGHvwPUiD4l2/erzyxdqO5m4qg2V4tf18AroVu6yKFoqX659l5X4ABpfRVGyqmYnz4qPq8hT/OwRbEm99P2ILy2K/AVnLD+neBRncvrAI2JKBv8kZzYr9+mO3fZl0kvK4AhNo5SMOVnrk9Pf5rGs5vGvFh8kBYmkl9h9tek0TfmJeBxyWgVNveV5Wz7D5yU6Nrw2XwWEJO4lw6yTPky+w1yC5VXiVmioGjEEqST1ZoWBn87LejzrOwSztAOnErGyRUg3+HyagO+g3obMEPeDJqM98d9ng5xvoV4PM+YTpjSWP+fhafR+ZxmwRPqXUO9DZgapb6JhPUuCKaEAF7+A8h/urDvUpmYZ/gAAAABJRU5ErkJggg==\n"
},
"metadata": {}
},
{
"output_type": "stream",
"name": "stdout",
"text": [
"ok!\n"
]
}
]
}
},
"2bed0e04c4e94a9490a85ac16213d3ed": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"41f63bc6783b4af181e4303f5f68a18b": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"8dd98c92a5794b5e9db5848548ca4ccf": {
"model_module": "@jupyter-widgets/controls",
"model_name": "SliderStyleModel",
"model_module_version": "1.5.0",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "SliderStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"description_width": "",
"handle_color": null
}
},
"01686b9cdcc2416c83c5c066d0bc86c8": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"450b5dca331847ff85c2353fa5432698": {
"model_module": "@jupyter-widgets/controls",
"model_name": "SliderStyleModel",
"model_module_version": "1.5.0",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "SliderStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"description_width": "",
"handle_color": null
}
},
"09eedbb8a2bb4785a19f3bec50ba65a2": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
}
}
}
},
"cells": [
{
"cell_type": "markdown",
"metadata": {
"id": "view-in-github",
"colab_type": "text"
},
"source": [
"<a href=\"https://colab.research.google.com/gist/dsaint31x/2afa8252d9134452db87ee5046ba1d3a/dip_canny_edge_detection.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
]
},
{
"cell_type": "markdown",
"source": [
"# Canny Edge Detection"
],
"metadata": {
"id": "zZYfY7d25Odu"
}
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "GGmlCGlPzuGg"
},
"outputs": [],
"source": [
"import cv2\n",
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
"import requests\n",
"from google.colab.patches import cv2_imshow # for goole colab"
]
},
{
"cell_type": "code",
"source": [
"def get_img_cv(url):\n",
" image_ndarray = np.asarray(bytearray(requests.get(url).content), dtype=np.uint8)\n",
" img = cv2.imdecode(image_ndarray, cv2.IMREAD_COLOR)\n",
" print(img.shape)\n",
" return img"
],
"metadata": {
"id": "Dkh_NnKzzuwe"
},
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"source": [
"url = 'https://raw.githubusercontent.com/dsaint31x/OpenCV_Python_Tutorial/master/images/sudoku.jpg'\n",
"\n",
"#img = cv2.imread(img_path)\n",
"img = get_img_cv(url)\n",
"print(img.shape,img.max(),img.min())"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "Y7mRP3bIzwDc",
"outputId": "ab9c626f-c4f1-48cf-af33-0913100990a2"
},
"execution_count": null,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"(320, 317, 3)\n",
"(320, 317, 3) 226 0\n"
]
}
]
},
{
"cell_type": "code",
"source": [
"edge = cv2.Canny(img,120,200)\n",
"print(edge.shape)\n",
"cv2_imshow(edge)"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 356
},
"id": "ymr2NfyHz1DE",
"outputId": "6570fc69-b56d-4c30-8b9b-6106a0c9895d"
},
"execution_count": null,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"(320, 317)\n"
]
},
{
"output_type": "display_data",
"data": {
"text/plain": [
"<PIL.Image.Image image mode=L size=317x320 at 0x7EFCEA113280>"
],
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAT0AAAFACAAAAADrTPReAAAYQ0lEQVR4nO1d6XboKAiGOff9X5n54YaKCi6Jafudmds2iUsIAgIqQAmqrpT3CYCAKD5IoyLTICDXo04L1sYp+43Sb0T+H/D/0PDF/tm7QkgIgIFoCHiMeqnJ0xUTAAKQ+yf+OkJBPRwQkCCRy9VOoQOOqNMg0HR3HZz1fIcJgVAg4Bg17/WIED4I4zb3qyuXfy8NOUMJAmx9tr2MnbpI4S0IE6+Rmu0AQOC9dmfJ3UZpHCFkQ5j8pfRNCVOHMX5g93d8WkSvSwDsaw+/VdZOKoXhBoH7XT8GDHIP/T+EXo57+lBkHWTPUmBHTyhCRzysnqYuu4/hWolkFqid+Dt/T4T4Kc1sBwA59fwbCe8SeSW1GdgGHWNRUiOsxxhGulOfGL9A1kkcdDl/6bpzmORXegt2paoGCNDJa/9Jo8xr9aQxPP6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3KdNCnjarfS+Igjr6bJZF43y2HbUd927DtPLUEVqWjt18Fvo3hLLPwOXlunlo9fJxCTy6+1qQdDpC8xeYrP7qFwzSo/f4Izxl+HJIjOZHfAI6JLBn+SM2+hHk96cRkcKnXMJaNP1npSjV+zL0GW9KJbxeFW08RfXzh9/BbqFbw2dg0TEtuXDPnZbM/hFuqVA047bAPv0f5QxmuwcYG8x1ovt8rfI1+S4q/p6iO4RmtY+SbtD4puKZczWO4Icq7BzntCiY4gm+cuavw+h0t476lwqTPMw6rq5fSt/wESTnp9P6LC3QAAAABJRU5ErkJggg==\n"
},
"metadata": {}
}
]
},
{
"cell_type": "markdown",
"source": [
"# For ipynb file"
],
"metadata": {
"id": "b7xmkFgw5T1L"
}
},
{
"cell_type": "code",
"source": [
"from __future__ import print_function\n",
"from ipywidgets import interact, interactive, fixed, interact_manual,IntSlider\n",
"import ipywidgets as widgets\n",
"\n",
"from IPython.display import clear_output"
],
"metadata": {
"id": "ubIxhGUMz1nU"
},
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"source": [
"min_slide = IntSlider(min=0, max=255, step=1, value=90)\n",
"max_slide = IntSlider(min=0, max=255, step=1, value=100)\n",
"\n",
"def f(min,max):\n",
" clear_output(wait=True)\n",
" if max < min:\n",
" print(f'inavailable arguments : min={min}, max={max}')\n",
" print(f',but working!')\n",
" edge = cv2.Canny(img,\n",
" min,\n",
" max)\n",
" cv2_imshow(edge)\n",
" print('ok!')\n",
"\n",
"\n",
"interact(f, min=min_slide, max=max_slide)\n",
"\n"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 438,
"referenced_widgets": [
"8848e51e746242babd4dc05d8583a176",
"ee5e3581159b4157a74603b5c15924be",
"84e5ad8017cf46f4a17ea48bb97de8fa",
"86bcff8f14fe4e829ee5954fda21c0a5",
"2bed0e04c4e94a9490a85ac16213d3ed",
"41f63bc6783b4af181e4303f5f68a18b",
"8dd98c92a5794b5e9db5848548ca4ccf",
"01686b9cdcc2416c83c5c066d0bc86c8",
"450b5dca331847ff85c2353fa5432698",
"09eedbb8a2bb4785a19f3bec50ba65a2"
]
},
"id": "ZwMqS9eC0OGN",
"outputId": "b9386a63-cafb-4a8f-9db7-76cb74177515"
},
"execution_count": null,
"outputs": [
{
"output_type": "display_data",
"data": {
"text/plain": [
"interactive(children=(IntSlider(value=90, description='min', max=255), IntSlider(value=100, description='max',…"
],
"application/vnd.jupyter.widget-view+json": {
"version_major": 2,
"version_minor": 0,
"model_id": "8848e51e746242babd4dc05d8583a176"
}
},
"metadata": {}
},
{
"output_type": "execute_result",
"data": {
"text/plain": [
"<function __main__.f(min, max)>"
]
},
"metadata": {},
"execution_count": 23
}
]
},
{
"cell_type": "code",
"source": [],
"metadata": {
"id": "ueFo2QzQ0hXN"
},
"execution_count": null,
"outputs": []
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment