Visualization (human) Analysis (computer) Documents, Textures, Biometrics, Object recognition

Similar documents
Digital Image Processing

int16 map is often stored with an indexed image and is automatically loaded with image when using imread

MATLAB for Image Processing

xv Programming for image analysis fundamental steps

Digital Image Processing. Today Outline. Matlab Desktop. Matlab Basics

Lecture 5 C Programming Language

Chapter 2 Fundamentals. Chapter 2 Fundamentals The images used here are provided by the authors.

Matlab Tutorial. Yi Gong

ERNST. Environment for Redaction of News Sub-Titles

APPLESHARE PC UPDATE INTERNATIONAL SUPPORT IN APPLESHARE PC

Personal Conference Manager (PCM)

THE BARE ESSENTIALS OF MATLAB

Pointers & Arrays. CS2023 Winter 2004

Lecture #3. MATLAB image processing (cont.) Histograms Mathematics of image processing Geometric transforms Image Warping.

MATLAB. Image Processing Toolbox. User s Guide. Computation. Visualization. Programming. Version 2

Introduction to Matlab/Octave

GRAPHICS AND VISUALISATION WITH MATLAB Part 2

Pointers. CS2023 Winter 2004

Image Processing CS 6640 : An Introduction to MATLAB Basics Bo Wang and Avantika Vardhan

CSE/Math 485 Matlab Tutorial and Demo

Introduction to image processing in Matlab

MATLAB for Image Processing. April 2018 Rod Dockter

Introduction to Digital Image Processing

This file contains an excerpt from the character code tables and list of character names for The Unicode Standard, Version 3.0.

Image Processing Toolbox

ASCII Code - The extended ASCII table

Getting round your Mac with Shortcut Keys

Matlab? Chapter 3-4 Matlab and IPT Basics. Working Environment. Matlab Demo. Array. Data Type. MATLAB Desktop:

Cartons (PCCs) Management

CMPT 470 Based on lecture notes by Woshun Luk

UNIVERSITY OF THE FREE STATE DEPARTMENT OF COMPUTER SCIENCE AND INFORMATICS CSIS1614

More on Images and Matlab

USB-ASC232. ASCII RS-232 Controlled USB Keyboard and Mouse Cable. User Manual

To provide state and district level PARCC assessment data for the administration of Grades 3-8 Math and English Language Arts.

MAT 343 Laboratory 1 Matrix and Vector Computations in MATLAB

OOstaExcel.ir. J. Abbasi Syooki. HTML Number. Device Control 1 (oft. XON) Device Control 3 (oft. Negative Acknowledgement

Image Processing Matlab tutorial 2 MATLAB PROGRAMMING

Bold U S E R S G U I D E

Lecture #5. Point transformations (cont.) Histogram transformations. Intro to neighborhoods and spatial filtering

APPM 2360 Project 2 Due Nov. 3 at 5:00 PM in D2L

Banner 8 Using International Characters

Matlab Primer. Lecture 02a Optical Sciences 330 Physical Optics II William J. Dallas January 12, 2005

Oracle Primavera P6 Enterprise Project Portfolio Management Performance and Sizing Guide. An Oracle White Paper December 2011

Adorn. Serif. Smooth. v22622x

Clustering Images. John Burkardt (ARC/ICAM) Virginia Tech... Math/CS 4414:

Adorn. Serif. Smooth. v22622x. user s guide PART OF THE ADORN POMANDER SMOOTH COLLECTION

Lab 1: Basic operations on images in Matlab

State of Connecticut Workers Compensation Commission

Image Processing Toolbox

A Gentle Introduction to Matlab

Modules. CS2023 Winter 2004

Digital Image Fundamentals. Prof. George Wolberg Dept. of Computer Science City College of New York

IMAGING. Images are stored by capturing the binary data using some electronic devices (SENSORS)

HoneyBee User s Guide

function [s p] = sumprod (f, g)

CMSC 313 Lecture 03 Multiple-byte data big-endian vs little-endian sign extension Multiplication and division Floating point formats Character Codes

Chemistry Hour Exam 2

MAT 343 Laboratory 1 Matrix and Vector Computations in MATLAB

CS129: Introduction to Matlab (Code)

ConMan. A Web based Conference Manager for Asterisk. How I Managed to get Con'd into skipping my summer vacation by building this thing

CMSC 313 COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE PROGRAMMING LECTURE 02, FALL 2012

Contrast. user s guide

Introduction to MATLAB. CS534 Fall 2016

Computer Vision 2 Exercise 0. Introduction to MATLAB ( )

Feature Moderators Participants

BUCKLEY. User s Guide

UNIVERSITY OF THE FREE STATE DEPARTMENT OF COMPUTER SCIENCE AND INFORMATICS CSIS1614. DATE: 5 March 2015 MARKS: 100 SECTION A (36)

Using non-latin alphabets in Blaise

Second Year March 2017

Adorn. Slab Serif Smooth R E G U LAR. v22622x

More on Plots. Dmitry Adamskiy 30 Nov 2011

Probabilistic analysis of algorithms: What s it good for?

HERIOT-WATT UNIVERSITY DEPARTMENT OF COMPUTING AND ELECTRICAL ENGINEERING. B35SD2 Matlab tutorial 1 MATLAB BASICS

Version /10/2015. Type specimen. Bw STRETCH

Lecture 4 Image Enhancement in Spatial Domain

Getting started with MATLAB

) $ G}] }O H~U. G yhpgxl. Cong

