 Muhammad Arif (BCS-F07-M034)  Hafiz Adil (BCS-F07-M008)  Saad Bilal (BCS-F07-M014)  Asif Majeed(BCS-F06-M019)  Muhammad Ajmal (BCS-F06-M047) 

Slides:



Advertisements
Similar presentations
1 ECE 495 – Integrated System Design I Introduction to Image Processing ECE 495, Spring 2013.
Advertisements

Introduction to MATLAB The language of Technical Computing.
CS Spring 2009 CS 414 – Multimedia Systems Design Lecture 4 – Digital Image Representation Klara Nahrstedt Spring 2009.
November 12, 2013Computer Vision Lecture 12: Texture 1Signature Another popular method of representing shape is called the signature. In order to compute.
Grey Level Enhancement Contrast stretching Linear mapping Non-linear mapping Efficient implementation of mapping algorithms Design of classes to support.
Computational Biology, Part 23 Biological Imaging II Robert F. Murphy Copyright  1996, 1999, All rights reserved.
Chapter 3 Image Enhancement in the Spatial Domain.
From Images to Answers A Basic Understanding of Digital Imaging and Analysis.
Slide deck by Dr. Greg Reese Miami University MATLAB An Introduction With Applications, 5 th Edition Dr. Amos Gilat The Ohio State University Chapter 3.
Image Processing in Matlab An Introductory Approach by Sabih D. Khan
ImageJ tutorial showing the operations needed to calculate air-filled porosity for an example soil column.
Image Segmentation Image segmentation (segmentace obrazu) –division or separation of the image into segments (connected regions) of similar properties.
Each pixel is 0 or 1, background or foreground Image processing to
Morphological Image Processing Md. Rokanujjaman Assistant Professor Dept of Computer Science and Engineering Rajshahi University.
Connecting with Computer Science, 2e
Highlights Lecture on the image part (10) Automatic Perception 16
The Segmentation Problem
Chapter 2. Image Analysis. Image Analysis Domains Frequency Domain Spatial Domain.
CS 376b Introduction to Computer Vision 02 / 26 / 2008 Instructor: Michael Eckmann.
Chapter 10: Image Segmentation
COMP Bitmapped and Vector Graphics Pages Using Qwizdom.
Chapter 9.  Mathematical morphology: ◦ A useful tool for extracting image components in the representation of region shape.  Boundaries, skeletons,
Simple Image Processing Speaker : Lin Hsiu-Ting Date : 2005 / 04 / 27.
CO1301: Games Concepts Dr Nick Mitchell (Room CM 226) Material originally prepared by Gareth Bellaby.
University of Kurdistan Digital Image Processing (DIP) Lecturer: Kaveh Mollazade, Ph.D. Department of Biosystems Engineering, Faculty of Agriculture,
Gulsah Tumuklu Ozyer MATLAB IMAGE PROCESSING TOOLBOX.
September 5, 2013Computer Vision Lecture 2: Digital Images 1 Computer Vision A simple two-stage model of computer vision: Image processing Scene analysis.
Digital Image Processing CCS331 Relationships of Pixel 1.
Image Segmentation and Morphological Processing Digital Image Processing in Life- Science Aviad Baram
Chapter 10 Image Segmentation.
AdeptSight Image Processing Tools Lee Haney January 21, 2010.
Data Extraction using Image Similarity CIS 601 Image Processing Ajay Kumar Yadav.
Presented By: ROLL No IMTIAZ HUSSAIN048 M.EHSAN ULLAH012 MUHAMMAD IDREES027 HAFIZ ABU BAKKAR096(06)
Introduction MATLAB stands for MATrix LABoratory.  Basics  Matrix Manipulations  MATLAB Programming  Graphics  Image types  Image Processing  Useful.
Digital Image Processing Lecture4: Fundamentals. Digital Image Representation An image can be defined as a two- dimensional function, f(x,y), where x.
Mathematical Morphology Mathematical morphology (matematická morfologie) –A special image analysis discipline based on morphological transformations of.
October 7, 2014Computer Vision Lecture 9: Edge Detection II 1 Laplacian Filters Idea: Smooth the image, Smooth the image, compute the second derivative.
Autonomous Robots Vision © Manfred Huber 2014.
CS654: Digital Image Analysis
Digital Image Processing Introduction to MATLAB. Background on MATLAB (Definition) MATLAB is a high-performance language for technical computing. The.
October 1, 2013Computer Vision Lecture 9: From Edges to Contours 1 Canny Edge Detector However, usually there will still be noise in the array E[i, j],
Nottingham Image Analysis School, 23 – 25 June NITS Image Segmentation Guoping Qiu School of Computer Science, University of Nottingham
CDS 301 Fall, 2008 Image Visualization Chap. 9 November 11, 2008 Jie Zhang Copyright ©
Course 5 Edge Detection. Image Features: local, meaningful, detectable parts of an image. edge corner texture … Edges: Edges points, or simply edges,
Digital Image Processing Lecture 17: Segmentation: Canny Edge Detector & Hough Transform Prof. Charlene Tsai.
Machine Vision Edge Detection Techniques ENT 273 Lecture 6 Hema C.R.
TOPIC 12 IMAGE SEGMENTATION & MORPHOLOGY. Image segmentation is approached from three different perspectives :. Region detection: each pixel is assigned.
Morphological Image Processing (Chapter 9) CSC 446 Lecturer: Nada ALZaben.
September 26, 2013Computer Vision Lecture 8: Edge Detection II 1Gradient In the one-dimensional case, a step edge corresponds to a local peak in the first.
MA/CS375 Fall MA/CS 375 Fall 2002 Lecture 5.
April 21, 2016Introduction to Artificial Intelligence Lecture 22: Computer Vision II 1 Canny Edge Detector The Canny edge detector is a good approximation.
Computer Application in Engineering Design
Chapter 10 Image Segmentation
Bitmap Image Vectorization using Potrace Algorithm
Digital Image Processing Lecture 16: Segmentation: Detection of Discontinuities Prof. Charlene Tsai.
Introduction Computer vision is the analysis of digital images
Fitting Curve Models to Edges
Digital Image Processing using MATLAB
Computer Vision Lecture 9: Edge Detection II
Introduction Computer vision is the analysis of digital images
Computer Vision Lecture 16: Texture II
Digital Image Processing
CSC 381/481 Quarter: Fall 03/04 Daniela Stan Raicu
Department of Computer Engineering
Midterm Exam Closed book, notes, computer Similar to test 1 in format:
Fundamentals of Image Processing Digital Image Representation
Introduction Computer vision is the analysis of digital images
7th Annual STEMtech conference
Introduction to Artificial Intelligence Lecture 22: Computer Vision II
DIGITAL IMAGE PROCESSING Elective 3 (5th Sem.)
Presentation transcript:

 Muhammad Arif (BCS-F07-M034)  Hafiz Adil (BCS-F07-M008)  Saad Bilal (BCS-F07-M014)  Asif Majeed(BCS-F06-M019)  Muhammad Ajmal (BCS-F06-M047)  Azhar Qaqyom (BCS-F07-M020)

 This worksheet is an introduction on how to handle images in Matlab. When working with images in Matlab, there are many things to keep in mind such as loading an image, using the right format, saving the data as different data types, how to display an image, conversion between different image formats, etc. This worksheet presents some of the commands designed for these operations. Most of these commands require you to have the Image processing tool box installed with Matlab. To find out if it is installed, type ver at the Matlab prompt. This gives you a list of what tool boxes that are installed on your system.

 Image Processing generally involves extraction of useful information from an image.  This useful information may be the dimensions of an engineering component, size of diagnosed tumor, or even a 3D view of an unborn baby.  In Pakistan the main areas of application of Image Processing are Bio-Medical, Engineering, Quality Control, etc.

