Aguirrediego.com



CS 1190 Computational Problem SolvingMidterm ExerciseObjective: Use what we have learned about Computational Thinking and the IDEAL framework to solve the following problem:Problem Description: You are given two images: GreenScreen.png and Background.png. You need to replace the green pixels (and only the green pixels) in GreenScreen.png with pixels from Background.pngThe next instructions will show you how to read and display an image in Python 3. Install the following dependenciespython3 -m pip install --user numpy scipy matplotlib ipython jupyter pandas sympy noseDownload the following image: Spyder/PyCharm and create a new project. Add a new Python file, and copy and paste this code (replace <PATH> with the actual path to your file):import matplotlib.pyplot as pltfrom scipy import miscf = misc.imread("<PATH>/GreenScreen.png", mode="RGB")print(type(f))print(f.shape)# This is how we're going to display imagesplt.imshow(f)plt.show()Run the code and see what happensVariable ‘f’ is a 3D matrixFirst dimension -> RowsSecond dimension ->ColsThird Dimension -> Color Bands (RGB)To manipulate this image, you can directly modify the values of this matrix.Download a background image from the internet and name it Background.pngWork with your team mates to solve the problem! After you have a working prototype, take pictures of yourselves with the green screen provided by the instructor. Use those images as input to your program. Does it work well? If not, go ahead and try to improve it!Deliverables: Write a small report explaining how you used Decomposition, Pattern Recognition, Abstraction, and Algorithmic Design to tackle the problem. In addition, explain how you used the IDEAL framework. End your report by stating your conclusions/reflections. ................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download