lib/quagga.js
/**
	     * Iterate over the entire image
	     * extract patches
	     */
Iterate over the entire image
extract patches
Iterate over the entire image extract patches
function findPatches() {
	        var i,
	            j,
	            x,
	            y,
	            moments,
	            patchesFound = [],
	            rasterizer,
	            rasterResult,
	            patch;
	        for (i = 0; i < _numPatches.x; i++) {
	            for (j = 0; j < _numPatches.y; j++) {
	                x = _subImageWrapper.size.x * i;
	                y = _subImageWrapper.size.y * j;
	                skeletonize(x, y);
	                _skelImageWrapper.zeroBorder();
	                _array_helper2.default.init(_labelImageWrapper.data, 0);
	                rasterizer = _rasterizer2.default.create(_skelImageWrapper, _labelImageWrapper);
	                rasterResult = rasterizer.rasterize(0);
	                if (false) {
	                    _labelImageWrapper.overlay(_canvasContainer.dom.binary, Math.floor(360 / rasterResult.count), { x: x, y: y });
	                }
	                moments = _labelImageWrapper.moments(rasterResult.count);
	                patchesFound = patchesFound.concat(describePatch(moments, [i, j], x, y));
	            }
	        }
	        if (false) {
	            for (i = 0; i < patchesFound.length; i++) {
	                patch = patchesFound[i];
	                _image_debug2.default.drawRect(patch.pos, _subImageWrapper.size, _canvasContainer.ctx.binary, { color: "#99ff00", lineWidth: 2 });
	            }
	        }
	        return patchesFound;
	    }
function findPatches ( ) { var i , j , x , y , moments , patchesFound = [ ] , rasterizer , rasterResult , patch ; for ( i = 0 ; i < _numPatches . x ; i ++ ) { for ( j = 0 ; j < _numPatches . y ; j ++ ) { x = _subImageWrapper . size . x * i ; y = _subImageWrapper . size . y * j ; skeletonize ( x , y ) ; _skelImageWrapper . zeroBorder ( ) ; _array_helper2 . default . init ( _labelImageWrapper . data , 0 ) ; rasterizer = _rasterizer2 . default . create ( _skelImageWrapper , _labelImageWrapper ) ; rasterResult = rasterizer . rasterize ( 0 ) ; if ( false ) { _labelImageWrapper . overlay ( _canvasContainer . dom . binary , Math . floor ( 360 / rasterResult . count ) , { x : x , y : y } ) ; } moments = _labelImageWrapper . moments ( rasterResult . count ) ; patchesFound = patchesFound . concat ( describePatch ( moments , [ i , j ] , x , y ) ) ; } } if ( false ) { for ( i = 0 ; i < patchesFound . length ; i ++ ) { patch = patchesFound [ i ] ; _image_debug2 . default . drawRect ( patch . pos , _subImageWrapper . size , _canvasContainer . ctx . binary , { color : "#99ff00" , lineWidth : 2 } ) ; } } return patchesFound ; }
Iterate over the entire image
 extract patches
Iterate over the entire image extract patches
// seperate parts // Rasterize, find individual bars // calculate moments from the skeletonized patch // extract eligible patches