{ "cells": [ { "cell_type": "markdown", "metadata": { "id": "2lpyuBqXKTtq" }, "source": [ "## $\\large{Quiz}$" ] }, { "cell_type": "markdown", "metadata": { "id": "b2ySR-zAKTtu" }, "source": [ "請將左圖中的龍貓完成底下這幾個影像處理,以得到右圖
\n", "1. 以一半影像長、寬減 1 的 index 作為中心點,將旋轉 45 度角\n", "2. 使用鏡像反射補值法\n", "3. 將影像放大 2 倍\n", "\n", "![](https://hackmd.io/_uploads/rkOHU2DG6.png)\n" ] }, { "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": "h65aeBmzKTtv" }, "outputs": [], "source": [ "path = \"totoro.png\"" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "nMh7rtR-KTtw" }, "outputs": [], "source": [ "def load_img(path):\n", "\n", " \"請寫下你如何作開檔及影像處理\"\n", "\n", "\n", " return \"請回傳一張影像\"" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "vFmqH8ZJKTtw" }, "outputs": [], "source": [ "import cv2\n", "import numpy as np\n", "quiz_img = cv2.imread(\"totoro_ans.png\")[:,:,::-1]\n", "assert np.array_equiv(load_img(path), quiz_img)" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "Echlst-dNPFq" }, "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": 0 }