REGIONSEGMENTSFAST function for extracting target candidates from the occluded area REGIONSEGMENTSFAST.m this function analyzes the segmented occluding area and extract meaningful target candidates. For more information about how DSKCF handles occlusions see [1]. INPUT: - labelMatrix image containing pixels' label corresponding to the segmentation - imageCoordinateOffset bounding box containing the occluding area n the format [topLeftX, topLeftY, bottomRightX, bottomRightY] read as [columnIndexTopLeft, rowIndexTopLeft, columnIndexBottomRight, rowIndexBottomRight] OUTPUT - tarListFull Matrix that contains (in each column) target candidates' bounding box in the format [topLeftX, topLeftY, bottomRightX, bottomRightY] read as [columnIndexTopLeft, rowIndexTopLeft, columnIndexBottomRight, rowIndexBottomRight] See also TARGETSEARCHDSKCF [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 %REGIONSEGMENTSFAST function for extracting target candidates from the occluded area 0002 % 0003 %REGIONSEGMENTSFAST.m this function analyzes the segmented occluding area 0004 %and extract meaningful target candidates. For more information about how 0005 %DSKCF handles occlusions see [1]. 0006 % 0007 % 0008 % INPUT: 0009 % - labelMatrix image containing pixels' label corresponding to the 0010 % segmentation 0011 % - imageCoordinateOffset bounding box containing the occluding area n 0012 % the format [topLeftX, topLeftY, bottomRightX, bottomRightY] read as 0013 % [columnIndexTopLeft, rowIndexTopLeft, columnIndexBottomRight, 0014 % rowIndexBottomRight] 0015 % 0016 % OUTPUT - tarListFull Matrix that contains (in each column) target 0017 % candidates' bounding box in the format [topLeftX, topLeftY, 0018 % bottomRightX, bottomRightY] read as [columnIndexTopLeft, 0019 % rowIndexTopLeft, columnIndexBottomRight, rowIndexBottomRight] 0020 % 0021 % See also TARGETSEARCHDSKCF 0022 % 0023 % 0024 % [1] S. Hannuna, M. Camplani, J. Hall, M. Mirmehdi, D. Damen, T. 0025 % Burghardt, A. Paiement, L. Tao, DS-KCF: A real-time tracker for RGB-D 0026 % data, Journal of Real-Time Image Processing 0027 % 0028 % 0029 % University of Bristol 0030 % Massimo Camplani and Sion Hannuna 0031 % 0032 % massimo.camplani@bristol.ac.uk 0033 % hannuna@compsci.bristol.ac.uk 0034 0035 function [ tarListFull, areaVector ] = regionSegmentsFast(labelMatrix, imageCoordinateOffset) 0036 tarListFull=[]; 0037 0038 0039 tarBBProp=regionprops(labelMatrix,'BoundingBox','Area'); 0040 areaVector=cat(1, tarBBProp.Area); 0041 0042 for i=1:length(areaVector) 0043 0044 tmpBB=tarBBProp(i).BoundingBox; 0045 %use extrema points..... 0046 tmpBB=ceil([tmpBB(1), tmpBB(2),tmpBB(1)+tmpBB(3),tmpBB(2)+tmpBB(4)]); 0047 %and recenter to the entire image coordinate 0048 tmpBB([1 3])=tmpBB([1 3])+imageCoordinateOffset(1); 0049 tmpBB([2 4])=tmpBB([2 4])+imageCoordinateOffset(2); 0050 0051 tarListFull=[tarListFull, tmpBB']; 0052 end 0053 0054 end 0055 0056