OBSCURA VISION WEB SDK · TECHNICAL DEMONSTRATION
Inspect the live document-vision engine.
This page runs directly on the Obscura Vision TypeScript SDK wrapper and WebAssembly runtime. Start your camera to inspect live 4-corner tracking, real runtime telemetry, and planar perspective-corrected image output. All processing runs locally in your browser.
CAMERA VIEWPORT
IDLE
LIVE ENGINE TELEMETRY
IDLE
{
"state": "idle",
"note": "Start the camera to stream real DetectionFrame and CaptureResult payloads."
}
EVENT LOG
- --:--:--INITReady. Waiting for Start Camera.
PERSPECTIVE-CORRECTED OUTPUT
Start the camera, point it at a document, and click Capture Document to inspect the actual planar perspective-corrected image returned by scanner.capture().
- Output Dimensions
- -
- MIME Type
- -
- File Size
- -
- Detection Lock
- -
- Inference / Warp
- -
REAL SDK INTERFACE
Integration example
The exact TypeScript API powering this page. Zero PDF or OCR dependencies required.
import { createObscuraVision } from './sdk/obscura-vision'
const video = document.querySelector<HTMLVideoElement>('#camera')!
const overlay = document.querySelector<SVGSVGElement>('#overlay')!
const scanner = createObscuraVision({
captureMimeType: 'image/png',
onReady: (caps) => console.log('Runtime ready:', caps.backend, caps.threads),
onDetection: (frame) => {
// frame: { status, locked, score, corners, normalizedCorners, supportedSides, inferenceMs, ... }
console.log(frame.status, frame.locked, frame.corners)
},
onError: (err) => console.error(err.code, err.message),
})
await scanner.startCamera(video, overlay)
const result = await scanner.capture()
const previewUrl = URL.createObjectURL(result.blob)
// result: { blob, mimeType, width, height, corners, normalizedCorners, detected, inferenceMs, warpMs }
// Release camera tracks, animation loop, and WebAssembly worker on exit
scanner.stopCamera()
scanner.destroy()
URL.revokeObjectURL(previewUrl)
import { useEffect, useRef, useState } from 'react'
import { createObscuraVision, type DetectionFrame, type ObscuraVisionScanner } from './sdk/obscura-vision'
export function DocumentScannerDemo() {
const videoRef = useRef<HTMLVideoElement>(null)
const overlayRef = useRef<SVGSVGElement>(null)
const scannerRef = useRef<ObscuraVisionScanner | null>(null)
const [telemetry, setTelemetry] = useState<DetectionFrame | null>(null)
const [imageUrl, setImageUrl] = useState<string | null>(null)
useEffect(() => {
const scanner = createObscuraVision({
onDetection: (frame) => setTelemetry(frame),
})
scannerRef.current = scanner
return () => {
scanner.destroy()
scannerRef.current = null
}
}, [])
const handleStart = () =>
scannerRef.current?.startCamera(videoRef.current!, overlayRef.current)
const handleCapture = async () => {
const res = await scannerRef.current?.capture()
if (!res) return
setImageUrl((prev) => {
if (prev) URL.revokeObjectURL(prev)
return URL.createObjectURL(res.blob)
})
}
return (
<div>
<video ref={videoRef} muted playsInline />
<svg ref={overlayRef} />
<button onClick={handleStart}>Start Camera</button>
<button onClick={handleCapture}>Capture Document</button>
<pre>{JSON.stringify(telemetry, null, 2)}</pre>
{imageUrl && <img src={imageUrl} alt="Perspective-corrected capture" />}
</div>
)
}
Ready to embed Obscura Vision in your web app?
One-time perpetual commercial license ($499 single project or $899 unlimited projects). Complete TypeScript source and compiled WASM binaries.