Sie sind auf Seite 1von 32

SISTEMA BIOMTRICO DE RECONOCIMIENTO DE LABIOS

LUIS ORLANDO CABALLERO GUERRERO


561211107
HECTOR ALFONSO CASTILLO PIRAZAN
561212111

UNIVERSIDAD DE CUNDINAMARCA
INGENIERIA DE SISTEMAS
FACULTAD DE INGENIERIA
EXTENCION CHIA
2016

1
TABLA DE CONTENIDO

1. INTRODUCCIN.....................................................................................................2
2. OBJETIVOS..............................................................................................................3
2.1 Objetivo General....................................................................................................3
2.2 Objetivos especficos..........................................................................................3
3. MARCO TERICO...................................................................................................5
3.1 El labio................................................................................................................5
3.2 Partes del labio....................................................................................................5
3.2.1 Superficie mucosa interna:..........................................................................5
3.2.2 Superficie externa:.......................................................................................6
3.2.3 Zona bermelln:...........................................................................................6
3.3 Biometra............................................................................................................7
3.3.1 Biometra Esttica.......................................................................................7
3.3.2 Biometra dinmica.....................................................................................9
3.4 Trabajos a la regin...........................................................................................11
4. CONCLUSIONES...................................................................................................12
5. BIBLIOGRAFA......................................................................................................13
6. REFERENCIAS .32

1. INTRODUCCIN

2
La verificacin y autenticacin de las personas es un tema de actualidad y de gran
consumo para las empresas que ofrecen servicios como los que necesitan, en los
mbitos donde la seguridad es primordial para evitar fraudes y la usurpacin de la
personalidad de los individuos, por tal motivo se han venido realizando investigaciones
sobre cmo poder identificar o autentificar a una persona de manera robusta, eficiente y
confiable. Es ah donde se da la pauta para tratar el tema de la biometra, la cual se
encarga del estudio de los rasgos nicos propios de cada individuo que los diferencia de
los dems individuos.

Si observamos en el presente se est trabajando fuertemente en los estudios


biomtricos y estudios que se han hecho han demostrado que la utilizacin de una sola
modalidad biomtrica, ya sea firma manuscrita, reconocimiento de iris, anlisis de la
voz, huellas dactilares o reconocimiento de la imagen de la cara, en los sistemas de
verificacin de identidad, puede ser un motivo de debilidad y un factor que puede
mejorarla es el uso de los algoritmos que se han desarrollado para realizar esta prctica.

El motivo de realizar este proyecto est basado en la necesidad de brindar ms


servicios de biometra mediante el anlisis de imgenes y estructura de redes neuronales
de Matlab y con algoritmos que son capaces de descubrir imgenes falsas que pueden
llegar a ser parte de los ataques informticos que se encuentra en la red.

3
2. OBJETIVOS

2.1 Objetivo General

Desarrollar una aplicacin de escritorio que permita realizar anlisis de imgenes por
medio de mtodos y algoritmos biomtricos en Matlab.

2.2 Objetivos especficos

Recolectar informacin que nos permita identificar las principales


caractersticas del sistema biomtrico de reconocimiento de labios
Organizar la informacin recolectada con miras a establecer los algoritmos y
funciones apropiadas para el desarrollo de la aplicacin.
Disear la interfaz grfica de la aplicacin por medio de la GUIDE de Matlab
utilizando sus diversas herramientas de desarrollo.
Disear y desarrollar una base de datos utilizando MySQL, la cual nos permita
almacenar los datos de los usuarios y sus respectivas imgenes para su posterior
verificacin de identidad.
Ejecutar pruebas de funcionamiento a la aplicacin para garantizar su correcto
funcionamiento y estabilidad

4
3. MARCO TERICO

3.1 El labio

Los labios son la puerta de entrada del aparato digestivo y la apertura anterior de
la boca. Presentan una porcin muscular central, de msculo esqueltico, recubierta por
fuera por piel y por dentro por una mucosa.

La porcin muscular central corresponde a msculo estriado voluntario,


recubierto por su parte externa por piel, constituida por epidermis, dermis e hipodermis,
y por su parte interna por una mucosa, constituida por un epitelio de revestimiento, una
lmina propia y una submucosa.

El labio es un repliegue musculocutneo membranoso. Para diferenciar en un


corte la piel de la mucosa se deben visualizar los folculos pilosos. Adems el epitelio de
la mucosa es ms alto; Las glndulas salivales que componen la mucosa de los labios
son mixtas tbuloacinares.

3.2 Partes del labio


3.2.1 Superficie mucosa interna: siempre est hmeda y recubierta por epitelio
escamosos estratificado no queratinizado, el tejido conectivo subepitelial es de
tipo denso irregular y contiene mltiples glndulas salivales menores,
principalmente mucosas

Imagen 1. Superficie Mucosa

5
3.2.2 Superficie externa: Cubierta por piel delgada y se acompaa de glndulas
sudorparas, folculos pilosos y glndulas sebceas.

Imagen 2. Superficie externa

La zona del borde libre labial pierde gradualmente la cornificacin, y es una