2.0 MATLAB Fundamentals

What is MATLAB? What is MATLAB? Programming Environment MATLAB PROGRAMMING. Stands for MATrix LABoratory. A programming environment

You 2 Software

O Type of array element

Introduction to Matlab

font faq HOW TO INSTALL YOUR FONT HOW TO INSERT SWASHES, ALTERNATES, AND ORNAMENTS

Image Manipulation in MATLAB Due Monday, July 17 at 5:00 PM

ADORN. Roman. v x. user s gu ide

Spring 2010 Instructor: Michele Merler.

Filtering (I) Agenda. Getting to know images. Image noise. Image filters. Dr. Chang Shu. COMP 4900C Winter 2008

Intro To MATLAB. CS Fall 2013 Zach Welch

Sheila. Regular Bold. User s Guide

Introduction to Digital Image Processing

Intensive Course on Image Processing Matlab project

Filtering (I) Dr. Chang Shu. COMP 4900C Winter 2008

CS1114 Assignment 5, Part 1

Adorn. Serif. v x. user s gu ide

III. CLAIMS ADMINISTRATION

Octave Tutorial Machine Learning WS 12/13 Umer Khan Information Systems and Machine Learning Lab (ISMLL) University of Hildesheim, Germany

ČVUT v Praze in Prague. Introduction to MATLAB

124 DISTO pro 4 / pro 4 a-1.0.0zh

The Product Comparison Guide for HP Languages on HP Large-Format Printers

Calligraphic Packing. Craig S. Kaplan. Computer Graphics Lab David R. Cheriton School of Computer Science University of Waterloo. GI'07 May 28, 2007

Transcription:

Dr. Yoram Tal! " # $ $ % & ' Visualization (human) Enhancement, Restoration Analysis (computer) Documents, Textures, Biometrics, Object recognition There are fundamental differences between them 3 Dr. Yoram Tal ( ) * * + 4 2

Dr. Yoram Tal, -.. / 5 Dr. Yoram Tal, -.. / 0 1 1 2 Lena Soderberg (ne Sjooblom) was last reported living in her native Sweden, happily married with three kids and a job with the state liquor monopoly. In 1988, she was interviewed by some Swedish computer related publication, and she was pleasantly amused by what had happened to her picture. That was the first she knew of the use of that picture in the computer business. 6 3

