Introduction to Programming in MATLAB Intro. MATLAB Peer Instruction Lecture Slides by Dr. Cynthia Lee, UCSD is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike.

Slides:



Advertisements
Similar presentations
Watercolor Effect in Photoshop Tutorial. Go to the File, click the Open tab and set your canvas of 1920 X 1200 pixels, in RGB mode.
Advertisements

Introduction to PowerPoint
Introducing DFA Formal Description Using Peer Instruction Cynthia Bailey Lee UCSD 2011 Theory of Computation Peer Instruction Lecture Slides by Dr. Cynthia.
Introduction to Programming
Introduction to Programming in MATLAB Intro. MATLAB Peer Instruction Lecture Slides by Dr. Cynthia Lee, UCSD is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike.
Instructions for using templates 1. Resave file Open the template and resave the file with a new name 2. Title slide Decide which title slide to use. Either.
THE PUMPING LEMMA PROVING A LANGUAGE IS NOT REGULAR Dr. Cynthia Lee - UCSD - Spring 2011 Theory of Computation Peer Instruction Lecture Slides by Dr. Cynthia.
Introduction to Programming in MATLAB Intro. MATLAB Peer Instruction Lecture Slides by Dr. Cynthia Lee, UCSD is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike.
How to Add an Animated Image. Search Google Images for an “animated gif”
Study Guide Commercial Photography Technology
CSC 461: Lecture 51 CSC461 Lecture 5: Simple OpenGL Program Objectives: Discuss a simple program Discuss a simple program Introduce the OpenGL program.
© Anselm Spoerri Lecture 11 Flash –Build Flash Website with Animated Navigation Structure –Decide on Overall Navigation Layout, Import Images & Organize.
Start -> All Programs -> Classes -> Web Expressions -> Dreamweaver.
Theory of Computation 1 Theory of Computation Peer Instruction Lecture Slides by Dr. Cynthia Lee, UCSD are licensed under a Creative Commons Attribution-NonCommercial-ShareAlike.
Lesson Design Template for Teaching with Visualization IIT Bombay January, 2015.
Introduction to Power Point
Exercise : Animated Navigation Structure in Flash 1.Develop Answers to “What did you learn in ITI program?” “What do you have to offer?” “What are your.
PowerPoint Practice Highlight this text and type your name.
Theory of Computation 1 Theory of Computation Peer Instruction Lecture Slides by Dr. Cynthia Lee, UCSD are licensed under a Creative Commons Attribution-NonCommercial-ShareAlike.
Theory of Computation 1 Theory of Computation Peer Instruction Lecture Slides by Dr. Cynthia Lee, UCSD are licensed under a Creative Commons Attribution-NonCommercial-ShareAlike.
Introduction to Programming in MATLAB Intro. MATLAB Peer Instruction Lecture Slides by Dr. Cynthia Lee, UCSD is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike.
POWER POINT PRESENTATIONS. Getting Started Click Start Point to Programs Pick PowerPoint Shortcut on Desk Top.
ELPSS RLO Scripting Templates VERSION 3 (Jan 09).
Log In to your User Start: Photoshop Elements. Start a new document 700x120 pixels with white background. Create a new layer by clicking Layer -> New.
Introduction to Programming in MATLAB Intro. MATLAB Peer Instruction Lecture Slides by Dr. Cynthia Lee, UCSD is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike.
Lecture 15: Intro to Graphics Yoni Fridman 7/25/01 7/25/01.
A guide to creating a power point display Essentials Ctl M =New Slide: a new slide can be inserted. It is placed after the slide that you are viewing.
Subheading Insert text here as much as is needed. Try to maintain the format. Specifically, the second word in a subheading should not be capitalized.
Introduction to Programming in MATLAB Intro. MATLAB Peer Instruction Lecture Slides by Dr. Cynthia Lee, UCSD is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike.
Tutorial: Reduction from A TM Proofs Dr. Cynthia Lee CSE 105, UCSD Spring 2011 Theory of Computation Peer Instruction Lecture Slides by Dr. Cynthia Lee,
Introduction to Programming in MATLAB Intro. MATLAB Peer Instruction Lecture Slides by Dr. Cynthia Lee, UCSD is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike.
Creating a navigation bar in Fireworks. Setting up the canvas Open Fireworks and choose a canvas size big enough to fit the buttons on you are going to.
Pink Panther Spotlight PowerPoint Dr Hutchinson, Martin Levine and George Swanson Chesterton Community College Cambridge CB4 3NY.
Lesson Design Template for Teaching with Visualization IIT Bombay January, 2015.
How to Make a Power Point. How to Open Power Point Go to the bottom of the screen Click on START PROGRAMS MICROSOFT WORD PROGRAMS MICROSOFT OFFICE POWER.
Lesson Design Template for Teaching with Visualization
Introduction to Microsoft Word 2010 This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.Creative Commons.
Multimedia Authoring1 Image Manipulation Software Image Manipulation As Images are such an important part of Multimedia presentations you are going to.
Introduction to Programming in MATLAB Intro. MATLAB Peer Instruction Lecture Slides by Dr. Cynthia Lee, UCSD is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike.
Introduction to Programming in MATLAB Intro. MATLAB Peer Instruction Lecture Slides by Dr. Cynthia Lee, UCSD is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike.
Introduction to Microsoft Word 2010 This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.Creative Commons.
Pinnacle Pro Painting Program User Manual Created by: David Kwasny Chris Schulz W. Scott DePouw.
Creating Ilfracombe Arts College Banner By: Ben Renton BTEC ICT Level 3.
LING 408/508: Programming for Linguists Online Lecture 7 September 16 th.
Licensed under Creative Commons Attribution – ShareAlike 4.0 International Building Slide Decks.
Tips for Preparing a Professional Presentation. The first thing that gives a professional touch to any presentation is the design.
Edit the text off the left side of the slide with your own phrase. The animation is already done for you; just copy and paste the slide into your existing.
Introduction to Programming in MATLAB
Introduction to Programming in MATLAB
TITLE Author Center Country
Please use following slides to make your presentations
Re-Designing Ilfracombe Arts College Logo
x IMPORTANT: read before building your presentation:
PRESENTATION LAYOUTS This is a title slide
Start: Photoshop Elements
Instructions The first time you open this template, immediately save the file by another name as a PowerPoint Presentation (.pptx), not as a PowerPoint.
DWCS2 Version UP Please place the farm files in the SD card directly under. Start the DWCS2, that Please insert the SD card. Please by pressing the.
Introduction to Programming in MATLAB
Introduction to Programming in MATLAB
Tips for Preparing a Professional Presentation
Images must be high quality (not stretched to be larger)
Images must be high quality (not stretched to be larger)
Images must be high quality (not stretched to be larger)
Images must be high quality (not stretched to be larger)
Images must be high quality (not stretched to be larger)
Images must be high quality (not stretched to be larger)
Legacy PowerPoint Slides
Images must be high quality (not stretched to be larger)
Please read the notes for this slide before completing your poster.
Presentation transcript:

Introduction to Programming in MATLAB Intro. MATLAB Peer Instruction Lecture Slides by Dr. Cynthia Lee, UCSD is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. Based on a work at Cynthia Lee, UCSDCreative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported Licensewww.peerinstruction4cs.org 1

LOOPS: ANIMATION WITH LOOPS 2

Write a loop that displays all six bird images in order % script: AnimateBird bird1 = imread(‘bird1.jpg’); bird2 = imread(‘bird2.jpg’); bird3 = imread(‘bird3.jpg’); bird4 = imread(‘bird4.jpg’); bird5 = imread(‘bird5.jpg’); bird6 = imread(‘bird6.jpg’); birds = cat(4,bird1,bird2,bird3,bird4,bird5,bird6); for i = 1:6 imshow(birds(:,:,:,i)); drawnow; end 3

[NOT A SLIDE: raw images] 4 This is a container for these image files from the example. Please use your own NOT these! And then you would change the text of the slides in this lecture to have filenames that make sense for YOUR example. But these give you an idea of what kind/size images I was using for this example.

Greenscreen a small image (bird) onto a large background (Zion Natl. Park) function [zion] = PasteBirdonBackground(bird,zion) % create a white canvas the size of the background largecanvas = uint8(zeros(size(zion))); % canvas is all black, same size as zion image largecanvas = 255-largecanvas; % change to all white % paste the bird into the top left corner of the canvas ?????? % select only the bird part of the canvas filter = largecanvas(:,:,1) < 30; filter = cat(3,filter,filter,filter); % greenscreen zion(filter) = largecanvas(filter); end a)largecanvas(1:end,1:end,:) = bird(1:end,1:end,:); b)largecanvas(1:size(bird,1),1:size(bird,2),:) = bird; c)largecanvas = bird; d)Other/none/more than one e)I don’t know!!

