{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "#
CS568:Deep Learning
Spring 2020
" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**Total Marks: 10**\n", "\n", "**Submission deadline: Sunday 05 April, 2020.**" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", "import cv2" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "def convolution(input_image, mask):\n", " \n", " # add code here\n", "\n", " return output" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "input_image = cv2.imread('book_gray.png')\n", "\n", "averaging_filter = 1/9*np.ones((3,3))\n", "vertical_edge_detection = np.array([[1, 0, -1], [1, 0, -1], [1, 0, -1]])\n", "horizontal_edge_detection = np.array([[1, 1, 1], [0, 0, 0], [-1, -1, -1]])\n", "\n", "result_avg_filter = convolution(input_image, averaging_filter)\n", "result_ver_edge_detection = convolution(input_image, vertical_edge_detection)\n", "result_hor_edge_detection = convolution(input_image, horizontal_edge_detection)\n", "\n", "## add code here to display output images\n", "## add code here to save images" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "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.6.9" } }, "nbformat": 4, "nbformat_minor": 2 }