Вы находитесь на странице: 1из 27

Algoritmos

Para
Procesamiento
de Imgenes
Cristian Ral Pineda
Rodrguez
Gustavo Adolfo Ceballos
Barrientos
Qu es una imagen?
Una matriz de puntos
Procesamiento de imgenes
Primera aproximacin a posibles algoritmos
paralelos:
Algoritmos generales sobre matrices.

No es suficiente: Necesitamos conocer los tipos
de procesamiento.

Clasificacin
Dos puntos de vista:
Por propsito.
Por algoritmo.

Propsitos diferentes comparten
algoritmos y existen diversos algoritmos
para un mismo propsito. Nos interesa la
clasificacin por algoritmo.
Clasificacin (II)

Procesamiento individual de puntos.

Basados en matrices de convolucin.

Transformada de Fourier.

Procesamiento de puntos
Se basan en un tratamiento individual de
cada punto de la imagen.

Pertenecen a este grupo:
Brillo / Contraste
Umbral
Histograma
Procesamiento de puntos (II)
Algoritmo secuencial

for (i=0; i<N; i++)
for (j=0; j<M; j++)
imagen[i][j] = calculo(imagen[i][j]);

Orden (NM)
Procesamiento de puntos (III)

Posibles algoritmos paralelos:
Particionamiento de la matriz.

Al no existir comunicacin entre procesos
el speedup es casi lineal. Orden (NM/P)
w
0
w
1
w
2
w
3
w
4
w
5
w
6
w
7
w
8
5 4 3
x x x
x x x
6 7 8
x x
1
x
0 2
x
4
'
Mscara
Imagen Resultado
Matriz de convolucin
Se basan en aplicar sobre cada punto de la
matriz un clculo basado en los puntos vecinos.
k
x w x w x w x w x w x w x w x w x w
x
8 8 7 7 6 6 5 5 4 4 3 3 2 2 1 1 0 0
'
4
+ + + + + + + +
=
Matriz de convolucin (II)
Pertenecen a este grupo:
Desenfoque
Enfoque

Y con variaciones en el clculo:
Eliminacin de ruido
Deteccin de bordes

Matriz de convolucin (III)
Algoritmo secuencial:

for (i=0; i<N; i++)
for (j=0; j<M; j++)
x[i][j] = w[0]*x[i-1][j-1] + w[1]*x[i-1][j] + ...;

Orden (NM)

Matriz de convolucin (IV)
Posibles algoritmos paralelos:
Particionamiento de la matriz.

Dos problemas:
Dependencias.
Mltiples lecturas.
Matriz de convolucin (V)
Caso especial: w
i
=w
j
, i,j
Algoritmo en 4 etapas:
x +x 0 1
x +x 3 4
x +x 6 7
x +x + x
0 x +x + x
6 7
1
8
2
x +x + x 0 1 2
x +x + x 3 4 5
x +x + x
3 x +x + x
6 7
4
8
5
x +x + x 0 1 2
x +x + x 0 1 2
x +x + x 6 7 8
x +x + x 0 1 2
5 4 3 x +x + x
8 7 6 x +x + x
Matriz de convolucin (VI)
Transformada de Fourier
Obtiene el espectro frecuencial de una
seal peridica.
50 100 150 200 250
2
4
6
8
50 100 150 200 250
-1.5
-1
-0.5
0.5
1
1.5
Transformada de Fourier (II)
Se define como:



= dt e t x f X
ift t 2
) ( ) (
Y para el caso continuo:

=
|
.
|

\
|

=
1
0
2
1
N
j
N
jk
i
j k
e x
N
X
t
Transformada de Fourier (III)
Una imagen, en este contexto, es una seal discreta bidimensional. Por tanto,
para calcular la transformada utilizamos la siguiente funcin:

=
|
.
|

\
|
+
=
1
0
1
0
2
N
j
M
k
M
km
N
jl
i
jk lm
e x X
t
Transformada de Fourier (IV)
Algoritmo secuencial (caso
unidimensional):

for (k=0; k<N;k++)
X[k] = 0;
for (j=0; j<N; j++)
X[k] = X[k] + w
jk
x[j];

Orden (N
2
)

Transformada rpida
Es un algoritmo divide y vencers:

=
=
1
0
1
N
j
jk
j k
w x
N
X
( )
( )
( )
(

+ =

=
+
+

=
1 2 /
0
1 2
1 2
1 2 /
0
2
2
1
N
j
k j
j
N
j
jk
j k
w x w x
N
X
( ) ( )
(

+ =

=
+

=
1 2 /
0
2
1 2
1 2 /
0
2
2
2 /
1
2 /
1
2
1
N
j
jk
j
k
N
j
jk
j k
w x
N
w w x
N
X
Transformada rpida (II)
impar
k
par k
X w X X + =
2
1
Orden (N log(N))

( ) ( ) | | ( ) ( ) | | { } ( ) ( ) | | ( ) ( ) | | { }

+ + + + + + + = 15 , 7 11 , 3 13 , 5 9 , 1 10 , 6 10 , 2 12 , 4 8 , 0
k k k k k k k
k
w w w w w w w x
( ) ( ) { } ( ) ( ) { }

+ + + = 15 , 11 , 7 , 3 13 , 9 , 5 , 1 14 , 10 , 6 , 2 12 , 8 , 4 , 0
k k k
k
w w w x
( ) ( )

+ = 15 , 13 , 11 , 9 , 7 , 5 , 3 , 1 14 , 12 , 10 , 8 , 6 , 4 , 2 , 0
k
k
w x
( )

= 15 , 14 , 13 , 12 , 11 , 10 , 9 , 8 , 7 , 6 , 5 , 4 , 3 , 2 , 1 , 0
k
x
0
1
x
2
x
3
x
4
x
5
x
6
x
7
x
8
x
9
x
10
x
11
x
12
x
13
x
14
x
15
x
7
X
12
X
15
14
13
X
X
X
11
10
9
8
X
X
X
X
X
6
5
4
3
2
X
X
X
X
1
0
X
Transformada rpida (III)
Algoritmos analizados.
1. Algoritmo Quick Hull.
2. Etiquetamiento.
3. Convolucin.
4. Transformada discreta de Fourier.
5. Transformada discreta del coseno.
6. Transformada Haar
Algoritmos analizados (II)
7. Entropa.
8. Operador de Sobel.
9. Funcin de calidad.
10. Filtraje espacial.
11. Procesamiento Individual por puntos.
12. Algoritmos genticos para
reconocimiento de imgenes.

Evaluacin De Algoritmos
Criterios 1 2 3 4 5 6 7 8 9 10 11 Total
Algoritmos
1 4 3 3 5 4 4 4 2 3 5 3 41
2 3 4 3 4 5 2 3 4 2 4 5 39
3 4 4 5 4 5 5 5 4 5 4 4 49
4 5 4 5 5 5 4 5 3 4 5 5 50
5 4 5 3 5 5 5 4 2 5 5 4 49
6 2 5 4 4 5 5 2 5 5 3 2 45
7 5 5 5 5 4 4 4 4 3 5 4 48
8 4 5 3 4 4 3 2 5 5 5 3 43
9 2 3 5 4 5 3 2 3 5 5 5 42
10 3 2 4 3 4 3 2 3 5 4 4 38
11 4 4 5 5 2 5 4 4 5 5 4 47
12 5 4 4 5 4 5 4 5 4 5 4 49
Algoritmo Seleccionado
Transformada discreta
de Fourier.

Bibliografa

Parallel programming. Barry Wilkinson,
Michael Allen. Prentice-Hall. 1999.

Parallel algorithms for digital image
processing, computer vision and neural
networks. Ioannis Pitas (Editor). John
Wiley & sons. 1993
Preguntas ???

Вам также может понравиться