The frame-by-frame stitcher accumulated drift, so later passes landed rotated and offset, doubling text. myscan/pagegraph.py instead solves all frame poses together: ECC odometry between consecutive frames (bridging single corrupt frames), SIFT+RANSAC loop closures between overlapping passes, and a robust Gauss-Newton pose graph. Loop matches must agree over the whole overlap, which rejects matches on repeated text. Off-page frames and frames that disagree with the mosaic are left out of the render. calib.Undistort applies the EEPROM lens model (OpenCV k1..k3, p1, p2 plus the tilt homography, as decoded in EEPROM.md); up to 8.8 px at the corners. scan.py registers frames on a worker thread so capture no longer drops frames, then assembles the page after the stop press (~11 s for a full page). stitch.py uses the new assembly by default; --live keeps the old one. EEPROM.md documents the full calibration blob layout, checksum and signature. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1.4 KiB
1.4 KiB
myscan
Linux driver tools for the Hama myScan (00052343) scanner mouse, a Dacuda design (USB 274f:c001: UVC MJPEG camera + HID mouse).
myscan/xu.py— UVC extension-unit access: switch between mouse and scan mode, LEDs, exposuremyscan/frame.py— fix the lying JPEG header and decode the per-frame sensor record (laser dx/dy)myscan/calib.py— per-device calibration from the mouse's EEPROM: colour gains, flat field, lens undistortionmyscan/pagegraph.py— assemble a page from all frames at once: frame-to-frame registration, loop closures between passes, pose-graph optimisation (used byscan.pyandstitch.py)myscan/stitch.py— the older live, frame-by-frame stitcher (stitch.py --live) and shared helperstools/scan.py— scan with the button:python tools/scan.py(press to start, press again to stop)tools/record.py— record a scan session:python tools/record.py -d 25 -o scan_texttools/stitch.py— stitch a recording:python tools/stitch.py scan_text->scan_text/page.pngtools/probe.py— log raw frames and HID reports side by sidetools/scantest.py— minimal scan-mode test: grab frames, decode records, restore mouse mode
See FINDINGS.md for the protocol and calibration notes, and EEPROM.md for the calibration blob.
Setup: python -m venv .venv && .venv/bin/pip install -r requirements.txt