function varargout = cbires(varargin)
% CBIRES MATLAB code for cbires.fig
% CBIRES, by itself, creates a new CBIRES or raises the existing
% singleton*.
%
% H = CBIRES returns the handle to a new CBIRES or the handle to
% the existing singleton*.
%
% CBIRES('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in CBIRES.M with the given input arguments.
%
% CBIRES('Property','Value',...) creates a new CBIRES or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before cbires_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to cbires_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 cbires
% Last Modified by GUIDE v2.5 23-May-2013 22:01:15
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @cbires_OpeningFcn, ...
'gui_OutputFcn', @cbires_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 cbires is made visible.
function cbires_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 cbires (see VARARGIN)
% Choose default command line output for cbires
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes cbires wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = cbires_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_BrowseImage.
function btn_BrowseImage_Callback(hObject, eventdata, handles)
% hObject handle to btn_BrowseImage (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
[query_fname, query_pathname] = uigetfile('*.jpg; *.png; *.bmp', 'Select query image');
if (query_fname ~= 0)
query_fullpath = strcat(query_pathname, query_fname);
imgInfo = imfinfo(query_fullpath);
[pathstr, name, ext] = fileparts(query_fullpath); % fiparts returns char type
if ( strcmp(lower(ext), '.jpg') == 1 || strcmp(lower(ext), '.png') == 1 ...
|| strcmp(lower(ext), '.bmp') == 1 )
queryImage = imread( fullfile( pathstr, strcat(name, ext) ) );
% handles.queryImage = queryImage;
% guidata(hObject, handles);
% extract query image features
queryImage = imresize(queryImage, [384 256]);
if (strcmp(imgInfo.ColorType, 'truecolor') == 1)
hsvHist = hsvHistogram(queryImage);
autoCorrelogram = colorAutoCorrelogram(queryImage);
color_moments = colorMoments(queryImage);
% for gabor filters we need gary scale image
img = double(rgb2gray(queryImage))/255;
[meanAmplitude, msEnergy] = gaborWavelet(img, 4, 6); % 4 = number of scales, 6 = number of orientations
wavelet_moments = waveletTransform(queryImage, imgInfo.ColorType);
% construct the queryImage feature vector
queryImageFeature = [hsvHist autoCorrelogram color_moments meanAmplitude msEnergy wavelet_moments str2num(name)];
elseif (strcmp(imgInfo.ColorType, 'grayscale') == 1)
grayHist = imhist(queryImage);
grayHist = grayHist/sum(grayHist);
grayHist = grayHist(:)';
color_moments = [mean(mean(queryImage)) std(std(double(queryImage)))];
[meanAmplitude, msEnergy] = gaborWavelet(queryImage, 4, 6); % 4 = number of scales, 6 = number of orientations
wavelet_moments = waveletTransform(queryImage, imgInfo.ColorType);
% construct the queryImage feature vector
queryImageFeature = [grayHist color_moments meanAmplitude msEnergy wavelet_moments str2num(name)];
end
% update handles
handles.queryImageFeature = queryImageFeature;
handles.img_ext = ext;
handles.folder_name = pathstr;
guidata(hObject, handles);
helpdlg('Proceed with the query by executing the green button!');
% Clear workspace
clear('query_fname', 'query_pathname', 'query_fullpath', 'pathstr', ...
'name', 'ext', 'queryImage', 'hsvHist', 'autoCorrelogram', ...
'color_moments', 'img', 'meanAmplitude', 'msEnergy', ...
'wavelet_moments', 'queryImageFeature', 'imgInfo');
else
errordlg('You have not selected the correct file type');
end
else
return;
end
% --- Executes on selection change in popupmenu_DistanceFunctions.
function popupmenu_DistanceFunctions_Callback(hObject, eventdata, handles)
% hObject handle to popupmenu_DistanceFunctions (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 popupmenu_DistanceFunctions contents as cell array
% contents{get(hObject,'Value')} returns selected item from popupmenu_DistanceFunctions
handles.DistanceFunctions = get(handles.popupmenu_DistanceFunctions, 'Value');
guidata(hObject, handles);
% --- Executes during object creation, after setting all properties.
function popupmenu_DistanceFunctions_CreateFcn(hObject, eventdata, handles)
% hObject handle to popupmenu_DistanceFunctions (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 selection change in popupmenu_NumOfReturnedImages.
function popupmenu_NumOfReturnedImages_Callback(hObject, eventdata, handles)
% hObject handle to popupmenu_NumOfReturnedImages (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 popupmenu_NumOfReturnedImages contents as cell array
% contents{get(hObject,'Value')} returns selected item from popupmenu_NumOfReturnedImages
handles.numOfReturnedImages = get(handles.popupmenu_NumOfReturnedImages, 'Value');
guidata(hObject, handles);
% --- Executes during object creation, after setting all properties.
function popupmenu_NumOfReturnedImages_CreateFcn(hObject, eventdata, handles)
% hObject handle to popupmenu_NumOfReturnedImages (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: popupme
没有合适的资源?快使用搜索试试~ 我知道了~
Image_Searching.rar_algorithms
共14个文件
m:14个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 67 浏览量
2022-07-14
08:34:44
上传
评论
收藏 21KB RAR 举报
温馨提示
This matlab program is helpful to develop the image searching algorithms. image retrievals etc.
资源推荐
资源详情
资源评论
收起资源包目录
Image_Searching.rar (14个子文件)
cbires.m 20KB
colorMoments.m 700B
confMatGet.m 1KB
waveletTransform.m 700B
matPlot.m 4KB
colorAutoCorrelogram.m 3KB
confMatPlot.m 5KB
relativeDeviation.m 2KB
L1.m 2KB
lowpassfilter.m 2KB
gaborWavelet.m 19KB
L2.m 3KB
svm.m 4KB
hsvHistogram.m 3KB
共 14 条
- 1
资源评论
周楷雯
- 粉丝: 80
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功