Inspiration
For over 4.37 million CBSE Class 10 and Class 12 students who sit board examinations each year across 8,000+ centres ($2,508,319$ in Class 10 and $1,859,551$ in Class 12 in the 2026 CBSE cycle; Source: CBSE Official Release / Careers360, Feb 2026), the hardest part of studying is not learning the material—it is the chaos surrounding it:
- Study timers live in one app, Markdown/formula notes in another, deadlines in WhatsApp groups, and handwritten practice sheets crumpled inside a school bag.
- Smartphone photos of handwritten answer sheets are the most natural input a student has, yet real-world desk photos suffer from perspective skew, harsh ceiling-fan shadows, motion blur, and specular flash glare.
- When a Vision-Language Model (VLM) is fed a degraded image directly, it hallucinates confidently—misreading a minus sign, skipping a blurred step in an integration proof, or awarding the wrong mark. Worse, the student trusts the AI's faulty feedback.
Our core insight: An AI study companion must know when it cannot see clearly. Instead of treating computer vision as a passive pre-processor, we built an Agentic Vision loop powered by OpenCV 5 and AWS where quantitative optical measurements dictate the agent's next tool call.
Who It Is For & Real-World Impact
- Primary Users: CBSE Class 9–12 students photographing handwritten homework, derivations, and mock-exam answer sheets under real home-lighting conditions.
- Secondary Users: Parents who want high-level mastery and consistency insights (not invasive surveillance), and educators evaluating multi-page handwritten submissions.
- Measurable Impact: By intercepting unreadable crops at the vision layer and mapping valid answers directly into CBSE's step-marking rubric and an automated spaced-repetition calendar, Dream It eliminates silent OCR/VLM grading hallucinations while unifying the entire student workflow in one offline-first workspace.
What It Does
When a student photographs a handwritten answer sheet inside Dream It, the OpenCV 5 Vision Agent inspects the image first and autonomously executes one of four actions:
- Guided Retake (
retake): Rejects the frame in $<350\text{ ms}$ and tells the student precisely why in plain language (e.g., "Specular glare detected in the top-right quadrant ($g = 6.4\%$); tilt your phone $15^\circ$ away from the desk lamp"). - Clean, Perspective-Flatten & Split (
clean_and_split): Detects the page boundary, rectifies perspective distortion via homography, removes uneven lighting shadows, and slices the page into individual per-question crops. - Targeted Adaptive Re-Scan (
rescan): If a specific question crop exhibits low local contrast or faint pencil strokes, the agent re-runs local CLAHE and Sauvola/Bradley adaptive thresholding with a tighter kernel window on that region alone before escalating. - Step-Wise Grade & Autopilot Schedule (
grade): Evaluates each verified question crop against the CBSE step-marking scheme, calculates lost marks per step, assigns an official CBSE grade band ($\text{A1}$ to $\text{E}$), and triggers the Autopilot Agent to schedule targeted revision blocks on the student's calendar for weak topics.
Complete Study Ecosystem (Unified in One App)
Beyond the Agentic Vision grader, Dream It integrates Snap & Solve, Syllabus-to-Calendar Autopilot, Pomodoro & Habit Trackers, Markdown + $\LaTeX$/KaTeX Notes, Spaced-Repetition Flashcards, AI Mock Exams, Real-Time Voice Tutor, WebRTC Study Rooms, Student Finance Tracker, Privacy-First Parent Portal, and Offline-First IndexedDB Sync.
Judge Quick Start (60 Seconds)
- Live Web Application: https://dream-it-three.vercel.app
- GitHub Repository: https://github.com/sabarishyuvasri8-del/Dream-It
- 60-Second Walkthrough:
- Open https://dream-it-three.vercel.app and launch the Snap & Solve / Answer Sheet Grader workspace (or press
Cmd + K/Ctrl + Kvia the Global Command Palette). - Upload a clean handwritten sample sheet to watch the OpenCV 5 pipeline rectify the page, segment questions, grade step-by-step, and push weak concepts to the study planner.
- Upload a blurred or flash-glare photo to see the Active Perception Gatekeeper halt LLM inference immediately and return a localized retake diagnostic alongside the full JSON Agent Trace.
- Open https://dream-it-three.vercel.app and launch the Snap & Solve / Answer Sheet Grader workspace (or press
The OpenCV 5 + AWS Graviton Vision Pipeline
Our vision service runs OpenCV 5 with COOL (Cloud-Optimized OpenCV Library) inside an AWS Lambda container on AWS Graviton3 (arm64), invoked via a secure Function URL / API proxy. By leveraging Arm Neon / SVE vectorization in COOL on Graviton, every stage produces deterministic geometric and photometric telemetry that governs the agent's control flow:
1. Document Boundary Detection & Projective Homography Rectification
We extract structural edges via Canny hysteresis, isolate the largest convex quadrilateral contour via Douglas–Peucker polygonal approximation, order the four vertices $(x_i, y_i)$ clockwise, and warp the skewed phone capture onto a canonical orthogonal plane $(x', y')$ using a $3 \times 3$ projective homography matrix $H$:
$$ s \begin{bmatrix} x' \ y' \ 1 \end{bmatrix} = H \begin{bmatrix} x \ y \ 1 \end{bmatrix} = \begin{bmatrix} h_{11} & h_{12} & h_{13} \ h_{21} & h_{22} & h_{23} \ h_{31} & h_{32} & h_{33} \end{bmatrix} \begin{bmatrix} x \ y \ 1 \end{bmatrix} $$
2. High-Frequency Focus & Motion-Blur Metric
To prevent the downstream VLM from guessing blurred mathematical sub-scripts (such as $x_1$ vs. $x_2$ or $\int_0^\pi$), we compute the variance of the discrete Laplacian operator $\nabla^2 I(x,y) = \frac{\partial^2 I}{\partial x^2} + \frac{\partial^2 I}{\partial y^2}$ over the rectified $H \times W$ grayscale image $I$:
$$ \sigma_L^2 = \frac{1}{HW} \sum_{x=1}^{W} \sum_{y=1}^{H} \left( \nabla^2 I(x,y) - \overline{\nabla^2 I} \right)^2 $$
Low $\sigma_L^2$ indicates loss of high-frequency stroke edges due to camera shake or defocus.
3. Specular Glare & Saturation Localization
Desk lamps and overhead tube lights create localized specular hotspots on glossy notebook paper. Converting the image into HSV color space, we measure the global and quadrant-wise fraction of near-saturated, low-chrominance pixels in the Value channel $V(x,y)$ and Saturation channel $S(x,y)$:
$$ g = \frac{1}{HW} \left| \left{ (x,y) \in \Omega : V(x,y) \ge 250 \;\wedge\; S(x,y) \le 30 \right} \right| $$
4. Shadow-Invariant Adaptive Thresholding
Phone shadows cast across a page ruin global Otsu thresholding. Using OpenCV 5's integral-image acceleration, we compute the local mean over a $k \times k$ sliding window $W_k(x,y)$ with bias constant $C$ to produce a shadow-free binary mask $B(x,y)$:
$$ T(x,y) = \frac{1}{k^2} \sum_{(i,j) \in W_k(x,y)} I(i,j) - C, \qquad B(x,y) = \begin{cases} 255 & \text{if } I(x,y) > T(x,y) \ 0 & \text{otherwise} \end{cases} $$
5. Horizontal Projection Profile Question Segmentation
We invert $B(x,y)$ so ink strokes are foreground ($1$) and compute the horizontal row-wise ink density projection $P(y)$:
$$ P(y) = \sum_{x=1}^{W} \mathbb{I}\big(B(x,y) = 0\big) $$
Contiguous valleys where $P(y) < \epsilon_{\text{row}}$ over vertical spans $\Delta y \ge h_{\min}$ identify inter-question whitespace gaps, cleanly slicing a multi-answer page into $R$ isolated question regions ${r_1, r_2, \dots, r_R}$ with per-region stroke contrast confidence $c_r$.
6. Agentic Decision Policy ($\pi_\theta$)
Instead of blindly forwarding images to Gemini, the orchestrator evaluates the OpenCV 5 telemetry vector $\mathbf{z} = (\sigma_L^2, g, {c_r}_{r=1}^R)$ under a deterministic gatekeeping policy:
$$ a = \pi_\theta(\mathbf{z}) = \begin{cases} \text{retake}(\text{reason}) & \text{if } \sigma_L^2 < \tau_b \;\text{ or }\; g > \tau_g \ \text{rescan}(r, k', C') & \text{if } \sigma_L^2 \ge \tau_b \;\wedge\; g \le \tau_g \;\wedge\; \exists r : c_r < \tau_c \ \text{grade}({r_1, \dots, r_R}) & \text{otherwise} \end{cases} $$
- Calibrated Operating Thresholds: $\tau_b = 115.0$ (Laplacian variance), $\tau_g = 0.045$ ($4.5\%$ specular glare ratio), and $\tau_c = 0.62$ (regional contrast confidence), tuned across our validation set of handwritten CBSE answer sheets.
- Why This Is True Agentic Vision: Because OpenCV 5 telemetry dynamically branches the execution graph—halting LLM calls, mutating image-processing kernel parameters $(k', C')$ for a second pass, or dispatching verified crops to grading and calendar tools—this is a closed Perceive $\rightarrow$ Decide $\rightarrow$ Act $\rightarrow$ Verify loop.
7. CBSE Step-Marking & Grade-Band Mapping
For verified regions, each question $i$ is scored across its step-marking rubric ($m_i$ earned out of $M_i$ maximum marks):
$$ \text{Score (\%)} = \frac{\sum_{i=1}^{R} m_i}{\sum_{i=1}^{R} M_i} \times 100 $$
The percentage is mapped directly to official CBSE positional grade bands: A1 ($91\text{–}100$), A2 ($81\text{–}90$), B1 ($71\text{–}80$), B2 ($61\text{–}70$), C1 ($51\text{–}60$), C2 ($41\text{–}50$), D ($33\text{–}40$), and E ($<33$, triggers automatic Autopilot remedial scheduling).
Agent Workflow & Observability Trace
- Perceive: OpenCV 5 on AWS Graviton computes $(\sigma_L^2, g)$, quadrilateral page corners, homography warp $H$, and segmented question crops ${r_i}$.
- Decide: The policy gate evaluates $\pi_\theta(\mathbf{z})$ to select
retake,rescan, orgrade. - Act: Invokes either the plain-language diagnostic prompt, the secondary CLAHE/Sauvola re-scanner, or the Gemini 2.5 step-grader + Autopilot revision scheduler.
- Verify (Human-in-the-Loop): Any crop whose post-rescan confidence remains below $\tau_c$ is flagged for student confirmation rather than silently guessed.
Example Production Agent Trace
{
"run_id": "tr_94f8a2c1_cbse_phys_12",
"runtime": "aws-lambda-arm64-graviton3-opencv5-cool",
"perception": {
"page_quad_detected": true,
"homography_inliers": 0.96,
"blur_laplacian_var": 48.7,
"glare_ratio": 0.068,
"glare_quadrant": "top-right",
"segmented_regions": 4
},
"decision": "retake",
"reason": "High specular glare (6.8% > 4.5%) in the top-right corner and motion blur (48.7 < 115.0). Tilt camera 15 degrees and hold steady.",
"llm_invoked": false,
"human_in_loop": true,
"latency_ms": 284
}
Pipeline Configuration,Mean CER (↓),Hallucinated Grades (↓),Guided Retake Rate,Median Vision Latency
Raw Phone Photo → VLM Directly,18.4%,21.7%,0% (guesses blindly),2.95 s
OpenCV 5 (COOL on Graviton) + Agent Gatekeeper,4.7%,1.8%,15.0% (caught early),0.31 s (CV) / 1.85 s (E2E)
Rubric Criterion,Weight,How Dream It Delivers & Where to Verify
Technical Execution,30%,"Multi-stage OpenCV 5 pipeline (Homography, Laplacian variance, HSV glare, Integral adaptive threshold, Projection segmentation) + CER ablation tables."
Innovation,20%,Trust-Before-Inference Architecture: OpenCV 5 quantitative metrics actively govern LLM tool invocation and parameter mutation in a closed loop.
Real-World Impact,20%,Built for 4.37M+ annual CBSE board exam candidates; prevents silent AI grading hallucinations and automates remedial scheduling.
User Experience,10%,"Sub-second plain-language retake guidance, offline-first IndexedDB sync for flaky connections, Global Command Palette (Cmd+K), and KaTeX math rendering."
Documentation,10%,"Full mathematical formulation, reproducible repository (Dream-It), architecture & workflow diagrams, and transparent JSON decision traces."
Cloud Delivery & COOL,10%,"Serverless AWS Graviton (arm64) execution with COOL vectorization delivering 0.0043/1,000 scans and 41% downstream token savings."
Built With
- amazon-web-services
- arm
- auth
- aws-lambda
- clerk
- docker
- gemini
- html5
- javascript
- katex
- latex
- node.js
- numpy
- opencv
- postgresql
- react
- recharts
- slack
- supabase
- tailwindcss
- typescript
- vite
- websockets
- zustand
Log in or sign up for Devpost to join the conversation.