Question: The edge-detection function described in this chapter returns a black-and-white image. Think of a similar way to transform color values so that the new image
The edge-detection function described in this chapter returns a black-and-white image. Think of a similar way to transform color values so that the new image is still in its original colors but the outlines within it are merely sharpened.
Then, define a function named sharpen that performs this operation. The function should expect an image and two integers as arguments. One integer should represent the degree to which the image should be sharpened. The other integer should represent the threshold used to detect edges.
(Hint: A pixel can be darkened by making its RGB values smaller.)

?
from images import Image def sharpen(image, degree, threshold): """Builds and returns a sharpened image. Expects an image and two integers (the degree to which the image should be sharpened and the threshold used to detect edges) as arguments." pass def main(): filename = input("Enter the image file name: ") Image(filename) if image = newimage = sharpen(image, 20, 15) newimage.draw() name main() "____main___":
Step by Step Solution
There are 3 Steps involved in it
Text format code Header file section for image module from images import Image Function defition of ... View full answer
Get step-by-step solutions from verified subject matter experts