Dr. Yoram Tal 3 4 5 5 6 7 8 4 9 : 6 5 ; Thomas Colthurst O dear Lena, your beauty is so vast It is hard sometimes to describe it fast. I thought the entire world I would impress If only your portrait I could compress. Alas! First when I tried to use VQ I found that your cheeks belong to only you. Your silky hair contains a thousand lines Hard to match with sums of discrete cosines. And your lips, sensual and tactual Thirteen Crays found not the proper fractal. And while these setbacks are all quite severe I might have fixed them with hacks here or there But when filters took sparkle from your eyes I said, Damn all this, Ill just digitize. 7 Dr. Yoram Tal < = >? @ A > B C D B 8 4

Dr. Yoram Tal E F G H I J K L F G M N K O External Irradiation Electromagnetic Acoustic Visible IR UV MW File Degradation Reflected Transmitted X-Rays A/D Sensor Array Focus Emitted Object 9 Dr. Yoram Tal P Q R Q S T U V W T R X Y A digital image is an ordered set of pixels (picture elements, also called pels). A pixel is actually a point that has two components: position and color. Further, pixel position has two components (X,Y) while color is represented by three components, which makes a total of five independent components. The screen representation of an image pixel may contain more (sometimes less) than a single screen point (or screen pixel) per image pixel 10 5

