CMVision and Color Segmentation. CSE398/498 Robocup 19 Jan 05

Similar documents
Wireless Communication

CS 565 Computer Vision. Nazar Khan PUCIT Lecture 4: Colour

IMAGES AND COLOR. N. C. State University. CSC557 Multimedia Computing and Networking. Fall Lecture # 10

Computer Vision. Howie Choset Introduction to Robotics

Introduction to Computer Vision CSE 152 Lecture 18

Digital Image Processing Lec.(3) 4 th class

COLOR and the human response to light

Human Vision, Color and Basic Image Processing

Image Processing. Michael Kazhdan ( /657) HB Ch FvDFH Ch. 13.1

Announcements. Electromagnetic Spectrum. The appearance of colors. Homework 4 is due Tue, Dec 6, 11:59 PM Reading:

15110 Principles of Computing, Carnegie Mellon University

Mahdi Amiri. March Sharif University of Technology

Introduction to Multimedia Computing

Lecture Notes 11 Introduction to Color Imaging

Digital Image Processing. Lecture # 3 Image Enhancement

Computer Graphics. Si Lu. Fall er_graphics.htm 10/02/2015

COLOR. and the human response to light

Waitlist. We ll let you know as soon as we can. Biggest issue is TAs

Multimedia Systems Color Space Mahdi Amiri March 2012 Sharif University of Technology

Image Processing: An Overview

Color & Compression. Robin Strand Centre for Image analysis Swedish University of Agricultural Sciences Uppsala University

Light. intensity wavelength. Light is electromagnetic waves Laser is light that contains only a narrow spectrum of frequencies

VIDEO AND IMAGE PROCESSING USING DSP AND PFGA. Chapter 1: Introduction to Image Processing. Contents

LECTURE 07 COLORS IN IMAGES & VIDEO

Oversubscription. Sorry, not fixed yet. We ll let you know as soon as we can.

Reading instructions: Chapter 6

Digital Image Processing Color Models &Processing

Chapter 3 Part 2 Color image processing

Colors in Images & Video

15110 Principles of Computing, Carnegie Mellon University

Lecture 2 Digital Image Fundamentals. Lin ZHANG, PhD School of Software Engineering Tongji University Fall 2016

Visual Perception. Overview. The Eye. Information Processing by Human Observer

Image Perception & 2D Images

Color image Demosaicing. CS 663, Ajit Rajwade

Mech 296: Vision for Robotic Applications. Vision for Robotic Applications

Efficient Color Object Segmentation Using the Dichromatic Reflection Model

Introduction to More Advanced Steganography. John Ortiz. Crucial Security Inc. San Antonio

PRACTICAL IMAGE AND VIDEO PROCESSING USING MATLAB

Color image processing

Introduction to DSP ECE-S352 Fall Quarter 2000 Matlab Project 1

Image processing & Computer vision Xử lí ảnh và thị giác máy tính

Color Image Processing

Dr. Shahanawaj Ahamad. Dr. S.Ahamad, SWE-423, Unit-06

Improvements of Demosaicking and Compression for Single Sensor Digital Cameras

Digital Image Processing. Lecture # 6 Corner Detection & Color Processing

Lecture 1: image display and representation

Image and video processing (EBU723U) Colour Images. Dr. Yi-Zhe Song

Images and Graphics. 4. Images and Graphics - Copyright Denis Hamelin - Ryerson University

Announcements. The appearance of colors

Color Image Processing. Gonzales & Woods: Chapter 6

INSTITUTIONEN FÖR SYSTEMTEKNIK LULEÅ TEKNISKA UNIVERSITET

Histograms and Color Balancing

Bettina Selig. Centre for Image Analysis. Swedish University of Agricultural Sciences Uppsala University

EECS490: Digital Image Processing. Lecture #12

Cvision 2. António J. R. Neves João Paulo Silva Cunha. Bernardo Cunha. IEETA / Universidade de Aveiro

Digital Image Processing. Lecture # 8 Color Processing

