HIST_FEATURE_CVIP
hist_feature_cvip() - calculates the 5 first order histogram features for an object.
Contents
SYNTAX
h = hist_feature_cvip(originalImage, labeledImage, objLabel,featSelect)
Input Parameters include :
- originalImage -The orignial image which can be grayscale or RGB.
- labelImage - Label image of MxN size with single object or multiple objects. Each object has unique gray value.
- objLabel - Labels of the objects. Column vector (Yx1) or Yx2 matrix. If row vector,objLabel must be unique gray value corresponding to each object.If Yx2 matrix,objLabel must have row index in first column and col index in second column for each object.
- featSelect - Empty matrix '[ ]' or Row vector of size 1x5 with values 1 or 0 (1->Select or 0->No Select). If [ ], then all 5 features are selected. The elements of featSelect correspond respectively to Mean, STD, Skew, Energy and Entropy.
Output Parameter include :
- histfeats - Cell array containing object name, object label, and feature data for selected features.
DESCRIPTION
The function calculates the five first order HIstogram features of an input image or a binary object. The FIve features correspond to the Mean, Standard Deviation, Skew, Energy and Entropy. The function calculates the user specified features from these five histogram features of a binary object in an image characterized by the label given as an input to the function.
REFERENCE
1. Scott E Umbaugh. DIGITAL IMAGE PROCESSING AND ANALYSIS: Applications with MATLAB and CVIPtools, 3rd Edition.
EXAMPLE
% Read image originalImage = imread('Stripey.jpg'); % Labeled Image labeledImage = zeros(size(originalImage)); labeledImage = labeledImage(:,:,1); labeledImage(50:200,25:95) = 1; labeledImage(100:300,255:400) = 2; % Feature selection featSelect = [1 0 1 0 1]; % Object label objLabel = [1 ;2]; % Output features output = hist_feature_cvip(originalImage, labeledImage,objLabel,featSelect)
output = Columns 1 through 5 'obj_id' 'Mean_1' 'Mean_2' 'Mean_3' 'Skew_1' [ 1] [155.0287] [161.6867] [174.3474] [-0.5756] [ 2] [340.3228] [225.1499] [178.3310] [-0.6471] Columns 6 through 10 'Skew_2' 'Skew_3' 'Entropy_1' 'Entropy_2' 'Entropy_3' [-0.9963] [-1.0611] [ 6.9187] [ 7.0673] [ 7.1503] [ 0.1495] [ 0.4221] [ 7.2843] [ 7.6111] [ 7.6501]
CREDITS
Author: Mehrdad Alvandipour, March 2017
Copyright © 2017-2018 Scott
E Umbaugh
For updates visit CVIP Toolbox Website