Before you keep reading...
Runestone Academy can only continue if we get support from individuals like you. As a student you are well aware of the high cost of textbooks. Our mission is to provide great books to you for free, but we ask that you consider a $10 donation, more if you can or less if $10 is a burden.
Before you keep reading...
Making great stuff takes time and $$. If you appreciate the book you are reading now and want to keep quality materials free for other students please consider a donation to Runestone Academy. We ask that you consider a $10 donation, but if you can give more thats great, if $10 is too much for your budget we would be happy with whatever you can afford as a show of support.
🤔 Image Processing Revisited¶
Image used under Creative Commons Attribution License.
Use the name “GoldenGateBridgeCC.png” to access this image.
Returning to the code that you wrote in the original image processing project. convert your grayscale algorithm into a function called
grayscale that takes an image as a parameter and returns a new image that has been converted to grayscale, leaving the old image alone. Display the old image on the top of the window and the new image below.
Next convert your rotation and scaling algorithms into functions. Your rotation function should take two parameters, an image, and the number of degrees to rotate. If you only know how to rotate an image by 90, 180, or 270 degrees then you should check the parameters and print an error if it is not one of those values. If you are ready to tackle rotating by any number of degrees now would be a great time to do so. Your scaling function should take an image as a parameter along with a scale factor. Both of these functions should return a new image leaving the original alone.
Then use the functions together to take an image, rotate it by 90 degrees, enlarge it by a factor of 2 and convert it to gray scale.
Next design and write functions that will allow you to do:
Do the smoothing here using our old friend the noisyman.
Do the edge detection here.
Write a function called
montage that takes a background image and a foreground image and a row and column. The foreground image should be a green-backgrounded image so you can place it anywhere on the background image. The row and column parameters tell you where to put the foreground image in the background image.
A fun test for this and your other functions is to write a program that makes a row of small rubber ducks swimming in the bay under the golden gate bridge!
Post Project Questions
During this project I was primarily in my...
- 1. Comfort Zone
- 2. Learning Zone
- 3. Panic Zone
Completing this project took...
- 1. Very little time
- 2. A reasonable amount of time
- 3. More time than is reasonable
Based on my own interests and needs, the things taught in this project...
- 1. Don't seem worth learning
- 2. May be worth learning
- 3. Are definitely worth learning
For me to master the things taught in this project feels...
- 1. Definitely within reach
- 2. Within reach if I try my hardest
- 3. Out of reach no matter how hard I try