INITDISTRIBUTIONFAST.m initializes the depth distribution of the DS-KCF tracker INITDISTRIBUTIONFAST function initializes the depth distribution of the tracked object at the beginning of the sequence. In particular, the fast depth segmentation algorithm described in [1] is used INPUT: -bbIn bounding box containing the tracked object. Format of the bounding box is [topLeftX, topLeftY, bottomRightX, bottomRightY] read as [rowIndexTopLeft, columnIndexTopLeft,rowIndexBottomRight, columnIndexBottomRight] -depth16Bit depth data in mm -noData binary mask containing information about missing depth pixels OUTPUT -targetDepth mean depth value of the cluster containing the target -targetStd standard deviation of the cluster containing the target -LabelReg connected component with cluster labels -regionIndex label of the target's cluster (or the closest object to the camera) -Centers depth value corresponding to the identified connected components -LUT look-up-table containing the connected component labels and the corresponding mean depth value See also ROIFROMBB, FASTDEPTHSEGMENTATIONDSKCF_INITFRAME, WRAPPERDSKCF [1] S. Hannuna, M. Camplani, J. Hall, M. Mirmehdi, D. Damen, T. Burghardt, A.Paiement, L. Tao, DS-KCF: A real-time tracker for RGB-D data, Journal of Real-Time Image Processing University of Bristol Massimo Camplani and Sion Hannuna massimo.camplani@bristol.ac.uk hannuna@compsci.bristol.ac.uk
0001 function [targetDepth,targetStd,LabelReg,regionIndex,Centers,LUT] = initDistributionFast(bbIn, depth16Bit,noData) 0002 % INITDISTRIBUTIONFAST.m initializes the depth distribution of the DS-KCF tracker 0003 % 0004 % INITDISTRIBUTIONFAST function initializes the depth distribution of the 0005 % tracked object at the beginning of the sequence. In particular, the 0006 % fast depth segmentation algorithm described in [1] is used 0007 % 0008 % INPUT: 0009 % -bbIn bounding box containing the tracked object. Format of the bounding 0010 % box is [topLeftX, topLeftY, bottomRightX, bottomRightY] read as 0011 % [rowIndexTopLeft, columnIndexTopLeft,rowIndexBottomRight, 0012 % columnIndexBottomRight] 0013 % -depth16Bit depth data in mm 0014 % -noData binary mask containing information about missing depth pixels 0015 % 0016 % OUTPUT 0017 % -targetDepth mean depth value of the cluster containing the target 0018 % -targetStd standard deviation of the cluster containing the target 0019 % -LabelReg connected component with cluster labels 0020 % -regionIndex label of the target's cluster (or the closest object to the 0021 % camera) 0022 % -Centers depth value corresponding to the identified connected 0023 % components 0024 % -LUT look-up-table containing the connected component labels and the 0025 % corresponding mean depth value 0026 % 0027 % See also ROIFROMBB, FASTDEPTHSEGMENTATIONDSKCF_INITFRAME, WRAPPERDSKCF 0028 % 0029 % [1] S. Hannuna, M. Camplani, J. Hall, M. Mirmehdi, D. Damen, T. 0030 % Burghardt, A.Paiement, L. Tao, DS-KCF: A real-time tracker for RGB-D 0031 % data, Journal of Real-Time Image Processing 0032 % 0033 % 0034 % University of Bristol 0035 % Massimo Camplani and Sion Hannuna 0036 % 0037 % massimo.camplani@bristol.ac.uk 0038 % hannuna@compsci.bristol.ac.uk 0039 0040 %extract the target roi, from the depth and the nodata mask 0041 front_depth=roiFromBB(depth16Bit,bbIn); 0042 depthNoData=roiFromBB(noData,bbIn); 0043 0044 [LabelReg,Centers,LUT]=fastDepthSegmentationDSKCF_initFrameV2(front_depth,3,depthNoData,1,50,[-1 -1 -1],1); 0045 0046 %for the initialization the object belong to the cluster with the smaller 0047 %depth (see [1] for more details) 0048 [targetDepth,regionIndex]=min(Centers); 0049 %extract all the depth value belonging to that cluster 0050 depthVector=double(front_depth(LabelReg==regionIndex)); 0051 %then calculate the standard deviation 0052 targetStd=std(depthVector); 0053 0054 end 0055