Está en la página 1de 31

PROCESAMIENTO DIGITAL DE SEÑALES:

PROYECTO:RECONOCIMIENTO DE PLACAS DE VEHICULOS

INFORME PROYECTO FINAL :

IMPLEMENTACION DE SOFTWARE (PRIMERAS PRUEBAS)

ALUMNOS:

MAMANI QUINCHO ALEX ALBERIANO


BEGAZO GALLEGOS GIANCARLO
BENAVENTE SALAS LUIS

GRUPO : 04

DOCENTE:

ING: DIANA VALDIEZO HERRERA

AREQUIPA – PERU

2019
Diagrama de Flujo Para Procesamiento de imagen de Detección de Placas:

Toma de Imagen

Conversión a RGB

Dilatación

Procesamiento en forma Horizontal

Procesamiento en forma Vertical

Segmentación

Extracción de Región de Trabajo


(Patrones)

Comparación de Patrones
1.1) Adquisición de Imagen:

Toma de Imagen y Almacenamiento de imagen:

Prueba:
1.2) Conversión a RGB

Prueba:

1.3) Dilatación
1.4) Procesamiento en forma Horizontal
Histograma aplicado al Filtro (horizontal)

Señal de Salida después del Filtro:


Prueba:

1.5) Procesamiento en forma Vertical


Histograma de bordes Verticales aplicado al Filtro PB (Vertical)
Señal de Salida de Filtro PB:

Señales Obtenidad:
1.6) Segmentación
Probables secciones de imagen a numero de placa:
1.7) Extracción de Región de Trabajo (Patrones)
Entrada: Imagen segmentada

A=Conversión a Imagen (42x 24)

B=Letras y números (Base de Datos)

A==B (i)

L=Obtención de Correlación máx.

Lencontrada=Max Correlación

Placa= [LE ]
Creacion de Letras:
Comparación de Figura:

Figura 1: imagen de Entrada Segmentada


Figura 2: imagen de Comparación

Creación de Base de datos de cada una de las imágenes:

Obtención de Correlación entre ambas imágenes:


.
.
.
.
Código de interfaz:

function varargout = interfaz1(varargin)


gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @interfaz1_OpeningFcn, ...
'gui_OutputFcn', @interfaz1_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 interfaz1 is made visible.


function interfaz1_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 interfaz1 (see VARARGIN)
global bt
bt=Bluetooth('btspp://201610316071',1);
fopen(bt);
fwrite(bt,'C');

% Choose default command line output for interfaz1


handles.output = hObject;
% Update handles structure
guidata(hObject, handles);

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


% uiwait(handles.figure1);

% --- Outputs from this function are returned to the command line.
function varargout = interfaz1_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;

% --- Executes on button press in pushbutton1.


function pushbutton1_Callback(hObject, eventdata, handles)
global vid
%*************Configuracion deCamara************************************
set(handles.textcam,'visible','on');
axes(handles.textcam);
vid=videoinput('winvideo',1);
vid.ReturnedColorSpace='rgb';
vidRes=get(vid,'VideoResolution');
nBands=get(vid,'NumberOfBands');
hImage=image(zeros(vidRes(2),vidRes(1), nBands));
preview(vid, hImage);
%************************************************************************
% --- Executes on button press in pushbutton2.
function pushbutton2_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
%close(interfaz1);
%interfaz2
REJISTRO_PLACAS
% --- Executes on button press in pushbutton4.
function pushbutton4_Callback(hObject, eventdata, handles)
global vid
global foto
set(handles.axes9,'Visible','On');
%****************Toma de Imagen***********************************
foto=getsnapshot(vid);
%********************************************************************
axes(handles.axes9);
imshow(foto);
closepreview;
function pushbutton5_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton5 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
set(handles.textcam,'visible','off');
closepreview;
fondo=imread('C:\Users\alex }\Desktop\delfines.gif');
axes(handles.textcam);
imshow(fondo);
% --- Executes on button press in pushbutton6.
function pushbutton6_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton6 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

% --- Executes on button press in pushbutton7.


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

% --- Executes on selection change in popupmenu1.


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

% Hints: contents = cellstr(get(hObject,'String')) returns popupmenu1


contents as cell array
% contents{get(hObject,'Value')} returns selected item from
popupmenu1

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


