getShapeFactorStructDirectionsV2

PURPOSE ^

GETSHAPEFACTORSTRUCTDIRECTIONSV2.m updates the shape struct according to

SYNOPSIS ^

function [scaleDSKCF_struct, newPosShape, newInterpolationFactor,shapeDSKCF_struct]=getShapeFactorStructDirectionsV2(estimatedShapeBB,pos,estimatedDepth,scaleDSKCF_struct,shapeDSKCF_struct)

DESCRIPTION ^

  GETSHAPEFACTORSTRUCTDIRECTIONSV2.m updates the shape struct according to
  the detected changes

   GETSHAPEFACTORSTRUCTDIRECTIONSV2 this function updates the shape struct
   according to the detected changes

   INPUT:
  -estimatedShapeBB bounding box of the segmented object
  -pos tracker predicted position
  -estimatedDepth UNUSED argument, it is the mean depth value of the
  object
  -scaleDSKCF_struct,shapeDSKCF_struct data structure of shape and scale
  information

  OUTPUT: 
  - updated scaleDSKCF_struct,shapeDSKCF_struct data structure of
  shape and scale information
  -newPosShape target centrouid position according to the segmented area
  -newInterpolationFactor UNUSED VALUE, it is set to 0

  See also INITDSKCFPARAM

  University of Bristol
  Massimo Camplani and Sion Hannuna

  massimo.camplani@bristol.ac.uk
  hannuna@compsci.bristol.ac.uk

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [scaleDSKCF_struct, newPosShape, newInterpolationFactor,shapeDSKCF_struct]=...
0002     getShapeFactorStructDirectionsV2(estimatedShapeBB,pos,estimatedDepth,scaleDSKCF_struct,shapeDSKCF_struct)
0003 %  GETSHAPEFACTORSTRUCTDIRECTIONSV2.m updates the shape struct according to
0004 %  the detected changes
0005 %
0006 %   GETSHAPEFACTORSTRUCTDIRECTIONSV2 this function updates the shape struct
0007 %   according to the detected changes
0008 %
0009 %   INPUT:
0010 %  -estimatedShapeBB bounding box of the segmented object
0011 %  -pos tracker predicted position
0012 %  -estimatedDepth UNUSED argument, it is the mean depth value of the
0013 %  object
0014 %  -scaleDSKCF_struct,shapeDSKCF_struct data structure of shape and scale
0015 %  information
0016 %
0017 %  OUTPUT:
0018 %  - updated scaleDSKCF_struct,shapeDSKCF_struct data structure of
0019 %  shape and scale information
0020 %  -newPosShape target centrouid position according to the segmented area
0021 %  -newInterpolationFactor UNUSED VALUE, it is set to 0
0022 %
0023 %  See also INITDSKCFPARAM
0024 %
0025 %  University of Bristol
0026 %  Massimo Camplani and Sion Hannuna
0027 %
0028 %  massimo.camplani@bristol.ac.uk
0029 %  hannuna@compsci.bristol.ac.uk
0030 
0031 %scaleDSKCF_struct.updated = 0;
0032 
0033 %mode1 = estimatedDepthMode;
0034 %scaleDSKCF_struct.currDepth = mode1;
0035 
0036 %sf = scaleDSKCF_struct.InitialDepth / mode1;
0037 %currentW=scaleDSKCF_struct.target_sz(scaleDSKCF_struct.i).target_sz(1);
0038 %currentH=scaleDSKCF_struct.target_sz(scaleDSKCF_struct.i).target_sz(2);
0039 
0040 newInterpolationFactor=0;
0041 
0042 newPosShape=pos;
0043 [centerX,centerY,width,height]=fromBBtoCentralPoint(estimatedShapeBB);
0044 estimatedShapeSize=[height,width];
0045 %newSize=sqrt(height*width);
0046 newSize=height*width;
0047 
0048 % Check for significant scale difference to current shape
0049 %currentSize=sqrt(scaleDSKCF_struct.target_sz(scaleDSKCF_struct.i).target_sz(1)*scaleDSKCF_struct.target_sz(scaleDSKCF_struct.i).target_sz(2));
0050 %initialSQsize=sqrt(scaleDSKCF_struct.InitialTargetSize(1)*scaleDSKCF_struct.InitialTargetSize(2));
0051 currentSize=(scaleDSKCF_struct.target_sz(scaleDSKCF_struct.i).target_sz(1)*scaleDSKCF_struct.target_sz(scaleDSKCF_struct.i).target_sz(2));
0052 initialSQsize=(scaleDSKCF_struct.InitialTargetSize(1)*scaleDSKCF_struct.InitialTargetSize(2));
0053 
0054 shapeSF =  newSize/(initialSQsize);
0055 shapeOffset =  shapeSF - scaleDSKCF_struct.scales(scaleDSKCF_struct.i);
0056 
0057 %%NOW IF THE CHANGE IS NOT on the small side of the bounding box, check the
0058 %%change on the large one... without really changing the square target area
0059 if(shapeDSKCF_struct.growingStatus==false)
0060     
0061     
0062     if abs(shapeOffset) > scaleDSKCF_struct.minStep*0.93 %% Need to change scale if possible
0063         
0064         newPosShape=round([mean([centerY,pos(1)]),mean([centerX,pos(2)])]);
0065         %%update here segment Struct...
0066         shapeDSKCF_struct.growingStatus=true;
0067         
0068         shapeDSKCF_struct.segmentW=size(shapeDSKCF_struct.cumulativeMask,2);
0069         shapeDSKCF_struct.segmentH=size(shapeDSKCF_struct.cumulativeMask,1);
0070         
0071         %zero pad previous segmentations
0072         segmentWIncrement=round(0.05*shapeDSKCF_struct.segmentW);
0073         segmentHIncrement=round(0.05*shapeDSKCF_struct.segmentH);
0074         
0075         shapeDSKCF_struct.cumulativeMask=padarray(shapeDSKCF_struct.cumulativeMask,[segmentHIncrement segmentWIncrement]);
0076         %you need only from the second one...
0077         
0078         for i=1:size(shapeDSKCF_struct.maskArray,3)
0079             tmpMaskArray(:,:,i)=...
0080                 padarray(shapeDSKCF_struct.maskArray(:,:,i),[segmentHIncrement segmentWIncrement]);
0081         end
0082         shapeDSKCF_struct.maskArray=tmpMaskArray;
0083         
0084     end
0085 end
0086 
0087 end

Generated on Thu 24-Nov-2016 18:03:21 by m2html © 2005