Animate a small image (bird) on a large background (Zion Natl. Park) % script: AnimateBird zion = imread(‘zion.jpg’); bird1 = imread(‘bird1.jpg’); bird2 = imread(‘bird2.jpg’); bird3 = imread(‘bird3.jpg’); bird4 = imread(‘bird4.jpg’); bird5 = imread(‘bird5.jpg’); bird6 = imread(‘bird6.jpg’); birds = cat(4,bird1,bird2,bird3,bird4,bird5,bird6); for i = 1:6 bird = birds(:,:,:,i); imshow(PasteBirdonBackground(bird,zion)); % this function on previous slide drawnow; end

Greenscreen a small image (bird) across a large background (Zion Natl. Park) function [zion] = PasteBirdonBackground(bird,zion) % create a white canvas the size of the background largecanvas = uint8(zeros(size(zion))); % canvas is all black, same size as zion image largecanvas = 255-largecanvas; % change to all white % paste the bird 10 PIXELS TO THE RIGHT OF the top left corner of the canvas ?????? % select only the bird part of the canvas filter = largeanvas(:,:,1) < 30; filter = cat(3,filter,filter,filter); % greenscreen zion(filter) = largecanvas(filter); end a)largecanvas(1+10:size(bird,1)+10,1+10:size(bird,2)+10,:) = bird; b)largecanvas(1:size(bird,1),1+10:size(bird,2)+10,:) = bird; c)largecanvas(1+10:size(bird,1)+10,1:size(bird,2),:) = bird; d)Other/none/more than one e)I don’t know!!

Greenscreen a small image (bird) across a large background (Zion Natl. Park) function [zion] = PasteBirdonBackground(bird,zion,offset) % create a white canvas the size of the background largecanvas = uint8(zeros(size(zion))); % canvas is all black, same size as zion image largecanvas = 255-largecanvas; % change to all white % paste the bird “OFFSET” PIXELS TO THE RIGHT OF the top left corner of the canvas largecanvas(1+offset:size(bird,1)+offset,1:size(bird,2),:) = bird; % select only the bird part of the canvas filter = largeanvas(:,:,1) < 30; filter = cat(3,filter,filter,filter); % greenscreen zion(filter) = largecanvas(filter); end Add an “offset” argument to the function, so we can decide how far to the right we want to paste.

Move a small image (bird) across a large background (Zion Natl. Park) % script: AnimateBird zion = imread(‘zion.jpg’); bird = imread(‘bird1.jpg’); for offset = ?????? imshow(PasteBirdonBackground(bird,zion,offset)); drawnow; end Goal: ZION BIRD a)0:size(bird,2) b)0:size(zion,2) c)0:size(zion,2) + size(bird,2) d)0:size(zion,2) – size(bird,2) e)Other/none/more than one/I don’t know!! Use “offset” version of the function—on previous slide—so we can specify different offsets to make the bird move.