Introduction of OpenCV Alireza Shirani Researcher of Medical Image and Signal Processing M. S Electrical Engineering yahoo. com Spring.

Slides:



Advertisements
Similar presentations
Editing In ImageJ John H. Krantz Hanover College.
Advertisements

Md. Monjur –ul-Hasan Department of Computer Science & Engineering Chittagong University of Engineering & Technology Chittagong 4349
Graphics You draw on a Graphics object The Graphics object cannot directly be created by your code, instead one is generated when the method paintComponent.
Working with images and scenes CS 5010 Program Design Paradigms “Bootcamp” Lesson 2.5 TexPoint fonts used in EMF. Read the TexPoint manual before you delete.
Text David Meredith Aalborg University.
Image Transforms 主講人:虞台文. Content Overview Convolution Edge Detection – Gradients – Sobel operator – Canny edge detector – Laplacian Hough Transforms.
ACA practice.
Graphics CS 121 Concepts of Computing II. What is a graphic? n A rectangular image. n Stored in a file of its own, or … … embedded in another data file.
Gavin S Page OpenCV Tutorial Part I Using OpenCV with Microsoft Visual Studio.net November 2005.
OpenCV Stacy O’Malley CS-590 Summer, What is OpenCV? Open source library of functions relating to computer vision. Cross-platform (Linux, OS X,
Graphics and Still Images John H. Krantz Hanover College.
Introduction to Computer Graphics
Vector vs. Bitmap SciVis V
V Obtained from a summer workshop in Guildford County July, 2014
Desktop Publishing Features Designing Documents. Publication Terms  Graphics - Objects used to convey a message.  Multiple Columns - Layout used to.
Ku-Yaw Chang Assistant Professor, Department of Computer Science and Information Engineering Da-Yeh University.
L.
Computational Tools for Image Processing Lecture 1, Jan 22nd, 2007 Part 2 (8:10-9:20pm) by Lexing Xie EE4830 Digital Image Processing
Prepared by George Holt Digital Photography BITMAP GRAPHIC ESSENTIALS.
Addison Wesley is an imprint of © 2010 Pearson Addison-Wesley. All rights reserved. Chapter 3 Variables, Calculations, and Colors Starting Out with Games.
1 Bitmap Graphics It is represented by a dot pattern in which each dot is called a pixel. Each pixel can be in any one of the colors available and the.
Filtering (I) Dr. Chang Shu COMP 4900C Winter 2008.
OpenCV Open source C omputer V ision library By: Bahare Torkaman Fall 2010.
OPENCV TUTORIAL OpenCV Windows 7 Microsoft Visual C++ Express 2010.
CGMB214: Introduction to Computer Graphics
SDL Programming Introduction. Initialization 2  The first thing you must do is initialize SDL  int SDL_Init( SDL_INIT_EVERYTHING )  This will return.
Module Code: CU0001NI Technical Information on Digital Images Week -2.
Lecture 4 - Introduction to Computer Graphics
Računarska grafika GDI+ (Graphics Device Interface Plus)
Software Resources Multimodal Interaction Dr. Mike Spann
Detect Candle.  Open VC++ Directories configuration: Tools > Options > Projects and Solutions > VC++ Directories  Choose "Show directories for: Include.
Multimedia Programming 02: Play with Images Departments of Digital Contents Sang Il Park.
Measurements in Fluid Mechanics 058:180:001 (ME:5180:0001) Time & Location: 2:30P - 3:20P MWF 218 MLH Office Hours: 4:00P – 5:00P MWF 223B-5 HL Instructor:
Multimedia Programming 03: Point Processing Departments of Digital Contents Sang Il Park.
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.
Image Processing 主講人:虞台文. Content Smoothing Image Morphology Some Applications of Image Morphology Flood Fill Resize Image Pyramids Threshold.
1 Imaging Techniques for Flow and Motion Measurement Lecture 2 Lichuan Gui University of Mississippi 2011 Digital Image & Image Processing.
Computer Graphics Bitmaps & Sprites CO2409 Computer Graphics Week 3.
Information Processes and Technology Multimedia: Graphics.
1 Graphics CSCI 343, Fall 2015 Lecture 4 More on WebGL.
Multimedia Programming 13: Review and term project Departments of Digital Contents Sang Il Park.
Digital Multimedia, 2nd edition Nigel Chapman & Jenny Chapman Chapter 3 This presentation © 2004, MacAvon Media Productions Introduction to Computer Graphics.
Graphics and Images Graphics and images are both non-textual information, that can be displayed and printed. These images may appear on screen as well.
Digital Media Dr. Jim Rowan ITEC So far… We have compared bitmapped graphics and vector graphics We have discussed bitmapped images, some file formats.
Vision Geza Kovacs Maslab Colorspaces RGB: red, green, and blue components HSV: hue, saturation, and value Your color-detection code will be more.
12/5/2015 EEC492/693/793 - iPhone Application Development 1 EEC-693/793 Applied Computer Vision with Depth Cameras Lecture 4 Wenbing Zhao
CHAPTER 3 (P.49-53) Importing modules + pygame intro.
Getting to Know OpenCV 主講人:虞台文. Content Basic Structures Arrays, Matrices, and Images Matrix and Image Operators Drawing Things Drawing Text Data Persistence.
MULTIMEDIA Multimedia is the field concerned with the computer- controlled integration of text, graphics, drawings, still and moving images (Video), animation,
Image File Formats By Dr. Rajeev Srivastava 1. Image File Formats Header and Image data. A typical image file format contains two fields namely Dr. Rajeev.
Screen Basic color – RGB Print Basic Color - CMYK R – Read G – Green B - Blue Total Color combination: 256x256x256=16,777,216 Total Printing Color.
Image File Formats Harrow Computer Club – Wed, 1 Dec 2010 Bob Watson MA CMath MIMA MBCS.
Digital Media Lecture 5: Vector Graphics Georgia Gwinnett College School of Science and Technology Dr. Jim Rowan.
Scanner Scanner Introduction: Scanner is an input device. It reads the graphical images or line art or text from the source and converts.
Graphics and Image Data Representations 1. Q1 How images are represented in a computer system? 2.
Guilford County SciVis V104.03
Digital Basics Quiz Preparation. Basic Digital Image Concepts Aliasing & Anti‐aliasing Resolution Compression Raster & Vector Color mode & Image mode.
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.
3. Drawing Let’s Learn Saengthong School, June – August 2016 Teacher: Aj. Andrew Davison, CoE, PSU Hat Yai Campus
Understanding Images. Pixels pixels Every image is made up of very small squares called pixels, and each pixel represents a color or shade. Pixels within.
Representation of image data
OpenCV Tutorial Part I Using OpenCV with Microsoft Visual Studio .net November 2005 Gavin S Page
Chapter 5 Working with Images
Introduction to Computer Graphics
Outline Image formats and basic operations Image representation
Importing modules + pygame intro
COMS 161 Introduction to Computing
Presentation transcript:

Introduction of OpenCV Alireza Shirani Researcher of Medical Image and Signal Processing M. S Electrical Engineering yahoo. com Spring 1392

Outline Of Talking Introduction of OpenCV How to Install OpenCV Read & Write image & other related Function Read & Write video & other related Function

Introduction of OpenCV OpenCv (open computer vision ) library is library of programming function mainly aimed at real time computer vision developed by Intel and now supported by Willow Garage. It’s free for use under the open source BSD License OS Support: Windows,Android,Blackberry,Linux Distribution such as puppy, Ubuntu,…,Maemo,Free BSD,… Programming language OpenCv written in C++ and its primary interface is in C++.There are full interfacing Python, Java,MATLAB OpenCV can be used in Embedded Systems.

Read & Write image & other related Function Load Image: cvLoadImage The function cvLoadImage loads an image from the specified file and returns the pointer to the loaded image  IplImage* cvLoadImage(const char* filename, Parameters) Currently the following file formats are supported:  Windows bitmaps - BMP, DIB  JPEG files - JPEG, JPG, JPE  Portable Network Graphics - PNG  Portable image format - PBM, PGM, PPM  Sun rasters - SR, RAS  TIFF files - TIFF, TIF o Parameters : o CV_LOAD_IMAGE_COLOR the loaded image is forced to be a 3-channel color image o CV_LOAD_IMAGE_GRAYSCALE the loaded image is forced to be grayscale o CV_LOAD_IMAGE_UNCHANGED the loaded image will be loaded as is.

Read & Write image & other related Function IplImage is structure that contain all details about Image that was loaded

Read & Write image & other related Function Open window cvNamedWindow  cvNamedWindow(const char* name, int flags)¶¶ The function cvNamedWindow creates a window which can be used as a placeholder for images name – Name of the window in the window caption that may be used as a window identifier. flags – Flags of the window. Currently the only supported flag is CV_WINDOW_AUTOSIZE Delay in millisecondscvWaitKey  Int cvWaitKey(int delay=0) The function cvWaitKey waits for key event infinitely ( delay<=0) or for delay milliseconds. Returns the code of the pressed key or -1 if no key was pressed before the specified time had elapsed

Read & Write image & other related Function Release Space of RAMcvReleaseImage  void cvReleaseImage(IplImage* image)  Deallocates the image header and the image data image – Double pointer to the image header

Read & Write image & other related Function Create image cvCreateImage  IplImage* cvCreateImage(CvSize size, int depth, int channels)  Creates an image header and allocates the image data size – Image width and height depth – Bit depth of image elements. channels – Number of channels per pixel Point of image CvPoint  2D point with integer coordinates

Read & Write image & other related Function MoveWindoe cvMoveWindow(*name,x,y)  cvMoveWindow(const char* name, int x, int y) The function cvMoveWindow() changes the position of the window o x – New x coordinate of the top-left corner o y – New y coordinate of the top-left corner Convert Image cvConvertImage  cvConvertImage(const CvArr* src, CvArr* dst, int flags=0) Converts one image to another with an optional vertical flip src – Source image dst – Destination image The operation flags: CV_CVTIMG_FLIP - Flips the image vertically CV_CVTIMG_SWAP_RB - Swaps the red and blue channels. In OpenCV color images have BGR channel order, however on some systems the order needs to be reversed before displaying the image.

Read & Write image & other related Function Font setting in opencv cvInitFont  cvInitFont(CvFont* font, int fontFace, double hscale, double vscale, double shear=0, int thickness=1, int lineType=8)  The function initializes the font structure that can be passed to text rendering functions  font – Pointer to the font structure initialized by the function fontFace : CV_FONT_HERSHEY_SIMPLEX - normal size sans-serif font CV_FONT_HERSHEY_PLAIN - small size sans-serif font CV_FONT_HERSHEY_DUPLEX - normal size sans-serif font (more complex than  Hscale : Horizontal scale  Vscale: Vertical scale  param thickness : Thickness of the text strokes  param shear: Approximate tangent of the character slope relative to the vertical line. A zero value means a non-italic font. 1.0f means about a 45 degree slope, etc.  lineType : The function initializes the font structure that can be passed to text rendering functions.

Read & Write image & other related Function Write string on OpenCV cvPutText  void cvPutText(CvArr* img, const char* text, CvPoint org, const CvFont* font, CvScalar color)  The function renders the text in the image with the specified font and color img – Input image text – String to print org – Coordinates of the bottom-left corner of the first letter font – Pointer to the font structure color – Text color  CvScaler: is structure that contain R,G,B values of Pixels  Example CV_RGB(255,255,255) create white color

Read & Write image & other related Function Convert ImagecvCreateImage  IplImage* cvCreateImage(CvSize size, int depth, int channels)  Creates an image header and allocates the image data size – Image width and height depth – Bit depth of image elements. channels – Number of channels per pixel.

Read & Write image & other related Function Implements the Canny Algorithm cvCanny  void cvCanny(const CvArr* image, CvArr * edges, double threshold1, double threshold2, int aperture_size=3)  The function finds the edges on the input image and marks them in the output image edges using the Canny algorithm. image – Single-channel input image edges – Single-channel image to store the edges found by the function threshold1 – The first threshold threshold2 – The second threshold aperture_size – Aperture parameter for the Sobel operator

Read & Write image & other related Function Draws a line cvLine  cvLine(CvArr* img, CvPoint pt1, CvPoint pt2, CvScalar color, int thickness=1, int lineType=8, int shift=0)  The function draws the line segment between pt1 and pt2 points in the image img – The image pt1 – First point of the line segment pt2 – Second point of the line segment color – Line color thickness – Line thickness lineType – Type of the line: 8 - (or omitted) 8-connected line connected line. CV_AA - antialiased line. shift – Number of fractional bits in the point coordinates

Read & Write image & other related Function Draw circle cvCircle  cvCircle(CvArr* img, CvPoint center, int radius, CvScalar color, int thickness=1, int lineType=8, int shift=0)  The function draws a simple or filled circle with a given center and radius. img – Image where the circle is drawn center – Center of the circle radius – Radius of the circle color – Circle color thickness – Thickness of the circle outline if positive, otherwise this indicates that a filled circle is to be drawn lineType – Type of the circle boundary shift – Number of fractional bits in the center coordinates and radius value

Read & Write image & other related Function Smooth cvSmooth  cvSmooth(const CvArr* src, CvArr* dst, int smoothtype=CV_GAUSSIAN, int param1=3, int param2=0, double param3=0, double param4=0)  Function smooths an image using one of several methods. src – The source image dst – The destination image smoothtype – Type of the smoothing: CV_BLUR_NO_SCALE linear convolution with box kernel (all 1’s). If you want to smooth different pixels with different-size box kernels, you can use the integral image that is computed using Integral Integral CV_BLUR linear convolution with box kernel (all 1’s) with subsequent scaling by CV_GAUSSIAN linear convolution with a Gaussian kernel CV_MEDIAN median filter with a square aperture CV_BILATERAL bilateral filter with a square aperture

Read & Write image & other related Function Save Image cvSaveImage  int cvSaveImage(const char* filename, const CvArr* image)  The function cvSaveImagesaves the image to the specified file filename – Name of the file. image – Image to be saved

Read & Write video & other related Function capturing a video from a camera cvCaptureFromCAM  The functioncvCaptureFromCAMallocates and initializes the CvCapture structure for reading a video stream from the camera  CvCapture* cvCaptureFromCAM(int index)  index – Index of the camera to be used

Read & Write video & other related Function Extract frame from camera cvQueryFrame  Grabs and returns a frame from a camera or file  IplImage* cvQueryFrame(CvCapture* capture )  capture – video capturing structure

Thank You Kingsoft Office published by kingsoftstore Kingsoft Office