Skip to main content

CSC 151.01, Class 21: Images as Functions from Positions to Colors

Overview

  • Preliminaries
    • Notes and news
    • Upcoming work
    • Extra credit
    • Questions
  • Iterating over positions; images as functions
  • Lab

News / Etc.

  • New partners!
  • Welcome to my favorite image model!

Rotating reminders

  • Use our tutors! We have tutors available Sunday through Thursday evening from 7-10 p.m. in Science 3813/15.

Upcoming Work

  • Assignment 5 due TOMORROW at 10:30 p.m.
  • Lab writeup: 3e and 3f. (Don’t start with these; Doing the prior problems helps.)
  • Reading: Revisiting lists
  • Exam 2 arrives Wednesday. Yay!

Extra credit (Academic/Artistic)

  • CS Table, Tuesday at noon: Facial Recognition “algorithms”
  • W. Kamau Bell, Tuesday at 6pm, Harris.
  • Prazak Quartet, Tuesday, 28 February 2017, 7:30 p.m., Herrick.
  • CS Extras, Thursday at 4:15 pm, Sam’s research and PM’s research

Extra credit (Peer)

Extra credit (Misc)

  • Preventing sexual assault, Tuesday at 11am, JRC 101
  • Host a prospective student THIS COMING WEEKEND. (March 5, April 8, April 23)
  • Standing Rock conference today and tomorrow
    • 7:30 Today in Herrick: Indigenous leadership
    • 4:00 Tuesday in JRC 101: Non-violent training session

Good things to do

  • StoneCo thing somewhere on campus at 9pm tonight. Ask SRC.
  • SRC social hour today at 6pm.
  • Bagel party in Math commons, Thursday, 7-9 pm

Questions

How do you require a racket file?
We did this in lab 1.
  1. In the terminal, type raco link /home/USERNAME/Desktop

  2. At the top of the library file, put (provide (all-defined-out))

  3. Restart

  4. In your file that uses the library file, put (require Desktop/file) with no .rkt suffix.

Iterating over positions; images as functions

What was the reading about?
image-compute and how it makes images by repeatedly doing the same computation with different inputs.
What are the inputs to image-compute?
  1. A procedure that takes column and row as input and gives a color as output. 2. width. 3. height.
What happens if I just return a real number, rather than a color, from
the color function?
Amazingly, DrRacket rarely crashes. Instead, since colors are represented as numbers, you get whatever color that number represents.

Lab

I’m not sure why I get “expected three parameters to image-compute,
received only one”
Your mentor says “Check your parentheses! Use Ctrl-i to have Scheme show you things.”
I’m not sure how to do the range 64 to 192.
Think about how you would do the range 0 to 128.
Is it important that I understand problem 3?
Yes, very. One of the exam problems depends directly on it. Bring questions tomorrow.

Writeup

Write up exercises 3e and 3f from the lab on computing images. Include 4P-style or 6P-style documentation!

Send your solution to csc151-01-grader@grinnell.edu.

Title your email CSC 151.01 Writeup for Class 21 (YOUR FULL NAMES).