object_counter

Count object instances in images using template matching with OpenCV.

4|Updated Feb 22, 2026
One-click install
npx skills add https://github.com/GeneralReasoning/env-skillsbench --skill object-counter-generalreasoning
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: object_counter
Source: https://github.com/GeneralReasoning/env-skillsbench/tree/main/mario-coin-counting/environment/skills/object_counter
Command: npx skills add https://github.com/GeneralReasoning/env-skillsbench --skill object-counter-generalreasoning

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

Counting occurrences of a visual object in an image for automated analysis and quality control tasks.

Core Features & Use Cases

  • Template-based object counting using thresholding and non-maximum suppression to identify multiple instances.
  • Quick analyses for quality control, inventory checks, and scene understanding in datasets.
  • Scalable to single images or batches with simple command-line usage.

Quick Start

Run the object counting script on your input image and object template to get the total number of detected objects.

Frequently Asked Questions about object_counter

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

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

Count multiple object instances in an image using OpenCV template matching with a threshold and dedup_min_dist parameter for non-maximum suppression, returning the total detected object count.

What is template matching with non-maximum suppression for object counting?

Template matching for object counting detects visual object instances by applying a threshold to match scores and using a dedup_min_dist parameter to perform non-maximum suppression, eliminating overlapping duplicate detections.

Can I use this OpenCV template matching approach for quality inspection and inventory counting?

Yes, OpenCV template matching supports automated quality inspection, inventory counting, and scene analysis by detecting and counting multiple visual object instances within a single input image.

Do I need Python and OpenCV to count objects in images with template matching?

Yes, counting objects in images with template matching requires Python with opencv-python and numpy dependencies installed to execute the script and process the visual data.

What are the limitations of using template matching for object counting in images?

Template matching for object counting relies on visual similarity, requiring a specific object template and threshold tuning, and may struggle with significant scale, rotation, or lighting variations in the input image.