function popupmenu1_CreateFcn(hObject, eventdata, handles)
% hObject handle to popupmenu1 (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 button press in pushbutton8.


function pushbutton8_Callback(hObject, eventdata, handles)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
closepreview;
%global A
global foto
%im=A;
im=foto;
im = imresize(im, [800 800]);
imgray=im(:,:,2);
imbin = imbinarize(imgray);
im = edge(imbin, 'sobel');
im = imdilate(im, strel('diamond',2));
im = imfill(im, 'holes');
im = imerode(im, strel('diamond',11));
Iprops=regionprops(im,'BoundingBox','Area', 'Image');
area = Iprops.Area;
count = numel(Iprops);
maxa= area;
boundingBox = Iprops.BoundingBox;
for i=1:count
if maxa<Iprops(i).Area
maxa=Iprops(i).Area;
boundingBox=Iprops(i).BoundingBox;
end
end
im = imcrop(imbin, boundingBox);
im = imresize(im, [480 NaN]);
im = imopen(im, strel('rectangle', [1 1]));
im = bwareaopen(~im, 100);
[h, w] = size(im);
axes(handles.axes9);
imshow(im);
Iprops=regionprops(im,'BoundingBox','Area', 'Image');
count = numel(Iprops);
global noPlate;
noPlate=[];
m=[];
for i=1:count
ow = length(Iprops(i).Image(1,:));
oh = length(Iprops(i).Image(:,1));
m(i)=1;
if ow<(h/4) & oh>(h/4)
m(i)=2;
letter=readLetter(Iprops(i).Image);
noPlate=[noPlate letter];
set(handles.edit3,'String',noPlate);
end
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%Extraccion de Caracteres%%%%%%%%%%%%%%%%%%%%%%%
z=length(m);
t=0;
y=[];
for j=1:z
if m(j)==2
t=t+1;
y(t)=j;
end
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
e=length(y);
a1=y(e);
axes(handles.axes8);
imshow(Iprops(a1).Image);
a2=y(e-1);
axes(handles.axes7);
imshow(Iprops(a2).Image);
a3=y(e-2);
axes(handles.axes6);
imshow(Iprops(a3).Image);
a4=y(e-3);
axes(handles.axes5);
imshow(Iprops(a4).Image);
a5=y(e-4);
axes(handles.axes4);
imshow(Iprops(a5).Image);
a6=y(e-5);
axes(handles.axes2);
imshow(Iprops(a6).Image);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
% hObject handle to pushbutton8 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

function edit1_Callback(hObject, eventdata, handles)


% hObject handle to edit1 (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 edit1 as text


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

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


function edit1_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit1 (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 pushbutton9.


function pushbutton9_Callback(hObject, eventdata, handles)
global A
naam=get(handles.naam,'String');
A=imread(strcat('C:\Users\alex }\Desktop\autos/',naam));
axes(handles.textcam);
imshow(A);
%originele afbeelding wordt getoond
% hObject handle to pushbutton9 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
function naam_Callback(hObject, eventdata, handles)
% hObject handle to naam (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 naam as text


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

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


function naam_CreateFcn(hObject, eventdata, handles)
% hObject handle to naam (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 edit3_Callback(hObject, eventdata, handles)


% hObject handle to edit3 (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 edit3 as text


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

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


function edit3_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit3 (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 edit4_Callback(hObject, eventdata, handles)


% hObject handle to edit4 (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 edit4 as text


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

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


function edit4_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit4 (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 pushbutton10.


function pushbutton10_Callback(hObject, eventdata, handles)
global datos
A=importdata('datos.dat');
Nombre=A.textdata;
Puntos=A.data;
Puntos=num2cell(Puntos);
datos=[Nombre Puntos];
set(handles.uitable1,'data',datos);
% hObject handle to pushbutton10 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

% --- Executes on button press in pushbutton11.


function pushbutton11_Callback(hObject, eventdata, handles)
global noPlate
global bt
A=importdata('datos.dat');
Nombre=A.textdata;
k=length(Nombre);
x4=0;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
r=['Registro Encontrado......ok'];
r1=['Registro No Encontrado...error'];
noPlate
for i=1:k;
x1=Nombre{i,:};
x3=strcmp(x1,noPlate);
if x3==1
x4=1;
end
end
if x4==1

set(handles.edit4,'String',r);
fwrite(bt,'E');
pause(3);
fwrite(bt,'E');
end
if x4==0
set(handles.edit4,'String',r1);
fwrite(bt,'C');
end
fwrite(bt,'A');
pause(1);
fwrite(bt,'C');
% hObject handle to pushbutton11 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

Interfaz de Base de Datos:

function varargout = REJISTRO_PLACAS(varargin)

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

% Last Modified by GUIDE v2.5 27-Jun-2019 09:35:07

% Begin initialization code - DO NOT EDIT


gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @REJISTRO_PLACAS_OpeningFcn, ...
'gui_OutputFcn', @REJISTRO_PLACAS_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 REJISTRO_PLACAS is made visible.


function REJISTRO_PLACAS_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 REJISTRO_PLACAS (see VARARGIN)
global T
T=0;
datos=get(handles.uitable5,'Data');
A=get(handles.uitable5,'Data');
datos(:,:)=[];
A(:,:)=[];
set(handles.uitable5,'Data',datos);
% Choose default command line output for REJISTRO_PLACAS
handles.output = hObject;

% Update handles structure


guidata(hObject, handles);

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


% uiwait(handles.figure1);

% --- Outputs from this function are returned to the command line.
function varargout = REJISTRO_PLACAS_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 edit1_Callback(hObject, eventdata, handles)


% hObject handle to edit1 (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 edit1 as text


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

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


function edit1_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit1 (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 edit2_Callback(hObject, eventdata, handles)


% hObject handle to edit2 (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 edit2 as text


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

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


function edit2_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit2 (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 edit3_Callback(hObject, eventdata, handles)


% hObject handle to edit3 (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 edit3 as text
% str2double(get(hObject,'String')) returns contents of edit3 as a
double

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


function edit3_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit3 (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 pushbutton1.


function pushbutton1_Callback(hObject, eventdata, handles)
global T
global datos
T=T+1;
P=get(handles.edit1,'String');
D=get(handles.edit2,'String');
datos=get(handles.uitable5,'Data');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%if isempty(datos)
% datos{1,1}=P;
% datos{1,2}=D;
%else
datos{end+1,1}=P;
datos{end,2}=D;
%end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%C=get(handles.uitable5,'data');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%if T==5
%archivo=fopen('datos.txt','w');
%n=size(A,1);
%for i=1:n
%fprintf(archivo,'%s %s \n',A{i,:});
%end
%fclose(archivo);
%end
set(handles.uitable5,'Data',datos);
% hObject handle to pushbutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with hadles and user data (see GUIDATA)

function edit4_Callback(hObject, eventdata, handles)


% hObject handle to edit4 (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 edit4 as text


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

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


function edit4_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit4 (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 edit5_Callback(hObject, eventdata, handles)


% hObject handle to edit5 (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 edit5 as text


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

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


function edit5_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit5 (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 pushbutton2.


function pushbutton2_Callback(hObject, eventdata, handles)
global datos
A=importdata('datos.dat');
Nombre=A.textdata;
Puntos=A.data;
Puntos=num2cell(Puntos);
datos=[Nombre Puntos];
set(handles.uitable6,'data',datos);
% hObject handle to pushbutton2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

% --- Executes on button press in pushbutton3.


function pushbutton3_Callback(hObject, eventdata, handles)
C=get(handles.uitable5,'data');
n=size(C,1);
archivo=fopen('datos.dat','w');
for i=1:n
fprintf(archivo,'%s %s \n',C{i,:});
end
fclose(archivo);
% hObject handle to pushbutton3 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

function edit6_Callback(hObject, eventdata, handles)


% hObject handle to edit6 (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 edit6 as text


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

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


function edit6_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit6 (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 edit7_Callback(hObject, eventdata, handles)


% hObject handle to edit7 (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 edit7 as text


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

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


function edit7_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit7 (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 pushbutton4.


function pushbutton4_Callback(hObject, eventdata, handles)
F=get(handles.edit6,'String');
A=importdata('datos.dat');
Nombre=A.textdata;
k=length(Nombre);
x4=0;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
r=['Registro Encontrado......ok'];
r1=['Registro No Encontrado...error'];
for i=1:k;
x1=Nombre{i,:};
x3=strcmp(x1,F);
if x3==1
x4=1;
end
end
if x4==1
set(handles.edit7,'String',r);
end
if x4==0
set(handles.edit7,'String',r1);
end

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% hObject handle to pushbutton4 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --- Executes on button press in pushbutton5.
function pushbutton5_Callback(hObject, eventdata, handles)
close(REJISTRO_PLACAS);
% hObject handle to pushbutton5 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

También podría gustarte