Multimedia Programming 13: Review and term project Departments of Digital Contents Sang Il Park.

Slides:



Advertisements
Similar presentations
CS 691 Computational Photography Instructor: Gianfranco Doretto Image Warping.
Advertisements

Morphing CSE 590 Computational Photography Tamara Berg.
Multimedia Programming 08: Point Processing 4 Departments of Digital Contents Sang Il Park.
Informationsteknologi Monday, November 12, 2007Computer Graphics - Class 71 Today’s class Viewing transformation Menus Mandelbrot set and pixel drawing.
Image Warping : Computational Photography Alexei Efros, CMU, Fall 2006 Some slides from Steve Seitz
Image Processing : Computational Photography Alexei Efros, CMU, Fall 2006 Some figures from Steve Seitz, and Gonzalez et al.
Lecture 8: Geometric transformations CS4670: Computer Vision Noah Snavely.
Image Warping : Computational Photography Alexei Efros, CMU, Fall 2008 Some slides from Steve Seitz
Image Warping : Computational Photography Alexei Efros, CMU, Fall 2005 Some slides from Steve Seitz
Point Processing : Computational Photography Alexei Efros, CMU, Fall 2008 Some figures from Steve Seitz, and Gonzalez et al.
Image Morphing : Rendering and Image Processing Alexei Efros.
Image Morphing : Computational Photography Alexei Efros, CMU, Fall 2005 © Alexey Tikhonov.
Image Morphing, Triangulation CSE399b, Spring 07 Computer Vision.
Image warping/morphing Digital Video Special Effects Fall /10/17 with slides by Y.Y. Chuang,Richard Szeliski, Steve Seitz and Alexei Efros.
Image Warping Computational Photography Derek Hoiem, University of Illinois 09/27/11 Many slides from Alyosha Efros + Steve Seitz Photo by Sean Carroll.
L.
Image Morphing CSC320: Introduction to Visual Computing
Filtering (I) Dr. Chang Shu COMP 4900C Winter 2008.
OpenCV Open source C omputer V ision library By: Bahare Torkaman Fall 2010.
Image Warping (Szeliski 3.6.1) cs129: Computational Photography James Hays, Brown, Fall 2012 Slides from Alexei Efros and Steve Seitz
SDL Programming Introduction. Initialization 2  The first thing you must do is initialize SDL  int SDL_Init( SDL_INIT_EVERYTHING )  This will return.
CSCE 441: Computer Graphics Image Warping/Morphing Jinxiang Chai.
Module Code: CU0001NI Technical Information on Digital Images Week -2.
Detect Candle.  Open VC++ Directories configuration: Tools > Options > Projects and Solutions > VC++ Directories  Choose "Show directories for: Include.
Multimedia Programming 06: Image Warping Departments of Digital Contents Sang Il Park.
Warping CSE 590 Computational Photography Tamara Berg.
Multimedia Programming 02: Play with Images Departments of Digital Contents Sang Il Park.
Image Warping Computational Photography Derek Hoiem, University of Illinois 09/24/15 Many slides from Alyosha Efros + Steve Seitz Photo by Sean Carroll.
Image warping/morphing Digital Visual Effects Yung-Yu Chuang with slides by Richard Szeliski, Steve Seitz, Tom Funkhouser and Alexei Efros.
Homogeneous Coordinates (Projective Space) Let be a point in Euclidean space Change to homogeneous coordinates: Defined up to scale: Can go back to non-homogeneous.
Point Processing (Szeliski 3.1) cs129: Computational Photography James Hays, Brown, Fall 2012 Some figures from Alexei Efros, Steve Seitz, and Gonzalez.
Multimedia Programming 03: Point Processing Departments of Digital Contents Sang Il Park.
Image Warping Computational Photography Derek Hoiem, University of Illinois 09/23/10 Many slides from Alyosha Efros + Steve Seitz Photo by Sean Carroll.
Addison Wesley is an imprint of © 2010 Pearson Addison-Wesley. All rights reserved. Chapter 5 Working with Images Starting Out with Games & Graphics in.
L. Akshay Masare Piyush Awasthi IMAGE PROCESSING AND OPENCV.
Introduction of OpenCV Alireza Shirani Researcher of Medical Image and Signal Processing M. S Electrical Engineering yahoo. com Spring.
Computational Photography Derek Hoiem, University of Illinois
Image Warping and Morphing cs195g: Computational Photography James Hays, Brown, Spring 2010 © Alexey Tikhonov.
Multimedia Programming 26: Playing with Video
Advanced Multimedia Warping & Morphing Tamara Berg.
CS559: Computer Graphics Lecture 8: Warping, Morphing, 3D Transformation Li Zhang Spring 2010 Most slides borrowed from Yungyu ChuangYungyu Chuang.
Interactive Frequency Filtering Program Geoff Franz.
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
Getting to Know OpenCV 主講人:虞台文. Content Basic Structures Arrays, Matrices, and Images Matrix and Image Operators Drawing Things Drawing Text Data Persistence.
Multimedia Programming 07: Image Warping Keyframe Animation Departments of Digital Contents Sang Il Park.
CS 691B Computational Photography
Multimedia Programming 04: 점, 선, 면
Multimedia Programming 10: Image Morphing
CS559: Computer Graphics Lecture 9: 3D Transformation and Projection Li Zhang Spring 2010 Most slides borrowed from Yungyu ChuangYungyu Chuang.
Recap from Monday DCT and JPEG Point Processing Histogram Normalization Questions: JPEG compression levels Gamma correction.
Image Warping Many slides from Alyosha Efros + Steve Seitz + Derek oeim Photo by Sean Carroll.
CS559: Computer Graphics Lecture 7: Image Warping and Panorama Li Zhang Spring 2008 Most slides borrowed from Yungyu ChuangYungyu Chuang.
Geometric Transformations Ceng 477 Introduction to Computer Graphics Computer Engineering METU.
Multimedia Programming 10: Mouse, Draw and Morphing Departments of Digital Contents Sang Il Park.
Multimedia Programming 12: Mouse, Draw and Morphing2 Departments of Digital Contents Sang Il Park.
Image Warping 2D Geometric Transformations
Image warping/morphing Digital Visual Effects, Spring 2006 Yung-Yu Chuang 2005/3/15 with slides by Richard Szeliski, Steve Seitz and Alexei Efros.
HADI Tutorial HADI Usage Contents 1.System Requirements 2.Capture Image 3.Calibration 4.Properties of Measurement Tools 5.View and Display 6.Show.
Image Morphing © Zooface Many slides from Alexei Efros, Berkeley.
Image Warping (Szeliski Sec 2.1.2)
Image Warping (Szeliski Sec 2.1.2)
Image warping/morphing
Image Warping : Computational Photography
Recap from Friday Image Completion Synthesis Order Graph Cut Scene Completion.
Point Processing : Computational Photography
Point Processing cs195g: Computational Photography
Image Warping : Computational Photography
Image Warping (Szeliski Sec 2.1.2)
Point Processing cs129: Computational Photography
Presentation transcript:

