dist/ngx-document-scanner/bundles/ngx-document-scanner.umd.js
function () {
                var _this = this;
                return new Promise(function (resolve, reject) {
                    _this.processing.emit(true);
                    setTimeout(function () {
                        // load the image and compute the ratio of the old height to the new height, clone it, and resize it
                        /** @type {?} */
                        var processingResizeRatio = 0.5;
                        /** @type {?} */
                        var dst = cv.imread(_this.editedImage);
                        /** @type {?} */
                        var dsize = new cv.Size(dst.rows * processingResizeRatio, dst.cols * processingResizeRatio);
                        /** @type {?} */
                        var ksize = new cv.Size(5, 5);
                        // convert the image to grayscale, blur it, and find edges in the image
                        cv.cvtColor(dst, dst, cv.COLOR_RGBA2GRAY, 0);
                        cv.GaussianBlur(dst, dst, ksize, 0, 0, cv.BORDER_DEFAULT);
                        cv.Canny(dst, dst, 75, 200);
                        // find contours
                        cv.threshold(dst, dst, 120, 200, cv.THRESH_BINARY);
                        /** @type {?} */
                        var contours = new cv.MatVector();
                        /** @type {?} */
                        var hierarchy = new cv.Mat();
                        cv.findContours(dst, contours, hierarchy, cv.RETR_CCOMP, cv.CHAIN_APPROX_SIMPLE);
                        /** @type {?} */
                        var rect = cv.boundingRect(dst);
                        dst.delete();
                        hierarchy.delete();
                        contours.delete();
                        // transform the rectangle into a set of points
                        Object.keys(rect).forEach(function (key) {
                            rect[key] = rect[key] * _this.imageResizeRatio;
                        });
                        /** @type {?} */
                        var contourCoordinates = [
                            new PositionChangeData({ x: rect.x, y: rect.y }, ['left', 'top']),
                            new PositionChangeData({ x: rect.x + rect.width, y: rect.y }, ['right', 'top']),
                            new PositionChangeData({ x: rect.x + rect.width, y: rect.y + rect.height }, ['right', 'bottom']),
                            new PositionChangeData({ x: rect.x, y: rect.y + rect.height }, ['left', 'bottom']),
                        ];
                        _this.limitsService.repositionPoints(contourCoordinates);
                        // this.processing.emit(false);
                        resolve();
                    }, 30);
                });
            }
function () {
                var _this = this;
                return new Promise(function (resolve, reject) {
                    _this.processing.emit(true);
                    setTimeout(function () {
                        // load the image and compute the ratio of the old height to the new height, clone it, and resize it
                        /** @type {?} */
                        var processingResizeRatio = 0.5;
                        /** @type {?} */
                        var dst = cv.imread(_this.editedImage);
                        /** @type {?} */
                        var dsize = new cv.Size(dst.rows * processingResizeRatio, dst.cols * processingResizeRatio);
                        /** @type {?} */
                        var ksize = new cv.Size(5, 5);
                        // convert the image to grayscale, blur it, and find edges in the image
                        cv.cvtColor(dst, dst, cv.COLOR_RGBA2GRAY, 0);
                        cv.GaussianBlur(dst, dst, ksize, 0, 0, cv.BORDER_DEFAULT);
                        cv.Canny(dst, dst, 75, 200);
                        // find contours
                        cv.threshold(dst, dst, 120, 200, cv.THRESH_BINARY);
                        /** @type {?} */
                        var contours = new cv.MatVector();
                        /** @type {?} */
                        var hierarchy = new cv.Mat();
                        cv.findContours(dst, contours, hierarchy, cv.RETR_CCOMP, cv.CHAIN_APPROX_SIMPLE);
                        /** @type {?} */
                        var rect = cv.boundingRect(dst);
                        dst.delete();
                        hierarchy.delete();
                        contours.delete();
                        // transform the rectangle into a set of points
                        Object.keys(rect).forEach(function (key) {
                            rect[key] = rect[key] * _this.imageResizeRatio;
                        });
                        /** @type {?} */
                        var contourCoordinates = [
                            new PositionChangeData({ x: rect.x, y: rect.y }, ['left', 'top']),
                            new PositionChangeData({ x: rect.x + rect.width, y: rect.y }, ['right', 'top']),
                            new PositionChangeData({ x: rect.x + rect.width, y: rect.y + rect.height }, ['right', 'bottom']),
                            new PositionChangeData({ x: rect.x, y: rect.y + rect.height }, ['left', 'bottom']),
                        ];
                        _this.limitsService.repositionPoints(contourCoordinates);
                        // this.processing.emit(false);
                        resolve();
                    }, 30);
                });
            }
function ( ) { var _this = this ; return new Promise ( function ( resolve , reject ) { _this . processing . emit ( true ) ; setTimeout ( function ( ) { // load the image and compute the ratio of the old height to the new height, clone it, and resize it /** @type {?} */ var processingResizeRatio = 0.5 ; /** @type {?} */ var dst = cv . imread ( _this . editedImage ) ; /** @type {?} */ var dsize = new cv . Size ( dst . rows * processingResizeRatio , dst . cols * processingResizeRatio ) ; /** @type {?} */ var ksize = new cv . Size ( 5 , 5 ) ; // convert the image to grayscale, blur it, and find edges in the image cv . cvtColor ( dst , dst , cv . COLOR_RGBA2GRAY , 0 ) ; cv . GaussianBlur ( dst , dst , ksize , 0 , 0 , cv . BORDER_DEFAULT ) ; cv . Canny ( dst , dst , 75 , 200 ) ; // find contours cv . threshold ( dst , dst , 120 , 200 , cv . THRESH_BINARY ) ; /** @type {?} */ var contours = new cv . MatVector ( ) ; /** @type {?} */ var hierarchy = new cv . Mat ( ) ; cv . findContours ( dst , contours , hierarchy , cv . RETR_CCOMP , cv . CHAIN_APPROX_SIMPLE ) ; /** @type {?} */ var rect = cv . boundingRect ( dst ) ; dst . delete ( ) ; hierarchy . delete ( ) ; contours . delete ( ) ; // transform the rectangle into a set of points Object . keys ( rect ) . forEach ( function ( key ) { rect [ key ] = rect [ key ] * _this . imageResizeRatio ; } ) ; /** @type {?} */ var contourCoordinates = [ new PositionChangeData ( { x : rect . x , y : rect . y } , [ 'left' , 'top' ] ) , new PositionChangeData ( { x : rect . x + rect . width , y : rect . y } , [ 'right' , 'top' ] ) , new PositionChangeData ( { x : rect . x + rect . width , y : rect . y + rect . height } , [ 'right' , 'bottom' ] ) , new PositionChangeData ( { x : rect . x , y : rect . y + rect . height } , [ 'left' , 'bottom' ] ) , ] ; _this . limitsService . repositionPoints ( contourCoordinates ) ; // this.processing.emit(false); resolve ( ) ; } , 30 ) ; } ) ; }
detects the contours of the document and

@private
@return {?}
detects the contours of the document and