by shahid farid - diunitofarid/teaching/dip/lecture - 1.pdf · text book: digital image processing,...

45
by Shahid Farid Session – 1

Upload: others

Post on 05-Jun-2020

13 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: by Shahid Farid - DiUniTofarid/teaching/DIP/Lecture - 1.pdf · Text book: Digital Image Processing, 3Digital Image Processing, 3 rrddrd Ed. (DIP/3e) b(DIP/3e) by Gonzalez and Woods

by

Shahid Farid

Session – 1

Page 2: by Shahid Farid - DiUniTofarid/teaching/DIP/Lecture - 1.pdf · Text book: Digital Image Processing, 3Digital Image Processing, 3 rrddrd Ed. (DIP/3e) b(DIP/3e) by Gonzalez and Woods

� Course introduction

� What is image and its attributes?

� Image types◦ Monochrome images

◦ Grayscale images

◦ Color images

� Color lookup table

� Image Histogram

2© Shahid Farid, PUCIT

Course introduction

Page 3: by Shahid Farid - DiUniTofarid/teaching/DIP/Lecture - 1.pdf · Text book: Digital Image Processing, 3Digital Image Processing, 3 rrddrd Ed. (DIP/3e) b(DIP/3e) by Gonzalez and Woods

� The aim of this course is to ◦ Introduce the basic theory of digital processing of

images.

◦ Expose students to exciting applications of image processing.

◦ To develop experience in coding image processing algorithms.

© Shahid Farid, PUCIT 3

Page 4: by Shahid Farid - DiUniTofarid/teaching/DIP/Lecture - 1.pdf · Text book: Digital Image Processing, 3Digital Image Processing, 3 rrddrd Ed. (DIP/3e) b(DIP/3e) by Gonzalez and Woods

� Text book: Digital Image Processing, 3Digital Image Processing, 3Digital Image Processing, 3Digital Image Processing, 3rdrdrdrd Ed. Ed. Ed. Ed. (DIP/3e) b(DIP/3e) b(DIP/3e) b(DIP/3e) by Gonzalez and Woods

� Reference books:◦ Digital Image Processing, Kenneth R. Castleman, Prentice

Hall, 1996

◦ Digital Image Processing and Applications, I. Pitas, John Wiley, 2000

◦ Digital Image Processing/3E, William K. Pratt, John Wiley, 2001

� Plus some handouts and tools

© Shahid Farid, PUCIT 4

Page 5: by Shahid Farid - DiUniTofarid/teaching/DIP/Lecture - 1.pdf · Text book: Digital Image Processing, 3Digital Image Processing, 3 rrddrd Ed. (DIP/3e) b(DIP/3e) by Gonzalez and Woods

� Introductory digital image processing class

� Pre-requisites◦ Linear Algebra

◦ Signals & Systems

© Shahid Farid, PUCIT 5

Page 6: by Shahid Farid - DiUniTofarid/teaching/DIP/Lecture - 1.pdf · Text book: Digital Image Processing, 3Digital Image Processing, 3 rrddrd Ed. (DIP/3e) b(DIP/3e) by Gonzalez and Woods

� Homeworks:◦ Both written as well as programming assignments

� Programming Environment◦ MATLAB or C/C++

� Lectures 32 of 90 minutes each

� – Midterm

� – Final

� No grade for attendance

� Short Quizzes

� Projects (Research and Development)

© Shahid Farid, PUCIT 6

Page 7: by Shahid Farid - DiUniTofarid/teaching/DIP/Lecture - 1.pdf · Text book: Digital Image Processing, 3Digital Image Processing, 3 rrddrd Ed. (DIP/3e) b(DIP/3e) by Gonzalez and Woods

� Assignments are on individual-submission basis◦ Can discuss with your class fellows, subject to the

following conditions:

� Discussion participants should be acknowledged on the first page of submission

� Solution should be written up individually, without ‘coping’ from another solution or referring to someone else’s work

◦ Help from books, websites should be referenced.

� Cheating is not an honorable thing to do!

� Of course, any suspected cases of cheating or plagiarism will be sent to the DC

© Shahid Farid, PUCIT 7

