Detailed Results: Shows detection coordinates, corners, and quality metrics
Full-Screen Camera: Immersive camera preview experience
Architecture
Backend (/backend/index.ts)
Framework: Hono for HTTP handling
Detection: Mock implementation for demonstration (see Production Notes below)
API Endpoint: POST /api/detect - accepts image uploads and returns detection results
Static Serving: Serves frontend files
Frontend (/frontend/index.html)
Camera Access: Uses getUserMedia API for camera access
Image Capture: Captures frames from video stream to canvas
Upload: Sends captured images to backend via FormData
Results Display: Shows detection results in a modal overlay
Production Notes
Important: This demo uses a mock AprilTag detection implementation because the @monumental-works/apriltag-node package requires native binaries that aren't available in serverless environments like Val Town.
For production use, consider these alternatives:
Cloud Vision APIs:
Google Cloud Vision API
AWS Rekognition Custom Labels
Azure Computer Vision
WASM-based Solutions:
Compile AprilTag detection to WebAssembly
Use browser-based detection libraries
Dedicated Server:
Deploy on a server with native library support
Use Docker containers with pre-compiled binaries
Client-side Detection:
Use JavaScript/WASM AprilTag libraries
Process images directly in the browser
API
POST /api/detect
Accepts an image file and returns AprilTag detection results.