Fix OpenCV Mat leak when stitching/connecting PCB images
This commit is contained in:
parent
6e8079dd50
commit
70104b33ac
1 changed files with 3 additions and 1 deletions
|
|
@ -105,7 +105,9 @@ class CVManager {
|
||||||
const { mat, scale, width, height } = await this.createSmallMat(blob);
|
const { mat, scale, width, height } = await this.createSmallMat(blob);
|
||||||
const kp = new cv.KeyPointVector();
|
const kp = new cv.KeyPointVector();
|
||||||
const des = new cv.Mat();
|
const des = new cv.Mat();
|
||||||
this.detector.detectAndCompute(mat, new cv.Mat(), kp, des);
|
const mask = new cv.Mat();
|
||||||
|
this.detector.detectAndCompute(mat, mask, kp, des);
|
||||||
|
mask.delete();
|
||||||
mat.delete();
|
mat.delete();
|
||||||
return { kp, des, scale, w: width, h: height };
|
return { kp, des, scale, w: width, h: height };
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue