Home > samsung-code > detSingleInitialFeatures.m

detSingleInitialFeatures

PURPOSE ^

DETSINGLEINITIALFEATURES extract features from the initial bounding boxes on a single image.

SYNOPSIS ^

function [Fcls, Freg, bboxes] = detSingleInitialFeatures( I, det_model, bboxes )

DESCRIPTION ^

 DETSINGLEINITIALFEATURES extract features from the initial bounding boxes on a single image.

 Usage:

   I: is an image matrix loaded by imread (e.g., I = imread('000220.jpg');).

   det_model: is the detection model loaded by detInit(...)

   bboxes: can be M*4 maxtrix for intial bounding box coordinates, where 
     M is the number of initial bounding boxes. Each row should be in the
     form of [ymin, xmin, ymax, xmax].
   If bboxes is not specified or empty, Selective Search toolbox is called
   to generated bounding box proposals

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [Fcls, Freg, bboxes] = detSingleInitialFeatures( I, det_model, bboxes )
0002 % DETSINGLEINITIALFEATURES extract features from the initial bounding boxes on a single image.
0003 %
0004 % Usage:
0005 %
0006 %   I: is an image matrix loaded by imread (e.g., I = imread('000220.jpg');).
0007 %
0008 %   det_model: is the detection model loaded by detInit(...)
0009 %
0010 %   bboxes: can be M*4 maxtrix for intial bounding box coordinates, where
0011 %     M is the number of initial bounding boxes. Each row should be in the
0012 %     form of [ymin, xmin, ymax, xmax].
0013 %   If bboxes is not specified or empty, Selective Search toolbox is called
0014 %   to generated bounding box proposals
0015 %
0016 
0017 
0018 % region proposal (Selective Search)
0019 fprintf('Region proposal : '); tic
0020 if ~exist('bboxes','var') || isempty(bboxes)
0021     bboxes = det_model.rp_func( I );
0022     toc
0023 else
0024     fprintf( 'use cached\n' );
0025 end
0026 
0027 % extract features
0028 fprintf('Feature extraction : %d boxes : ', size(bboxes,1) ); tic
0029 
0030 F = features_from_bboxes( I, bboxes, ...
0031     det_model.cnn.canonical_patchsize, ...
0032     det_model.cnn.padding, det_model.cnn.feat_func, ...
0033     det_model.cnn.max_batch_num * det_model.cnn.batch_size );
0034 
0035 Fcls = F{1}; Freg = F{2};
0036 toc
0037 
0038 end

Generated on Thu 18-Dec-2014 22:27:44 by m2html © 2005