Digital Image Processing Lecture 2: Image Types & Matlab January 13, 2004 Prof. Charlene Tsai.

Slides:



Advertisements
Similar presentations
Digital Color 24-bit Color Indexed Color Image file compression
Advertisements

Image Data Representations and Standards
Dale & Lewis Chapter 3 Data Representation. Representing color Similarly to how color is perceived in the human eye, color information is encoded in combinations.
Color COM 366 Web Design & Production. RGB color Amount of light in each channel Closer to 255, whiter color gets Every color has value for red,
Multimedia for the Web: Creating Digital Excitement Multimedia Element -- Graphics.
Graphics File Formats. 2 Graphics Data n Vector data –Lines –Polygons –Curves n Bitmap data –Array of pixels –Numerical values corresponding to gray-
Images.
Graphics in the web Digital Media: Communication and Design
Introduction to Computer Graphics
Guilford County SciVis V106.01
V Obtained from a Guildford County workshop-Summer, 2014.
Welcome to a New Quarter Class Rules and Responsibilities What will be learning? 106-Static and Dynamic Visualization 105-Synthesize Data for SciVis Video-Real.
Image Compression CSC CSC Computing with Images2 How do we use fewer bytes to encode the same or similar information? Reduce redundancy Take.
Image and Sound Editing Raed S. Rasheed Image Image. Digital image. – Raster images. – Vector Images. – Stereo Images. – Image File Formats Lossless.
Manipulating Images Image A visual representation of something that is seen in real life. It can be two-dimensional or three-dimensional A visual representation.
File Formats By Jack Turner. Raster (Bitmap) Raster or bitmap is a dot matrix data structure, containing columns of dots and rows, of a graphics image.
1 GFI Files Graphics Interchange Format. 2 GIF History  CompuServe developed 1987 Versions 87a, V89a Because there was no standard.
Data starts with width and height of image Then an array of pixel values (colors) The number of elements in this array is width times height Colors can.
Zinnia Bell. RAWimages are image files that have not yet processed, they contain minimally processed data from the image sensor of either a image scanner,
Prepared by George Holt Digital Photography BITMAP GRAPHIC ESSENTIALS.
Faculty of Sciences and Social Sciences HOPE Website Development Graphics Stewart Blakeway FML 213
COMP Bitmapped and Vector Graphics Pages Using Qwizdom.
File Formats About graphic file formats And image compression.
Lecture 4 - Introduction to Computer Graphics
Digital Images Chapter 8, Exploring the Digital Domain.
Lab #5-6 Follow-Up: More Python; Images Images ● A signal (e.g. sound, temperature infrared sensor reading) is a single (one- dimensional) quantity that.
Image Storage Bitmapped Graphics – in which an image is represented as a collection of dots Vector Graphics – in which an image is represented as a set.
All About File Formats Mr. Butler John Jay High School Department of Technology.
1 Perception, Illusion and VR HNRS 299, Spring 2008 Lecture 14 Introduction to Computer Graphics.
Digital Image: Representation & Processing (2/2) Lecture-3
September 21, COMPUTER VISION WEB PAGE IS UP !! OR Simply go to computer science homepage.
1 Image Formats. 2  To be able save image data for future manipulation and display we need to be able to store it in a consistent manner  Formats enable.
Information Processes and Technology Multimedia: Graphics.
Raster Graphics. An image is considered to be made up of small picture elements (pixels). Constructing a raster image requires setting the color of each.
Graphics. Graphic is the important media used to show the appearance of integrative media applications. According to DBP dictionary, graphics mean drawing.
Graphics workshop Library and Information Services University of St Andrews.
Image Representation. Digital Cameras Scanned Film & Photographs Digitized TV Signals Computer Graphics Radar & Sonar Medical Imaging Devices (X-Ray,
File Formats Different applications (programs) store data in different formats. Applications support some file formats and not others. Open…, Save…, Save.
Web graphics Discussion Session August 16, 2000 Discussion Session August 16, 2000.
File Formats and Vector Graphics. File Types Images and data are stored in files. Each software application uses different native file types and file.
1 © 2010 Cengage Learning Engineering. All Rights Reserved. 1 Introduction to Digital Image Processing with MATLAB ® Asia Edition McAndrew ‧ Wang ‧ Tseng.
Image Compression CSC CSC Computing with Images2 Image Compression Goal: reduce redundancy –Encode the same information using fewer bits.
Chapter 2 File Format Objectives (1 of 2) Identify the difference between vector based graphics and bitmap-based graphics Clarify bitmap and vector graphic.
Multimedia Basics (1) Hongli Luo CEIT, IPFW. Topics r Image data type r Color Model : m RGB, CMY, CMYK, YUV, YIQ, YCbCr r Analog Video – NTSC, PAL r Digital.
Digital Image Processing Lecture 2: Image Types & Matlab
Image formats Characteristics © Adolf Knoll, National Library of the Czech Republic.
Digital Images are represented by manipulating this…
Image File Formats. What is an Image File Format? Image file formats are standard way of organizing and storing of image files. Image files are composed.
Graphics Concepts Presentation
Image File Formats By Dr. Rajeev Srivastava 1. Image File Formats Header and Image data. A typical image file format contains two fields namely Dr. Rajeev.
Image File Formats Harrow Computer Club – Wed, 1 Dec 2010 Bob Watson MA CMath MIMA MBCS.
Graphics and Image Data Representations 1. Q1 How images are represented in a computer system? 2.
ITEC2110, Digital Media Chapter 2 Fundamentals of Digital Imaging 1 GGC -- ITEC Digital Media.
Graphics and image data representation
Sampling, Quantization, Color Models & Indexed Color
Binary Representation in Audio and Images
Computer Science Higher
Chapter 3 Graphics and Image Data Representations
Raster Images CPSC 1030.
Chapter 3 Image Files © 2017 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
"Digital Media Primer" Yue-Ling Wong, Copyright (c)2013 by Pearson Education, Inc. All rights reserved.
A computer display is made up of small squares, called pixels.
Image File Size and File Compression
Chapter 3:- Graphics Eyad Alshareef Eyad Alshareef.
Saving Images from Fireworks
1.01 Investigate graphic types and file formats.
Introduction to Computer Graphics
Representing Images 2.6 – Data Representation.
Graphic File Format Skill Area
"Digital Media Primer" Yue-Ling Wong, Copyright (c)2013 by Pearson Education, Inc. All rights reserved.
Presentation transcript:

Digital Image Processing Lecture 2: Image Types & Matlab January 13, 2004 Prof. Charlene Tsai

Digital Image ProcessingLecture 2 2 Teaching Assistants  陳威志  謝坤霖  陳威志  謝坤霖

Digital Image ProcessingLecture 2 3 Types  Four basic types of images:  Binary  Grayscale  True color (red-green-blue)  Indexed  Four basic types of images:  Binary  Grayscale  True color (red-green-blue)  Indexed

Digital Image ProcessingLecture 2 4 Types - Binary  Each pixel is black or white  What is the maximum storage or each pixel?  Applications?  Each pixel is black or white  What is the maximum storage or each pixel?  Applications?

Digital Image ProcessingLecture 2 5 Types: Grayscale  Normally from 0 (black) to 255 (white)  Represented by 8 bits (1 byte)  256 gray levels are enough for recognition of most natural objects.  Normally from 0 (black) to 255 (white)  Represented by 8 bits (1 byte)  256 gray levels are enough for recognition of most natural objects.

Digital Image ProcessingLecture 2 6 Types: Color  Hardware generally delivers or displays color via RGB model (red, green, and blue).  Each pixel associated with a 3d vector (r,g,b)  Hardware generally delivers or displays color via RGB model (red, green, and blue).  Each pixel associated with a 3d vector (r,g,b)

Digital Image ProcessingLecture 2 7 Type: Color (con’d)  Another model most relevant to image processing is HIS – hue, saturation and intensity.  Hue: perceived color (the dominant wavelength)  Saturation: dilution by white color, e.g. light purple, dark purple, etc.  Intensity: brightness  This model is closer to human perception.  Another model most relevant to image processing is HIS – hue, saturation and intensity.  Hue: perceived color (the dominant wavelength)  Saturation: dilution by white color, e.g. light purple, dark purple, etc.  Intensity: brightness  This model is closer to human perception.

Digital Image ProcessingLecture 2 8 Type: Color (con’d)  Central axis for intensity  The circle for hue, determined by the angular location  Saturation is the distance perpendicular to the intensity axis.  Can easily perform RGB HIS.  Central axis for intensity  The circle for hue, determined by the angular location  Saturation is the distance perpendicular to the intensity axis.  Can easily perform RGB HIS.

Digital Image ProcessingLecture 2 9 Types: Indexed  If using for each color channel, there are =16,777,216 (about 16 million)  Normally, only a small subset of the colors is needed => wasting of space  Solution: color map or color pallette (color values stored in the colormap)  If using for each color channel, there are =16,777,216 (about 16 million)  Normally, only a small subset of the colors is needed => wasting of space  Solution: color map or color pallette (color values stored in the colormap) pointer (indices) colormap

Digital Image ProcessingLecture 2 10 Switching Image Representation  RGB to grayscale  Taking the average where I R, I G and I B are red, green and blue channels, respectively.  Using channel mixer (different % for the 3 channels)  Taking only one channel  RGB to grayscale  Taking the average where I R, I G and I B are red, green and blue channels, respectively.  Using channel mixer (different % for the 3 channels)  Taking only one channel

Digital Image ProcessingLecture 2 11 Example RGB Grey R GB

Digital Image ProcessingLecture 2 12 Switching Image Representation  Going from greyscale to binary  Simplest way is to apply a threshold d Problem:  Throws away information  Threshold must generally be chosen by hand  Not robust: different thresholds usually required for different images. (Will discuss more possibilities later in the course)  Going from greyscale to binary  Simplest way is to apply a threshold d Problem:  Throws away information  Threshold must generally be chosen by hand  Not robust: different thresholds usually required for different images. (Will discuss more possibilities later in the course)

Digital Image ProcessingLecture 2 13 Matlab  To read an image w=imread(‘hello.tif’); % The image is now stored in a matrix w of % size height x width of image hello.tif  To display an image figure;% creates a figure on the screen Imshow(w);% display matrix as an image pixelval on;% turns on the pixel values  To read an image w=imread(‘hello.tif’); % The image is now stored in a matrix w of % size height x width of image hello.tif  To display an image figure;% creates a figure on the screen Imshow(w);% display matrix as an image pixelval on;% turns on the pixel values

Digital Image ProcessingLecture 2 14 Matlab (con’d)  Grayscale image: r x c matrix  Color image: r x c x 3 matrix (3 for 3 channels)  e.g. w(:,:,1) is the image of the red channel  Indexed color image: two matrices  color map and  Index to the color map  [em,emap]=imread(‘emu.tif’); figure, imshow(em,emap), pixval on;  Functions for converting images (section 2.4)  Grayscale image: r x c matrix  Color image: r x c x 3 matrix (3 for 3 channels)  e.g. w(:,:,1) is the image of the red channel  Indexed color image: two matrices  color map and  Index to the color map  [em,emap]=imread(‘emu.tif’); figure, imshow(em,emap), pixval on;  Functions for converting images (section 2.4)

Digital Image ProcessingLecture 2 15 Matlab: Example [i,map] = imread('trees.tif'); imshow(i); i1 = ind2rgb(i,map); figure; imshow(i1) i2= ind2gray(i,map); figure; imshow(i2) i3 = im2bw(i,map,0.5); figure; imshow(i3)

Digital Image ProcessingLecture 2 16 Matlab: Example (con’d) Please note, class double has range [0,1], and class uint8 has range [0,255].

Digital Image ProcessingLecture 2 17 Digital Image Formats  From compression point of view, there are effectively two kinds of image formats, uncompressed and compressed  Uncompressed image stake the most disk space (like TIFF, BMP)  Compressed images have another two kinds of format, known as lossy and loss- less (meaning image data is lost during the compression process)  From compression point of view, there are effectively two kinds of image formats, uncompressed and compressed  Uncompressed image stake the most disk space (like TIFF, BMP)  Compressed images have another two kinds of format, known as lossy and loss- less (meaning image data is lost during the compression process)

Digital Image ProcessingLecture 2 18 Format: JPEG  JPEG: Joint Photographic Experts Group.  You can often have the dramatic reductions in file size offered by JPEG: with little or no loss of image quality (depending on the characteristics of the image).  The target of the JPEG format was quite specific:  The subject matter best suited for JPEG compression are the types of images found in nature, with lots of colour gradients and few sharp edges.  Image elements with sharp edges, such as typefaces and line art are poor subjects for JPEG compression.  Water, sky and skin can be generously compressed with the minimum of loss and retain their rich, true colours.  JPEG: Joint Photographic Experts Group.  You can often have the dramatic reductions in file size offered by JPEG: with little or no loss of image quality (depending on the characteristics of the image).  The target of the JPEG format was quite specific:  The subject matter best suited for JPEG compression are the types of images found in nature, with lots of colour gradients and few sharp edges.  Image elements with sharp edges, such as typefaces and line art are poor subjects for JPEG compression.  Water, sky and skin can be generously compressed with the minimum of loss and retain their rich, true colours.

Digital Image ProcessingLecture 2 19 Format: JPEG (con’d)  One of the important characteristics of human visual perception discovered is : We perceive small changes in brightness more readily than we do small changes in colour.  It is this aspect of our perception that the JPEG committee exploited when they designed the compression standard.  JPEG format converts RGB (red, green, blue) value to luminance (brightness) and chrominance (hue+saturation).  This allows for separate compression of these two factors. JPEG attempts to maintain brightness and contrast information (which the human eye is sensitive to) at the expense of colour information.  One of the important characteristics of human visual perception discovered is : We perceive small changes in brightness more readily than we do small changes in colour.  It is this aspect of our perception that the JPEG committee exploited when they designed the compression standard.  JPEG format converts RGB (red, green, blue) value to luminance (brightness) and chrominance (hue+saturation).  This allows for separate compression of these two factors. JPEG attempts to maintain brightness and contrast information (which the human eye is sensitive to) at the expense of colour information.

Digital Image ProcessingLecture 2 20 JPEG: Example High quality, 86kb Good quality, 47kb Fair quality 24kb “Poor” quality 14kb

Digital Image ProcessingLecture 2 21 Format: BMP  Microsoft Windows bitmap  It is platform-dependent, but the near ubiquity of the Windows platform makes it widely understood by programs on other systems.  Unlike most other bitmapped formats, BMP only supports a simple form of lossless compression, and BMP files are usually stored uncompressed, thus are large files.  It is a common default file format for images on Windows applications, but is less commonly used in the professional print industry because of the early dominance of Macintosh in this industry.  Microsoft Windows bitmap  It is platform-dependent, but the near ubiquity of the Windows platform makes it widely understood by programs on other systems.  Unlike most other bitmapped formats, BMP only supports a simple form of lossless compression, and BMP files are usually stored uncompressed, thus are large files.  It is a common default file format for images on Windows applications, but is less commonly used in the professional print industry because of the early dominance of Macintosh in this industry.

Digital Image ProcessingLecture 2 22 Format: GIF  GIF: Graphics Interchange Format  was originally developed by CompuServe  Designed to facilitate the exchange of raster image information  GIF is nominally a lossless compression scheme; for greyscale images, it truly is lossless  GIF works only on indexed colour images, and a huge amount of information is lost.  When you convert a 24-bit colour image to 8-bit indexed colour you go from a possible 16.7 million colours to a mere 256.  GIF has some advantages  It's a de facto standard, supported by every graphical Web browser.  If you use GIF, you can expect that everyone will be able to download your image everywhere.  GIF: Graphics Interchange Format  was originally developed by CompuServe  Designed to facilitate the exchange of raster image information  GIF is nominally a lossless compression scheme; for greyscale images, it truly is lossless  GIF works only on indexed colour images, and a huge amount of information is lost.  When you convert a 24-bit colour image to 8-bit indexed colour you go from a possible 16.7 million colours to a mere 256.  GIF has some advantages  It's a de facto standard, supported by every graphical Web browser.  If you use GIF, you can expect that everyone will be able to download your image everywhere.

Digital Image ProcessingLecture 2 23 Format: GIF (Transparency)  GIF is also a widely adopted format that lets you use transparent pixels in you images, which allows for the specification of one of the colours in the palette to be ignored while processing the image for your display device.  Transparent GIFs are commonplace on the web.  Using transparency, you can create images that seem to merge with or overlay the existing background, giving the illusion that the graphic is not rectangular (even though it really is).  GIF is also a widely adopted format that lets you use transparent pixels in you images, which allows for the specification of one of the colours in the palette to be ignored while processing the image for your display device.  Transparent GIFs are commonplace on the web.  Using transparency, you can create images that seem to merge with or overlay the existing background, giving the illusion that the graphic is not rectangular (even though it really is).

Digital Image ProcessingLecture 2 24 Format: GIF (Interlacing)  GIF supports interlacing  The images on your page to appear more quickly, albeit at an initially low quality, in order to keep your viewer interested.  Physically, an interlaced GIF just has the scan lines stored in an unusual order:  the first pass has pixel rows 1, 9, 17, n (every eighth row)  the second pass has rows 5, 13, 21, n (every remaining fourth row);  the third pass has rows 3, 7, 11, 15, n (every remaining odd-numbered row);  the last pass has rows 2, 4, 6,...2n (every remaining even- numbered rows).  How the browser chooses to display this is up to the browser.  GIF supports interlacing  The images on your page to appear more quickly, albeit at an initially low quality, in order to keep your viewer interested.  Physically, an interlaced GIF just has the scan lines stored in an unusual order:  the first pass has pixel rows 1, 9, 17, n (every eighth row)  the second pass has rows 5, 13, 21, n (every remaining fourth row);  the third pass has rows 3, 7, 11, 15, n (every remaining odd-numbered row);  the last pass has rows 2, 4, 6,...2n (every remaining even- numbered rows).  How the browser chooses to display this is up to the browser.

Digital Image ProcessingLecture 2 25 Format: GIF (con’d)

Digital Image ProcessingLecture 2 26 Format: GIF (con’d)  Netscape and Explorer draw each incoming row several times, to fill not only its assigned place but also the immediately following not-yet-received rows. So the first few rows are big blocks which get overwritten progressively:  scan 1 fills 1 to 8 with scan line 1 data and then 9 to 16 with 2.  scan 2 fills 5 to 8 with scan line 2 data and then with 2  scan 3 fills 3 and 4 with scan line data and then 7-8 with 2  scan 4 overwrites 2, 4,  Netscape and Explorer draw each incoming row several times, to fill not only its assigned place but also the immediately following not-yet-received rows. So the first few rows are big blocks which get overwritten progressively:  scan 1 fills 1 to 8 with scan line 1 data and then 9 to 16 with 2.  scan 2 fills 5 to 8 with scan line 2 data and then with 2  scan 3 fills 3 and 4 with scan line data and then 7-8 with 2  scan 4 overwrites 2, 4, 6....

Digital Image ProcessingLecture 2 27 Format: GIF (con’d)  The GIF89a specification add a few enhancements to the file header which allows browsers to display multiple GIF images in a timed and/or looped sequence.  Netscape and I.E. both support GIF animation. There are many freeware tools for creating GIF animation.  The process is actually very simple:  First create a series of frames which contain the same image  Each frame is modified according to a plotted timeline  Construct a multi image GIF file with the desired delay between image   The GIF89a specification add a few enhancements to the file header which allows browsers to display multiple GIF images in a timed and/or looped sequence.  Netscape and I.E. both support GIF animation. There are many freeware tools for creating GIF animation.  The process is actually very simple:  First create a series of frames which contain the same image  Each frame is modified according to a plotted timeline  Construct a multi image GIF file with the desired delay between image 

Digital Image ProcessingLecture 2 28 Format: TIFF  TIFF: Tagged Image File Format  More general than GIF  Allows 24 bits/pixel  Supports 5 types of image compression including  RLE (Run length encoding)  LZW (Lempel-Ziv-Welch)  JPEG (Joint Photographic Experts Group)  TIFF: Tagged Image File Format  More general than GIF  Allows 24 bits/pixel  Supports 5 types of image compression including  RLE (Run length encoding)  LZW (Lempel-Ziv-Welch)  JPEG (Joint Photographic Experts Group)

Digital Image ProcessingLecture 2 29 Format: PNG  PNG: Portable Network Graphics  A replacement for GIF: supporting grayscale, truecolor and indexed images.  Support alpha channels, which are ways of associating variable transparencies with an image.  Support gamma correction, ensuring same image appearance, independent of computer display system.  PNG: Portable Network Graphics  A replacement for GIF: supporting grayscale, truecolor and indexed images.  Support alpha channels, which are ways of associating variable transparencies with an image.  Support gamma correction, ensuring same image appearance, independent of computer display system.

Digital Image ProcessingLecture 2 30 Format: PGM  P2 means ASCII gray; P5 means binary gray image Comments  W=16; H=8  192 is max intensity  Can be made with editor  P2 means ASCII gray; P5 means binary gray image Comments  W=16; H=8  192 is max intensity  Can be made with editor An example of a PGM file of type "P2" is given below

Digital Image ProcessingLecture 2 31 Format: DICOM  DICOM: Digital Imaging and Communications in Medine.  An image can be a slice or a frame of a 3D object.  A header contains size, number of slices, modality used, patient information, and compression used.  DICOM: Digital Imaging and Communications in Medine.  An image can be a slice or a frame of a 3D object.  A header contains size, number of slices, modality used, patient information, and compression used.

Digital Image ProcessingLecture 2 32 Summary  Types of images  Simple Matlab commands related to reading and displaying of images  File formats of images.  Types of images  Simple Matlab commands related to reading and displaying of images  File formats of images.

Digital Image ProcessingLecture 2 33 Homework  1. Read “Appendix A” on basic use of matlab.  2. Do question 6~11.  Homework is always individual work.  The report should contain the matlab workspace of each question.  Due date is 3/14 before lecture. 謝 坤霖 the pdf of your  No late submission is accepted.  1. Read “Appendix A” on basic use of matlab.  2. Do question 6~11.  Homework is always individual work.  The report should contain the matlab workspace of each question.  Due date is 3/14 before lecture. 謝 坤霖 the pdf of your  No late submission is accepted.