UNPKG

@flexabrain/mcp-server

Version:

Advanced electrical schematic analysis MCP server with rail engineering expertise

62 lines 1.96 kB
/** * FlexaBrain MCP Server - OCR Service * * Advanced OCR service optimized for electrical schematic text extraction. * Uses Tesseract.js with preprocessing for improved component label recognition. */ import { PSM } from 'tesseract.js'; import { OCRResult } from '../types/schematic.js'; export interface OCROptions { language?: string; psm?: PSM; whitelist?: string; blacklist?: string; tessdata_dir?: string; } export declare class OCRService { private worker; private isInitialized; constructor(); private initializeWorker; /** * Extract text from electrical schematic image * Optimized for component labels and reference designators */ extractText(imagePath: string, options?: OCROptions): Promise<OCRResult>; /** * Extract text from specific regions of interest * Useful for focusing on component labels or specific schematic areas */ extractTextFromRegion(imagePath: string, region: { x: number; y: number; width: number; height: number; }, options?: OCROptions): Promise<OCRResult>; /** * Batch process multiple images for component extraction */ extractTextBatch(imagePaths: string[], options?: OCROptions): Promise<OCRResult[]>; /** * Specialized extraction for electrical component patterns * Pre-configured for common rail electrical component formats */ extractComponentLabels(imagePath: string): Promise<OCRResult>; /** * Extract numerical values from schematics (voltages, currents, etc.) */ extractNumericalValues(imagePath: string): Promise<OCRResult>; /** * Clean up resources */ terminate(): Promise<void>; /** * Get service status and performance metrics */ getStatus(): { initialized: boolean; worker: boolean; }; } export declare const ocrService: OCRService; //# sourceMappingURL=ocr-service.d.ts.map