Digital Image Processing. Converting between Data Classes The general syntax is B = data_class_name (A) Where data_class_name is one of the names defined.

Slides:



Advertisements
Similar presentations
2.3 Modeling Real World Data with Matrices
Advertisements

Chapter Matrices Matrix Arithmetic
Introduction to Matlab
Maths for Computer Graphics
EGR 106 – Week 2 – Arrays Definition, size, and terminology Construction methods Addressing and sub-arrays Some useful functions for arrays Character arrays.
CIS 101: Computer Programming and Problem Solving Lecture 2 Usman Roshan Department of Computer Science NJIT.
Part 3 Chapter 8 Linear Algebraic Equations and Matrices PowerPoints organized by Dr. Michael R. Gustafson II, Duke University All images copyright © The.
Module 6 Matrices & Applications Chapter 26 Matrices and Applications I.
Matrix Definition A Matrix is an ordered set of numbers, variables or parameters. An example of a matrix can be represented by: The matrix is an ordered.
Matrices The Basics Vocabulary and basic concepts.
Lecture 7: Matrix-Vector Product; Matrix of a Linear Transformation; Matrix-Matrix Product Sections 2.1, 2.2.1,
Intro to Matrices Don’t be scared….
Arithmetic Operations on Matrices. 1. Definition of Matrix 2. Column, Row and Square Matrix 3. Addition and Subtraction of Matrices 4. Multiplying Row.
CE 311 K - Introduction to Computer Methods Daene C. McKinney
Chapter 7 Matrix Mathematics Matrix Operations Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Data Types Data types: Fundamental data-type in Matlab is array or Matrix. It also consists of integers, doubles, character strings, structures and cells.
Matlab tutorial course Lesson 2: Arrays and data types
MATLAB INTRO CONTROL LAB1  The Environment  The command prompt Getting Help : e.g help sin, lookfor cos Variables Vectors, Matrices, and Linear Algebra.
Introduction to MATLAB Session 1 Prepared By: Dina El Kholy Ahmed Dalal Statistics Course – Biomedical Department -year 3.
4-1 Matrices and Data Warm Up Lesson Presentation Lesson Quiz
Matlab Chapter 2: Array and Matrix Operations. What is a vector? In Matlab, it is a single row (horizontal) or column (vertical) of numbers or characters.
CSE123 Lecture 5 Arrays and Array Operations. Definitions Scalars: Variables that represent single numbers. Note that complex numbers are also scalars,
A rectangular array of numbers (we will concentrate on real numbers). A nxm matrix has ‘n’ rows and ‘m’ columns What is a matrix? First column First row.
Learner’s Guide to MATLAB® Chapter 2 : Working with Arrays.
Lecture 28: Mathematical Insight and Engineering.
13.1 Matrices and Their Sums
Company LOGO Chapter 1: Matrix, Determinant, System of linear equations Module 1: Matrix Natural Science Department Example 1: The following rectangular.
Chapter 4 Review: Manipulating Matrices Introduction to MATLAB 7 Engineering 161.
Digital Image Processing Lecture4: Fundamentals. Digital Image Representation An image can be defined as a two- dimensional function, f(x,y), where x.
Prepared by Deluar Jahan Moloy Lecturer Northern University Bangladesh
Chapter 2 Creating Arrays Legend: MATLAB command or syntax : Blue MATLAB command OUTPUT : LIGHT BLUE.
ES 240: Scientific and Engineering Computation. Chapter 8 Chapter 8: Linear Algebraic Equations and Matrices Uchechukwu Ofoegbu Temple University.
Meeting 18 Matrix Operations. Matrix If A is an m x n matrix - that is, a matrix with m rows and n columns – then the scalar entry in the i th row and.
4.1 Using Matrices Warm-up (IN) Learning Objective: to represent mathematical and real-world data in a matrix and to find sums, differences and scalar.
LESSON 3 MATRICES Azalya Rahmatika Fathul Fithrah JURUSAN MATEMATIKA FAKULTAS MATEMATIKA DAN ILMU PENGETAHUAN ALAM UNIVERSITAS SYIAH KUALA DARUSSALAM,
Unit 1 MATRICES Dr. Shildneck Fall, WHAT IS A MATRIX? A Matrix is a rectangular array of numbers placed inside brackets. A Matrix is a rectangular.
Digital Image Processing Introduction to MATLAB. Background on MATLAB (Definition) MATLAB is a high-performance language for technical computing. The.
1.3 Matrices and Matrix Operations. A matrix is a rectangular array of numbers. The numbers in the arry are called the Entries in the matrix. The size.
Unit 3 Matrix Arithmetic IT Disicipline ITD 1111 Discrete Mathematics & Statistics STDTLP 1 Unit 3 Matrix Arithmetic.
Section 9-1 An Introduction to Matrices Objective: To perform scalar multiplication on a matrix. To solve matrices for variables. To solve problems using.
1 Lecture 3 Post-Graduate Students Advanced Programming (Introduction to MATLAB) Code: ENG 505 Dr. Basheer M. Nasef Computers & Systems Dept.
MATRIX A set of numbers arranged in rows and columns enclosed in round or square brackets is called a matrix. The order of a matrix gives the number of.
Linear System of Simultaneous Equations Warm UP First precinct: 6 arrests last week equally divided between felonies and misdemeanors. Second precinct:
14.1 Matrix Addition and Scalar Multiplication OBJ:  To find the sum, difference, or scalar multiples of matrices.
Designed by Victor Help you improve MATRICES Let Maths take you Further… Know how to write a Matrix, Know what is Order of Matrices,
Matrices. Variety of engineering problems lead to the need to solve systems of linear equations matrixcolumn vectors.
CS 285- Discrete Mathematics Lecture 11. Section 3.8 Matrices Introduction Matrix Arithmetic Transposes and Power of Matrices Zero – One Matrices Boolean.
2.1 Matrix Operations 2. Matrix Algebra. j -th column i -th row Diagonal entries Diagonal matrix : a square matrix whose nondiagonal entries are zero.
ENG College of Engineering Engineering Education Innovation Center 1 Arrays in MATLAB Topics Covered: 1.Creating arrays of numbers vectors matrices.
Matrices. Matrix A matrix is an ordered rectangular array of numbers. The entry in the i th row and j th column is denoted by a ij. Ex. 4 Columns 3 Rows.
LAB 2 Vectors and Matrices Dr.Abdel Fattah FARES.
MTH108 Business Math I Lecture 20.
1.5 Matricies.
L5 matrix.
CS 1674: Intro to Computer Vision Linear Algebra Review
Digital Image Processing using MATLAB
Introduction to Matrices
2. Matrix Algebra 2.1 Matrix Operations.
Vectors and Matrices I.
Introduction to MATLAB [Vectors and Matrices] Lab 2
Digital Image Processing
CSE107 Matlab Introduction
2.2 Introduction to Matrices
Array and Matrix Functions
Arrays and Matrices in MATLAB
3.5 Perform Basic Matrix Operations
Chapter 4 Matrices & Determinants
Matrices in MATLAB Dr. Risanuri Hidayat.
EECS Introduction to Computing for the Physical Sciences
Arrays and Matrices Prof. Abdul Hameed.
Presentation transcript:

