lib/quagga.js
/**
	     * Finds those connected areas which contain at least 6 patches
	     * and returns them ordered DESC by the number of contained patches
	     * @param {Number} maxLabel
	     */
Finds those connected areas which contain at least 6 patches
and returns them ordered DESC by the number of contained patches
@param {Number} maxLabel
Finds those connected areas which contain at least 6 patches and returns them ordered DESC by the number of contained patches @param { Number } maxLabel
function findBiggestConnectedAreas(maxLabel) {
	        var i,
	            sum,
	            labelHist = [],
	            topLabels = [];
	        for (i = 0; i < maxLabel; i++) {
	            labelHist.push(0);
	        }
	        sum = _patchLabelGrid.data.length;
	        while (sum--) {
	            if (_patchLabelGrid.data[sum] > 0) {
	                labelHist[_patchLabelGrid.data[sum] - 1]++;
	            }
	        }
	        labelHist = labelHist.map(function (val, idx) {
	            return {
	                val: val,
	                label: idx + 1
	            };
	        });
	        labelHist.sort(function (a, b) {
	            return b.val - a.val;
	        });
	        topLabels = labelHist.filter(function (el) {
	            return el.val >= 5;
	        });
	        return topLabels;
	    }
function findBiggestConnectedAreas ( maxLabel ) { var i , sum , labelHist = [ ] , topLabels = [ ] ; for ( i = 0 ; i < maxLabel ; i ++ ) { labelHist . push ( 0 ) ; } sum = _patchLabelGrid . data . length ; while ( sum -- ) { if ( _patchLabelGrid . data [ sum ] > 0 ) { labelHist [ _patchLabelGrid . data [ sum ] - 1 ] ++ ; } } labelHist = labelHist . map ( function ( val , idx ) { return { val : val , label : idx + 1 } ; } ) ; labelHist . sort ( function ( a , b ) { return b . val - a . val ; } ) ; topLabels = labelHist . filter ( function ( el ) { return el . val >= 5 ; } ) ; return topLabels ; }
Finds those connected areas which contain at least 6 patches
 and returns them ordered DESC by the number of contained patches
 @param {Number} maxLabel
Finds those connected areas which contain at least 6 patches and returns them ordered DESC by the number of contained patches @param { Number } maxLabel
// extract top areas with at least 6 patches present