DIGITAL IMAGE PROCESSING (COM-3371) Week 2 - January 14, 2002

Lecture 3: Grey and Color Image Processing

Sensing and Perception

LECTURE III: COLOR IN IMAGE & VIDEO DR. OUIEM BCHIR

Images and Colour COSC342. Lecture 2 2 March 2015

Sunderland, NE England

Camera Image Processing Pipeline: Part II

ECC419 IMAGE PROCESSING

4/9/2015. Simple Graphics and Image Processing. Simple Graphics. Overview of Turtle Graphics (continued) Overview of Turtle Graphics

Image acquisition. In both cases, the digital sensing element is one of the following: Line array Area array. Single sensor

Camera Image Processing Pipeline

Correction of Clipped Pixels in Color Images

Prof. Feng Liu. Fall /02/2018

Colors in images. Color spaces, perception, mixing, printing, manipulating...

Color , , Computational Photography Fall 2018, Lecture 7

Digital Imaging Rochester Institute of Technology

CS 262 Lecture 01: Digital Images and Video. John Magee Some material copyright Jones and Bartlett

Understand brightness, intensity, eye characteristics, and gamma correction, halftone technology, Understand general usage of color

Camera Image Processing Pipeline: Part II

Practical Content-Adaptive Subsampling for Image and Video Compression

CSE1710. Big Picture. Reminder

CS 376b Computer Vision

Vision, Color, and Illusions. Vision: How we see

Image and Multidimensional Signal Processing

Acquisition and representation of images

EMVA1288 compliant Interpolation Algorithm

2. Color spaces Introduction The RGB color space

Image and Video Processing

Color Computer Vision Spring 2018, Lecture 15

Chapter 2: Digital Image Fundamentals. Digital image processing is based on. Mathematical and probabilistic models Human intuition and analysis

Image Processing for Mechatronics Engineering For senior undergraduate students Academic Year 2017/2018, Winter Semester

the eye Light is electromagnetic radiation. The different wavelengths of the (to humans) visible part of the spectra make up the colors.

Color , , Computational Photography Fall 2017, Lecture 11

Colour (1) Graphics 2

Ch. 3: Image Compression Multimedia Systems

For a long time I limited myself to one color as a form of discipline. Pablo Picasso. Color Image Processing

Acquisition and representation of images

Overview. Pinhole camera model Projective geometry Vanishing points and lines Projection matrix Cameras with Lenses Color Digital image

Digital Asset Management 2. Introduction to Digital Media Format

Color images C1 C2 C3

MULTIMEDIA SYSTEMS

Digital Media. Lecture 4: Bitmapped images: Compression & Convolution Georgia Gwinnett College School of Science and Technology Dr.

Graphics and Image Processing Basics

Lecture 8. Color Image Processing

Transcription:

CMVision and Color Segmentation CSE398/498 Robocup 19 Jan 05

Announcements Please send me your time availability for working in the lab during the M-F, 8AM-8PM time period

Why Color Segmentation? Computationally inexpensive (relative to other features) Contrived colors are easy to track Combines with other features for robust tracking

Target Tracking Demo

Color Tracking Demo

Image Representation Let s Start with B&W Images These are referred to as grayscale or gray level images Corresponds to achromatic or monochromatic light Light devoid of color Also results from equal levels of R-G-B in an image

Image Representation

Image Representation 61 29 29 57 199 192 222 200 197 135 167 222 203 203 203 137 137 165 208 208 201 124 142 111 208 203 200 190 127 92 204 201 200 218 173 139 It s just a bunch of NUMBERS!

Digital Image Representation (0,0) x Images are contiguous blocks of numbers in computer memory y We will manipulate these numbers to get them into a useful form

Digital Image Representation (cont d) Several properties define the image format Pixel (or spatial) Resolution (e.g. 640x480 pixels) Pixel bit-depth (8-bit unsigned, 16-bit signed, etc.) Frame rate (e.g. 30 Hz) Colorspace (RGB, YCbCr, etc.) Number of planes - 1 for grayscale images, 3 for color Pixel format (planar vs. packed) R G B R G B R G B R R R G G G B B B You MUST know ALL of these or you will have processed GARBAGE!