Multimedia Programming 13: Review and term project Departments of Digital Contents Sang Il Park

중간고사 ! 10 월 15 일 월요일 오후 7 시 ~9 시 충무관 210 호 필기고사

Outline Review Topics for the term project

What you’ve learned so far: OpenCV Image Processing –Image filtering Brightness/Contrast Gamma Histogram Equalization Blur Filtering Unsharp Filter –Image Warping Scaling/Rotation/Shearing Translation Recovering Transformation Image Morphing

HelloCV #include "stdafx.h" #include int _tmain(int argc, _TCHAR* argv[]) { IplImage * img; img = cvLoadImage("d:\\test.jpg"); cvNamedWindow("HelloCV"); cvShowImage("HelloCV", img); cvWaitKey(); cvDestroyWindow("HelloCV"); cvReleaseImage(&img); return 0; } IplImage cvLoadImage cvReleaseImage cvNamedWindow cvShowImage cvDestroyWindow cvWaitKey

Image structure IplImage (Image Processing Library) typedef struct _IplImage { int nSize; /* size of iplImage struct */ int ID; /* image header version */ int nChannels; int alphaChannel; int depth; /* pixel depth in bits */ char colorModel[4]; char channelSeq[4]; int dataOrder; int origin; int align; /* 4- or 8-byte align */ int width; int height; struct _IplROI *roi; /* pointer to ROI if any */ struct _IplImage *maskROI; /*pointer to mask ROI if any */ void *imageId; /* use of the application */ struct _IplTileInfo *tileInfo; /* contains information on tiling*/ int imageSize; /* useful size in bytes */ char *imageData; /* pointer to aligned image */ int widthStep; /* size of aligned line in bytes */ int BorderMode[4]; /* the top, bottom, left,and right border mode */ int BorderConst[4]; /* constants for the top, bottom,left, and right border */ char *imageDataOrigin; /* ptr to full, nonaligned image */ } IplImage;

