Question: Write a function that saves the image as a specified file: ( 1 5 % ) - In the parameter lists, it supplies an
Write a function that saves the image as a specified file:
In the parameter lists, it supplies an image filename and output filename
Load the image and convert it to the grayscale
Blur the image
Run the Sobel edge detection algorithm on the blurred image, with applying both vertical and horizontal filters.
Run the Canny edge detection algorithm on the blurred image
Stack the three images in a column
Save the result as the specified output filename. Do not show the plots.
This problem is about image processing and data visualization.
Note: There are multiple ways in stacking images. You may consider plt subplot, or cvvconcat.
Code:
#
import numpy as np
import cv
import matplotlib.pyplot as plt
# Problem
def problemimagefilename, outputqjpg:
# write your logic here
pltsavefigoutput # do not show the plt
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
