Home > SuperSegger > Internal > getBBpad.m

getBBpad

PURPOSE ^

getBBpad : coordinates of bounding box with extra 'pad' pixels along x & y.

SYNOPSIS ^

function [xx,yy] = getBBpad( bb1,ss,pad )

DESCRIPTION ^

 getBBpad : coordinates of bounding box with extra 'pad' pixels along x & y.

 INPUT :
       bb1: bounding box [x, y, width, height]
       ss : size of the phase image
       pad :  pixels to be added right,left, above and below of the bounding box
 OUTPUT :
       xx : array from start to end of bounding box along x
       yy : array from start to end of bounding box along y

 Copyright (C) 2016 Wiggins Lab 
 Written by Paul Wiggins.
 University of Washington, 2016
 This file is part of SuperSegger.
 
 SuperSegger is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation, either version 3 of the License, or
 (at your option) any later version.
 
 SuperSegger is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
 along with SuperSegger.  If not, see <http://www.gnu.org/licenses/>.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [xx,yy] = getBBpad( bb1,ss,pad )
0002 % getBBpad : coordinates of bounding box with extra 'pad' pixels along x & y.
0003 %
0004 % INPUT :
0005 %       bb1: bounding box [x, y, width, height]
0006 %       ss : size of the phase image
0007 %       pad :  pixels to be added right,left, above and below of the bounding box
0008 % OUTPUT :
0009 %       xx : array from start to end of bounding box along x
0010 %       yy : array from start to end of bounding box along y
0011 %
0012 % Copyright (C) 2016 Wiggins Lab
0013 % Written by Paul Wiggins.
0014 % University of Washington, 2016
0015 % This file is part of SuperSegger.
0016 %
0017 % SuperSegger is free software: you can redistribute it and/or modify
0018 % it under the terms of the GNU General Public License as published by
0019 % the Free Software Foundation, either version 3 of the License, or
0020 % (at your option) any later version.
0021 %
0022 % SuperSegger is distributed in the hope that it will be useful,
0023 % but WITHOUT ANY WARRANTY; without even the implied warranty of
0024 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0025 % GNU General Public License for more details.
0026 %
0027 % You should have received a copy of the GNU General Public License
0028 % along with SuperSegger.  If not, see <http://www.gnu.org/licenses/>.
0029 
0030 ymin = ceil(bb1(2))-pad;
0031 xmin = ceil(bb1(1))-pad;
0032 ymax = ymin+floor(bb1(4))+2*pad-1;
0033 xmax = xmin+floor(bb1(3))+2*pad-1;
0034 
0035 yy = max([1,ymin]):min([ymax,ss(1)]);
0036 xx = max([1,xmin]):min([xmax,ss(2)]);
0037 
0038 end

Generated on Thu 19-Jan-2017 13:55:21 by m2html © 2005