wiki:Developer/FeatureService/ApiMatlab

Feature Service API - Matlab

Goals

  • Return features as Matlab matrix format
  • Simple and easy to make requests on on a set of resources
  • Versatile enough to handle all the different feature requests (different input resources)
  • Use existing Matlab API
  • Have similar structure as the Matlab API

Class bq.Feature()

fetch(resource_list, name, root_url, user, password, filename=None)

Static method of bq.Feature class to extract features

  • resource_list - Cell Array structure: {{'resource type1','resource url1';'resource type2','resource url2'...};...}
  • name - the feature name
  • root_url - bisque root
  • user - user name
  • password - password for the user name
  • filename - returns on output to this file else returns feature vectors

Examples

Uploading and fetch a feature from the image

%Here is a very famous image
I = imread('coins.png'); 

%Lets upload it to bisque
args = struct('filename', 'coins.png');
image = bq.Image.store(I, args, root_url, user, pass); 

%construct resource list
resource_list = {{'image',image.pixels_url.url};};

%fetch feature
m = bq.Feature.fetch(resource_list, 'EHD', root_url, user, pass);

% m = 
% 
%       image: [2000x1 char]
%        mask: [2000x1 char]
%     gobject: [2000x1 char]
%     feature: [80x1 single]

%Fetch many features from a dataset of images.

Here is an example dataset url
url = 'http://host/data_service/00-pata8zf8dtDe3LEGxKsMyE/value';

%fetch dataset xml
dataset = bq.Factory.fetch(url, [], user, pass);

%parse image xml nodes
images = dataset.findNodes('image');

%create resource list to make a request to feature service
resource_list = cell(length(images),1);
for i = 1:length(images)
    resource = {'image', images{i}.pixels_url.url};
    resource_list{i,1}=resource;
end

m = bq.Feature.fetch(resource_list, 'EHD', root_url, user, pass);

% m = 
% 
%       image: [2000x4 char]
%        mask: [2000x4 char]
%     gobject: [2000x4 char]
%     feature: [80x4 single]

Source references

Last modified 3 years ago Last modified on Nov 20, 2014 11:49:35 PM