Question: We'll use matplotlib.pyplot to read in , display, and manipulate a digital image. You should use a color image in this problem. 3 import matplotlib.pyplot

We'll use matplotlib.pyplot to read in, display, and manipulate a digital image. You should use a color image in this problem.
3
import matplotlib.pyplot as plt
img = plt.imread('somePicture.jpg')
plt. figure ()
plt.imshow (img)
(a) What is the type of img? What is the shape of img?
(b) Modify the image so that a rectangular block of pixels are red, and display the result using plt.imshow.
(c) Modify the image so that a rectangular block of pixels is green, and display the result using plt.imshow.
 We'll use matplotlib.pyplot to read in, display, and manipulate a digital

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!