Professional Documents
Culture Documents
Donde:
G, es la resolucin
n, es el nmero de bits
La matriz utilizada se lista a continuacin, con un rango de nmeros de 0 a 15, donde 0
se entiende como el color ms oscuro y el 15 como el color ms claro.
Daniel =[
8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15;
8 9 9 10 10 11 11 12 11 12 12 13 13 14 14 15;
9 0 0 10 11 11 0 0 15 0 0 12 13 0 14 14;
9 0 10 0 11 12 0 12 0 12 0 12 0 13 0 14;
10 0 11 0 12 12 0 11 12 13 0 11 0 0 0 13;
11 11 12 12 0 11 14 14 11 10 9 10 11 11 12 12;
11 11 12 0 12 0 13 0 0 9 0 0 14 0 11 0;
12 11 11 0 0 0 12 0 15 0 8 0 15 0 0 0;
12 12 11 0 12 0 11 0 14 14 13 0 15 0 11 0;
13 12 12 11 11 10 10 0 9 13 13 0 12 11 11 10;
8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15;
8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15;
8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15;
8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15;
8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15;
8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15]
Al computarlo en Matlab, se obtiene la siguiente imagen:
Y su histograma correspondiente, donde enlista la variacin de los valores es:
Despus se anula un color dentro de la matriz, se elige cambiar el 15 por 0, quedando
la imagen como se muestra a continuacin:
Y por consiguiente el histograma correspondiente donde se muestra su variacin es:
Como se puede notar, en el histograma es reemplazado el espacio 15, y notamos una
variacin a comparacin del primer histograma, donde hay una baja cantidad de
colores en el 1, y en el segundo histograma se nota un claro aumento del mismo.
Conclusiones
Para ser el inicio del tratamiento de imgenes, se pudieron apreciar varias cosas que
hacen ms clara la teora vista en clase, lo cual nos ayudar en muchos mbitos del
tratamiento de imgenes.
Tambin conocer como es una imagen en esencia, compuesta por una matriz de
dimensin variable, nos da un margen distinto de lo que se percibe en realidad.
Anexos
Se muestra a continuacin el cdigo utilizado en Matlab
%% Otras secuencias
close all;
%% Variables / Matrices
Daniel =[
8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15;
8 9 9 10 10 11 11 12 11 12 12 13 13 14 14 15;
9 0 0 10 11 11 0 0 15 0 0 12 13 0 14 14;
9 0 10 0 11 12 0 12 0 12 0 12 0 13 0 14;
10 0 11 0 12 12 0 11 12 13 0 11 0 0 0 13;
11 11 12 12 0 11 14 14 11 10 9 10 11 11 12 12;
11 11 12 0 12 0 13 0 0 9 0 0 14 0 11 0;
12 11 11 0 0 0 12 0 15 0 8 0 15 0 0 0;
12 12 11 0 12 0 11 0 14 14 13 0 15 0 11 0;
13 12 12 11 11 10 10 0 9 13 13 0 12 11 11 10;
8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15;
8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15;
8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15;
8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15;
8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15;
8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15]
%% Programa Principal
% hist (Daniel)
Daniel2 = Daniel;
Daniel3 = Daniel;
for i = 1:16
for j = 1 : 16
if (Daniel(i,j) == 15)
Daniel2(i,j)= abs(Daniel(i,j)-15);
end
end
end
% for i = 1:16
% for j = 1 : 16
% if (Daniel(i,j) == 14)
% Daniel3(17-i,j)= abs(Daniel(i,j)-15);
% end
% end
% end
figure
imshow(Daniel,[0,15])
figure
hist(Daniel)
figure
imshow(Daniel2,[0,15])
figure
hist(Daniel2)
% figure
% imshow(Daniel3,[0,15])
% figure
% hist(Daniel3)
Daniel4=rot90(Daniel);
figure
imshow(Daniel4)