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

📄 demoactivity.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
% UIUC_UCLA_Sports_Activity_10 subset
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

clear; close all;

% Set default folers
HOMEANNOTATIONS='http://yoshi.cs.ucla.edu/yao/data/LHI_UIUC_Sport_Activity_10/Annotations';
HOMELABELMAPS='http://yoshi.cs.ucla.edu/yao/data/LHI_UIUC_Sport_Activity_10/LabelMaps';
HOMEIMAGES='http://yoshi.cs.ucla.edu/yao/data/LHI_UIUC_Sport_Activity_10/Images';

% Set new folder to store translated annotations and labelmaps
NEWHOMELABELMAPS='C:\yourfolder\LHI_UIUC_Sport_Activity_10\Labelmaps_new';
NEWHOMEANNOTATIONS='C:\yourfolder\LHI_UIUC_Sport_Activity_10\Annotations_new';

% load database
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_sportactivity.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 image
i = 3; % i could be any integer from 1 to length(db)
LHIdbshowimage(db,i,HOMEIMAGES);

%% Geometry
% show geometry of a certain image
i = 3; % i could be any integer from 1 to length(db)
LHIdbshowgeometry(db,i,HOMEIMAGES);

%% Template
% % Queries for badminton category
badminton = LHIquery(db,'folder','badminton');
% query for all object parts with name 'skeleton'
db_part = LHIquery(badminton, 'object.parts.name', 'skeleton');
% display the parts with template ids
LHIdbshowparts(db_part, HOMEIMAGES, 1, [4,4]);

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

⌨️ 快捷键说明

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