Manipulating and Displaying Images in Java Lihang Ying Department of Computing Science University of Alberta, Canada 2005-1-25.

Slides:



Advertisements
Similar presentations
Lecture10 Java Advanced Imaging (JAI) API. Example First import java.awt.image.renderable.*; import javax.media.jai.*; public class RenderedChainTest.
Advertisements

Sequence of characters Generalized form Expresses Pattern of strings in a Generalized notation.
For(int i = 1; i
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.
EXAMPLES (Arrays). Example Many engineering and scientific applications represent data as a 2-dimensional grid of values; say brightness of pixels in.
Introduction to Computer Science Robert Sedgewick and Kevin Wayne Recursive Factorial Demo pubic class Factorial {
Picture It Very Basic Game Picture Pepper. Original Game import java.util.Scanner; public class Game { public static void main() { Scanner scan=new Scanner(System.in);
Java POWERED BY: ARVIND DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING RADHA GOVIND GROUP OF INSTITUTIONS,MEERUT.
2006 by Jim X. Chen: 1.1. Review –Graphics commands specify straight lines or other geometric primitives that are scan-converted.
Image Processing … computing with and about data, … where "data" includes the values and relative locations of the colors that make up an image.
Computer Graphics Tz-Huan Huang National Taiwan University (Slides are based on Prof. Chen’s)
Data Structures (Second Part) Lecture 2 : Pointers Bong-Soo Sohn Assistant Professor School of Computer Science and Engineering Chung-Ang University.
Structure.
Lecture 9 Grey Level & Colour Enhancement TK3813 Dr. Masri Ayob.
Continuing to very Powerful Rendering Model Java2D.
Regional Processing There goes the neighborhood. Overview  Under point processing a single input sample is processed to produce a single output sample.
CS 106 Introduction to Computer Science I 02 / 18 / 2008 Instructor: Michael Eckmann.
Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 1 Chapter 4 2D Graphics: Advanced Topics.
School of Engineering and Computer Science Victoria University of Wellington Copyright: Peter Andreae & david streader, VUW Images and 2D Graphics COMP.
Lecture 11 Neighbourhood Operations (1)
Lecture09 Push & Immediate Mode Imaging. Push Imaging Model (PIM) ImageProducer is an interface for objects which can produce the image data for Images.
1 Chapter 4 2D Graphics: Advanced Topics  To construct custom shape primitives  To apply basic image processing techniques  To create fractal images.
Slides prepared by Rose Williams, Binghamton University ICS201 Lecture 24 : Collections King Fahd University of Petroleum & Minerals College of Computer.
Unit 071 Review of Applets Learning Outcomes oDistinguish between Java Applications and Java Applets. oWrite applet programs that can load images and play.
CS1110: Computer Science I Chapter 5 Arrays. One-dimensional Arrays int [] data = new int [4]; data[0] = 1; data[1] = 3; data[2] = 5; data[3] = 7; Arrays.
Exercise 1 - Poisson Image completion using Discrete Poisson Linear Systems.
CMPUT 301: Lecture 04 Practical OO constructs & UML Lecturer: Martin Jagersand Department of Computing Science University of Alberta Notes based on previous.
Introduction to Arrays CSC 1401: Introduction to Programming with Java Week 10 – Lecture 1 Wanda M. Kunkle.
Java Review Structure of a graphics program. Computer Graphics and User Interfaces Java is Object-Oriented A program uses objects to model the solution.
School of Engineering and Computer Science Victoria University of Wellington Copyright: Peter Andreae, VUW Images and 2D Graphics COMP # 16.
03/16/ What is an Array?... An array is an object that stores list of items. Each slot of an array holds an individual element. Characteristics.
Principles of Computer Programming (using Java) Review Haidong Xue Summer 2011, at GSU.
Object-Oriented Programming in Java. Object-Oriented Programming Objects are the basic building blocks in an O-O program. – A program consists of one.
Image Buffer Ku-Yaw Chang Assistant Professor, Department of Computer Science and Information Engineering Da-Yeh University.
Internet Software Development Applets Paul J Krause.
PROGARMMING THROUGH JAVA Presentation on IMAGES Group No:3 Presented By: Anthony Narzary (DC2012MCA0002) Chandra Gupta Bora (DC2012MCA0009) Dipankar Saikia.
Computer Science 101 Images in Web Pages. Image Files Two common formats, GIF and JPEG GIF images are more flexible for use as icons JPEG images are sharper.
A brief introduction to javadoc and doxygen Cont’d.
ImageJ EE4H, M.Sc Computer Vision Dr. Mike Spann
Image processing with Java - 2D cont’d. Overview  An imaging model that supports the manipulation of fixed- resolution images stored in memory.  A new.
Graphics Copyright © 2015 by Maria Litvin, Gary Litvin, and Skylight Publishing. All rights reserved. Java Methods Object-Oriented Programming and Data.
CS-2852 Data Structures LECTURE 7A Andrew J. Wozniewicz Image copyright © 2010 andyjphoto.com.
Image Processing in MapReduce. The Problem Image processing involves the application of some operation on an Image – Images are typically represented.
CSC1401 Classes - 1. Learning Goals Computing concepts Identifying objects and classes Declaring a class Declaring fields Default field values.
2D Graphics: Advanced Topics Chapter 4. Bird’s Eye View  Overview of Computer Graphics  2D Graphics: Basics  2D Graphics: Rendering Details  2D Graphics:
CSE 219 Computer Science III Image Manipulation. HW 1 Has been posted on Blackboard Making a Game of Life with limited.
Copyright © Curt Hill Multiple Dimension Arrays Extending Java Arrays.
NestedLoops-Mody7-part51 Two-Dimensional Arrays and Nested Loops – part 5 Rotations Barb Ericson Georgia Institute of Technology May 2007.
1 Sung-Ju Kang Department of Physics Kangwon National University Basic Concept of The Computer Graphic. For the investigation of the physical problem by.
A brief introduction to doxygen. What does a compiler do?  A compiler ignores comments and processes the code.  What does doxygen do? –It ignores the.
Graphics and Java2D Chapter Java Coordinate System Origin is in _____________ corner –Behind title bar of window X values increase to the ________.
Peter Andreae Computer Science Victoria University of Wellington Copyright: Peter Andreae, Victoria University of Wellington Types and Interfaces COMP.
Methods.
Grouping Data Together Often we want to group together a number of values or objects to be treated in the same way e.g. names of students in a tutorial.
JAVA: An Introduction to Problem Solving & Programming, 7 th Ed. By Walter Savitch ISBN © 2015 Pearson Education, Inc., Upper Saddle River,
Java 2D Image Manipulation A Brief Overview Ziv Yaniv.
Chapter 9 Nested Loops and Two-Dimensional Arrays Lecture Slides to Accompany An Introduction to Computer Science Using Java (2nd Edition) by S.N. Kamin,
BIS 219 Final Exam 6 Sets Check this A+ tutorial guideline at 219/BIS-219-Final-Exam-Guides For more classes visit.
BIS 219 Week 1 Individual Information Systems and Organizational Departments Check this A+ tutorial guideline at 219/BIS-219-Week-1-Individual-Information-
BIS 220 Introduction to Computer Application and Systems Check this A+ tutorial guideline at 220/BIS-220-Complete-Class-Guide.
Images and 2D Graphics COMP
University of Central Florida COP 3330 Object Oriented Programming
A brief introduction to doxygen
null, true, and false are also reserved.
Cs212: DataStructures Computer Science Department Lab 3 : Recursion.
class PrintOnetoTen { public static void main(String args[]) {
The Image The pixels in the image The mask The resulting image 255 X
INTERFACES Explained By: Sarbjit Kaur. Lecturer, Department of Computer Application, PGG.C.G., Sector: 42, Chandigarh.
Presentation transcript:

Manipulating and Displaying Images in Java Lihang Ying Department of Computing Science University of Alberta, Canada

Display an image Image img = getImage(getURL("images/test.jpg")); BufferedImage bi = new BufferedImage(iw, ih, BufferedImage.TYPE_INT_RGB); Graphics2D big = bi.createGraphics(); big.drawImage(img,0,x,y);

Manipulate pixels Class BufferedImage int getRGB(int x, int y)getRGB void setRGB(int x, int y, int rgb)setRGB void setData(Raster r) Sets a rectangular region of the image to the contents of the specified Raster r.setDataRaster Class WritableRaster extend Raster A class representing a rectangular array of pixels. voidsetPixel(int x, int y, float[] fArray)setPixel …

Image-filter operations(1)

Image-Filter Operations(2) public static final float[] SHARPEN3x3 = { 0.f, -1.f, 0.f, -1.f, 5.0f, -1.f, 0.f, -1.f, 0.f}; BufferedImage dstbimg = new BufferedImage(iw,ih,BufferedImage.TYPE_INT_R GB); Kernel kernel = new Kernel(3,3,SHARPEN3x3); ConvolveOp cop = new ConvolveOp(kernel, ConvolveOp.EDGE_NO_OP, null); cop.filter(srcbimg,dstbimg);

References Tutorial image.fm.html# image.fm.html#65661 Java API mage/BufferedImage.html mage/BufferedImage.html mage/Raster.html mage/Raster.html