COSC 1P02 Introduction to Computer Science 7.1 Cosc 1P02 Week 7 Lecture slides "There are two ways of constructing a software design; one way is to make.

Slides:



Advertisements
Similar presentations
Copyright 2006 by Pearson Education 1 Building Java Programs Supplement 3G: Graphics.
Advertisements

Digital Images in Java Java’s imaging classes. Java imaging library  Java has good support for image processing  Must master a handful of classes and.
CSE Lecture 6 – Complex Numbers & Images
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.
Color & Light, Digitalization, Storage. Vision Rods work at low light levels and do not see color –That is, their response depends only on how many photons,
Cosc 1P02 Week 2 Lecture slides
Bit Depth and Spatial Resolution SIMG-201 Survey of Imaging Science © 2002 CIS/RIT.
Fundamentals of Python: From First Programs Through Data Structures
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.
Computer Science 111 Fundamentals of Programming I Introduction to Digital Image Processing.
Computer Science 101 Introduction to Programming with Pictures.
1 Bitmap Graphics It is represented by a dot pattern in which each dot is called a pixel. Each pixel can be in any one of the colors available and the.
© GCSE Computing Candidates should be able to:  explain the representation of an image as a series of pixels represented in binary  explain the need.
Chapter 6: Color Image Processing Digital Image Processing.
Image Processing & Perception Sec 9-11 Web Design.
Colours and Computer Jimmy Lam The Hong Kong Polytechnic University.
ECE291 Computer Engineering II Lecture 9 Josh Potts University of Illinois at Urbana- Champaign.
COSC 1P02 Intro. to Computer Science 6.1 Cosc 1P02 Week 6 Lecture slides "To succeed, jump as quickly at opportunities as you do at conclusions." --Benjamin.
© 1999 Rochester Institute of Technology Introduction to Digital Imaging.
Nov 061 Size Control How is a component’s size determined during layout and during resize operations? Three factors determine component sizes: The component’s.
25.2 The human eye The eye is the sensory organ used for vision.
Computer Science 111 Fundamentals of Programming I Introduction to Graphics.
COSC 1P03 Introduction to Data Structures 1.1 COSC 1P03  Audience  planning to major in COSC (prereq. 1P02 60%)  Lectures (AS202, AS217), labs (J301),
Computer Science 112 Fundamentals of Programming II Graphics Programming.
Color and Vision Key Question: How do we see color?
Pictures Looping through pixels.. Lab Review (1) Objects  Instantiated from Class  Turtle myTut = new Turtle(myWorld);  new operator creates an instance.
September 5, 2013Computer Vision Lecture 2: Digital Images 1 Computer Vision A simple two-stage model of computer vision: Image processing Scene analysis.
Art 321 Lecture 7 Dr. J. Parker. Programming In order to ‘make things happen’ on a computer, you really have to program it. Programming is not hard and.
Two –Dimensional Arrays Mrs. C. Furman Java Programming November 19, 2008.
Lecture 15: Intro to Graphics Yoni Fridman 7/25/01 7/25/01.
INT 840E Computer graphics Introduction & Graphic’s Architecture.
CS112 Scientific Computation Department of Computer Science Wellesley College Numb3rs Number and image types.
Digital Image Processing Part 1 Introduction. The eye.
Chapter 16 Light and Color  16.1 Properties and Sources of Light  16.2 Color and Vision  16.3 Photons and Atoms.
Processing can load images, display them on the screen, and change their size, position, opacity, and tint. You can load gif, png and jpg images in processing.
1 Building Java Programs Supplement 3G: Graphics These lecture notes are copyright (C) Marty Stepp and Stuart Reges, They may not be rehosted, sold,
Digital Media Dr. Jim Rowan ITEC So far… We have compared bitmapped graphics and vector graphics We have discussed bitmapped images, some file formats.
Lecture 7: Intro to Computer Graphics. Remember…… DIGITAL - Digital means discrete. DIGITAL - Digital means discrete. Digital representation is comprised.
VIS-IT The 3 Steps to filtering Open an image The user can either select an image from our pre-existing library or choose to upload an image from.
Adobe Photoshop CS5 – Illustrated Unit A: Getting Started with Photoshop CS5.
DIGITAL IMAGE. Basic Image Concepts An image is a spatial representation of an object An image can be thought of as a function with resulting values of.
The Seven Elements of Art Ms. Hanson/ART 1. Definition of The Elements of Art The elements of art are a commonly used group of aspects of a work of art.
Why a bitmap (.bmp), not a.jpg? If you cannot save a.bmp, make it an uncompressed.tif. Compression (of this 8-bit 397,000 pixel image): none (397kb memory)medium.
CSC1401 Using Decisions in Java - 1. Recall from Alice We only wanted to shoot a lightning bolt at a philosopher So, we used the If statement.
HDFLook Some basic instructions on the functionality of the HDFLook software.
CS COMPUTER GRAPHICS LABORATORY. LIST OF EXPERIMENTS 1.Implementation of Bresenhams Algorithm – Line, Circle, Ellipse. 2.Implementation of Line,
1 Layer up to keep warm… A short tutorial on the usage of layers.
1 Introduction to Graphics b The last one or two sections of each chapter of the textbook focus on graphical issues b Most computer programs have graphical.
David Luebke 1 2/5/2016 Color CS 445/645 Introduction to Computer Graphics David Luebke, Spring 2003.
16.2 Color and Vision. Chapter 16 Objectives  Describe at least five properties of light.  Describe the meaning of the term “intensity.”  Use the speed.
1 Sections 5.1 – 5.2 Digital Image Processing Fundamentals of Java: AP Computer Science Essentials, 4th Edition Lambert / Osborne.
1 Computational Vision CSCI 363, Fall 2012 Lecture 32 Biological Heading, Color.
Photoshop CS6 – Nelson Unit 3: Photoshop CS6. Objectives Define photo editing software Start Photoshop and view the workspace Use the Zoom tool and the.
Computer Systems Nat 5 Computing Science Data Representation
Image Processing Objectives To understand pixel based image processing
David Meredith Aalborg University
Computer Graphics Lecture 3 Computer Graphics Hardware
Additive Colour Theory
Fundamentals of Programming I Introduction to Digital Image Processing
Lesson One: The Beginning Chapter 1: Pixels Learning Processing Daniel Shiffman Presentation by Donald W. Smith Graphics from
Images Presentation Name Course Name Unit # – Lesson #.# – Lesson Name
Basic Graphics Drawing Shapes 1.
CS320n –Visual Programming
Color Values All colors in computer images are a combination of red, green and blue Each component is encoded as a number means the color is.
Digital Media Dr. Jim Rowan ITEC 2110.
Gray Scale picture def pixBW(pixel): # given a pixel, change to BW
Images Presentation Name Course Name Unit # – Lesson #.# – Lesson Name
Digital Image Processing
Chapter 15, Images …a few points
Presentation transcript:

