Introducing The Sweep: OX’s New Live Security Research Series
Register Now
Breaking: The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Read the Report
Are you exposed? Connect your apps in minutes.
Scan your apps free

doc-preproc

Latest version: v0.1.0

Overview

Last scanned
27 Nov 2026
Published
27 Nov 2026
PyPI package Publisher: funaharakoju
1 Versions

Scan summary

doc-preproc was last scanned on 27 Nov 2026 at version 0.1.0. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: First and only release on 27 Nov 2026.
  • Findings: No rules fired in version 0.1.0.

Versions

1 version published
Versions and the rules that fired in each
VersionPublishedStatus
0.1.0 LATEST 27 Nov 2026 No rules fired

No rules fired in 0.1.0

Findings

Findings for v0.1.0. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.

The score describes 0.1.0; other versions have their own rules, not their own score.

README

The publisher’s own README, as collected from the registry.

doc-preproc

Lightweight, zero-dependency, non-destructive document image quality diagnosis, adaptive preprocessing, and exact 2D coordinate mapping for Python (>=3.10).

Design Principles

  • Pure Python core, zero required runtime dependencies: Operates on a lightweight GrayImage 2D grid (0..255) with seamless duck-typed support for 2D grayscale or 3D RGB numpy arrays when passed in.
  • Non-destructive by default: Never mutates input images and never applies destructive hard binarization.
  • No-op fast path: Clean images with negligible skew, healthy contrast, and even lighting incur zero pixel transforms (is_noop=True, identity AffineTransform2D).
  • Exact reversible geometry: Every geometric transform returns an exact 2x3 AffineTransform2D with forward(x, y) and inverse(x', y') mapping between original and preprocessed coordinates.
  • Strict safety boundary: Performs deterministic signal processing only—no OCR inference, no generative super-resolution/image synthesis, and no network calls.

Installation

Install in editable mode from a local checkout:

pip install -e .

Quick Start

from doc_preproc import GrayImage, compute_crop_plan, diagnose, preprocess

# Construct from nested lists (or pass a 2D/3D numpy array directly)
image = GrayImage.filled(120, 80, value=250.0)

# 1. Inspect image quality
report = diagnose(image)
print(report.skew_angle_deg, report.blur_score, report.contrast_score)

# 2. Run adaptive, non-destructive preprocessing
result = preprocess(image, profile="receipt")
print(result.is_noop, result.applied_transforms)

# Map a point from preprocessed coordinates back to original image coordinates
orig_x, orig_y = result.transform.inverse(50.0, 30.0)

# 3. Compute an optimal local re-read crop plan with exact coordinate transform
plan = compute_crop_plan(
    bbox=(10.0, 20.0, 90.0, 45.0),
    image_size=(image.width, image.height),
    estimated_char_height_px=14.0,
    target_char_height_px=28.0,
)
print(plan.scale_factor, plan.output_size)

Public API

  • GrayImage: Row-major 2D grayscale container with from_nested, from_any, to_nested, copy, and bilinear sampling.
  • AffineTransform2D: Composable 2x3 affine matrix (identity, translation, scale, rotation, forward, inverse, invert, compose).
  • diagnose(image, config=None) -> QualityReport: Computes skew_angle_deg, blur_score, contrast_score, illumination_unevenness, estimated_char_height_px, aspect_ratio, and advisory unreadable_flag / unreadable_reasons.
  • preprocess(image, profile="receipt"|"invoice"|"crop", config=None) -> PreprocessResult: Runs diagnosis and applies only needed transforms (deskew, illumination_normalization, contrast_normalization), returning (image, report, transform, applied_transforms, is_noop).
  • compute_crop_plan(...) -> CropPlan & apply_crop_plan(image, plan) -> GrayImage: Computes padded crop bounds, optimal scale factor, and exact coordinate transform for local re-read regions.

Running Tests

PYTHONPATH=src python -m unittest discover -s tests -v

OX Radar and Response Center

Find threats in your stack.

OX Radar can check high-priority threats, like critical package CVEs, against your context.

Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.

Where it’s listed

The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).

  • pypi-releases doc-preproc

References

The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.

Powered by Read the latest findings

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

Microsoft's Official agent framework Hijacked
AI & VibeSec

BREAKING: Hijacked Releases of Microsoft’s Official agent-framework Steals Azure and CI Credentials

The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Vulnerability Insights

The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?

Copy of Template Design OX Blog (2)
Research

NGINX2Root: Five Critical NGINX Flaws Expose Web Servers to Remote Code Execution

Frame 2085668439 (1)
Group 1261154229