Test 2 on Wed, 11/9 On image processing

Slides:



Advertisements
Similar presentations
CS1315: Introduction to Media Computation Making sense of functions.
Advertisements

A Media Computation Cookbook Manipulating Images and Sounds for Use in Alice Part 1: Image Manipulations Part 2: Advanced Image Manipulations, e.g., changing.
Python: Modifying Pictures Using Loops. Review JES command area – program area Defining/using functions specifying a sequence of steps for what the function.
TOPIC 5 INTRODUCTION TO PICTURES 1 1 Notes adapted from Introduction to Computing and Programming with Java: A Multimedia Approach by M. Guzdial and B.
Python: Making colors and Using Loops. Review JES command area – program area Defining/using functions specifying a sequence of steps for what the function.
CS 102 Computers In Context (Multimedia)‏ 02 / 06 / 2009 Instructor: Michael Eckmann.
CS 102 Computers In Context (Multimedia)‏ 02 / 18 / 2009 Instructor: Michael Eckmann.
1 CS 177 Week 6 Recitation Slides Scaling Drawing on images Vector-based Vs. Bitmap graphical representation.
Programming: Part II In this section of notes you will learn more advanced programming concepts such as branching and repetition as well as how to work.
James Tam Programming: Part II In this section of notes you will learn about more advanced programming concepts such as looping, functions.
CS 102 Computers In Context (Multimedia)‏ 02 / 25 / 2009 Instructor: Michael Eckmann.
Some Utility Functions If you know the name of the file, searching for it with pickAFile() feels tedious You can set and get a media folder (path) for.
Georgia Institute of Technology Two-Dimensional Arrays and Nested Loops – part 6 Barb Ericson Georgia Institute of Technology August 2005.
TOPIC 9 MODIFYING PIXELS IN A MATRIX: COPYING, CROPPING 1 Notes adapted from Introduction to Computing and Programming with Java: A Multimedia Approach.
Copying and Transforming Pictures. First, finding the min or max… Next homework asks you to write a function to find the darkest and lightest shade of.
NestedLoops-part31 Nested Loops – part 3 Barb Ericson Georgia Institute of Technology Nov 2009.
Computer Science 101 Introduction to Programming with Pictures.
How to use the Java class libraries Brief documentation of how to do this all with Java.
CS1315: Introduction to Media Computation Picture encoding and manipulation.
CS1315: Introduction to Media Computation Picture encoding and manipulation.
Download JES Tool JES: Jython Environment for Students
02-RangesInPictures1 Barb Ericson Georgia Institute of Technology Oct 2010 Working with ranges in pictures.
CS2984: Introduction to Media Computation Using Loops for Pictures Conditionals Copying images.
Jeopardy Heading1Heading2Heading3Heading4 Heading5 Q $100 Q $200 Q $300 Q $400 Q $500 Q $100 Q $200 Q $300 Q $400 Q $500 Final Jeopardy.
Resizing Images CS 268. Where to start? Pictures (of course)  Need to down size them for the web.  Pictures taken with a 10 mega pixel camera are usually.
CS1315: Introduction to Media Computation Picture encoding and manipulation.
1 CS 177 Week 5 Recitation Slides Mirroring and copying images, Using for Loop, if statement, and range.
Copying: How it works Here's the initial setup:. Copying: How it works 2 After incrementing the sourceY and targetY once (whether in the for or via expression):
Chapter 4: Modifying Pixels in a Range (partial slide deck)
Introduction to Computing and Programming in Python: A Multimedia Approach Chapter 4: Modifying Pixels in a Range.
Georgia Institute of Technology Two-Dimensional Arrays and Nested Loops – part 5 Barb Ericson Georgia Institute of Technology August 2005.
NestedLoops-part41 Nested Loops – part 4 Barb Ericson Georgia Institute of Technology Nov 2009.
NestedLoops-Mody7-part51 Two-Dimensional Arrays and Nested Loops – part 5 Rotations Barb Ericson Georgia Institute of Technology May 2007.
Creating a picture in JES Use in the command window of JES (black background at bottom) to set the folder where the picture is to be saved >>> path = setMediaPath()
CS 102 Computers In Context (Multimedia)‏ 02 / 09 / 2009 Instructor: Michael Eckmann.
A Media Computation Cookbook Manipulating Images and Sounds for Use in Alice Part 1: Image Manipulations Part 2: Advanced Image Manipulations, e.g., changing.
NestedLoops-part21 Nested Loops – part 2 Barb Ericson Georgia Institute of Technology Nov 2009.
Chapter 6: Modifying Pixels by Position
CSC 112Introduction to Media Computation 1 Rotating Images.
CS1315: Introduction to Media Computation Transforming pictures by index number.
Python: Working with pixels. Reminder: Conditionals if age < 18: showInformation(“Sorry, not allowed to vote yet.”) else: showInformation(“Please select.
Introduction to Computing and Programming in Python: A Multimedia Approach Chapter 4: Modifying Pixels in a Range.
I MAGE P ROCESSING IN CS1 Brad Miller David Ranum Luther College.
1 Sections 5.1 – 5.2 Digital Image Processing Fundamentals of Java: AP Computer Science Essentials, 4th Edition Lambert / Osborne.
Test 2 on Wed, 11/9 On image processing
Chapter 5: Picture Techniques with Selection
Python/JES JES IDE (Integrated Development Environment)
Topic 9 Modifying Pixels in a Matrix: Copying, Cropping
Download JES Tool JES: Jython Environment for Students
Week 2.
Picture Functions ppp =makePicture(pickAFile())
Download JES Tool JES: Jython Environment for Students
Workshop for Programming And Systems Management Teachers
Working with ranges in pictures
Two-Dimensional Arrays and Nested Loops – part 5
Gray Scale picture def pixBW(pixel): # given a pixel, change to BW
Chapter 4: Modifying Pixels in a Range
Agenda – 1/31/18 Questions? Group practice problems
Week 3.
Chap. 3 Functions Start Python IDLE (Shell) and open a new file.
Two-Dimensional Arrays and Nested Loops – part 4
Two-Dimensional Arrays and Nested Loops – part 3
Two-Dimensional Arrays and Nested Loops – part 6
Two-Dimensional Arrays and Nested Loops – part 6
CS 177 Week 3 Recitation Slides
CSC1401 Viewing a picture as a 2D image - 2
Two-Dimensional Arrays and Nested Loops – part 6
CS 101: Introduction to Computing
Chapter 4: Modifying Pixels in a Range
Let's create your English Folder!.
Presentation transcript:

Test 2 on Wed, 11/9 On image processing Allowed to use JES to test your code, but discouraged Last day to withdraw with W: 11/15

Picture Functions ppp =makePicture(pickAFile()) ppp.getWidth(), ppp.getHeight() xxx=ppp.getPixel( , ) xxx.getColor(), .getRed(), .getGreen(), .getBlue() xxx.setColor(), .setRed(), .setGreen(), .setBlue() makeColor(), pickAColor()

Some Utility Functions If you know the name of the file, searching for it with pickAFile() is boring You can set and get a media folder (path) in order to remember the folder where your media files are coming from (or going to) setMediaPath() lets you pick your media folder and remember it getMediaPath(“\test.jpg”) lets you generate a complete path of the filename from only the last part

Example >>> setMediaPath() New media folder: C:\mediasources\ >>> getMediaPath("barbara.jpg") 'C:\\mediasources\\barbara.jpg' >>> barb=makePicture(getMediaPath("barbara.jpg"))

Additional Picture Functions setMediaPath() – fix a path to media files getMediaPath(filename) file = makeEmptyPicture(100,100) – creates a blank picture of size 100x100 writePictureTo(file, getMediaPath()+“\100x100.jpg”) – save file with name “100x100.jpg” canvas=makePicture(getMediaPath(“100x100.jpg”))

Picture Copy copy.py with Two pictures ‘pictA’ to copy to ‘pictB’ (pictB has to larger than pictA) def picCopy(fromPic, toPic): # for every pixel in fromPic, copy its colors to the same pixel location in the toPic def main(): setMediaPath() picA = makePicture(getMediaPath(“ “) # get the width of picA # get the height of picA # create an empty picture, called picB, with the same dimension picCopy(picA, picB) repaint(pictB)

Copy flower1 to lower left corner sourceX sourceY flower1 targetX = sourceX targetY = sourceY + ? ? : getHeight(canvas) – getHeight(flower1)

Copy flower2 targetX = sourceX + getWidth(flower1) sourceY flower2 flower1 targetX = sourceX + getWidth(flower1) targetY = sourceY + ? ? : getHeight(canvas) – getHeight(flower2)

Lab_1104 Create a large empty picture, called ‘canvas’ Modify picCopy() so that it has four arguments: picCopy(fromPic, toPic, toX, toY) where toX and toY are coordinates in toPic from where pixels in fromPic have to be copied over Email updated copy.py to COMP1000.201@gmail.com