πŸ–ΌοΈ

Blur Detector

Automatically detect and filter out blurry images from a photo collection.

Image ⭐⭐ Intermediate ⏱️ 3 minutes

😫 The Pain Point

After an event shoot, you have 500 photos but 100 are blurry. Reviewing each one to find the bad shots takes hours.

πŸš€ Agentic Solution

An Automatic Blur Detector that scores each image and separates the sharp from the blurry.

Key Features:

  • Laplacian Variance: Mathematical measurement of image sharpness.
  • Adjustable Threshold: Customize what counts as β€œtoo blurry”.
  • Batch Sorting: Automatically move blurry images to a separate folder.

βš”οΈ Phase 1: Commander (Quick Fix)

For quick sorting.

Prompt:

β€œI have a folder event_photos with mixed quality images. Write a Python script using OpenCV to:

  1. Blur Detection: Calculate Laplacian variance for each image.
  2. Threshold: Images with variance < 100 are considered blurry (adjustable).
  3. Sort: Move blurry images to blurry/ folder, keep sharp in sharp/.
  4. Report: Print each image with its blur score.

Handle read errors gracefully. Print summary at end.”

Result: Only sharp photos remain for editing.

πŸ—οΈ Phase 2: Architect (Permanent Tool)

For Photographers.

Engineering Prompt:

**Role:** Python Tool Developer
**Task:** Create a "Photo Quality Sorter".

**Requirements:**
1.  **GUI:**
    *   Select folder.
    *   Threshold slider with preview.
    *   Show blur score distribution chart.
    *   Preview borderline images.
    *   Move or copy options.
    *   Progress bar.

2.  **Logic:**
    *   Laplacian variance calculation.
    *   Convert to grayscale first.
    *   Handle various image formats.

3.  **Deliverables:**
    *   `blur_detector.py`
    *   `run.bat`, `run.sh`
    *   `requirements.txt`

🧠 Prompt Decoding

  • Laplacian Variance: A sharp image has high variation in the Laplacian (edges are clear). A blurry image has low variance (edges are mushy).

πŸ› οΈ Instructions

  1. Install: pip install opencv-python
  2. Copy Prompt β†’ Run.
  3. Adjust threshold based on your quality standards.

Related Workflows

Explore other categories

πŸ“¬

Get Started with Agentic Working

Subscribe to receive updates from AgenticWorking.io

πŸ“– Free eBook Guide πŸ“¦ 7 Ready-to-use Scripts πŸ”” Weekly Tips

No spam, unsubscribe anytime. Join 1,000+ subscribers.