Question: Please do this in Python, here are the imports import matplotlib as mpl import numpy as np from matplotlib import pyplot as plt from scipy
Please do this in Python, here are the imports
import matplotlib as mpl import numpy as np from matplotlib import pyplot as plt from scipy import ndimage from skimage import color
Basically, there is an input image in .jpg format. I have turn this image into gray for default color. For now I need to enlarge this picture in python by using imports above
Task 5: Upscaling Background When an image is scaled up to a larger size, there is the question of what to do with the new spaces in between the original pixels. Consider a 1-dimensional signal (0, 2,4, 6, 4, 2, 0] and suppose we want to expand it by a factor of 2. Two possibilities for how to fill the spaces include: 1. Simply double each sample -value replication; and 2. Make the new samples half way between the previous samples - 2 tap linear interpolation. The figure below shows the original signal and the result from each of these two methods: Original Signal Value Replication Linear Interpolation Assignment (15%) Find a Python function that can expand the input image with dimension NXM to a 2NX2M image using linear interpolation. Task 5: Upscaling Background When an image is scaled up to a larger size, there is the question of what to do with the new spaces in between the original pixels. Consider a 1-dimensional signal (0, 2,4, 6, 4, 2, 0] and suppose we want to expand it by a factor of 2. Two possibilities for how to fill the spaces include: 1. Simply double each sample -value replication; and 2. Make the new samples half way between the previous samples - 2 tap linear interpolation. The figure below shows the original signal and the result from each of these two methods: Original Signal Value Replication Linear Interpolation Assignment (15%) Find a Python function that can expand the input image with dimension NXM to a 2NX2M image using linear interpolation
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
