• Tel:+86-711-3876688,+86-711-3867183
  • Fax:+86-711-3876699
  • Contact person:
  • Benjamin Yao:
  • Michael Yang:
Free data 
MATLAB Toolbox for the LHI Image Dataset


A Walk Through for the Matlab Toolbox

1. Setup
2. A quick look into the dataset
3. List of functions in the toolbox
4. Using the toolbox

4.1. Basic functions: indexing, queries
4.2. Object part hierarchies
4.3. Searching objects by name


1. Setup
Step1
Download
the toolbox and add it to the Matlab path.
Step2
The function LHIinstall will download the database. There are three ways to use this function:
To download the entire dataset, type the following into Matlab:
HOMEIMAGES = '/desired/path/to/Images';
HOMEANNOTATIONS = '/desired/path/to/Annotations';
HOMELABELMAPS = '/desired/path/to/
LabelMaps';

L
HIinstall(subset, HOMEIMAGES, HOMEANNOTATIONS, HOMELABELMAPS);

where "/desired/path/to/" is the desired location where the annotations and images will be stored.
This process will create the following directory structure under "/desired/path/to/":
./Annotations
./Annotations/folder1
...
./Annotations/folderN

./Images
./Images/folder1
...
./Images/folderN

./LabelMaps
./LabelMaps/folder1
...
./LabelMaps/folderN

where folder1 through folderN are directories containing the images and annotations. If you only want to download a list of specific folders, then run:

HOMEIMAGES = '/desired/path/to/Images';
HOMEANNOTATIONS = '/desired/path/to/Annotations';
HOMELABELMAPS = '/desired/path/to/LabelMaps';
folderlist = {'badminton'};
LMinstall (subset,folderlist, HOMEIMAGES, HOMEANNOTATIONS);

This will download only one folder from the collection. You can see the complete list of folders here.


2. A quick look into the dataset

The toolbox allows you using the dataset online without needing to download it first. Just execute the next lines to visualize the content of one of the folders of the collection:

HOMEANNOTATIONS = '/webpath/Annotations';
HOMEIMAGES = '/webpath/Images';
HOMELABELMAPS= '/webpath/LabelMaps';
D = LHIdatabase(HOMEANNOTATIONS);
LMdbshowscenes(D, HOMEIMAGES);


(Installing a local copy of the database will allow you a faster access).


3. List of functions in the toolbox

Introduction
demoTransportation - contains examples of subset LHI_Transportation_9
demoActivity - contains examples of subset LHI_UIUC_Sport_Activity_10
demoAerial - contains examples of subset LHI_UCLA_Aerial_Image_5
demoManmade - contains examples of subset LHI_Manmade_Object_75
demoNature - contains examples of subset LHI_Nature_Object_40
demoObjectinScene - contains examples of subset LHI_ObjectsinScene
demoScene - contains examples of subset LHI_SceneSegmentation_18
demoSurveillance - contains examples of subset LHI_SurveillanceScenes


LHI tools for reading and ploting the annotations of individual files
LHIplot -- image and polygons visualization
LHIplotsubgraph -- image and subgraph (sketchmap) visualization

LHI Database tools
LHIdatabase - loads all the annotations into a big database struct
LHIdbshowscenes - shows thumbnails for the all the images in the database
LHIdbshowobjects - shows crops of the objects in the database.
LHIdbshowimage - shows one image with hierarchical decomposition.

Stats
LHIobjectnames - returns a list with the name of all the objects in the database

Search tools
LHIquery - performs a query on the database

Image manipulation
LHIimread - reads one image from the database
LHIimscale - scales the image and the corresponding annotation

Creation of training and test images and databases
LHIregulatenames - create tuned databases (you can control the categories, the objects, ...)

Install and update images and annotations
LHIinstall - installs the database

XML tools (translates the XML files into MATLAB struct arrays)
xml2struct - translates a XML string into a matlab struct
struct2xml - translates a matlab struct into a XML string

4. Using the toolbox

4.1 - Basic functions: indexing, queries

First, you need to download the LHI databaset or you need to provide the url of the images and annotations online. If you are going to use the dataset frequently, it is better that you get a local copy.

% Define the root folder for the images
HOMEIMAGES = 'C:\yourpath\Images'; % you can set here your default folder
HOMEANNOTATIONS = 'C:\yourpath\Annotations'; % you can set here your default folder
HOMELABELMAPS = 'C:\yourpath\LabelMaps'; % you can set here your default folder

% This line reads the entire database into a Matlab struct
D = LHIdatabase(HOMEANNOTATIONS,{'Badminton'});


LHIdbshowscenes(D, HOMEIMAGES, HOMELABELMAPS, 1);

 

LHIdbshowscenes(D, HOMEIMAGES, HOMELABELMAPS);

4.2 - Object part hierarchies

Show one image with object part hierarchies :

% Define the root folder for the images
HOMEIMAGES = 'C:\yourpath\Images'; % you can set here your default folder
HOMEANNOTATIONS = 'C:\yourpath\Annotations'; % you can set here your default folder
HOMELABELMAPS = 'C:\yourpath\LabelMaps'; % you can set here your default folder

% This line reads the entire database into a Matlab struct
D = LHIdatabase(HOMEANNOTATIONS);

LHIdbshowimage(D, 10, HOMEIMAGES);

4.3 - Search Objects by Names

LHIquery.m

% Define the root folder for the images
HOMEIMAGES = 'C:\yourpath\Images'; % you can set here your default folder
HOMEANNOTATIONS = 'C:\yourpath\Annotations'; % you can set here your default folder
HOMELABELMAPS = 'C:\yourpath\LabelMaps'; % you can set here your default folder

% This line reads the entire database into a Matlab struct
D = LHIdatabase(HOMEANNOTATIONS);

LHIdbshowscenes(LHIquery(D,'object.name',car), HOMEIMAGES, HOMELABELMAPS,1,[6,4]);



  • Lotus Hill Reseach Institute for Computer Vision and Information Science, City of Ezhou, Hubei 436000, China
  • 1024*768 IE6.0
  • Copyright ? 2007 by www.imageparsing.com. All rights Reserved.