Grayscale Images Corresponds to achromatic or monochromatic light (without color) Typically 8-bit unsigned chars with a dynamic range of [0,255] One char corresponds to one image pixel 0 I( x, y) 255

RGB Color Space Motivated by human visual system 3 color receptor cells (cones) in the retina with different spectral response curves Used in color monitors and most video cameras

RGB Image Formation in Cameras Most video cameras use RGB space Expensive variants use 3 CCDs, each with a filter for the respective wavelength of light More common variants (like what we will use) have a single CCD Q: How do they reproduce color? A: A Filter!

The Bayer Filter Based upon the observation that human vision is much more responsive to green light than red or blue Half the pixels in the CCD are allocated to green, ¼ to red and ¼ to blue Color is generated for the whole CCD by interpolating neighbor values The image we get has already undergone a lossy compression

RGB Image Format Images pixels can be either planar or packed format Planar format separates the colors into three contiguous arrays in memory Packed alternate R->G->B->R-> in memory Planar Packed

Representing Colors in an RGB Image Red Green Blue

How do we segment a single color? We need to model is mathematically a priori In other words, the robot needs models of colors it is looking for in its memory Sample set for orange hat

Simple RGB Color Segmentation Red Green Blue ( µ = 254.5, σ = 1.1) ( µ = 103.6, σ = 14.8) ( µ = 45.1, σ = 6.07) Issue of Thresholding! 251 < I R ( x, y) < 256 73 < I G ( x, y) < 135 32 < ( x, y) < 58 I B Segmented Color Image & &

Segmentation Issues The approach surrounds the color with a prism This captures the color, but also many other colors that are not of interest Remember, each POINT represents a unique color

Implementation is Important! Recall that we only have a 567 MHz, so the implementation is important What s wrong with the following code segment (the RGB pixel values are imr, img, imb respectively): if(imr<=rmax && imr>=rmin && img<=gmax && img>=gmin && imb<=bmax && imb>=bmin) x=1; else x=0; Conditional Branch is a control hazard! Could result in a flushed pipeline!!! Better would be: x = imr<=rmax && imr>=rmin && img<=gmax && img>=gmin && imb<=bmax && imb>=bmin; So the segmentation can be reduced to a series of logical operations

But we have Many colors to segment * www.robocup.org

CMVision Color Segmentation James Bruce et al, IROS 2000 The main ideas: Use lookup tables (LUT) to store colors Since color membership is based on binary logical operations, represent colors at the bit level For an integer based LUT, this allows the segmentation of up to 32 colors in parallel Since the LUTs are small, they will can be contained in the cache for improved performance

CMVision Color Segmentation (cont d) x = imr<=rmax && imr>=rmin && img<=gmax && img>=gmin && imb<=bmax && imb>=bmin; We want to convert this into a LUT. Assume for now that the pixel depth is 4 bits Let s say the valid range of colors for a ball are: 3 We can write these as the following LUTs: 0 red int inred[16] = {1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0}; int ingreen[16] = {0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0}; int inblue[16] = {0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1}; 8 green 6 9 blue 15

CMVision Color Segmentation (cont d) Now we can express x = imr<=rmax && imr>=rmin && img<=gmax && img>=gmin && imb<=bmax && imb>=bmin; as: x = inred[imr] && ingreen[img] && inblue[imb] This is the whole point of LUTs increase speed at the cost of memory Notice that testing whether an image pixel is a member of a color requires only a single bit (0/1) representation Use this to embed multiple colors in the LUT and segment them in parallel

CMVision Color Segmentation (cont d) Lets consider two colors: int inred1[16] = {1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0}; int ingreen1[16] = {0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0}; int inblue1[16] = {0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1}; int inred2[16] = {0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0}; int ingreen2[16] = {0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0}; int inblue2[16] = {0,0,0,0,0,0,1,1,1,1,1,1,1,0,0,0}; We can combine these into a single LUT int inred[16] = {1,1,1,1,1,3,3,0,0,0,0,0,0,0,0,0}; int ingreen[16] = {0,0,0,0,0,0,2,2,3,3,0,0,0,0,0,0}; int inblue[16] = {0,0,0,1,1,1,3,3,3,3,3,3,3,1,1,1};

