Académique Documents
Professionnel Documents
Culture Documents
prop=regionprops(L);
hold on
%Dibujar solamente area mayor
amay = 0
pmay = 0
vec = [0,0]
for n=1:length(prop)
Area = prop(n).Area
vec(1) = prop(n).BoundingBox(3)
vec(2) = prop(n).BoundingBox(4)
%%Protocolo de tamao cuadrado por lo menos 70%
co = min(vec)/max(vec)
if 0.7>co
Area = 0
end
if Area>amay
amay = Area
pmay = n
end
end
rectangle('position',prop(pmay).BoundingBox,'EdgeColor','g','LineWidth',2)
x=prop(pmay.BoundingBox(1)+prop(pmay).BoundingBox(3)/2);
y=prop(pmay.BoundingBox(2)+prop(pmay).BoundingBox(4)/2);
%%Calculo de tamao en milimetros
alfa = 90*(prop(pmay).BoundingBox(3)/b);
prof = handles.edit1
T = prof*tand(alfa)
plot(x,y,'+')
set(handles.text1,'string',T);
% --- Executes on button press in Reiniciar.
function Reiniciar_Callback(hObject, eventdata, handles)
% hObject
handle to Reiniciar (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)
ini=char(' ');
set(handles.text1,'String',ini);
%Limpia la casilla de texto donde se visualiza la longitud de la Pupila
clear all, clc
%Limpia la pantalla principal de Matlab y elimina las variables
close(gcbf)
%Cierra el programa
protect_1;
%Vuelve y Ejecuta el Programa
% --- Executes on button press in Editar.
function Editar_Callback(hObject, eventdata, handles)
% hObject
handle to Editar (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)
y=imcrop(handles.myImage);
%Nos permite recortar una zona deseada de la Imagen seleccionada
imshow(y,'Parent',handles.axes1);
%Visualizamos la imagen recortada en axes1
handles.myImage=y;
%Almacenamos en un indicador esta imagen
guidata(hObject,handles);
%Guardamos los indicadores Existentes
% --- Executes on button press in Salir.
function Salir_Callback(hObject, eventdata, handles)
% hObject
handle to Salir (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)