object_counter

Count target object occurrences in images using OpenCV template matching.

Updated Jan 15, 2026
One-click install
npx skills add https://github.com/KaiserWhoLearns/skillsbench --skill object-counter
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: object_counter
Source: https://github.com/KaiserWhoLearns/skillsbench/tree/main/tasks/mario-coin-counting/environment/skills/object_counter
Command: npx skills add https://github.com/KaiserWhoLearns/skillsbench --skill object-counter

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires opencv-python, numpy, and includes scripts (resource) components.

What problem does it solve?

Count the occurrences of a target object in an image using a simple template-matching CV approach, reducing manual counting effort.

Core Features & Use Cases

  • Template-based counting detects and counts occurrences of a specified object image within a larger image using a threshold.
  • Simple integration provides a Python script that accepts input and object images, threshold, and a dedup distance.
  • Use cases include quality control and inventory checks in manufacturing, retail image analysis, or any scenario requiring fast object tallies from scenes.

Quick Start

Count objects present in an image by matching a template image using the provided Python script.

Frequently Asked Questions about object_counter

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I count occurrences of an object in an image using OpenCV?

You can count occurrences of an object in an image using OpenCV template matching. This approach matches a target template image against a larger scene to detect and tally specific items automatically.

What's the best way to automate object counting for manufacturing quality control?

Automating object counting for manufacturing quality control is best handled by OpenCV template matching. It provides a fast, scriptable method to detect and tally items in inventory or QA workflows.

How does template matching dedup distance prevent duplicate object detections?

Template matching dedup distance prevents duplicate object detections by setting a minimum separation threshold between matched locations. This dedup_min_dist parameter ensures overlapping matches are merged into a single accurate count.

Can I use Python and NumPy to detect and count objects in retail images?

Yes, you can use Python and NumPy to detect and count objects in retail images. This Skill uses OpenCV and NumPy to process input images and apply template matching for fast object tallies.

Why does my template matching count duplicate objects in the same image?

Template matching counts duplicate objects when the dedup_min_dist value is too low or the matching threshold is too lenient. Adjusting these two parameters controls detection sensitivity and filters out overlapping duplicate matches.