CMVision Color Segmentation (cont d) Lets consider two colors: int inred1[16] = {1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0}; int ingreen1[16] = {0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0}; int inblue1[16] = {0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1}; int inred2[16] = {0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0}; int ingreen2[16] = {0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0}; int inblue2[16] = {0,0,0,0,0,0,1,1,1,1,1,1,1,0,0,0}; We can combine these into a single LUT int inred[16] = {01,01,01,01,01,11,11,00,00,00,00,00,00,00,00,00}; int ingreen[16] = {00,00,00,00,00,00,10,10,11,11,00,00,00,00,00,00}; int inblue[16] = {00,00,00,01,01,01,11,11,11,11,11,11,11,01,01,01}; The first color is embedded in the LSB. The next color is in the next bit

CMVision Color Segmentation (cont d) Now we can express as: x = inred[imr] && ingreen[img] && inblue[imb] x = inred[imr] & ingreen[img] & inblue[imb] Note that the logical operations are now done at the BIT level Thus, we test a pixel against n colors (for an n-bit word) in parallel! The only negative is that since we are representing colors by prisms, it will be difficult to find that many that don t overlap.

CMVision Segmentation Example Raw Image Segmented Image * http://www-2.cs.cmu.edu/~jbruce/cmvision/

An Alternate Segmentation Approach 1 Bound the color with a rectangle at a color/grayscale level Much less conservative in that it lets in less invalid pixels, but still conservative Fast implementations employ bit-based LUT to segment multiple colors in a single pass

A Layered Bounding Rectangle Approach Example: For each level of blue, bound the red & green levels from above and below: g min g max g min g max Red Red r max r min r max r min Green Green Blue = 0 Blue = 255

2D LUT We will now have 2, two-dimensional LUTs: int bluered[16][16] = {{1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0},, {0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0}}; int bluegreen[16][16] = {{0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1}, Our test now becomes {0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0}}; x = bluered[imb][imr] & bluegreen[imb][img] where we again use a bitwise representation for color membership Only negative is the growth of the LUT by O(n) but still small enough to be very fast

Alternate Segmentation Approach 2 Bound the color with a three-dimensional solid Best color representation Requires a 3D LUT, which for even an 8-bit LUT depth is > 16 MB

YCbCr Color Space Human eye more responsive to brightness changes than color changes Separates luma ( brightness ) from the chroma ( color ) channels Basis for US television signal (related to YUV/YIQ formats) Allows for the transmission of B&W images Image format for Aibos Greyscale Y= 0.30*R+0.59*G+0.11*B Y 0.299 0.587 Cb = 0.169 0.331 Cr 0.500 0.419 * One possible conversion. 0.114 R 0 0.500 128 G + 0.082 B 128

YIQ Image Format Images can be either planar or packed format, but normally is packed Alternates U1->Y1->V1->Y2->U2->Y3->V2->Y4 Every 2 Y pixels share a Cb and Cr Sub-sampled horizontally 4 bytes/2 pixels vs. 6 bytes for RGB24 Separation of the luminance helps in color segmentation (sometimes)

An Alternate Segmentation Approach 1 Bound the color with a rectangle at a color/grayscale level Much less conservative in that it lets in less invalid pixels, but still conservative Fast implementations employ bit-based LUT to segment multiple colors in a single pass

Summary Colors are easily segmented from images Need to be characterized a priori Color is the perception of reflected light in a scene Perception is strongly tied to illumination levels Formats of interest for us are RGB and YCbCr Often combined with other feature detectors for robust tracking Efficient implementation is important Tradeoffs between speed, memory use and accurate color representation: There is no free lunch

Next Time Review of edge detection for line segmentation * www.robocup.org