The following image formats are supported by Matlab:  BMP  HDF  JPEG  PCX  TIFF  XWB

 A digital image is composed of pixels which can be thought of as small dots on the screen. A digital image is an instruction of how to color each pixel. We will see in detail later on how this is done in practice. A typical size of an image is 512-by-512 pixels. Later on in the course you will see that it is convenient to let the dimensions of the image to be a power of 2. For example, 2 9 =512. In the general case we say that an image is of size m-by-n if it is composed of m pixels in the vertical direction and n pixels in the horizontal direction

 Matlab is an abbreviation of Matrix Laboratory.  It is a popular Mathematical Programming Environment used extensively in Education as well as in Industry.  The trick behind Matlab is that everything is represented in the form of arrays or matrices.  Mathematical Operations starting from simple algebra to complex calculus may be conveniently carried out using this environment.  The main use of Matlab in Software Development is Algorithm Design and Development.  Code developed in Matlab can be converted into C, C++ or Visual C++.  Additionally Matlab may be called as ActiveX Object from still higher level languages like Visual Basic, etc.

 Matrix Declaration:  Simple Declaration  Null Matrix  Matrix with Ones  Identity Matrix  Random Matrix  Vector Matrix  Scalar Matrix  Matrix Arithmetic:  Addition  Subtraction  Multiplication  Division

 Matrix Manipulation:  Addressing of individual element  Complete Row Addressing  Complete Column Addressing  Trnaspose  Fliplr and Flipud  Saving and Loading Data  Concept of Function and m-Files  Concept of Path

 Images can be conveniently represented as matrices in Matlab.  One can open an image as a matrix using imread command.  The matrix may simply be m x n form or it may be 3 dimensional array or it may be an indexed matrix, depending upon image type.  The image processing may be done simply by matrix calculation or matrix manipulation.  Image may be displayed with imshow command.  Changes image may then be saved with imwrite command.

 Outside Matlab images may be of three types i.e. black & white, grey scale and colored.  In Matlab, however, there are four types of images.  Black & White images are called binary images, containing 1 for white and 0 for black.  Grey scale images are called intensity images, containing numbers in the range of 0 to 255 or 0 to 1.  Colored images may be represented as RGB Image or Indexed Image.

 In RGB Images there exist three indexed images.  First image contains all the red portion of the image, second green and third contains the blue portion.  So for a 640 x 480 sized image the matrix will be 640 x 480 x 3.  An alternate method of colored image representation is Indexed Image.  It actually exist of two matrices namely image matrix and map matrix.  Each color in the image is given an index number and in image matrix each color is represented as an index number.  Map matrix contains the database of which index number belongs to which color.

 RGB Image to Intensity Image (rgb2gray)  RGB Image to Indexed Image (rgb2ind)  RGB Image to Binary Image (im2bw)  Indexed Image to RGB Image (ind2rgb)  Indexed Image to Intensity Image (ind2gray)  Indexed Image to Binary Image (im2bw)  Intensity Image to Indexed Image (gray2ind)  Intensity Image to Binary Image (im2bw)  Intensity Image to RGB Image (gray2ind, ind2rgb)

 There are a number of ways to get statistical information about data in the image.  Image histogram is on such way.  An image histogram is a chart that shows the distribution of intensities in an image.  Each color level is represented as a point on x-axis and on y- axis is the number instances a color level repeats in the image.  Histogram may be view with imhist command.  Sometimes all the important information in an image lies only in a small region of colors, hence it usually is difficult to extract information out of that image.  To balance the brightness level, we carryout an image processing operation termed histogram equalization.

 In image processing useful pixels in the image are separated from the rest by a process called image segmentation.  Brightness Threshold and Edge detection are the two most common image segregation techniques.  In brightness threshold, all the pixels brighter than a specified brightness level are taken as 1 and rest are left 0.  In this way we get a binary image with useful image as 1 and unwanted as 0.  In edge detection special algorithms are used to detect edges of objects in the image.

 Edge detection extract edges of objects from an image.  There are a number of algorithms for this, but these may be classified as derivative based or gradient based.  In derivative based edge detection the algorithm takes first or second derivative on each pixel in the image.  In case of first derivative at the edge of the image there is a rapid change of intensity.  While in case of second derivative there is a zero pixel value, termed zero crossing.  In gradient based edge detection a gradient of consecutive pixels is taken in x and y direction.

 Taking derivative on each and every pixel of the image consumes a lot of computer resources and hence is not practical.  So usually an operation called kernel operation is carried out.  A kernel is a small matrix sliding over the image matrix containing coefficients which are multiplied to corresponding image matrix elements and their sum is put at the target pixel.

 In sobel following formulas are applied on each pixel(i,j) in the image and two matrices S x and S y are obtained: S x = (a 2 + ca 3 +a 4 ) - (a 0 + ca 7 + a 6 ) S y = (a 0 + ca 1 + a 2 ) – (a 6 + ca 5 + a 4 ) C = 2  Alternatively this can be done by applying following two kernels:  The resultant matrix is then obtained by taking the square root of the sum of the squares of Sx and Sy, as follows: M(i,j) = ( S x 2 + S y 2 ) 1/2