Digital Image Processing

Converting between Data Classes The general syntax is B = data_class_name (A) Where data_class_name is one of the names defined in the previous lecture for Data Classes Ex: B = double (A) D = uint8(C) Note: Take into consideration the data range for each of the data classes before conversion

Array Indexing - Vector Vector Indexing –As discussed before, an array of dimension 1xN is called a row vector, while an array of dimension Mx1 is called a column vector. –To refer to any element in a vector v, we use the notation v(1) for the first element, v(2) for the second and so on.

Array Indexing - Vector Example of Vector Indexing >> v = [ ] v = >> v(2) ans = 3

Array Indexing - Vector To transpose a row vector into a column vector: >> w = v.’ // use the operand (.’) w =

Array Indexing - Vector To access blocks of elements, use (:) >> v(1:3) ans = >> v(3:end) ans = 5 7 9

Array Indexing - Vector If v is a vector, writing >> v(:) produces a column vector, whereas writing >> v(1:end) produces a row vector

Array Indexing - Vector Indexing is not restricted to contiguous elements, for example: >> v(1:2:end) ans = 15 9 >> v(end:-2:1) ans = 9 5 1

Array Indexing - Vector Indexing a vector by another vector >> v([1 4 5]) ans = 1 7 9

Array Indexing – Matrix Matrix Indexing Matrices can be represented in MATLAB as a sequence of row vectors enclosed by square brackets and separated by semicolons. >> A = [1 2 3; 4 5 6; 7 8 9] // 3x3 matrix A =

Array Indexing – Matrix We select elements in a matrix just as we did for vectors, but now we need two indices; one for the row location, and the other for the column location >> A (2,3) ans = 6

Array Indexing – Matrix To select a whole column: >> C3 = A(:, 3) C3 = To select a whole row: >> R3 = A(2,:) R3 = 4 5 6

Array Indexing – Matrix To indicate the top two rows: >> T2 = A(1:2, 1:3) T2 = To indicate the left two columns >> L2 = A(1:3, 1:2)

Array Indexing – Matrix To create a matrix B equal to A but with its last column set to 0s, we write: >> B = A; >> B(:,3) = 0 B =

Array Indexing – Matrix Using “end” operand in Matrices >> A (end, end) ans = 9 >> A (end, end -2)//(3,1) ans = 7 >> A (2:end, end:-2:1) ans =

Array Indexing – Matrix Using vectors to index into a matrix >> E = A ([1 3], [2 3]) E =

Array Indexing – Matrix Indexing a matrix using a logical matrix >> D = logical ([1 0 0; 0 0 1; 0 0 0]) D = >> A (D) ans = 1 6

Array Indexing – Matrix To display all matrix elements in one column, we use (:) to index the matrix >> V = T2 (:) V = This can be helpful when, for example, we want to find the sum of all the elements of a matrix >> s = sum (A(:)) s= 45

Some Important Standard Arrays zeros (M,N), generates an MxN matrix of 0s of class double. ones(M,N), generates an MxN matrix of 1s of class double. true(M,N), generates an MxN logical matrix of 1s. false(M,N), generates an MxN logical matrix of 0s. magic(M), generates an MxM “magic square”. This is a square array in which the sum along any row, column or main diagonal, is the same. The generated numbers are integers. rand(M,N), generates an MxN matrix whose entries are uniformly distributed random numbers in the interval [0,1]. randn(M,N), generates an MxN matrix whose numbers are normally distributed random numbers with mean 0 and varience 1. length(A), return the size of the longest dimension of an array A numel(A), return the number of elements in an array directly. ndims(A), return the dimensions of array A.

Pixel information: >>imshow(image) >>impixelinfo This function is used to display the intensity values of individual pixel interactively. Moving the cursor, the coordinates of the cursor position and the corresponding intensity vales are shown.