Reading and Writing Image Files

Slides:



Advertisements
Similar presentations
MATLAB – A Computational Methods By Rohit Khokher Department of Computer Science, Sharda University, Greater Noida, India MATLAB – A Computational Methods.
Advertisements

ParaView Tutorial Greg Johnson, Karla Vega. Before we begin… Make sure you have ParaView installed so you can follow along in the lab section –
DATA RETRIEVAL AND GUI CREATION DAVID COOPER SUMMER 2014.
Create slices and hotspots Create links in Web pages Create rollovers from slices Create basic animation Add tweening symbol instances to create animation.
Graphics and Still Images John H. Krantz Hanover College.
Introduction to Macromedia Flash 8
Adobe Photoshop 6 Advanced Level Course. Easy Fixes Photoshop is the best tool to fix old, torn and faded photographs, and can fix almost all flaws in.
MATLAB Week 3 17 November Outline Graphics – Basic plotting – Editing plots from GUI – Editing plots from m-file – Advanced plotting commands.
Informationsteknologi Tuesday, November 6, 2007Computer Graphics - Class 41 Today’s class Input and interaction.
1 Flash and Animation Presented by : Behzad Sajed Khosrowshahi.
© 2011 Delmar, Cengage Learning Chapter 8 Building Complex Animations.
1 An Introduction to TI SmartView Emulator Software (Version 2.0) Jim Eiting Developmental Mathematics Department Collin County Community College August.
Graphics: Creating Images Chapter 8, Exploring the Digital Domain.
Creating a MagicInfo Pro Screen Template
1 Perception, Illusion and VR HNRS 299, Spring 2008 Lecture 19 Other Graphics Considerations Review.
PLOTS AND FIGURES DAVID COOPER SUMMER Plots One of the primary uses for MATLAB is to be able to create publication quality figures from you data.
ENG College of Engineering Engineering Education Innovation Center 1 2D Plots 1 in MATLAB Topics Covered: 1.Plotting basic 2-D plots The plot()
Matlab tutorial course Lesson 5: Loading and writing data, producing visual output
Objectives Understand what MATLAB is and why it is widely used in engineering and science Start the MATLAB program and solve simple problems in the command.
© 2012 Adobe Systems Incorporated. All Rights Reserved. Copyright 2012 Adobe Systems Incorporated. All rights reserved. ® INTRODUCTION TO FLASH ANIMATION.
Introduction to Arrays. definitions and things to consider… This presentation is designed to give a simple demonstration of array and object visualizations.
XP Tutorial 1 Introduction to Macromedia Flash MX 2004.
CMPS 1371 Introduction to Computing for Engineers MatLab.
2006 Adobe Systems Incorporated. All Rights Reserved. 1 INTRODUCTION TO ADOBE FLASH CS3.
Introduction MATLAB stands for MATrix LABoratory.  Basics  Matrix Manipulations  MATLAB Programming  Graphics  Image types  Image Processing  Useful.
MATLAB for Engineers 4E, by Holly Moore. © 2014 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved. This material is protected by Copyright.
Adobe Photoshop CS3 Revealed – Chapter 16 FOR THE WEB CREATING IMAGES.
Introduction to Matlab & Data Analysis 2015 In this tutorial we will: Build a practical application using GUIDE Learn more about graphical user interface.
Chapter 6 Review: User Defined Functions Introduction to MATLAB 7 Engineering 161.
Recap Plots with More than one Line Plots of Complex Arrays Line, Color and Mark Style Axis Scaling and Annotating Plots Subplots Polar Plots Logarithmic.
Visualization with ParaView. Before we begin… Make sure you have ParaView 3.14 installed so you can follow along in the lab section –
Photoshop Actions Lights, Camera, Actions in Photoshop.
Introduction to Programming on MATLAB Ecological Modeling Course Sep 11th, 2006.
An Introduction to Programming in Matlab Emily Blumenthal
Beginning Programming for Engineers Animation. Special matrix functions >> clear >> ones(2,3) >> zeros(3,5) >> ones(2) >> zeros(3) >> eye(4) >> magic(4)
Introducing Macromedia Flash 8
OVERVIEW Objectives Follow a design document to prepare images for inclusion in a Web page Run a batch process to prepare multiple images in one step Use.
Microsoft Office Illustrated
GIF or Not GIF? Use GIF for animation:
Composition.
2D Graphics and Animations in Unity 3D
EEC-693/793 Applied Computer Vision with Depth Cameras
Flash Interface, Commands and Functions
Matlab Training Session 4: Control, Flow and Functions
Plotting Chapter 5.
Lecture 25.
Introducing Blender.
Chapter Lessons Understand the Macromedia Flash workspace
Introduction to Basic Interface of
Ch3 Graphics Overview of Plotting Editing Plots
Lecture 25: Exploring data
Two-Dimensional Plots
Microsoft PowerPoint 2003 Illustrated Introductory
Introducing Blender.
More on Graphical User Interfaces
MATLAB DENC 2533 ECADD LAB 9.
Introducing Blender.
Exercise 63 Use a Flash movie clip symbol to store an animation that you need to use more than once in an application. This is very important for keeping.
INTRODUCTION TO ADOBE FLASH CS4
MATLAB How to use (using M-files) Double click this icon
MATLAB – What Is It ? Name is from matrix laboratory Powerful tool for
MATLAB How to use (using M-files) Double click this icon
INTRODUCTION TO FLASH ANIMATION
Digital Image Processing
Computer Graphics 4Practical Lesson
MATLAB stands for MATrix LABoratory.
GIF or Not GIF? Use GIF for animation:
Exercise 64 Use the Flash Movie Explorer to examine the contents of an application to quickly locate specific elements such as instances. Use the Movie.
The Web Collection Standard CS3 Revealed
Presentation transcript:

Reading and Writing Image Files We’ve explored several options for reading in image information MATLAB also supports functions to write images to a number of different formats

Reading Image Information Interactive Import Wizard Easiest Simply double click the file name from the current directory MATLAB will suggest appropriate variable names The matrices are available in the edit window for preview

The downside… The problem with interactively importing any data is that you can’t include the instructions in a MATLAB program We need one of the import functions Most standard images can be read in using imread

Use load for .mat .dat load cape

Image created by loading a built in file

Storing Image Information Use the file menu File-> Save as… Most of the common formats are supported

This image of a Mandelbrot is being saved as an enhanced metafile

imwrite This function can also be used to store image data in a number of different formats The input depends on the image type Intensity (grayscale) True color Indexed – requires an array plus a colormap

Section 14.2 Handle Graphics A handle is a “nickname” given to an object in MATLAB We can assign a handle to Individual plots The figure window The axis on which we draw the plots

Figure User Interfaces Axes Annotation axes Core Objects Plot Objects Group Objects MATLAB uses a hierarchical system for organizing plotting information

Figure User Interfaces Axes Annotation axes Core Objects Plot Objects Group Objects The basic plotting object is the figure. The figure can contain a number of different objects

Figure User Interfaces Axes Annotation axes Core Objects Plot Objects Group Objects The axes are contained inside the figure. Think of the axes as being layered on top of the figure window . The axes also can contain a number of different objects .

Figure User Interfaces Axes Annotation axes Core Objects Plot Objects Group Objects A plot is drawn on top of the axes.

Anatomy of a graph Figure Axes layered on top of the figure Plot drawn on the axes

When you use a plot function… MATLAB automatically creates a figure an appropriate axis draws the graph (plot) on the axis MATLAB uses default values for many of the plot object properties. For example the first line drawn is always blue, unless the user specifically changes it.

Plot Handles Assigning a plot a name (or a handle) allows us to easily ask MATLAB to list the plot object properties

