digital image processing lecture # 14 color image processing

of 72 /72
Digital Image Processing Digital Image Processing Lecture # 14 Lecture # 14 Color Image Processing Color Image Processing Fall 2012 Fall 2012

Author: seamus

Post on 11-Jan-2016

101 views

Category:

Documents


12 download

Embed Size (px)

DESCRIPTION

Digital Image Processing Lecture # 14 Color Image Processing. Fall 2012. Color Fundamentals. Color Fundamentals. White Light. Colours Absorbed. Green Light. The colors that humans and most animals perceive in an object are determined by the nature of the light reflected from the object - PowerPoint PPT Presentation

TRANSCRIPT

  • Digital Image Processing

    Lecture # 14

    Color Image ProcessingFall 2012

    CP-7008: Digital Image ProcessingLecture # 14*

    Color Fundamentals

    CP-7008: Digital Image ProcessingLecture # 14*

    Color FundamentalsThe colors that humans and most animals perceive in an object are determined by the nature of the light reflected from the objectFor example, green objects reflect light with wave lengths primarily in the range of 500 570 nm while absorbing most of the energy at other wavelengthsWhite LightColours AbsorbedGreen Light

    CP-7008: Digital Image ProcessingLecture # 14*

    Color ModelA mathematical system for representing color

    The human eye combines 3 primary colors (using the 3 different types of cones) to discern all possible colors.

    Colors are just different light frequenciesred 700nm wavelengthgreen 546.1 nm wavelengthblue 435.8 nm wavelength

    Higher frequencies are cooler colors*Color Fundamentals

    CP-7008: Digital Image ProcessingLecture # 14*

    Color Fundamentals6 to 7 million cones in the human eye can be divided into three principal sensing categories, corresponding roughly to red, green, and blue. 65%: red 33%: green 2%: blue (blue cones are the most sensitive)

    CP-7008: Digital Image ProcessingLecture # 14*

    Color Fundamentals

    CP-7008: Digital Image ProcessingLecture # 14*

    Color FundamentalsThe characteristics generally used to distinguish one color from another are brightness, hue, and saturation brightness: the achromatic notion of intensity.

    hue: dominant wavelength in a mixture of light waves, represents dominant color as perceived by an observer.

    saturation: relative purity or the amount of white light mixed with its hue.

    CP-7008: Digital Image ProcessingLecture # 14*

    Color Fundamentals3 basic qualities are used to describe the quality of a chromatic light source:

    Radiance: the total amount of energy that flows from the light source (measured in watts)

    Luminance: the amount of energy an observer perceives from the light source (measured in lumens)Note we can have high radiance, but low luminance

    Brightness: a subjective (practically immeasurable) notion that embodies the intensity of light

    CP-7008: Digital Image ProcessingLecture # 14*

    Primary ColorsPrimary colors of light are additivePrimary colors are red, green, and blueCombining red + green + blue yields white

    Primary colors of pigment are subtractivePrimary colors are cyan, magenta, and yellowCombining cyan + magenta + yellow yields black*

    CP-7008: Digital Image ProcessingLecture # 14*

    RGB Color model*Active displays, such as computer monitors and television sets, emit combinations of red, green and blue light. This is an additive color model

    CP-7008: Digital Image ProcessingLecture # 14*

    CMY Color model*Passive displays, such as color inkjet printers, absorb light instead of emitting it. Combinations of cyan, magenta and yellow inks are used. This is a subtractive color model.

    CP-7008: Digital Image ProcessingLecture # 14*

    RGB vs CMY

    CP-7008: Digital Image ProcessingLecture # 14*

    RGB color cubeRGB 24-bit color cube

    CP-7008: Digital Image ProcessingLecture # 14*

    RGB and CMY Color Cubes*

    CP-7008: Digital Image ProcessingLecture # 14*

    RGB Example*Red Band

    CP-7008: Digital Image ProcessingLecture # 14*

    RGB Example*No Red

    CP-7008: Digital Image ProcessingLecture # 14*

    RGB Example

    CP-7008: Digital Image ProcessingLecture # 14*

    The CMY and CMYK Color ModelsEqual amounts of the pigment primaries, cyan, magenta, and yellow should produce black. In practice, combining these colors for printing produces a muddy-looking black.

    To produce true black, the predominant color in printing, the fourth color, black, is added, giving rise to the CMYK color model.

    CP-7008: Digital Image ProcessingLecture # 14*

    http://en.wikipedia.org/wiki/CMYKCMY vs. CMYK

    CP-7008: Digital Image ProcessingLecture # 14*

    Subtractive mixing of inksInks subtract light from white.Linearity depends on pigment properties inks, paints, often hugely non-linear.Inks: Cyan=White-Red, Magenta=White-Green, Yellow=White-Blue.For a good choice of inks, and good registration, matching is linear and easyeg. C+M+Y=White-White=Black, C+M=White-Yellow=BlueUsually require CMY and Black, because colored inks are more expensive, and registration is hard (CMYK)For good choice of inks, there is a linear transform between XYZ and CMY

    CP-7008: Digital Image ProcessingLecture # 14*

    Color receptors and color deficiencyIn color normal people, there are three types of color receptor, called cones, which vary in their sensitivity to light at different wavelengths (shown by molecular biologists).Deficiency by optical problems in the eye, or by absent receptor types Usually a result of absent genes.Some people have fewer than three types of receptor; most common deficiency is red-green color blindness in men. Color deficiency is less common in women; red and green receptor genes are carried on the X chromosome, and these are the ones that typically go wrong. Women need two bad X chromosomes to have a deficiency, and this is less likely.

    CP-7008: Digital Image ProcessingLecture # 14*

    HSI Color ModelBased on human perception of colors. Color is decoupled from intensity.HUEA subjective measure of colorAverage human eye can perceive ~200 different colors

    SaturationRelative purity of the color. Mixing more white with a color reduces its saturation.Pink has the same hue as red but less saturation

    IntensityThe brightness or darkness of an object

    CP-7008: Digital Image ProcessingLecture # 14*

    HSI Color Model*Source: http://www.cs.cornell.edu/courses/cs631/1999sp/

    CP-7008: Digital Image ProcessingLecture # 14*

    HSI Color ModelHue is defined as an angle0 degrees is RED120 degrees is GREEN240 degrees is BLUE

    Saturation is defined as the percentage of distance from the center of the HSI triangle to the pyramid surface.Values range from 0 to 1.

    Intensity is denoted as the distance up the axis from black. Values range from 0 to 1*

    CP-7008: Digital Image ProcessingLecture # 14*

    HSI Color Model

    CP-7008: Digital Image ProcessingLecture # 14*

    HSI Color Model*

    CP-7008: Digital Image ProcessingLecture # 14*

    HSI and RGB*RGB and HSI are commonly used to specify colors in software applications.

    HSI has variants such as HSL and HSB both all of which model color in the same fundamental way.

    CP-7008: Digital Image ProcessingLecture # 14*

    Conversion Between RGB and HSI

    CP-7008: Digital Image ProcessingLecture # 14*

    CP-7008: Digital Image ProcessingLecture # 14*

    Image Types(categorized by color)Binary Imagehas exactly two colorsGrayscalehas no chromatic contentColorcontains some pixels with colormore than two colors exist*

    CP-7008: Digital Image ProcessingLecture # 14*

    Color DepthDescribes the ability of an image to accurately reproduce colors

    Given as the number of bits consumed by a single pixelOtherwise known as bits per pixel (bpp)

    Binary images are ____ bpp?

    Grayscale images are typically ____ bpp?

    Color images are typically ____ bpp?*

    CP-7008: Digital Image ProcessingLecture # 14*

    *A: 1 bppB: 2 bppC: 5 bppD: 24 bpp

    ABCD

    CP-7008: Digital Image ProcessingLecture # 14*

    Tristimulus ValuesTristimulus valueThe amounts of red, green, and blue needed to form any particular color are called the tristimulus values, denoted by X, Y, and Z.

    Only two chromaticity coefficients are necessary to specify the chrominance of a light.

    CP-7008: Digital Image ProcessingLecture # 14*

    CIE Chromacity DiagramSpecifying colors systematically can be achieved using the CIE chromacity diagramOn this diagram the x-axis represents the proportion of red and the y-axis represents the proportion of green used The proportion of blue used in a color is calculated as: z = 1 (x + y)

    CP-7008: Digital Image ProcessingLecture # 14*

    CIE Chromacity Diagram (cont)Green: 62% green, 25% red and 13% blue

    Red: 32% green, 67% red and 1% blue

    CP-7008: Digital Image ProcessingLecture # 14*

    CIE Chromacity Diagram (cont)Any color located on the boundary of the chromacity chart is fully saturated

    The point of equal energy has equal amounts of each color and is the CIE standard for pure white

    Any straight line joining two points in the diagram defines all of the different colors that can be obtained by combining these two colors additively

    This can be easily extended to three points

    CP-7008: Digital Image ProcessingLecture # 14*

    CIE Chromacity Diagram (cont)This means the entire color range cannot be displayed based on any three colors

    The triangle shows the typical color gamut produced by RGB monitors

    The strange shape is the gamut achieved by high quality color printers

    CP-7008: Digital Image ProcessingLecture # 14*

    Color ModelsSpecify three primary or secondary colorsRed, Green, Blue.Cyan, Magenta, Yellow.

    Specify the luminance and chrominance HSB, HSI or HSV (Hue, saturation, and brightness, intensity or value)

    Amplitude specification:8 bits per color component, or 24 bits per pixelTotal of 16 million colors

    CP-7008: Digital Image ProcessingLecture # 14*

    Comparison of Different Color SpacesMuch details than other bands (can be used for processing color images)

    CP-7008: Digital Image ProcessingLecture # 14*

    Pseudocolor Image ProcessingThe process of assigning colors to gray values based on a specified criterion.

    Intensity Slicing

    CP-7008: Digital Image ProcessingLecture # 14*

    CP-7008: Digital Image ProcessingLecture # 14*

    CP-7008: Digital Image ProcessingLecture # 14*

    Intensity SlicingPixels with gray-scale (intensity) value in the range of (f i-1 , fi) are rendered with color Ci

    CP-7008: Digital Image ProcessingLecture # 14*

    CP-7008: Digital Image ProcessingLecture # 14*

    CP-7008: Digital Image ProcessingLecture # 14*

    Pseudocolor Image ProcessingIntensity to Color Transformation

    CP-7008: Digital Image ProcessingLecture # 14*

    The images are obtained from an airport X-ray scanning system.The left contains ordinary articles and the right contains the same articles as well as a block of simulated plastic explosives.

    CP-7008: Digital Image ProcessingLecture # 14*

    Basics of Full-Color Image Processing

    CP-7008: Digital Image ProcessingLecture # 14*

    Basics of Full-Color Image Processing

    CP-7008: Digital Image ProcessingLecture # 14*

    Color Image Smoothing

    CP-7008: Digital Image ProcessingLecture # 14*

    CP-7008: Digital Image ProcessingLecture # 14*

    CP-7008: Digital Image ProcessingLecture # 14*

    CP-7008: Digital Image ProcessingLecture # 14*

    Color Image Sharpening

    CP-7008: Digital Image ProcessingLecture # 14*

    CP-7008: Digital Image ProcessingLecture # 14*

    Color Edge Detection (1)

    CP-7008: Digital Image ProcessingLecture # 14*

    Color Edge Detection (2)

    CP-7008: Digital Image ProcessingLecture # 14*

    Color Edge Detection (3)

    CP-7008: Digital Image ProcessingLecture # 14*

    CP-7008: Digital Image ProcessingLecture # 14*

    CP-7008: Digital Image ProcessingLecture # 14*

    Image File FormatsTo understand the advantages and disadvantages of various image formatsCategoriesOne categoryRaster Image FormatsVector Image FormatsAnother categoryBinary Image FormatsASCII Image Formats

    CP-7008: Digital Image ProcessingLecture # 14*

    Raster Image FormatsBreaks the image into a series of color dots called pixelsThe number of bits at each pixel determines the maximum number of colors 1 bits= 2 (21) colors 2 bits= 4(22) colors 4 bits= 16 (24) colors 8 bits= 256 (28) colors 16 bits= 65,536 (216) colors 24 bits = 16,777,216 (224) colors !

    CP-7008: Digital Image ProcessingLecture # 14*

    Vector Image FormatsBreak the image into a set of mathematical descriptions of shapes: curve, arc, rectangle, sphere etc.Resolution-independent: scalable without the problem of pixelating .Not all images are easily described in a mathematical form. How to describe a photograph?

    CP-7008: Digital Image ProcessingLecture # 14*

    ComparisonRaster-Resolution-dependent-Suitable for photographs-smooth tones and subtle details-larger size

    Vector-Resolution-independent -suitable for line drawings, CAD, LogosSmooth curvesSmaller size

    CP-7008: Digital Image ProcessingLecture # 14*

    What are the common types of image formatsRasterGIF (Graphics Interchange Format), Bitmap, JPEG,TIFF, PBM (portable Bit Map binary), PGM (Portable Gray map grayscale), PPM (Portable Pixel Map color), PNM (Portable Any Map any three), PCD(photo CD), PNG (Portable Network Graphics), etc.Vector: PS(postscript), EPS (embedded postscript), CDW (CorelDraw), WMF (windows metafile), SVG (Scalable vector graphics), etc.

    CP-7008: Digital Image ProcessingLecture # 14*

    CompuServ GIF Graphics Interchange FormatFirst standardized in 1987 by compuserv (called GIF87a)Updated in 1989 to include transparency, interlacing, and animation (called GIF89a)Use the LZW (Lempel-Ziv Welch) algorithm for compressionA maximum of 256 colors, so doesnt work well for photographsSuitable for small images such as iconsSimple animations

    CP-7008: Digital Image ProcessingLecture # 14*

    BitmapsCan create great image with 24 or even 32 bits per pixelFile size is large, for example, a bitmap image of size 1024*768*3= 2MBsHow to reduce size? Run Length Encoding (RLE) losslessWhat about even smaller size? Lossy encoding such as JPEG.

    CP-7008: Digital Image ProcessingLecture # 14*

    JPEG (Joint Photographic Experts Group)Lossy encoding

    CP-7008: Digital Image ProcessingLecture # 14*

    TIFF (Tag Image File Format)Tag-based image formatOriginated in 1986 at Aldus Corp. (PageMaker), the latest version 6.0Developed by Aldus and Microsoft Platform-independentMostly used by scanners and desktop publishinghttp://www.libtiff.org/ for a TIFF librarySupport compressions of CCITT Fax 3 & 4, LZW, JPEG etc.Support multiple color spaces: Grayscale, RGB, YCbCr, CMYK etc.

    CP-7008: Digital Image ProcessingLecture # 14*

    Some detailsFile headerByte order (2 bytes) : MM or IIVersion ( 2 bytes) : 42 (deep philosophical reason!)Pointer to first IFD (4 bytes)IFD (image file directory)Pointer count ( 2 bytes)Tagged pointer 0 (12 bytes)Tagged pointer 1 (12 bytes)-pointer to next IFD (if none, 0000) (4 bytes)

    CP-7008: Digital Image ProcessingLecture # 14*

    Some details - continuedTagged pointer (12 bytes)Tag code ( 2 bytes) : in the specsType of data (2 bytes ) : 1 (BYTE), 2 (ASCII), 3 (SHORT), 4 (LONG), 5 (rational)Length ( 4 bytes)Data pointer or data field

    CP-7008: Digital Image ProcessingLecture # 14*

    Which One to UseNo unique answerFor small image e.g. icon . GIFFor large image e.g. photograph JPEGIf scalability required PS, EPS