Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …
Transcript of Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …
![Page 1: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/1.jpg)
Imagem Digital
Captura, Processamento, Interpretação, Criação,
Reprodução, …
![Page 2: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/2.jpg)
FORMAÇÃO DE UMA IMAGEM NUMA CÂMERA DIGITAL
Captura da radiância de uma cena num plano
![Page 3: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/3.jpg)
Câmera obscura e Câmera “pin-hole”
Plymouth, UK
![Page 4: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/4.jpg)
Câmera Obscura -- efeito natural
Bellinzona no canton TicinoSwitzerland.
![Page 5: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/5.jpg)
Primeiras câmaras fotográficas
Luis-Jacques-Mandé Daguerre (1787-1851)1839
![Page 6: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/6.jpg)
Câmeras digitais
![Page 7: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/7.jpg)
Captura da cor
![Page 8: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/8.jpg)
Sensores
![Page 9: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/9.jpg)
MONITORESEmissão da radiância num plano
![Page 10: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/10.jpg)
Primeira imagem colorida (início do sec. XX)
James Clerk Maxwell (1831-1879)
Scottish physicist.
![Page 11: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/11.jpg)
RBG Images
![Page 12: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/12.jpg)
Multi-fontes pontuais
Nexus_one_screen_microscope.jpg(wiki)
OLED
![Page 13: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/13.jpg)
Impressão
![Page 14: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/14.jpg)
Imagem: Modelo Matemático: Função
u
v
L
L(u,v)
Função
0%
20%
40%
60%
80%
100%
Nív
eis
de c
inza
Posição ao longo da linhax
C 2,0,0: hwL
Lv
u
![Page 15: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/15.jpg)
Imagem colorida
R
G
Bu
v
![Page 16: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/16.jpg)
Imagem coloridas como 3 canais de cor
= ++
u
v
R
R(u,v)
u
v
GG(u,v)
u
v
BB(u,v)
![Page 17: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/17.jpg)
Imagem Digital
Amostragem, quantização e codificação
![Page 18: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/18.jpg)
Digitalização de Imagens
Discretização espacial (amostragem)
![Page 19: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/19.jpg)
Processos básicos
Imagem de tons contínuos
64x54
Imagem amostrada
amostragem
64x54 - 16 cores
Imagem amostrada equantizada
quantização
55 55 55 55 55 55 55
55 20 22 23 45 55 55
55 55 10 09 11 55 55
55 55 43 42 70 55 55
55 55 28 76 22 55 55
55 55 55 55 55 55 55
codificação8*55, 1*20, 1*22, 1*23, ….
Imagem amostrada, quantizada e codificada
![Page 20: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/20.jpg)
Áudio (Sinal 1D)
![Page 21: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/21.jpg)
Amostragem, quantização e codificação de f(x)
x
f(x)
amostra
partição do eixo x
![Page 22: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/22.jpg)
codificação = (3, 4, 5, 5, 4, 2, 2, 3, 5, 5, 4, 2)
Amostragem, quantização e codificação de f(x)
0
1
2
3
4
5
6
x
f(x)
amostraquantizada
![Page 23: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/23.jpg)
(a) aumento de resolução
Problemas associados a re-amostragem de um sinal digital f(x)
x
f(x)
função reconstruídapelo vizinho mais próximo
função reconstruídapor interpolação linear
0
1
2
3
4
5
6 função original
![Page 24: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/24.jpg)
Re-amostragem de f(x)
x
f(x)
função reconstruídapelo vizinho mais próximo
função reconstruídapor interpolação linear
função original
(b) redução de resolução
0
1
2
3
4
5
6
![Page 25: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/25.jpg)
Parte 2 - Eliminação de ruídos e realce de arestas
Aplicações da Transformada de Fourier
Imagem DigitalConceitos, Processamento e Análise
![Page 26: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/26.jpg)
Redução de ruídos
• Dada uma imagem I com um ruído n, reduza n o máximo que puder (preferencialmente elimine n completamente) sem alterar significativamente I.
),(),(),(ˆ jinjiIjiI
n
sSNR
n
sdBSNR
10log10
100n
s
20 dB significam
![Page 27: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/27.jpg)
Dois tipos básicos de ruídos
• Ruído Gaussiano branco : processo estocástico de média zero, independente do tempo e dos espaço.
2
2
2
2
1)(
x
exG
0),( jin
),(~),( 00 jjiinjin é o mesmo processo estocástico que não varia no tempo.
),( jin é uma variável aleatória com a distribuição:
![Page 28: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/28.jpg)
Dois tipos básicos de ruídos
• Ruído impulsivo: causado por erro de transmissão, CCDs defeituosos, etc... Também chamado de pico e de sal e pimenta.
lxiiyi
lxjinsp )(
0),(
minmaxmin
1,0, yx são v.a. uniformemente distribuídas
imin, imax, e l são parâmetos de controle da quantidade de ruídos.
![Page 29: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/29.jpg)
Exemplo de ruído Gaussiano (=5) e Impulsivo ( =0.99)
![Page 30: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/30.jpg)
![Page 31: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/31.jpg)
Imagem com ruído impulsivo
223 204 204 204 204 204 204 204 204 204 204 204 204 223
171 120 120 120 18 120 50 120 120 120 120 120 120 171
171 120 120 120 116 120 120 120 120 120 120 120 120 171
138 120 120 120 120 120 50 120 97 120 120 120 120 171
171 120 120 120 120 120 120 120 120 120 187 120 120 242
172 120 120 120 120 120 120 120 120 120 120 120 120 171
171 120 120 120 120 120 179 120 120 120 120 167 120 171
171 120 120 120 120 120 120 235 120 120 120 120 120 171
171 120 120 120 120 120 120 235 120 76 175 120 120 171
171 120 120 120 120 120 120 120 120 120 120 120 120 171
171 120 120 120 120 120 120 120 123 120 120 214 120 114
171 120 120 120 120 120 120 120 120 120 120 120 143 171
171 120 120 120 232 120 120 198 120 120 120 120 120 171
203 171 171 171 171 171 171 171 171 205 171 171 171 203
Uso da mediana
Iij = mediana Ωij
![Page 32: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/32.jpg)
Sinal com ruído
:= ( )f3 x 10 ( )cos 2 x 6 ( )sin 10 x .8 ( )cos 40 x
-20
-15
-10
-5
0
5
10
15
20
![Page 33: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/33.jpg)
Suavização
f
h
4
2 11 iii
i
fffh
![Page 34: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/34.jpg)
Filtragem Gaussiana
-20
-15
-10
-5
0
5
10
15
20
w1+w2+w3 filtro w1+w2
![Page 35: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/35.jpg)
Imagem Digital: Histogramas
Uma outra maneira de ver a informação da imagem: probabilidade deocorrência de um determinado valor, uso do intervalo [0,255], contraste,...
![Page 36: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/36.jpg)
Histogramas de Imagem Colorida
![Page 37: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/37.jpg)
Propriedades básicas de uma Imagem Digital
![Page 38: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/38.jpg)
Convolução
t
t
dtxfxtgxh )()()(
1
0)(
n
kiiki fgh
duuxgufgfxh )()()(
![Page 39: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/39.jpg)
Convolution
• Pictorially
f(x)
h(x)
![Page 40: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/40.jpg)
Convolution
f(t)
x
h(t-x)
![Page 41: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/41.jpg)
Convolution
• Consider the function (box filter):
21
21
21
21
0
1
0
)(
x
x
x
xh
![Page 42: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/42.jpg)
Convolution
• This function windows our function f(x).
f(t)
![Page 43: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/43.jpg)
Convolution
• This function windows our function f(x).
f(t)
![Page 44: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/44.jpg)
Convolution
• This function windows our function f(x).
f(t)
![Page 45: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/45.jpg)
Convolution
• This function windows our function f(x).
f(t)
![Page 46: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/46.jpg)
Convolution
• This function windows our function f(x).
f(t)
![Page 47: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/47.jpg)
Convolution
• This function windows our function f(x).
f(t)
![Page 48: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/48.jpg)
Convolution
• This function windows our function f(x).
f(t)
![Page 49: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/49.jpg)
Convolution
• This function windows our function f(x).
f(t)
![Page 50: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/50.jpg)
Convolution
• This function windows our function f(x).
f(t)
![Page 51: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/51.jpg)
Convolution
• This function windows our function f(x).
f(t)
![Page 52: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/52.jpg)
Convolution
• This function windows our function f(x).
f(t)
![Page 53: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/53.jpg)
Convolution
• This function windows our function f(x).
f(t)
![Page 54: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/54.jpg)
Convolution
• This function windows our function f(x).
f(t)
![Page 55: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/55.jpg)
Convolution
• This function windows our function f(x).
f(t)
![Page 56: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/56.jpg)
Convolution
• This function windows our function f(x).
f(t)
![Page 57: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/57.jpg)
Convolution
• This function windows our function f(x).
f(t)
![Page 58: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/58.jpg)
Convolution
• This function windows our function f(x).
f(t)
![Page 59: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/59.jpg)
Convolution
• This function windows our function f(x).
f(t)
![Page 60: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/60.jpg)
Convolution
• This function windows our function f(x).
f(t)
![Page 61: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/61.jpg)
Convolution
• This function windows our function f(x).
f(t)
![Page 62: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/62.jpg)
Convolution
• This function windows our function f(x).
f(t)
![Page 63: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/63.jpg)
Convolution
• This function windows our function f(x).
f(t)
![Page 64: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/64.jpg)
Convolution
• This particular convolution smooths out some of the high frequencies in f(x).
f(x)g(x) f(t)
![Page 65: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/65.jpg)
Ilustação da convolução
t
t
dtxfxtgxh )()()(
![Page 66: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/66.jpg)
Ilustração da convolução
t
t
dtxfxtgxh )()()(
![Page 67: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/67.jpg)
ALIASO problema de amostragem
![Page 68: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/68.jpg)
Freqüência de Amostragem
x
f(x)
x
f(x)
x
f(x)
![Page 69: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/69.jpg)
Sinal sub-amostrado
![Page 70: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/70.jpg)
Estudo de sinais digitais
Transformadas para o domínio da freqüencia
Teorema de Nyquist e Alias
![Page 71: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/71.jpg)
Harmônicos
t+
)cos( tA
-8
-6
-4
-2
0
2
4
6
8
0 0.01 0.02 0.03 0.04 0.05A-A
T
)(1
HzT
f
revisão
)(2
2 radtT
ftt
A
![Page 72: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/72.jpg)
Integrais de senos e cosenos em [-,]
cos(nx) sin(nx)
n = 1
n = 2
sin(nx)cos(nx)
revisão
Áreas se compensam.Integrais resultam em 0.
![Page 73: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/73.jpg)
Integrais de senos e cosenos em [-,]
Funções ortogonais
revisão
![Page 74: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/74.jpg)
Série de Fourier
)2
sin2
cos(2)(1
0 T
ktb
T
ktaatf k
kk
t
f(t)
0T
Jean Baptiste Joseph Fourier (1768-1830) Paper de 1807 para o Institut de France: Joseph Louis Lagrange (1736-1813), and Pierre Simon de Laplace (1749-1827).
![Page 75: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/75.jpg)
Exemplo: Série de harmônicos
-0.25
-0.05
0.15
0.35
0.55
0.75
0.95
1.15
-0.25
-0.05
0.15
0.35
0.55
0.75
0.95
1.15
-0.25
-0.05
0.15
0.35
0.55
0.75
0.95
1.15
![Page 76: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/76.jpg)
Série de Fourier: cálculo de a0
T
k
T
k
T
k
T
o dtT
ktbdt
T
nktadtadttf
01
000)
2sin()
2cos()(
00)(0 0 T
Tadttf
T
dttfT
a00 )(
1
)2
sin2
cos(2)(1
0 T
ktb
T
tkaatf k
kk
t
f(t)
0 T
![Page 77: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/77.jpg)
Série de Fourier: an e bn
T
dttfT
tn0
)()2
cos(
T
n dtT
tntf
Ta
0)
2cos()(
1
T
n dtT
tntf
Tb
0)
2sin()(
1 ...
)2
sin2
cos(2)(1
0 T
ktb
T
tkaatf k
kk
t
f(t)
0 T
0)2
cos()2
cos(200
1
T
kn dt
T
tk
T
tna
nTa
![Page 78: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/78.jpg)
Resumindo
)2
sin2
cos(2)(1
0 T
ktb
T
ktaatf k
kk
T
k kdtT
kttf
Ta
0,...3,2,1,0)
2cos()(
1
T
k kdtT
kttf
Tb
0,...3,2,1)
2sin()(
1
t
f(t)
0 T
T
kk
2
T
2
![Page 79: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/79.jpg)
Domínios
t
f(t)
0 T
T
2
w
ak
0
w
bk
0
tempo ou espaço
freqüencia
![Page 80: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/80.jpg)
Coeficientes de funções pares e ímpares
-1
-0.8
-0.6
-0.4
-0.2
0
0.2
0.4
0.6
0.8
1
0 0.2 0.4 0.6 0.8 1
cos cos sin sin
f-ímpar ak= 0
f-par bk= 0
![Page 81: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/81.jpg)
Periodicidade da Série de Fourier
)()(2
sin)(2
cos2)(1
0 tfTtT
kbTt
T
kaaTtf
kkk
t
f(t)
0 T
t
f(t)
0 T
![Page 82: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/82.jpg)
Números complexos
• x é a parte real• y é a parte imaginária• A é a magnitude• q é a fase
q
A
x
eixo real
eixo imagnário
y
)sin(cos iAiyxz
1i
revisão
![Page 83: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/83.jpg)
Operação básicas com complexos
)()( 2211 iyxiyx
))(( 2211 iyxiyx
))(( iyxiyx
22
11
iyx
iyx
iayax)()( 2121 yyixx )( iyxa
)()( 21122121 yxyxiyyxx )()( 2112212
21 yxyxiyyixx 12 i
2222 )()( yxxyxyiyx
2222
2211
iyxiyx
iyxiyx
221122
22
1iyxiyx
yx
sincos iei
revisão
![Page 84: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/84.jpg)
Derivada de eit
titi eiedt
d
tittitdt
d cossinsincos
)cossin1
( tti
i
i
1
)cossin( ttii
C.Q.D.
2i
ii
i
1
revisão
![Page 85: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/85.jpg)
Outras propriedades úteis
sincos iei
1ie
iei2
i
-1 1
revisão
![Page 86: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/86.jpg)
Outras propriedades úteis (2)
sincos iei sincos ie i
)(cos 21 ii ee
revisão
)(cos 21 titi eet
t
t
1-1
i
-i
o cosseno corresponde a média de dois harmônicos de freqüênciasw e -w
![Page 87: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/87.jpg)
Outras propriedades úteis (2)
sincos iei sincos ie i
)()(sin 221 iiiiii eeee
revisão
i
12i
ii
i
1
tt
1-1
i
-i
o seno também corresponde a dois harmônicos:w e -w
![Page 88: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/88.jpg)
Outras propriedades úteis (3)
)sin(cos 111111 iAeAz i
)sin(cos 222222 iAeAz i
)(2121
21 ieAAzz
)(
2
1
2
1 21 ieA
A
z
z
revisão
![Page 89: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/89.jpg)
Amplitude e fase de complexos
sinA
A-A
Dado um valor:
iyxiAz )sin(cos
zzyxA 222
x
ytan
Amplitude
Fase
cosA
revisão
![Page 90: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/90.jpg)
Série de Fourier com números complexos
10
2sin
2cos2)(
knk T
ktb
T
ktaatf
2cos
ii ee
i
ee ii
2sin
1
22
0)(k
T
kti
kT
kti
k eFeFFtf
nnkkkk ibaFibaFaF ,,00
k
T
kti
keFtf2
)(
kk FF
1
2222
0)(k
T
kti
T
kti
kT
kti
T
kti
k eei
beeaatf
1
22
0)(k
T
kti
kk
T
kti
kk e
i
bae
i
baatf
T
T
kti
k kdtetfT
F0
)2
(,...3,2,1)(
1
i
12i
ii
i
1
![Page 91: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/91.jpg)
Escrevendo em complexos
k
T
kti
kkk
k eFT
ktb
T
ktaatf
2
10 )
2sin
2cos(2)(
T T
kk kdtT
kttf
Tbdt
T
kttf
Ta
0 0,...3,2,1,0)
2sin()(
1,)
2cos()(
1
T
T
kti
k kdtetfT
F0
)2
(,...3,2,1,0)(
1
kkk ibaF
)2
sin()2
cos()
2(
T
kti
T
kte T
kti
![Page 92: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/92.jpg)
Serie de Fourier de Sinais Discretos
![Page 93: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/93.jpg)
Sinal discreto
t0 1 2 3 4 5 6 N-1
rf
r
)(tf
tNT
ttrt
,,,,,,,, 1221 NNro ffffff
![Page 94: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/94.jpg)
T
k dtT
kttf
Ta
0)
2cos()(
1
01 2 3 4 5 N
)2
cos()(T
kttf
tt
trtr
ttN
tkrf
tN
N
rk
1
0
2cos
1
TtNT
1
0
)2
cos(1 N
rrk N
rkf
Na
1
0
2sin
1 N
rkk N
rkf
Nb
. . .
![Page 95: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/95.jpg)
1
0
)2
cos(1 N
rrk N
rkf
Na
1
0
2sin
1 N
rkk N
rkf
Nb
1
1
0
)1)(1(1)1(0)1(
)1(11110
)1(00100
1
1
0
1
NNNNN
N
N
N f
f
f
ccc
ccc
ccc
N
a
a
a
)2
cos(N
krckr
onde:
1
1
0
)1)(1(1)1(0)1(
)1(11110
)1(00100
1
1
0
1
NNNNN
N
N
N f
f
f
sss
sss
sss
N
b
b
b
)2
sin(N
krskr
onde:
![Page 96: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/96.jpg)
1
0
)2
(1 N
s
N
ksi
skkk efN
ibaF
1
1
0
)1)(1(1)1(0)1(
)1(11110
)1(00100
1
1
0
1
NNNNN
N
N
N f
f
f
EEE
EEE
EEE
N
F
F
F
N
kri
kr eE2
onde:
1
0
)2
(N
r
N
kri
rk eFf
1
1
0
)1)(1(1)1(0)1(
)1(11110
)1(00100
1
1
0
'''
'''
'''
NNNNN
N
N
N F
F
F
EEE
EEE
EEE
f
f
f
N
kri
kr eE2
'
onde:
![Page 97: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/97.jpg)
Transformada Discreta
)102sin()( ttf
256N
sec005.01
aft
sec28.1256005.0 T
T - não é o período do sinal!
Hzfa 200
-1.5
-1
-0.5
0
0.5
1
1.5
0 0.2 0.4 0.6 0.8 1 1.2 1.4
af
NtNT
-1.5
-1
-0.5
0
0.5
1
1.5
0 0.2 0.4 0.6 0.8 1 1.2 1.4
)102sin(N
sTf s
![Page 98: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/98.jpg)
Transformada Discreta de Fourier
1
0
)2
(1 N
s
N
ksi
sk efN
F
/sec0.78131
Tf
/sec91.42
radT
-1.5
-1
-0.5
0
0.5
1
1.5
0 0.2 0.4 0.6 0.8 1 1.2 1.4
ampl
10.15625, 0.46776
0
0.1
0.2
0.3
0.4
0.5
0 20 40 60 80 100
)102sin(N
sTf s
1k
todas as feqüências computadas são multiplas destas
![Page 99: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/99.jpg)
Outro exemplo
-20
-15
-10
-5
0
5
10
15
20
:= ( )f3 t + +10 ( )cos 2 p t 6 ( )sin 10 p t .8 ( )cos 40 p t
![Page 100: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/100.jpg)
Transformada fk
-20
-15
-10
-5
0
5
10
15
20
0 0.2 0.4 0.6 0.8 1 1.2 1.4
ampl
0.78
, 4.5
24.
69, 2
.41
20.3
1, 0
.35
0
1
2
3
4
5
0 20 40 60 80 100 120
1
0
)2
(1 N
s
N
ski
sk efN
F
1
0
)2
(N
r
N
rki
rk eFf
![Page 101: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/101.jpg)
Eixo de freqüência
![Page 102: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/102.jpg)
Discrete Cosine Transformation (DCT)
02
01)(
k
kk
1
0 2
)12(cos
)( N
ssk N
ksf
N
kC
1
0 2
)12(cos
)(N
krs N
ksC
N
kf
![Page 103: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/103.jpg)
-1
-0.8
-0.6
-0.4
-0.2
0
0.2
0.4
0.6
0.8
1
1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31
N
ks
2
)12(cos
)()cos( 2 sen o cosseno pode substituir o seno
![Page 104: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/104.jpg)
Resumindo
)2
sin2
cos(2)(1
0 T
ktb
T
ktaatf k
kk
T
k kdtT
kttf
Ta
0,...3,2,1,0)
2cos()(
1
T
k kdtT
kttf
Tb
0,...3,2,1)
2sin()(
1
t
f(t)
0 T
T
kk
2
T
2
![Page 105: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/105.jpg)
T
k dtT
kttf
Ta
0)
2cos()(
1
01 2 3 4 5 N
)2
cos()(T
kttf
tt
trtr
ttN
tkrf
tN
N
rk
1
0
2cos
1
TtNT
1
0
)2
cos(1 N
rrk N
rkf
Na
1
0
2sin
1 N
rkk N
rkf
Nb
. . .
![Page 106: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/106.jpg)
Aula 2
![Page 107: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/107.jpg)
Serie de Fourier de Sinais Discretos
![Page 108: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/108.jpg)
Sinal discreto
t0 1 2 3 4 5 6 N-1
rf
r
)(tf
tNT
ttrt
,,,,,,,, 1221 NNro ffffff
![Page 109: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/109.jpg)
1
0
)2
(1 N
s
N
ksi
skkk efN
ibaF
1
1
0
)1)(1(1)1(0)1(
)1(11110
)1(00100
1
1
0
1
NNNNN
N
N
N f
f
f
EEE
EEE
EEE
N
F
F
F
N
kri
kr eE2
onde:
1
0
)2
(N
r
N
kri
rk eFf
1
1
0
)1)(1(1)1(0)1(
)1(11110
)1(00100
1
1
0
'''
'''
'''
NNNNN
N
N
N F
F
F
EEE
EEE
EEE
f
f
f
N
kri
kr eE2
'
onde:
![Page 110: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/110.jpg)
Transformada fk
-20
-15
-10
-5
0
5
10
15
20
0 0.2 0.4 0.6 0.8 1 1.2 1.4
ampl
0.78
, 4.5
24.
69, 2
.41
20.3
1, 0
.35
0
1
2
3
4
5
0 20 40 60 80 100 120
1
0
)2
(1 N
s
N
ski
sk efN
F
1
0
)2
(N
r
N
rki
rk eFf
![Page 111: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/111.jpg)
Transformada de Fourier
dwewFxf wxi 2)()(
dxexfwF wxi 2)()(
![Page 112: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/112.jpg)
Exemplo 1: Função caixa (box)box(x)
x
]2,
20
2[
20
)()( b
bxse
bxsea
bxse
xboxxf
a
dxexboxwF wxi 2)()(
2/
2/2
2
b
bwxie
wi
a
2/
2/
2b
b
wxi dxea
wbiwbi eewi
a
2
i
ee
w
a wbiwbi
2
)sin( wb
w
a
b
wb
wbabwF
)sin(
)(
![Page 113: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/113.jpg)
Transformada da função box
bw
bwabwF
)sin(
)(
F(w)
0 1/b 2/b 3/b-1/b-2/b-3/b
ab
w
sinc(bw)
wb
wbabwF
)sin(
)( box(x)
x
a
b
![Page 114: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/114.jpg)
Distribuição normal: Gaussiana
2
2
22
1)(
x
exGauss
:= ( )gaus x e( ) x
2
![Page 115: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/115.jpg)
Exemplo 2: Gaussiana
-0.02
0.03
0.08
0.13
0.18
-0.02
0.03
0.08
0.13
0.18
2
2
2
2
1)(
x
exf
2
2
12)(
w
ewF
f(x)
x
|| F(w) ||
w
1
![Page 116: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/116.jpg)
Transformada da Gaussiana
dxeewF wxix
22 2
2
2
1)(
dxwxiwxex
)2sin()2cos(2
1 2
2
2
dxwxex
)2cos(
2
2
22
1
222 we
2
1,
2
12
2
2
2
w
e
![Page 117: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/117.jpg)
Exemplo 3: Delta de Dirac f(x)
xb/2-b/2
1/b ]2,
20
2[/1
20
lim)(0
b
bxse
bxseb
bxse
xb
2
,2
),(2/2/
lim)(1
lim)()(0
2/
2/0
bbf
b
bbdxxf
bdxxxf
b
b
bb
)0()()( fdxxxf
![Page 118: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/118.jpg)
Delta de Dirac de Gaussianas
22
31
9
x
e
22
21
4
x
e
22
11
1
x
e
2
2
20
1lim)(
x
ex
![Page 119: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/119.jpg)
Transformada do Delta de Dirac
f(x)
x
1)()( 02
edxexwF wxi (x)
|| F(w) ||
w
1
![Page 120: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/120.jpg)
Transformada do cosseno
dxexwwF wxi 2cos()(
dxwxiwxxw )2sin()2cos()cos(
2
20
)2cos()cos(w
wse
wwse
dxwxxw
-1.5
-1
-0.5
0
0.5
1
1.5)cos( tw
x
![Page 121: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/121.jpg)
Exemplo 4: Cosseno
)
2()
2(
2
1)(
w
ww
wwF
|| F(w) ||
ww w
)( ww )( ww
-1.5
-1
-0.5
0
0.5
1
1.5)cos( tw
x
![Page 122: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/122.jpg)
Exemplo 5: Sequência de impulsos
w
f(x)
xb 2b3b-b-2b
|| F(w) ||
1/b 2/b2/b-1/b-2/b
f(x)
x1b 2b 3b-b-2b
|| F(w) ||
w1/b 2/b2/b-1/b-2/b
k
kTtt )()( 0 k T
ktw )2
()(0
![Page 123: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/123.jpg)
Pares importantes
![Page 124: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/124.jpg)
Propriedades da transformada
convolução
![Page 125: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/125.jpg)
Filtragem com Transformada de Fourier
)(xf
)(wF
FT
)(xh
)(wH
FT
)(xf )(xh
X )(wF X )(wH
FT
FT
-1
![Page 126: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/126.jpg)
Amostragem e Reconstrução
Observando os domínio do espaço e das freqüências
![Page 127: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/127.jpg)
Sinal original
domínio do espaço domínio das freqüências
![Page 128: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/128.jpg)
Sinal discretizado
dtkTttffk
k )()( 0
![Page 129: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/129.jpg)
Amostragemdomínio do espaço domínio das freqüências
produto convolução
![Page 130: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/130.jpg)
Sinal discretizado
domínio do espaço domínio das freqüências
![Page 131: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/131.jpg)
Reconstruçãodomínio do espaço domínio das freqüências
convolução produto
![Page 132: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/132.jpg)
Retorno ao sinal original
domínio do espaço domínio das freqüências
![Page 133: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/133.jpg)
Sinal original com mais altas freqüências
domínio do espaço domínio das freqüências
![Page 134: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/134.jpg)
Mesma taxa de amostragemdomínio do espaço domínio das freqüências
produto convolução
![Page 135: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/135.jpg)
Sinal amostrado
domínio do espaço domínio das freqüências
Não temos como reconstruir sem introduzir artefatos!
![Page 136: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/136.jpg)
Teorema de Nyquist
Para que um sinal de banda limitada (i.e. aqueles cuja a transformada resultam em zero para freqüências f > B) seja reconstruido plenamente ele precisa ser amostrado numa freqüência f >= 2B. Um sinal amostrado na freqüência (f=2B) é dito amostrado por Nyquist e f=2B é a freqüência de Nyquist.
Não há perda de informação nos sinais amostrados na freqüência de Nyquist, e não adicionamos nenhuma informação se amostrarmos numa freqüência maior.
![Page 137: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/137.jpg)
Aliasing
• Esta mistura de espectros é chamada de aliasing.
• Existem duas maneiras de lidarmos com aliasing.
– Passar um filtro passa-baixa no sinal.
– Aumentar a freqüência de amostragem.
![Page 138: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/138.jpg)
Alias
Texture errors
![Page 139: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/139.jpg)
Parte 2 - Eliminação de ruídos e realce de arestas
Aplicações da Transformada de Fourier
Imagem DigitalConceitos, Processamento e Análise
![Page 140: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/140.jpg)
Filtragem Gaussiana
-20
-15
-10
-5
0
5
10
15
20
w1+w2+w3 filtro w1+w2
4
2 11 iii
i
fffh
![Page 141: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/141.jpg)
Filtro
• Um filtro é um operador que atenua ou realça uma determinada freqüência
• Fácil de visualizar no domínio da freqüência onde:
)()()( GFH
)()( tfF
)()( Hth h(t) é o f(t) filtrado
![Page 142: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/142.jpg)
Tipos de Filtros
F G
=
=
=
H
Passa baixa
Passa alta
Passa banda
)()()( GFH
![Page 143: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/143.jpg)
Imagem filtrada com um filtro passa baixa
![Page 144: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/144.jpg)
Imagem filtrada com um filtro passa alta
![Page 145: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/145.jpg)
Filtragem no domínio espacial
• Filtragem no domínio espacial é obtida pela convolution (e vice-versa).
)()()( GFH
)()( xfF
)()( Hxh
)()( xgG
duuxgufgfxh )()()(
ou:
Na realidade é ao contrário: a TF é uma ferramenta para filtragem.
![Page 146: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/146.jpg)
Mascara ou Filtro
4
2 11 iii
i
fffh
1
0)(
n
kiiki fgh
10
14/1
04/2
14/1
10
lse
lse
lse
lse
lse
gl
ou:
![Page 147: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/147.jpg)
Discretização da Gaussiana 1D
0.1
0.2
0.3
-4 -3 -2 -1 0 1 2 3 4
2
2
2
2
1)(
x
exG
1214
1 14641
16
1
161520156164
1
![Page 148: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/148.jpg)
Discretização da Gaussiana 2D
2
22
2
2
1),(
yx
eyxG
121
242
121
16
1
14741
41626164
72641267
41626164
14741
273
1
![Page 149: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/149.jpg)
Separabilidade do filtro gaussiano
207 247 38 131 38
62 90 129 234 231
211 175 44 1 26
236 58 75 128 112
210 141 125 168 58
121
242
121
16
1
130 117 129
125 90 88
129 93 92
1214
1
1214
1
185 113 84
93 145 207
151 66 18
107 84 111
154 140 130
130 117 129
125 90 88
129 93 92
![Page 150: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/150.jpg)
Transformada normalizada de Fourier
1
0
1
0
)//(2),(1
),(w
x
h
y
hyswxrieyxfwh
srF
1
0
1
0
)//(2),(1
),(w
r
h
s
hyswxriesrFwh
yxf
![Page 151: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/151.jpg)
Transformada normalizada de Fourier: separação
)/(21
0
1
0
)/(2),(11
),( wxriw
x
h
y
hysi eeyxfhw
srF
1
0
1
0
)//(2),(1
),(w
x
h
y
hyswxrieyxfwh
srF
),( sxT
![Page 152: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/152.jpg)
Transformada normalizada de Fourier: Matriz H
1
0
)/(21),(),(
h
y
hysieh
yxfsxT
),( syH
sy
h
ihysi e
he
hsyH
2)/(2 11
),(
![Page 153: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/153.jpg)
)1(0)1)(1(1)1(0)1(
)1(11110
)1(00100
hhhhh
h
h
ffff
fff
fff
f
fHT
![Page 154: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/154.jpg)
)1()1(21)1(20)1(2
)1(12112012
)1(02102002
1
hh
h
ih
h
ih
h
i
h
h
i
h
i
h
i
h
h
i
h
i
h
i
eee
eee
eee
h
H
fHT
![Page 155: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/155.jpg)
1
0
2
),(1
),(w
x
rx
w
i
sxTew
srF
),( xrW
xr
w
i
ew
xrW
21),(
![Page 156: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/156.jpg)
)1()1(21)1(20)1(2
)1(12112012
)1(02102002
1
ww
h
iw
h
iw
h
i
w
h
i
h
i
h
i
w
h
i
h
i
h
i
eee
eee
eee
w
W
WfHWTF
![Page 157: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/157.jpg)
Problemas com a Transformada de Fourier
)(2121
21),(),( bkakiekkFbxaxf
),(),( 2121 kkFxxf
),(1
),( 2121
kkFxxf
)cossin,sincos(
)cossin,sincos(
2121
2121
kkkkF
xxxxf
![Page 158: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/158.jpg)
Como tornar a TF invariante a rotação e escala?
),(),( 2121 kkFxxf ),(),( 2121 kkFxxf iezkkF ),( 21
2
1 )ln(
y
yez i
)','(),( 2121 kkFyyf
![Page 159: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/159.jpg)
Parte 3 - Processamentos apenas no espaço das cores
Imagem DigitalConceitos, Processamento e Análise
![Page 160: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/160.jpg)
Correção gamaAjustes de contraste e iluminação
![Page 161: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/161.jpg)
Correção gama
LL
![Page 162: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/162.jpg)
Probabilidade
0 1 x
DF(x)
x0 x1
1
0
)( 10
x
x
dxxDFxxxP x
dxxDFxxPxCDF0
)(0)(
)()( xCDFdx
dxDF
Função de densidade de probabilidade
0 1 x
CDF(x)
1
x
Função de densidade acumulada de probabilidade
![Page 163: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/163.jpg)
Mudança de variavel y = f (x)
)()( yCDFdy
dyDF
0 1 x
y=f(x)
1
0 1 y
1
)(1 yfx
)()( xCDFxf )(xDFdx
dy
1)(
)()(
xDF
xDFyDF
0 1 x
DF(y)1
Transformação monotônica e limitada ao intervalo [0,1]
dy
dxxCDF
dx
d)(
dy
dxxDF )(
![Page 164: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/164.jpg)
Equalização de Histograma
L
j
j
n
nLfL
0
)('
0
0.2
0.4
0.6
0.8
1
1.2
1.4
1.6
1 2 3 4 5 6 7 8 9 10 11
n
n j
L
![Page 165: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/165.jpg)
Equalização do histograma
![Page 166: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/166.jpg)
Tons de cinza e negativo
Lx,y = 0.299Rx,y + 0.587Gx,y + 0.114Bx,y
tons de cinza
Lx,y = 255 - Lx,y
![Page 167: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/167.jpg)
Outros exemplos com o PaintShopProtm
![Page 168: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/168.jpg)
Quantização de cores
Quantização de 24 para 8 bits
![Page 169: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/169.jpg)
A qualidade depende da imagem
![Page 170: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/170.jpg)
Corte mediano
![Page 171: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/171.jpg)
Corte mediano
![Page 172: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/172.jpg)
Parte 4 - Codificação e armazenamento de Imagens
compressão e formatos de arquivos
Imagem DigitalConceitos, Processamento e Análise
![Page 173: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/173.jpg)
Codificação uniforme
Uniforme
tons # pixels código tam. # bits
0 1900 000 3 5700
1/7 2500 001 3 7500
2/7 2100 010 3 6300
3/7 1600 011 3 4800
4/7 800 100 3 2400
5/7 600 101 3 1800
6/7 300 110 3 900
1 200 111 3 600
TOTAL 30000
Podemos melhorar?
![Page 174: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/174.jpg)
Construção da Árvore Huffman
1/7 2500
2/7 2100
0 1900
3/7 1600
4/7 800
5/7 600
6/7 300
1 200
1/7 2500
2/7 2100
0 1900
3/7 1600
4/7 800
5/7 600
n0 500
n0
6/7 1
![Page 175: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/175.jpg)
Construção da Árvore Huffman
1/7 2500
2/7 2100
0 1900
3/7 1600
4/7 800
5/7 600
n0 500
n0
6/7 1
1/7 2500
2/7 2100
0 1900
3/7 1600
n1 1100
4/7 800
5/7
n1
![Page 176: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/176.jpg)
Construção da Árvore Huffman
1/7 2500
2/7 2100
0 1900
3/7 1600
n1 1100
4/7 800
1/7 2500
2/7 2100
0 1900
n2 1900
3/7 1600
n0
6/7 1
5/7
n1 4/7
n2
![Page 177: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/177.jpg)
Construção da Árvore Huffman
1/7 2500
2/7 2100
0 1900
n2 1900
3/7 1600
n3 3500
1/7 2500
2/7 2100
0 1900
n0
6/7 1
5/7
n1 4/7
n2 3/7
n3
![Page 178: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/178.jpg)
Construção da Árvore Huffman
n3 3500
1/7 2500
2/7 2100
0 1900
n0
6/7 1
5/7
n1 4/7
n2 3/7
n3
n4 4000
n3 3500
1/7 2500
n4
2/7 0
![Page 179: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/179.jpg)
Construção da Árvore Huffman
n0
6/7 1
5/7
n1 4/7
n2 3/7
n3
n5 6000
n4 4000 n4
2/7 0
n4 4000
n3 3500
1/7 2500n5
1/7
n6
![Page 180: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/180.jpg)
Construção da Árvore Huffman
1 0
11
10 01
00
111 110
1111 1110
1111
1
11110
1111
01
111100
000110
110
1110
11111
111100111101
n0
n1
n2
n3
n4n5
n6
6/7 1
5/7
4/7
3/7
0 2/71/7
![Page 181: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/181.jpg)
Codificação de HuffmanUniforme Huffman
tons # pixels código tam. # bits código tam. # bits
0 1900 000 3 5700 00 2 3800
1/7 2500 001 3 7500 10 2 5000
2/7 2100 010 3 6300 01 2 4200
3/7 1600 011 3 4800 110 3 4800
4/7 800 100 3 2400 1110 4 3200
5/7 600 101 3 1800 11111 5 3000
6/7 300 110 3 900 111101 6 1800
1 200 111 3 600 111100 6 1200
TOTAL 30000 TOTAL 27000
![Page 182: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/182.jpg)
Redundância de Codificação
r p(r) Code 1 l(r) l(r)p(r) Code 2 l(r) l(r)p(r)0 0.19 000 3 0.57 11 2 0.38
1/7 0.25 001 3 0.75 01 2 0.502/7 0.21 010 3 0.63 10 2 0.423/7 0.16 011 3 0.48 001 3 0.484/7 0.08 100 3 0.24 0001 4 0.325/7 0.06 101 3 0.18 00001 5 0.306/7 0.03 110 3 0.09 000001 6 0.18
1 0.02 111 3 0.06 000000 6 0.12
1.00 Lavg= 3.00 2.70
rk = tons de cinza em uma imagem, k=0, 1, ..., 1
p(rk) = nk / n
onde nk = número de pixels com tom rk
n = número de pixels da imagem
Lavg=
kk
kavg rprlL
1
0
111001
001
0001
00001
000001000000
![Page 183: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/183.jpg)
Resultado da Teoria da Informação
bitsdenúmerorp
rlk
kopt
1log2
r p(r) Code 1 l(r) l(r)p(r) Code 2 l(r) l(r)p(r) log(1/p) log(1/p)*p0 0.19 000 3 0.57 11 2 0.38 2.4 0.461/7 0.25 001 3 0.75 01 2 0.50 2.0 0.502/7 0.21 010 3 0.63 10 2 0.42 2.3 0.473/7 0.16 011 3 0.48 001 3 0.48 2.6 0.424/7 0.08 100 3 0.24 0001 4 0.32 3.6 0.295/7 0.06 101 3 0.18 00001 5 0.30 4.1 0.246/7 0.03 110 3 0.09 000001 6 0.18 5.1 0.151 0.02 111 3 0.06 000000 6 0.12 5.6 0.11
=1.00 Lavg = 3.00 2.70 Lopt = 2.65Lavg =
![Page 184: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/184.jpg)
Compressão de imagens
Compressão deImagens
Compressão deImagens
Sem PerdaSem Perda Com PerdaCom Perda
• Preserva exatamente o conteúdo da imagem
• Taxas de compressão 3 : 1
• Preserva de forma controlada o nível de qualidade da imagem
• Taxas de compressão que chegam a valores de mais de 100 : 1
![Page 185: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/185.jpg)
Métodos de compressão
• Sem perdas–Run length encoding (RLE) - repetição–Huffman coding - histograma–Predictive coding - diferenças–Block coding (LZW) - dicionário
• Com perdas–Truncation coding - reduz a representação–Predictive coding - descarta diferenças altas–Block coding - dicionário aproximado –Transform coding - descarta frequencias altas
Métodos compostos: JPEG, MPEG
![Page 186: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/186.jpg)
Processo de compressão e descompressão
Dados daImagemOriginal
32, 45, 57, 68, 23, 100,98, ...
32, 45, 57, 68, 23, 100,98, ...
Imagem Comprimida
32, 45, 57, 68, 23, 100,98, ...
Dados daImagemOriginal
Compressãoda imagem
Imagem Comprimida
32, 45, 57, 68, 23, 100,98, ...
Transporte e/ouArmazenamento
Descompressãoda imagem
¹
¹
![Page 187: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/187.jpg)
Fundamentos da Compressão de Imagens
•codificação
•entre pixels
•psico-visual
A compressão de uma imagem é obtida quando se elimina a redundância de:
![Page 188: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/188.jpg)
Redundância entre pixels
640 colunas x 480 linhas x 1 byte/pixel = 300 KBytes
480*(1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0) = ~18 Kbytes
onde 1 = 32 bytes de preto e 0 = 32 bytes de branco
![Page 189: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/189.jpg)
Compressão - RLE
Objetivo
Reduzir a quantidade de dados redundantes.
Exemplo
AAAAAAxxx 6A3x
Caracterísiticas
Simples e rápido, porém a eficiência depende da imagem a ser comprimida.
![Page 190: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/190.jpg)
Run-Length Encoding
76 76 76 76 76 78 79 79 79 79 80 80
76 | 5 78 | 1 79 | 4 80 | 2
imagem binária
0 0 0 0 0 0 0 1 1 1 1 0 0 0 0 0
7 4
1. . .
5
![Page 191: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/191.jpg)
Compressão do jpeg
![Page 192: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/192.jpg)
Aplicações são tecnologicamente complexas:
exemplo: algoritmo do JPEG
FDCT
SourceImage
QuantizerEntropyEncoder
TableTable
Compressedimage data
DCT-based encoding
8x8 blocks
R
BG
![Page 193: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/193.jpg)
![Page 194: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/194.jpg)
![Page 195: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/195.jpg)
![Page 196: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/196.jpg)
Equations for JPEG DCT
• Forward DCT:
• Inverse DCT:
.1, otherwise ;0yfor x, 2
1 where
16
)12(cos
16
)12(cos),(
4
1),(
7
0
7
0
yxyx
x yyx
CCCC
yjxijiSpixelCCyxDCT
.1, otherwise ;0,for 2
1, where
)12(cos
16)12(
cos),(41
),(7
0
7
0
jiji
x yji
CCjiCC
iyjx
jiDCTCCyxpixel
![Page 197: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/197.jpg)
Visualization of Basis Functions
Increasin
g frequ
ency
Increasing frequency
![Page 198: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/198.jpg)
Organização de pixels num arrayno formato TGA (targa)
b g r ab g r a bb arg
0 1 …
...
arg
w-1x
y
unsigned char *bgra_vector;…offset=4*(w*y+x);blue = bgra_vector[offset];green = bgra_vector[offset+1];red = bgra_vector[offset+2];alpha = bgra_vector[offset+3];
0
12
h-1
3
Pixel (x,y)
![Page 199: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/199.jpg)
Outra ordem no plano
![Page 200: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/200.jpg)
Tipo Abstrato ImagemImage *imgCreate (int w, int h);
void imgDestroy (Image *image);
int imgGetWidth(Image * image);
int imgGetHeight(Image * image);
float * imgGetRGBData(Image * image);
void imgSetPixel3fv(Image *image, int x, int y, float * color);
void imgSetPixel3ubv(Image *image, int x, int y, unsigned char *color);
void imgGetPixel3fv(Image *image, int x, int y, float *color);
void imgGetPixel3ubv(Image *image, int x, int y, unsigned char *color);
Image * imgReadBMP(char *filename);
int imgWriteBMP(char *filename, Image * image);
Image * imgCopy(Image * image);
Image * imgGrey(Image * image);
Image * imgResize(Image * img0, int w1, int h1);
/*- implementação do tipo Imagem */
struct image_imp
int width; /* largura (width) em pixels */
int height; /* altura (height) em pixels */
float *buf; /* buffer RGB */
;
![Page 201: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/201.jpg)
Arquivos Targa RGBA
Cabeçalho Pixels (bgra,bgra, …,bgra)
/* escreve o cabecalho */
putc(byteZero,filePtr); /* no. de caracteres no campo de id da imagem */
putc(byteZero,filePtr); /* imagem nao tem palheta de cores */
putc(imageType,filePtr); /* = 2 -> imagem "true color" (RGBA) */
putuint(shortZero,filePtr);/* info sobre a tabela de cores (inexistente) */
putuint(shortZero,filePtr); /* idem */
putc(byteZero,filePtr); /* idem */
putuint(shortZero,filePtr); /* =0 origem em x */
putuint(shortZero,filePtr); /* =0 origem em y */
putuint(img->width,filePtr); /* largura da imagem em pixels */
putuint(img->height,filePtr); /* altura da imagem em pixels */
putc(bitDepth,filePtr); /* numero de bits de um pixel */
putc(byteZero, filePtr); /* origem canto inf esquedo sem entrelacamento */
unsigned char imageType=2 /* RGB(A) sem compressão */
unsigned char bitDepth=32; /* 32 bits por pixel */
unsigned char byteZero=0; /* usado para escrever um byte zero no arquivo */
short int shortZero=0; /* usado para escrever um short int zero no arquivo */
![Page 202: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/202.jpg)
Organização de pixels num arrayno formato PPM (o mais simples)
00 01 02 0807060503 04 1009 11
0 1 2
...
1312 14
w-1
15 16 17 18 ...
x
y Pixel (x,y)unsigned char *rgb_vector;…offset=3*(w*y+x);red = rgb_vector[offset];green = rgb_vector[offset+1];blue = rgb_vector[offset+2];
01
2
h-1
3
...
![Page 203: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/203.jpg)
Formato PPM• File_signature "P6". • White_space (blanks, TABs, CRs, LFs). • Width, w, (ASCII decimal characters). • White_space (blanks, TABs, CRs, LFs). • Height, h, (ASCII decimal characters). • White_space (blanks, TABs, CRs, LFs). • Max_color, max, (ASCII decimal characters). • White_space (blanks, TABs, CRs, LFs). • Pixels, (3*w*h bytes rgb components of pixels)
• Comments from # to the end of line• lines 70 characters
![Page 204: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/204.jpg)
Formato PPM
P6# Created by Paint Shop Pro358 539255=?:?A<AC>CE@EFAFGBGHCGHCGHB . . .
exemplo
![Page 205: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/205.jpg)
Gravação em PPM
int ppm_write(int w, int h, unsigned char *rgb, char *file_name) FILE *fp;
fp = fopen(file_name, "wb"); if (fp == NULL) return 0;
if (fprintf(fp, "P6\n%d %d\n255\n", w, h) <= 0) fclose(fp); return 0;
if (fwrite(rgb, 3*w*h, 1, fp) != 1) fclose(fp); return 0;
fclose(fp); return 1;
![Page 206: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/206.jpg)
Leitura em PPMint ppm_read(int *p_w, int *p_h, unsigned char **p_rgb, char *file_name) FILE *fp; char line[80]; int rgb_size; int max;
fp = fopen(file_name, "rb"); if (fp == NULL) printf(”Error reading %s",file_name); return 0; fgets(line,80,fp); if(strcmp(line,"P6\n")) printf(”Wrong signature\n"); return 0;
while (fscanf( fp, " %d ", p_w ) != 1) fgets(line, 80, fp);
while (fscanf( fp, " %d ", p_h ) != 1)
fgets(line, 80, fp); while (fscanf( fp, " %d", &max ) != 1)
fgets(line, 80, fp); fgetc(fp); rgb_size=3*(*p_w)*(*p_h); (*p_rgb) = (unsigned char *) calloc(rgb_size, 1); if ((*p_rgb) != NULL) fread( (*p_rgb), rgb_size, 1, fp ); fclose(fp); return 1;
![Page 207: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/207.jpg)
Programa Simplesvoid main(void) int w, h; // dimensões da imagem unsigned char *rgb; // bytes de rgb unsigned char r,g,b,grey; // componentes de cor int x,y; long int k;
if (ppm_read(&w,&h,&rgb,"test_in.ppm")==0) return; for (y = 0; y < h; y++) for (x = 0; x < w; x++) k = 3*(y*w+x); r = rgb[k]; g = rgb[k+1]; b = rgb[k+2]; grey = (unsigned char)(0.3*r+0.6*g+0.1*b); rgb[k] = grey; rgb[k+1] = grey; rgb[k+2] = grey; ppm_write(w, h, rgb, "test_out.ppm"); free(rgb);
![Page 208: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/208.jpg)
Arquivo BMP
00 01 02 0807060503 04 1009 11
Pixel 0 Pixel 1 Pixel 2 Pixel 3
1312 14
Pixel 4
15
16 17 18 ...
colocado para garantir múltiplo de 4
colocado para garantir múltiplo de 4
Organização dos pixels de uma imagem RGB no arquivo BMP
![Page 209: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/209.jpg)
Microsoft Windows Bitmap - BMP
Características Principais
• Mono, 4-bit, 8-bit, 24-bit• Tipo de compressão: RLE / não comprimido• Tamanho máximo: 64K x 64K pixels• Seções (versão 3):
Header
Info. Header
Palette
Bitmap Data
![Page 210: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/210.jpg)
BMP - Header
typedef struct _Win3xBitmapHeader
WORD Type; /* Image file type 4D42h (“BM”)*/
DWORD FileSize; /* File size (bytes) */
WORD Reserved1; /* Reserved (always 0) */
WORD Reserved2; /* Reserved (always 0) */
DWORD Offset; /* Offset to bitmap data in bytes */
WIN3XHEAD;
![Page 211: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/211.jpg)
BMP - Information Header
typedef struct _Win3xBitmapInfoHeader
DWORD Size; /* Size of this Header (40) */
DWORD Width; /* Image width (pixels) */
DWORD Height; /* Image height (pixels) */
WORD Planes; /* Number of Planes (always=1) */
WORD BitCount; /* Bits per pixel (1/4/8 or 24)*/
DWORD Compression; /* Compression (0/1/2) */
DWORD SizeImage; /* Size of bitmap (bytes) */
DWORD XPelsPerMeter; /* Horz. resol.(pixels/m) */
DWORD YPelsPerMeter; /* Vert. resol.(pixels/m) */
DWORD ClrUsed; /* Num of colors in the image */
DWORD ClrImportant; /* Num of important colors */
WIN3XINFOHEADER;
![Page 212: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/212.jpg)
BMP - Palette
typedef struct _Win3xPaletteRGBQUAD Palette[ ]; /* 2, 16, or 256 elem. */ WIN3XPALETTE;
typedef struct _Win3xRgbQuadBYTE Blue; /* 8-bit blue component */BYTE Green; /* 8-bit green component */BYTE Red; /* 8-bit red component */BYTE Reserved; /* Reserved (= 0) */
RGBQUAD;
![Page 213: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/213.jpg)
BMP - Image Data
Notas
Cada scan line em um arquivo BMP é sempre um múltiplo de 4.
Imagens com1-, 4-, e 8-bits usam uma palheta de cores.
Imagens com 24-bits guardam a cor diretamente, na ordem azul, verde e vermelho.
O armazenamento da imagem é sempre feito a partir do canto esquerdo inferior.
![Page 214: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/214.jpg)
Esquemas de armazenamento de imagens
Verm.
Verde
Azul
Pixe
l 2
Plano de Cores
00 01 02 060503 04
07 08 09 . . .
Pixe
l 0
Pixe
l 5
Pixe
l 4
Pixe
l 3
Pixe
l 1
06
06
Organização dos pixels de uma imagem por planos de cores
Ban
cos
(Jav
a)
Informação é uma componente da cor
(Data Buffer – Java)
![Page 215: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/215.jpg)
Transformações Geométricas na Imagem
Amostragem
e
Reconstrução
![Page 216: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/216.jpg)
![Page 217: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/217.jpg)
Transformações R2 R2
xy
yx
y
x 2
'
'
Exemplos:
x
yx´
y´ p´ =
x
y
y
xf
y
x'
'
pp T'
x
yp =
yx
yx
y
x 52'
'
)sin(
)cos('
'
yx
yx
y
x
![Page 218: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/218.jpg)
Transformações lineares R2 R2
x
y
m11 x´
y´ =
m21 m22
m12
Mostre que:
1 0
x
y
0 1
m11 m21
1 0
T =
m12 m22
0 1
T =
T (0) = 0A)
B)
0)()()()0( pppp TTTT
222112211 ),()()( RpRpppp ii eaTaTaaaT
![Page 219: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/219.jpg)
Transformações lineares: escala
x
y
a =x
y
x´
y´ a =
Redução (0< sx <1) ,Aumento (sy >1)
c
b
y
x
s
s
ys
xs
y
x
y
x
y
x
0
0
'
'
y
x
s
s
0
0S
x
y
i
j
0)( xs
T i
ysT
0)(j
![Page 220: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/220.jpg)
Transformações lineares: espelhamento
x´ = -1xy´ = y
x
y
x´
y´ p' =
=px
y
y
x
y
x
y
x
10
01
'
'
x
y
i
j
0
1)( iiT
1
0)( jjT
10
01yE
![Page 221: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/221.jpg)
Transformações lineares: rotação
x´
y´ p' =
x´
y´
a
r
x´ = x.cos q - y.sen q y´ = x.sen q + y.cos q
x
y
p =x
yqar
r
sincoscoscos
sinsincoscos
rr
rr
y
x
y
x
cossin
sincos
'
'
r
sinsin - coscos )cos(
sincos cossin )sin(
)sin(
)cos(
'
'
r
r
y
x
![Page 222: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/222.jpg)
Transformações Lineares:matriz derivada pela geometria
x
y
q
sin
cos)(iT
cos
sin)(jT
i
j
cossin
sincosR
cossin
sincosR
![Page 223: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/223.jpg)
Mudança de referêncial
x
y
p =x
y
x
y
cos q u
v=
sen q cos q
-sen q
u
v
u
vou
- qx
y
p =
x´
y´ p'=
x
yq
x
yux
u
v=
vxvy
uy
Para montarmos a matriz que transforma as coordenadas de um refencial xy para um novo refencial uv basta escrevermos as linhas como sendo os unitários das direções.
x
y
q
sin
cos)(iT
cos
sin)(jT
i
j
cossin
sincosR
![Page 224: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/224.jpg)
Mudança de coordenadas entre sistemas rotacionados
• As coordenas de um ponto rodado de um ângulo em relação a um sistema são iguais as coordenadas do ponto original em relação a um sistema que sofre a rotação inversa.
• Como o novo sistema sofre a rotação inversa, a matriz de rotação é a inversa da matriz que levaria da base original para a este novo sistema.
• As colunas de uma matriz de uma rotação são as transformadas dos vetores da base e a transposta desta matriz é a sua inversa (rotaçãomatriz ortonormal).
• Logo as linhas da matriz que escreve uma mudança entre bases ortonormais rodadas são as coordenadas do vetores da nova base em relação a base original.
![Page 225: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/225.jpg)
y
x
y
yx
y
x
10
tan1tan
'
'
Transformações lineares: cisalhamento (shear)
Cisalhamento em x
x
x
yy
x
y
ij
0
1)( iiT
1)(
tgT j
10
1 tgShx
![Page 226: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/226.jpg)
Exemplo de aplicação do cisalhamento
x
y
a
b
cplano de projeção
m
x
y
a' m'
x
y
c'
b'
a' m'
R
ySh
![Page 227: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/227.jpg)
Exemplo de aplicação do cisalhamento
2
xy
1
4
y
xyx
x
y
x12
101
2'
'
x
y
a x
y
c'
b'
a' m'
5
4
2
4
2'
'
xyy
xx
i
)(jj T
)(iT
![Page 228: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/228.jpg)
Decomposição Singular de Matrizes
USVM diagonal
rotações
0.7991650.601112
0.601112-0.799165
1.3294760
00.752176
0.6011120.799165-
0.7991650.601112
10
5773.01
10
5773.01
10
30tan1 0
M
)cos(37)sin(37
)sin(37-)cos(37
1.3294760
00.752176
)cos(-53)sin(-53
)sin(-53-)cos(-53
10
30tan100
00
00
000
)37()329.1,752.0()53()30( 000 RSRSh x
![Page 229: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/229.jpg)
Exemplo: cisalhamento como composição de rotações e escala
10
5773.01
0.7991650.601112
0.601112-0.799165
1.3294760
00.752176
0.6011120.799165-
0.7991650.601112
)30( 0xSh
)37( 0R
S
)53( 0R
![Page 230: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/230.jpg)
Transformações Geométricas: Translação
x
y
p
p'
tx
ty
t =
x
yp' =
tx
ty
+=x’
y’
x
y
? x´
y´ =
? ??
x
y
1 x´
y´ =
0 10 tx
ty
+
Não pode ser escrito na forma
Ruim paraimplementação
![Page 231: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/231.jpg)
Translação num plano do R3
yh
xh
w
w=1
x
y
t
1100
10
01
1
'
'
y
x
t
t
y
x
y
x
matriz de translação
![Page 232: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/232.jpg)
Concatenação
x
y
x0
y0
a
x
y
x
y
a
x
y
x0
y0
1 0
0 1
0 0 1
0
0
x
y 1 0
0 1
0 0 1
0
0
x
y
cos sin
sin cos
0
0
0 0 1
x
y
x
y
x
y
x
y
'
'
cos sin
sin cos
1
1 0
0 1
0 0 1
0
0
0 0 1
1 0
0 1
0 0 1 1
0
0
0
0
![Page 233: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/233.jpg)
Concatenação
x
y
x
y
x
y
x
y
x
y
x
yT1
R1
E
R2
T2P’= T2 R2 E R1 T1 PP’= T2 R2 E R1 T1 P
![Page 234: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/234.jpg)
Coordenadas projetivas(ou homogêneas)
x
yp
wx
wy
w
xh
yh
w
= =
x
y
1
=D =D
yh
xh
w
w=1
x
y
wx
wy
w
x = xh /w
y = yh /ww>0
Ex.:
3
2
1
3
2
6
4
2
9
6
3
==D =D
p
![Page 235: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/235.jpg)
Vantagens das coordenadas homogêneas (pontos no infinito)
yh
xh
w
w=1
x
y
2
3u =
u
uh
2
3
0
=?
?
w=1
uh
wh1
c1h2 = c2
h3
c3
2
3
2
2
3
1
2
3
1/2
2
3
1/4
2
3
0
. . .
1
1.5
2
3
4
6
8
12
infinitona
direção(2,3)
infinitona
direção(2,3)
h1 h2 h3 h4
c1 c2 c3 c4
![Page 236: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/236.jpg)
Reta no espaço projetivo
yh
xh
w
reta: ax+by+c=0
plano: ax+by+cw=0
plano: w=1
![Page 237: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/237.jpg)
Reta paralelas no espaço projetivo
yh
xh
wplano: ax+by+c1w=0
reta: ax+by+c 1 =0
reta: ax+by+c 2 =0
plano: ax+by+c2w=0
reta= ax+by =0
plano: w=1
![Page 238: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/238.jpg)
Deformação sem paralelismo
yh
xh
w
w=1
x
y
yh
xh
w
w=1
x
y
![Page 239: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/239.jpg)
Matriz da Homografia
?H
u
v
x
y
0
0
v
u
1
1
v
u
2
2
v
u
3
3
v
u
0
0
y
x
1
1
y
x
2
2
y
x
3
3
y
x
NP
A
APNH
![Page 240: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/240.jpg)
[A] : Afim
100
00301
00301
yyyyy
xxxxx
A
x
y
0
0
y
x
1
1
y
x
2
2
y
x
3
3
y
x
?A
110012
2
1
00301
00301
2
21 y
x
yyyyy
xxxxx
y
x
A Obs: Se fosse um
paralelograma a imagem do ponto 2 seria (1,1)T
e não (α, )T
![Page 241: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/241.jpg)
[P] : Projetiva
111
00
00
P
?P
![Page 242: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/242.jpg)
[N] : Paralelograma para quadrado unitário
TLN 1
u
v
0
0
v
u
1
1
v
u
2
2
v
u
01
01
vv
uu
03
03
vv
uu
3
3
v
u
100
10
01
0
0
v
u
T
1
1
100
0
0
0301
0301
vvvv
uuuu
L
1L
![Page 243: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/243.jpg)
Fundamentals of Texture Mapping and Image Warping
“Explained”A revisit of Paul Heckbert’s
M.Sc. Thesis
![Page 244: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/244.jpg)
![Page 245: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/245.jpg)
![Page 246: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/246.jpg)
Um exemplo 1D
)(uf
u
)(ufc
Nk
kkkc uurwuf )()(
u
Sinal de entrada discreto
Textura discreta Textuta contínua
![Page 247: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/247.jpg)
Deformação da textura (warping)
Nk
kkkc uurwuf )()(
)(ufc
u))(()( 1 xmfxg cc
)(xgc
x
)(umx
)(1 xmu
))(()( 1k
Nkkkc uxmrwxg
Textuta contínua deformadaTextuta contínua
![Page 248: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/248.jpg)
Limitando a freqüência
)(xgc
))(()( 1 xmfxg cc
x
)(xgc
)()()(' xhxgxg cc
x
![Page 249: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/249.jpg)
Filtro de re-amostragem
R
cc dttxhtmfxg )())(()(' 1
)()()(' xufxg kNk
kc
)()()(' xhxgxg cc
R Nk
kkkc dtuxmrwtxhxg ))(()()(' 1
R
kkk dtutmrtxhx ))(()()( 1
R
kkk duu
muurumxhx )())(()(
)(umt
duu
umdt
)(
![Page 250: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/250.jpg)
Reconstrução, warping, filtragem e amostragem
![Page 251: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/251.jpg)
Textura em imagem
v
ji
ijkijc rff,
)()()( uuuu
u
v
u
![Page 252: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/252.jpg)
Textura em imagem
ji
ijkijc rff,
)()()( uuuu
v
u x
y)(umx
))(()( 1 xmx cc fg
)(1 xmu
![Page 253: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/253.jpg)
Filtro de re-amostragem no espaço de destino (espaço da imagem)
A
cc dAhfg ttxtmx )())(()(' 1
)()()(',
xux ijji
ijc fg
)()()(' xxx hgg cc
A
tji
ijijijc dArfhg,
1 ))(()()()(' uxmutxx
A
ijijij dArh tutmtxx ))(()()( 1
destination space integral
![Page 254: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/254.jpg)
Filtro de re-amostragem no espaço de origem (espaço da textura)
)()()(',
xux ijji
ijc fg
A
ijijij dArh tutmtxx ))(()()( 1
R
ijijij drh uu
muuumxx )())(()(
)(umt
R
ijijij drh uJuuumxx )())(()(
)(det)(
v
x
u
y
v
y
u
x
v
y
u
yv
x
u
x
ddd
u
u
umuJt
)(1 tmu
![Page 255: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/255.jpg)
R
ijijij drh uJuuumxx )())(()(
Filtro de re-amostragem no espaço de origem (espaço da textura)
cJuculumx )()( 11111 )()( cxJcxlxmu
))(()(
))(()(1
1
uxmJumx
uxmmumx
ijijcJux
cJux
22
11
)( 2121 uuJxx
R
ijijij drh uuuuxmJJx )()))((()( 1
R
ijijij drh tttuxmJJx )()))((()( 1
ijuut ut dd tuu ij
![Page 256: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/256.jpg)
R
ijijij drh tttuxmJJx )()))((()( 1
)()(' uJJu hh
R
ijijij drh tttuxmx )()))(((')( 1
))()('()( 1ijijij rh uxmx
Filtro de re-amostragem no espaço de origem (espaço da textura)
texture space integral
![Page 257: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/257.jpg)
Mapeamentos lineares afins
11001
v
u
fed
cba
y
x
100
1
1
v
u
bdae
afcdab
cebfde
bdaev
u
ed
ba
v
y
u
yv
x
u
x
J
cJuculumx )()(
f
c
v
u
ed
ba
y
x
11111 )()( cxJcxlxmu
)()(' uJJu hh ),()(),(' evdubvauhdbaevuh
![Page 258: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/258.jpg)
Elliptical Gaussian Resampling
![Page 259: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/259.jpg)
Gaussiana
xVx
VV x1
1/22
1
||π21)(
T
eG
2
2
0
0
V
0
02
1V
y
xyxT
2
21
10
01
xVx2
22
yx
2
22
222
1),(
yx
eyxG
2
2
2
2
1)(
x
exG
![Page 260: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/260.jpg)
Gaussiana
2
22
222
1),(
yx
eyxG
2
2
2
2
1)(
x
exG
2
2
2
2
1)(
y
eyG
2
22
2
2
2
2
22
222 2
1
2
1)()(),(
yxyx
eeeyGxGyxG
![Page 261: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/261.jpg)
Circulos e Elipses
v
u
dc
ba
y
x222 Ryx
2Ry
xyx
2R
v
u
dc
ba
db
cavu
2
22
22
Rv
u
dbcdab
cdabcavu
2
2
2 Rv
u
CB
BAvu
FCvBuvAu 22
![Page 262: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/262.jpg)
Warping de domínios de Gaussianas
2
22
2
1),(
vu
evuG
xVx
VV x1
1/22
1
||π21)(
T
eG
CB
BA
2/
2/V
.22 contCyBxyAxT Vxx
![Page 263: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/263.jpg)
Filtro Gaussiano de re-amostragem no espaço de origem (espaço da textura)
![Page 264: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/264.jpg)
Exemplo de reconstrução com Gaussiana
![Page 265: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/265.jpg)
Implementação do Filtro Gaussiano
IRH k
))(()( 1 kkk Tg uxmxIJJ
xVx
VV x1
1/22
1
||π21)(
T
eg
IJJV T1
![Page 266: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/266.jpg)
Magnificação e mimificação
![Page 267: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/267.jpg)
Regiões que mapeiam num quadrado ou círculo
![Page 268: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/268.jpg)
Nosso problema
Screen space Texture space
![Page 269: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/269.jpg)
Como tratar o caso geral
...)( Jucumx
![Page 270: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/270.jpg)
FIM
![Page 271: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/271.jpg)
Adding a lens
• A lens focuses light onto the film– There is a specific distance at which
objects are “in focus”• other points project to a “circle of confusion” in
the image
– Changing the shape of the lens changes this distance
“circle of confusion”
![Page 272: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/272.jpg)
Lenses
• A lens focuses parallel rays onto a single focal point– focal point at a distance f beyond the plane
of the lens• f is a function of the shape and index of refraction of the lens
– Aperture of diameter D restricts the range of rays• aperture may be on either side of the lens
– Lenses are typically spherical (easier to produce)
focal point
F
optical center(Center Of Projection)
![Page 273: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/273.jpg)
Thin lenses
• Thin lens equation:
– Any object point satisfying this equation is in focus– What is the shape of the focus region?– How can we change the focus region?– Thin lens applet: http://www.phy.ntnu.edu.tw/java/Lens/lens_e.html (by Fu-Kwun Hwang )
![Page 274: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/274.jpg)
Depth of field
• Changing the aperture size affects depth of field– A smaller aperture increases the range in
which the object is approximately in focus
f / 5.6
f / 32
Flower images from Wikipedia http://en.wikipedia.org/wiki/Depth_of_field
![Page 275: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/275.jpg)
Lentes reais
![Page 276: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/276.jpg)
Câmera obscura e Camera “pin-hole”
![Page 277: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/277.jpg)
Sensor Fujifilm
![Page 278: Imagem Digital Captura, Processamento, Interpretação, Criação, Reprodução, …](https://reader036.fdocument.pub/reader036/viewer/2022062404/552fc15f497959413d8e755f/html5/thumbnails/278.jpg)
O que é registrado nos sensores (CCD, CMOS...)
yim
xim0
1 3 4
1
2
0
3
2
sx
sy
5