davidcastagnetoa/skills

unsharp_mask_sharpening

Aumentar nitidez del texto del documento con Unsharp Mask para maximizar la precisión del OCR

First seen Mar 6, 2026

Installation

$ npx skills add davidcastagnetoa/skills --skill unsharp_mask_sharpening

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from davidcastagnetoa/skills · top by installs.

npx skills add davidcastagnetoa/skills

Browse all from davidcastagnetoa/skills

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Repository health

Stars 1
Default branch main
Open issues 0
Status Active

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 1,412 B
  • docs SUMMARY.md 125 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 5 installs

SKILL.md

unsharpmasksharpening

Unsharp Mask aumenta el contraste local en los bordes del texto, haciendo los caracteres más nítidos para el OCR. Es el estándar en pre-procesamiento de documentos.

When to use

Aplicar como último paso de mejora de imagen, justo antes de pasar al ocr_agent.

Instructions

  1. Implementar con NumPy + OpenCV:

``python import cv2, numpy as np def unsharp_mask(img, sigma=1.0, strength=1.5): blurred = cv2.GaussianBlur(img, (0, 0), sigma) sharpened = cv2.addWeighted(img, 1.0 + strength, blurred, -strength, 0) return np.clip(sharpened, 0, 255).astype(np.uint8) ``

  1. Parámetros recomendados para documentos: sigma=1.0, strength=1.5.
  2. Aplicar sobre imagen en escala de grises para OCR:

``python gray = cv2.cvtColor(denoiseddoc, cv2.COLORBGR2GRAY) sharpened = unsharp_mask(gray, sigma=1.0, strength=1.5) ``

  1. Opcional: binarización Otsu después para texto puro blanco/negro:

, binary = cv2.threshold(sharpened, 0, 255, cv2.THRESHBINARY + cv2.THRESH_OTSU)

Notes

  • Demasiado sharpening (strength > 2.5) introduce halos que empeoran el OCR.
  • Para texto muy pequeño (campos MRZ), aumentar strength=2.0.