0.9.4 Back to top-level High Level Digital Images ENGG05 st This week Semester, 00 Dr. Hayden Kwok-Hay So Department of Electrical and Electronic Engineering Low Level Applications Image & Video Processing Systems Computer & Embedded Systems Computer Network Mobile Network Digital Logic Combinational Logic Boolean Algebra Circuits Basic Circuit Theory Electrical Signals Voltage, Current Power & Energy Back to top-level High Level This week Low Level Digital Images Applications Image & Video Processing Systems Computer & Embedded Systems Computer Network Mobile Network Digital Logic Combinational Logic Boolean Algebra Circuits Basic Circuit Theory Electrical Signals Voltage, Current Power & Energy Representation Hardware 3 Processing 4 Representing Images R bitmap G B pixel An image is broken down into small regions called picture elements (pixels) Bitmap: A pixel-by-pixel representation of image 5 6
0.9.4 Image Dimensions Representing Pixels Image Size The number of pixel in X-Y direction Sometimes quoted using the total number of pixels in a picture (N megapixels) Each pixel is represented by one or more values Black & white images: Each pixel is represented by exactly value (B or W) bit is enough to represent possible values 4 Grey scale images: Each pixel is usually a byte, keeping the brightness or gray levels 5 Image Resolution Each pixel represented a group of color components of that location Different color systems: RGB, CYMK, YCbCr, etc The density of pixels Measured by pixel-per-inch (PPI) 7 B&W (w/ dither) Grayscale 6 colors Monochrome Image Gray-scale Image Each pixel is bit, either 0 or Dithering is used to produce different intensities Each pixel is usually a byte (-bit), keeping the brightness or gray levels 9 6M colors Color Look-Up Tables (LUTs) Color palette 4-bit color image Each pixel is represented by 3 bytes using a certain color model Supports 56x56x56 colors 6 million colors 0 CMY Color Model Additive color model Primary colors: Red, Green, and Blue Secondary colors obtained by additive mixing of primary colors Commission Internationale d'eclairage (CIE) specifies red to be 700nm, green to be 546.nm and blue to be 435.nm Used in media that transmit light (e.g. TV) 56 colors indexed color image # of color support depends on the # of bit for each pixel 4 bits 6 colors bits 56 colors RGB Color Model Color Images Monochrome and Gray-scale Images B&W Color images: Subtractive color model Subtractive primaries: Cyan, magenta, and yellow A subtractive primary absorbs a primary color and reflects the other two E.g. Cyan absorbs red and reflect blues and green Used in printing device
Printing an Image Print Size Depends on the mapping between printer s resolution, image resolution & image size A Printer s printing resolution is usually higher than an image s resolution because multiple dots of ink are needed to created color of an image pixel Color Space On screen display: RGB (additive) Printing devices: CMYK (subtractive) Color Production Each pixel may have different color Each ink drop has only color Dithering Create the illusion of new colors and shades by varying the pattern of dots. E.g. Newspaper photographs are dithered. If you look closely, you can see that different shades of gray are produced by varying the patterns of black and white dots. There are no gray dots at all. 3 4 Dither, Halftone, Grayscale RGB Color Space The RGB model describes the formation of color by mixing different portion of Red, Blue and Green light. But what is red, blue and green? E.g. which of the colors on top of this page is red? A color space defines objectively the exact color that is represented numerically so the same information may be reproduced on different machines. original dither halftone 5 6 srgb color space Originally defined by HP and Microsoft Now the de facto standard on the Internet and most consumer electornics Digital camera, HDTV, computer monitors, etc If a color profile is not specified, the default assumption is that the colors are specified in srgb color space Given the specification of the 3 primary colors (R, G, B), the colors representable will be the color triangle spanned from the three colors. Common Color Spaces 7
More Color Models Both RGB and CMY(K) model specify how to form a color But they have little resemblance to how human beings reason about colors E.g. How do you get the RGB values of the pale orange color on the right? [R G B] = [04 3 4] [R G B] = [???] [4 5 5] HS(B/V), HSL, HSI Color Model The family of HSx models describe colors similar to how human perceives colors Also similar to how painters create colors HSB: Hue Saturation Brightness HSV: Hue Saturation Value HSL: Hue Saturation Lightness HSI: Hue Saturation Intensity Similar, but often comes with confusing (or even contradicting) definitions 9 Cylindrical-Coordination Hue: The dominant color The angle away from red Saturation The amount away from the center How full the color is Lightness/ Brightness/Value The amount of white/black added More Image Representations? Raster image (bitmap image) - Raster graphics uses pixel values to describe an image. The file size is independent of the image complexity. For higher resolution, the file size increases dramatically Vector graphics (draw graphics) - An alternate approach is to use only instructions for drawing lines, circles, ellipses, curves, and other shapes. Vector Graphics Vector-based images are composed of key points and paths which define shapes, and coloring instructions, such as line and fill colors. Example: Vector Graphics Advantages Vector graphics can be scaled up and down easily and quickly while retaining the quality of the picture. Raster images scale poorly and display poorly at resolutions other than that for which the image was originally created. Vector graphics require less bandwidth and can be accessed and viewed faster than raster graphics. Vector graphics can be edited and manipulated far easier than raster images.
0.9.4 Image Processing Used in digital camera, TV, cell phones Used in all kinds of photo editing SW e.g. Photoshop, GIMP 5 Image Processing - Examples Original Greyscale RGB to Grey-scale Conversion Each pixel of a grey-scale image has only one intensity value, V High V: white, Low V: black Easiest conversion: V= Blur Edge Detection Filters are building blocks of image processing systems One of the most basic filtering method is by matrix convolution y[r,c] = i, j h[ j,i]x[r j,c i] h[i, j] j= i= r c Produce better result if you weight G and R more than B Human eyes are more sensitive to green and red Matrix Convolution in Action Basic Filtering: Matrix Convolution R+G+ B 3 X H 7 6 54 4 4 9 6 3 0 5 50 60 34 7 9 9 9 5 44 35 56 7 Y 4 4 9 34 39 43 34 63 77 6 6 + 9 9 + 9 9 + 0 + 4 5 0 + 50 5 + 5 50 60 34 34 + 9 + 9 5 = 4 9 34 5
Gaussian Blur A simple but effective way to blur a picture Each pixel is replaced with a weighted sum of the values of its surrounding pixels The weighting factors have a Gaussian distribution, thereby the name Intuitively: each pixel is mixed to certain extent with its neighbors 4 5 4 4 9 9 4 5 5 5 4 9 9 4 4 5 4 Edge Detection Useful in understanding an image For robot, face recognition, medical imaging etc In a smooth contour, the pixel values usually do not change rapidly However, the pixel exhibit sudden jump in values near an edge E.g. jump from to 30 Sobel edge detection is one of the simplest algorithms that makes use of this observation to find edges Compares values of the neighbors of pixel 3 3 Sobel filter - 0 + - 0 + - 0 + + + + 0 0 0 - - - Gx Gy Sobel filter use the results of two filters In x and y direction Magnitude of the resulting pixel as: G = G x + G y G G x + G y Easier to compute Sobel Filter Example x Dir X H Y 3 3 3 39 39 39 3 3 3 40 40 40-0 3 3 3 4 4 4-0 0 5 5 3 3 3 4 4 4-0 3 3 3 4 4 4 3 3 37 40 40 40-3 + 0 40 3 + 40 3 + - 3 + 0 4 3 + 4 3 + - 3 + 0 4 3 + 4 3 = 5 0 33 Sobel Filter Example x Dir X H Y 3 3 3 39 39 39 0 0 4 4 0 0 3 3 3 40 40 40 0 0 4 4 0 0-0 3 3 3 4 4 4 0 0 5 5 0 0-0 3 3 3 4 4 4 0 0 54 54 0 0-0 3 3 3 4 4 4 0 0 5 5 0 0 3 3 37 40 40 40 0 0 5 5 0 0 Image Processing Summary Image processing is the task of manipulating the image by mathematical means to achieve high level requirements Common operations: filtering Many other operations: E.g. Image forensic, Lithography, medical imaging, automatic image diagnosis, robot control, etc 36
Digital Cameras Resolution measured in pixels H x V Image sensing: charge coupled device (CCD) Megapixels is used to denote the total max pixels in the image E.g. 5 Megapixel - in the 50 by 90 and higher pixel range. Photo quality x 4 prints from this class of camera. Comparing film cameras to digital cameras is difficult since resolution is measured differently 37 Taking Pictures Marketing Caveats. Image captured by lens. Image focuses on CCD 3. CCD generates analog representation of image 4. Analog signal converts to digital 5. Digital signal processing (DSP) adjust quality, etc Step Step Step 3 Step 4 Step 5 Q: For digital cameras, higher megapixel value always produce better photos? A: Not really. If you will only look at the photos on websites, or will only print them on 3R papers, you don t need all the pixels from a 0M pixels camera. Area You Ready? Flat Panel TVs and Monitors Pictures displayed as matrix of pixels on screen Two major technologies for generating picture Plasma Liquid Crystal Display (LCD) Plasma Neon-Xenon gas trapped between two glasses When electrically charged, each pixel display red, blue or green color. LCD Liquid crystal between glasses pass/block light depending on electrical signal Pass corresponding backlight
LED TVs? Misleading term Proper name: LED-backlight LCD TVs Use the same LCD display technology as all other LCD displays. Most other standard LCD displays use cold cathode fluorescent light (CCFL) for backlight Three Characteristic Dimensions Panel Size The physical dimension of the panel A 4 panel has a diagonal measurement of 4 Display Resolution The number of picture-elements (pixels) along each X-Y direction Dot Pitch The distance between two pixel of the screen Panel Size = Display Resolution * Dot Pitch 43 Standard Display Resolutions Marketing Caveats Q: For flat panel TVs, a bigger screen always produce better display than a smaller screen? A: Not really. It depends on the distance you will be watching the TV and the TV source signal. More Pixel = Good? Human eye can identify 0 pixels per degree of visual arc i.e. if dots are closer than /0 degree, then our eyes cannot tell the difference At a distance of m (normal distance to a TV) our eyes cannot differentiate dots 0.4mm apart. Closer to TV => easier to differentiate pixels Far away => cannot tell the difference screen Minimum: arc minute Image courtesy of www.carltonbale.com
True LED displays Each pixel is a LED Used mostly in outdoor, largescale displays Hong Kong Shatin Racecourse 70.4m x m World s Longest TV screen Source: http://www.diamond-vision.com/ quad_dot_pattern.asp Dallas Cowboys Stadium Sideline Display 4.64m x.76m Pixel Pitch: 0mm Displays World s Largest High- Definition Video Display In Conclusion Digital signal processing is a very broad field within EEE The processing of digital image is a good example of high-level applications that run on digital signal processing systems. To display and process digital images correctly, you need the right combination of image representation, hardware, and processing power. 5