initial commit with random descriptors and skeleton report
This commit is contained in:
commit
01ce588a9e
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
dataset
|
10
cvpr_compare.m
Normal file
10
cvpr_compare.m
Normal file
@ -0,0 +1,10 @@
|
||||
function dst=cvpr_compare(F1, F2)
|
||||
|
||||
% This function should compare F1 to F2 - i.e. compute the distance
|
||||
% between the two descriptors
|
||||
|
||||
% For now it just returns a random number
|
||||
|
||||
dst=rand();
|
||||
|
||||
return;
|
38
cvpr_computedescriptors.m
Normal file
38
cvpr_computedescriptors.m
Normal file
@ -0,0 +1,38 @@
|
||||
%% EEE3032 - Computer Vision and Pattern Recognition (ee3.cvpr)
|
||||
%%
|
||||
%% cvpr_computedescriptors.m
|
||||
%% Skeleton code provided as part of the coursework assessment
|
||||
%% This code will iterate through every image in the MSRCv2 dataset
|
||||
%% and call a function 'extractRandom' to extract a descriptor from the
|
||||
%% image. Currently that function returns just a random vector so should
|
||||
%% be changed as part of the coursework exercise.
|
||||
%%
|
||||
%% (c) John Collomosse 2010 (J.Collomosse@surrey.ac.uk)
|
||||
%% Centre for Vision Speech and Signal Processing (CVSSP)
|
||||
%% University of Surrey, United Kingdom
|
||||
|
||||
close all;
|
||||
clear all;
|
||||
|
||||
%% Edit the following line to the folder you unzipped the MSRCv2 dataset to
|
||||
DATASET_FOLDER = 'dataset';
|
||||
|
||||
%% Create a folder to hold the results...
|
||||
OUT_FOLDER = 'descriptors';
|
||||
%% and within that folder, create another folder to hold these descriptors
|
||||
%% the idea is all your descriptors are in individual folders - within
|
||||
%% the folder specified as 'OUT_FOLDER'.
|
||||
OUT_SUBFOLDER='globalRGBhisto';
|
||||
|
||||
allfiles=dir (fullfile([DATASET_FOLDER,'/Images/*.bmp']));
|
||||
for filenum=1:length(allfiles)
|
||||
fname=allfiles(filenum).name;
|
||||
fprintf('Processing file %d/%d - %s\n',filenum,length(allfiles),fname);
|
||||
tic;
|
||||
imgfname_full=([DATASET_FOLDER,'/Images/',fname]);
|
||||
img=double(imread(imgfname_full))./255;
|
||||
fout=[OUT_FOLDER,'/',OUT_SUBFOLDER,'/',fname(1:end-4),'.mat'];%replace .bmp with .mat
|
||||
F=extractRandom(img);
|
||||
save(fout,'F');
|
||||
toc
|
||||
end
|
81
cvpr_visualsearch.m
Normal file
81
cvpr_visualsearch.m
Normal file
@ -0,0 +1,81 @@
|
||||
%% EEE3032 - Computer Vision and Pattern Recognition (ee3.cvpr)
|
||||
%%
|
||||
%% cvpr_visualsearch.m
|
||||
%% Skeleton code provided as part of the coursework assessment
|
||||
%%
|
||||
%% This code will load in all descriptors pre-computed (by the
|
||||
%% function cvpr_computedescriptors) from the images in the MSRCv2 dataset.
|
||||
%%
|
||||
%% It will pick a descriptor at random and compare all other descriptors to
|
||||
%% it - by calling cvpr_compare. In doing so it will rank the images by
|
||||
%% similarity to the randomly picked descriptor. Note that initially the
|
||||
%% function cvpr_compare returns a random number - you need to code it
|
||||
%% so that it returns the Euclidean distance or some other distance metric
|
||||
%% between the two descriptors it is passed.
|
||||
%%
|
||||
%% (c) John Collomosse 2010 (J.Collomosse@surrey.ac.uk)
|
||||
%% Centre for Vision Speech and Signal Processing (CVSSP)
|
||||
%% University of Surrey, United Kingdom
|
||||
|
||||
close all;
|
||||
clear all;
|
||||
|
||||
%% Edit the following line to the folder you unzipped the MSRCv2 dataset to
|
||||
DATASET_FOLDER = 'dataset';
|
||||
|
||||
%% Folder that holds the results...
|
||||
DESCRIPTOR_FOLDER = 'descriptors';
|
||||
%% and within that folder, another folder to hold the descriptors
|
||||
%% we are interested in working with
|
||||
DESCRIPTOR_SUBFOLDER='globalRGBhisto';
|
||||
|
||||
|
||||
%% 1) Load all the descriptors into "ALLFEAT"
|
||||
%% each row of ALLFEAT is a descriptor (is an image)
|
||||
|
||||
ALLFEAT=[];
|
||||
ALLFILES=cell(1,0);
|
||||
ctr=1;
|
||||
allfiles=dir (fullfile([DATASET_FOLDER,'/Images/*.bmp']));
|
||||
for filenum=1:length(allfiles)
|
||||
fname=allfiles(filenum).name;
|
||||
imgfname_full=([DATASET_FOLDER,'/Images/',fname]);
|
||||
img=double(imread(imgfname_full))./255;
|
||||
thesefeat=[];
|
||||
featfile=[DESCRIPTOR_FOLDER,'/',DESCRIPTOR_SUBFOLDER,'/',fname(1:end-4),'.mat'];%replace .bmp with .mat
|
||||
load(featfile,'F');
|
||||
ALLFILES{ctr}=imgfname_full;
|
||||
ALLFEAT=[ALLFEAT ; F];
|
||||
ctr=ctr+1;
|
||||
end
|
||||
|
||||
%% 2) Pick an image at random to be the query
|
||||
NIMG=size(ALLFEAT,1); % number of images in collection
|
||||
queryimg=floor(rand()*NIMG); % index of a random image
|
||||
|
||||
|
||||
%% 3) Compute the distance of image to the query
|
||||
dst=[];
|
||||
for i=1:NIMG
|
||||
candidate=ALLFEAT(i,:);
|
||||
query=ALLFEAT(queryimg,:);
|
||||
thedst=cvpr_compare(query,candidate);
|
||||
dst=[dst ; [thedst i]];
|
||||
end
|
||||
dst=sortrows(dst,1); % sort the results
|
||||
|
||||
%% 4) Visualise the results
|
||||
%% These may be a little hard to see using imgshow
|
||||
%% If you have access, try using imshow(outdisplay) or imagesc(outdisplay)
|
||||
|
||||
SHOW=15; % Show top 15 results
|
||||
dst=dst(1:SHOW,:);
|
||||
outdisplay=[];
|
||||
for i=1:size(dst,1)
|
||||
img=imread(ALLFILES{dst(i,2)});
|
||||
img=img(1:2:end,1:2:end,:); % make image a quarter size
|
||||
img=img(1:81,:,:); % crop image to uniform size vertically (some MSVC images are different heights)
|
||||
outdisplay=[outdisplay img];
|
||||
end
|
||||
imgshow(outdisplay);
|
||||
axis off;
|
BIN
descriptors/globalRGBhisto/10_10_s.mat
Normal file
BIN
descriptors/globalRGBhisto/10_10_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/10_11_s.mat
Normal file
BIN
descriptors/globalRGBhisto/10_11_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/10_12_s.mat
Normal file
BIN
descriptors/globalRGBhisto/10_12_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/10_13_s.mat
Normal file
BIN
descriptors/globalRGBhisto/10_13_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/10_14_s.mat
Normal file
BIN
descriptors/globalRGBhisto/10_14_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/10_15_s.mat
Normal file
BIN
descriptors/globalRGBhisto/10_15_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/10_16_s.mat
Normal file
BIN
descriptors/globalRGBhisto/10_16_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/10_17_s.mat
Normal file
BIN
descriptors/globalRGBhisto/10_17_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/10_18_s.mat
Normal file
BIN
descriptors/globalRGBhisto/10_18_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/10_19_s.mat
Normal file
BIN
descriptors/globalRGBhisto/10_19_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/10_1_s.mat
Normal file
BIN
descriptors/globalRGBhisto/10_1_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/10_20_s.mat
Normal file
BIN
descriptors/globalRGBhisto/10_20_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/10_21_s.mat
Normal file
BIN
descriptors/globalRGBhisto/10_21_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/10_22_s.mat
Normal file
BIN
descriptors/globalRGBhisto/10_22_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/10_23_s.mat
Normal file
BIN
descriptors/globalRGBhisto/10_23_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/10_24_s.mat
Normal file
BIN
descriptors/globalRGBhisto/10_24_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/10_25_s.mat
Normal file
BIN
descriptors/globalRGBhisto/10_25_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/10_26_s.mat
Normal file
BIN
descriptors/globalRGBhisto/10_26_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/10_27_s.mat
Normal file
BIN
descriptors/globalRGBhisto/10_27_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/10_28_s.mat
Normal file
BIN
descriptors/globalRGBhisto/10_28_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/10_29_s.mat
Normal file
BIN
descriptors/globalRGBhisto/10_29_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/10_2_s.mat
Normal file
BIN
descriptors/globalRGBhisto/10_2_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/10_30_s.mat
Normal file
BIN
descriptors/globalRGBhisto/10_30_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/10_31_s.mat
Normal file
BIN
descriptors/globalRGBhisto/10_31_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/10_32_s.mat
Normal file
BIN
descriptors/globalRGBhisto/10_32_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/10_3_s.mat
Normal file
BIN
descriptors/globalRGBhisto/10_3_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/10_4_s.mat
Normal file
BIN
descriptors/globalRGBhisto/10_4_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/10_5_s.mat
Normal file
BIN
descriptors/globalRGBhisto/10_5_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/10_6_s.mat
Normal file
BIN
descriptors/globalRGBhisto/10_6_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/10_7_s.mat
Normal file
BIN
descriptors/globalRGBhisto/10_7_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/10_8_s.mat
Normal file
BIN
descriptors/globalRGBhisto/10_8_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/10_9_s.mat
Normal file
BIN
descriptors/globalRGBhisto/10_9_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/11_10_s.mat
Normal file
BIN
descriptors/globalRGBhisto/11_10_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/11_11_s.mat
Normal file
BIN
descriptors/globalRGBhisto/11_11_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/11_12_s.mat
Normal file
BIN
descriptors/globalRGBhisto/11_12_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/11_13_s.mat
Normal file
BIN
descriptors/globalRGBhisto/11_13_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/11_14_s.mat
Normal file
BIN
descriptors/globalRGBhisto/11_14_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/11_15_s.mat
Normal file
BIN
descriptors/globalRGBhisto/11_15_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/11_16_s.mat
Normal file
BIN
descriptors/globalRGBhisto/11_16_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/11_17_s.mat
Normal file
BIN
descriptors/globalRGBhisto/11_17_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/11_18_s.mat
Normal file
BIN
descriptors/globalRGBhisto/11_18_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/11_19_s.mat
Normal file
BIN
descriptors/globalRGBhisto/11_19_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/11_1_s.mat
Normal file
BIN
descriptors/globalRGBhisto/11_1_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/11_20_s.mat
Normal file
BIN
descriptors/globalRGBhisto/11_20_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/11_21_s.mat
Normal file
BIN
descriptors/globalRGBhisto/11_21_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/11_22_s.mat
Normal file
BIN
descriptors/globalRGBhisto/11_22_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/11_23_s.mat
Normal file
BIN
descriptors/globalRGBhisto/11_23_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/11_24_s.mat
Normal file
BIN
descriptors/globalRGBhisto/11_24_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/11_25_s.mat
Normal file
BIN
descriptors/globalRGBhisto/11_25_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/11_26_s.mat
Normal file
BIN
descriptors/globalRGBhisto/11_26_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/11_27_s.mat
Normal file
BIN
descriptors/globalRGBhisto/11_27_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/11_28_s.mat
Normal file
BIN
descriptors/globalRGBhisto/11_28_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/11_29_s.mat
Normal file
BIN
descriptors/globalRGBhisto/11_29_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/11_2_s.mat
Normal file
BIN
descriptors/globalRGBhisto/11_2_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/11_30_s.mat
Normal file
BIN
descriptors/globalRGBhisto/11_30_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/11_3_s.mat
Normal file
BIN
descriptors/globalRGBhisto/11_3_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/11_4_s.mat
Normal file
BIN
descriptors/globalRGBhisto/11_4_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/11_5_s.mat
Normal file
BIN
descriptors/globalRGBhisto/11_5_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/11_6_s.mat
Normal file
BIN
descriptors/globalRGBhisto/11_6_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/11_7_s.mat
Normal file
BIN
descriptors/globalRGBhisto/11_7_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/11_8_s.mat
Normal file
BIN
descriptors/globalRGBhisto/11_8_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/11_9_s.mat
Normal file
BIN
descriptors/globalRGBhisto/11_9_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/12_10_s.mat
Normal file
BIN
descriptors/globalRGBhisto/12_10_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/12_11_s.mat
Normal file
BIN
descriptors/globalRGBhisto/12_11_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/12_12_s.mat
Normal file
BIN
descriptors/globalRGBhisto/12_12_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/12_13_s.mat
Normal file
BIN
descriptors/globalRGBhisto/12_13_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/12_14_s.mat
Normal file
BIN
descriptors/globalRGBhisto/12_14_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/12_15_s.mat
Normal file
BIN
descriptors/globalRGBhisto/12_15_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/12_16_s.mat
Normal file
BIN
descriptors/globalRGBhisto/12_16_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/12_17_s.mat
Normal file
BIN
descriptors/globalRGBhisto/12_17_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/12_18_s.mat
Normal file
BIN
descriptors/globalRGBhisto/12_18_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/12_19_s.mat
Normal file
BIN
descriptors/globalRGBhisto/12_19_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/12_1_s.mat
Normal file
BIN
descriptors/globalRGBhisto/12_1_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/12_20_s.mat
Normal file
BIN
descriptors/globalRGBhisto/12_20_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/12_21_s.mat
Normal file
BIN
descriptors/globalRGBhisto/12_21_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/12_22_s.mat
Normal file
BIN
descriptors/globalRGBhisto/12_22_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/12_23_s.mat
Normal file
BIN
descriptors/globalRGBhisto/12_23_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/12_24_s.mat
Normal file
BIN
descriptors/globalRGBhisto/12_24_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/12_25_s.mat
Normal file
BIN
descriptors/globalRGBhisto/12_25_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/12_26_s.mat
Normal file
BIN
descriptors/globalRGBhisto/12_26_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/12_27_s.mat
Normal file
BIN
descriptors/globalRGBhisto/12_27_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/12_28_s.mat
Normal file
BIN
descriptors/globalRGBhisto/12_28_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/12_29_s.mat
Normal file
BIN
descriptors/globalRGBhisto/12_29_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/12_2_s.mat
Normal file
BIN
descriptors/globalRGBhisto/12_2_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/12_30_s.mat
Normal file
BIN
descriptors/globalRGBhisto/12_30_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/12_31_s.mat
Normal file
BIN
descriptors/globalRGBhisto/12_31_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/12_32_s.mat
Normal file
BIN
descriptors/globalRGBhisto/12_32_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/12_33_s.mat
Normal file
BIN
descriptors/globalRGBhisto/12_33_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/12_34_s.mat
Normal file
BIN
descriptors/globalRGBhisto/12_34_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/12_3_s.mat
Normal file
BIN
descriptors/globalRGBhisto/12_3_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/12_4_s.mat
Normal file
BIN
descriptors/globalRGBhisto/12_4_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/12_5_s.mat
Normal file
BIN
descriptors/globalRGBhisto/12_5_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/12_6_s.mat
Normal file
BIN
descriptors/globalRGBhisto/12_6_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/12_7_s.mat
Normal file
BIN
descriptors/globalRGBhisto/12_7_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/12_8_s.mat
Normal file
BIN
descriptors/globalRGBhisto/12_8_s.mat
Normal file
Binary file not shown.
BIN
descriptors/globalRGBhisto/12_9_s.mat
Normal file
BIN
descriptors/globalRGBhisto/12_9_s.mat
Normal file
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user