Starting from:

$30

Homework 6- n × m × 3 Numpy array

PIC 16 Homework 6 
Instructions:
There are three problems in this assignment. For each problem, you may assume that both
the function’s input and output are a n × m × 3 Numpy array. Name your script hw6.py
and submit it on CCLE. Add comments to each function.
Problem 1:
Write a function heart(im) that takes an image im as input, and outputs a heart-shaped
cut-out of it on a pink background. The shape of the heart will need to depend on the
dimensions of the image, so that you do not cut too much of the image.
Figure 1: (Left) Original figure; (Right) Figure with a heart-shaped mask.
Problem 2:
Write a function blurring(im, method) that takes a gray-scale picture, and offers two
options for noise blurring: uniform or Gaussian.
Figure 2: (Left) Grey-scale figure with Gaussian noise; (Center) After Gaussian blurring;
(Right) After uniform blurring
Problem 3:
Write a function detect edge(im, method) that takes a gray-scale image and detects edges,
with the option of horizontal, vertical or both.
Figure 3: (From left) original figure; edge detection in vertical, horizontal, or both directions.

More products