Image and Video Processing in MATLAB Partly based on slides by Dmitri Roduy.

Slides:



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

Matlab Image Processing
Tutorial on Matlab and OpenCV Rui Ma TA of CMPT 414 May 14, 2013 Office hours: Fridays 11:00-12:00, CSIL TA Office 1 (ASB 9838)
Introduction to Computer Vision Image Texture Analysis
Matlab Tutorial. Session 1 Basics, Filters, Color Space, Derivatives, Pyramids, Optical Flow Gonzalo Vaca-Castano.
Image Processing with MATLAB
1 A L L A H. Command-Window Workspace & Directory Command- History The Matlab Command window - Finding your way around.
Digital Image Processing Lecture 3: Image Display & Enhancement
Laboratory of Image Processing Pier Luigi Mazzeo
Neighborhood Processing
Image Display MATLAB functions for displaying image Bit Planes
Computational Biology, Part 23 Biological Imaging II Robert F. Murphy Copyright  1996, 1999, All rights reserved.
CS231A Matlab Tutorial Philip Lee Winter Overview  Goals › Introduction to Matlab › Matlab Snippets › Basic image manipulations › Helpful Matlab.
Image Processing in Matlab An Introductory Approach by Sabih D. Khan
Chapter 14 Landsat 7 image of the retreating Malaspina Glacier, Alaska.
Introduction to Morphological Operators
MATLAB for Image Processing April 10 th, Outline Introduction to MATLAB –Basics & Examples Image Processing with MATLAB –Basics & Examples.
Computer Vision Introduction to Image formats, reading and writing images, and image environments Image filtering.
Computer Vision Basics Image Terminology Binary Operations Filtering Edge Operators.
Digital Image Processing Homework 4 TA. Yu-Lun Liu VC Lab. Dec.04, 2007.
Advanced MATLAB Topics Data Types Image Representation Image/Video I/O Matrix access Image Manipulation MEX - MATLAB Executable Data Visualization.
Computational Tools for Image Processing Lecture 1, Jan 22nd, 2007 Part 2 (8:10-9:20pm) by Lexing Xie EE4830 Digital Image Processing
IMAGE PROCESSING LIBRARY (PIL) This is a package that you can import into python and it has quite a few methods that you can process image files with.
Chapter 2. Image Analysis. Image Analysis Domains Frequency Domain Spatial Domain.
Images Course web page: vision.cis.udel.edu/cv March 3, 2003  Lecture 8.
Sundermeyer MAR 550 Spring Laboratory in Oceanography: Data and Methods MAR550, Spring 2013 Miles A. Sundermeyer Image Processing/Analysis.
Introduction to MATLAB
Chap 3 : Binary Image Analysis. Counting Foreground Objects.
Chapter 5 Neighborhood Processing
Gulsah Tumuklu Ozyer MATLAB IMAGE PROCESSING TOOLBOX.
M ATLAB L ECTURE 1 Basic Concepts of Digital Image Processing.
CS112 Scientific Computation Department of Computer Science Wellesley College Numb3rs Number and image types.
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.
1 Regions and Binary Images Hao Jiang Computer Science Department Sept. 25, 2014.
Digital Image Processing Lecture4: Fundamentals. Digital Image Representation An image can be defined as a two- dimensional function, f(x,y), where x.
Getting Started With Images, Video, and Matlab
1 Regions and Binary Images Hao Jiang Computer Science Department Sept. 24, 2009.
CS 376b Introduction to Computer Vision 02 / 11 / 2008 Instructor: Michael Eckmann.
CMPS1371 Introduction to Computing for Engineers IMAGES.
Outline Introduction to MATLAB Image Processing with MATLAB
Digital Image Processing Introduction to MATLAB. Background on MATLAB (Definition) MATLAB is a high-performance language for technical computing. The.
Image processing using MATLAB
Lecture 27: Image Processing
Digital Image Processing
Image Representation Last update st March Heejune Ahn, SeoulTech.
Machine Vision ENT 273 Hema C.R. Binary Image Processing Lecture 3.
Sharpening Spatial Filters ( high pass)  Previously we have looked at smoothing filters which remove fine detail  Sharpening spatial filters seek to.
Introduction to MATLAB Ehsan Adeli M. Iran University of Science and Technology, E-Learing Center, Fall 2008 (1387)
การใช้งานโปรแกรม MATLAB ดร. อำนาจ ขาวเน. BASIC ELEMENTS OF MATLAB MATLAB Desktop MATLAB Editor Help System MATLAB (MATrix LABoratory)
Content Based Coding of Face Images
Computer Application in Engineering Design
(Project) by:- ROHAN HIMANSHU ANUP 70282
MATLAB® Image Processing Toolbox
CSE 554 Lecture 1: Binary Pictures
Color Tracking.
Digital Image Processing using MATLAB
Laboratory in Oceanography: Data and Methods
EEEB0765 Digital Signal Processing for Embedded Systems 8 Video and Image Processing in Embedded Systems (I) Assoc. Prof. Dr. Peerapol Yuvapoositanon.
CSE107 Matlab Introduction
CSC 381/481 Quarter: Fall 03/04 Daniela Stan Raicu
Tutorial 1 (additional materials)
CSE 307 Basics of Image Processing
Digital Image Processing
© 2010 Cengage Learning Engineering. All Rights Reserved.
Fundamentals of Image Processing Digital Image Representation
MATLAB stands for MATrix LABoratory.
Image segmentation Grey scale image Binary image
DIGITAL IMAGE PROCESSING Elective 3 (5th Sem.)
Presentation transcript:

