![Page 1: Introduction au cours Traitement d' Images en ESSI2](https://reader034.vdocuments.us/reader034/viewer/2022052313/586e0ea01a28ab687a8bc5b0/html5/thumbnails/1.jpg)
2006
Image Processing:Introduction University of the Philippines
August 2006
Diane LingrandUniversity of Nice – Sophia Antipolis,
http://www.polytech.unice.fr/~lingrand
![Page 2: Introduction au cours Traitement d' Images en ESSI2](https://reader034.vdocuments.us/reader034/viewer/2022052313/586e0ea01a28ab687a8bc5b0/html5/thumbnails/2.jpg)
2006 Sophia AntipolisSophia Antipolis
![Page 3: Introduction au cours Traitement d' Images en ESSI2](https://reader034.vdocuments.us/reader034/viewer/2022052313/586e0ea01a28ab687a8bc5b0/html5/thumbnails/3.jpg)
2006
Course overview
• Basics: image format, color representation• Quantification, Sampling and applications• Image segmentation• Noise and image restauration• Image and video compression
![Page 4: Introduction au cours Traitement d' Images en ESSI2](https://reader034.vdocuments.us/reader034/viewer/2022052313/586e0ea01a28ab687a8bc5b0/html5/thumbnails/4.jpg)
2006
Today
• Image acquisition• Image format• Data structures• Color representation
![Page 5: Introduction au cours Traitement d' Images en ESSI2](https://reader034.vdocuments.us/reader034/viewer/2022052313/586e0ea01a28ab687a8bc5b0/html5/thumbnails/5.jpg)
20065
Image formation (1)
Sensor
Real world imagesensor+ =
![Page 6: Introduction au cours Traitement d' Images en ESSI2](https://reader034.vdocuments.us/reader034/viewer/2022052313/586e0ea01a28ab687a8bc5b0/html5/thumbnails/6.jpg)
20066
Image Formation (2)
• Visual sensors :
– photochimic (biological systems, photographic films)
– photoelectric (CMOS, CCD)
• Other sensors
– Medical imaging (IRM, rayons X, …)
– Sismic imaging
![Page 7: Introduction au cours Traitement d' Images en ESSI2](https://reader034.vdocuments.us/reader034/viewer/2022052313/586e0ea01a28ab687a8bc5b0/html5/thumbnails/7.jpg)
20067
Signal
• Dimension : – 1D, 2D, 3D, 2D+T, 3D+T, …
• Nature :– Analog– Digital
• How to put an image on a computer ?– Sampling (space) – Quantification (values)
![Page 8: Introduction au cours Traitement d' Images en ESSI2](https://reader034.vdocuments.us/reader034/viewer/2022052313/586e0ea01a28ab687a8bc5b0/html5/thumbnails/8.jpg)
20068
An image on computer
• An array of pixels– 1D array– 2D array– 3D array (video sequence or volumetric
image)– …
• A pixel (= picture element)– Its value is an intensity (scalar), a color ...– dimension ?
![Page 9: Introduction au cours Traitement d' Images en ESSI2](https://reader034.vdocuments.us/reader034/viewer/2022052313/586e0ea01a28ab687a8bc5b0/html5/thumbnails/9.jpg)
20069
Tesselation: how to arrange the pixels
hexagonalrectangular
triangular « quite real »
![Page 10: Introduction au cours Traitement d' Images en ESSI2](https://reader034.vdocuments.us/reader034/viewer/2022052313/586e0ea01a28ab687a8bc5b0/html5/thumbnails/10.jpg)
200610
Neighbourhood
• Square or rectangular pixels :
• Hexagonal pixels :
4connexity
8connexity
6 neighbours
![Page 11: Introduction au cours Traitement d' Images en ESSI2](https://reader034.vdocuments.us/reader034/viewer/2022052313/586e0ea01a28ab687a8bc5b0/html5/thumbnails/11.jpg)
200611
Distances
• Euclidean Distance (k - i)2 + (l - j)2
• Block Distance (Manhattan)| k – i | + | l – j |
• Chess Distancemax( | k - i | , | l – j |)
i k
j
l
![Page 12: Introduction au cours Traitement d' Images en ESSI2](https://reader034.vdocuments.us/reader034/viewer/2022052313/586e0ea01a28ab687a8bc5b0/html5/thumbnails/12.jpg)
200612
2D visible images
• Black and white images
– a pixel value is black or white (binary)
• Grey images / Grey levels images
– a pixel value is represented by a scalar value
• Color images– a pixel value is represented by 3 or more
scalar values (RGB, …)
• Multi-spectral images, …
![Page 13: Introduction au cours Traitement d' Images en ESSI2](https://reader034.vdocuments.us/reader034/viewer/2022052313/586e0ea01a28ab687a8bc5b0/html5/thumbnails/13.jpg)
200613
Quantification
• Only few grey levels or colors are considered:
– grey levels: 256
– number of colors: 256 * 256 * 256
• Consequences :
– quality decreasing
– artefacts
256*256*256= 16777216 colors
8*8*8= 512 colors
2*2*2 = 8 colors
![Page 14: Introduction au cours Traitement d' Images en ESSI2](https://reader034.vdocuments.us/reader034/viewer/2022052313/586e0ea01a28ab687a8bc5b0/html5/thumbnails/14.jpg)
200614
Trade-off between …
… visual quality and memory space.The more colors ou grey levels we have, the
better the visual quality but bigger the memory space used.
do not increase the quantification step if the improved quality is not visible.
![Page 15: Introduction au cours Traitement d' Images en ESSI2](https://reader034.vdocuments.us/reader034/viewer/2022052313/586e0ea01a28ab687a8bc5b0/html5/thumbnails/15.jpg)
200615
Idea of values
28 = 256 colors
pixel on 8 bits
216 colors = 65536
pixel on 16 bits
memory space * 2
nb. of colors * 256
![Page 16: Introduction au cours Traitement d' Images en ESSI2](https://reader034.vdocuments.us/reader034/viewer/2022052313/586e0ea01a28ab687a8bc5b0/html5/thumbnails/16.jpg)
2006
Image Formats
orHow to memorize an image as a
file on my computer disk.
![Page 17: Introduction au cours Traitement d' Images en ESSI2](https://reader034.vdocuments.us/reader034/viewer/2022052313/586e0ea01a28ab687a8bc5b0/html5/thumbnails/17.jpg)
200617
What do I need ?
• Necessary informations :– image width (in pixels)– image heigth (in pixels)– image value (intensity) for each pixel
• Image values :– are usually given line by line from top to
bottom and then from left to right
![Page 18: Introduction au cours Traitement d' Images en ESSI2](https://reader034.vdocuments.us/reader034/viewer/2022052313/586e0ea01a28ab687a8bc5b0/html5/thumbnails/18.jpg)
200618
A very simple image format: PBM
• Black and white images
> more ph021-ascii.pbmP1# CREATOR: XV Version 3.10a Rev: 12/29/94 (PNG patch 1.2)640 4801 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 0 11 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 1 01 1 1 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 00 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 00 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 00 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 00 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 00 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 00 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 00 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 00 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 …
indicates the format : PBM
width and height of images, in pixels l
![Page 19: Introduction au cours Traitement d' Images en ESSI2](https://reader034.vdocuments.us/reader034/viewer/2022052313/586e0ea01a28ab687a8bc5b0/html5/thumbnails/19.jpg)
200619
The whole image in PBM
![Page 20: Introduction au cours Traitement d' Images en ESSI2](https://reader034.vdocuments.us/reader034/viewer/2022052313/586e0ea01a28ab687a8bc5b0/html5/thumbnails/20.jpg)
200620
> more ph021-ascii.pgmP2# CREATOR: XV Version 3.10a Rev: 12/29/94 (PNG patch 1.2)640 480255 73 154 125 160 172 163 172 168 131 162 171 171 170 174 165 171 167166 159 170 164 170 157 93 54 67 86 96 50 75 61 88 135 163 54 85 82 70 66 72 45 56 56 54 80 84 111 134 103 120 154169 175 182 174 175 172 172 176 175 173 177 173 174 155 115 122 114104 99 91 102 95 102 117 103 106 190 178 176 177 176 176 180 179176 176 175 177 179 179 178 180 182 180 179 180 177 181 184 179 180180 178 178 179 179 179 181 181 183 185 182 184 182 182 182 181 182183 184 183 185 182 184 186 186 184 185 182 184 183 184 184 184 186185 184 184 186 183 184 184 187 190 183 187 184 185 185 186 187 186188 187 188 187 185 191 189 185 186 188 187 187 185 185 185 188 185 …
Another very simple format : PGM
• For grey levels images
indicates the format: PGM
width and height max grey level
![Page 21: Introduction au cours Traitement d' Images en ESSI2](https://reader034.vdocuments.us/reader034/viewer/2022052313/586e0ea01a28ab687a8bc5b0/html5/thumbnails/21.jpg)
200621
Previous image in PGM format
![Page 22: Introduction au cours Traitement d' Images en ESSI2](https://reader034.vdocuments.us/reader034/viewer/2022052313/586e0ea01a28ab687a8bc5b0/html5/thumbnails/22.jpg)
200622
> more ph021-ascii.ppmP3# CREATOR: XV Version 3.10a Rev: 12/29/94 (PNG patch 1.2)640 48025589 62 79 167 143 165 130 117 145 155 155 191 160 169 210137 170 203 151 176 206 158 167 198 127 125 164 155 156 200156 169 211 155 170 211 153 170 213 153 177 215 139 172 205150 174 210 146 171 202 140 175 195 136 169 178 152 180 181144 175 177 148 183 177 140 175 142 82 113 54 45 72 19 62 79 45 82 97 64 92 108 71 46 63 18 72 92 33 64 79 0 87 109 26 129 157 82 158 184 113 54 72 0 79 107 30 71 102 43 60 88 37 60 86 21 68 88 35 44 55 21 53 67 31 51 69 27 50 68 18 81 94 38 …
Another very simple format : PPM
• For RGB color images
indicates the format: PPM
width and heighteach color component between 0 and 255
(r,g,b)
![Page 23: Introduction au cours Traitement d' Images en ESSI2](https://reader034.vdocuments.us/reader034/viewer/2022052313/586e0ea01a28ab687a8bc5b0/html5/thumbnails/23.jpg)
200623
The same image but ... in color !
![Page 24: Introduction au cours Traitement d' Images en ESSI2](https://reader034.vdocuments.us/reader034/viewer/2022052313/586e0ea01a28ab687a8bc5b0/html5/thumbnails/24.jpg)
200624
Size of files
• In our example (640x480):
PBM : 620 KB PGM : 1,2 MB PPM : 3,6 MB
![Page 25: Introduction au cours Traitement d' Images en ESSI2](https://reader034.vdocuments.us/reader034/viewer/2022052313/586e0ea01a28ab687a8bc5b0/html5/thumbnails/25.jpg)
200625
Binary formats
• The headings are still in ASCII, the data is saved in binary.
• We need to know the pixel value representation (int, char, ….).
– example of PGM : unsigned char (8 bits)
• Code in C / C++size_t fread(void *data, size_t size, size_t nobj, FILE *stream)size_t fwrite(const void *data, size_t size, size_t nobj, FILE
*stream)
![Page 26: Introduction au cours Traitement d' Images en ESSI2](https://reader034.vdocuments.us/reader034/viewer/2022052313/586e0ea01a28ab687a8bc5b0/html5/thumbnails/26.jpg)
200626
Be careful of little and big endians !
• Little endian : – light bytes will be stored to lowest addressel– ex: Intel processor
• Big endian :– heavy level bytes will be saved to the lowest adresses – ex: Motorola processor (Mac)
• Example : Byte3 Byte2 Byte1 Byte0 will be saved as :
@ + 0 : Byte3@ + 1 : Byte2@ + 2 : Byte1@ + 3 : Byte0
@ + 0 : Byte0@ + 1 : Byte1@ + 2 : Byte2@ + 3 : Byte3
Big endianLittle endian
![Page 27: Introduction au cours Traitement d' Images en ESSI2](https://reader034.vdocuments.us/reader034/viewer/2022052313/586e0ea01a28ab687a8bc5b0/html5/thumbnails/27.jpg)
200627
Endians and Images
• Two choices are possible :– format depends on the computer that wrote
the file: we need to store this information in the file heading
– format does not depend on the computer that wrote the file: little or big endian is chosed for the file format
• Examples :– Big endian : Adobe Photoshop, JPEG,
MacPaint– Little endian : BMP, GIF, QTM (QuickTime)– Both : TIFF, XWD (X Window Dump)
![Page 28: Introduction au cours Traitement d' Images en ESSI2](https://reader034.vdocuments.us/reader034/viewer/2022052313/586e0ea01a28ab687a8bc5b0/html5/thumbnails/28.jpg)
200628
Back to our example
PBM ascii : 620 KB
PBM raw : 40 KB
PGM ascii : 1,2 MB
PGM raw : 310 KB
PPM ascii : 3,6 MB
PPM raw : 900 KB
P1P1
P4P4 P5P5
P3P3P2P2
P6P6
![Page 29: Introduction au cours Traitement d' Images en ESSI2](https://reader034.vdocuments.us/reader034/viewer/2022052313/586e0ea01a28ab687a8bc5b0/html5/thumbnails/29.jpg)
200629
ASCII / binary : no confusion ! mMNM&%w mkMH$MUMFPM,NM#Z%% :!.:x )!!X)$MMWWMM$**$$Nx~~` !<!*R@@MNR$$$B$WWXXtdn."?XT!: :~` tH!~!!MBT5$$$$$$$WRHb!"! !. .<.$f <!!HR$$$$$$$$$$$X?`>!)X?~( ~-!#@\~/!!!@$$$$$$$$$$$R! ̀ <!M>-!%. .!!"X !XXM$$$$$$$$$$$R!! !X!!i"~ :̀ :!t! <: !?X***$$$$$$$***~! ??>X ` ' `!~~: ~x. !R$$$$* . x W` - > ~! ::" `L?X#$F.uC"L" . $ `n % ~<%!.#mT$"<$k"$$Q?:xW " ' ~ 4BhU@$W$?!$$ "$$WdN"'. R$$$$$$* $$k'$$$$$ !&!x Albert !T$$$$6n'$$$ $$$(T .?"Einstein @!M$$$$ec.")d$$$$! ̀ . !!8$f"` " `^T$!~ !!R$ :xxox..o:d" " #@!$WN@W$$$~" \ "~R$$$$$$" N. . "#"""" :X ̀ Wmu. '<:<!! .u$M $!$$$bou. .:!!!~!!? . :ud$$$! ~@XR$$$$$$$eu. <!!!!RnL̀ "% ~\ X~ti $̀RM$R~ : ̀ #W$$$R$$$T$$$c <!!!!XX?*> ~ .-` `% XxU@$R~ ~: . ^*$M"$$B$$$"$!:Mm m!!!!!M8X! :̀ .:L ~UT?8$F .!-.x!: "N ̀ 9$$$":"$LFDSAHDFB<FLOYDXM ~:X. "̀X:. '*$$" :?ud$RW:~<x %'$$$# $s$EYNRBx
![Page 30: Introduction au cours Traitement d' Images en ESSI2](https://reader034.vdocuments.us/reader034/viewer/2022052313/586e0ea01a28ab687a8bc5b0/html5/thumbnails/30.jpg)
200630
Compression
• Some consecutives pixels have same value : counting identical pixels:– [red, red, red ] => [(red, 3)]
• Eliminate rare colors or similar colors• Some pixel's values are rare, some others
are frequent: using less memory for frequent pixels
• Same reasoning on image transforms.
![Page 31: Introduction au cours Traitement d' Images en ESSI2](https://reader034.vdocuments.us/reader034/viewer/2022052313/586e0ea01a28ab687a8bc5b0/html5/thumbnails/31.jpg)
200631
Color Model
• Direct : pixel value corresponds to a grey level or to a (R;G;B) triplet value :
it is the pen's color
• Indirect: pixel value corresponds to a color index in a color table :
it is the pen's index
![Page 32: Introduction au cours Traitement d' Images en ESSI2](https://reader034.vdocuments.us/reader034/viewer/2022052313/586e0ea01a28ab687a8bc5b0/html5/thumbnails/32.jpg)
200632
Other image formats
• without compression : PBM, PGM, PPM, TIFF • with compression:
– lossless : • TIFF (PZW) • GIF (8 bits, propriétaire)• PNG (licence GNU www.visualtek.com/PNG)
– lossly : JPEG• vectorial drawing : PostScript, SVG • … back to our example :
– JPEG format = 88 KB
![Page 33: Introduction au cours Traitement d' Images en ESSI2](https://reader034.vdocuments.us/reader034/viewer/2022052313/586e0ea01a28ab687a8bc5b0/html5/thumbnails/33.jpg)
2006
Data structure
![Page 34: Introduction au cours Traitement d' Images en ESSI2](https://reader034.vdocuments.us/reader034/viewer/2022052313/586e0ea01a28ab687a8bc5b0/html5/thumbnails/34.jpg)
200634
Data structure
• We want a structure that enables us :
– to access to pixel values regarding the coordinates (i,j)
– to browse an image from the first to the last pixel
– to access to pixel (i,j) neighbours
![Page 35: Introduction au cours Traitement d' Images en ESSI2](https://reader034.vdocuments.us/reader034/viewer/2022052313/586e0ea01a28ab687a8bc5b0/html5/thumbnails/35.jpg)
200635
Image frame
• Usually :x
y
0 width
height
![Page 36: Introduction au cours Traitement d' Images en ESSI2](https://reader034.vdocuments.us/reader034/viewer/2022052313/586e0ea01a28ab687a8bc5b0/html5/thumbnails/36.jpg)
200636
A 2D image seen as a 1D array
• allow to have only one loop for the entire image browsing :for (int i = 0 ; i < im.getWidth()*im.getHeight(); i++)
{ …}
• not so easy to access to neighbours:
i i+1i 1
iimage.getWidth()
![Page 37: Introduction au cours Traitement d' Images en ESSI2](https://reader034.vdocuments.us/reader034/viewer/2022052313/586e0ea01a28ab687a8bc5b0/html5/thumbnails/37.jpg)
200637
A 2D image seen as a 2D array
• Allow to easily access to neighboursdata[i+1][j-1] ….
• Need two imbricated loops for the entire image browsing:for( int i = 0 ; i < image.getWidth() ; i++) {
for ( int j = 0 ; j < image.getHeight(); j++) {….
}}
![Page 38: Introduction au cours Traitement d' Images en ESSI2](https://reader034.vdocuments.us/reader034/viewer/2022052313/586e0ea01a28ab687a8bc5b0/html5/thumbnails/38.jpg)
200638
Several “tricks”
• Introducing an auxiliary counter variable :int ij = i + j*image.getWidth();
• Adding pointers to rows :
char *
char
char **img
= img[y][x]
pointer on data :char *p = &img[0][0];
p
![Page 39: Introduction au cours Traitement d' Images en ESSI2](https://reader034.vdocuments.us/reader034/viewer/2022052313/586e0ea01a28ab687a8bc5b0/html5/thumbnails/39.jpg)
200639
Example in C
typedef struct {int width;int height;unsigned char
*data;} ImageChar ;
typedef struct {int width;int height;unsigned char
**img;unsigned char
*data;} ImageChar ;
![Page 40: Introduction au cours Traitement d' Images en ESSI2](https://reader034.vdocuments.us/reader034/viewer/2022052313/586e0ea01a28ab687a8bc5b0/html5/thumbnails/40.jpg)
200640
Example in C++ : template class
template <class Type> class Image {public:
Image( const Type&);private:
Type *data;int width, height;
…}
![Page 41: Introduction au cours Traitement d' Images en ESSI2](https://reader034.vdocuments.us/reader034/viewer/2022052313/586e0ea01a28ab687a8bc5b0/html5/thumbnails/41.jpg)
200641
File reading in C++
• Problem of templates instanciation: we do not know the type of pixels before file reading.
• Solution : polymorphism !
– a mother class BaseImage with the template class as daughter
– while reading, we create a BaseImage qui est that is in fact a Image <short> i or a Image <double> i …
![Page 42: Introduction au cours Traitement d' Images en ESSI2](https://reader034.vdocuments.us/reader034/viewer/2022052313/586e0ea01a28ab687a8bc5b0/html5/thumbnails/42.jpg)
200642
In Java
public class Image {private int width;private int height;private int [] data;
public Image(int w, int h) {height = h; width = w;data = new int [h*w];
}
public int getPixel(int i, int j) { …. }public int getPixel(int ij) { …. }public int setPixel(int i, int j, int value) { …. }
….}
1 pixel = 32 bits= 4 * 8 bits
blue(8 bits)
green(8 bits)
red(8 bits)
Alpha(8 bits)
![Page 43: Introduction au cours Traitement d' Images en ESSI2](https://reader034.vdocuments.us/reader034/viewer/2022052313/586e0ea01a28ab687a8bc5b0/html5/thumbnails/43.jpg)
200643
Images in Java
• Push Model ou Producer/Consumer (jdk 1.1.*, 1.2.*) – Image– ImageProducer– ImageConsumer– ImageObserver
• Immediate Mode ou Image Buffer Model (new in Java 2D)– BufferedImage, Raster– BufferedImageOp, RasterOp
• Pull Model (JAI = Java Advanced Imaging)– RenderableImage, RenderableImageOp, ...
![Page 44: Introduction au cours Traitement d' Images en ESSI2](https://reader034.vdocuments.us/reader034/viewer/2022052313/586e0ea01a28ab687a8bc5b0/html5/thumbnails/44.jpg)
200644
BufferedImage
Buffered Image
Raster Color Model
DataBuffer Sample Model Color Space
has a
![Page 45: Introduction au cours Traitement d' Images en ESSI2](https://reader034.vdocuments.us/reader034/viewer/2022052313/586e0ea01a28ab687a8bc5b0/html5/thumbnails/45.jpg)
200645
Java 2D
• Imaging Interfaces• Image Data Class
– BufferedImage, LookupTable, DataBuffer, DataBufferByte, DataBufferInt, …, Kernel, Raster, ….
• Image Operation Classes– AffineTransformOp, BandCombineOp, BufferedImageFilter,
ColorCongreenOp, ConvolveOp, LookupOp, RescaleOp• Sample Model Classes
– BandedSampleModel, ComponentSampleModel, …• Color Model Classes
– ColorModel, ComponentColorModel, DirectColorModel, IndexColorModel, PackedColorModel
• Exception Classes– ImagingOpException, RasterFormatException
![Page 46: Introduction au cours Traitement d' Images en ESSI2](https://reader034.vdocuments.us/reader034/viewer/2022052313/586e0ea01a28ab687a8bc5b0/html5/thumbnails/46.jpg)
200646
Input - Output
• Javax.imageio.ImageIO (since j2sdk 1.4.0)– Simplification of reading and writing– Formats : gif, jpeg, png, xbm– Possibility of adding other formats
• Image file readingFile f = new File(“toto.gif”);BufferedImage bi;try { bi = ImageIO.read(f);} catch(IOException e) {...}
• Image file writingFile f = new File(“toto.jpg”);try { ImageIO.write(bi, ”jpg”, f);} catch(IOException e)
{...}
![Page 47: Introduction au cours Traitement d' Images en ESSI2](https://reader034.vdocuments.us/reader034/viewer/2022052313/586e0ea01a28ab687a8bc5b0/html5/thumbnails/47.jpg)
200647
A very famous image : LENA (http://www.lenna.org/)
![Page 48: Introduction au cours Traitement d' Images en ESSI2](https://reader034.vdocuments.us/reader034/viewer/2022052313/586e0ea01a28ab687a8bc5b0/html5/thumbnails/48.jpg)
200648
Let's talk about color
![Page 49: Introduction au cours Traitement d' Images en ESSI2](https://reader034.vdocuments.us/reader034/viewer/2022052313/586e0ea01a28ab687a8bc5b0/html5/thumbnails/49.jpg)
200649
What is color ?
• physical process
– physical interactions of electromagnetic waves with physical objects
• psycho-physiological process
– our visual system's interpretation of these penonomenons (eye + brain)
![Page 50: Introduction au cours Traitement d' Images en ESSI2](https://reader034.vdocuments.us/reader034/viewer/2022052313/586e0ea01a28ab687a8bc5b0/html5/thumbnails/50.jpg)
200650
Color perception
• in the retina: photoreceptors
– rod cells• 1 pigment
– cone cells• 3 pigments:
– red– green– blue
![Page 51: Introduction au cours Traitement d' Images en ESSI2](https://reader034.vdocuments.us/reader034/viewer/2022052313/586e0ea01a28ab687a8bc5b0/html5/thumbnails/51.jpg)
200651
Eye's sensibility
555
max of perception
= red
luminosity perceptionduring the day
green
red
blue
![Page 52: Introduction au cours Traitement d' Images en ESSI2](https://reader034.vdocuments.us/reader034/viewer/2022052313/586e0ea01a28ab687a8bc5b0/html5/thumbnails/52.jpg)
200652
Eye's performances
• The eye distinguishes:– 350000 colors, – 150 hues– 3000 colored lights
of same intensity red
Purples
blue
green
yellow
![Page 53: Introduction au cours Traitement d' Images en ESSI2](https://reader034.vdocuments.us/reader034/viewer/2022052313/586e0ea01a28ab687a8bc5b0/html5/thumbnails/53.jpg)
200653
Light spectrum
wavelength
frequency
U.V. I.R.
~ 1015 Hz
![Page 54: Introduction au cours Traitement d' Images en ESSI2](https://reader034.vdocuments.us/reader034/viewer/2022052313/586e0ea01a28ab687a8bc5b0/html5/thumbnails/54.jpg)
200654
Definitions• hue : name of the color, dominant wavelength
– non additive• saturation : degree of dilution in white• luminosity : intensity of achromatic light
– measurable and additive– unit: 1cd.m-2 = 10 nits
![Page 55: Introduction au cours Traitement d' Images en ESSI2](https://reader034.vdocuments.us/reader034/viewer/2022052313/586e0ea01a28ab687a8bc5b0/html5/thumbnails/55.jpg)
200655
Small history of color photography
• 1848 : 1st photography of the visible spectrum by Becquerel
• 1870 : black chamber de Ducos du Hauron
• 1894 : interferentiel process de Gabriel Lippman
• 1907 : autochrome process from the Lumières brothers
• 1930 : Kodachrome system
• 1932 : Color film
![Page 56: Introduction au cours Traitement d' Images en ESSI2](https://reader034.vdocuments.us/reader034/viewer/2022052313/586e0ea01a28ab687a8bc5b0/html5/thumbnails/56.jpg)
200656
Color acquisition
• 1st step :
– Filter to stop infra-red wavelenghts• Then :
– colored optical filters• filters + monochrome camera
– mono-CCD color camera• overload of filters masks
– tri-CCD color camera• prism duplicates the image in 3
![Page 57: Introduction au cours Traitement d' Images en ESSI2](https://reader034.vdocuments.us/reader034/viewer/2022052313/586e0ea01a28ab687a8bc5b0/html5/thumbnails/57.jpg)
200657
Gamma correction
• The intensity measured by cameras depends on a concave logarithm of real intensity. Colors appear less satured and chromatic coordinates are erroneous.
I = A.Dγcamera
monitor
![Page 58: Introduction au cours Traitement d' Images en ESSI2](https://reader034.vdocuments.us/reader034/viewer/2022052313/586e0ea01a28ab687a8bc5b0/html5/thumbnails/58.jpg)
2006
Examples of gamma correction
1 1.7 2
0.7 1 1.5
![Page 59: Introduction au cours Traitement d' Images en ESSI2](https://reader034.vdocuments.us/reader034/viewer/2022052313/586e0ea01a28ab687a8bc5b0/html5/thumbnails/59.jpg)
2006
Color representation
![Page 60: Introduction au cours Traitement d' Images en ESSI2](https://reader034.vdocuments.us/reader034/viewer/2022052313/586e0ea01a28ab687a8bc5b0/html5/thumbnails/60.jpg)
200660
Color representation
• Color Atlas : – Munsell, 1929
• ordered by tonality, clarity and saturation
• 10 tonalitiess, 10 levels of clarity
– NCS (Natural System of Colors)
• 3-D space representations :– based on our perception
– related to physical entities
![Page 61: Introduction au cours Traitement d' Images en ESSI2](https://reader034.vdocuments.us/reader034/viewer/2022052313/586e0ea01a28ab687a8bc5b0/html5/thumbnails/61.jpg)
200661
3D space
• primary colors (RBG)
– red (700 nm), green (546 nm), blue (435.8 nm)
– used by projection
• secondary colors (YCM)
– yellow, cyan, magenta
– used by printers
![Page 62: Introduction au cours Traitement d' Images en ESSI2](https://reader034.vdocuments.us/reader034/viewer/2022052313/586e0ea01a28ab687a8bc5b0/html5/thumbnails/62.jpg)
200662
additives colors
green
blue
redyellow = red + green
magenta =red + blue
cyan = blue + green
white = red + green + blue = magenta + yellow + cyan
![Page 63: Introduction au cours Traitement d' Images en ESSI2](https://reader034.vdocuments.us/reader034/viewer/2022052313/586e0ea01a28ab687a8bc5b0/html5/thumbnails/63.jpg)
200663
substractives colors
green = yellow cyan
cyan
yellow
blue = cyan magenta
magenta
red =magenta yellow
black= green blue red= yellow cyan magenta
![Page 64: Introduction au cours Traitement d' Images en ESSI2](https://reader034.vdocuments.us/reader034/viewer/2022052313/586e0ea01a28ab687a8bc5b0/html5/thumbnails/64.jpg)
2006
Printing
![Page 65: Introduction au cours Traitement d' Images en ESSI2](https://reader034.vdocuments.us/reader034/viewer/2022052313/586e0ea01a28ab687a8bc5b0/html5/thumbnails/65.jpg)
200665
Addition - substraction
• color C = rR + gG + bB
• Coordinates or chromaticity values :r = r / (r + g + b)g = g / (r + g + b)b = b / (r + g + b)
![Page 66: Introduction au cours Traitement d' Images en ESSI2](https://reader034.vdocuments.us/reader034/viewer/2022052313/586e0ea01a28ab687a8bc5b0/html5/thumbnails/66.jpg)
200666
RGB color model
wavelength
![Page 67: Introduction au cours Traitement d' Images en ESSI2](https://reader034.vdocuments.us/reader034/viewer/2022052313/586e0ea01a28ab687a8bc5b0/html5/thumbnails/67.jpg)
200667
metamerism: different spectrum, same color
wavelength
luminosity
-> color blindness
![Page 68: Introduction au cours Traitement d' Images en ESSI2](https://reader034.vdocuments.us/reader034/viewer/2022052313/586e0ea01a28ab687a8bc5b0/html5/thumbnails/68.jpg)
200668
Chromaticity diagram CIE (1935)
• Primary colors :– Theoretical colors : X,
Y et Z– Y luminance– Equal proportions
gives white
• No more negative values
• CIEXYZ model
![Page 69: Introduction au cours Traitement d' Images en ESSI2](https://reader034.vdocuments.us/reader034/viewer/2022052313/586e0ea01a28ab687a8bc5b0/html5/thumbnails/69.jpg)
200669
CIE XYZ
X = 0.489989 R + 0.310008 G + 0.2 B
Y = 0.26533R + 0.81249 G + 0.01 B
Z = 0.0 R + 0.01 G + 0.99 B
R = 2.3647 X - 0.89658 Y – 0.468083 Z
G = -0.515155 X + 1.426409 Y – 0.088746 Z
B = -0.005203 X - 0.014407 Y + 1.0092 Z
![Page 70: Introduction au cours Traitement d' Images en ESSI2](https://reader034.vdocuments.us/reader034/viewer/2022052313/586e0ea01a28ab687a8bc5b0/html5/thumbnails/70.jpg)
200670
Chromaticity diagram
![Page 71: Introduction au cours Traitement d' Images en ESSI2](https://reader034.vdocuments.us/reader034/viewer/2022052313/586e0ea01a28ab687a8bc5b0/html5/thumbnails/71.jpg)
200671
colors
![Page 72: Introduction au cours Traitement d' Images en ESSI2](https://reader034.vdocuments.us/reader034/viewer/2022052313/586e0ea01a28ab687a8bc5b0/html5/thumbnails/72.jpg)
200672
colors (2)
Film
Colourmonitor(sRGB)
Printing inks
![Page 73: Introduction au cours Traitement d' Images en ESSI2](https://reader034.vdocuments.us/reader034/viewer/2022052313/586e0ea01a28ab687a8bc5b0/html5/thumbnails/73.jpg)
200673
Smith's HSV Pyramid
Hue, Saturation, Value
Green Yellow
Hue
Black
White
Red
![Page 74: Introduction au cours Traitement d' Images en ESSI2](https://reader034.vdocuments.us/reader034/viewer/2022052313/586e0ea01a28ab687a8bc5b0/html5/thumbnails/74.jpg)
200674
Other models
Luminance : Y = 0.299 R + 0.587 G + 0.114 B
• Betacam (Y pb pr )pb = 0.5 (B – Y) / (1 – 0.114) pr = 0.5 (R – Y)/ (1 –
0.299)
• Digital Video System (Y Cb Cr )Cb = 128 + 112 pb Cr = 128 + 112 pr
• YUVU = 0.493 ( B – Y ) V = 0.877 ( R – Y)
• NTSC YIQI = 0.6 R – 0.28 G – 0.32 B Q = 0.21 R – 0.52 G +
0.31 B
![Page 75: Introduction au cours Traitement d' Images en ESSI2](https://reader034.vdocuments.us/reader034/viewer/2022052313/586e0ea01a28ab687a8bc5b0/html5/thumbnails/75.jpg)
200675
sRGB format
• in order to normalize the representation of \ RGB / YCMK for all printers, monitors, ...
• RGB + gamma de 2.2
• exists in Java2D sRGB monitor
without transformation !
![Page 76: Introduction au cours Traitement d' Images en ESSI2](https://reader034.vdocuments.us/reader034/viewer/2022052313/586e0ea01a28ab687a8bc5b0/html5/thumbnails/76.jpg)
2006
![Page 77: Introduction au cours Traitement d' Images en ESSI2](https://reader034.vdocuments.us/reader034/viewer/2022052313/586e0ea01a28ab687a8bc5b0/html5/thumbnails/77.jpg)
2006
Illusions in color perception
the Hermann Grid Illusion
![Page 78: Introduction au cours Traitement d' Images en ESSI2](https://reader034.vdocuments.us/reader034/viewer/2022052313/586e0ea01a28ab687a8bc5b0/html5/thumbnails/78.jpg)
200678
Cells « on-center »
+
+
+
+
![Page 79: Introduction au cours Traitement d' Images en ESSI2](https://reader034.vdocuments.us/reader034/viewer/2022052313/586e0ea01a28ab687a8bc5b0/html5/thumbnails/79.jpg)
200679
Hermann Grid Illusion
• Near the fovea • Peripheric area
![Page 80: Introduction au cours Traitement d' Images en ESSI2](https://reader034.vdocuments.us/reader034/viewer/2022052313/586e0ea01a28ab687a8bc5b0/html5/thumbnails/80.jpg)
200680
Mach Bandes
w/3 2w/3 w0
255
(0,0,0)
(0,255,0)…
perception
signal
![Page 81: Introduction au cours Traitement d' Images en ESSI2](https://reader034.vdocuments.us/reader034/viewer/2022052313/586e0ea01a28ab687a8bc5b0/html5/thumbnails/81.jpg)
200681
Illusions (suite)
![Page 82: Introduction au cours Traitement d' Images en ESSI2](https://reader034.vdocuments.us/reader034/viewer/2022052313/586e0ea01a28ab687a8bc5b0/html5/thumbnails/82.jpg)
200682
Illusions (suite)
![Page 83: Introduction au cours Traitement d' Images en ESSI2](https://reader034.vdocuments.us/reader034/viewer/2022052313/586e0ea01a28ab687a8bc5b0/html5/thumbnails/83.jpg)
2006
Bibliography
•“Digital Image Processing" par W. K. Pratt, John Wiley & Sons, inc., Third Edition, 2001•"Digital Image Processing" par Gonzalez et Woods, Prentice Hall, Second Edition, 2002•http://www.dai.ed.ac.uk/HIPR2/•Books available on the webhttp://homepages.inf.ed.ac.uk/rbf/CVonline/books.htm•Computer Vision Onlinehttp://www.dai.ed.ac.uk/CVonline/transf.htm•Vetterli's talks (wavelets, ..) http://lcavwww.epfl.ch/~vetterli/talks/index.html
![Page 84: Introduction au cours Traitement d' Images en ESSI2](https://reader034.vdocuments.us/reader034/viewer/2022052313/586e0ea01a28ab687a8bc5b0/html5/thumbnails/84.jpg)
200684
Illusions (suite)Color persistence