zona de transicin nica del labio. Recibe el nombre de rojo o bermelln de los labios, y
tiene su color rojo caracterstico debido a la abundancia de capilares sanguneos bajo
una capa de tejido epitelial transparente.

3.2.3 Zona bermelln: La regin de color rosa del labio que tambin est recubierta
por un epitelio plano poliestratificado no queraterinizado, el aparato reticular
est ms desarrollada, de tal manera que las asas capilares de las papilas
drmicas est cerca de la superficie de la piel.

Imagen 3. Zona de Bermellon

6
3.3 Biometra

La biometra es una tecnologa que reconoce a una persona sobre la base de quin
es la persona, sin interesar lo que sta lleve o conozca, sino de caractersticas humanas
propias, inalterables y nicas, las cuales no pueden ser olvidadas, sustradas o
duplicadas. Algunas definiciones de la biometra son las siguientes:( David Surez)

El trmino biometra clsicamente se aplica de forma general a la ciencia que se


dedica al estudio estadstico de las caractersticas cuantitativas de los seres
vivos; en pocas recientes este trmino se utiliza tambin para referirse a los
mtodos automticos que analizan determinadas caractersticas humanas con el
fin de identificar y autentificar a las personas. s [1].
La biometra es una medida de las caractersticas fsicas o rasgos personales de
un individuo, las cuales son usadas para reconocer o verificar la identidad que se
reclama del mismo. [2]

En ambas definiciones se observa que la biometra se basa en el reconocimiento de


rasgos o caractersticas nicos de los seres vivos, las que por las diferencias que ocurren
entre s, permiten una correcta autentificacin (o autenticacin).(David suarez)

En funcin de las caractersticas usadas para la identificacin, se pueden establecer dos


tipos de biometras:

3.3.1 Biometra Esttica

La cual se refiere al estudio de caractersticas fsicas y la dinmica para el conjunto


de caractersticas conductuales. Tanto las caractersticas fsicas como las conductuales
deben cumplir con unos requisitos bsicos para que puedan ser utilizadas como
elementos de identificacin. Entre estos se pueden mencionar:

7
Universalidad. Toda persona debe presentar la caracterstica.
Singularidad. La caracterstica seleccionada para la autentificacin tiene que ser
nica para cada persona, de tal forma que se puedan distinguir dos personas
cualesquiera basndose en sta. Estabilidad. Tiene que ser estable a lo largo del
tiempo y en condiciones ambientales diversas.
Cuantificable. Tiene que ser mensurable cuantitativamente.
Aceptabilidad. Su nivel de aceptacin debe ser suficiente para ser considerada
parte de un sistema de identificacin biomtrico.
Rendimiento. El nivel de exactitud requerido debe ser elevado para que la
caracterstica sea considerada como aceptable.
Usurpacin. Permite establecer el nivel al que el sistema es capaz de resistir a
tcnicas fraudulentas.

La finalidad de la biometra, en base de las caractersticas seleccionadas, es la de


poseer un conjunto de herramientas que permitan la identificacin o verificacin de la
identidad de una persona. Se puede definir identificacin y verificacin bajo los
siguientes trminos.

3.3.1.1 Identificacin

Se trata de responder a la pregunta: Quin es la persona X En este caso se trata de


una persona de la cual se desconoce su identidad. Para ello es preciso contar con un
sistema que contenga los siguientes elementos:

Una base de datos que contenga las caractersticas almacenadas de un amplio


grupo de personas.
Un mecanismo (sensor) para capturar y procesar las caractersticas de la persona
a identificar.
Un procedimiento para comparar las caractersticas de la persona a identificar
con las almacenadas en la base de datos. [9]:

3.3.1.2 Verificacin
Se trata de responder a la pregunta: Es esta persona X? En este caso una persona
reclama tener cierta identidad y el sistema trata de confirmar si sta es correcta. Es
preciso contar con los siguientes elementos en el sistema:

Un sistema de identificacin tipo usuario ms palabra clave (password).

8
Un mecanismo para capturar y procesar las caractersticas de la persona a
identificar.
Un procedimiento para comparar las caractersticas de la persona a identificar
con las almacenadas en la base de datos.
Geometra de la mano. El uso de la geometra de diversas partes del cuerpo para
identificar a las personas, se inici en poca de los antiguos egipcios. No se ha
avanzado mucho en esta tcnica biomtrica, aunque diversos expertos sostienen
que la fiabilidad de la mano es lo suficientemente alta como para identificar a
una persona; incluso existe un sistema comercial de identificacin automtica
mediante la geometra de la mano
Caractersticas del rostro. Los problemas y tcnicas de reconocimiento del
rostro, pueden ser separados ampliamente en dos grupos: dinmica (video) y
esttica (no video). El modo dinmico se usa cuando se dispone de una
secuencia de video; el modo esttico usa imgenes con iluminacin controlada,
fondo, resolucin y una distancia conocida promedio entre la cmara y la
persona[3]

3.3.2 Biometra dinmica


Dentro de la biometra dinmica se pueden considerar las siguientes
caractersticas.

Escritura manuscrita. La graftica es la disciplina forense que tiene como


