修复 image wrapper多余release导致崩溃的问题

This commit is contained in:
hyb1996
2018-10-28 09:02:30 +08:00
parent 245d13c377
commit e4a92531c3
8 changed files with 24 additions and 18 deletions

View File

@@ -122,6 +122,20 @@ module.exports = function (__runtime__, scope) {
return matToImage(mat);
}
images.resize = function(img, size, interpolation) {
var mat = newMat();
interpolation = Imgproc["INTER_" + (interpolation || "LINEAR")];
Imgproc.resize(img.mat, mat, newSize(size), 0, 0, interpolation);
return matToImage(mat);
}
images.scale = function(img, fx, fy, interpolation) {
var mat = newMat();
interpolation = Imgproc["INTER_" + (interpolation || "LINEAR")];
Imgproc.resize(img.mat, mat, newSize([0, 0]), fx, fy, interpolation);
return matToImage(mat);
}
images.detectsColor = function (img, color, x, y, threshold, algorithm) {
color = parseColor(color);
algorithm = algorithm || "diff";