Optimize WhitePaperTransform DoG computation and add CLAHE-based fast algorithm#567
Draft
Optimize WhitePaperTransform DoG computation and add CLAHE-based fast algorithm#567
Conversation
…formance Co-authored-by: farfromrefug <655344+farfromrefug@users.noreply.github.com>
Co-authored-by: farfromrefug <655344+farfromrefug@users.noreply.github.com>
…tation Co-authored-by: farfromrefug <655344+farfromrefug@users.noreply.github.com>
Co-authored-by: farfromrefug <655344+farfromrefug@users.noreply.github.com>
Co-authored-by: farfromrefug <655344+farfromrefug@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Improve performance of OpenCV algorithms for document enhancement
Optimize document processing algorithms: 4-5x performance improvement
Feb 14, 2026
Copilot stopped work on behalf of
farfromrefug due to an error
February 14, 2026 15:12
Co-authored-by: farfromrefug <655344+farfromrefug@users.noreply.github.com>
Co-authored-by: farfromrefug <655344+farfromrefug@users.noreply.github.com>
Co-authored-by: farfromrefug <655344+farfromrefug@users.noreply.github.com>
Co-authored-by: farfromrefug <655344+farfromrefug@users.noreply.github.com>
Copilot
AI
changed the title
Optimize document processing algorithms: 4-5x performance improvement
Optimize document transforms and fix book gutter detection
Feb 14, 2026
…ation' into copilot/optimize-color-simplification
Copilot stopped work on behalf of
farfromrefug due to an error
March 14, 2026 14:12
Co-authored-by: farfromrefug <655344+farfromrefug@users.noreply.github.com>
Copilot
AI
changed the title
Optimize document transforms and fix book gutter detection
Revert DoG optimization - kernel normalization critical for text readability
Mar 14, 2026
Co-authored-by: farfromrefug <655344+farfromrefug@users.noreply.github.com>
Co-authored-by: farfromrefug <655344+farfromrefug@users.noreply.github.com>
Copilot
AI
changed the title
Revert DoG optimization - kernel normalization critical for text readability
Optimize WhitePaperTransform DoG computation and add CLAHE-based fast algorithm
Mar 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
WhitePaperTransform's DoG kernel computation consumed 81% of processing time. Need faster alternatives without sacrificing quality.
Changes
DoG Kernel Optimization (~1.3x speedup)
.at<>()indexingv*vin outer loopconstMaintains quality-critical kernel normalization with separate pos/neg scaling.
New Fast Algorithm:
whiteboardEnhanceFast()(5-10x speedup)Alternative algorithm using CLAHE for documents with good lighting:
Available as
"whitepaperfast"transform with optional params:"whitepaperfast_{clipLimit}_{tileGridSize}"Performance
Files
cpp/src/WhitePaperTransform.cpp- DoG optimization + fast algorithmcpp/src/WhitePaperTransform2.cpp- DoG optimizationcpp/src/include/WhitePaperTransform.h- New function declarationcpp/src/DocumentDetector.cpp- Transform handler for "whitepaperfast"✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.