{
"cells": [
{
"cell_type": "markdown",
"metadata": {
"id": "dkDVPxxu6JPf"
},
"source": [
"## $\\large{Quiz}$"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "ENJLS4vq6JPh"
},
"source": [
"請使用 Laplacian Filter 將跑車的輪廓找出來
\n",
"\n",
"
\n",
"\n",
"Laplacian Filter (5x5):\n",
"$\\begin{bmatrix}\n",
"0 & 0 &-1 & 0 & 0 \\\\\n",
"0 & -1 & -2 & -1 & 0\\\\\n",
"-1 & -2 & 16 & -2 & -1\\\\\n",
"0 & -1 & -2 & -1 & 0\\\\\n",
"0 & 0 &-1 & 0 & 0\n",
"\\end{bmatrix}$"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "rZ65aUaxN4Mg"
},
"outputs": [],
"source": [
"# upload Data\n",
"!wget -q https://github.com/TA-aiacademy/course_3.0/releases/download/CVCNN_Data/CVCNN_part1.zip\n",
"!unzip -q CVCNN_part1.zip"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "jATKig6n_gpX"
},
"outputs": [],
"source": [
"path = \"car.png\""
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "XSJTKs4J6JPj"
},
"outputs": [],
"source": [
"def load_img(path):\n",
" \n",
" \"請寫下你如何作開檔及影像處理\"\n",
" \n",
" \n",
" return \"請回傳一張影像\""
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "sI1YfQF46JPj"
},
"outputs": [],
"source": [
"import cv2\n",
"import numpy as np\n",
"quiz_img = cv2.imread(\"car_ans.png\")[:,:,::-1]\n",
"assert np.array_equiv(load_img(path), quiz_img)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "DaBERNzp9cW3"
},
"outputs": [],
"source": []
}
],
"metadata": {
"colab": {
"provenance": []
},
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.12"
}
},
"nbformat": 4,
"nbformat_minor": 4
}