In Prewitt everything is same but C=1: S x = (a 2 + ca 3 +a 4 ) - (a 0 + ca 7 + a 6 ) S y = (a 0 + ca 1 + a 2 ) – (a 6 + ca 5 + a 4 ) C = 1 Alternatively this can be done by applying following two kernels: The resultant matrix is then obtained by taking the square root of the sum of the squares of Sx and Sy, as follows: M(i,j) = ( S x 2 + S y 2 ) 1/2

 These are image processing operations done on binary images based on certain morphologies or shapes.  The value of each pixel in the output is based on the corresponding input pixel and its neighbors.  By choosing appropriately shaped neighbors one can construct an operation that is sensitive to a certain shape in the input image.

 Bridge – bridges unconnected pixels.  Clean – removes isolated pixels.  Fill – fills isolated interior pixels.  Majority – sets a pixel 1 if five or more pixels in 3x3 neighborhood are 1’s.  Remove – removes interior pixels by setting pixels to zero if its 4 neighbors are 1, thus leaving only boundary pixels on.  Shrink – shrinks object to a point.  Diagonal Fill – fills diagonal elements to eliminate 8 connectivity with background.

 It creates skeleton of an object, by removing pixels on the boundaries but does not allow objects to break apart.  It is an extremely important operation in image processing as it removes complexities from an image without loosing details.

 These are the most fundamental of binary morphological operations.  In dilation if any pixel in the input pixel’s neighborhood is on, the output pixel is on otherwise off.  In actual dilation grows the area of the object. Small holes in the object are removed.  In erosion if every pixel in the input pixel’s neighborhood is on the output pixel is on otherwise off  This in actual works as shrinking the object’s area, thus small isolated regions disappear.

 Computing the mean or standard deviation  Determining the intensity values along a line segment  Displaying an image histogram  Plotting a profile of intensity values

 Edge-detection algorithms let you identify object boundaries in an image. These algorithms include the Sobel, Prewitt, Roberts, Canny, and Laplacian of Gaussian methods. The powerful Canny method can detect true weak edges without being "fooled" by noise.  Image segmentation algorithms determine region boundaries in an image. You can explore many different approaches to image segmentation, including automatic thresholding, edge-based methods, and morphology-based methods such as the watershed transform, often used to segment touching objects

 Image Processing Toolbox provides a suite of tools for interactive image display and exploration. You can load an image from a file or from the MATLAB workspace, view image information, adjust the contrast, closely examine a region of pixels, and zoom and pan around the image. You can interactively place and manipulate ROIs, including points, lines, rectangles, polygons, ellipses, and freehand shapes. You can also interactively crop, create histograms and contours, and measure distances.

 Image Processing Toolbox supports images generated by a wide range of devices, including digital cameras, frame grabbers, satellite and airborne sensors, medical imaging devices, microscopes, telescopes, and other scientific instruments. You can visualize, analyze, and process these images in many data types, including single- and double- precision floating-point.  There are several ways to import or export images into and out of the MATLAB environment for processing. You can use Image Acquisition Toolbox to acquire live images from Web cameras, frame grabbers, DCAM-compatible cameras, and other devices.