function varargout = ImageIndex(varargin)
% IMAGEINDEX M-file for ImageIndex.fig
% IMAGEINDEX, by itself, creates a new IMAGEINDEX or raises the existing
% singleton*.
%
% H = IMAGEINDEX returns the handle to a new IMAGEINDEX or the handle to
% the existing singleton*.
%
% IMAGEINDEX('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in IMAGEINDEX.M with the given input arguments.
%
% IMAGEINDEX('Property','Value',...) creates a new IMAGEINDEX or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before ImageIndex_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to ImageIndex_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 ImageIndex
% Last Modified by GUIDE v2.5 30-May-2012 17:13:08
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @ImageIndex_OpeningFcn, ...
'gui_OutputFcn', @ImageIndex_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 ImageIndex is made visible.
function ImageIndex_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 ImageIndex (see VARARGIN)
% Choose default command line output for ImageIndex
handles.output = hObject;
set(handles.axes2,'Visible','off');
set(handles.axes3,'Visible','off');
handles.T = 0.5;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes ImageIndex wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = ImageIndex_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 btn_indexPath.
function btn_indexPath_Callback(hObject, eventdata, handles)
% hObject handle to btn_indexPath (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
[FileName,PathName] = uigetfile({'*.bmp';'*.jpg';'*.*'},'选择训练图像库');
set(handles.edit_indexpath,'string',PathName);
[pathstr, name, ext, versn] = fileparts(fullfile(PathName,FileName));
handles.Format = strcat('*',ext);
handles.PathName = PathName;
A = dir(fullfile(PathName,handles.Format));
handles.FileName = A;
Images = [];
handles.indexnum = size(A,1);
for k=1:size(A,1)
Images(k).vlu = imread([PathName A(k).name]);
end
handles.Images = Images;
guidata(hObject, handles);
% --- Executes on button press in btn_featureExt.
function btn_featureExt_Callback(hObject, eventdata, handles)
% hObject handle to btn_featureExt (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
handles.stdfeature = featureextract(handles.stdimg);
set(handles.edit_stdfeatures,'string',num2str(handles.stdfeature));
guidata(hObject, handles);
function edit_stdfeatures_Callback(hObject, eventdata, handles)
% hObject handle to edit_stdfeatures (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_stdfeatures as text
% str2double(get(hObject,'String')) returns contents of edit_stdfeatures as a double
% --- Executes during object creation, after setting all properties.
function edit_stdfeatures_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit_stdfeatures (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 btn_open.
function btn_open_Callback(hObject, eventdata, handles)
% hObject handle to btn_open (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
[FileName,PathName] = uigetfile({'*.bmp';'*.jpg';'*.*'},'选择标准图像');
handles.stdimg = imread(fullfile(PathName,FileName));
axes(handles.axes2);
% cla reset;
imshow(handles.stdimg );
guidata(hObject, handles);
function edit_indexpath_Callback(hObject, eventdata, handles)
% hObject handle to edit_indexpath (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_indexpath as text
% str2double(get(hObject,'String')) returns contents of edit_indexpath as a double
% --- Executes during object creation, after setting all properties.
function edit_indexpath_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit_indexpath (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 btn_index.
function btn_index_Callback(hObject, eventdata, handles)
% hObject handle to btn_index (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
hwbar = waitbar(0,'Please wait...');
for k =1:handles.indexnum
Features(k).vlu = featureextract(handles.Images(k).vlu);
waitbar(k/(handles.indexnum));
end
close(hwbar);
handles.fdists = featuredists(handles.stdfeature,Features);
mind = find(handles.fdists == min(handles.fdists));
ind = find(handles.fdists <= handles.T);
num = size(ind,2);
if ~ishandle(handles.axes3)
handles.axes3 = axes('parent',handles.uipanel4); %重建一个axes
end
axis(handles.axes3);
% set(get(handles.figure1,'Axes','axes3'),'visible','on');
set(handles.figure1,'CurrentAxes',handles.axes3);
% cla reset;
if num >= 4
ind = ind(1:4);
axis(handles.axes3);
subplot(221);
% subplot('position',[.05 .55 .4 .4]);
imshow(handles.Images(ind(1)).vlu,[]);
subplot(222);
% subplot('position',[.55 .55 .4 .5 ])
imshow(handles.Images(ind(2)).vlu,[]);
subplot(223);
% subplot('position',[.05 .05 .4 .5 ])
imshow(handles.Images(ind(3)).vlu,[]);
subplot(224);
% subplot('position',[.55 .05 .4 .5 ])
imshow(handles.Images(ind(4)).vlu,[]);
elseif num == 3
axis(handles.axes3);
subpl
没有合适的资源?快使用搜索试试~ 我知道了~
基于Zernike不变矩的图像检索代码
共66个文件
jpg:56个
m:8个
fig:1个
5星 · 超过95%的资源 需积分: 29 64 下载量 8 浏览量
2012-11-20
21:33:19
上传
评论 3
收藏 356KB RAR 举报
温馨提示
matlab,Zernike矩是一种具有尺度、移位和旋转不变性的正交不变矩,本设计的目的就是利用Zernike不变矩设计一种图像检索系统,该系统能够充分验证Zerinike矩的不变性及其在图像检索中的优良性能。
资源推荐
资源详情
资源评论
收起资源包目录
daima(Zernike).rar (66个子文件)
daima(Zernike)
zernike2.m 2KB
w_imgmoments.m 2KB
featureextract.m 769B
images
8.jpg 11KB
26.jpg 4KB
D15_5.JPG 6KB
D18_4.JPG 5KB
2.jpg 14KB
D18_14.JPG 5KB
D18_12.JPG 5KB
D15_8.JPG 6KB
1.jpg 9KB
D2_3.JPG 6KB
6.jpg 7KB
D2_7.JPG 6KB
D18_2.JPG 4KB
D18_1.JPG 5KB
25.jpg 3KB
D18_5.JPG 5KB
D1_2.JPG 4KB
3.jpg 10KB
5.jpg 5KB
D1.JPG 4KB
D15_6.JPG 7KB
D18_11.JPG 5KB
21.jpg 4KB
D18_8.JPG 5KB
D2_6.JPG 6KB
D18_3.JPG 4KB
D15_2.JPG 6KB
11.jpg 4KB
D1_3.JPG 4KB
D15_1.JPG 6KB
4.jpg 9KB
23.jpg 6KB
10.jpg 8KB
22.jpg 7KB
D2_5.JPG 6KB
24.jpg 4KB
D1_1.JPG 4KB
D2_2.JPG 7KB
18.jpg 7KB
D18_15.JPG 5KB
D15_4.JPG 6KB
D18_10.JPG 5KB
9.jpg 8KB
12.JPG 4KB
D18_7.JPG 5KB
20.jpg 7KB
7.jpg 16KB
D15_3.JPG 6KB
D18_16.JPG 5KB
D18_13.JPG 5KB
D18_6.JPG 5KB
D2_4.JPG 6KB
D2_1.JPG 7KB
D15_7.JPG 6KB
D18_9.JPG 5KB
D15_9.JPG 6KB
w_imgshift.m 941B
P_zernike.m 2KB
w_imnormalized.m 524B
featuredists.m 172B
ImageIndex.fig 9KB
ImageIndex.asv 9KB
ImageIndex.m 9KB
共 66 条
- 1
hanlianfu
- 粉丝: 0
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
前往页