Dr. Yoram Tal Z [ \ ] ^ _ ` a b c d e f g h e g g i 4 neighborhood 8 neighborhood In most cases an image is represented by a 2D matrix Picture Element (pixel) 11 Dr. Yoram Tal j k l k m n o p q In MATLAB, colormaps are tables (2D matrices) of size Mx3, M being the number of colors (rows). By default M=64. Each color (row) is represented by three numbers in [0,1] corresponding to the intensities of the [Red, Green, Blue] components. For example [1,0,0] is red, [1,1,0] is yellow, [0,0,0.5] is dark blue, and so on. In Graylevel maps R=G=B. There are many predefined colormaps (in \matlab\graph3d) such as jet, hsv,hot,pink, autumn, copper, gray, 12 6

Dr. Yoram Tal r s t u u v w u x y u z { z { } ~ ƒ ˆ Š Š Œ Category # of functions Image Display 11 Image File I/O 5 Spatial Transformations 13 Pixel Values and Statistics 10 Image Analysis 4 Image Arithmetic 7 Image Enhancement (Deblurring) 7 Image Registration 5 Linear Filtering 6 Linear 2-D Filter Design 6 Image Transforms 11 ( == major upgradings in MATLAB 6.1 ) Category # of functions Neighborhood and Block Processing 6 Morphological Operations (Intensity and Binary Images) 18 Morphological Operations (Binary Images) 18 Structuring Element (STREL) Creation and Manipulation 8 Deblurring 7 Array Operations 2 Region-Based Processing 4 Colormap Manipulation 6 Color Space Conversions 6 Image Types and Type Conversions 22 Toolbox Preferences 2 See also: IP Toolbox Demos at matlabroot\toolbox\images\imdemos 13 Dr. Yoram Tal Ž Ž š œ ž œ Ÿ ª «± ² ³ µ ³ ¹ º» ¼ ½ ¾ À Á Â Ã Ä Å Æ Ç ¹ È É Ê Ë Ì Í Î Ï Ð Ñ Ò Ó Ô Õ Ö Ø Ù Ú Û Ü Ý Þ ß à á â ã ä å æ á ç è é ç ê ç è é ç ë á â ì í à î 14 7

Dr. Yoram Tal ï ð ñ ò ð ó ô õ ö ø ù ú û ü õ (multi-dimensional) Packed binary Image Data ý þ ÿ 15 Dr. Yoram Tal! " # $ % $ #! & ' ( $ ) >> [x, map] = imread( trees.tif ); >> imshow(x,map) 1 2 3 4 5 6 3 7 3 * +, + -. / 0 16 8

Dr. Yoram Tal 8 9 : ; < = : > =? @ A ; < >> x1 = ind2gray(x,map); >> imshow(x1) 17 Dr. Yoram Tal 8 9 : ; 9 < = : > =? @ A ; < 0.0 0.4 0.6 1.0 9

Dr. Yoram Tal B C D E F G H I J 19 Dr. Yoram Tal B C D K F G H I J Three intensity matrices: R, G, and B 10

Dr. Yoram Tal L M N O P Q R S T U N V image imagesc imshow - Create and display image object. - Scale data and display as image. - Display image. colorbar getimage truesize warp zoom - Display colorbar. - Get image data from axes. - Adjust display size of image. - Display image as texture-mapped surface. - Zoom in and out of image or 2-D plot. 21 Dr. Yoram Tal L M N O P W X Y imread imwrite imshow Z Z [[ [[ \\ ]] ^ ^ `` aa bb aa cc dd ee - Read image type files. - Write image type files. - Load and display an image. - Interactive loading of different files (MATLAB 6). - image file info (IP toolbox 3) 22 11

w Dr. Yoram Tal f g h i j k l m n o p q r s t q s r n.tif.bmp.jpg.png.pcx.gif Header Image Data raster fields blocks u Magic number v width Height Compression info comments colormap Bits per pixel Formats:.tif.bmp.jpg.png.pcx.gif 23 Dr. Yoram Tal x y z { } ~ { } ~ gray2ind im2bw Im2double im2uint8 Im2uint16 ind2gray ind2rgb mat2gray rgb2gray rgb2ind - intensity image to indexed image. - image to binary image by thresholding. - image to double precision. - image to 8-bit unsigned integers. - image to 16-bit unsigned integers. - indexed image to intensity image. - indexed image to RGB image. - matrix to intensity image. - RGB image or colormap to grayscale. - RGB image to indexed image. 24 12

Dr. Yoram Tal ƒ ˆ Š Œ Š Ž Image data Colormap (figure property) Display Direct (indexed) Clim (axes property, NA for direct) scaled scaled...... CDataMapping: scaled or direct (image property) 25 Dr. Yoram Tal ˆ Š Š š œ ž Ÿ ž œ œ Ÿ Ÿ œ 26 13

Dr. Yoram Tal ª «± ² ± ³ µ ¹ º» ¼ ½ ¾ À À Á » Ã Ä Å ½ Æ Ç È É Ê Ë É Ì Í Î Î Ï Ð Ë Ñ É Ê Ò Ó å æ ç è é ê ë ì í î ç ï Ô ÕÖ Õ Ø Ù Ú Û Ü Ù Ý Þ Ô ß à á Ü â ã ä 27 Dr. Yoram Tal ð ñ ò ó ó ô õ ö ó ø ô ô ù ó ô ó ö ú û ü õ ý ú ü ó ö ò þ ÿ 28 14

Dr. Yoram Tal 29 Dr. Yoram Tal! " # $ % 1 2 3 4 2 5 6 7 7 8 9 : ; < Core C D E F G H H I J * +, -. / 0 Interpreter & ' ( ) & ' = >? @ A B User 30 15

Dr. Yoram Tal K L M N O P Q R P S N R T U M P V Selection Vectorization Sparse Matrices 31 Dr. Yoram Tal W X Y X Z [ \ ] ^ _ ` a b c d e f g h i c e h i d j e h k g j l m n o p f i h q r s t u s v r w x u x y z { z u } ~ u t y ƒ ˆ š œ Š Œ Ž ˆ 32 16

