digital image processing lab 1

19
Presented by: Presented by: Dr. Moe Moe Myint [email protected] Information Technology Department Technological University (Kyaukse), Myanmar

Upload: moe-moe-myint

Post on 18-Jan-2017

142 views

Category:

Engineering


3 download

TRANSCRIPT

Page 1: Digital image processing lab 1

Presented by:Presented by:Dr. Moe Moe Myint

[email protected] Technology Department

Technological University (Kyaukse), Myanmar

Page 2: Digital image processing lab 1

Only Original Owner has full rights reserved for copied images.

This PPT is only for fair academic use.

Page 3: Digital image processing lab 1

How to read and display image

How to enhance an image

How to write MATLAB code

How to study Image Processing Toolbox with MATLAB

Let’s use MATLAB programming software

M. M. Myint

Page 4: Digital image processing lab 1

M. M. Myint

Page 5: Digital image processing lab 1

MATLAB

Matrix

Laboratory

MATLAB was originally written to provide easy access to matrix software developed by the LINPACK and EISPACK projects.

What is MATLAB?

M. M. Myint

Page 6: Digital image processing lab 1

MATLAB is a high-performance language for technical computing. It integrates computation, visualization, and programming in an easy-to-use environment where problems and solutions are expressed in familiar mathematical notation. Typical uses include• Math and computation• Algorithm development• Data acquisition• Modeling, simulation, and prototyping• Data analysis, exploration, and visualization• Scientific and engineering graphics• Application development, including graphical user interface building

Overview of MATLAB

M. M. Myint

Page 7: Digital image processing lab 1

Command WindowCommand Window

Command HistoryCommand History

Memu BarMemu Bar

Current DirectoryCurrent Directory

Work SpaceWork Space

M. M. Myint

Page 8: Digital image processing lab 1

MATLAB : Long term calls MATrix LABoratory. It is not like that C,C++,FORTRAN Programming language.(that is

MATLAB is BASIC)Everybody can afford to study this MATLAB who have the basic of

programming knowledge. Educated persons and Engineers in every field use MATLAB that it

is also used to write simple program to simulation program.MATLAB is an interactive program for scientific and engineering

calculation.For example, differential equation… If it is difficult to solve it by analytical methods, we use MATLAB

solvers ,Symbolic math toolbox and Simulink in MATLAB.

M. M. Myint

Page 9: Digital image processing lab 1

Enter MATLAB functions at the Command Window prompt

The Command History Maintains a record of the MATLAB functionsyou run

Workspace<512x512 uint8>

Current Directory

Page 10: Digital image processing lab 1

M. M. Myint

Page 11: Digital image processing lab 1

Reading and Writing Images (Lab 1)

- Introduces some basic image processing concepts- starts by reading an image into the MATLAB workspace- performs some contrast adjustment on the image-Writes the adjusted image to a file

Dr. Moe Moe MyintInformation Technology DepartmentTechnological University (Kyaukse)

Page 12: Digital image processing lab 1

To clear the MATLAB workspace of any variables and close open figure windows close all, clear all, clc

To read an image, use the imread commandI=imread(‘pout.tif’);

To display the image, use the imshow commandimshow(I);

title(‘Grayscale Image’)imtool(I)

M. M. Myint

Page 13: Digital image processing lab 1

To see how the imread function stores the image data in the workspace

Return the image data in the variable I, which is a 291-by-240 element array of uint8 data

To get information about variables in the workspace by calling the whos command

Name Size Bytes Class Attributes I 291x240 69840 uint8

M. M. Myint

Page 14: Digital image processing lab 1

To see the distribution of intensities in pout.tif, use the imhist function

figure, imhist(I)Notice how the intensity range is rather narrow.

To improve the contrast in an image, do the histogram equalization

I2 = histeq(I);Display the new equalized image, I2, in a new

figure windowfigure, imshow(I2)figure,imhist(I2)

M. M. Myint

Page 15: Digital image processing lab 1

To write the newly adjusted Image I2 to a disk file, use the imwrite function

imwrite(I2, ‘pout2.png’);

M. M. Myint

Page 16: Digital image processing lab 1

To see what imwrite wrote to the disk file, use the imfinfo function

imfinfo('pout2.png')

(The imfinfo fucntion returns information about the image in the file, such as its format, size, width, and height.)

M. M. Myint

Page 17: Digital image processing lab 1

TIFF

JPG

PNG

Page 18: Digital image processing lab 1
Page 19: Digital image processing lab 1