Nested Loops Circles inside Circles

Slides:



Advertisements
Similar presentations
Creative Commons Attribution Non-Commercial Share Alike License sa/3.0/
Advertisements

Do Now:.
Objective: Convert between degrees and radians. Draw angles in standard form. Warm up Fill in the blanks. An angle is formed by two_____________ that have.
2.3 – Perform Rotations.
11.5 Rotations. Rotations Rotate a Figure 90 about the origin.
Seeing Double With a partner, walk around the room and see if you can identify the two images in each picture. At the end, we’ll talk about the answers.
Four simple expressions in meta. Data objects Pieces of data in a computer are called objects Today, we’ll talk about four kinds of objects Numbers Pictures.
Original image: 512 pixels by 512 pixels. Probe is the size of 1 pixel. Picture is sampled at every pixel ( samples taken)
IMAGE PROCESSING LIBRARY (PIL) This is a package that you can import into python and it has quite a few methods that you can process image files with.
2.4: Rotations.
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.
NestedLoops-part11 Nested Loops – part 1 Barb Ericson Georgia Institute of Technology Nov 2009.
Rotations EQ: How do you rotate a figure 90, 180 or 270 degrees around a given point?
CSC1401 Viewing a picture as a 2D image - 1. Review from the last week We used a getPixels() to get all of the pixels of a picture But this has been somewhat.
Draw rotations in the coordinate plane.
Pictures Looping through pixels.. Lab Review (1) Objects  Instantiated from Class  Turtle myTut = new Turtle(myWorld);  new operator creates an instance.
Two –Dimensional Arrays Mrs. C. Furman Java Programming November 19, 2008.
Rotations. Graph the following coordinates, then connect the dots (2, 1) (4,1) (2, 5) X y Rotate the triangle 90° clockwise about the origin and graph.
TOPIC 11 RETURNING VALUES FROM METHODS PICTURE TRANSFORMATIONS 1 Notes adapted from Introduction to Computing and Programming with Java: A Multimedia Approach.
NestedLoops-Mod7-part31 Two-Dimensional Arrays and Nested Loops – part 3 Bugs in the garden Originally by Barb Ericson Georgia Institute of Technology.
NestedLoops-Mody7-part51 Two-Dimensional Arrays and Nested Loops – part 5 Rotations Barb Ericson Georgia Institute of Technology May 2007.
Rotations.
Day 8: Fruit Loops: Color. Loop Review What does the following loop print? for (int i= 0; i
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:
SYMMETRY GOAL: TO IDENTIFY LINES OF SYMMETRY IN AN OBJECT.
Transformation: Rotation Unit 4.10 I can perform rotations and identify their transformation notation.
Rotation – A circular movement around a fixed point Rotation.
EQ: How do you rotate a figure 90, 180 or 270 degrees around a given point and what is point symmetry? Rotations.
Properties or Rules of Transformations Equations used to find new locations.
Creative Commons Attribution Non-Commercial Share Alike License sa/3.0/
Copyright © Curt Hill Further Picture Manipulation Considering position.
Go Back > Question 1 Describe this transformation. A reflection in the line y = x. ? Object Image.
04-ManipulatingPictures-part21 Manipulating Pictures, Arrays, and Loops part 2 Barb Ericson Georgia Institute of Technology June 2008.
Georgia Institute of Technology Two-Dimensional Arrays and Nested Loops – part 2 Barb Ericson Georgia Institute of Technology August 2005.
Barbara Ericson Georgia Tech Sept 2005
Topic 9 Modifying Pixels in a Matrix: Copying, Cropping
Jeopardy Transformations.
Two Dimensional Arrays
Unit 1: Transformations Lesson 3: Rotations
11.4 Rotations 1/12/17.
Lab 9 Intro to Robots.
Unit 1 Transformations in the Coordinate Plane
Find the area of the region enclosed by one loop of the curve. {image}
Two-Dimensional Arrays and Nested Loops – part 1
Two-Dimensional Arrays and Nested Loops – part 1
A movement of a figure in a plane.
A movement of a figure in a plane.
Looping through pixels.
CSE 8A Lecture 6 Reading for next class:
Warm up A function is even. Point A(-3, 4) is on the even function. Name another point. A function is even. Point B(9, 2) is on the even function.
Properties or Rules of Transformations
Rotations on the Coordinate Plane
Drawing the Mandelbrot Set
Lecture 13: Two-Dimensional Arrays
Circles! You are going to create an “image” with circle(s)
Lecture 4 2d Arrays CSE /26/2018.
Lecture 12: 2D Arrays AP Computer Science Principles
Introduction to transformational GEOMETRY
CSC1401 Viewing a picture as a 2D image - 2
Properties or Rules of Transformations
Nested Loops Circles inside Circles
Introduction to Programming in MATLAB
2-Dimensional Lists (Matrices) in Python
The Image The pixels in the image The mask The resulting image 255 X
Directions: Fill in the blanks with the correct answers then color in the picture with the given color. Color White: A full rotation around a.
( , ) ( , ) ( , ) ( , ) ( , ) ( , ) ( , ) ( , ) ( , ) ( , ) ( , )
13-2 Angles and Angle Measure
Transformations Review
Warm-Ups A _____________ is a change in a figure’s position or size
Let’s start an intro unit to Geometry!!
Presentation transcript:

Nested Loops Circles inside Circles Picture Two Nested Loops Circles inside Circles

Lab Review - Problem Extract the red plane of an image. Display the original image Display the red plane only of the image Both should be displayed simulataeously

Lab Review - Problem Analysis orig show() getRedPlane() Instantiates Picture Class Returned from redPlaneImg show()

Lab Review – The Procedure public Picture getRedPlane() { // get the pixels of this picture Pixel [] origPixData = this.getPixels(); // make a blank picture of the same size Picture newPict = new Picture(this.getWidth(), this.getHeight()); // get the pixels of the new picture Pixel [] newPixData = newPict.getPixels(); // Set the new picture's pixels to the red value in this picture // For you to supply return newPict; }

Another Problem Rotate the picture clockwise by 90 and return the rotated image as a new Picture Image?

Java Hint We can treat an image as a 2-D object using nested loops! for(int col = 0; col < this.getWidth(); col++ { for(int row = 0; row < this.getHeight(); row++) { Pixel pix = this.getPixel(col,row); // do something with pix }

Analysis 1 2 3 4 5 6 7 8 9 10 11 Rotate Clockwise (0,0) (0,1) (0,2) 1 2 3 4 5 6 7 8 9 10 11 Rotate Clockwise (0,0) (0,1) (0,2) (1,0) (1,1) (1,2) (2,0) (2,1) … (2,1) (2,2) (1,2) … 4 8 1 5 9 2 6

Group Work Grab a partner and write out a method rotateClockwise() for the Picture class that will return an image rotated 90 degrees in a clockwise direction. Can we rotate the image in place?