Creative Commons Attribution Non-Commercial Share Alike License sa/3.0/http://creativecommons.org/licenses/by-nc-

Slides:



Advertisements
Similar presentations
Selection Feature of C: Decision making statements: It allow us to take decisions as to which code is to be executed next. Since these statements control.
Advertisements

Conditionals-part31 Conditionals – part 3 Barb Ericson Georgia Institute of Technology Nov 2009.
Creative Commons Attribution Non-Commercial Share Alike License sa/3.0/
Finding Red Pixels – Part 1 Prof. Noah Snavely CS1114
First Bytes - LabVIEW. Today’s Session Introduction to LabVIEW Colors and computers Lab to create a color picker Lab to manipulate an image Visual ProgrammingImage.
Creative Commons Attribution Non-Commercial Share Alike License sa/3.0/
Programing Concept Ken Youssefi/Ping HsuIntroduction to Engineering – E10 1 ENGR 10 Introduction to Engineering (Part A)
Creative Commons Attribution Non-Commercial Share Alike License sa/3.0/
Creative Commons Attribution Non-Commercial Share Alike License sa/3.0/
Creative Commons Attribution Non-Commercial Share Alike License sa/3.0/
Creative Commons Attribution Non-Commercial Share Alike License sa/3.0/
Creative Commons Attribution Non-Commercial Share Alike License sa/3.0/
Creative Commons Attribution Non-Commercial Share Alike License sa/3.0/
Rob Miles. Creating a Working MoodLight We know that colours in XNA are stored as values which represent the amount of red, blue, green and transparency.
Creative Commons Attribution Non-Commercial Share Alike License sa/3.0/
Instructor: Alexander Stoytchev CprE 185: Intro to Problem Solving (using C)
CSE 113 Introduction to Computer Programming Lecture slides for Week 12 Monday, November 14 th, 2011 Instructor: Scott Settembre.
CSc2310 tutoring session, week 8 Fall, 2012 Haidong Xue 5:30pm—8:30pm 11/06/2012 and 11/07/2012 -Test 3 Study Guide.
TOPIC 11 RETURNING VALUES FROM METHODS PICTURE TRANSFORMATIONS 1 Notes adapted from Introduction to Computing and Programming with Java: A Multimedia Approach.
Creative Commons Attribution Non-Commercial Share Alike License sa/3.0/
TOPIC 6 MODIFYING PICTURES USING LOOPS 1 Notes adapted from Introduction to Computing and Programming with Java: A Multimedia Approach by M. Guzdial and.
Creative Commons Attribution Non-Commercial Share Alike License sa/3.0/
Creative Commons Attribution Non-Commercial Share Alike License sa/3.0/
CS161 Topic #16 1 Today in CS161 Lecture #16 Prepare for the Final Reviewing all Topics this term Variables If Statements Loops (do while, while, for)
ManipulatingPictures-Mod6-part61 Manipulating Pictures, Arrays, and Loops: Eliminating color, Inversion, grey scale and adjusting for luminance Barb Ericson.
February ,  2/16: Exam 1 Makeup Papers Available  2/20: Exam 2 Review Sheet Available in Lecture  2/27: Lab 2 due by 11:59:59pm  3/2:
Lecture 2 Conditional Statement. chcslonline.org Conditional Statements in PHP Conditional Statements are used for decision making. Different actions.
Conditionals-Mod8-part41 Conditionals – part 4 Replace background Barb Ericson Georgia Institute of Technology May 2007.
TOPIC 10 THE IF STATEMENT 1 Notes adapted from Introduction to Computing and Programming with Java: A Multimedia Approach by M. Guzdial and B. Ericson,
Introduction to Programming in MATLAB Intro. MATLAB Peer Instruction Lecture Slides by Dr. Cynthia Lee, UCSD is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike.
 In computer programming, a loop is a sequence of instruction s that is continually repeated until a certain condition is reached.  PHP Loops :  In.
Creative Commons Attribution Non-Commercial Share Alike License sa/3.0/
Creative Commons Attribution Non-Commercial Share Alike License sa/3.0/
CompSci 4 Chap 6 Sec 2 Sep 30, 2010 Prof. Susan Rodger “All your troubles are due to those ‘ifs’,” declared the Wizard. If you were not a Flutterbudget.
CSE 8A Lecture 13 Reading for next class: Chapter 9 Today’s topics: –Sounds! Finish PSA 6: Chromakey! DUE TUESDAY Interm exam 3 next Thursday.
Conditionals-Mod8-part21 Conditionals – part 2 Edge Detection Barb Ericson Georgia Institute of Technology May 2007.
Creative Commons Attribution Non-Commercial Share Alike License sa/3.0/
CSE8A Lecture 5 TODO: –FINISH PSA2 WITH YOUR PARTNER! Read next class: Section 5.1. PLAY WITH CODE! –Get stuck, then figure out how to get unstuck – it’s.
ManipulatingPictures-part31 Manipulating Pictures, Arrays, and Loops part 3 Barb Ericson Georgia Institute of Technology Nov 2009.
CompSci 101 Introduction to Computer Science November 11, 2014 Prof. Rodger CompSci 101 Fall Review for exam.
Dr. Naveed Riaz Design and Analysis of Algorithms 1 1 Formal Methods in Software Engineering Lecture # 27.
Creative Commons Attribution Non-Commercial Share Alike License sa/3.0/
Presentation Kasame Kammarabutr (Leo) s Facebook Cover Picture 1 Facebook Cover Picture 2 Facebook Profile Picture.
CMPSC 16 Problem Solving with Computers I Spring 2014 Instructor: Tevfik Bultan Lecture 6: Stepwise refinement revisited, Midterm review.
PHP Condtions and Loops Prepared by Dr. Maher Abuhamdeh.
Image Processing CS177.
Creative Commons Attribution Non-Commercial Share Alike License
Implementation of Convolution using C++
Barb Ericson Georgia Institute of Technology Dec 2009
Topic 10 The if statement Notes adapted from Introduction to Computing and Programming with Java: A Multimedia Approach by M. Guzdial and B. Ericson,
CHAPTER 4 Test Design Techniques
Important Information
Barb Ericson Georgia Institute of Technology August 2005
Manipulating Pictures, Arrays, and Loops part 5
Workshop for Programming And Systems Management Teachers
CSE 8A Lecture 6 Reading for next class:
CSE 113 A February , 2009.
MATLAB Programming Indexing Copyright © Software Carpentry 2011
Creative Commons Attribution Non-Commercial Share Alike License
Georgia Institute of Technology
Manipulating Pictures, Arrays, and Loops
February , 2009 CSE 113 B.
What Color is it?.
Manipulating Pictures, Arrays, and Loops part 6
Creative Commons Attribution Non-Commercial Share Alike License
February , 2009 CSE 113 B.
Creative Commons Attribution Non-Commercial Share Alike License
CS November 2010 Developing array algorithms. Reading:
CSC1401 Manipulating Pictures 2
Manipulating Pictures, Arrays, and Loops part 6
Presentation transcript:

Creative Commons Attribution Non-Commercial Share Alike License sa/3.0/ sa/3.0/ Original Developer: Beth Simon, 2009

CSE8A Lecture 17 Read next class: read pg Midterm! BRING RED SCANTRON! –Covers material through Friday –Review session with Leo tonight 7-8:00pm Peterson 108 –Reading quizzes available as “midterm RQ review” on moodle. –Sample midterm posted Use learning goals to know what I care about Redo: clicker questions, quizzes, lab quizzes, (75-80% ish Multi choice Be able to WRITE CODE ON PAPER (like your PSAs) –35 min individual (90%), 15 min group (10%)

By the end of today’s class you should be able to… LG34: Compare and contrast two solutions to a problem using for loops and if statements LG35: Be able to identify which pixels you want to check for chromakey LG36: Identify, compare and contrast if-else if –else statements and separate if statement blocks.

Original make convict bird: If it’s a green pixel AND it’s an even indexed row, make it black Else If it’s a green pixel AND it’s an odd indexed row, make it white If it’s a green pixel –If it’s an even indexed row, make it black –Else make it white Better version: Test Common Element Once Take advantage of “mutually exclusive”

A better version of the code if ( ((y%2) == 0) && (currentPix.getGreen() > 200)) { currentPix.setColor(Color.BLACK); } else if( ((y%2) == 1) && (currentPix.getGreen() > 200)) { currentPix.setColor(Color.WHITE); } if (currentPix.getGreen() > 200) { }

Complete this code if (currentPix.getGreen() > 200) { > } if (x%2 == 0) currentPix.setColor(Color.BLACK); else if (x%2 == 1) currentPix.setColor(Color.WHITE); if (x%2 == 0) currentPix.setColor(Color.BLACK); if (x%2 == 1) currentPix.setColor(Color.WHITE); if (x%2 == 0) currentPix.setColor(Color.BLACK); else currentPix.setColor(Color.WHITE); How many times is a % executed?

Programming Rule DO NOT recompute known values –Not only inefficient –Made Software Engineering since other programmers say – there must be something different here, it’s being recomputed and it doesn’t need to be!

Chromakey: Visit strange new places

How will you know which part (say red) you are in? A.Depends on the coordinates of x and y (not the color) B.Depends on the colors at coordinate x, y in foo C.Depends on the colors at coordinate x, y in bar D.Depends on the colors at coordinates x, y in foo compared to those in bar

The book uses swapBackground differently than we will Just be aware!!!! The calling object is the “final merged picture” public void swapBackground(Picture oldBackground, Picture newBackground) for (int x = 0; x < this.getWidth(); x++) for (int y = 0; y < this.getHeight(); y++) { //Do some stuff }

Your chromakey Call two methods –One to replace background –One to replace tShirt –If there are more than 2 people in the picture, you can call more method – one to replace each tShirt with a different background if you like public void chromaKeyBlue(Picture newPicToReplaceBlue, int blueThreshold) for (int x = 0; x < this.getWidth(); x++) for (int y = 0; y < this.getHeight(); y++) { //Do some stuff }

Handout: Compare and Contrast Sepia Tone and Posterize

How many times can redValue and blueValue be assigned a NEW value in sepia?

How many times can redValue and blueValue be assigned a NEW value in posterize?

Which of these statements best characterizes sepia? A.All Color components are changed, based on that same component’s original value (red changed based on red, blue changed based on blue, green changed based on green) B.All Color components are changed, based on one component’s original value (just use one component to make decision) C.Some (not all) Color components are changed, based on their original value D.Some (not all) Color components are changed based on red’s original component value E.None of these are true!

Which of these statements best characterizes posterize? A.All Color components are changed, based on that same component’s original value (red changed based on red, blue changed based on blue, green changed based on green) B.All Color components are changed, based on one component’s original value (just use one component to make decision) C.Some (not all) Color components are changed, based on their original value D.Some (not all) Color components are changed based on red’s original component value E.None of these are true!