1. 程式人生 > 其它 >【影象檢索】基於matlab GUI綜合特徵影象檢索【含Matlab原始碼 719期】

【影象檢索】基於matlab GUI綜合特徵影象檢索【含Matlab原始碼 719期】

一、簡介

基於matlab GUI綜合特徵影象檢索

二、原始碼

function varargout = Run(varargin)
% RUN M-file for Run.fig
%      RUN, by itself, creates a new RUN or raises the existing
%      singleton*.
%
%      H = RUN returns the handle to a new RUN or the handle to
%      the existing singleton*.
%
%      RUN('CALLBACK',hObject,eventData,handles,...) calls the local
%      function named CALLBACK in RUN.M with the given input arguments.
%
%      RUN('Property','Value',...) creates a new RUN or raises the
%      existing singleton*.  Starting from the left, property value pairs are
%      applied to the GUI before Run_OpeningFcn gets called.  An
%      unrecognized property name or invalid value makes property application
%      stop.  All inputs are passed to Run_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 Run

% Last Modified by GUIDE v2.5 03-Jan-2013 16:06:52

% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...
    'gui_Singleton',  gui_Singleton, ...
    'gui_OpeningFcn', @Run_OpeningFcn, ...
    'gui_OutputFcn',  @Run_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 Run is made visible.
function Run_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 Run (see VARARGIN)

axes( handles.axes1 ) ;
imshow( 'GUI選擇.jpg' ) ;
axes( handles.axes2 ) ;
imshow( 'GUI顏色.jpg' ) ;
axes( handles.axes3 ) ;
imshow( 'GUI形狀.jpg' ) ;
axes( handles.axes4 ) ;
imshow( 'GUI紋理.jpg' ) ;
axes( handles.axes9 )
imshow( 'GUI問號.jpg' ) ;
axes( handles.axes5 )
imshow( 'GUI問號.jpg' ) ;
axes( handles.axes6 )
imshow( 'GUI問號.jpg' ) ;
axes( handles.axes7 )
imshow( 'GUI問號.jpg' ) ;
axes( handles.axes8 )
imshow( 'GUI問號.jpg') ;
handles.Chose = 6 ;
guidata(hObject, handles);
handles.To_be_matched = 0 ; 
guidata(hObject, handles);
handles.color_w = 0.5 ;
guidata(hObject, handles);
handles.edge_w = 0.01 ;
guidata(hObject, handles);
handles.texture_w =0.01 ;
guidata(hObject, handles);
% Choose default command line output for Run
handles.output = hObject;

% Update handles structure
guidata(hObject, handles);

% UIWAIT makes Run wait for user response (see UIRESUME)
% uiwait(handles.figure1);


% --- Outputs from this function are returned to the command line.
function varargout = Run_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 slider movement.
function slider_color_Callback(hObject, eventdata, handles)
% hObject    handle to slider_color (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
temp_color_w = get( hObject , 'Value' ) ;
set( handles.edit_color , 'String' , num2str(temp_color_w) ) ;
handles.color_w = temp_color_w ;
guidata( hObject , handles ) ;


% Hints: get(hObject,'Value') returns position of slider
%        get(hObject,'Min') and get(hObject,'Max') to determine range of slider


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

% Hint: slider controls usually have a light gray background.
if isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor',[.9 .9 .9]);
end
set ( hObject , 'Value' , 0 ) ;


% --- Executes on slider movement.
function slider_edge_Callback(hObject, eventdata, handles)
% hObject    handle to slider_edge (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,'Value') returns position of slider
%        get(hObject,'Min') and get(hObject,'Max') to determine range of slider
temp_edge_w = get( hObject , 'Value' ) ;
set( handles.edit_edge , 'String' , num2str(temp_edge_w) ) ;
handles.edge_w = temp_edge_w ;
guidata( hObject , handles ) ;


% --- Executes during object creation, after setting all properties.
function slider_edge_CreateFcn(hObject, eventdata, handles)
% hObject    handle to slider_edge (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called
% Hint: slider controls usually have a light gray background.
if isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor',[.9 .9 .9]);
end
set( hObject , 'Value' , 0 ) ;


% --- Executes on slider movement.
function slider_texture_Callback(hObject, eventdata, handles)
% hObject    handle to slider_texture (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,'Value') returns position of slider
%        get(hObject,'Min') and get(hObject,'Max') to determine range of slider
temp_texture_w = get( hObject , 'Value' ) ;
set( handles.edit_texture , 'String' , num2str(temp_texture_w) ) ;
handles.texture_w = temp_texture_w ;
guidata( hObject , handles ) ;

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

% Hint: slider controls usually have a light gray background.
if isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor',[.9 .9 .9]);
end
set( hObject , 'Value' , 0 ) ;



function edit_color_Callback(hObject, eventdata, handles)
% hObject    handle to edit_color (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 edit_color as text
%        str2double(get(hObject,'String')) returns contents of edit_color as a double
value = str2double( get( hObject , 'String' ) ) ;
if isnan(value)
    msgbox('黃老師,要輸入數字才行哦!');
    set( hObject , 'String' , '0' );
    set( handles.slider_color , 'Value' , 0 );
elseif value<0 | value >1
    msgbox('黃老師,只能數入0-1才行哦!');
    set( hObject , 'String' , '0' );
    set( handles.slider_color , 'Value' , value );
else
    set( handles.slider_color , 'Value' , 0 );
    handles.color_w = value ;
    guidata( hObject , handles ) ;
end

三、執行結果

四、備註

版本:2014a
完整程式碼或代寫加1564658423