h is the plot handle

h is the plot handle in this example The color property specifies the line color – in this case blue The get function returns a list of the object (in this case a plot) properties For example, the LineWidth property is set to 0.500

Figure Handles We can also specify a handle name for the figure window

The color property specifies the background color in the figure window – in this case gray F_handle is the figure handle in this example A figure window has a lot of properties

If we haven’t specified a handle name, we can ask MATLAB to determine the current figure with the gcf command (get current figure) get(f_handle) and get(gcf) return the same results in this example

Axis Handles Just as we can assign a handle to the figure window and the plot itself, we can assign a handle to the axis using the gca function (get current axis ) for example h_axis = gca

h_axis is the name of the axis upon which the plot is drawn in this example

Annotation Axes In addition there is a transparent layer added to the plot, used for annotation objects, such as: lines legends text boxes

What good is all this information? Use the set function to change the object properties Set requires at least three inputs object handle (plot, figure or axis) property name a new property value

Property Editor You can accomplish the same thing interactively using the property editor and the property inspector

Interactive Property Editing

14.3 Animation There are two techniques for creating an animation in MATLAB redrawing and erasing creating a movie We use handle graphics in each case to create the animation

Redrawing and Erasing To create an animation by redrawing and erasing you first create a plot then adjust the properties of the graph each time through a loop

Consider this equation for a set of parabolas Each value of k defines a different parabola We could represent this data with a three dimensional plot Or we could create an animation where we draw a series of graphs, each with a different value of k

Animation works by redrawing the graph multiple times.

M-file to animate the equation of a parabola

In this example we… used the XData and YData objects from the plot These objects assign the data points to be plotted Using the set function allows us to specify new x and y values, and to create a different graph every time the drawnow function is called

In the program notice the line… %set(h,'EraseMode','xor') If you activate this line by removing the comment operator (%) the program does not erase the entire graph each time the graph is redrawn. Only pixels that change color are changed. This makes the animation run faster, a characteristic that is important when the plot is more complicated than the simple parabola used in this example. Refer to the help tutorial for an example animation modeling Brownian Motion.

Movies Animating the motion of a line is not computationally intensive, and it’s easy to get nice smooth movement Animating the motion of a surface plot is more complicated and correspondingly more computationally intensive

The animation of this figure moves up and down - something like a wave – and takes a lot of computational power

This file creates an animation of the surface plot, which runs quite slowly.

This file creates and stores a movie of the animation This file creates and stores a movie of the animation. You can play the movie again with the movie function

Movies are saved in a structure array, such the M array shown in this figure

Example 14.2 illustrates how to create a movie by zooming in on a Mandelbrot image. Because this process is quite computationally intensive, it’s a good idea to try it out with a low resolution mandelbrot image first

This series of Mandelbrot images is a selection of the frames captured to create the movie. Each movie will be different, since it zooms in on a different point on the image.

14.4 Other Visualization Techniques Transparency Hidden Lines Lighting

First a small sphere was plotted Adding transparency to a surface plot makes it possible to see hidden details. First a small sphere was plotted Then a second, larger sphere was plotted on top, obscuring the original sphere The alpha function was used to create a transparent surface alpha(0.5)

Mesh plots do not show mesh lines that would be obscured by a solid figure The hidden off command forces the program to draw the hidden lines.

The default lighting is diffuse When the camlight command is issued a spot light is modeled, located at the camera position

14.5 Introduction to Volume Visualization Volume visualization of scalar data (where the data collected or calculated is a single value at each point, such as temperature) Volume visualization of vector data (where the data collected or calculated is a vector, such as velocity)

MATLAB includes visualization techniques used with three dimensional data. This is a contourslice of MRI data using the sample data file included with MATLAB

Isosurface of flow data using the sample m-file included with MATLAB

Contour slices of the wind speed data included with the MATLAB program.

Cone plot of the wind velocity data included with the MATLAB program.