COSC 1P02 Introduction to Computer Science 7.1 Cosc 1P02 Week 7 Lecture slides "There are two ways of constructing a software design; one way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult." - C. A. R. Hoare

COSC 1P02 Introduction to Computer Science 7.2 Choosing a Color  Set color of each pixel  Sequence through all pixels  Picture is a collection  for-each  ASCIIPrompter to get RGB values  Pixel class  methods to get & set color of pixels  Example  Color constructor allows setting RGB  Black & white  Gray  if R=G=B we get gray  different shades with different intensities

Pixel Methods

COSC 1P02 Introduction to Computer Science 7.4 Grayscale  Convert a picture into grayscale  essentially what we call a black and white picture  shades of gray indicating the luminance of the picture  Gray if R=G=B  set RGB to same value  average of RGB values  Color methods  Example  Note method may change the color of the pixels of the Picture parameter  they stay changed  just like a method moving a turtle changes its position

Color Methods

COSC 1P02 Introduction to Computer Science 7.6 Color Blindness  Inability do distinguish some colors  Red-green color blindness affects 5% of males  deuteranopia – red and green receptors trigger at same level  test  Example  set red and green values to same level (as green)  PictureDisplayer(picture) constructor creates displayer that fits the picture and places the picture on displayer  note display now declared in method not class  depends on picture loaded  local to method  constructor does no initialization

COSC 1P02 Introduction to Computer Science 7.7 Rods and Cones

COSC 1P02 Introduction to Computer Science 7.9 Random Paint  Create a picture by setting randomly chosen pixels to randomly chosen colors  Start with a white canvas (picture)  Select a random pixel  pixels are arranged in two dimensions (width x height)  can access a particular pixel via getPixel(x,y)  x is x-coordinate (column)  y is y-coordinate (row)  top left corner is (0,0)  bottom right corner is (height,width)  Example  picture attributes (width, height)  random color  random R, G, and B values

COSC 1P02 Introduction to Computer Science 7.10 Rotating a Picture  90 degree rotation to the left  Rotated picture has different dimensions  Pixel movement  e.g. 3x2 picture  (x,y) -> (y,width-1-x)  Sequence through pixels of original producing new by setting pixels  nested for loops  y indexes through rows  x indexes through columns  Example  displayer that sizes to picture  need two displayers  pictures different shapes  garbage collection  when display no longer references first displayer  with no references, the storage for the object is reclaimed

(0,0) -> (0,2) (0,1) -> (1,2) (1,0) -> (0,1) (1,1) -> (1,1) (2,1) -> (1,0) (2,2) -> (2,0)

COSC 1P02 Introduction to Computer Science 7.12 Redeye Correction  Flash reflecting from back of eye shows red in picture  Change red to black (pupil)  cannot change all red pixels or real red gets changed  Select area to apply correction  use some tool (e.g. PictureInspector ) to determine area  What is red?  many shades of red, not only (255,0,0)  want colors close to red  Color distance  distance in 3 dimensional (R,G,B) space  Example  constant declaration ( TOLERANCE )  indexing over subrange of picture  distance method  sqrt & pow from Math

Euclidian Distance

COSC 1P02 Introduction to Computer Science 7.14 Colour Distance

COSC 1P02 Introduction to Computer Science 7.15 Picture Methods

COSC 1P02 Introduction to Computer Science 7.16 PictureDisplayer Methods

COSC 1P02 Introduction to Computer Science 7.17 The end