CSI Lab 06

Tuesday, February 19th

Objectives:

For this lab you will need to download the following images or copy them from the common_mediasources directory on the p: drive


Activity A : Make your predictions

Open your textbook to p. 111 and locate the four methods presented.  Using what you have learned about loops and conditionals, carefully consider each method. 

[Q1]  What do you PREDICT would be the effect of executing blueOneHundred() on a picture?

[Q2]  What do you PREDICT would be the effect of executing removeBlue() on a picture?

[Q3]  What do you PREDICT would be the effect of executing noBlue() on a picture?

[Q4]  What do you PREDICT would be the effect of executing byeByeBlue() on a picture?


Activity B : Test your predictions

  1. Launch JES 
  2. Enter the method blueOneHundred() that you considered in Activity A and save this as lab06.py
  3. Using the interactions pane, "load" the image you just downloaded and invoke this blueOneHundred() method. 
  4. Observe what happened.  Did your predictions match what you observed?  (NOTE : You may need to look very carefully to observe what is happening.  In fact, it may be darn tough to tell.  At this point, pay careful attention to detail, and consider what would help make interpreting the action(s) easier.
  5. Summarize your observations in question Q5 below...
  6. [Q5]  Invoke blueOneHundred().  What did you observe?  Did this match your prediction from [Q1]?  If not, why?  What were you "mis-interpreting?"

     

  7. Repeat steps 2-5 for each of the remaining methods from Activity A.  Don't forget to reset the interactions pane and re-load the image before trying the next method.

[Q6]  Invoke removeBlue().  What did you observe?  Did this match your prediction from [Q2]?  If not, why?  What were you "mis-interpreting?"

[Q7]  Invoke noBlue().  What did you observe?   Did this match your prediction from [Q3]?  If not, why?  What were you "mis-interpreting?"

[Q8]  Invoke byeByeblue().  What did you observe? Did this match your prediction from [Q4]?  If not, why?  What were you "mis-interpreting?"

 

 


Activity C : Confirm your tests

As we mentioned in Activity B, telling the difference between some of these methods may be very difficult to do.

[Q9]  What could you do in order to better understand what these four methods are actually doing?  What kinds of tests or images would be helpful?

 

 

 

 

 

 

 

 

One possibility is to consider the effect that these methods have on VERY specific colors.  For example, consider a simple color "test pattern"  This image contains only a handful of very "distinct" colors.

[Q10]  Load this image into the image explorer and record the RGB values for each of the 8 main colors.  (Use the table provided on the activity report).

 

[Q11]  Looking back over the code for each of the four methods, which colors do you expect to be changed by each of the four methods? (Use the table provided on the activity report).

 

[Q12]  Only AFTER you have made your predictions, test the four methods using the test pattern you downloaded.  Which colors were changed by each method?  (Use the table provided on the activity report).


Activity D : I always knew he was from another planet

Write a method called makeMartian().  This method should use what you have learned about looping and if statements to take an image of a person, and make several modifications:

You can do this to a photo of any person of your choosing.  You can use yourself, a friend, your instructor (this photo is me after polishing off the 1 pound "Gunderburger"), or even president Allen (Hopefully he would have a sense of humor about this).

You may check this in as you add each piece, or you can check it in when you are all done.

[SIG1]  When you are done creating green skin, show it to a TA for signatures.

[SIG2]  When you are done creating red eyes, show it to a TA for signatures.

[SIG3]  When you are done creating orange hair, show it to a TA for signatures.


Activity E : BONUS Activity - Adding in your own personal touch

Make some additional changes to the makeMartian() method from Activity C.  This can make any changes you would like to play with.  For example, you can change to different colors, you can use what you have learned about resizing and copying to create HUGE eyes or a small body.  Be creative.

[BONUS SIG]  Show this to me when you get done (I want to see what you come up with!)