Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

Matching rescanned pages to a damaged PDF with SIFT, and admitting when it can't

说明与用途

使用 Darnleaf 将损坏的 PDF 页面替换为新扫描件,利用 SIFT 和 RANSAC 进行精确匹配,并保持书签和链接不变。

问题

A scanned PDF had pages ruined by a coffee ring and a crease, and fresh scans of those pages were available in no particular order.

结果

On 90 synthetic rescans, 45 were Clear and none were wrong; the right page was listed for 89 of 90 rescans. The real wrong rate could still be about 6.7%.

工作流

  • Render each PDF page with PDFium and reduce size.
  • Extract a subset of SIFT features from each rendered page.
  • For each rescan, shortlist ten candidate pages using the SIFT features.
  • Verify each candidate with RANSAC under a similarity transform, requiring scale 0.7–1.4 and skew ≤12°. Determine the required quarter turn from the transform. Assign rescans to pages one‑to‑one, preventing conflicts. Classify matches as Clear if they have sufficient consistent features, ink agreement, and a margin over the runner‑up; otherwise classify as Check. If OCR is available, adjust scores but do not create matches solely on text. Swap replaced pages in place using pikepdf, keeping untouched pages as original objects. Maintain bookmarks and links that point to replaced pages. Generate a JSON receipt recording SHA‑256 hashes of the original, output, and each rescan, plus evidence for each swap.

证据

On 90 synthetic rescans over ten held‑out seeds, 45 were Clear and none of those was wrong.

来源

A match is Clear only if it has enough consistent features, enough ink agreement after alignment and a big margin over the runner‑up. Otherwise it's Check.

来源

Replaced pages are swapped in place with pikepdf. Untouched pages stay the original objects, and bookmarks and links that point at a replaced page still work.

来源

  • 记录日期: 2026-10-21T03:41:20.059Z