ojos
Version:
High level API on top of Mirada (opencv.js) supporting bth browser and node.
41 lines • 2.81 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 abstractOperation_1 = require("./abstractOperation");
/**
* The function applies bilateral filtering to the input image, as described in bilateralFilter can reduce unwanted noise very well while keeping edges fairly sharp. However, it is very slow compared to most filters.
*
* Sigma values*: For simplicity, you can set the 2 sigma values to be the same. If they are small (< 10), the filter will not have much effect, whereas if they are large (> 150), they will have a very strong effect, making the image look "cartoonish".
*
* Filter size*: Large filters (d > 5) are very slow, so it is recommended to use d=5 for real-time applications, and perhaps d=9 for offline applications that need heavy noise filtering.
*/
var BilateralFilter = /** @class */ (function (_super) {
__extends(BilateralFilter, _super);
function BilateralFilter() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.name = "BilateralFilter";
_this.description = "The function applies bilateral filtering to the input image, as described in bilateralFilter can reduce unwanted noise very well while keeping edges fairly sharp. However, it is very slow compared to most filters. \n \n Sigma values*: For simplicity, you can set the 2 sigma values to be the same. If they are small (< 10), the filter will not have much effect, whereas if they are large (> 150), they will have a very strong effect, making the image look \"cartoonish\".\n \n Filter size*: Large filters (d > 5) are very slow, so it is recommended to use d=5 for real-time applications, and perhaps d=9 for offline applications that need heavy noise filtering.";
_this.noInPlace = true;
_this.sameSizeAndType = true;
_this.validChannels = [1, 3];
return _this;
}
BilateralFilter.prototype._exec = function (o) {
cv.bilateralFilter(o.src, o.dst, o.d || -1, o.sigmaColor, o.sigmaSpace, o.borderType || cv.BORDER_DEFAULT);
};
return BilateralFilter;
}(abstractOperation_1.AbstractOperation));
exports.BilateralFilter = BilateralFilter;
//# sourceMappingURL=bilateralFilter.js.map
;