Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
davidcastagnetoa avatar

Laplacian Variance

  • 9 installs
  • 1 repo stars
  • Updated March 10, 2026
  • davidcastagnetoa/skills

Measures image sharpness with the variance of the Laplacian in OpenCV to reject blurry captures before they reach ML models.

About

Uses the OpenCV Laplacian variance to score image sharpness and reject blurry frames as a quality gate before ML processing. Use it to filter low-quality captures ahead of liveness or document analysis.

  • Simple cv2.Laplacian variance check with a tunable blur threshold
  • Records the sharpness score in the audit event

Laplacian Variance by the numbers

  • 9 all-time installs (skills.sh)
  • Ranked #1,569 of 2,064 Data Science & ML skills by installs in the Skillselion catalog
  • Data as of Jul 29, 2026 (Skillselion catalog sync)
npx skills add https://github.com/davidcastagnetoa/skills --skill laplacian_variance

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs9
repo stars1
Last updatedMarch 10, 2026
Repositorydavidcastagnetoa/skills

What it does

Measures image sharpness with the variance of the Laplacian in OpenCV to reject blurry captures before they reach ML models.

Files

SKILL.mdMarkdownGitHub ↗

laplacian_variance

La varianza del Laplaciano mide la nitidez de una imagen. Una imagen borrosa tiene varianza baja. Usar como filtro de calidad previo a los modelos ML.

When to use

Aplicar a cada frame capturado antes de enviarlo al liveness_agent o document_processor_agent.

Instructions

1. pip install opencv-python-headless 2. gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) 3. laplacian = cv2.Laplacian(gray, cv2.CV_64F) 4. variance = laplacian.var() 5. Umbral: BLUR_THRESHOLD = 100.0. Si variance < threshold: rechazar. 6. Incluir el score de nitidez en el evento de auditoría.

Notes

  • El umbral depende de la resolución; calibrar con imágenes de referencia.
  • Complementar con histogram_analysis para detección de calidad completa.

Related skills

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.