Multimedia Programming 12: Mouse, Draw and Morphing2 Departments of Digital Contents Sang Il Park.

Slides:



Advertisements
Similar presentations
For(int i = 1; i
Advertisements

Class 15 - Overhead 11Object Oriented Programming Using C #define t_circle 1 #define t_rectangle 2 struct circle_shape {short type; double x,y; double.
Computer Graphics Tz-Huan Huang National Taiwan University (Slides are based on Prof. Chen’s)
Lecture # 11 JavaScript Graphics. Scalable Vector Graphics (SVG) Scalable Vector Graphics (SVG), as the name implies, are - scalable (without pixelation):
Chapter 5 Creating an Image Map.
Objective: Use slope-intercept form and standard form to graph equations. 2.4 Quick Graphs of Linear Equations.
5.2 Trigonometric Functions: Unit Circle Approach.
Sullivan Precalculus: Section 5.2 Trig Functions: Unit Circle
Quick graphs using Intercepts 4.3 Objective 1 – Find the intercepts of the graph of a linear equation Objective 2 – Use intercepts to make a quick graph.
Mouse Events and Keyboard Events
C++ Graphics Primitives April 15th. void clearscreen(int c) –clear the screen to background color c –If c = 1 screen black.
Abstraction: Polymorphism, pt. 1 Abstracting Objects.
Perimeter Rectangles, Squares, and Triangles Perimeter Measures the distance around the edge of any flat object. To find the perimeter of any figure,
Special Right Triangles
10.7 Write and Graph Equations of Circles Hubarth Geometry.
ARC, BAR AND CIRCLE FUNCTIONS IN C++ The presentation defines the usage of the functions shown above OBJECT ORIENTED PROGRAMMING IN C++ BY: MUHAMMAD DANIYAL.
10.6 Equations of Circles Advanced Geometry. What do you need to find the equation of a circle? Coordinates of the Center of the circle. Radius – Distance.
Using Graphics Libraries Lecture 3 Mon, Sep 1, 2003.
Events and Coordinates Lecture 5 Fri, Sep 5, 2003.
Detect Candle.  Open VC++ Directories configuration: Tools > Options > Projects and Solutions > VC++ Directories  Choose "Show directories for: Include.
Graphics and Multimedia Part #2
Multimedia Programming 02: Play with Images Departments of Digital Contents Sang Il Park.
Systems of Inequalities. Graphing a Linear Inequality in Two Variables 1.Replace the inequality symbol with an equal sign and graph the corresponding.
Overview of Previous Lesson(s) Over View  Visual C++ provides us with 3 basic ways of creating an interactive Windows application  Using the Windows.
Multimedia Programming 03: Point Processing Departments of Digital Contents Sang Il Park.
FLTK Help Session By Richard Yu Gu CS 638 -Graphics Fall, 1999.
The Coordinate Plane The coordinate plane is formed when two number lines (called axis) intersect at right angles. The horizontal axis is called the x-axis.
EZYFLO. Aim of EZYFLO To draw simple flowcharts To reduce the memory size of the flowchart To create a software which runs in DOS environment also.
Image Processing 主講人:虞台文. Content Smoothing Image Morphology Some Applications of Image Morphology Flood Fill Resize Image Pyramids Threshold.
1.8 Circles.
Multimedia Programming 13: Review and term project Departments of Digital Contents Sang Il Park.
Introduction of OpenCV Alireza Shirani Researcher of Medical Image and Signal Processing M. S Electrical Engineering yahoo. com Spring.
Introduction to AutoCAD Engineering Drawings
Multimedia Programming 26: Playing with Video
EXAMPLE 1 Graph the equation of a translated circle Graph (x – 2) 2 + (y + 3) 2 = 9. SOLUTION STEP 1 Compare the given equation to the standard form of.
Some Graphics CS303E: Elements of Computers and Programming.
Section 11-4: Areas of Regular Polygons and Composite Figures
Object Oriented Programming A new way of thinking.
Getting to Know OpenCV 主講人:虞台文. Content Basic Structures Arrays, Matrices, and Images Matrix and Image Operators Drawing Things Drawing Text Data Persistence.
Warm up: 1.Write a definition: m = Compute the slope of a line through: 2. (2, -4) and (3, 5)  m = 3.(0, 5) and (2, 9)  m = 4.(-8, 1) and (4, 1)  m.
Multimedia Programming 07: Image Warping Keyframe Animation Departments of Digital Contents Sang Il Park.
1 Mapping Coordinates Find the x- and y- coordinates for the images, relative to the x-axis and y-axis In a coordinate pair, the first number is the x-coordinate.
Multimedia Programming 04: 점, 선, 면
The Circle. Examples (1) – (5) Determine the center and radius of the circle having the given equation. Identify four points of the circle.
Warm-Up Determine the coordinates of each point in the graph below. y
Project 2 Function Plotter Mon, Sep 22, 2003 Due Mon, Sep 29, 2003.
School of Computing and Information Systems RIA Animation, part I.
Midterm: Question 1 (35%) (30 minutes) Write an assembly program to draw a rectangle. – (5%) Show a message to ask for information of the rectangle – (5%)
Multimedia Programming 10: Image Morphing
Equations of Circles. You can write an equation of a circle in a coordinate plane, if you know: Its radius The coordinates of its center.
Processing Variables. Variables Processing gives us several variables to play with These variables are always being updated and you can assume they have.
- draw a diameter - make a radius - join diameter and radius -join other end of diameter and radius - put in any angle for one of the angles formed - fill.
Chapter 14 Timers and Idle Processing Department of Digital Contents Sang Il Park.
VG101 RECITATION 5 By TAs. CONTENTS How to read Vg101Class.h Samples about graphics About assignment 5 Array.
Equation of a Circle. Equation Where the center of the circle is (h, k) and r is the radius.
13.1 The Distance Formulas. Review of Graphs Coordinate Plane.
Multimedia Programming 10: Mouse, Draw and Morphing Departments of Digital Contents Sang Il Park.
  Where the center of the circle is (h, k) and r is the radius. Equation.
July FLTK The Fast Light Toolkit • A C++ graphical user interface toolkit • Can be used under X, Windows, MacOS • Supports OpenGL • Provides: – Interactive.
EXAMPLE 1 Graph the equation of a translated circle
Estimating Sums and Differences of Decimals
Control structures Chapter 3.
Drawing Two-Dimensional Shapes with Digital Technology
Lesson 17: Building an App: Canvas Painter
Pointers & Functions.
Structure.
All About Shapes! Let’s Go!.
Class 7 coordinates: pixel and with setCoords aspect ratio Rectangle
Pointers & Functions.
Presentation transcript:

Multimedia Programming 12: Mouse, Draw and Morphing2 Departments of Digital Contents Sang Il Park

Outline Review Various Drawing Morphing

Mouse Callback in OpenCV Mouse Interaction with OpenCV

Mouse Callback Two things you have to do: –Implementation Define what you are going to do when events happen –Setting (registration) Let the OpenCV know which one is the callback function void cvSetMouseCallback(window_name, yourFunction) void yourFunction (int event, int x, int y, int flags, void *param);

Implementation Message from the OpenCV Telling what kind of the mouse event is coming Examples) CV_EVENT_MOUSEMOVE CV_EVENT_LBUTTONDOWN CV_EVENT_RBUTTONDOWN CV_EVENT_MBUTTONDOWN CV_EVENT_LBUTTONUP CV_EVENT_RBUTTONUP CV_EVENT_MBUTTONUP CV_EVENT_LBUTTONDBLCLK CV_EVENT_RBUTTONDBLCLK CV_EVENT_MBUTTONDBLCLK void yourFunction (int event, int x, int y, int flags, void *param);

