digital image processing, 2nd ed. © 2002 r. c. gonzalez & r. e. woods melhoramento de imagens...
TRANSCRIPT
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Melhoramento de Imagens
Paulo Sérgio Rodrigues
PEL205
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 3Image Enhancement in the
Spatial Domain
Chapter 3Image Enhancement in the
Spatial Domain
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 3Image Enhancement in the
Spatial Domain
Chapter 3Image Enhancement in the
Spatial Domain
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Melhoramento no Domínio Espacial
Alguns tipos simples de transformações de intensidade
• Negativo
• Stretching
• Compressão
• Slicing
Uma maneira de realizar algumas dessas operações é atravésda função de transformação g(x,y) = c f(x,y)y
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 3Image Enhancement in the
Spatial Domain
Chapter 3Image Enhancement in the
Spatial Domain
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 3Image Enhancement in the
Spatial Domain
Chapter 3Image Enhancement in the
Spatial Domain
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 3Image Enhancement in the
Spatial Domain
Chapter 3Image Enhancement in the
Spatial Domain
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 3Image Enhancement in the
Spatial Domain
Chapter 3Image Enhancement in the
Spatial Domain
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 3Image Enhancement in the
Spatial Domain
Chapter 3Image Enhancement in the
Spatial Domain
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 3Image Enhancement in the
Spatial Domain
Chapter 3Image Enhancement in the
Spatial Domain
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 3Image Enhancement in the
Spatial Domain
Chapter 3Image Enhancement in the
Spatial Domain
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 3Image Enhancement in the
Spatial Domain
Chapter 3Image Enhancement in the
Spatial Domain
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 3Image Enhancement in the
Spatial Domain
Chapter 3Image Enhancement in the
Spatial Domain
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 3Image Enhancement in the
Spatial Domain: Bit-Plane Slicing
Chapter 3Image Enhancement in the
Spatial Domain: Bit-Plane Slicing
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 3Image Enhancement in the
Spatial Domain: Bit-Plane Slicing
Chapter 3Image Enhancement in the
Spatial Domain: Bit-Plane Slicing
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 3Image Enhancement in the
Spatial Domain: Bit-Plane Slicing
Chapter 3Image Enhancement in the
Spatial Domain: Bit-Plane Slicing
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Melhoramento no Domínio Espacial
Processamento Baseado em Histograma: Equalização
O objetivo é usar uma função de transformação que torne o histograma o mais uniforme possível, criando uma imagemcom maior contraste.
Se usarmos como função de transformação o histograma cumulativoo resultado será uma distribuição mais uniforme (equalizada)
• Calcular o Histograma original• Calcular o Histograma cumulativo• Equalizar a imagem com o Histograma cumulativo
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Melhoramento no Domínio Espacial
Processamento Baseado em Histograma: Equalização
1,...,1,0 10 )( Lkrn
nrp k
kkr
onde: pr(rk) é a probabilidade da intensidade rk
nk é o número de ocorrências de rk
n é o número total de ocorrências
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Melhoramento no Domínio Espacial
Processamento Baseado em Histograma: Equalização
A função cumulativa é calculada como:
1,......,1,0 1,0
)(
)()(
1
00
Lksr
sTr
rpn
nrTs
kk
kk
k
jjr
k
j
jkk
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Melhoramento no Domínio Espacial
Processamento Baseado em Histograma: Equalização
)(rpr )()( 1 sTsps
r s
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 3Image Enhancement in the
Spatial Domain
Chapter 3Image Enhancement in the
Spatial Domain
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 3Image Enhancement in the
Spatial Domain: Enhancing with Arithmetic/Logic Operations
Chapter 3Image Enhancement in the
Spatial Domain: Enhancing with Arithmetic/Logic Operations
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 3Image Enhancement in the
Spatial Domain: Image Averaging
Chapter 3Image Enhancement in the
Spatial Domain: Image Averaging
a) Originalb) Original + ruídoc) Média de 8 imagensd) Média de 16 imagens e) Média de 32 imagensf) Média de 64 imagens
(a) (b)
(c) (d)
(e) (f)
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 3Image Enhancement in the
Spatial Domain: Image Averaging
Chapter 3Image Enhancement in the
Spatial Domain: Image Averaging
Diferença de imagens
a) Original slide 23 – (c) slide 24 b) Original slide 23 – (d) slide 24(c) Original slide 23 – (e) slide 24(d) Original slide 23 – (f) slide 24
(a)
(b)
(c)
(d)
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 3Image Enhancement in theSpatial Domain: Filtering
Chapter 3Image Enhancement in theSpatial Domain: Filtering
Mecanismo parafiltragem no domínioespacial
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 3Image Enhancement in theSpatial Domain: Filtering
Chapter 3Image Enhancement in theSpatial Domain: Filtering
Representação da máscarade convolução
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 3Image Enhancement in theSpatial Domain: Filtering
Chapter 3Image Enhancement in theSpatial Domain: Filtering
Exemplo de máscaras de suavização
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 3Image Enhancement in theSpatial Domain: Filtering
Chapter 3Image Enhancement in theSpatial Domain: Filtering
(a) (b)
(c) (d)
(e) (f)
Exemplo de suavização
a)Imagem original
(b) a (f) Resultados de suavização com máscaras de tamanho 3, 5, 9,15 e 35
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 3Image Enhancement in theSpatial Domain: Filtering
Chapter 3Image Enhancement in theSpatial Domain: Filtering
a) Imagem do telescópio Hubble; b) suavização com máscara 15 x 15; c) Limiarização de (b)
(a) (b) (c)
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 3Image Enhancement in the
Spatial Domain: Edge Detection
Chapter 3Image Enhancement in the
Spatial Domain: Edge Detection
(a)
(c)
(b)
(d)
a) Máscara para o Laplaciano;
b) Extensão incluindo as diagonais;
c) Outra implementação para (a)
d) Outra implementação para (b)
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 3Image Enhancement in the
Spatial Domain: Edge Detection/Filtering
Chapter 3Image Enhancement in the
Spatial Domain: Edge Detection/Filtering
a) Imagem original;b) Laplaciano;c) (b) escalonado;d) Melhoramento
usando a equação abaixo
(a) (b)
(c)(d)
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 3Image Enhancement in the
Spatial Domain: Edge Detection/Filtering
Chapter 3Image Enhancement in the
Spatial Domain: Edge Detection/Filtering
(a) (b)
(c) (d)
a) Filtros Laplacianos;b) Imagem microscópicac) Filtragem com (a)
superiord) Filtragem com (a)
inferior
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 3Image Enhancement in the
Spatial Domain: Popular Masks
Chapter 3Image Enhancement in the
Spatial Domain: Popular Masks
a) Máscara 3 x 3;b) Máscara 2 x 2 sensível
a diagonal;c) Filtro Sobel horizontald) Filtro Sobel Vertical
(a)
(b)
(c) (d)
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 3Image Enhancement in the
Spatial Domain: Edge with Sobel
Chapter 3Image Enhancement in the
Spatial Domain: Edge with Sobel
(a) (b)
a) Imagem de Lentes de Contato; (b) Aplicação do Gradiente Sobel
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Melhoramento no Domínio Espacial
Filtragem com função Sigmoid
Se uma escala de reflectância das regiões de interesse são conhecidas, pode-se usar uma função que se adapte aos valoresconhecidos para direcionar a suavização. Exemplo: região em torno da mama
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Melhoramento no Domínio Espacial
Filtragem com função Sigmoid
Em caso de tumores de mama, um estudo de tais regiões, produz a seguinte escala:
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Melhoramento no Domínio Espacial
Filtragem com função Sigmoid
Tal escala, pode ser utilizada em uma função sigmoid como a seguinte:
Min
e
MinMaxII
1
1)(
~
onde ....
Digital Image Processing, 2nd ed.Digital Image Processing, 2nd ed.www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Melhoramento no Domínio EspacialFiltragem com função Sigmoid
interesse de faixa da mínimo e máximo valoresos são e
dacentraliza está interesse de faixa a qual do tornoem valor o é
interesse de faixa da largura a é
original luminância de valor o é
suavizado luminância de valor o é ~
1
1)(
~
MinMax
I
I
Min
e
MinMaxII