From 76e83fbe06fd190b337d988346f4339f84c248ed Mon Sep 17 00:00:00 2001 From: vincent Date: Thu, 26 Apr 2018 11:14:27 +0200 Subject: [PATCH] added some missing typescript bindings --- lib/typings/Mat.d.ts | 8 ++++---- lib/typings/cv.d.ts | 9 +++++++-- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/lib/typings/Mat.d.ts b/lib/typings/Mat.d.ts index 4fbd94e0d..addd28c10 100644 --- a/lib/typings/Mat.d.ts +++ b/lib/typings/Mat.d.ts @@ -167,6 +167,10 @@ export class Mat { getOptimalNewCameraMatrix(distCoeffs: number[], imageSize: Size, alpha: number, newImageSize?: Size, centerPrincipalPoint?: boolean): { out: Mat, validPixROI: Rect }; getOptimalNewCameraMatrixAsync(distCoeffs: number[], imageSize: Size, alpha: number, newImageSize?: Size, centerPrincipalPoint?: boolean): Promise<{ out: Mat, validPixROI: Rect }>; getRegion(region: Rect): Mat; + goodFeaturesToTrack(maxCorners: number, qualityLevel: number, minDistance: number, mask?: Mat, blockSize?: number, useHarrisDetector?: boolean, harrisK?: number): Point2[]; + goodFeaturesToTrackAsync(maxCorners: number, qualityLevel: number, minDistance: number, mask?: Mat, blockSize?: number, useHarrisDetector?: boolean, harrisK?: number): Promise; + goodFeaturesToTrack(maxCorners: number, qualityLevel: number, minDistance: number, mask?: Mat, blockSize?: number, gradientSize?: number, useHarrisDetector?: boolean, harrisK?: number): Point2[]; + goodFeaturesToTrackAsync(maxCorners: number, qualityLevel: number, minDistance: number, mask?: Mat, blockSize?: number, gradientSize?: number, useHarrisDetector?: boolean, harrisK?: number): Promise; grabCut(mask: Mat, rect: Rect, bgdModel: Mat, fgdModel: Mat, iterCount: number, mode: number): void; grabCutAsync(mask: Mat, rect: Rect, bgdModel: Mat, fgdModel: Mat, iterCount: number, mode: number): Promise; hDiv(otherMat: Mat): Mat; @@ -294,10 +298,6 @@ export class Mat { warpPerspectiveAsync(transforMationMatrix: Mat, size?: Size, flags?: number, borderMode?: number): Promise; watershed(markers: Mat): Mat; watershedAsync(markers: Mat): Promise; - goodFeaturesToTrack(maxCorners: number, qualityLevel: number, minDistance: number, mask?: Mat, blockSize?: number, useHarrisDetector?: boolean, harrisK?: number): Point2[]; - goodFeaturesToTrackAsync(maxCorners: number, qualityLevel: number, minDistance: number, mask?: Mat, blockSize?: number, useHarrisDetector?: boolean, harrisK?: number): Promise; - goodFeaturesToTrack(maxCorners: number, qualityLevel: number, minDistance: number, mask?: Mat, blockSize?: number, gradientSize?: number, useHarrisDetector?: boolean, harrisK?: number): Point2[]; - goodFeaturesToTrackAsync(maxCorners: number, qualityLevel: number, minDistance: number, mask?: Mat, blockSize?: number, gradientSize?: number, useHarrisDetector?: boolean, harrisK?: number): Promise; static eye(rows: number, cols: number, type: number): Mat; } diff --git a/lib/typings/cv.d.ts b/lib/typings/cv.d.ts index 86b3fa71c..14938264c 100644 --- a/lib/typings/cv.d.ts +++ b/lib/typings/cv.d.ts @@ -55,7 +55,7 @@ export function findEssentialMat(points1: Point2[], points2: Point2[], focal?: n export function findEssentialMatAsync(points1: Point2[], points2: Point2[], focal?: number, pp?: Point2, method?: number, prob?: number, threshold?: number): Promise<{ E: Mat, mask: Mat }>; export function findFundamentalMat(points1: Point2[], points2: Point2[], method?: number, param1?: number, param2?: number): { F: Mat, mask: Mat }; export function findFundamentalMatAsync(points1: Point2[], points2: Point2[], method?: number, param1?: number, param2?: number): Promise<{ F: Mat, mask: Mat }>; -export function findHomography(srcPoints: Point2[], dstPoints: Point2[], method?: number, ransacReprojThreshold?: number, mask?: Mat, maxIters?: number, confidence?: number): Mat; +export function findHomography(srcPoints: Point2[], dstPoints: Point2[], method?: number, ransacReprojThreshold?: number, maxIters?: number, confidence?: number): { homography: Mat, mask: Mat }; export function fitLine(points: Point2[], distType: number, param: number, reps: number, aeps: number): number[]; export function fitLine(points: Point3[], distType: number, param: number, reps: number, aeps: number): number[]; export function getAffineTransform(srcPoints: Point2[], dstPoints: Point2[]): Mat; @@ -156,4 +156,9 @@ export interface TextLine extends FontParams { } export function drawDetection(img: Mat, inputRect: Rect, opts?: DrawDetectionParams): Rect; -export function drawTextBox(img: Mat, upperLeft: { x: number, y: number }, textLines: TextLine[], alpha: number): Mat; \ No newline at end of file +export function drawTextBox(img: Mat, upperLeft: { x: number, y: number }, textLines: TextLine[], alpha: number): Mat; + +export function isCustomMatAllocatorEnabled(): boolean; +export function dangerousEnableCustomMatAllocator(): boolean; +export function dangerousDisableCustomMatAllocator(): boolean; +export function getMemMetrics(): { TotalAlloc: number, TotalKnownByJS: number, NumAllocations: number, NumDeAllocations: number }; \ No newline at end of file