FEATURE_OBJECTS_CVIP

feature_objects_cvip() - extracts features from a group of objects in a single image and a single image mask for the objects, output is a csv file.

Contents

SYNTAX

final_table = feature_objects_cvip( input_img, mask_img,objLabel, out_file_name,bin_feat,his_feat, rst_feat, tex_feat, spec_feat,varargin)

Input parameters include:

DESCRIPTION

The function extracts the features from a group of objects present in a single input image and outputs a .CSV file that contains all the extracted features. The objects can be isolated with the use of a mask image that contains '0' in all the elements except where the objects are present. The features extracted depend on the feature selection given as input by the user. The user can select different features from five different feature areas. The function is most useful in Image analysis applications.

REFERENCE

1.Scott E Umbaugh. DIGITAL IMAGE PROCESSING AND ANALYSIS: Applications with MATLAB and CVIPtools, 3rd Edition.

EXAMPLE

% Read image

 input_img = imread('Stripey.jpg');

% Mask image

 mask_img = zeros(size(input_img));
 mask_img = mask_img(:,:,1);
 mask_img(50:200,25:95) = 1;
 mask_img(100:300,255:400) = 2;

% Output file name

 out_file_name = 'sdfsdf';

% Object label

 objLabel = [1 ;2];

% Binary features row vector 8 elements at most

 bin_feat = [1 0 1];

% Histogram features row vector 5 elements at most

 his_feat = [0 1 1];

% RST feature row vector 7 elements at most

 rst_feat = [1 0 0 1];

% Texture features  row vector 20 elements at most

 tex_feat = [1 0 0 0];

% Spectral features row vector 2 elements at most

 spec_feat = [0 0];

% Optional texDist,quantLv1,statsType

  texDist  = 4;

  quantLvl = 2;

  statsType = [0 0 1];

  normWidth = 12;

  normHeight = 15;

 % Output feature objects

  b = feature_objects_cvip( input_img, mask_img,objLabel, out_file_name,bin_feat,his_feat, rst_feat, tex_feat, spec_feat, 'statstype', [1 0 1])
The settings for texture features are as follows: 
Texture distance = 2
Quantization level = -1
Statistics type = 1  0  1

b = 

  Columns 1 through 5

    'obj_id'    'ASM_Avg'    'ASM_Var'       'rst1'      'rst4'      
    [     1]    [ 0.2626]    [8.9010e-06]    [0.2164]    [         0]
    [     2]    [ 0.2500]    [1.2646e-11]    [0.1753]    [7.4800e-07]

  Columns 6 through 10

    'Area'     'Centroid_r'    'Centroid_c'    'STD_1'      'STD_2'   
    [10721]    [       125]    [        60]    [58.5869]    [ 67.1601]
    [29346]    [       200]    [       328]    [80.6615]    [100.3378]

  Columns 11 through 14

    'STD_3'       'Skew_1'     'Skew_2'     'Skew_3' 
    [ 72.3852]    [-0.5756]    [-0.9963]    [-1.0611]
    [113.3581]    [-0.6471]    [ 0.1495]    [ 0.4221]

CREDITS

Author: Mehrdad Alvandipour, March 2017
Copyright © 2017-2018 Scott E Umbaugh
For updates visit CVIP Toolbox Website