Digital Image Processing Lecture 2: Image Types & Matlab

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
File Formats COM 366 Web Design & Layout. Native file format –Format native to software program –.psd > PhotoShop default Preserves layers –Use “Save.
COMP Bitmapped and Vector Graphics Pages Using Qwizdom.
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.
Chapter 3 Graphics and Image Data Representations
Graphics/Image Data Types
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.
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.
1 Ethics of Computing MONT 113G, Spring 2012 Session 10 HTML Tables Graphics on the Web.
Data Compression. Compression? Compression refers to the ways in which the amount of data needed to store an image or other file can be reduced. This.
Information Processes and Technology Multimedia: Graphics.
Digital Image Processing Lecture 2: Image Types & Matlab January 13, 2004 Prof. Charlene Tsai.
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.
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.
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.
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.
Scanner Scanner Introduction: Scanner is an input device. It reads the graphical images or line art or text from the source and converts.
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
Saving Images from Fireworks
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 Prof. Charlene Tsai

Types Four basic types of images: Binary Grayscale True color (red-green-blue) Indexed

Types - Binary Each pixel is black or white What is the maximum storage for each pixel? Applications? Briefly discuss thresholding, application of binary images, advantages and disadvantages for the in-class quize

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.

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)

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. For example, it is easy to change the color of a car from light blue to light green without altering the intensity and saturation.

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.

Types: Indexed If using 0-255 for each color channel, there are 2553=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

Switching Image Representation RGB to grayscale Taking the average where IR, IG and IB are red, green and blue channels, respectively. Using channel mixer (different % for the 3 channels) Taking only one channel

Example Grey RGB R G B

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)

Matlab To read an image To display 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

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

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)

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

Digital Image Formats From compression point of view, there are effectively two kinds of image formats, uncompressed and compressed Uncompressed images take 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) Image-compression techniques take two different forms, lossless and lossy. With lossless compression, your decompressed image is identical to the original. Lossy compression, on the other hand, permanently loses some image information. This sounds a great deal scarier than it is. Well-implemented lossy compression schemes can achieve far higher compression ratios than any lossless method while producing results that the unaided eye can't distinguish from the original.

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. GIF has become a de facto standard, but JPEG is a full-blown, International Standards Organisation-certified standard - ISO 10981-1, to be exact. It takes its name from the ISO working committee that developed it, the Joint Photographic Experts Group. A lossless compression method is included in the JPEG standard, but virtually no one has adopted it, mainly because it had little recommend it over other techniques. Lossy JPEG compression, however, has garnered wide support, and most graphical Web browsers now understand it. With lossy JPEG there's a trade-off between file size and image quality. You can achieve very high compression ratios - on the order of 100:1 or more -but at the expense of fairly obvious blocky artifacts in the image. At lower compression ratios, image degradation is much less noticeable, and most observers agree that ratios of around 10:1 produce a result that's visually indistinguishable from the original.

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.

Format: JPEG (con’d) 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.

JPEG: Example Fair quality 24kb High quality, 86kb Good quality, 47kb The amount of compression you achiever from JPEG depends principally on the quantization step; the different quality settings offered by most JPEG utilities are achieved by changing quantization values (greater compression applies higher values). Also, different vendors' implementations of JPEG can produce substantially different image quality, even though the amount of compression they obtain is exactly the same, because they implement different quantization values for chrominance and luminance channels. The actual amount of compression achieved also varies according to the image content. High-frequency images - those in which adjacent pixels are quite different from one another - are much less compressible than low frequency images in which adjacent pixels tend to be similar. In the decompressed images, blocky artifacts are more noticeable in low-frequency areas, along the edges of those 8-x-8-pixels blocks, while artifacting called "mosquito noise" - fuzzy rings so named because they resemble ripples around mosquitoes' feet in water - occurs along high - frequency edges. JPEG - compressed images will typically be much smaller than if they are converted to GIF, and they decompress to true 24-bit colour. The downside is that JPEG decompression takes considerably longer than opening GIF files, so time saved by sending a smaller file across the Net is usually eaten up by the decompression process. Plus, JPEG doesn't support transparency or interlacing. Some browsers, however, including Netscape Navigator 2.0 and Spyglass's Mosaic, support a format called progressive JPEG (PJPEG) . Progressive JPEG displays images onscreen similarly to interlaced GIFs - they gradually "fade in"- only faster and more smoothly than interlaced GIFs. Equilibrium's DeBabelizer supports progressive JPEG, as do two Adobe Photoshop plug-ins; ProJPEG from BoxTop Software and InTouch Technologies' Transmogrifier, which is also available as a stand-alone converter. The results are encouraging - images appear almost instantly even with slow connections. High quality, 86kb Good quality, 47kb “Poor” quality 14kb

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.

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.

Format: GIF (cont) 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.

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). http://www.htmlgoodies.com/tutors/transpar.html

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, ....1+8n (every eighth row) the second pass has rows 5, 13, 21, .... 1+4n (every remaining fourth row); the third pass has rows 3, 7, 11, 15, .... 3 + 4n (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.

Format: GIF (con’d)

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 13-16 with 2 scan 3 fills 3 and 4 with scan line data and then 7-8 with 2 scan 4 overwrites 2, 4, 6 ....

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.

Format: GIF (con’d) 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 http://www.htmlgoodies.com/tutors/animate.html

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)

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.

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 An example of a PGM file of type "P2" is given below

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.

Summary Types of images Simple Matlab commands related to reading and displaying of images File formats of images.

Quiz2 Write your function in pseudo code that converts the mxn GIF image shown in slide8 to a grayscale image with the greyscale range [0,255]. Please state your RGB->grey converter clearly.