⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 demooins.m

📁 This code can parse any image in matlab. Very elaborate code
💻 M
字号:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% This script contains a number of examples about how to use the
% LHI_ObjectsinScene subset
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%load another database
clear; close all;

% Set default folers
HOMEIMAGES = 'http://yoshi.cs.ucla.edu/yao/data/LHI_ObjectsinScene/Images'; % you can set here your default folder
HOMEANNOTATIONS = 'http://yoshi.cs.ucla.edu/yao/data/LHI_ObjectsinScene/Annotations'; % you can set here your default folder
HOMELABELMAPS = 'http://yoshi.cs.ucla.edu/yao/data/LHI_ObjectsinScene/LabelMaps';

% Set new folder to store translated annotations and labelmaps
NEWHOMELABELMAPS = 'C:/temp/LHI_ObjectsinScene/LabelMaps_new';
NEWHOMEANNOTATIONS = 'C:/temp/LHI_ObjectsinScene/Annotations_new'; % you can set here your default folder


D = LHIdatabase(HOMEANNOTATIONS);

% Regularize names of objets ( first time running or to customize the
% translation rule ). For second time, please use NEWHOMEANNOTATIONS,
% and skip the LHIregulatenames step
db=LHIregulatenames(D,HOMELABELMAPS,NEWHOMELABELMAPS,'namelist_objectinscene.txt');
% Save back to new folder (overwrite old xml or keep for future editing)
upgradeDatabase(db,NEWHOMEANNOTATIONS);
%% How to customize the namelist_*.txt file
% You can modify the object categories that will appear in the dataset by 
% editing the 'namelist_*.txt' file. 
% For example, if you want 'athlete' and 'spectator' be merged into a same category
% 'human'. The 'namelist_*.txt' should look like:
%      %%%%%%%%%%%
%      %salient objects
%      %%%%%%%%%%%
%      human,athlete,spectator 
%      ......
% After running LHIregulatenames(), the 'athlete' and 'spectator' will 
% merge into 'human', and share same color in the labelmap

% Another example, if your algorithms concerns about a certain category 
% inside the "less important objects" list (e.g. 'chair'),while 
% you have no interest on some categories inside the "salient objects" 
% such as 'window' 'light'. You can simply comment the line of 
% 'window' 'light' and uncomment the line of 'chair'. Then the 'chair' will 
% automatically appear among the object list when you do LHIregulatenames(), and
% 'window','light' will be categorized into 'other'.
%      %%%%%%%%%%%
%      %salient objects
%      %%%%%%%%%%%
%      .........
%      %light
%      %window 
%      ......   
%      %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%      %less important objects
%      % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%      .....
%      chair
%      %.....
% The SALIENCY of an object category is decided heuristicly by
% occuring frequency and occupied area of the category, which differs
% from case to case.

%show statistics
[a,b,c,d,e]=LHIobjectstats(db, HOMEIMAGES, NEWHOMELABELMAPS);

LHIdbshowscenes(db,HOMEIMAGES,NEWHOMELABELMAPS,0,[4 4]);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -