Gray Scale picture def pixBW(pixel): # given a pixel, change to BW

Slides:



Advertisements
Similar presentations
Spreadsheet Vocabulary
Advertisements

Spreadsheet Vocabulary Split the screen so you can see the words AND the crossword puzzle AND the quiz at the same time.
The lines of this object appear continuous However, they are made of pixels 2April 13, 2015.
Computer Science 111 Fundamentals of Programming I More Digital Image Processing.
Movie of picture negatives # Pseudo Code def movieNeg(directory, pic): for each column of ‘pic’ across the entire width for each pixel from top of the.
2-3 We use a visual tool called a histogram to analyze the shape of the distribution of the data.
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.
CSE 113 Week 5 February , Announcements  Module 2 due 2/15  Exam 3 is on 2/15  Module 3 due 2/22  Exam 4 is on 2/25  Module 4 due 2/29.
TEKS 8.6 (A,B) & 8.7 (A,D) This slide is meant to be a title page for the whole presentation and not an actual slide. 8.6 (A) Generate similar shapes using.
Images and Tables. Displaying Image Attributes: SRC= " mypic.gif " – Name of the picture file SRC= " pic/mygif.jpg " – Name of file found in pic directory.
Notes Ch. 12—Creating Tables Web Page Design. Why Use Tables? Tables are used to create a variety of items such as calendars, charts, and spreadsheets.
Tickertape def tickertape(directory,string): for each frame to generate create an new canvas write the string on canvas slightly left of the previous frame.
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.
Web Design. How to set up the robot How to link to robot How not to break my robot Sec Getting Started How to make it move How to control speed.
Image Processing & Perception Sec 9-11 Web Design.
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.
Step 2: Solve the 1st side/layer
Chapter 6: Modifying Pixels by Position. Chapter Learning Goals.
NestedLoops-part11 Nested Loops – part 1 Barb Ericson Georgia Institute of Technology Nov 2009.
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.
02-RangesInPictures1 Barb Ericson Georgia Institute of Technology Oct 2010 Working with ranges in pictures.
Manipulating Pixels by Range and More on Functions.
UsingSoundRanges-part21 Processing Sound Ranges part 2 Barb Ericson Georgia Institute of Technology Oct 2009.
1 CS 177 Week 5 Recitation Slides Mirroring and copying images, Using for Loop, if statement, and range.
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.
Unit 4 Create and Use Tables. TITLE CORNELL NOTES TOPIC: NOTES: Name: Date: 09/08/2009 Period : Summary: Reasons for using tables Unit 4 Page 1 Display.
NestedLoops-Mody7-part51 Two-Dimensional Arrays and Nested Loops – part 5 Rotations Barb Ericson Georgia Institute of Technology May 2007.
Step 1: Place x 2 term and constant into the box 2x 2 2 PROBLEM: 2x 2 + 5x + 2.
An image has Reflective Symmetry if there is at least one line which splits the image in half so that one side is the mirror image of the other.
Grid References.
Copyright © Curt Hill Further Picture Manipulation Considering position.
CSC 112Introduction to Media Computation 1 Rotating Images.
CS1315: Introduction to Media Computation Transforming pictures by index number.
Georgia Institute of Technology Two-Dimensional Arrays and Nested Loops – part 2 Barb Ericson Georgia Institute of Technology August 2005.
Web Design. How to link the robot How to turn on the robot Sec Getting Started What is python Programming in python How to move the robot How to.
Test 2 on Wed, 11/9 On image processing
Pixels, Colors and Shapes
Topic 9 Modifying Pixels in a Matrix: Copying, Cropping
Overview Frequency Distributions
Adapted from slides by Marty Stepp and Stuart Reges
CSS Layouts: Grouping Elements
NORMAL DISTRIBUTION.
high-level operations on pictures
Image Processing & Perception
CMPT 120 Topic:  Case Study.
CS1315: Introduction to Media Computation
Fundamentals of Programming I Introduction to Digital Image Processing
Workshop for Programming And Systems Management Teachers
Animated picture fades from gray to color (Basic)
Working with ranges in pictures
Two-Dimensional Arrays and Nested Loops – part 1
Column addition and subtraction
Two-Dimensional Arrays and Nested Loops – part 2
Two-Dimensional Arrays and Nested Loops – part 1
Transformations and Symmetry
Chap. 3 Functions Start Python IDLE (Shell) and open a new file.
Fundamentals of Programming I Introduction to Digital Image Processing
Two-Dimensional Arrays and Nested Loops – part 6
Two-Dimensional Arrays and Nested Loops – part 2
Two-Dimensional Arrays and Nested Loops – part 6
Processing Sound Ranges part 2
Processing Sound Ranges
Digital Image Processing
CSC1401 Viewing a picture as a 2D image - 2
Two-Dimensional Arrays and Nested Loops – part 6
CS 101: Introduction to Computing
CS1315: Introduction to Media Computation
QUESTION NUMBER 1.
Presentation transcript:

Gray Scale picture def pixBW(pixel): # given a pixel, change to BW get R,G,B values of the pixel compute the average set R,G,B values of the pixel to the average return def picBW(pic): get the width of pic, and name it get the height of pic, and name it for every y coordinate: for every pixel in the row at the given row y: call pixBW(pixxx)

What is wrong with this picture ?

Doing something useful with mirroring

Vertical Mirroring Imagine a mirror horizontally across the picture, or vertically What would we see? How do generate that digitally? We simply copy the colors of pixels from one place to another

Vertical Mirroring 1 2 3 4 Think of a number at each x and y location instead of a color Note that the distances from the middle column are identical in both directions 1 2 3 4 5 1 2 1 2 3 5 4

How do we design Algorithm for this ? Slicing a picture down the middle and sticking a mirror on the slice Do it by using a loop to measure a difference x mirrorpoint y x x

Algorithm (recipe) Use a distance from the mirror point Then reference to either side of the mirrorpoint using the difference

1 2 3 4 5 Loop through all the rows (y starts at 1, increments by 1, and is less than the picture height) For each row, Loop with x starting at 1 and x less than the midpoint (mirror point) value Get the left pixel at (mirrorpoint-x, y) Get the right pixel at (mirrorpoint+x, y) Set the color for the right pixel to be the color of the left pixel 1 2 3 5 4

How does it work? Compute the half-way horizontal index The y value travels the height of the picture The x value is an offset It’s not actually an index It’s the amount to add or subtract We copy the color at mirrorpoint-offset to mirrorpoint+offset

Can we make a horizontal mirror?

Messing with Santa some more Copy bottom to top

Lab_1102 Complete the Python program for one of image processings (gray scale, sunset, posterizing) Write a Python program for a vertical mirroring Email the Python program file to comp1000.201@gmail.com