Í Ø, Dr. Yoram Tal ž Ÿ Ÿ ¹ º» ¼ ½ ¾ À Á Â Ã Ä Å Æ Ç È É Ê È Ë Ì Í Î ÏÐ Ñ Ò Ó Î Í Î Ô Õ Ë Ì ÏÎÖ Ð Ñ [ ] ª ª ª ª ««± ± ² ² ³ ³ ««ªª ªª ³³ ³ ³ ª ª ³³ ² ² µ µ ³ ³ é ê ëì í î ï ï ð ï ð ñ ð ò ó ô õ ö ø ù ú û ü ý þ ÿ ù û ü Ù Ú Û Ü Ý Þ ß Û à á â ã ä å æ ç è æ ç è å â ã ä 33 Dr. Yoram Tal 2 3 4 ( / 5 6 * 7 8 ) 2 3 4 ( / 5 6 4 / * 5 7 8 ( ) +,!! "" ## $ $ $$ %% $ $ $$ ## && $ $ ' ( ) 0 1 * +, -. / 2 3 ( 9/ 9, 7 8 4 ' 6-6 + 6 ) 5 [ ] 2 3 4 ( / 5 6 4 * * * 5 7 8 ) ) ) [ ] [,,, ] 34 17

Dr. Yoram Tal : ; < ; = >? @ A B C D N O E F G H I J K L M U V [ \ ] ^ _ ` a b c d e f g W X Y Z ƒ Y Œ ƒ ˆ ˆ W ˆ ƒ Š Š W a h i j k l m l i n o j p q r i l o l s j h p t u v w x y z { x x } ~ z { S T Q QRP Dr. Yoram Tal Ž š œ ž Ÿ ž ž x y 1. 0.0804 0.7751 2. 0.0986 0.8062 3. 0.1626 0.8206 4. 0.2311 0.8206 5. 0.3361 0.8182 6. 0.3498 0.9211 7. 0.3817 0.8206 8. 0.4114 0.7632............. n 2 i+ 1 i i i+ 1 ± ² ª «³ ± ² i= 1 µ ¹ º µ ¹ 9. 0.4091 0.7081 S = ( x y x y ) 18

` ` b b a a ` ` Dr. Yoram Tal» ¼ ½ ¾ À Á Â Ã ¾ Á Ä Å Æ Ç È É Ê Ë È Ì Í Î Ï Ð È È É Ñ Ò Ó Ô Õ Ö Ô Ó Ø Ù Ô Ú Û Ü Ý Ú Ô Þ Ò Ó Ô Õ Ö ß à Ó á Ö à ß Ø â ã ä å æ ç è é ê ë ì í é ê î ï í ð ñ ò è é ê ë ï í é ê î ó ë ô î õ ö ø ù ú û ë é üñ ý þ ÿ þ 37 ^ _ Dr. Yoram Tal! " # $ % & ' & ( & " ) * & ' & ( & " +, -. b c d ^ b _ ` e ^ f _ b e ^ g _ f h ^ ` _ b h ^ b _ f h ^ f _ g / 0 1 2 3 4 5 4 6 7 8 9 : ; < = >? @ A B C D E F G E H I F J K L M E F G N O P Q R S T U V W W X Y Z Y [ \ ] 38 19

Dr. Yoram Tal i j k l m n o p q l o m r s t u v w x y v z { } y z z ~ w v x ƒ ˆ Š Œ Ž ˆ Š Œ ˆ Š Œ Ž ˆ Š Œ ƒ ƒ 39 Dr. Yoram Tal š œ 40 20

Background Command Window Workspace = set of variables Workspace Browser = shows variables Array Editor = double click on variable for more info current directory search path for m files; set path from file menu Command History Windows = current and previous sessions

Background MATLAB editor = edit in command window HELP - click on? on desktop toolbar - type help browser navigator pane display pane e.g. search tab doc e.g. doc format shows format command

Images picture is given as a matrix (0,0) or (1,1) is upper left corner (0,1) is top row second column second index is rows (C) f(x,y) is intensity at (x,y)=(r,c) types: TIFF,JPEG,GIF,BMP,PNG,XWD PNG: Portable Network Graphics;.png XWD: X Window Dump;.xwd

Simple Commands read image: f=imread( chestxray.jpg ); f=imread ( d:\ myimages\ chestxray. j pg ); [M, N] = size(f); whos; imshow(f); use impixel to get intensity of individual pixel - use with mouse MATLAB replaces next picture in same spot. To get a new graph use figure

imshow(f), figure, imshow(g) imwrite(f, patient, tif ); or else imwrite(f, patient.tif ); options to change intensity range and compression imfinfo bubbles25.jpg or K=imfinfo( bubbles25.jpg );

Data Classes double = double precision; 8 bytes per element uint8 = unsigned 8 bit integer [0,255] byte per element uint16= unsigned 8 bit integer [0,65535] 2 bytes per element uint32= unsigned 8 bit integer [0,65535] 4 bytes per element int8 = signed 8 bit integer [-128,127] int16 int32

single = single precision; 4 bytes per element char = Characters ; 2 bytes per element logical= 0 or 1; 1 byte per element

Image Types intensity images binary images indexed images RGB images conversion between classes im2uint8 : to uint8 im2uint16: to uint16

mat2gray: from double to double in [0,1 ] im2double: to double im2bw : to logical (binary)

Array indexing v=[1 3 5 7 9]; row vector w= v. ; column vector v(1:3) ----- 1 3 5 v(3:end) ----- 5 7 9 v(:) column vector v(1:end) row vector v(1:2:end) all odd components 1 5 9

v(end:-2:1) all odd components backwards 9 5 1 x = linspace(a, b, n); reshape changes size of matrix In general, RESHAPE(X,SIZ) returns an N-D array with the same elements as X but reshaped to the size SIZ. PROD(SIZ) must be the same as PROD(SIZE(X)).

Matrix indexing A=[1 2 3; 4 5 6; 7 8 9]; 3 x 3 matrix A(2, 3 ) ----- 6 C3 = A(:,3) yields 3rd column (column vector) R2 = A(2, : ) yields 2nd row (row vector) s= sum(a); column vector with sum of each row s= sum(a(:)); or sum(sum(a)) sum of entire matrix

Applications to Images fp = f(end:-1:1, :); flips image vertically (1 st index is columns) fc = f(257:768, 267:768); crops picture fs = f(1:2:end, 1:2,end) subsample

standard matrices zeros(m,n) M columns N rows ones (M, N ) true (M,N) false(m, N ) - rand (M,N) uniformly distributed in [0 1] randn(m,n) normally (Gaussian) distributed - mean 0 variance 1

m files filename.m created with text editor function body comments

function [s, p] = sumprod (f,g) where f,g are two images and s and p are their sum and product H1 is first text line. It is a single comment line help sumprod H 1 line for example: SUMPROD computes the sum and product of two images m files can be created with any text editor edit sumprod opens meditor editor

Arithmetic Operators A*B matrix multiplication A.*B element by element multiplication imadd adds 2 images imsubtract, immultiply,imdivide (element by element)

Relational Operators A==B gives 1 where the elements are the same and 0 otherwise > = gives 1 where the elementof A is larger than B otherwise 0 A&B gives 1 where the both elements are zero and 0 otherwise pi and i=sqrt(-1) are pre-defined

Flow Control if expression statements end for index=start:increment:end while expression statements end break switch expression case end

Loops Example: if (isinf (x) isreal (x) disp ( Bad input ) y = Nan; elseif (x==round (x) ) && (x>0) y = prod (1 : x-1) ; else y = gamma (x) ; end && ( logical AND ) ( logical OR) ( logical (NO

switch units case length disp ( meters ) case volume disp ( liters ) case time disp ( seconds ) otherwise di sp ( I give up ) end

x=1:100; s=0; for j=find (isprime (x) ) s = s+ x(j); end Finds sum of all primes less than 100 (alternativesum(find(iprime(1:100))); ) n=0 while x>1 x=x/2; n=n+1 i f ( n> 5 0, break, end end

Vectorization x=1:m f(x)=sin((x-1)/(2*pi)) [C,R] =meshgrid(c,r); rows of C are copies of c and columns of R are copies of r example r=[0 1 2] c=[0 1] h=r.ˆ2 + C.ˆ2yields 01 12 45 preallocate arrays f=zeros(1024);

Interactive I/O disp(a); displays matrix A on screen t=input( message ); n=str2num(t)