ojos
Version:
High level API on top of Mirada (opencv.js) supporting bth browser and node.
38 lines • 1.79 kB
JavaScript
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
var misc_utils_of_mine_generic_1 = require("misc-utils-of-mine-generic");
var abstractOperation_1 = require("./abstractOperation");
/**
* transforms a grayscale image to a binary image
*/
var AdaptiveThreshold = /** @class */ (function (_super) {
__extends(AdaptiveThreshold, _super);
function AdaptiveThreshold() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.name = 'AdaptiveThreshold';
_this.description = 'transforms a grayscale image to a binary image';
_this.validChannels = [1];
_this.sameSizeAndType = true;
return _this;
}
AdaptiveThreshold.prototype._exec = function (o) {
misc_utils_of_mine_generic_1.checkThrow(!o.blockSize || o.blockSize === 1 || o.blockSize % 2 !== 0, 'MedianBlur Blur size must be odd and greater than 2');
cv.adaptiveThreshold(o.src, o.dst, o.maxval, o.adaptiveMethod, o.thresholdType, o.blockSize, o.C);
};
return AdaptiveThreshold;
}(abstractOperation_1.AbstractOperation));
exports.AdaptiveThreshold = AdaptiveThreshold;
//# sourceMappingURL=adaptiveThreshold.js.map
;