Image I/O IplImage* cvLoadImage(image_path, colorness_flag); loads image from file, converts to color or grayscle, if need, and returns it (or returns NULL). image format is determined by the file contents. #define CV_LOAD_IMAGE_COLOR 1 #define CV_LOAD_IMAGE_GRAYSCALE 0 #define CV_LOAD_IMAGE_UNCHANGED -1  DEFAULT cvSaveImage(image_path, image); saves image to file, image format is determined from extension. cvReleaseImage(image_path, image); releases memory BMP, JPEG, PNG, TIFF, PPM/PGM formats are supported. IplImage* img = cvLoadImage(“picture.jpeg”,-1); if( img ) cvSaveImage( “picture.bmp”, img );

Windows cvNamedWindow(window_name, fixed_size_flag); creates window accessed by its name. Window handles repaint, resize events. Its position is remembered in registry: cvNamedWindow(“ViewA”); cvMoveWindow(“ViewA”,300,100); cvDestroyWindow(“ViewA”); … cvShowImage(window_name, image); copies the image to window buffer, then repaints it when necessary. {8u|16s|32s|32f}{C1|3|4} are supported. only the whole window contents can be modified. Dynamic updates of parts of the window are done using operations on images, drawing functions etc. cvDestroyWindow(window_name); deletes the window with the given name

User Input int cvWaitKey( int delay=0 ) waits for a pressed key. After waiting for the given delay, it proceeds. Zero delay means waiting forever until user input. –Delay in milliseconds.  Good for animating something Example) swapping between two images

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);

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

Image Processing image filtering: change range of image g(x) = h(f(x)) image warping: change domain of image g(x) = f(h(x)) h fg h f g Alexei Efros

Image Filtering 1 Brightness/contrast input output g = Af + B g = input color value f = output color value A = contrast value ( 초기값 = 1) B = brightness value ( 초기값 = 0)

Gamma Image Filtering 2

Histogram Equalization: Modify the image to have a well-distributed histogram Image Filtering 3

Histogram Equalization Procedure: For each color channel (R, G, B) –1. Compute the histogram –2. Compute the cumulative histogram –3. Set the maximum value as 255 –4. Using the cumulative histogram as a mapping function

Image Filtering 4: Cross-correlation filtering: or it can be written as: H is called the “filter,” “kernel,” or “mask.”

Image Filtering 4-1 Blur filter: 3x3 Mean kernel 1/ u01 v 0 1

Image Filtering 4-2 Blur filter: 3x3 Gaussian kernel

Image Filtering 4-3 Median Filter: selecting the median intensity in the window Median( 중간값 )

Image Filtering 5: Unsharp Masking = +  blurreddifferenceoriginal - = blurreddifference

Image Processing image filtering: change range of image g(x) = h(f(x)) image warping: change domain of image g(x) = f(h(x)) h fg h f g Alexei Efros

Image Warping Homogeneous coordinates –represent coordinates in 2 dimensions with a 3-vector ( 동차좌표 )

Basic 2D transformations as 3x3 matrices Translate Rotate Scale Image Warping

Affine transformations : –Combinations of … Linear transformations, and Translations –Properties of affine transformations: Origin does not necessarily map to origin Lines map to lines Ratios are preserved Parallel lines remain parallel Closed under composition Models change of basis ( 유사변환 ) Image Warping

Projective transformations : –Combinations of.. Affine transformations, and Projective warps –Properties of projective transformations: Origin does not necessarily map to origin Lines map to lines Ratios are not preserved Parallel lines do not necessarily remain parallel Closed under composition Models change of basis ( 사영변환 ) Image Warping

Matrix Composition p’ = T(t x,t y ) R(  ) S(s x,s y ) p Sequence of composition 1.First, Scaling 2.Next, Rotation 3.Finally, Translation Image Warping

Keyframe animation: Interpolation of state vector: 1-αα α Image Warping

Image Morphing: Cross-Dissolve Interpolate whole images: Image halfway = (1-t)*Image 1 + t*image 2 This is called cross-dissolve in film industry But what is the images are not aligned?

Image Morphing : cross-disolve2 Align first, then cross-dissolve –Alignment using global warp – picture still valid

General Image Morphing Procedure 1.Create an intermediate shape (by interpolation) 2.Warp both images towards it 3.Cross-dissolve the colors in the newly warped images