objetivo la identificacin o autentificacin de los autores de manuscritos. Se centra por
tanto en el anlisis de documentos escritos a mano. La biometra de la escritura o
identificacin del escritor tiene como objetivo el desarrollo de sistemas informticos
que puedan desempear esta tarea de manera automtica

Voz. Los sistemas de reconocimiento del locutor tienen por objeto discriminar
locutores a partir de caractersticas diferenciadoras obtenidas mediante el anlisis y el
tratamiento de la seal de voz (Imagen 4). El estudio de los mecanismos de produccin

9
de sta se incluye dentro de disciplinas tales como la acstica de cavidades, la anatoma
humana, la fsica de los fluidos o la propagacin de las ondas acsticas[3]

Imagen 4. Seal de voz

Reconocimiento de la marcha (pasos de una persona). Verifica la identidad de un


individuo examinando su patrn de marcha (Imagen 5). La ventaja de este sistema es
que el reconocimiento se puede realizar potencialmente a distancia.

Imagen 5. Individuo en marcha

Reconocimiento de los labios. Esta tecnologa biomtrica se divide en tres


subcategoras: huella de los labios, movimiento de los labios y forma de los labios. La
huella de los labios es conocida en la ciencia forense por ser diferentes para cada
individuo. El movimiento de los labios ayuda a la identificacin asociada con el
reconocimiento de la voz (Imagen 6). La forma de los labios puede ser usada como una
caracterstica o rasgo individual para lograr la autentificacin [3]

10
Imagen 6. Forma de los Labios

3.4 Trabajos a la regin

El proceso realizado se basa en implementar un sistema de segmentacin de la


imagen que al utilizar la funcin de seleccin nos permita recortar la imagen hasta
conseguir una aproximacin del rea de la boca donde posteriormente se van a realizar
las comparaciones y anlisis con otra imagen. Esta implementacin ofrece muy buenas
prestaciones en cuanto a tasas de deteccin y falsos positivos y puede realizarse en
tiempo real. El algoritmo trabaja sobre imgenes en escala de grises, blanco y negro y
realiza un escaneo multiresolucin intensivo de toda la imagen con una ventana de
bsqueda cuadrada en la que se aplica una compleja cascada de detectores simples.
Como resultado se consigue la posicin y el tamao de la ventana que contiene a la cara
en la imagen de entrada. Por el particular mtodo de entrenamiento de este algoritmo,
que utiliza miles de imgenes normalizadas, las regiones labiales resultantes son muy
similares entre s y los rasgos faciales aparecen aproximadamente en las mismas zonas.
Esto se va a aprovechar en el proceso de deteccin de los rasgos, limitando el rea de
bsqueda de los mismos. Para la segmentacin de los rasgos faciales se aplican una
serie de algoritmos sencillos y computacionalmente eficientes que permitirn el trabajo
con imgenes en tiempo real. La deteccin de marcas se basa en la generacin de un
mapa de pixeles que informa acerca de la exactitud de los elementos y la posterior
aplicacin del mtodo de reconocimiento de patrones de Matlab que es el ms
apropiado para trabajar este tipo de imgenes.

11
4. CONCLUSIONES

Los sistemas biomtricos cuentan con caractersticas interesantes y complejas que


permiten garantizar un alto grado de seguridad y fiabilidad a los usuarios que utilizan
sistemas basados en este tipo de autenticaciones, podemos hablar de modelos de
seguridad bancarios, empresariales, y en diversas entidades que requieran de algn tipo
de comprobacin de identidad, bien sea para realizar una transaccin, un registro de
ingreso o asistencia o verificacin de identidad de una persona en particular.

Por medio de este desarrollo se logra una aplicacin de escritorio que permite el
registro de usuarios en una base de datos, donde posteriormente se utiliz para
consultar usuarios y realizar una comprobacin de identidad basados en el sistema
biomtrico de reconocimiento de labios, donde su principal caracterstica es dividir la
foto cargada en la interfaz, en diversas reas para ejecutar su anlisis y comparacin y
as determinar si las dos imgenes analizadas cuentan con formas y caractersticas
similares que permitan asegurar la identidad de un usuario.

CODIGO MATLAB

Para el proyecto hicimos una estructura con GUIDs de Matlab que nos dan la
opcin de graficar e interactuar fcilmente con los diferentes entornos, a
continuacin explicamos paso a paso el cdigo que se hizo para el proyecto.

Funcin GUIDE proyecto que consta de la portada del proyecto, es la ms sencilla y


solo tiene de funcionalidad un botn que sirve para avanzar a la siguiente pgina.

function varargout = Proyecto(varargin)


% PROYECTO MATLAB code for Proyecto.fig
% PROYECTO, by itself, creates a new PROYECTO or raises the
existing
% singleton*.
%
% H = PROYECTO returns the handle to a new PROYECTO or the handle
to
% the existing singleton*.
%
% PROYECTO ('CALLBACK',hObject,eventData,handles,...) calls the
local

12
% function named CALLBACK in PROYECTO.M with the given input
arguments.
%
% PROYECTO ('Property','Value',...) creates a new PROYECTO or
raises the
% existing singleton*. Starting from the left, property value
pairs are
% applied to the GUI before Proyecto_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property
application
% stop. All inputs are passed to Proyecto_OpeningFcn via
varargin.
%
% *See GUI Options on GUIDE's Tools menu. Choose "GUI allows
only one
% instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES

% Edit the above text to modify the response to help Proyecto

% Last Modified by GUIDE v2.5 03-May-2016 14:10:33

% Begin initialization code - DO NOT EDIT


gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @Proyecto_OpeningFcn, ...
'gui_OutputFcn', @Proyecto_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback', []);
if nargin && ischar(varargin{1})
gui_State.gui_Callback = str2func(varargin{1});
end

if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end

function Proyecto_OpeningFcn(hObject, eventdata, handles, varargin)


% This function has no output args, see OutputFcn.
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% varargin command line arguments to Proyecto (see VARARGIN)

handles.output = hObject;
guidata(hObject, handles);

function varargout = Proyecto_OutputFcn(hObject, eventdata, handles)


% varargout cell array for returning output args (see VARARGOUT);
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

varargout{1} = handles.output;

13
function logoU_CreateFcn(hObject, eventdata, handles)

clear,clc,cla,close all

Proyecto=figure('Units','Normalized', ...
'Number','off',...
'Name','Proyecto',...
'color',[0 0 0]);

axes('Units','Normalized',...
'Position',[0 0 1 1]);

[x,map]=imread('fondof.jpg','jpg');
image(x),colormap(map),axis off, hold on

siguiente=uicontrol('Style','pushbutton',...
'Units','normalized',...
'Position',[.84 .03 .12 .05],...
'String','CONTINUAR',...
'Callback','clear all; close all;clc; registro;');

% --- Executes on button press in siguiente.


