ojos
Version:
High level API on top of Mirada (opencv.js) supporting bth browser and node.
45 lines (44 loc) • 1.39 kB
TypeScript
import { CVDataType, Mat } from 'mirada';
import { AbstractOperation } from './abstractOperation';
import { OperationExecBaseOptions } from './types';
export interface MathOptions extends OperationExecBaseOptions, MathConcreteOptions {
}
interface MathBaseOptions {
/**
* second input array of the same size and the same type as src
*/
src2: Mat;
/**
* optional depth of the output array
*/
dtype?: CVDataType;
}
interface AddWeightConcreteOptions {
alpha: number;
beta: number;
gamma: number;
}
export interface AddWeightOptions extends AddWeightConcreteOptions, MathBaseOptions, OperationExecBaseOptions {
}
export interface MathConcreteOptions extends MathBaseOptions, Partial<AddWeightConcreteOptions> {
type: 'add' | 'subtract' | 'divide' | 'multiply' | 'addWeighted';
/**
* only applies to 'add' and 'subtract'
*/
mask?: Mat;
/**
* only applies to 'multiply' and 'divide'
*/
scale?: number;
}
/**
* performs math operations per pixel on images, like add, subtract, divide, addWeighted and multiply
*/
export declare class Math extends AbstractOperation<MathOptions> {
name: string;
description: string;
sameSizeAndType: boolean;
protected validate(o: MathOptions): "alpha, beta, gamma and src2 must be defined" | undefined;
protected _exec(o: MathOptions): void;
}
export {};