File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 142142 return this . minDimension ;
143143 } ;
144144
145+ /**
146+ * Sets the maximum dimension to classify a rectangle.
147+ * @param {number } maxDimension
148+ */
149+ tracking . ColorTracker . prototype . getMaxDimension = function ( ) {
150+ return this . maxDimension ;
151+ }
152+
145153 /**
146154 * Gets the minimum group size to be classified as a rectangle.
147155 * @return {number }
187195 var intersects ;
188196 var results = [ ] ;
189197 var minDimension = this . getMinDimension ( ) ;
198+ var maxDimension = this . getMaxDimension ( ) ;
199+
190200 for ( var r = 0 ; r < rects . length ; r ++ ) {
191201 var r1 = rects [ r ] ;
192202 intersects = true ;
205215 break ;
206216 }
207217 }
218+
208219 if ( intersects ) {
209220 if ( r1 . width >= minDimension && r1 . height >= minDimension ) {
210- results . push ( r1 ) ;
221+ if ( r1 . width <= maxDimension && r1 . height <= maxDimension ) {
222+ results . push ( r1 ) ;
223+ }
211224 }
212225 }
213226 }
227+
214228 return results ;
215229 } ;
216230
230244 this . minDimension = minDimension ;
231245 } ;
232246
247+ /**
248+ * Sets the maximum dimension to classify a rectangle.
249+ * @return {number }
250+ */
251+ tracking . ColorTracker . prototype . setMaxDimension = function ( maxDimension ) {
252+ this . maxDimension = maxDimension ;
253+ }
254+
233255 /**
234256 * Sets the minimum group size to be classified as a rectangle.
235257 * @param {number } minGroupSize
You can’t perform that action at this time.
0 commit comments