Java教程

【图像检索】基于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

这篇关于【图像检索】基于matlab GUI综合特征图像检索【含Matlab源码 719期】的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!