color image processing 4.6 color image processing color –simplifies object extraction and...

52
Color Color Image Image Processin Processin g g

Upload: myrtle-nelson

Post on 23-Dec-2015

222 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Color Image Processing 4.6 Color Image Processing Color –simplifies object extraction and identification –human vision : thousands of colors vs max-24

Color Image Color Image ProcessingProcessing

Page 2: Color Image Processing 4.6 Color Image Processing Color –simplifies object extraction and identification –human vision : thousands of colors vs max-24

4.6 Color Image Processing

• Color– simplifies object extraction and identification– human vision : thousands of colors vs max-24

gray levels

• Color Spectrum– white light with a prism (1966, Newton)

Page 3: Color Image Processing 4.6 Color Image Processing Color –simplifies object extraction and identification –human vision : thousands of colors vs max-24

4.6 Color Image Processing

• RGB : Color Monitor, Color Camera, Color Scanner

• CMY : Color Printer, Color Copier

• YIQ : Color TV 표준 , Y(luminance), I(Inphase), Q(quadrature)

– HSI, HSV

Page 4: Color Image Processing 4.6 Color Image Processing Color –simplifies object extraction and identification –human vision : thousands of colors vs max-24

4.6 Color Image Processing

• RGB Model

Page 5: Color Image Processing 4.6 Color Image Processing Color –simplifies object extraction and identification –human vision : thousands of colors vs max-24

4.6 Color Image Processing

• CMY Model– Color Printer, Color Copier– RGB data CMY

B

G

R

Y

M

C

1

1

1

Page 6: Color Image Processing 4.6 Color Image Processing Color –simplifies object extraction and identification –human vision : thousands of colors vs max-24

4.6 Color Image Processing

B

G

R

Q

I

Y

311.0523.0212.0

321.0275.0596.0

114.0587.0299.0

Q

I

Y

B

G

R

705.1108.11

647.0272.01

620.0956.01

Page 7: Color Image Processing 4.6 Color Image Processing Color –simplifies object extraction and identification –human vision : thousands of colors vs max-24

4.6 Color Image Processing

Page 8: Color Image Processing 4.6 Color Image Processing Color –simplifies object extraction and identification –human vision : thousands of colors vs max-24

4.6 Color Image Processing

