Spring 2015.  Evolving Lists & Lights On!  Caesar Cipher  Looks Good!

Slides:



Advertisements
Similar presentations
RAPTOR Syntax and Semantics By Lt Col Schorsch
Advertisements

Strings Testing for equality with strings.
Computer Science 111 Fundamentals of Programming I More Digital Image Processing.
The Binary Numbering Systems
CS324e - Elements of Graphics and Visualization Color Histograms.
Effective Digital Imaging using Basic Composition and Adobe Photoshop Paul S. Marley Instructional Technology Specialist Department of Art Wake Forest.
1 Working with Web Graphics – About Web Graphics. File Formats. Image Resolution, Image Size – Creating Web Graphics. Getting Started, Paint Shop Pro 5.
HW 3: Problems 2&3. HW 3 Prob 2:Encipher encipher( S, n ) takes as input a string S and a non-negative integer n between 0 and 25. This function returns.
Data Representation Computer Organization &
Eleven colors and rasters. Color objects [color name] Returns color with the specified name [color red green blue] Returns color with the specified amounts.
Data Representation COE 205
Eleven colors and rasters. Color objects Meta represents colors with color objects You can create a color by saying: [color r g b] r: amount of red (0-255)
Computer Science 111 Fundamentals of Programming I Introduction to Digital Image Processing.
Eleven colors and rasters. Color objects Meta represents colors with color objects You can create a color by saying: [color r g b] r: amount of red (0-255)
Connecting with Computer Science 2 Objectives Learn why numbering systems are important to understand Refresh your knowledge of powers of numbers Learn.
Tutorial 3: Working with Images. Objectives Session 3.1 – Identify the differences among image file types – Evaluate the purpose of alternative text –
CS 102 Computers In Context (Multimedia)‏ 01 / 28 / 2009 Instructor: Michael Eckmann.
Computers Organization & Assembly Language
The Elements and Principles of Art
TOPIC 7 MODIFYING PIXELS IN A MATRIX NESTED FOR LOOPS 1 Notes adapted from Introduction to Computing and Programming with Java: A Multimedia Approach by.
INTRODUCTION TO HTML5 Styling Text. Change the Font Size  You can use the font-size property to change the font size for a document’s text.  Instead.
Lec 3: Data Representation Computer Organization & Assembly Language Programming.
EECS 110: Lec 8: Lists of Lists Aleksandar Kuzmanovic Northwestern University
Addison Wesley is an imprint of © 2010 Pearson Addison-Wesley. All rights reserved. Chapter 5 Working with Images Starting Out with Games & Graphics in.
Translations A B Name: Target Grade: Translate this shape
Animate picture to peek from bottom (1 of 3) 1. Right click on picture you want to animate. 2. Click on Custom Animation. 2 1 R.
Google Sketchup. What is Sketchup SketchUp is a very powerful 3-D modeling software of the type used by architects and drafters. In three dimensional.
Tables Sacramento City College Engineering Design Technology.
SIMD Image Processor Eric Liskay Andrew Northy Neraj Kumar 1.
ManipulatingPictures-Mod6-part61 Manipulating Pictures, Arrays, and Loops: Eliminating color, Inversion, grey scale and adjusting for luminance Barb Ericson.
Comprehending List Comprehensions
Picture Lab. Manipulating Pictures Discussion and activities with java.awt.Color introduce students to megapixels, pixels, the RGB color model, binary.
CSC508 Convolution Operators. CSC508 Convolution Arguably the most fundamental operation of computer vision It’s a neighborhood operator –Similar to the.
EECS 110: Lec 8: Lists of Lists Aleksandar Kuzmanovic Northwestern University
Unit #4 Graphing and Equation of the Line Lesson #1 Graphing Ordered Pairs.
Python Programming in Context Chapter 6. Objectives To understand pixel based image processing To use nested iteration To use and understand tuples To.
Data Representation. What is data? Data is information that has been translated into a form that is more convenient to process As information take different.
1 Arrays of Arrays An array can represent a collection of any type of object - including other arrays! The world is filled with examples Monthly magazine:
Text on a CCR Matrix using the SuperStar Sequence Editor Brian Bruderer.
EECS 110: Lec 9: Review for the Midterm Exam Aleksandar Kuzmanovic Northwestern University
Copyright © Curt Hill Further Picture Manipulation Considering position.
Building Your Own Number Line. Step 1: Fold your strip in half.
EECS 110: Lec 8: Lists of Lists Aleksandar Kuzmanovic Northwestern University
More Digital Representation Discrete information is represented in binary (PandA), and “continuous” information is made discrete.
Information in Computers. Remember Computers Execute algorithms Need to be told what to do And to whom to do it.
More String Manipulation. Programming Challenge Define a function that accepts two arguments: a string literal and a single character. Have the function.
Many of the figures from this book may be reproduced free of charge in scholarly articles, proceedings, and presentations, provided only that the following.
Image Processing Intro2CS – week 6 1. Image Processing Many devices now have cameras on them Lots of image data recorded for computers to process. But.
Chapter 7 Cartesian Coordinate System. Day….. 1.Graphing Ordered Pairs 2.Identifying Ordered Pairs 3.Reflections and Opposites 4.Reflecting Figures 5.Quick.
EECS 110: Lec 8: Lists of Lists
Multidimensional Arrays
Image Processing Objectives To understand pixel based image processing
David Meredith Aalborg University
Lec 3: Data Representation
Spring 2010 EECS 110: Homework III.
EECS 110: Lec 9: Review for the Midterm Exam
Barb Ericson Georgia Institute of Technology Dec 2009
BEGINNER EV3 PROGRAMMING Lesson
String Manipulation Part 2
Final Exam.
Multidimensional Arrays and Image Manipulation
Fundamentals of Programming I Introduction to Digital Image Processing
BEGINNER PROGRAMMING LESSON
Spring 2015.
Multidimensional Arrays
Manipulating Pictures, Arrays, and Loops
Manipulating Pictures, Arrays, and Loops part 6
GO! with Microsoft® Excel 2010
BEGINNER EV3 PROGRAMMING Lesson
Manipulating Pictures, Arrays, and Loops part 6
Presentation transcript:

Spring 2015

 Evolving Lists & Lights On!  Caesar Cipher  Looks Good!

 encipher(S, n)  Rotates the string S by n characters  Example:  encipher('AbC', 2) returns 'CdE'  encipher('xYz', 4) returns 'bCd'  decipher(S)  Retrieve the original string from an enciphered version (with unknown rotation)

 Recursion  Rotate character individually  Rules:  Lower-case → lower-case  Upper-case → upper-case  Otherwise → unchanged  Character checking:  'a' <= c <= 'z'  'A' <= c <= 'Z'  Character rotation: using ASCII values

 ASCII values  Useful functions:  ord( ' a ' ) returns 97  chr(66) returns ' B '  Example: rotate 'b' by 22 characters: chr(ord('b') + 22) returns 'x'  Note: need to take care of wrapping around ABC…XYZ … abc…xyz …

 Unknown number of rotation → Test 26 cases and pick out the best  Techniques:  English letter appearance probability (provided!)  Scrabble scores (roughly a reverse of the above)  Any other heuristics (i.e. rules of thumb)  Should work well on large strings

 Create a list of all possibilities (there are 26) #['Dmc', 'End', 'Foe',...]  For each possibility, calculate the sum of the probability of the letters #[0.0766, , ,...]  Return the one with the largest sum (using recursion? using for loop?)

 See class web-site for set-up instruction  Goals:  Write basic image editing tools  At least 3, one from each of the following: ▪ Group 1: negative, gray scale ▪ Group 2: vertical flip, horizontal flip, vertical mirror, horizontal mirror ▪ Group 3: scale, blur, random grid

 An image is a 2 dimensional list (i.e. list of lists) of pixels  Example: pixels = [[pixel, pixel], [pixel, pixel], [pixel, pixel]]  Note:  An image is a list of rows A row is a list of pixels  len(pixels) returns height  len(pixels[0]) returns width

 A pixel is a tuple of 3 colors red, green, blue  Color value is from 0 to 255  Example:  (255,0,0) is red  (100,100,100) is gray  (112, 48, 160) is purple  List uses [ ], tuple uses ( )  No difference (for now)

pixels = [[(255,0,0), (0,255,0)], [(0,0,255), (100,100,100)], [ (0,0,0), (112,48,160)]]

 The beginning from modifyBase import * label = "Brighten" # change this ordinal = 1  Similarity in roles to problem 1:  modify(pic) is similar to evolve(L)  setNewPixel is similar to setNewElement  In general, modifying setNewPixel is enough, but feel free to do anything else.

 Group 1 (individual pixel):  Negative: new color value = 255 – original value  Grayscale (values of red, green & blue are equal)  Group 2 (change pixel position):  Flip/Mirror horizontally/vertically  Group 3 (using multiple pixels):  Scale  Blur: take an average of surrounding pixels  Random Grid: Use random.shuffle(L)

Have fun + Good luck