Page 8: by Shahid Farid - DiUniTofarid/teaching/DIP/Lecture - 1.pdf · Text book: Digital Image Processing, 3Digital Image Processing, 3 rrddrd Ed. (DIP/3e) b(DIP/3e) by Gonzalez and Woods

� There is no clear boundary between Image Processing and Computer Vision

� However, CV deals with more ‘higher’ level processing

© Shahid Farid, PUCIT 8

Page 9: by Shahid Farid - DiUniTofarid/teaching/DIP/Lecture - 1.pdf · Text book: Digital Image Processing, 3Digital Image Processing, 3 rrddrd Ed. (DIP/3e) b(DIP/3e) by Gonzalez and Woods

� To facilitate storage and transmission◦ Compression, quality

� Prepare images for display or printing◦ e.g. half-toning

� Enhancement and restoration◦ Noise removal, quality, sharpness

� Extract information from images◦ Image understanding

◦ Comparison of images to find changes

© Shahid Farid, PUCIT 9

Page 10: by Shahid Farid - DiUniTofarid/teaching/DIP/Lecture - 1.pdf · Text book: Digital Image Processing, 3Digital Image Processing, 3 rrddrd Ed. (DIP/3e) b(DIP/3e) by Gonzalez and Woods

� Image Enhancement

© Shahid Farid, PUCIT 10

Page 11: by Shahid Farid - DiUniTofarid/teaching/DIP/Lecture - 1.pdf · Text book: Digital Image Processing, 3Digital Image Processing, 3 rrddrd Ed. (DIP/3e) b(DIP/3e) by Gonzalez and Woods

� Hubble Space Telescope suffered from spherical aberration when it was launched. However, its images were digitally corrected. Later, the telescope was repaired optically by astronauts

© Shahid Farid, PUCIT 11

Page 12: by Shahid Farid - DiUniTofarid/teaching/DIP/Lecture - 1.pdf · Text book: Digital Image Processing, 3Digital Image Processing, 3 rrddrd Ed. (DIP/3e) b(DIP/3e) by Gonzalez and Woods

� Another example from HST

© Shahid Farid, PUCIT 12

Page 13: by Shahid Farid - DiUniTofarid/teaching/DIP/Lecture - 1.pdf · Text book: Digital Image Processing, 3Digital Image Processing, 3 rrddrd Ed. (DIP/3e) b(DIP/3e) by Gonzalez and Woods

� Color Image Restoration

© Shahid Farid, PUCIT 13

Page 14: by Shahid Farid - DiUniTofarid/teaching/DIP/Lecture - 1.pdf · Text book: Digital Image Processing, 3Digital Image Processing, 3 rrddrd Ed. (DIP/3e) b(DIP/3e) by Gonzalez and Woods

� Noise Removal

© Shahid Farid, PUCIT 14

Page 15: by Shahid Farid - DiUniTofarid/teaching/DIP/Lecture - 1.pdf · Text book: Digital Image Processing, 3Digital Image Processing, 3 rrddrd Ed. (DIP/3e) b(DIP/3e) by Gonzalez and Woods

© Shahid Farid, PUCIT 15

Page 16: by Shahid Farid - DiUniTofarid/teaching/DIP/Lecture - 1.pdf · Text book: Digital Image Processing, 3Digital Image Processing, 3 rrddrd Ed. (DIP/3e) b(DIP/3e) by Gonzalez and Woods

© Shahid Farid, PUCIT 16

Page 17: by Shahid Farid - DiUniTofarid/teaching/DIP/Lecture - 1.pdf · Text book: Digital Image Processing, 3Digital Image Processing, 3 rrddrd Ed. (DIP/3e) b(DIP/3e) by Gonzalez and Woods

© Shahid Farid, PUCIT 17

Page 18: by Shahid Farid - DiUniTofarid/teaching/DIP/Lecture - 1.pdf · Text book: Digital Image Processing, 3Digital Image Processing, 3 rrddrd Ed. (DIP/3e) b(DIP/3e) by Gonzalez and Woods

© Shahid Farid, PUCIT 18