• RGB to HSI Conversion1,,,0 where),(

3

1 BGRIBGRI

002

1 if },))(()(

)]()[(21

{cos bgBGBRGR

BRGRH

00 if ,360 bgHH

}),,(min{3

1 BGRBGR

S

IBbIGg / ,/ where 00

Page 9: Color Image Processing 4.6 Color Image Processing Color –simplifies object extraction and identification –human vision : thousands of colors vs max-24

4.6 Color Image Processing

• HSI to RGB Conversion

BRG

H

HSR

SB

1

])60cos(

cos1[

3

1

)1(3

1

1200 assume H

Page 10: Color Image Processing 4.6 Color Image Processing Color –simplifies object extraction and identification –human vision : thousands of colors vs max-24

Image Retrieval Application

• Content-Based Image Retrieval System

Index

Retrieval

Q uery

feature extrac tion

Im age database

c om pression im age

indexfeature inform ation

dec om pression

result

query

Page 11: Color Image Processing 4.6 Color Image Processing Color –simplifies object extraction and identification –human vision : thousands of colors vs max-24

Image Retrieval Application

• Color Features for Image Indexing– Color Histogram

• an estimate of the probability of occurrence of color intensities• 장점 : simple and geometric invariance(translation, rotation, and

scaling)• 단점 : lack of spatial information of objects

– Dominant Colors• image 의 대표 색상• 잡음에 무관

– Color Monments• moment invariants for color distribution

Page 12: Color Image Processing 4.6 Color Image Processing Color –simplifies object extraction and identification –human vision : thousands of colors vs max-24

Image Retrieval Application

• Example of Color Histogram in HSI Model

- Hue : range [0, 360]- Saturation : range[0, 1] - Intensity : range[0, 1]- Total 36 bin quantization Hue : 6bin Saturation : 2bin Intensity: 3bin

Page 13: Color Image Processing 4.6 Color Image Processing Color –simplifies object extraction and identification –human vision : thousands of colors vs max-24

• Image representation

• Image statistics

• Histograms (frequency)

• Entropy (information)

• Filters (low, high, edge, smooth)

The Course

• Books– Computer Vision – Adrian

Lowe

– Digital Image Processing – Gonzalez, Woods

– Image Processing, Analysis and Machine Vision – Milan Sonka, Roger Boyle

Page 14: Color Image Processing 4.6 Color Image Processing Color –simplifies object extraction and identification –human vision : thousands of colors vs max-24

Introduction to Digital Image Processing

• Human vision - perceive and understand world

• Computer vision, Image Understanding / Interpretation, Image processing.– 3D world -> sensors (TV cameras) -> 2D images

– Dimension reduction -> loss of information

• low level image processing • transform of one image to another

• high level image understanding• knowledge based - imitate human cognition

• make decisions according to information in image

Page 15: Color Image Processing 4.6 Color Image Processing Color –simplifies object extraction and identification –human vision : thousands of colors vs max-24

Introduction to Digital Image Processing

HIGH

MEDIUM

LOW

Algorithm Complexity Increases

Classification / decision

Raw data

Amount of Data Decreases

• Acquisition, preprocessing– no intelligence

• Extraction, edge joining

• Recognition, interpretation– intelligent

Page 16: Color Image Processing 4.6 Color Image Processing Color –simplifies object extraction and identification –human vision : thousands of colors vs max-24

Low level digital image processing

• Low level computer vision ~ digital image processing

• Image Acquisition

– image captured by a sensor (TV camera) and digitized

• Preprocessing

– suppresses noise (image pre-processing)

– enhances some object features - relevant to understanding the image

– edge extraction, smoothing, thresholding etc.

• Image segmentation

– separate objects from the image background

– colour segmentation, region growing, edge linking etc

• Object description and classification

– after segmentation

Page 17: Color Image Processing 4.6 Color Image Processing Color –simplifies object extraction and identification –human vision : thousands of colors vs max-24

Signals and Functions• What is an image

• Signal = function (variable with physical meaning)

– one-dimensional (e.g. dependent on time)

– two-dimensional (e.g. images dependent on two co-ordinates in a plane)– three-dimensional (e.g. describing an object in space)– higher-dimensional

• Scalar functions

– sufficient to describe a monochromatic image - intensity images

• Vector functions

– represent color images - three component colors

Page 18: Color Image Processing 4.6 Color Image Processing Color –simplifies object extraction and identification –human vision : thousands of colors vs max-24

Image Functions• Image - continuous function of a number of variables

• Co-ordinates x, y in a spatial plane– for image sequences - variable (time) t

• Image function value = brightness at image points– other physical quantities

– temperature, pressure distribution, distance from the observer

• Image on the human eye retina / TV camera sensor - intrinsically 2D

• 2D image using brightness points = intensity image

• Mapping 3D real world -> 2D image– 2D intensity image = perspective projection of the 3D scene

– information lost - transformation is not one-to-one

– geometric problem - information recovery

– understanding brightness info

Page 19: Color Image Processing 4.6 Color Image Processing Color –simplifies object extraction and identification –human vision : thousands of colors vs max-24

Image Acquisition & Manipulation

• Analogue camera– frame grabber

– video capture card

• Digital camera / video recorder• Capture rate 30 frames / second

– HVS persistence of vision • Computer, digitised image, software (usually c)• f(x,y) #define M 128

#define N 128

unsigned char f[N][M] • 2D array of size N*M• Each element contains an intensity value

Page 20: Color Image Processing 4.6 Color Image Processing Color –simplifies object extraction and identification –human vision : thousands of colors vs max-24

Image definition

• Image definition:– A 2D function obtained by sensing a scene

– F(x,y), F(x1,x2), F(x)

– F - intensity, grey level

– x,y - spatial co-ordinates

• No. of grey levels, L = 2B

• B = no. of bits

B L Description 1 2 Binary Image (black and white) 6 54 64 levels, limit of human visual system 8 256 Typical grey level resolution

f(N-1,M-1)

f(o,o)

N

M

Page 21: Color Image Processing 4.6 Color Image Processing Color –simplifies object extraction and identification –human vision : thousands of colors vs max-24

Brightness and 2D images

• Brightness dependent several factors

– object surface reflectance properties

• surface material, microstructure and marking

– illumination properties

– object surface orientation with respect to a viewer and light source

• Some Scientific / technical disciplines work with 2D images directly

– image of flat specimen viewed by a microscope with transparent illumination

– character drawn on a sheet of paper

– image of a fingerprint

Page 22: Color Image Processing 4.6 Color Image Processing Color –simplifies object extraction and identification –human vision : thousands of colors vs max-24

Monochromatic images• Image processing - static images - time t is constant

• Monochromatic static image - continuous image function f(x,y) – arguments - two co-ordinates (x,y)

• Digital image functions - represented by matrices– co-ordinates = integer numbers

– Cartesian (horizontal x axis, vertical y axis)

– OR (row, column) matrices

• Monochromatic image function range– lowest value - black

– highest value - white

• Limited brightness values = gray levels

Page 23: Color Image Processing 4.6 Color Image Processing Color –simplifies object extraction and identification –human vision : thousands of colors vs max-24

Chromatic images

• Colour– Represented by vector not scalar

• Red, Green, Blue (RGB)

• Hue, Saturation, Value (HSV)

• luminance, chrominance (Yuv , Luv)

Red

Green

Hue degrees:Red, 0 degGreen 120 degBlue 240 deg

Green

V=0

S=0

Page 24: Color Image Processing 4.6 Color Image Processing Color –simplifies object extraction and identification –human vision : thousands of colors vs max-24

Use of colour space

Page 25: Color Image Processing 4.6 Color Image Processing Color –simplifies object extraction and identification –human vision : thousands of colors vs max-24

Image quality

• Quality of digital image proportional to:

– spatial resolution • proximity of image samples in image plane

– spectral resolution • bandwidth of light frequencies captured by sensor

– radiometric resolution • number of distinguishable gray levels

– time resolution • interval between time samples at which images captured

Page 26: Color Image Processing 4.6 Color Image Processing Color –simplifies object extraction and identification –human vision : thousands of colors vs max-24

Image summary

• F(xi,yj)

• i = 0 --> N-1• j = 0 --> M-1• N*M = spatial resolution, size of image• L = intensity levels, grey levels • B = no. of bits

f(N-1,M-1)

f(o,o)

N

M

Page 27: Color Image Processing 4.6 Color Image Processing Color –simplifies object extraction and identification –human vision : thousands of colors vs max-24

Digital Image Storage

• Stored in two parts– header

• width, height … cookie.– Cookie is an indicator of what type of image file

– data• uncompressed, compressed, ascii, binary.

• File types– JPEG, BMP, PPM.

Page 28: Color Image Processing 4.6 Color Image Processing Color –simplifies object extraction and identification –human vision : thousands of colors vs max-24

PPM, Portable Pixel Map

• Cookie– Px

• Where x is:

• 1 - (ascii) binary image (black & white, 0 & 1)

• 2 - (ascii) grey-scale image (monochromic)

• 3 - (ascii) colour (RGB)

• 4 - (binary) binary image

• 5 - (binary) grey-scale image (monochromatic)

• 6 - (binary) colour (RGB)

Page 29: Color Image Processing 4.6 Color Image Processing Color –simplifies object extraction and identification –human vision : thousands of colors vs max-24

PPM example

• PPM colour file RGB

P3

# feep.ppm

4 4

15

0 0 0 0 0 0 0 0 0 15 0 15

0 0 0 0 15 7 0 0 0 0 0 0

0 0 0 0 0 0 0 15 7 0 0 0

15 0 15 0 0 0 0 0 0 0 0 0

Page 30: Color Image Processing 4.6 Color Image Processing Color –simplifies object extraction and identification –human vision : thousands of colors vs max-24

ToolsTools

Page 31: Color Image Processing 4.6 Color Image Processing Color –simplifies object extraction and identification –human vision : thousands of colors vs max-24

Installing CVIPtools• Download the appropriate installation from

http://www.ee.siue.edu/CVIPtools/

• Double-click on binWin32.tar.gz

• Agree to the WinZip conditions.

• Answer the “Should WinZip decompress it to a temporary folder and open it?” YES

• You will see the WinZip window with over 1100 files, find the file install.exe and double-click on it

• You will see an “Install” window with the statement “WinZip will extract all files to a temporary folder and run the install.exe program” Press OK

Page 32: Color Image Processing 4.6 Color Image Processing Color –simplifies object extraction and identification –human vision : thousands of colors vs max-24

Installing CVIPtools• WinZip will extract the files to c:\windows\TEMP\install

• You will see the CVIPtools Installation window with the statement “Press OK to proceed with installation, Press Cancel to abort installation” Press OK

• You will see the Select source drive directory, which should be C:\WINDOWS\TEMP\install. Press OK

• You will see the Select destination drive and directory. Press the “..” until you see the directory C:\CVIPtools, then press OK

• You will see the Select installation type and options window. Select Binary installation and press OK

Page 33: Color Image Processing 4.6 Color Image Processing Color –simplifies object extraction and identification –human vision : thousands of colors vs max-24

Installing CVIPtools• You will see a Copying files message. Wait for the

program to finish. You will see the CVIPtools Installation complete message. Press OK.

• You will see a Install window with the question. When install.exe completes press the OK button to return to WinZip. Press OK.

• Exit from WinZip

• Go to C:\CVIPtools\bin

• Make a shortcut to CVIPtools.bat

• To run CVIPtools double-click on the shortcut.

Page 34: Color Image Processing 4.6 Color Image Processing Color –simplifies object extraction and identification –human vision : thousands of colors vs max-24

Image presentation (1)1.1 Image capture,

representation, and storage:

digital image, DPI, pixel...

Example: Various quantizing level: (a) 6 bits; (b) 4 bits; (c) 2 bits; (d) 1 bit.

Page 35: Color Image Processing 4.6 Color Image Processing Color –simplifies object extraction and identification –human vision : thousands of colors vs max-24

Image presentation (2)

• 1.2 Color representation:

Color systems: RGB, CMY/CMYK, HSI, YCbCr

Page 36: Color Image Processing 4.6 Color Image Processing Color –simplifies object extraction and identification –human vision : thousands of colors vs max-24

Sources

• Department of Pattern Recognition and Knowledge Engineering

• Institute of Information Technology• Hanoi, Vietnam

• Represented by LUONG CHI MAI

[email protected]ührung in die erweiterte Realität Virtual Reality Modeling Language (VRML) Prof. G. Klinker, Prof. B. Brügge 19. Mai 2000

• Schenney UC Berkeley

Page 37: Color Image Processing 4.6 Color Image Processing Color –simplifies object extraction and identification –human vision : thousands of colors vs max-24

SUPPLEMENTAL READINGSUPPLEMENTAL READING

Jensen. 1996. Introductory Digital Image Processing. (Upper Saddle River, NJ: Prentice Hall). Ed. 2. Ch. 2 (60-61), Ch. 3, and Ch. 4

Page 38: Color Image Processing 4.6 Color Image Processing Color –simplifies object extraction and identification –human vision : thousands of colors vs max-24

SourcesSources

• Maja Mataric

• Dodds, Harvey Mudd College

• Damien Blond

• Alim Fazal

• Tory Richard

• Jim Gast

• Bryan S. Morse• Gerald McGrath

• Vanessa S. Blake

• Many sources of slides from Internet

http://www.cheng.cam.ac.uk/seminars/imagepro/

Page 39: Color Image Processing 4.6 Color Image Processing Color –simplifies object extraction and identification –human vision : thousands of colors vs max-24

• 533 Text book• http://sern.ucalgary.ca/courses/CPSC/533/W99/presentations/L2_24A_Lee_Wang/ http://sern.ucalgary.ca/courses/CPSC/533/W99/presentations/L1_24A_Kaasten_Steller_Hoang/main.htm http://sern.ucalgary.ca/courses/CPSC/533/W99/presentations/L1_24_Schebywolok/index.html http://sern.ucalgary.ca/courses/CPSC/533/W99/presentations/L2_24B_Doering_Grenier/• http://www.geocities.com/SoHo/Museum/3828/optical.html• http://members.spree.com/funNgames/katbug/

SourcesSources

Page 40: Color Image Processing 4.6 Color Image Processing Color –simplifies object extraction and identification –human vision : thousands of colors vs max-24

SourcesSources•Bryan S. Morse •Prof. Paolo Dario•Cecilia Laschi •Many WWW sources•Anup Basu, Ph.D. Professor, Dept of Computing Sc. University of Alberta• Professor Kim, KAIST• Computer science, University of Massachusetts, Web Site: www-edlab.cs.umass/cs570

Page 41: Color Image Processing 4.6 Color Image Processing Color –simplifies object extraction and identification –human vision : thousands of colors vs max-24

Companies in Canada• BIOLOGICAL

– Morphometrix (Toronto): automated pap smear testing

• DEFENSE/INTELLIGENCE– SPAR Aerospace (Toronto, Edmonton): detection of targets in radar clutter

• DOCUMENT PROCESSING– NCR: check processing; character recognition

• FACTORY AUTOMATION– IPS Automation (Markham): automated bottle thread and CRT inspection

– IO Industries (London): image acquisition

• MEDICAL– Forward Imaging (London)

– EVS (London)

– Cedara Software (Mississauga)

– Mitra (Waterloo)

– Dicomit (Markham)

• ...

Page 42: Color Image Processing 4.6 Color Image Processing Color –simplifies object extraction and identification –human vision : thousands of colors vs max-24

SummaryShould know following terms:

• digital image (pixel, gray level)

• colormap

• digitization – continuous-tone image

– sampling

– quantization• dynamic range

– spatial resolution• pixelation

– brightness resolution• posterization & brightness contouring

• digital image processing

• digital image analysis

Page 43: Color Image Processing 4.6 Color Image Processing Color –simplifies object extraction and identification –human vision : thousands of colors vs max-24

OutlineOutline• Human Vision and Machine Vision• Digital Image• Image Formation•Image Processing Operations for Early Vision•Applications of Early Image Processing•Extracting 3D Information using Vision•Using Vision for Manipulation and Navigation•Object Representation and Recognition•Perception

• Light and Optics– Pinhole camera model

– Perspective projection

– Thin lens model

– Fundamental equation

– Distortion: spherical & chromatic aberration, radial distortion

– Reflection and Illumination: color, lambertian and specular surfaces, Phong, BDRF

• Sensing Light

• Conversion to Digital Images

• Sampling Theorem

• Other Sensors: frequency, type, ….

Start from

Page 44: Color Image Processing 4.6 Color Image Processing Color –simplifies object extraction and identification –human vision : thousands of colors vs max-24

Scanner

Photo card reader

Computer

Examples of Examples of simple image simple image processingprocessing

Page 45: Color Image Processing 4.6 Color Image Processing Color –simplifies object extraction and identification –human vision : thousands of colors vs max-24

What do I do with it?

Option 1

• Open it in PhotoEditor

• Print it out to Deskjet printer

• Laminate it

• Stick it on your poster

Page 46: Color Image Processing 4.6 Color Image Processing Color –simplifies object extraction and identification –human vision : thousands of colors vs max-24

What do I do with it?

Option 2

• Open it in PhotoEditor

• Crop and resize to the size it will appear in the final product

• Import image into Word

• Print report from Word

Page 47: Color Image Processing 4.6 Color Image Processing Color –simplifies object extraction and identification –human vision : thousands of colors vs max-24

What do I do with it? - Option 3

• Open it in PhotoEditor

• Crop and resize to the size it will appear in the final product

• Import image into PowerPoint

• Use PowerPoint for presentation or

• Take PowerPoint file to P&IS for printing as a poster (this costs money)

Page 48: Color Image Processing 4.6 Color Image Processing Color –simplifies object extraction and identification –human vision : thousands of colors vs max-24

Don't copy and paste images into Word and PowerPoint

Always use  Insert    Picture      From file

Page 49: Color Image Processing 4.6 Color Image Processing Color –simplifies object extraction and identification –human vision : thousands of colors vs max-24

Don’t just insert it into your document and resize by dragging its sizing handles

If you make it look smaller, it’s still same filesize

Page 50: Color Image Processing 4.6 Color Image Processing Color –simplifies object extraction and identification –human vision : thousands of colors vs max-24

and if you make it bigger…...

Page 51: Color Image Processing 4.6 Color Image Processing Color –simplifies object extraction and identification –human vision : thousands of colors vs max-24

Also, for images in web pages…

<img src="dept1.gif" width=274 height=230 alt="department with daffodils">

don’t use these fields to scale image

In this class, it is required to create web pages and good documentation to your project with color pictures. This is a standard among roboticists.

Page 52: Color Image Processing 4.6 Color Image Processing Color –simplifies object extraction and identification –human vision : thousands of colors vs max-24

Further information on web graphicsFurther information on web graphics

•The Web Developers Virtual Library http://WWW.Stars.com/Authoring/Graphics/

•Graphics links http://www.stars.com/Vlib/Multimedia/Graphics.html

•Tips and tutorials for creating graphics in PhotoShop and other applications. http://www.mccannas.com/pshop/menu.htm

Scanning tips

•http://www.scantips.com