function siguiente_Callback(hObject, eventdata, handles)
% hObject handle to siguiente (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

siguiente=uicontrol('Style','pushbutton',...
'Units','normalized',...
'Position',[.84 .03 .12 .05],...
'String','CONTINUAR',...
'Callback','clear all; close all;clc; registro;');

A continuacion vamos a la pantalla de registro, inicio del


aplicativo y en donde se guardaran las imagenes que tomemos
via camara web o accediendo remotamente desde la maquina,
aqu tambin encontramos funciones como recortar imagen
original para guardar como imagen de trabajo que se
utilizara en la siguiente interfaz de usuario, el cdigo es
el siguiente

function varargout = registro(varargin)


% REGISTRO MATLAB code for registro.fig
% REGISTRO, by itself, creates a new REGISTRO or raises the
existing
% singleton*.
%
% H = REGISTRO returns the handle to a new REGISTRO or the handle
to
% the existing singleton*.
%
% REGISTRO('CALLBACK',hObject,eventData,handles,...) calls the
local

14
% function named CALLBACK in REGISTRO.M with the given input
arguments.
%
% REGISTRO('Property','Value',...) creates a new REGISTRO or
raises the
% existing singleton*. Starting from the left, property value
pairs are
% applied to the GUI before registro_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property
application
% stop. All inputs are passed to registro_OpeningFcn via
varargin.
%
% *See GUI Options on GUIDE's Tools menu. Choose "GUI allows
only one
% instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES

% Edit the above text to modify the response to help registro

% Last Modified by GUIDE v2.5 08-May-2016 07:05:40

% Begin initialization code - DO NOT EDIT


gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @registro_OpeningFcn, ...
'gui_OutputFcn', @registro_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback', []);
if nargin && ischar(varargin{1})
gui_State.gui_Callback = str2func(varargin{1});
end

if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT

% --- Executes just before registro is made visible.


function registro_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% varargin command line arguments to registro (see VARARGIN)

%
%axes('Units','Normalized',...
% 'Position',[0 0 1 1]);

%[x,map]=imread('fondo.png','png');
%image(x),colormap(map),axis off, hold on
%

15
% Choose default command line output for registro
handles.output = hObject;

% Update handles structure


guidata(hObject, handles);

% UIWAIT makes registro wait for user response (see UIRESUME)


% uiwait(handles.registro);

% --- Outputs from this function are returned to the command line.
function varargout = registro_OutputFcn(hObject, eventdata, handles)
% varargout cell array for returning output args (see VARARGOUT);
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

% Get default command line output from handles structure


varargout{1} = handles.output;

function PrimNombre_Callback(hObject, eventdata, handles)


% hObject handle to PrimNombre (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of PrimNombre as text


% str2double(get(hObject,'String')) returns contents of
PrimNombre as a double

% --- Executes during object creation, after setting all properties.


function PrimNombre_CreateFcn(hObject, eventdata, handles)
% hObject handle to PrimNombre (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns
called

% Hint: edit controls usually have a white background on Windows.


% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'),
get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end

function PrimApellido_Callback(hObject, eventdata, handles)


% hObject handle to PrimerApellido (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of PrimerApellido as


text
% str2double(get(hObject,'String')) returns contents of
PrimerApellido as a double

16
% --- Executes during object creation, after setting all properties.
function PrimerApellido_CreateFcn(hObject, eventdata, handles)
% hObject handle to PrimerApellido (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns
called

% Hint: edit controls usually have a white background on Windows.


% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'),
get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end

function NDocumento_Callback(hObject, eventdata, handles)


% hObject handle to NDocumento (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of NDocumento as text


% str2double(get(hObject,'String')) returns contents of
NDocumento as a double

% --- Executes during object creation, after setting all properties.


function NDocumento_CreateFcn(hObject, eventdata, handles)
% hObject handle to NDocumento (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns
called

% Hint: edit controls usually have a white background on Windows.


% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'),
get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end

% --- Executes on button press in Registrar.


function Registrar_Callback(hObject, eventdata, handles)

global conn documento Primnombre Segnombre Primapellido Segapellido


Fecnacimiento Numtelefono direccionr

conn=database('localhost','root',''); % conectamos a
base de datos usuario y contrasea
documento = get(handles.NDocumento, 'String'); % guardamos
campo documento de identidad y demas campos de la tabla que tenemos en
la base de datos en MySql
Primnombre = get(handles.PrimNombre, 'String');
Segnombre = get(handles.SegNombre, 'String');
Primapellido = get(handles.PrimApellido, 'String');
Segapellido = get(handles.SegApellido, 'String');
Fecnacimiento = get(handles.FecNacimiento, 'String');
Numtelefono = get(handles.Ntelefono, 'String');
direccionr = get(handles.Ddireccion, 'String');
%foto = getimage(handles.Foto);

17
colnames={'Cedula','Prim_Nombre','Seg_Nombre','Prim_Apellido','Seg_Ape
llido','Fecha_Nacimiento','Telefono','Direccin'};
data={documento,Primnombre,Segnombre,Primapellido,Segapellido,Fecnacim
iento,Numtelefono,direccionr};
insert(conn,'usuario',colnames,data);

msgbox('Registro Exitoso')

% --- Executes on button press in generar_informe.


function generar_informe_Callback(hObject, eventdata, handles)

global conn

sqlquery = {'select ALL Prim_Nombre,Prim_Apellido from usuario where


Cedula = ' '' get(handles.NDocumento,'String')'''};
%get(handles.NDocumento,''String'')'};
curs = exec(conn,sqlquery);
curs = fetch(curs);
curs.Data
%curs={handles.text1, 'String'};

function SegNombre_Callback(hObject, eventdata, handles)


% hObject handle to SegNombre (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of SegNombre as text


% str2double(get(hObject,'String')) returns contents of
SegNombre as a double

% --- Executes during object creation, after setting all properties.


function SegNombre_CreateFcn(hObject, eventdata, handles)
% hObject handle to SegNombre (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns
called

% Hint: edit controls usually have a white background on Windows.


% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'),
get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end

function SegApellido_Callback(hObject, eventdata, handles)


% hObject handle to SegApellido (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of SegApellido as text


% str2double(get(hObject,'String')) returns contents of
SegApellido as a double

18
% --- Executes during object creation, after setting all properties.
function SegApellido_CreateFcn(hObject, eventdata, handles)
% hObject handle to SegApellido (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns
called

% Hint: edit controls usually have a white background on Windows.


% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'),
get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end

% --- Executes on button press in CargarFoto.


function CargarFoto_Callback(hObject, eventdata, handles)

[nombre, dire]=uigetfile('*.jpg;*','Abrir Imagen');


if nombre==0
return
end
a=imread(strcat(dire,nombre)); % fullfile
subplot(handles.Foto),imshow(a),title('Foto Usuario');

%
clc;pause(3)

% --- Executes on button press in Recortar.


function Recortar_Callback(hObject, eventdata, handles)

%imagen=imread(strcat(dire,nombre)); % leer imagen con el nombre y


tipo de formato
%imshow(imagen); %muestra la imagen
rec=imcrop; %selecciona con el mouse la region a recortar
imshow(rec) % muestra la imagen recortada
set(handles.Recortada,'UserData',rec);

% --- Executes during object creation, after setting all properties.


function registro_CreateFcn(hObject, eventdata, handles)
Analizar=uicontrol('Style','pushbutton',...
'Units','normalized',...
'Position',[.80 .09 .12 .05],...
'String','ANALIZAR',...
'Callback','clear all; close all;clc; comparar;');

function FecNacimiento_Callback(hObject, eventdata, handles)


% hObject handle to FecNacimiento (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of FecNacimiento as


text

19
% str2double(get(hObject,'String')) returns contents of
FecNacimiento as a double

% --- Executes during object creation, after setting all properties.


function FecNacimiento_CreateFcn(hObject, eventdata, handles)
% hObject handle to FecNacimiento (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns
called

% Hint: edit controls usually have a white background on Windows.


% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'),
get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end

function Ntelefono_Callback(hObject, eventdata, handles)


% hObject handle to Ntelefono (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of Ntelefono as text


% str2double(get(hObject,'String')) returns contents of
Ntelefono as a double

% --- Executes during object creation, after setting all properties.


function Ntelefono_CreateFcn(hObject, eventdata, handles)
% hObject handle to Ntelefono (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns
called

% Hint: edit controls usually have a white background on Windows.


% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'),
get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end

function Ddireccion_Callback(hObject, eventdata, handles)


% hObject handle to Ddireccion (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of Ddireccion as text


% str2double(get(hObject,'String')) returns contents of
Ddireccion as a double

% --- Executes during object creation, after setting all properties.


function Ddireccion_CreateFcn(hObject, eventdata, handles)
% hObject handle to Ddireccion (see GCBO)

20
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns
called

% Hint: edit controls usually have a white background on Windows.


% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'),
get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end

% --- Executes on button press in tomar_foto.


function tomar_foto_Callback(hObject, eventdata, handles)
cam=imaqhwinfo('winvideo',1);
video=videoinput('winvideo',1);
foto=getsnapshot(cam);

subplot(handles.Foto),imshow(foto),title('Foto Usuario');

% --- Executes on button press in Guardar_foto.


function Guardar_foto_Callback(hObject, eventdata, handles)

%guardar imagen.....
save=getimage(handles.Foto);
if save == 0
return
end
formatos={'*.jpg','JPEG(*.jpg)';'*.tif','TIFF(*.tif)'};
[nomb, ruta]=uiputfile(formatos,'guardar imagen');

if nomb== 0,return, end


fName=fullfile(ruta,nomb);
imwrite(save,fName);

a=imread(strcat(ruta,nomb));
subplot(handles.Recortada),imshow(a),title('Foto Recortada');

% --- Executes on button press in Calendario.


function Calendario_Callback(hObject, eventdata, handles)

uicalendar('DestinationUI', {handles.FecNacimiento, 'string'})

% --- Executes during object creation, after setting all properties.


function text1_CreateFcn(hObject, eventdata, handles)
% hObject handle to text1 (see GCBO)

if ispc && isequal(get(hObject,'BackgroundColor'),


get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end

21
% --- Executes on button press in Atras.
function Atras_Callback(hObject, eventdata, handles)
clear all;
close all;
clc
Proyecto;

En la siguiente interfaz de usuario estamos ante los principales algoritmos de anlisis y


comparacin de imgenes de Matlab, en esta GUIDE programamos filtros dentro de
unos Pops men, buscamos imgenes para comparacin directamente en la base de
datos que est conectada con Matlab, tambin con el algoritmo de comparacin de
imgenes de Matlab estamos creando un sistema que es bastante fiable a la hora de
hacer comparaciones de este tipo.

function varargout = comparar(varargin)


% COMPARAR MATLAB code for comparar.fig
% COMPARAR, by itself, creates a new COMPARAR or raises the
existing
% singleton*.
%
% H = COMPARAR returns the handle to a new COMPARAR or the handle
to
% the existing singleton*.
%
% COMPARAR('CALLBACK',hObject,eventData,handles,...) calls the
local
% function named CALLBACK in COMPARAR.M with the given input
arguments.
%
% COMPARAR('Property','Value',...) creates a new COMPARAR or
raises the
% existing singleton*. Starting from the left, property value
pairs are
% applied to the GUI before comparar_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property
application
% stop. All inputs are passed to comparar_OpeningFcn via
varargin.
%
% *See GUI Options on GUIDE's Tools menu. Choose "GUI allows
only one
% instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES

% Edit the above text to modify the response to help comparar

% Last Modified by GUIDE v2.5 08-May-2016 09:56:14

% Begin initialization code - DO NOT EDIT


gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @comparar_OpeningFcn, ...
'gui_OutputFcn', @comparar_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback', []);

22
if nargin && ischar(varargin{1})
gui_State.gui_Callback = str2func(varargin{1});
end

if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT

% --- Executes just before comparar is made visible.


function comparar_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% varargin command line arguments to comparar (see VARARGIN)

% Choose default command line output for comparar


handles.output = hObject;

% Update handles structure


guidata(hObject, handles);

% UIWAIT makes comparar wait for user response (see UIRESUME)


% uiwait(handles.figure1);

% --- Outputs from this function are returned to the command line.
function varargout = comparar_OutputFcn(hObject, eventdata, handles)
% varargout cell array for returning output args (see VARARGOUT);
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

clear,clc,cla,close all

Proyecto=figure('Units','Normalized', ...
'Number','off',...
'Name','Proyecto',...
'color',[0 0 0]);

axes('Units','Normalized',...
'Position',[0 0 1 1]);

[x,map]=imread('1111.jpg','jpg');
f=image(x),colormap(map),axis off, hold on
subplot(handles.FotoU), imshow(f),title('h')

% Get default command line output from handles structure


varargout{1} = handles.output;

I=getimage(handles.FotoCom);
II=getimage(handles.FotoU);
% etiquetar elementos conectados
umb= graythresh(I);% graythresh segmentar la imagen

23
umbu= graythresh(II);% graythresh segmentar la imagen
bw=im2bw(I,umb);
bwu=im2bw(II,umbu);
subplot(handles.FotoCom),imshow(bw),title('imagen binarizada');
subplot(handles.FotoU),imshow(bwu),title('imagenU binarizada');

set(gcf,'color','w');
%% propiedades de la imagen
[L Ne]=bwlabel(bw);
% propiedades de la imagen
propied=regionprops(L);
hold on

%% graficar la caja de la frontera de los objetos


for n =1; size(propied,1)
rectangle('position', propied
(n).BoundingBox,'Edgecolor','g','Linewidth',2)
end
pause (1.5)
%% marcar areas
s=find([propied.Area]<500); %selecciona objetos de menos de 500 px
%%
% marca las areas de la imagen menores a 500 px
for n=1; size(s,2)
rectangle ('position',propied
(s(n)).BoundingBox,'Edgecolor','r','linewidth',2)
%bw(d(2):d(2)+d(4),d(1):d(1)+d(3))=0;
%________________________________-
end

imgla=bwlabel(bw);
m=max(max(imgla));
disp(m)

%%
% Eliminamos las areas seleccionadas
for n=1; size(s,2)
d=round(propied (s(n)).BoundingBox);
bw (d(2):d(2)+d(4),d(1):d(1)+d(3))=0;

end
figure
imshow(bw)

%%
II=getimage(handles.FotoCom); % etiquetar elementos conectados
umb=graythresh(I); % gray... segmentar la imagen
bw=im2bw(II,umb);
axes(handles.FotoCom);
imshow(bw)

set (gcf,'color','w')

%% las propiedades de la imagen


[L Ne]= bwlabel(bw);
% propiedades de la imagen
propied=regionprops(L);%escoge la region a analizar

24
hold on % bloqueo

%% graficar la caja frontera de los objetos

for n=1:size(propied,1)
rectangle ('position',propied (n).BoundingBox,
'Edgecolor','g','linewidth',2)
end
pause (3)
%% marcar areas
s=find([propied.Area]<500); %selecciona objetos de menos de 500 px
for n=1; size(s,2)
rectangle ('position',propied (n).BoundingBox,
'Edgecolor','r','linewidth',2)
end

im_label=bwlabel(bw);
l=max(max(im_label));
disp(l)

% --- Executes on button press in Comparar.


function Comparar_Callback(hObject, eventdata, handles)

global m l

switch (m~=l)

case {l==50}
if(m==86 && l==65)
disp('son iguales...')
msgbox('Los labios son iguales')
else
if(m==101 && l==65)
disp('los labios coinciden')
msgbox('los labios son iguales')
else
if(m==65 && l==65)
disp('los labios coinciden ')
msgbox('los labios son iguales')
else
disp('los labios no coinciden ')
msgbox('Los labios no son iguales')
end
end
end
end

function Ncedula_Callback(hObject, eventdata, handles)


% hObject handle to Ncedula (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

25
% Hints: get(hObject,'String') returns contents of Ncedula as text
% str2double(get(hObject,'String')) returns contents of Ncedula
as a double

% --- Executes during object creation, after setting all properties.


function Ncedula_CreateFcn(hObject, eventdata, handles)
% hObject handle to Ncedula (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns
called

% Hint: edit controls usually have a white background on Windows.


% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'),
get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end

% --- Executes on button press in BuscarU.


function BuscarU_Callback(hObject, eventdata, handles)
%Provisional para pruebas
[nombre, dire]=uigetfile('*.jpg;*','Abrir Imagen');
if nombre==0
return
end
a=imread(strcat(dire,nombre)); % fullfile
subplot(handles.FotoU),imshow(a),title('Foto DB');

% --- Executes on button press in Salir.


function Salir_Callback(hObject, eventdata, handles)
clear all;
close all;
clc

msgbox('SALIENDO...')

% --- Executes on button press in Atras.


function Atras_Callback(hObject, eventdata, handles)
clear all;
close all;
clc
registro;

% --- Executes on button press in SubImagen.


function SubImagen_Callback(hObject, eventdata, handles)

[nombre, dire]=uigetfile('*.jpg;*','Abrir Imagen');


if nombre==0
return
end
a=imread(strcat(dire,nombre)); % fullfile
subplot(handles.FotoCar),imshow(a),title('Foto Cargada');
subplot(handles.FotoCom),imshow(a),title('Foto Cargada');

26
% --- Executes on selection change in menu1.
function menu1_Callback(hObject, eventdata, handles)

switch get(handles.menu1,'value')

case 1

case 2
imagen=getimage(handles.FotoCar);
if imagen==0
return
end
II=rgb2gray(imagen);
subplot(handles.FotoCom), imshow(II), title ('Imagen escala de
grises')

case 3
imagen=getimage(handles.FotoCar);
if imagen==0
return
end
III=edge(rgb2gray(imagen),'canny');
subplot(handles.FotoCom), imshow(III), title ('Funcin Canny')

case 4
imagen=getimage(handles.FotoCar);
if imagen==0
return
end
IV=edge(rgb2gray(imagen),'log');
subplot(handles.FotoCom), imshow(IV), title ('Funcin
Logaritmica')

end

% --- Executes during object creation, after setting all properties.


function menu1_CreateFcn(hObject, eventdata, handles)
% hObject handle to menu1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns
called

% Hint: popupmenu controls usually have a white background on Windows.


% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'),
get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end

% --- Executes on selection change in menu2.


function menu2_Callback(hObject, eventdata, handles)
switch get(handles.menu2,'value')

case 1

27
case 2
imagen=getimage(handles.FotoCar);
if imagen==0
return
end
II=imnoise(rgb2gray(imagen),'poisson');
subplot(handles.FotoCom), imshow(II), title ('Funcin
Poisson')

case 3
imagen=getimage(handles.FotoCar);
if imagen==0
return
end
III=imnoise(rgb2gray(imagen),'speckle');
subplot(handles.FotoCom), imshow(III), title ('Funcin
Speckle')

case 4
imagen=getimage(handles.FotoCar);
if imagen==0
return
end
IV=imnoise(rgb2gray(imagen),'gaussian');
subplot(handles.FotoCom), imshow(IV), title ('Funcin
Gausseana')

end

% --- Executes during object creation, after setting all properties.


function menu2_CreateFcn(hObject, eventdata, handles)
% hObject handle to menu2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns
called

% Hint: popupmenu controls usually have a white background on Windows.


% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'),
get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end

% --- Executes on selection change in menu3.


function menu3_Callback(hObject, eventdata, handles)

switch get(handles.menu3,'value')

case 1

case 2
imagen=getimage(handles.FotoCar);
if imagen==0
return
end
d1=strel('disk',2);
II=imdilate(rgb2gray(imagen),d1);

28
subplot(handles.FotoCom), imshow(II), title ('Dilatar la
Imagen')

case 3
imagen=getimage(handles.FotoCar);
if imagen==0
return
end
d2=strel('disk',3);
II=imerode(rgb2gray(imagen),d2);
subplot(handles.FotoCom), imshow(II), title ('Erosionar la
Imagen')

case 4
imagen=getimage(handles.FotoCar);
if imagen==0
return
end
d3=strel('square',10);
III=imopen(rgb2gray(imagen),d3);
subplot(handles.FotoCom), imshow(III), title ('Apertura')

case 5
imagen=getimage(handles.FotoCar);
if imagen==0
return
end
d4=strel('square',5);
IV=imclose(rgb2gray(imagen),d4);
subplot(handles.FotoCom), imshow(IV), title ('Cerradura')
end

% --- Executes during object creation, after setting all properties.


function menu3_CreateFcn(hObject, eventdata, handles)
% hObject handle to menu3 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns
called

% Hint: popupmenu controls usually have a white background on Windows.


% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'),
get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end

% --- Executes on selection change in menu4.


function menu4_Callback(hObject, eventdata, handles)

switch get(handles.menu4,'value')

case 1

case 2
imagen=getimage(handles.FotoCar);
if imagen==0

29
return
end
umb=graythresh(imagen);
II=im2bw(imagen,umb);
subplot(handles.FotoCom), imshow(II), title ('Binarizacin')
%set(gcf,'color','w')

case 3
imagen=getimage(handles.FotoCar);
if imagen==0
return
end
d2=strel('disk',3);
II=imerode(rgb2gray(imagen),d2);
subplot(handles.FotoCom), imshow(II), title ('Erosionar la
Imagen')

case 4
imagen=getimage(handles.FotoCar);
if imagen==0
return
end
d3=strel('square',10);
III=imopen(rgb2gray(imagen),d3);
subplot(handles.FotoCom), imshow(III), title ('Apertura')

case 5
imagen=getimage(handles.FotoCar);
if imagen==0
return
end
d4=strel('square',5);
IV=imclose(rgb2gray(imagen),d4);
subplot(handles.FotoCom), imshow(IV), title ('Cerradura')
end

% --- Executes during object creation, after setting all properties.


function menu4_CreateFcn(hObject, eventdata, handles)
% hObject handle to menu4 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns
called

% Hint: popupmenu controls usually have a white background on Windows.


% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'),
get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end

% --- Executes during object creation, after setting all properties.


function FotoU_CreateFcn(hObject, eventdata, handles)
% hObject handle to FotoU (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns
called

% Hint: place code in OpeningFcn to populate FotoU

30
31
5. BIBLIOGRAFA

Labio: https://es.wikipedia.org/wiki/Labio, Consultado el 1 de mayo de 2016.

Sistema Biomtrico:
http://www.repositoriodigital.ipn.mx/bitstream/handle/123456789/8502/Azul231_o
riginal.pdf?sequence=1, Consultado el 3 de mayo de 2016

Sistema Biomtrico de reconocimiento de labios:


https://www.researchgate.net/profile/Alejandro_Frangi/publication/228374298_Ap
ortaciones_de_la_lectura_de_labios_a_la_seguridad_de_los_sistemas_biomtricos/li
nks/0fcfd510bfecfb84da000000.pdf, Consultado el 4 de mayo de 2016

Consultas, ejemplos y algoritmos del ejercicio consultados en


http://es.mathworks.com/academia/

6. REFERENCIAS

[1] Tapiador Mateos, Marino., Sigenza Pizarro, Juan A., et. al. Tecnologas
biomtricasaplicadas a la seguridad. 1 Edicin. Alfaomega Grupo Editor.
Mxico. D. F., ISBN 970-15- 1128-X, 2005.

[2] Association for Biometrics and International Computer Security Association.


Glossary of Biometrics Terms, 1999.

[3] Jacobo Aragunde Prez, Jos Carlos Toucedo Alonso, et al. Reconocimiento
de Personas,Visin artificial. Tema 7 2006/07.

32

Das könnte Ihnen auch gefallen