Page 19: by Shahid Farid - DiUniTofarid/teaching/DIP/Lecture - 1.pdf · Text book: Digital Image Processing, 3Digital Image Processing, 3 rrddrd Ed. (DIP/3e) b(DIP/3e) by Gonzalez and Woods

© Shahid Farid, PUCIT 19

Page 20: by Shahid Farid - DiUniTofarid/teaching/DIP/Lecture - 1.pdf · Text book: Digital Image Processing, 3Digital Image Processing, 3 rrddrd Ed. (DIP/3e) b(DIP/3e) by Gonzalez and Woods

� Morphing

© Shahid Farid, PUCIT 20

Page 21: by Shahid Farid - DiUniTofarid/teaching/DIP/Lecture - 1.pdf · Text book: Digital Image Processing, 3Digital Image Processing, 3 rrddrd Ed. (DIP/3e) b(DIP/3e) by Gonzalez and Woods

� Digital Image is an electronic snapshots taken of a scene or scanned from documents, such as photographs, manuscripts, printed texts, and artwork.

� The digital image is sampled and mapped as a grid of dots or picture elements (pixels).

21© Shahid Farid, PUCIT

Page 22: by Shahid Farid - DiUniTofarid/teaching/DIP/Lecture - 1.pdf · Text book: Digital Image Processing, 3Digital Image Processing, 3 rrddrd Ed. (DIP/3e) b(DIP/3e) by Gonzalez and Woods

� Image can be defined as a 2-D function f(x,y), where x and y are spatial coordinates and the amplitude of f at any pair of coordinates (x,y) is called the intensity of the image at that point◦ When the image is gray scale, intensity values

represent the range of shades from black to white.

◦ For a color image the intensity values are represented as a combination of R, G, B

22© Shahid Farid, PUCIT

Page 23: by Shahid Farid - DiUniTofarid/teaching/DIP/Lecture - 1.pdf · Text book: Digital Image Processing, 3Digital Image Processing, 3 rrddrd Ed. (DIP/3e) b(DIP/3e) by Gonzalez and Woods

� Resolution refers to the number of pixels in an image

� Resolution is sometimes identified by ◦ The width and height of the image as well as ◦ The total number of pixels in the image

� For example, an image that is 2048 pixels wide and 1536 pixels high (2048 � 1536) contains 3,145,728 pixels (or 3.1 Megapixels).

� You could call it a 2048 � 1536 or a 3.1 Megapixel image.

23© Shahid Farid, PUCIT

Page 24: by Shahid Farid - DiUniTofarid/teaching/DIP/Lecture - 1.pdf · Text book: Digital Image Processing, 3Digital Image Processing, 3 rrddrd Ed. (DIP/3e) b(DIP/3e) by Gonzalez and Woods

� ResolutionResolutionResolutionResolution is the number of pixels in a linear inch (i.e. pixels per inch or ppi). The more pixels per inch (ppippippippi), the higher your image resolution will be.

24© Shahid Farid, PUCIT

Page 25: by Shahid Farid - DiUniTofarid/teaching/DIP/Lecture - 1.pdf · Text book: Digital Image Processing, 3Digital Image Processing, 3 rrddrd Ed. (DIP/3e) b(DIP/3e) by Gonzalez and Woods

� ResolutionResolutionResolutionResolution of an image display device or printing device is different from image resolution.

� The resolution of such devices is described in dots per inch (dpi).

25© Shahid Farid, PUCIT

Page 26: by Shahid Farid - DiUniTofarid/teaching/DIP/Lecture - 1.pdf · Text book: Digital Image Processing, 3Digital Image Processing, 3 rrddrd Ed. (DIP/3e) b(DIP/3e) by Gonzalez and Woods

� If your monitor is set to 800 � 600 and

� You open up an image that is 640 � 480,

� It will only fill up a part of your screen.

� What if you open up an image that is 2048 �1536?

26© Shahid Farid, PUCIT

Page 27: by Shahid Farid - DiUniTofarid/teaching/DIP/Lecture - 1.pdf · Text book: Digital Image Processing, 3Digital Image Processing, 3 rrddrd Ed. (DIP/3e) b(DIP/3e) by Gonzalez and Woods

� What if you open up an image that is 2048 �1536?

� You will find yourself moving the slider bar around to see all the different parts of the image. (see 2560X1600 image)

27© Shahid Farid, PUCIT

Page 28: by Shahid Farid - DiUniTofarid/teaching/DIP/Lecture - 1.pdf · Text book: Digital Image Processing, 3Digital Image Processing, 3 rrddrd Ed. (DIP/3e) b(DIP/3e) by Gonzalez and Woods

� You have a 640 � 480 image and

� You want to print it at 200 dpi (dots or pixels per inch).

� What will be the size of the printed image?

28© Shahid Farid, PUCIT

Page 29: by Shahid Farid - DiUniTofarid/teaching/DIP/Lecture - 1.pdf · Text book: Digital Image Processing, 3Digital Image Processing, 3 rrddrd Ed. (DIP/3e) b(DIP/3e) by Gonzalez and Woods

� What will be the size of the printed image?

� 640 / 200 = 3.2 and

� 480 / 200 = 2.4

� So, the size of the printed image is 3.2" � 2.4”

29© Shahid Farid, PUCIT

Page 30: by Shahid Farid - DiUniTofarid/teaching/DIP/Lecture - 1.pdf · Text book: Digital Image Processing, 3Digital Image Processing, 3 rrddrd Ed. (DIP/3e) b(DIP/3e) by Gonzalez and Woods

30© Shahid Farid, PUCIT

300 PPI / 600 x 600 pixel dimension

2 inches

72 PPI / 144 x 144 pixel dimension

30 PPI / 60 x 60 pixel dimension

Page 31: by Shahid Farid - DiUniTofarid/teaching/DIP/Lecture - 1.pdf · Text book: Digital Image Processing, 3Digital Image Processing, 3 rrddrd Ed. (DIP/3e) b(DIP/3e) by Gonzalez and Woods

© Shahid Farid, PUCIT 31

Page 32: by Shahid Farid - DiUniTofarid/teaching/DIP/Lecture - 1.pdf · Text book: Digital Image Processing, 3Digital Image Processing, 3 rrddrd Ed. (DIP/3e) b(DIP/3e) by Gonzalez and Woods

� The number of bits used to define a pixel.

� The greater the bit depth, the greater the number of tones (grayscale or color) that can be represented.

� For example, an image with a bit depth of 1 has pixels with two possible values: black and white.

� An image with a bit depth of 8 has 28, or 256, possible values.

© Shahid Farid, PUCIT 32

Page 33: by Shahid Farid - DiUniTofarid/teaching/DIP/Lecture - 1.pdf · Text book: Digital Image Processing, 3Digital Image Processing, 3 rrddrd Ed. (DIP/3e) b(DIP/3e) by Gonzalez and Woods

� Simplest type of image

� Each pixel consist of only 0/1information

� Called 1-bit monochrome (since no color) image

� Suitable for simple graphics & text

� How much storage is required for a monochrome image of resolution 640 � 480?

© Shahid Farid, PUCIT 33

Page 34: by Shahid Farid - DiUniTofarid/teaching/DIP/Lecture - 1.pdf · Text book: Digital Image Processing, 3Digital Image Processing, 3 rrddrd Ed. (DIP/3e) b(DIP/3e) by Gonzalez and Woods

© Shahid Farid, PUCIT 34

Page 35: by Shahid Farid - DiUniTofarid/teaching/DIP/Lecture - 1.pdf · Text book: Digital Image Processing, 3Digital Image Processing, 3 rrddrd Ed. (DIP/3e) b(DIP/3e) by Gonzalez and Woods

� Each pixel is represented by a single byte.

� Gray levels between 0 to 255 (black to white).

� How much storage is required for a grayscale image of resolution 640 � 480?

© Shahid Farid, PUCIT 35

Page 36: by Shahid Farid - DiUniTofarid/teaching/DIP/Lecture - 1.pdf · Text book: Digital Image Processing, 3Digital Image Processing, 3 rrddrd Ed. (DIP/3e) b(DIP/3e) by Gonzalez and Woods

© Shahid Farid, PUCIT 36

Page 37: by Shahid Farid - DiUniTofarid/teaching/DIP/Lecture - 1.pdf · Text book: Digital Image Processing, 3Digital Image Processing, 3 rrddrd Ed. (DIP/3e) b(DIP/3e) by Gonzalez and Woods