Image and Video Processing in MATLAB Partly based on slides by Dmitri Roduy

Topics Data Types Image Representation Image/Video I/O Matrix access Image Manipulation Application: Bright Cars Detection in Video

Image Data Types Relevant data types uint8 – [0 255] – native for natural images uint16 – [0 65,535] – common for medical images Logical – [0 1] – native for masks, morph. elements double – 64bit floating point (default range [0 1]) single – when you want to save memory (32bit floating point) Simple casting: double(), uint8(). Type Conversion (of images): im2double(),im2single(),im2uint8(), im2unit16() Works for colors, gray-scale, logical images

I = imread(‘pears.png'); I2 = I-1.4; diffI = I-I2; fprintf('Max difference between images: %d\n',max(diffI(:))); figure(1); subplot(1,2,1); imshow(I); title('I'); subplot(1,2,2); imshow(I2); title('I2'); I = imread(‘pears.png'); I2 = I-1.4; diffI = I-I2; fprintf('Max difference between images: %d\n',max(diffI(:))); figure(1); subplot(1,2,1); imshow(I); title('I'); subplot(1,2,2); imshow(I2); title('I2'); Common problem

I = double(imread('pears.png')); I2 = I-1.4; diffI = I-I2; fprintf('Max difference between images: %2.1f\n',max(diffI(:))); figure(1); subplot(1,2,1); imshow(I); title('I'); subplot(1,2,2); imshow(I2); title('I2'); I = double(imread('pears.png')); I2 = I-1.4; diffI = I-I2; fprintf('Max difference between images: %2.1f\n',max(diffI(:))); figure(1); subplot(1,2,1); imshow(I); title('I'); subplot(1,2,2); imshow(I2); title('I2'); Common problem

I = double(imread('pears.png')); I2 = I-1.4; diffI = I-I2; fprintf('Max difference between images: %2.1f\n',max(diffI(:))); figure(1); subplot(1,2,1); max_I = 255; imshow(I/max_I); title('I'); subplot(1,2,2); imshow(I2/max_I); title('I2'); I = double(imread('pears.png')); I2 = I-1.4; diffI = I-I2; fprintf('Max difference between images: %2.1f\n',max(diffI(:))); figure(1); subplot(1,2,1); max_I = 255; imshow(I/max_I); title('I'); subplot(1,2,2); imshow(I2/max_I); title('I2'); Possible Solution

Image Representation 2D Matrix Intensity: Each pixel value in the dynamic range [minP, maxP]. Can represent a grayscale image, results of a 2d function etc. Useful commands: imshow (), imagesc(), colormap(). Binary: a.k.a masks. Can represent areas of interest in image, morphological structuring elements and more… Useful commands: bwlabel(),bwmorph(),bwdist(),im2bw(),bwperim().

Image Representation 3D Matrix True Color: Three 2D matrices stacked. Each represents a color component. (e.g. RGB) Can represent an RGB color image, Ycbcr image, LAB image, etc. Useful commands: imshow(),rgb2gray(),rgb2ycbcr(), ycbcr2rgb(), rgb2lab().

Image/Video I/O Useful Commands imread() – read image imwrite() – write image im2frame() – convert image to movie frame movie2avi() – write avi file aviread() – read avi file mmreader()/VideoReader() – read video (better) VideoWriter() – create video file (2011b+) movie() – show movie implay() – show video interactively

Matrix access Useful Commands: sub2ind()– convert subscript (e.g. (r,c,clr)) to index (n). ind2sub() – convert index (n) to subscipt (e.g. (r,c,clr)). meshgrid() – generate X,Y grids.

Image Manipulation Useful Functions: imrotate()– Rotate image. imfilter() – Use kernal to convolve/correlation. nlfilter() – Sliding neighborhood operation. blkproc() – Perform function on (semi-)distinct blocks. fspecial() – Create common image filter kernels. imresize() – scale up/down image using defined interpolation. padarray() – Pad image. colfilt() – Column-stack filtering (faster) Many more – see IP toolbox help

Application: Bright Cars Detection in Video Objective: Tag with a red square bright colored cars in a color video with moving cars. Stages: 1)Convert each RGB frame to gray scale. 2)Search for regional maximas above a brightness threshold 3)Remove small regions (i.e morphology) 4)Compute centroid of each region 5)Place a red square in centroid location 6)Repeat 1-5 for all video frames

Morphological Open Erosion of the image with the Structuring Element followed by Dilation of the image with the Structuring Element.