MCPcopy Create free account
hub / github.com/Roy3838/Observer / captureFrameAndOCR

Function captureFrameAndOCR

app/src/utils/screenOCR.ts:21–30  ·  view source on GitHub ↗
(_stream: MediaStream, agentId?: string, streamType?: 'camera' | 'screen')

Source from the content-addressed store, hash-verified

19 * @returns OCR result with text, confidence, and success status
20 */
21export async function captureFrameAndOCR(_stream: MediaStream, agentId?: string, streamType?: 'camera' | 'screen'): Promise<OCRResult> {
22 const type = streamType || 'screen';
23 const imageData = await StreamManager.captureFrame(type, agentId);
24
25 if (!imageData) {
26 return { error: 'Failed to capture frame: video not ready' };
27 }
28
29 return performOCR(imageData);
30}
31
32export async function performOCROnBase64(imageData: string): Promise<OCRResult> {
33 return performOCR(imageData);

Callers 1

pre-processor.tsFile · 0.85

Calls 2

performOCRFunction · 0.85
captureFrameMethod · 0.80

Tested by

no test coverage detected