Implementation Message from the OpenCV Telling the status of the mouse or the keyboard Examples) CV_EVENT_FLAG_LBUTTON CV_EVENT_FLAG_RBUTTON CV_EVENT_FLAG_MBUTTON CV_EVENT_FLAG_CTRLKEY CV_EVENT_FLAG_SHIFTKEY CV_EVENT_FLAG_ALTKEY void yourFunction (int event, int x, int y, int flags, void *param);

Registration Example) cvSetMouseCallback( “test”, on_mouse); void cvSetMouseCallback(window_name, yourFunction)

Draw Line void cvLine( IplImage, CvPoint pt1, CvPoint pt2, CvScalar color, int thickness=1); Draw Line from pt1 to pt2 with the given thickness CvPoint: a structure for storing 2D position –Use cvPoint(x,y) for a quick usage. struct CvPoint { int x; // x-coordinate int y; // y-coordinate } struct CvPoint { int x; // x-coordinate int y; // y-coordinate }

Draw Rectangle void cvRectangle( IplImage, CvPoint pt1, CvPoint pt2, CvScalar color, int thickness=1 ) void cvRectangle( IplImage, CvPoint pt1, CvPoint pt2, CvScalar color, int thickness=1 ) Draw a rectangle with two opposite corners pt1 and pt2 pt1 pt2 What happens if thickness is -1?

Draw Circle void cvCircle( IplImage, CvPoint center, int radius, CvScalar color, int thickness=1 ) void cvCircle( IplImage, CvPoint center, int radius, CvScalar color, int thickness=1 ) Draw a circle with given center and radius center radius

Basic Morphing with Mouse Moving one point to the other

Basic Morphing with Mouse Moving one point to the other

Basic Morphing with Mouse Moving one point to the other

Linear Interpolation 1-αα α 고정이동 ?

Basic Morphing with Mouse Moving one point to the other

? Basic Morphing with Mouse Moving one point to the other

Basic Morphing with Mouse Moving one point to the other

? Basic Morphing with Mouse Moving one point to the other

Bilinear interpolation Sampling at f(x,y): displacement at (x,y)

중간고사 10 월 16 일 ( 화요일 ) 저녁 7 시 ???? 필기고사 – 알고리즘 설명 – 프로그램 틀린 것 찾기 – 프로그램 채우기 – 결과 예측