/** * Bio-Inspired Controller Adapter * * Wraps the standard Controller with Bio-Inspired Perception capabilities. * Provides significant performance improvements while maintaining API compatibility. * * Key features: * - Foveal attention: Processes only regions of interest at full resolution * - Predictive coding: Skips processing when scene is static * - Saccadic sampling: Strategic "glances" at high-saliency regions * * Usage: * ```javascript * import { BioInspiredController } from './bio-inspired-controller.js'; * * const controller = new BioInspiredController({ * inputWidth: 640, * inputHeight: 480, * onUpdate: (data) => console.log(data), * bioInspired: { * enabled: true, * aggressiveSkipping: true, * } * }); * ``` */ import { Controller, ControllerOptions } from './controller.js'; import { BIO_CONFIG } from '../core/perception/index.js'; /** * Extended options for Bio-Inspired Controller */ export interface BioInspiredControllerOptions extends ControllerOptions { bioInspired?: { enabled?: boolean; aggressiveSkipping?: boolean; foveaRadiusRatio?: number; maxSaccades?: number; }; } /** * Bio-Inspired Controller * * Extends the standard Controller with bio-inspired perception capabilities. */ declare class BioInspiredController extends Controller { private bioEngine; private bioEnabled; private bioMetricsInterval; private lastBioResult; constructor(options: BioInspiredControllerOptions); /** * Override processVideo to add bio-inspired perception */ processVideo(input: any): void; /** * Handle a skipped frame using prediction * @private */ private _handleSkippedFrame; /** * Process frame using bio-inspired attention regions * @private */ private _processWithAttention; /** * Detect and match features, optionally limited to specific octaves */ _detectAndMatch(inputData: any, targetIndexes: number[], octavesToProcess?: number[] | null): Promise<{ targetIndex: any; modelViewTransform: any; screenCoords: any; worldCoords: any; featurePoints: any; }>; /** * Communicate with worker for matching phase */ _workerMatch(featurePoints: any, targetIndexes: number[], inputData?: any, expectedScale?: number, octavesToProcess?: number[] | null): Promise; /** * Override _trackAndUpdate to capture active octave for the next frame's orchestration */ _trackAndUpdate(inputData: any, lastModelViewTransform: number[][], targetIndex: number): Promise<{ modelViewTransform: null; screenCoords: never[]; reliabilities: never[]; stabilities: never[]; deformedMesh: null; octaveIndex?: undefined; } | { modelViewTransform: null; screenCoords: any[]; reliabilities: number[]; stabilities: number[]; deformedMesh?: undefined; octaveIndex?: undefined; } | { modelViewTransform: any; screenCoords: any[]; reliabilities: number[]; stabilities: number[]; deformedMesh: any; octaveIndex: any; }>; /** * Flatten a 3x4 matrix to Float32Array * @private */ private _flattenMatrix; /** * Unflatten Float32Array to 3x4 matrix * @private */ private _unflattenMatrix; /** * Get bio-inspired engine metrics */ getBioMetrics(): Object | null; /** * Get last bio processing result */ getLastBioResult(): any; /** * Enable/disable bio-inspired processing dynamically */ setBioEnabled(enabled: boolean): void; /** * Configure bio-inspired engine at runtime */ configureBio(options: Partial): void; /** * Override dispose to clean up bio engine */ dispose(): void; } export { BioInspiredController };