~shahper.shahin
Back to Selected Work
Computer Vision & SystemsYear 2025

Non-Destructive Optical Document Highlighter & AI Engine

Hardware-software system for non-destructive physical text document highlighting, OCR extraction, and AI processing.

PythonOpenCVTesseract OCRC++Color Space SegmentationAdaptive Thresholding
01

The Problem

Physical highlighting permanently marks books, library archives, and legal documents, while digital notes remain disconnected from the physical source material.

Designed an optical capture workflow that isolates color-coded digital highlights without altering physical paper, pairing computer vision segmentation with text extraction.

02

The System & Architecture

Optical sensor capture workflow feeding an OpenCV image processing pipeline with HSV thresholding, contour detection, OCR bounding box extraction, and structured note sync.

System Schematic

Optical Highlight & Extraction Pipeline

4 Components • 3 Data Paths
client

Optical Sensor

Physical Page Capture

service

OpenCV Pipeline

HSV Segmentation

service

OCR Engine

Text Bounding Boxes

storage

Structured Notes

Categorized Sync

Execution Sequence & Interconnects
01Optical SensorOpenCV PipelineRaw Image Frames
02OpenCV PipelineOCR EngineSegmented ROIs
03OCR EngineStructured NotesStructured Notes
03

My Engineering Work

  • Formulated adaptive HSV color filtering thresholds to reliably detect transparent highlighter tints across varying illumination
  • Engineered spatial bounding box merging algorithm to reconstruct multiline paragraphs from fragmented character contours
  • Authored and submitted formal patent specification with the Indian Patent Office (Application No. 202511052205)
hsv_segmentation.py
python
def extract_highlighted_regions(image_bgr, lower_hsv, upper_hsv):
    hsv = cv2.cvtColor(image_bgr, cv2.COLOR_BGR2HSV)
    mask = cv2.inRange(hsv, lower_hsv, upper_hsv)
    kernel = cv2.getStructuringElement(cv2.MORPH_RECT, (5, 5))
    cleaned = cv2.morphologyEx(mask, cv2.MORPH_CLOSE, kernel)
    contours, _ = cv2.findContours(cleaned, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)
    return [cv2.boundingRect(c) for c in contours if cv2.contourArea(c) > 100]
04

Decisions & Trade-offs

Challenge: Ambient room lighting variations and page curvature causing false-positive color segmentation

Solution: Applied adaptive histogram equalization and dynamic white balancing prior to color space conversion

Engineering Trade-off: Added ~25ms frame preprocessing overhead to achieve consistent color isolation under both warm and cool light
05

Validation & Limitations

// Evaluated & Working
  • Filed Indian Patent Application No. 202511052205 (Inventor)
  • Verified high-accuracy OCR extraction across standard printed academic typography
// Current Limitations & Next Steps
  • Performance degrades on handwritten cursive scripts and heavily creased physical paper
  • Physical hardware rig requires consistent document positioning for optimal focal calibration
06

Evidence & Verification

Verify the implementation directly via source code, commit history, and setup documentation:

Ref: Indian Patent Application No. 202511052205; academic specifications and OpenCV prototype benchmarks