Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

implement in python - Read a grayscale image moon.png. - Filter the grayscale image with the following filters. - Display results. - Write your own

image text in transcribedimage text in transcribed

implement in python

- Read a grayscale image moon.png. - Filter the grayscale image with the following filters. - Display results. - Write your own code to implement the following filters: (You cannot use any built-in functions from any library for this.) NOTE: You may need to appropriately pad your input image so that the output image has the same shape as the supplied input. 1. Laplacian Filter 2. [0,0,0,0,0] [0,1,0,1,0] [0,0,0,1,0] 3. [0,0,0] [6,0,6] [0,0,0] 4. Compute image enhancement using a Laplacian filter. Use your result from 1. Inputs: Image I, filter matrix K; shape of K is (2h+1,2w+1) Output: Image J Step 1: Pad h rows on the top and the bottom and w columns at the left and the right of image I; Let (H,W) be the shape of the padded image I Step 2: Initialize output image J to all zeros; J has shape (H,W) Step 3: for i from h to Hh1 for j from w to Ww1 for m from h to h for n from w to w J[i,j]+=[i+m,j+n]K[m+h,n+w] Step 4: Strip padding from J, so that J has shape (H-2h, W-2w). Return J

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Driven Web Sites

Authors: Joline Morrison, Mike Morrison

2nd Edition

? 061906448X, 978-0619064488

More Books

Students also viewed these Databases questions