256 gray levels (8bits/pixel) 32 gray levels (5 bits/pixel) 16 gray levels (4 bits/pixel)

8 gray levels (3 bits/pixel) 4 gray levels (2 bits/pixel) 2 gray levels (1 bit/pixel)37

Page 38: by Shahid Farid - DiUniTofarid/teaching/DIP/Lecture - 1.pdf · Text book: Digital Image Processing, 3Digital Image Processing, 3 rrddrd Ed. (DIP/3e) b(DIP/3e) by Gonzalez and Woods

� 24- bit color image◦ Each pixel is represented by 3 bytes, RGB◦ Each R, G, B are in the range 0-255 ◦ 256 x 256 x 256 possible colors ◦ If space is a concern, reasonably accurate color

image can be obtained by quantizing the color information.

� What is the size (in kB) of a 24-bit, 640 � 480color image?

© Shahid Farid, PUCIT 38

Page 39: by Shahid Farid - DiUniTofarid/teaching/DIP/Lecture - 1.pdf · Text book: Digital Image Processing, 3Digital Image Processing, 3 rrddrd Ed. (DIP/3e) b(DIP/3e) by Gonzalez and Woods

� 8- bit color image◦ Carefully chosen 256 colors represent the image

◦ stores only the index of the color, the file header will contain the mapping information.◦ The mapping is performed using the color

lookup table (LUT).

� What is the size (in kB) of a 8-bit, 640 � 480color image?

© Shahid Farid, PUCIT 39

Page 40: by Shahid Farid - DiUniTofarid/teaching/DIP/Lecture - 1.pdf · Text book: Digital Image Processing, 3Digital Image Processing, 3 rrddrd Ed. (DIP/3e) b(DIP/3e) by Gonzalez and Woods

© Shahid Farid, PUCIT 40

Page 41: by Shahid Farid - DiUniTofarid/teaching/DIP/Lecture - 1.pdf · Text book: Digital Image Processing, 3Digital Image Processing, 3 rrddrd Ed. (DIP/3e) b(DIP/3e) by Gonzalez and Woods

� Image histogramImage histogramImage histogramImage histogram is a type of histogram which acts as a graphical representation of the tonal distribution in a digital image.

� It plots the number of pixels for each tonal value.

� By looking at the histogram for a specific image a viewer will be able to judge the entire tonal distribution at a glance.

© Shahid Farid, PUCIT 41

Page 42: by Shahid Farid - DiUniTofarid/teaching/DIP/Lecture - 1.pdf · Text book: Digital Image Processing, 3Digital Image Processing, 3 rrddrd Ed. (DIP/3e) b(DIP/3e) by Gonzalez and Woods

Histogram of Lena’s grayscale image

© Shahid Farid, PUCIT 42

Page 43: by Shahid Farid - DiUniTofarid/teaching/DIP/Lecture - 1.pdf · Text book: Digital Image Processing, 3Digital Image Processing, 3 rrddrd Ed. (DIP/3e) b(DIP/3e) by Gonzalez and Woods

Histogram of Lena’s colored image

© Shahid Farid, PUCIT 43

Page 44: by Shahid Farid - DiUniTofarid/teaching/DIP/Lecture - 1.pdf · Text book: Digital Image Processing, 3Digital Image Processing, 3 rrddrd Ed. (DIP/3e) b(DIP/3e) by Gonzalez and Woods

� Text book and recommended reference books

� http://www.microscope-microscope.org/imaging/image-resolution.htm

� http://www.espressographics.com/text/imagesize.html

� http://fourier.eng.hmc.edu/e161/lectures/image_display_a.gif

44© Shahid Farid, PUCIT

Page 45: by Shahid Farid - DiUniTofarid/teaching/DIP/Lecture - 1.pdf · Text book: Digital Image Processing, 3Digital Image Processing, 3 rrddrd Ed. (DIP/3e) b(DIP/3e) by Gonzalez and Woods

By:Dr. Shahid Farid

Assistant Professor, PUCITE-mail: [email protected]

Session - 1